diff --git "a/web/dist-embed/index.html" "b/web/dist-embed/index.html" --- "a/web/dist-embed/index.html" +++ "b/web/dist-embed/index.html" @@ -9,9 +9,9 @@ `),a=r.stack.split(` `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=` `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{oe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ae(e):``}function ce(e){switch(e.tag){case 5:return ae(e.type);case 16:return ae(`Lazy`);case 13:return ae(`Suspense`);case 19:return ae(`SuspenseList`);case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return``}}function le(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case ee:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case N:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}function ue(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return le(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function de(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function fe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function pe(e){var t=fe(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function me(e){e._valueTracker||=pe(e)}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=fe(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ge(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function _e(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ve(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=de(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ye(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function be(e,t){ye(e,t);var n=de(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Se(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Se(e,t.type,de(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xe(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Se(e,t,n){(t!==`number`||ge(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ce=Array.isArray;function we(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=je.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ne(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fe=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Pe).forEach(function(e){Fe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pe[t]=Pe[e]})});function Ie(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Pe.hasOwnProperty(e)&&Pe[e]?(``+t).trim():t+`px`}function Le(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ie(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Re=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ze(e,t){if(t){if(Re[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Be(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(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`:return!1;default:return!0}}var Ve=null;function He(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ue=null,We=null,Ge=null;function Ke(e){if(e=Ui(e)){if(typeof Ue!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Gi(t),Ue(e.stateNode,e.type,t))}}function qe(e){We?Ge?Ge.push(e):Ge=[e]:We=e}function Je(){if(We){var e=We,t=Ge;if(Ge=We=null,Ke(e),t)for(e=0;e>>=0,e===0?32:31-(At(e)/jt|0)|0}var Nt=64,Pt=4194304;function Ft(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function It(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Ft(a))):r=Ft(s)}else o=n&~i,o===0?a!==0&&(r=Ft(a)):r=Ft(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ht(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=n}function Ut(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=nr),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var lr=!1;function ur(e,t){switch(e){case`compositionend`:return cr(t);case`keypress`:return t.which===32?(or=!0,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function dr(e,t){if(lr)return e===`compositionend`||!tr&&sr(e,t)?(e=Tn(),wn=Cn=Sn=null,lr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Nr(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(){for(var e=window,t=ge();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ge(e.document)}return t}function Lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Rr(e){var t=Ir(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Fr(n.ownerDocument.documentElement,n)){if(r!==null&&Lr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Pr(n,a);var o=Pr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Br=null,Vr=null,Hr=null,Ur=!1;function Wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ur||Br==null||Br!==ge(r)||(r=Br,`selectionStart`in r&&Lr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hr&&Mr(Hr,r)||(Hr=r,r=gi(Vr,`onSelect`),0qi||(e.current=Ki[qi],Ki[qi]=null,qi--)}function Xi(e,t){qi++,Ki[qi]=e.current,e.current=t}var Zi={},Qi=Ji(Zi),$i=Ji(!1),ea=Zi;function ta(e,t){var n=e.type.contextTypes;if(!n)return Zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function na(e){return e=e.childContextTypes,e!=null}function ra(){Yi($i),Yi(Qi)}function ia(e,t,n){if(Qi.current!==Zi)throw Error(r(168));Xi(Qi,t),Xi($i,n)}function aa(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ue(e)||`Unknown`,a));return F({},n,i)}function oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zi,ea=Qi.current,Xi(Qi,e),Xi($i,$i.current),!0}function sa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=aa(e,t,ea),i.__reactInternalMemoizedMergedChildContext=e,Yi($i),Yi(Qi),Xi(Qi,e)):Yi($i),Xi($i,n)}var ca=null,la=!1,ua=!1;function da(e){ca===null?ca=[e]:ca.push(e)}function eee(e){la=!0,da(e)}function fa(){if(!ua&&ca!==null){ua=!0;var e=0,t=Gt;try{var n=ca;for(Gt=1;e>=o,i-=o,ba=1<<32-kt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Oa&&Sa(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oa&&Sa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oa&&Sa(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Oa&&Sa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===te&&Ha(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ba(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=cu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=su(i.type,i.key,i.props,null,e.mode,o),o.ref=Ba(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=du(i,e.mode,o),r.return=e,e=r}return s(e);case te:return l=i._init,_(e,r,l(i._payload),o)}if(Ce(i))return h(e,r,i,o);if(re(i))return g(e,r,i,o);Va(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=uu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Wa=Ua(!0),Ga=Ua(!1),Ka=Ji(null),qa=null,Ja=null,Ya=null;function Xa(){Ya=Ja=qa=null}function Za(e){var t=Ka.current;Yi(Ka),e._currentValue=t}function Qa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $a(e,t){qa=e,Ya=Ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Hs=!0),e.firstContext=null)}function eo(e){var t=e._currentValue;if(Ya!==e)if(e={context:e,memoizedValue:t,next:null},Ja===null){if(qa===null)throw Error(r(308));Ja=e,qa.dependencies={lanes:0,firstContext:e}}else Ja=Ja.next=e;return t}var to=null;function no(e){to===null?to=[e]:to.push(e)}function ro(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,no(t)):(n.next=i.next,i.next=n),t.interleaved=n,io(e,r)}function io(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function so(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,io(e,n)}return i=r.interleaved,i===null?(t.next=t,no(r)):(t.next=i.next,i.next=t),r.interleaved=t,io(e,n)}function uo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wt(e,n)}}function fo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function po(e,t,n,r){var i=e.updateQueue;ao=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=F({},d,f);break a;case 2:ao=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);al|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ko.transition;ko.transition={};try{e(!1),t()}finally{Gt=n,ko.transition=r}}function hs(){return Ho().memoizedState}function gs(e,t,n){var r=wl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},vs(e))ys(t,n);else if(n=ro(e,t,n,r),n!==null){var i=Cl();Tl(n,e,r,i),bs(n,t,r)}}function _s(e,t,n){var r=wl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(vs(e))ys(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,jr(s,o)){var c=t.interleaved;c===null?(i.next=i,no(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=ro(e,t,i,r),n!==null&&(i=Cl(),Tl(n,e,r,i),bs(n,t,r))}}function vs(e){var t=e.alternate;return e===jo||t!==null&&t===jo}function ys(e,t){Fo=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wt(e,n)}}var xs={readContext:eo,useCallback:Lo,useContext:Lo,useEffect:Lo,useImperativeHandle:Lo,useInsertionEffect:Lo,useLayoutEffect:Lo,useMemo:Lo,useReducer:Lo,useRef:Lo,useState:Lo,useDebugValue:Lo,useDeferredValue:Lo,useTransition:Lo,useMutableSource:Lo,useSyncExternalStore:Lo,useId:Lo,unstable_isNewReconciler:!1},Ss={readContext:eo,useCallback:function(e,t){return Vo().memoizedState=[e,t===void 0?null:t],e},useContext:eo,useEffect:is,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),ns(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){return ns(4,2,e,t)},useMemo:function(e,t){var n=Vo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=gs.bind(null,jo,e),[r.memoizedState,e]},useRef:function(e){var t=Vo();return e={current:e},t.memoizedState=e},useState:$o,useDebugValue:us,useDeferredValue:function(e){return Vo().memoizedState=e},useTransition:function(){var e=$o(!1),t=e[0];return e=ms.bind(null,e[1]),Vo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=jo,a=Vo();if(Oa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Qc===null)throw Error(r(349));Ao&30||Jo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Xo.bind(null,i,o,e),[e]),i.flags|=2048,es(9,Yo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Vo(),t=Qc.identifierPrefix;if(Oa){var n=xa,r=ba;n=(r&~(1<<32-kt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Io++,0qi||(e.current=Ki[qi],Ki[qi]=null,qi--)}function Xi(e,t){qi++,Ki[qi]=e.current,e.current=t}var Zi={},Qi=Ji(Zi),$i=Ji(!1),ea=Zi;function ta(e,t){var n=e.type.contextTypes;if(!n)return Zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function na(e){return e=e.childContextTypes,e!=null}function ra(){Yi($i),Yi(Qi)}function ia(e,t,n){if(Qi.current!==Zi)throw Error(r(168));Xi(Qi,t),Xi($i,n)}function aa(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ue(e)||`Unknown`,a));return F({},n,i)}function oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zi,ea=Qi.current,Xi(Qi,e),Xi($i,$i.current),!0}function sa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=aa(e,t,ea),i.__reactInternalMemoizedMergedChildContext=e,Yi($i),Yi(Qi),Xi(Qi,e)):Yi($i),Xi($i,n)}var ca=null,la=!1,ua=!1;function da(e){ca===null?ca=[e]:ca.push(e)}function fa(e){la=!0,da(e)}function pa(){if(!ua&&ca!==null){ua=!0;var e=0,t=Gt;try{var n=ca;for(Gt=1;e>=o,i-=o,xa=1<<32-kt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),ka&&Ca(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ka&&Ca(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ka&&Ca(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ka&&Ca(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===te&&Ua(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Va(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=su(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=ou(i.type,i.key,i.props,null,e.mode,o),o.ref=Va(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=uu(i,e.mode,o),r.return=e,e=r}return s(e);case te:return l=i._init,_(e,r,l(i._payload),o)}if(Ce(i))return h(e,r,i,o);if(re(i))return g(e,r,i,o);Ha(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=lu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ga=Wa(!0),Ka=Wa(!1),qa=Ji(null),Ja=null,Ya=null,Xa=null;function Za(){Xa=Ya=Ja=null}function Qa(e){var t=qa.current;Yi(qa),e._currentValue=t}function $a(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function eo(e,t){Ja=e,Xa=Ya=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ws=!0),e.firstContext=null)}function to(e){var t=e._currentValue;if(Xa!==e)if(e={context:e,memoizedValue:t,next:null},Ya===null){if(Ja===null)throw Error(r(308));Ya=e,Ja.dependencies={lanes:0,firstContext:e}}else Ya=Ya.next=e;return t}var no=null;function ro(e){no===null?no=[e]:no.push(e)}function io(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ro(t)):(n.next=i.next,i.next=n),t.interleaved=n,ao(e,r)}function ao(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var oo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function co(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function lo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ao(e,n)}return i=r.interleaved,i===null?(t.next=t,ro(r)):(t.next=i.next,i.next=t),r.interleaved=t,ao(e,n)}function fo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wt(e,n)}}function po(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function mo(e,t,n,r){var i=e.updateQueue;oo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=F({},d,f);break a;case 2:oo=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);al|=o,e.lanes=o,e.memoizedState=d}}function ho(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ao.transition;Ao.transition={};try{e(!1),t()}finally{Gt=n,Ao.transition=r}}function _s(){return Wo().memoizedState}function vs(e,t,n){var r=wl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bs(e))xs(t,n);else if(n=io(e,t,n,r),n!==null){var i=Cl();Tl(n,e,r,i),Ss(n,t,r)}}function ys(e,t,n){var r=wl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bs(e))xs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,jr(s,o)){var c=t.interleaved;c===null?(i.next=i,ro(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=io(e,t,i,r),n!==null&&(i=Cl(),Tl(n,e,r,i),Ss(n,t,r))}}function bs(e){var t=e.alternate;return e===Mo||t!==null&&t===Mo}function xs(e,t){Io=Fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ss(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wt(e,n)}}var Cs={readContext:to,useCallback:zo,useContext:zo,useEffect:zo,useImperativeHandle:zo,useInsertionEffect:zo,useLayoutEffect:zo,useMemo:zo,useReducer:zo,useRef:zo,useState:zo,useDebugValue:zo,useDeferredValue:zo,useTransition:zo,useMutableSource:zo,useSyncExternalStore:zo,useId:zo,unstable_isNewReconciler:!1},ws={readContext:to,useCallback:function(e,t){return Uo().memoizedState=[e,t===void 0?null:t],e},useContext:to,useEffect:os,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),is(4194308,4,us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){return is(4,2,e,t)},useMemo:function(e,t){var n=Uo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Uo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=vs.bind(null,Mo,e),[r.memoizedState,e]},useRef:function(e){var t=Uo();return e={current:e},t.memoizedState=e},useState:ts,useDebugValue:fs,useDeferredValue:function(e){return Uo().memoizedState=e},useTransition:function(){var e=ts(!1),t=e[0];return e=gs.bind(null,e[1]),Uo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Mo,a=Uo();if(ka){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Qc===null)throw Error(r(349));jo&30||Xo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(Qo.bind(null,i,o,e),[e]),i.flags|=2048,ns(9,Zo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Uo(),t=Qc.identifierPrefix;if(ka){var n=Sa,r=xa;n=(r&~(1<<32-kt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Lo++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ii]=t,e[Li]=i,dc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Be(n,i),n){case`dialog`:li(`cancel`,e),li(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:li(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;odl&&(t.flags|=128,i=!0,mc(s,!1),t.lanes=4194304)}else{if(!i)if(e=To(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Oa)return hc(t),null}else 2*yt()-s.renderingStartTime>dl&&n!==1073741824&&(t.flags|=128,i=!0,mc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(hc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=yt(),t.sibling=null,n=wo.current,Xi(wo,i?n&1|2:n&1),t);case 22:case 23:return Fl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?tl&1073741824&&(hc(t),t.subtreeFlags&6&&(t.flags|=8192)):hc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function _c(e,t){switch(Ta(t),t.tag){case 1:return na(t.type)&&ra(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),Yi($i),Yi(Qi),Do(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Co(t),null;case 13:if(Yi(wo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yi(wo),null;case 4:return xo(),null;case 10:return Za(t.type._context),null;case 22:case 23:return Fl(),null;case 24:return null;default:return null}}var vc=!1,yc=!1,bc=typeof WeakSet==`function`?WeakSet:Set,xc=null;function Sc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Yl(e,t,n)}else n.current=null}function Cc(e,t,n){try{n()}catch(n){Yl(e,t,n)}}var wc=!1;function Tc(e,t){if(wi=hn,e=Ir(),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ti={focusedElem:e,selectionRange:n},hn=!1,xc=t;xc!==null;)if(t=xc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,xc=e;else for(;xc!==null;){t=xc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ts(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Yl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,xc=e;break}xc=t.return}return h=wc,wc=!1,h}function Ec(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Cc(t,n,a)}i=i.next}while(i!==r)}}function Dc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Oc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function kc(e){var t=e.alternate;t!==null&&(e.alternate=null,kc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ii],delete t[Li],delete t[zi],delete t[Bi],delete t[Vi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ac(e){return e.tag===5||e.tag===3||e.tag===4}function jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ac(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ci));else if(r!==4&&(e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}function Nc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Nc(e,t,n),e=e.sibling;e!==null;)Nc(e,t,n),e=e.sibling}var Pc=null,Fc=!1;function Ic(e,t,n){for(n=n.child;n!==null;)Lc(e,t,n),n=n.sibling}function Lc(e,t,n){if(Dt&&typeof Dt.onCommitFiberUnmount==`function`)try{Dt.onCommitFiberUnmount(Et,n)}catch{}switch(n.tag){case 5:yc||Sc(n,t);case 6:var r=Pc,i=Fc;Pc=null,Ic(e,t,n),Pc=r,Fc=i,Pc!==null&&(Fc?(e=Pc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pc.removeChild(n.stateNode));break;case 18:Pc!==null&&(Fc?(e=Pc,n=n.stateNode,e.nodeType===8?Mi(e.parentNode,n):e.nodeType===1&&Mi(e,n),z(e)):Mi(Pc,n.stateNode));break;case 4:r=Pc,i=Fc,Pc=n.stateNode.containerInfo,Fc=!0,Ic(e,t,n),Pc=r,Fc=i;break;case 0:case 11:case 14:case 15:if(!yc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Cc(n,t,o),i=i.next}while(i!==r)}Ic(e,t,n);break;case 1:if(!yc&&(Sc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Yl(n,t,e)}Ic(e,t,n);break;case 21:Ic(e,t,n);break;case 22:n.mode&1?(yc=(r=yc)||n.memoizedState!==null,Ic(e,t,n),yc=r):Ic(e,t,n);break;default:Ic(e,t,n)}}function Rc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bc),t.forEach(function(t){var r=$l.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function zc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=yt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qc(i/1960))-i,10e?16:e,_l===null)var i=!1;else{if(e=_l,_l=null,vl=0,Zc&6)throw Error(r(331));var a=Zc;for(Zc|=4,xc=e.current;xc!==null;){var o=xc,s=o.child;if(xc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lyt()-ul?Il(e,0):sl|=n),El(e,t)}function Zl(e,t){t===0&&(e.mode&1?(t=Pt,Pt<<=1,!(Pt&130023424)&&(Pt=4194304)):t=1);var n=Cl();e=io(e,t),e!==null&&(Ht(e,t,n),El(e,n))}function Ql(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zl(e,n)}function $l(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Zl(e,n)}var eu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$i.current)Hs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Hs=!1,nee(e,t,n);Hs=!!(e.flags&131072)}else Hs=!1,Oa&&t.flags&1048576&&Ca(t,ga,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;lc(e,t),e=t.pendingProps;var a=ta(t,Qi.current);$a(t,n),a=zo(null,t,i,e,a,n);var o=Bo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,na(i)?(o=!0,oa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,oo(t),a.updater=Ds,t.stateNode=a,a._reactInternals=t,js(t,i,e,n),t=Zs(null,t,i,!0,o,n)):(t.tag=0,Oa&&o&&wa(t),Us(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(lc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=au(i),e=Ts(i,e),a){case 0:t=Ys(null,t,i,e,n);break a;case 1:t=Xs(null,t,i,e,n);break a;case 11:t=Ws(null,t,i,e,n);break a;case 14:t=Gs(null,t,i,Ts(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ts(i,a),Ys(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ts(i,a),Xs(e,t,i,a,n);case 3:a:{if(Qs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,so(e,t),po(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ms(Error(r(423)),t),t=$s(e,t,i,n,a);break a}else if(i!==a){a=Ms(Error(r(424)),t),t=$s(e,t,i,n,a);break a}else for(Da=Ni(t.stateNode.containerInfo.firstChild),Ea=t,Oa=!0,ka=null,n=Ga(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(La(),i===a){t=uc(e,t,n);break a}Us(e,t,i,n)}t=t.child}return t;case 5:return So(t),e===null&&Na(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ei(i,a)?s=null:o!==null&&Ei(i,o)&&(t.flags|=32),Js(e,t),Us(e,t,s,n),t.child;case 6:return e===null&&Na(t),null;case 13:return nc(e,t,n);case 4:return bo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Wa(t,null,i,n):Us(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ts(i,a),Ws(e,t,i,a,n);case 7:return Us(e,t,t.pendingProps,n),t.child;case 8:return Us(e,t,t.pendingProps.children,n),t.child;case 12:return Us(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Xi(Ka,i._currentValue),i._currentValue=s,o!==null)if(jr(o.value,s)){if(o.children===a.children&&!$i.current){t=uc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=co(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Qa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Qa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Us(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,$a(t,n),a=eo(a),i=i(a),t.flags|=1,Us(e,t,i,n),t.child;case 14:return i=t.type,a=Ts(i,t.pendingProps),a=Ts(i.type,a),Gs(e,t,i,a,n);case 15:return Ks(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ts(i,a),lc(e,t),t.tag=1,na(i)?(e=!0,oa(t)):e=!1,$a(t,n),ks(t,i,a),js(t,i,a,n),Zs(null,t,i,!0,e,n);case 19:return cc(e,t,n);case 22:return qs(e,t,n)}throw Error(r(156,t.tag))};function tu(e,t){return ht(e,t)}function nu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ru(e,t,n,r){return new nu(e,t,n,r)}function iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function au(e){if(typeof e==`function`)return+!!iu(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===N)return 14}return 2}function ou(e,t){var n=e.alternate;return n===null?(n=ru(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function su(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)iu(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return cu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=ru(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=ru(13,n,t,a),e.elementType=M,e.lanes=o,e;case ee:return e=ru(19,n,t,a),e.elementType=ee,e.lanes=o,e;case ne:return lu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case N:s=14;break a;case te:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=ru(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function cu(e,t,n,r){return e=ru(7,e,r,t),e.lanes=n,e}function lu(e,t,n,r){return e=ru(22,e,r,t),e.elementType=ne,e.lanes=n,e.stateNode={isHidden:!1},e}function uu(e,t,n){return e=ru(6,e,null,t),e.lanes=n,e}function du(e,t,n){return t=ru(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vt(0),this.expirationTimes=Vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function pu(e,t,n,r,i,a,o,s,c){return e=new fu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=ru(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oo(a),e}function mu(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=s((e=>{var t=g();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),v=u(f(),1),y=_();function b(e=`This should not happen`){throw Error(e)}function x(e,t=`Assertion failed`){if(!e)return b(t)}function S(e,t){return b(t??`Hell froze over`)}function C(e,t){try{return e()}catch{return t}}function w(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&w(e[r],t[r]););return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(T.call(e,n)&&++r&&!T.call(t,n)||!(n in t)||!w(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var T,E=o((()=>{T=Object.prototype.hasOwnProperty})),D=s(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e,t){return e!=null&&n.call(e,t)}t.exports=r})),O=s(((e,t)=>{t.exports=Array.isArray})),k=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),A=s(((e,t)=>{var n=k(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),j=s(((e,t)=>{t.exports=A().Symbol})),M=s(((e,t)=>{var n=j(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),ee=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),N=s(((e,t)=>{var n=j(),r=M(),i=ee(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),te=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),ne=s(((e,t)=>{var n=N(),r=te(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),P=s(((e,t)=>{var n=O(),r=ne(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),re=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),F=s(((e,t)=>{var n=N(),r=re(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),ie=s(((e,t)=>{t.exports=A()[`__core-js_shared__`]})),ae=s(((e,t)=>{var n=ie(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),oe=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),se=s(((e,t)=>{var n=F(),r=ae(),i=re(),a=oe(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),ce=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),le=s(((e,t)=>{var n=se(),r=ce();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),ue=s(((e,t)=>{t.exports=le()(Object,`create`)})),de=s(((e,t)=>{var n=ue();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),fe=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),pe=s(((e,t)=>{var n=ue(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),me=s(((e,t)=>{var n=ue(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),he=s(((e,t)=>{var n=ue(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),ge=s(((e,t)=>{var n=de(),r=fe(),i=pe(),a=me(),o=he();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{function n(){this.__data__=[],this.size=0}t.exports=n})),ve=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),ye=s(((e,t)=>{var n=ve();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),be=s(((e,t)=>{var n=ye(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),xe=s(((e,t)=>{var n=ye();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Se=s(((e,t)=>{var n=ye();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Ce=s(((e,t)=>{var n=ye();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),we=s(((e,t)=>{var n=_e(),r=be(),i=xe(),a=Se(),o=Ce();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{t.exports=le()(A(),`Map`)})),Ee=s(((e,t)=>{var n=ge(),r=we(),i=Te();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),De=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Oe=s(((e,t)=>{var n=De();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),ke=s(((e,t)=>{var n=Oe();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),Ae=s(((e,t)=>{var n=Oe();function r(e){return n(this,e).get(e)}t.exports=r})),je=s(((e,t)=>{var n=Oe();function r(e){return n(this,e).has(e)}t.exports=r})),Me=s(((e,t)=>{var n=Oe();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Ne=s(((e,t)=>{var n=Ee(),r=ke(),i=Ae(),a=je(),o=Me();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{var n=Ne(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),Fe=s(((e,t)=>{var n=Pe(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Ie=s(((e,t)=>{var n=Fe(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),Le=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n{var n=j(),r=Le(),i=O(),a=ne(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),ze=s(((e,t)=>{var n=Re();function r(e){return e==null?``:n(e)}t.exports=r})),Be=s(((e,t)=>{var n=O(),r=P(),i=Ie(),a=ze();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Ve=s(((e,t)=>{var n=N(),r=te(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),He=s(((e,t)=>{var n=Ve(),r=te(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Ue=s(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),Ge=s(((e,t)=>{var n=ne(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),Ke=s(((e,t)=>{var n=Be(),r=He(),i=O(),a=Ue(),o=We(),s=Ge();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l{var n=D(),r=Ke();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i}));function Je(e){return`width`in e&&typeof e.width==`number`}async function Ye(e){return typeof e==`object`?e:await e()}function Xe(e){return!(e.kind===I.Loading||e.kind===I.Bubble||e.kind===I.RowID||e.kind===I.Protected||e.kind===I.Drilldown)}function Ze(e){return e.kind===at.Marker||e.kind===at.NewRow}function Qe(e){if(!Xe(e)||e.kind===I.Image)return!1;if(e.kind===I.Text||e.kind===I.Number||e.kind===I.Markdown||e.kind===I.Uri||e.kind===I.Custom||e.kind===I.Boolean)return e.readonly!==!0;S(e,`A cell was passed with an invalid kind`)}function $e(e){return(0,nt.default)(e,`editor`)}function et(e){return!(e.readonly??!1)}function tt(e){if(e.length===0)return[];let t=[...e],n=[];t.sort(function(e,t){return e[0]-t[0]}),n.push([...t[0]]);for(let e of t.slice(1)){let t=n[n.length-1];t[1]{E(),nt=u(qe(),1),(function(e){e.Uri=`uri`,e.Text=`text`,e.Image=`image`,e.RowID=`row-id`,e.Number=`number`,e.Bubble=`bubble`,e.Boolean=`boolean`,e.Loading=`loading`,e.Markdown=`markdown`,e.Drilldown=`drilldown`,e.Protected=`protected`,e.Custom=`custom`})(I||={}),(function(e){e.HeaderRowID=`headerRowID`,e.HeaderCode=`headerCode`,e.HeaderNumber=`headerNumber`,e.HeaderString=`headerString`,e.HeaderBoolean=`headerBoolean`,e.HeaderAudioUri=`headerAudioUri`,e.HeaderVideoUri=`headerVideoUri`,e.HeaderEmoji=`headerEmoji`,e.HeaderImage=`headerImage`,e.HeaderUri=`headerUri`,e.HeaderPhone=`headerPhone`,e.HeaderMarkdown=`headerMarkdown`,e.HeaderDate=`headerDate`,e.HeaderTime=`headerTime`,e.HeaderEmail=`headerEmail`,e.HeaderReference=`headerReference`,e.HeaderIfThenElse=`headerIfThenElse`,e.HeaderSingleValue=`headerSingleValue`,e.HeaderLookup=`headerLookup`,e.HeaderTextTemplate=`headerTextTemplate`,e.HeaderMath=`headerMath`,e.HeaderRollup=`headerRollup`,e.HeaderJoinStrings=`headerJoinStrings`,e.HeaderSplitString=`headerSplitString`,e.HeaderGeoDistance=`headerGeoDistance`,e.HeaderArray=`headerArray`,e.RowOwnerOverlay=`rowOwnerOverlay`,e.ProtectedColumnOverlay=`protectedColumnOverlay`})(rt||={}),(function(e){e.Triangle=`triangle`,e.Dots=`dots`})(it||={}),(function(e){e.NewRow=`new-row`,e.Marker=`marker`})(at||={}),st=class e{items;constructor(e){this.items=e}static empty=()=>ot??=new e([]);static fromSingleSelection=t=>e.empty().add(t);offset(t){if(t===0)return this;let n=this.items.map(e=>[e[0]+t,e[1]+t]);return new e(n)}add(t){let n=typeof t==`number`?[t,t+1]:t,r=tt([...this.items,n]);return new e(r)}remove(t){let n=[...this.items],r=typeof t==`number`?t:t[0],i=typeof t==`number`?t+1:t[1];for(let[e,t]of n.entries()){let[a,o]=t;if(a<=i&&r<=o){let t=[];a=n&&e{})),dt,ft,pt=o((()=>{ut(),dt=/^((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)-.*))$/,ft=lt(function(e){return dt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),mt,ht=o((()=>{mt=function(){let e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(e=>{(e?e.split(` `):[]).forEach(e=>{if(e.startsWith(`atm_`)){let[,n]=e.split(`_`);t[n]=e}else n.push(e)})});let r=[];for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(t[e]);return r.push(...n),r.join(` `)}}));function gt(e,t,n){let r=bt(t,n);if(!e){let e=typeof ft==`function`?{default:ft}:ft;Object.keys(r).forEach(t=>{e.default(t)||delete r[t]})}return r}function _t(e){return t=>{let n=(n,r)=>{let{as:i=e,class:a=``}=n,o=gt(t.propsAsIs===void 0?!(typeof i==`string`&&i.indexOf(`-`)===-1&&!vt(i[0])):t.propsAsIs,n,[`as`,`class`]);o.ref=r,o.className=t.atomic?mt(t.class,o.className||a):mt(o.className||a,t.class);let{vars:s}=t;if(s){let e={};for(let r in s){let i=s[r],a=i[0],o=i[1]||``,c=typeof a==`function`?a(n):a;t.name,e[`--${r}`]=`${c}${o}`}let r=o.style||{},i=Object.keys(r);i.length>0&&i.forEach(t=>{e[t]=r[t]}),o.style=e}return e.__linaria&&e!==i?(o.as=i,v.createElement(e,o)):v.createElement(i,o)},r=v.forwardRef?v.forwardRef(n):e=>{let t=bt(e,[`innerRef`]);return n(t,e.innerRef)};return r.displayName=t.name,r.__linaria={className:t.class||``,extends:e},r}}var vt,yt,bt,xt,St=o((()=>{pt(),ht(),vt=e=>e.toUpperCase()===e,yt=e=>t=>e.indexOf(t)===-1,bt=(e,t)=>{let n={};return Object.keys(e).filter(yt(t)).forEach(t=>{n[t]=e[t]}),n},xt=_t}));St();var Ct=xt(`div`)({name:`ImageOverlayEditorStyle`,class:`gdg-i2iowwq`,propsAsIs:!1}),wt=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Tt=s(((e,t)=>{var n=wt();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Et=s(((e,t)=>{t.exports=Tt()()})),Dt=s((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`react`,`prop-types`],n);else if(e!==void 0)n(e,f(),Et());else{var r={exports:{}};n(r.exports,t.react,t.propTypes),t.reactSwipe=r.exports}})(e,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=p;var r=a(t),i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var l=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?e:e.capture}function h(e){if(`touches`in e){var t=e.touches[0];return{x:t.pageX,y:t.pageY}}return{x:e.screenX,y:e.screenY}}var g=function(e){d(t,e);function t(){var e;c(this,t);var n=[...arguments],r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(n)));return r._handleSwipeStart=r._handleSwipeStart.bind(r),r._handleSwipeMove=r._handleSwipeMove.bind(r),r._handleSwipeEnd=r._handleSwipeEnd.bind(r),r._onMouseDown=r._onMouseDown.bind(r),r._onMouseMove=r._onMouseMove.bind(r),r._onMouseUp=r._onMouseUp.bind(r),r._setSwiperRef=r._setSwiperRef.bind(r),r}return l(t,[{key:`componentDidMount`,value:function(){this.swiper&&this.swiper.addEventListener(`touchmove`,this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:`componentWillUnmount`,value:function(){this.swiper&&this.swiper.removeEventListener(`touchmove`,this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:`_onMouseDown`,value:function(e){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener(`mouseup`,this._onMouseUp),document.addEventListener(`mousemove`,this._onMouseMove),this._handleSwipeStart(e))}},{key:`_onMouseMove`,value:function(e){this.mouseDown&&this._handleSwipeMove(e)}},{key:`_onMouseUp`,value:function(e){this.mouseDown=!1,document.removeEventListener(`mouseup`,this._onMouseUp),document.removeEventListener(`mousemove`,this._onMouseMove),this._handleSwipeEnd(e)}},{key:`_handleSwipeStart`,value:function(e){var t=h(e),n=t.x,r=t.y;this.moveStart={x:n,y:r},this.props.onSwipeStart(e)}},{key:`_handleSwipeMove`,value:function(e){if(this.moveStart){var t=h(e),n=t.x,r=t.y,i=n-this.moveStart.x,a=r-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:i,y:a},e)&&e.cancelable&&e.preventDefault(),this.movePosition={deltaX:i,deltaY:a}}}},{key:`_handleSwipeEnd`,value:function(e){this.props.onSwipeEnd(e);var t=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-t?this.props.onSwipeLeft(1,e):this.movePosition.deltaX>t&&this.props.onSwipeRight(1,e),this.movePosition.deltaY<-t?this.props.onSwipeUp(1,e):this.movePosition.deltaY>t&&this.props.onSwipeDown(1,e)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:`_setSwiperRef`,value:function(e){this.swiper=e,this.props.innerRef(e)}},{key:`render`,value:function(){var e=this.props;e.tagName;var t=e.className,n=e.style,i=e.children;e.allowMouseEvents,e.onSwipeUp,e.onSwipeDown,e.onSwipeLeft,e.onSwipeRight,e.onSwipeStart,e.onSwipeMove,e.onSwipeEnd,e.innerRef,e.tolerance;var a=s(e,[`tagName`,`className`,`style`,`children`,`allowMouseEvents`,`onSwipeUp`,`onSwipeDown`,`onSwipeLeft`,`onSwipeRight`,`onSwipeStart`,`onSwipeMove`,`onSwipeEnd`,`innerRef`,`tolerance`]);return r.default.createElement(this.props.tagName,o({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:t,style:n},a),i)}}]),t}(t.Component);g.displayName=`ReactSwipe`,g.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},g.defaultProps={tagName:`div`,allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=g})})),Ot=s((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`./react-swipe`],n);else if(e!==void 0)n(e,Dt());else{var r={exports:{}};n(r.exports,t.reactSwipe),t.index=r.exports}})(e,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(e){return e&&e.__esModule?e:{default:e}}e.default=n.default})})),kt=s(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(kt());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.default={ROOT:function(e){return(0,t.default)(r({"carousel-root":!0},e||``,!!e))},CAROUSEL:function(e){return(0,t.default)({carousel:!0,"carousel-slider":e})},WRAPPER:function(e,n){return(0,t.default)({"thumbs-wrapper":!e,"slider-wrapper":e,"axis-horizontal":n===`horizontal`,"axis-vertical":n!==`horizontal`})},SLIDER:function(e,n){return(0,t.default)({thumbs:!e,slider:e,animated:!n})},ITEM:function(e,n,r){return(0,t.default)({thumb:!e,slide:e,selected:n,previous:r})},ARROW_PREV:function(e){return(0,t.default)({"control-arrow control-prev":!0,"control-disabled":e})},ARROW_NEXT:function(e){return(0,t.default)({"control-arrow control-next":!0,"control-disabled":e})},DOT:function(e){return(0,t.default)({dot:!0,selected:e})}}})),jt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.outerWidth=void 0,e.outerWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft)+parseInt(n.marginRight),t}})),Mt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(e,t,n){var r=e===0?e:e+t;return`translate3d`+(`(`+(n===`horizontal`?[r,0,0]:[0,r,0]).join(`,`)+`)`)}})),Nt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){return window}})),Pt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(f()),n=s(At()),r=jt(),i=s(Mt()),a=s(Ot()),o=s(Nt());function s(e){return e&&e.__esModule?e:{default:e}}function c(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(e===null||u(e)!==`object`&&typeof e!=`function`)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function u(e){"@babel/helpers - typeof";return u=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},u(e)}function d(){return d=Object.assign||function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){return e.hasOwnProperty(`key`)},T=function(e){g(c,e);var s=v(c);function c(e){var n;return p(this,c),n=s.call(this,e),C(b(n),`itemsWrapperRef`,void 0),C(b(n),`itemsListRef`,void 0),C(b(n),`thumbsRef`,void 0),C(b(n),`setItemsWrapperRef`,function(e){n.itemsWrapperRef=e}),C(b(n),`setItemsListRef`,function(e){n.itemsListRef=e}),C(b(n),`setThumbsRef`,function(e,t){n.thumbsRef||=[],n.thumbsRef[t]=e}),C(b(n),`updateSizes`,function(){if(!(!n.props.children||!n.itemsWrapperRef||!n.thumbsRef)){var e=t.Children.count(n.props.children),i=n.itemsWrapperRef.clientWidth,a=n.props.thumbWidth?n.props.thumbWidth:(0,r.outerWidth)(n.thumbsRef[0]),o=Math.floor(i/a),s=o0&&(r=0),s===c&&r<0&&(r=0);var l=s+100/(n.itemsWrapperRef.clientWidth/r);return n.itemsListRef&&[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(e){n.itemsListRef.style[e]=(0,i.default)(l,`%`,n.props.axis)}),!0}),C(b(n),`slideRight`,function(e){n.moveTo(n.state.firstItem-(typeof e==`number`?e:1))}),C(b(n),`slideLeft`,function(e){n.moveTo(n.state.firstItem+(typeof e==`number`?e:1))}),C(b(n),`moveTo`,function(e){e=e<0?0:e,e=e>=n.state.lastPosition?n.state.lastPosition:e,n.setState({firstItem:e})}),n.state={selectedItem:e.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},n}return h(c,[{key:`componentDidMount`,value:function(){this.setupThumbs()}},{key:`componentDidUpdate`,value:function(e){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==e.children&&this.updateSizes()}},{key:`componentWillUnmount`,value:function(){this.destroyThumbs()}},{key:`setupThumbs`,value:function(){(0,o.default)().addEventListener(`resize`,this.updateSizes),(0,o.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.updateSizes()}},{key:`destroyThumbs`,value:function(){(0,o.default)().removeEventListener(`resize`,this.updateSizes),(0,o.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes)}},{key:`getFirstItem`,value:function(e){var t=e;return e>=this.state.lastPosition&&(t=this.state.lastPosition),e1,o=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){return document}})),It=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setPosition=e.getPosition=e.isKeyboardEvent=e.defaultStatusFormatter=e.noop=void 0;var t=f(),n=r(Mt());function r(e){return e&&e.__esModule?e:{default:e}}e.noop=function(){},e.defaultStatusFormatter=function(e,t){return`${e} of ${t}`},e.isKeyboardEvent=function(e){return e?e.hasOwnProperty(`key`):!1},e.getPosition=function(e,n){if(n.infiniteLoop&&++e,e===0)return 0;var r=t.Children.count(n.children);if(n.centerMode&&n.axis===`horizontal`){var i=-e*n.centerSlidePercentage,a=r-1;return e&&(e!==a||n.infiniteLoop)?i+=(100-n.centerSlidePercentage)/2:e===a&&(i+=100-n.centerSlidePercentage),i}return-e*100},e.setPosition=function(e,t){var r={};return[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(i){r[i]=(0,n.default)(e,`%`,t)}),r}})),Lt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fadeAnimationHandler=e.slideStopSwipingHandler=e.slideSwipeAnimationHandler=e.slideAnimationHandler=void 0;var t=f(),n=i(Mt()),r=It();function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;tl))return c<0?e.centerMode&&e.centerSlidePercentage&&e.axis===`horizontal`?a.itemListStyle=(0,r.setPosition)(-(l+2)*e.centerSlidePercentage-(100-e.centerSlidePercentage)/2,e.axis):a.itemListStyle=(0,r.setPosition)(-(l+2)*100,e.axis):c>l&&(a.itemListStyle=(0,r.setPosition)(0,e.axis)),a;var u=(0,r.getPosition)(s,e),d=(0,n.default)(u,`%`,e.axis),f=e.transitionTime+`ms`;return a.itemListStyle={WebkitTransform:d,msTransform:d,OTransform:d,transform:d},i.swiping||(a.itemListStyle=o(o({},a.itemListStyle),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),a},e.slideSwipeAnimationHandler=function(e,n,i,a){var o={},s=n.axis===`horizontal`,c=t.Children.count(n.children),l=0,u=(0,r.getPosition)(i.selectedItem,n),d=n.infiniteLoop?(0,r.getPosition)(c-1,n)-100:(0,r.getPosition)(c-1,n),f=s?e.x:e.y,p=f;u===l&&f>0&&(p=0),u===d&&f<0&&(p=0);var m=u+100/(i.itemSize/p),h=Math.abs(f)>n.swipeScrollTolerance;return n.infiniteLoop&&h&&(i.selectedItem===0&&m>-100?m-=c*100:i.selectedItem===c-1&&m<-c*100&&(m+=c*100)),(!n.preventMovementUntilSwipeScrollTolerance||h||i.swipeMovementStarted)&&(i.swipeMovementStarted||a({swipeMovementStarted:!0}),o.itemListStyle=(0,r.setPosition)(m,n.axis)),h&&!i.cancelClick&&a({cancelClick:!0}),o},e.slideStopSwipingHandler=function(e,t){var n=(0,r.getPosition)(t.selectedItem,e);return{itemListStyle:(0,r.setPosition)(n,e.axis)}},e.fadeAnimationHandler=function(e,t){var n=e.transitionTime+`ms`,r=`ease-in-out`,i={position:`absolute`,display:`block`,zIndex:-2,minHeight:`100%`,opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return t.swiping||(i=o(o({},i),{},{WebkitTransitionDuration:n,MozTransitionDuration:n,OTransitionDuration:n,transitionDuration:n,msTransitionDuration:n})),{slideStyle:i,selectedStyle:o(o({},i),{},{opacity:1,position:`relative`}),prevStyle:o({},i)}}})),Rt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=d(f()),n=l(Ot()),r=l(At()),i=l(Pt()),a=l(Ft()),o=l(Nt()),s=It(),c=Lt();function l(e){return e&&e.__esModule?e:{default:e}}function u(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return u=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(e===null||p(e)!==`object`&&typeof e!=`function`)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function p(e){"@babel/helpers - typeof";return p=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},p(e)}function m(){return m=Object.assign||function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=function(e){b(u,e);var l=S(u);function u(e){var n;_(this,u),n=l.call(this,e),D(w(n),`thumbsRef`,void 0),D(w(n),`carouselWrapperRef`,void 0),D(w(n),`listRef`,void 0),D(w(n),`itemsRef`,void 0),D(w(n),`timer`,void 0),D(w(n),`animationHandler`,void 0),D(w(n),`setThumbsRef`,function(e){n.thumbsRef=e}),D(w(n),`setCarouselWrapperRef`,function(e){n.carouselWrapperRef=e}),D(w(n),`setListRef`,function(e){n.listRef=e}),D(w(n),`setItemsRef`,function(e,t){n.itemsRef||=[],n.itemsRef[t]=e}),D(w(n),`autoPlay`,function(){t.Children.count(n.props.children)<=1||(n.clearAutoPlay(),n.props.autoPlay&&(n.timer=setTimeout(function(){n.increment()},n.props.interval)))}),D(w(n),`clearAutoPlay`,function(){n.timer&&clearTimeout(n.timer)}),D(w(n),`resetAutoPlay`,function(){n.clearAutoPlay(),n.autoPlay()}),D(w(n),`stopOnHover`,function(){n.setState({isMouseEntered:!0},n.clearAutoPlay)}),D(w(n),`startOnLeave`,function(){n.setState({isMouseEntered:!1},n.autoPlay)}),D(w(n),`isFocusWithinTheCarousel`,function(){return n.carouselWrapperRef?!!((0,a.default)().activeElement===n.carouselWrapperRef||n.carouselWrapperRef.contains((0,a.default)().activeElement)):!1}),D(w(n),`navigateWithKeyboard`,function(e){if(n.isFocusWithinTheCarousel()){var t=n.props.axis===`horizontal`,r={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},i=t?r.ArrowRight:r.ArrowDown,a=t?r.ArrowLeft:r.ArrowUp;i===e.keyCode?n.increment():a===e.keyCode&&n.decrement()}}),D(w(n),`updateSizes`,function(){if(!(!n.state.initialized||!n.itemsRef||n.itemsRef.length===0)){var e=n.props.axis===`horizontal`,t=n.itemsRef[0];if(t){var r=e?t.clientWidth:t.clientHeight;n.setState({itemSize:r}),n.thumbsRef&&n.thumbsRef.updateSizes()}}}),D(w(n),`setMountState`,function(){n.setState({hasMount:!0}),n.updateSizes()}),D(w(n),`handleClickItem`,function(e,r){if(t.Children.count(n.props.children)!==0){if(n.state.cancelClick){n.setState({cancelClick:!1});return}n.props.onClickItem(e,r),e!==n.state.selectedItem&&n.setState({selectedItem:e})}}),D(w(n),`handleOnChange`,function(e,r){t.Children.count(n.props.children)<=1||n.props.onChange(e,r)}),D(w(n),`handleClickThumb`,function(e,t){n.props.onClickThumb(e,t),n.moveTo(e)}),D(w(n),`onSwipeStart`,function(e){n.setState({swiping:!0}),n.props.onSwipeStart(e)}),D(w(n),`onSwipeEnd`,function(e){n.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),n.props.onSwipeEnd(e),n.clearAutoPlay(),n.state.autoPlay&&n.autoPlay()}),D(w(n),`onSwipeMove`,function(e,t){n.props.onSwipeMove(t);var r=n.props.swipeAnimationHandler(e,n.props,n.state,n.setState.bind(w(n)));return n.setState(g({},r)),!!Object.keys(r).length}),D(w(n),`decrement`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem-(typeof e==`number`?e:1))}),D(w(n),`increment`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem+(typeof e==`number`?e:1))}),D(w(n),`moveTo`,function(e){if(typeof e==`number`){var r=t.Children.count(n.props.children)-1;e<0&&(e=n.props.infiniteLoop?r:0),e>r&&(e=n.props.infiniteLoop?0:r),n.selectItem({selectedItem:e}),n.state.autoPlay&&n.state.isMouseEntered===!1&&n.resetAutoPlay()}}),D(w(n),`onClickNext`,function(){n.increment(1)}),D(w(n),`onClickPrev`,function(){n.decrement(1)}),D(w(n),`onSwipeForward`,function(){n.increment(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`onSwipeBackwards`,function(){n.decrement(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`changeItem`,function(e){return function(t){(!(0,s.isKeyboardEvent)(t)||t.key===`Enter`)&&n.moveTo(e)}}),D(w(n),`selectItem`,function(e){n.setState(g({previousItem:n.state.selectedItem},e),function(){n.setState(n.animationHandler(n.props,n.state))}),n.handleOnChange(e.selectedItem,t.Children.toArray(n.props.children)[e.selectedItem])}),D(w(n),`getInitialImage`,function(){var e=n.props.selectedItem,t=n.itemsRef&&n.itemsRef[e];return(t&&t.getElementsByTagName(`img`)||[])[0]}),D(w(n),`getVariableItemHeight`,function(e){var t=n.itemsRef&&n.itemsRef[e];if(n.state.hasMount&&t&&t.children.length){var r=t.children[0].getElementsByTagName(`img`)||[];if(r.length>0){var i=r[0];i.complete||i.addEventListener(`load`,function e(){n.forceUpdate(),i.removeEventListener(`load`,e)})}var a=(r[0]||t.children[0]).clientHeight;return a>0?a:null}return null});var r={initialized:!1,previousItem:e.selectedItem,selectedItem:e.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:e.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return n.animationHandler=typeof e.animationHandler==`function`&&e.animationHandler||e.animationHandler===`fade`&&c.fadeAnimationHandler||c.slideAnimationHandler,n.state=g(g({},r),n.animationHandler(e,r)),n}return y(u,[{key:`componentDidMount`,value:function(){this.props.children&&this.setupCarousel()}},{key:`componentDidUpdate`,value:function(e,t){!e.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!e.autoFocus&&this.props.autoFocus&&this.forceFocus(),t.swiping&&!this.state.swiping&&this.setState(g({},this.props.stopSwipingHandler(this.props,this.state))),(e.selectedItem!==this.props.selectedItem||e.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),e.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:`componentWillUnmount`,value:function(){this.destroyCarousel()}},{key:`setupCarousel`,value:function(){var e=this;this.bindEvents(),this.state.autoPlay&&t.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var t=e.getInitialImage();t&&!t.complete?t.addEventListener(`load`,e.setMountState):e.setMountState()})}},{key:`destroyCarousel`,value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:`setupAutoPlay`,value:function(){this.autoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.addEventListener(`mouseenter`,this.stopOnHover),e.addEventListener(`mouseleave`,this.startOnLeave))}},{key:`destroyAutoPlay`,value:function(){this.clearAutoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.removeEventListener(`mouseenter`,this.stopOnHover),e.removeEventListener(`mouseleave`,this.startOnLeave))}},{key:`bindEvents`,value:function(){(0,o.default)().addEventListener(`resize`,this.updateSizes),(0,o.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.props.useKeyboardArrows&&(0,a.default)().addEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`unbindEvents`,value:function(){(0,o.default)().removeEventListener(`resize`,this.updateSizes),(0,o.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes);var e=this.getInitialImage();e&&e.removeEventListener(`load`,this.setMountState),this.props.useKeyboardArrows&&(0,a.default)().removeEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`forceFocus`,value:function(){var e;(e=this.carouselWrapperRef)==null||e.focus()}},{key:`renderItems`,value:function(e){var n=this;return this.props.children?t.Children.map(this.props.children,function(i,a){var o=a===n.state.selectedItem,s=a===n.state.previousItem,c=o&&n.state.selectedStyle||s&&n.state.prevStyle||n.state.slideStyle||{};n.props.centerMode&&n.props.axis===`horizontal`&&(c=g(g({},c),{},{minWidth:n.props.centerSlidePercentage+`%`})),n.state.swiping&&n.state.swipeMovementStarted&&(c=g(g({},c),{},{pointerEvents:`none`}));var l={ref:function(e){return n.setItemsRef(e,a)},key:`itemKey`+a+(e?`clone`:``),className:r.default.ITEM(!0,a===n.state.selectedItem,a===n.state.previousItem),onClick:n.handleClickItem.bind(n,a,i),style:c};return t.default.createElement(`li`,l,n.props.renderItem(i,{isSelected:a===n.state.selectedItem,isPrevious:a===n.state.previousItem}))}):[]}},{key:`renderControls`,value:function(){var e=this,n=this.props,r=n.showIndicators,i=n.labels,a=n.renderIndicator,o=n.children;return r?t.default.createElement(`ul`,{className:`control-dots`},t.Children.map(o,function(t,n){return a&&a(e.changeItem(n),n===e.state.selectedItem,n,i.item)})):null}},{key:`renderStatus`,value:function(){return this.props.showStatus?t.default.createElement(`p`,{className:`carousel-status`},this.props.statusFormatter(this.state.selectedItem+1,t.Children.count(this.props.children))):null}},{key:`renderThumbs`,value:function(){return!this.props.showThumbs||!this.props.children||t.Children.count(this.props.children)===0?null:t.default.createElement(i.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:`render`,value:function(){var e=this;if(!this.props.children||t.Children.count(this.props.children)===0)return null;var i=this.props.swipeable&&t.Children.count(this.props.children)>1,a=this.props.axis===`horizontal`,o=this.props.showArrows&&t.Children.count(this.props.children)>1,s=o&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,c=o&&(this.state.selectedItem{})),Bt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Rt()),n=zt(),r=i(Pt());function i(e){return e&&e.__esModule?e:{default:e}}})),Vt=s(((e,t)=>{var n=A();t.exports=function(){return n.Date.now()}})),Ht=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),Ut=s(((e,t)=>{var n=Ht(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),Wt=s(((e,t)=>{var n=Ut(),r=re(),i=ne(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Gt=s(((e,t)=>{var n=re(),r=Vt(),i=Wt(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),L=u(f(),1),Kt=u(Gt(),1);E();function qt(e,t,n,r,i=!1){let a=L.useRef();a.current=t,L.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;let t=n,o=e=>{a.current?.call(t,e)};return t.addEventListener(e,o,{passive:r,capture:i}),()=>{t.removeEventListener(e,o,{capture:i})}},[e,n,r,i])}function Jt(e,t){return e===void 0?void 0:t}var Yt=Math.PI;function Xt(e){return e*Yt/180}var Zt=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Qt=(e,t,n,r,i)=>{switch(e){case`left`:return Math.floor(t)+r+i/2;case`center`:return Math.floor(t+n/2);case`right`:return Math.floor(t+n)-r-i/2}},$t=(e,t,n)=>Math.min(e,t-n*2),en=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,tn=e=>{let t=e.fgColor??`currentColor`;return L.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}),L.createElement(`path`,{d:`M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}))},nn=e=>{let t=e.fgColor??`currentColor`;return L.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M19 6L10.3802 17L5.34071 11.8758`,vectorEffect:`non-scaling-stroke`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}))};function rn(e,t,n){let[r,i]=L.useState(e),a=L.useRef(!0);L.useEffect(()=>()=>{a.current=!1},[]);let o=L.useRef((0,Kt.default)(e=>{a.current&&i(e)},n));return L.useLayoutEffect(()=>{a.current&&o.current(()=>e())},t),r}var an=RegExp(`^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]`);function R(e){return an.test(e)?`rtl`:`not-rtl`}var on=void 0;function sn(){if(typeof document>`u`)return 0;if(on!==void 0)return on;let e=document.createElement(`p`);e.style.width=`100%`,e.style.height=`200px`;let t=document.createElement(`div`);t.id=`testScrollbar`,t.style.position=`absolute`,t.style.top=`0px`,t.style.left=`0px`,t.style.visibility=`hidden`,t.style.width=`200px`,t.style.height=`150px`,t.style.overflow=`hidden`,t.append(e),document.body.append(t);let n=e.offsetWidth;t.style.overflow=`scroll`;let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),on=n-r,on}var cn=Symbol();function ln(e){let t=L.useRef([cn,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;let[n,r]=L.useState(e),[,i]=L.useState(),a=L.useCallback(e=>{let n=t.current[0];n!==cn&&(e=typeof e==`function`?e(n):e,e===n)||(n!==cn&&i({}),r(t=>typeof e==`function`?e(n===cn?t:n):e),t.current[0]=cn)},[]),o=L.useCallback(()=>{t.current[0]=cn,i({})},[]);return[t.current[0]===cn?n:t.current[0],a,o]}function un(e){if(e.length===0)return``;let t=0,n=0;for(let r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(`, `)}function dn(e){let t=L.useRef(e);return w(e,t.current)||(t.current=e),t.current}var fn=Bt(),pn=e=>{let{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,a=t.filter(e=>e!==``);if(a.length===0)return null;let o=a.length>1;return L.createElement(Ct,{"data-testid":`GDG-default-image-overlay-editor`},L.createElement(fn.Carousel,{showArrows:o,showThumbs:!1,swipeable:o,emulateTouch:o,infiniteLoop:o},a.map(e=>{let t=i?.(e)??L.createElement(`img`,{draggable:!1,src:e});return L.createElement(`div`,{className:`gdg-centering-container`,key:e},t)})),n&&r&&L.createElement(`button`,{className:`gdg-edit-icon`,onClick:r},L.createElement(tn,null)))};function z(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:``,highlight:null,hooks:null,langPrefix:`language-`,mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var mn=z();function hn(e){mn=e}var gn=/[&<>"']/,_n=new RegExp(gn.source,`g`),vn=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,yn=new RegExp(vn.source,`g`),bn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},xn=e=>bn[e];function Sn(e,t){if(t){if(gn.test(e))return e.replace(_n,xn)}else if(vn.test(e))return e.replace(yn,xn);return e}var Cn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function wn(e){return e.replace(Cn,(e,t)=>(t=t.toLowerCase(),t===`colon`?`:`:t.charAt(0)===`#`?t.charAt(1)===`x`?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):``))}var Tn=/(^|[^\[])\^/g;function En(e,t){e=typeof e==`string`?e:e.source,t||=``;let n={replace:(t,r)=>(r=r.source||r,r=r.replace(Tn,`$1`),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}var Dn=/[^\w:]/g,On=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function kn(e,t,n){if(e){let e;try{e=decodeURIComponent(wn(n)).replace(Dn,``).toLowerCase()}catch{return null}if(e.indexOf(`javascript:`)===0||e.indexOf(`vbscript:`)===0||e.indexOf(`data:`)===0)return null}t&&!On.test(n)&&(n=Pn(t,n));try{n=encodeURI(n).replace(/%25/g,`%`)}catch{return null}return n}var An={},jn=/^[^:]+:\/*[^/]*$/,Mn=/^([^:]+:)[\s\S]*$/,Nn=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Pn(e,t){An[` `+e]||(jn.test(e)?An[` `+e]=e+`/`:An[` `+e]=Ln(e,`/`,!0)),e=An[` `+e];let n=e.indexOf(`:`)===-1;return t.substring(0,2)===`//`?n?t:e.replace(Mn,`$1`)+t:t.charAt(0)===`/`?n?t:e.replace(Nn,`$1`)+t:e+t}var Fn={exec:function(){}};function In(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Vn(e,t,n,r){let i=t.href,a=t.title?Sn(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:Sn(o)}}function Hn(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(` +`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Fs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Is(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ls=typeof WeakMap==`function`?WeakMap:Map;function Rs(e,t,n){n=lo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pl||(pl=!0,ml=r),Is(e,t)},n}function zs(e,t,n){n=lo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Is(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Is(e,t),typeof r!=`function`&&(hl===null?hl=new Set([this]):hl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Bs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ls;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Yl.bind(null,e,t,n),t.then(e,e))}function Vs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Hs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=lo(-1,1),t.tag=2,uo(n,t,1))),n.lanes|=1),e)}var Us=C.ReactCurrentOwner,Ws=!1;function Gs(e,t,n,r){t.child=e===null?Ka(t,null,n,r):Ga(t,e.child,n,r)}function Ks(e,t,n,r,i){n=n.render;var a=t.ref;return eo(t,i),r=Vo(e,t,n,r,a,i),n=Ho(),e!==null&&!Ws?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,fc(e,t,i)):(ka&&n&&Ta(t),t.flags|=1,Gs(e,t,r,i),t.child)}function qs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ru(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Js(e,t,a,r,i)):(e=ou(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return fc(e,t,i)}return t.flags|=1,e=au(a,r),e.ref=t.ref,e.return=t,t.child=e}function Js(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref)if(Ws=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ws=!0);else return t.lanes=e.lanes,fc(e,t,i)}return Zs(e,t,n,r,i)}function Ys(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xi(nl,tl),tl|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Xi(nl,tl),tl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Xi(nl,tl),tl|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Xi(nl,tl),tl|=r;return Gs(e,t,i,n),t.child}function Xs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Zs(e,t,n,r,i){var a=na(n)?ea:Qi.current;return a=ta(t,a),eo(t,i),n=Vo(e,t,n,r,a,i),r=Ho(),e!==null&&!Ws?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,fc(e,t,i)):(ka&&r&&Ta(t),t.flags|=1,Gs(e,t,n,i),t.child)}function Qs(e,t,n,r,i){if(na(n)){var a=!0;oa(t)}else a=!1;if(eo(t,i),t.stateNode===null)dc(e,t),js(t,n,r),Ns(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=to(l):(l=na(n)?ea:Qi.current,l=ta(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Ms(t,o,r,l),oo=!1;var f=t.memoizedState;o.state=f,mo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||$i.current||oo?(typeof u==`function`&&(Os(t,n,u,r),c=t.memoizedState),(s=oo||As(t,n,s,r,f,c,l))?(d||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`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,co(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Ds(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=to(c):(c=na(n)?ea:Qi.current,c=ta(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Ms(t,o,r,c),oo=!1,f=t.memoizedState,o.state=f,mo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||$i.current||oo?(typeof p==`function`&&(Os(t,n,p,r),m=t.memoizedState),(l=oo||As(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return $s(e,t,n,r,a,i)}function $s(e,t,n,r,i,a){Xs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&sa(t,n,!1),fc(e,t,a);r=t.stateNode,Us.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ga(t,e.child,null,a),t.child=Ga(t,null,s,a)):Gs(e,t,s,a),t.memoizedState=r.state,i&&sa(t,n,!0),t.child}function ec(e){var t=e.stateNode;t.pendingContext?ia(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ia(e,t.context,!1),xo(e,t.containerInfo)}function tc(e,t,n,r,i){return Ra(),za(i),t.flags|=256,Gs(e,t,n,r),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0};function rc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ic(e,t,n){var r=t.pendingProps,i=To.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Xi(To,i&1),e===null)return Pa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=cu(o,r,0,null),e=su(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=rc(n),t.memoizedState=nc,e):ac(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return sc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=au(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=su(a,o,n,null),a.flags|=2):a=au(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?rc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=nc,r}return a=e.child,e=a.sibling,r=au(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ac(e,t){return t=cu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function oc(e,t,n,r){return r!==null&&za(r),Ga(t,e.child,null,n),e=ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Fs(Error(r(422))),oc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=cu({mode:`visible`,children:i.children},a,0,null),o=su(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ga(t,e.child,null,s),t.child.memoizedState=rc(s),t.memoizedState=nc,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return oc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Fs(o,i,void 0),oc(e,t,s,i)}if(c=(s&e.childLanes)!==0,Ws||c){if(i=Qc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,ao(e,a),Tl(i,e,a,-1))}return zl(),i=Fs(Error(r(421))),oc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Zl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Oa=Ni(a.nextSibling),Da=t,ka=!0,Aa=null,e!==null&&(va[ya++]=xa,va[ya++]=Sa,va[ya++]=ba,xa=e.id,Sa=e.overflow,ba=t),t=ac(t,i.children),t.flags|=4096,t)}function cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$a(e.return,t,n)}function lc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function uc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Gs(e,t,r.children,n),r=To.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cc(e,n,t);else if(e.tag===19)cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Xi(To,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Eo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),lc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Eo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}lc(t,!0,n,null,a);break;case`together`:lc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function dc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function fc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),al|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=au(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=au(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pc(e,t,n){switch(t.tag){case 3:ec(t),Ra();break;case 5:Co(t);break;case 1:na(t.type)&&oa(t);break;case 4:xo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Xi(qa,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xi(To,To.current&1),e=fc(e,t,n),e===null?null:e.sibling):ic(e,t,n):(Xi(To,To.current&1),t.flags|=128,null);Xi(To,To.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return uc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Xi(To,To.current),r)break;return null;case 22:case 23:return t.lanes=0,Ys(e,t,n)}return fc(e,t,n)}var mc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},hc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,bo(_o.current);var o=null;switch(n){case`input`:i=_e(e,i),r=_e(e,r),o=[];break;case`select`:i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),o=[];break;case`textarea`:i=Te(e,i),r=Te(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=Ci)}ze(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&li(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},eee=function(e,t,n,r){n!==r&&(t.flags|=4)};function gc(e,t){if(!ka)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _c(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tee(e,t,n){var i=t.pendingProps;switch(Ea(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _c(t),null;case 1:return na(t.type)&&ra(),_c(t),null;case 3:return i=t.stateNode,So(),Yi($i),Yi(Qi),Oo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ia(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Aa!==null&&(kl(Aa),Aa=null))),_c(t),null;case 5:wo(t);var o=bo(yo.current);if(n=t.type,e!==null&&t.stateNode!=null)hc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return _c(t),null}if(e=bo(_o.current),Ia(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ii]=t,i[Li]=s,e=(t.mode&1)!=0,n){case`dialog`:li(`cancel`,i),li(`close`,i);break;case`iframe`:case`object`:case`embed`:li(`load`,i);break;case`video`:case`audio`:for(o=0;o<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ii]=t,e[Li]=i,mc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Be(n,i),n){case`dialog`:li(`cancel`,e),li(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:li(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;odl&&(t.flags|=128,i=!0,gc(s,!1),t.lanes=4194304)}else{if(!i)if(e=Eo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!ka)return _c(t),null}else 2*yt()-s.renderingStartTime>dl&&n!==1073741824&&(t.flags|=128,i=!0,gc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(_c(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=yt(),t.sibling=null,n=To.current,Xi(To,i?n&1|2:n&1),t);case 22:case 23:return Fl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?tl&1073741824&&(_c(t),t.subtreeFlags&6&&(t.flags|=8192)):_c(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function nee(e,t){switch(Ea(t),t.tag){case 1:return na(t.type)&&ra(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return So(),Yi($i),Yi(Qi),Oo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wo(t),null;case 13:if(Yi(To),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yi(To),null;case 4:return So(),null;case 10:return Qa(t.type._context),null;case 22:case 23:return Fl(),null;case 24:return null;default:return null}}var vc=!1,yc=!1,bc=typeof WeakSet==`function`?WeakSet:Set,xc=null;function Sc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Jl(e,t,n)}else n.current=null}function Cc(e,t,n){try{n()}catch(n){Jl(e,t,n)}}var wc=!1;function Tc(e,t){if(wi=hn,e=Ir(),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ti={focusedElem:e,selectionRange:n},hn=!1,xc=t;xc!==null;)if(t=xc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,xc=e;else for(;xc!==null;){t=xc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ds(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Jl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,xc=e;break}xc=t.return}return h=wc,wc=!1,h}function Ec(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Cc(t,n,a)}i=i.next}while(i!==r)}}function Dc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Oc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function kc(e){var t=e.alternate;t!==null&&(e.alternate=null,kc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ii],delete t[Li],delete t[zi],delete t[Bi],delete t[Vi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ac(e){return e.tag===5||e.tag===3||e.tag===4}function jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ac(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ci));else if(r!==4&&(e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}function Nc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Nc(e,t,n),e=e.sibling;e!==null;)Nc(e,t,n),e=e.sibling}var Pc=null,Fc=!1;function Ic(e,t,n){for(n=n.child;n!==null;)Lc(e,t,n),n=n.sibling}function Lc(e,t,n){if(Dt&&typeof Dt.onCommitFiberUnmount==`function`)try{Dt.onCommitFiberUnmount(Et,n)}catch{}switch(n.tag){case 5:yc||Sc(n,t);case 6:var r=Pc,i=Fc;Pc=null,Ic(e,t,n),Pc=r,Fc=i,Pc!==null&&(Fc?(e=Pc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pc.removeChild(n.stateNode));break;case 18:Pc!==null&&(Fc?(e=Pc,n=n.stateNode,e.nodeType===8?Mi(e.parentNode,n):e.nodeType===1&&Mi(e,n),z(e)):Mi(Pc,n.stateNode));break;case 4:r=Pc,i=Fc,Pc=n.stateNode.containerInfo,Fc=!0,Ic(e,t,n),Pc=r,Fc=i;break;case 0:case 11:case 14:case 15:if(!yc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Cc(n,t,o),i=i.next}while(i!==r)}Ic(e,t,n);break;case 1:if(!yc&&(Sc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Jl(n,t,e)}Ic(e,t,n);break;case 21:Ic(e,t,n);break;case 22:n.mode&1?(yc=(r=yc)||n.memoizedState!==null,Ic(e,t,n),yc=r):Ic(e,t,n);break;default:Ic(e,t,n)}}function Rc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bc),t.forEach(function(t){var r=Ql.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function zc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=yt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qc(i/1960))-i,10e?16:e,_l===null)var i=!1;else{if(e=_l,_l=null,vl=0,Zc&6)throw Error(r(331));var a=Zc;for(Zc|=4,xc=e.current;xc!==null;){var o=xc,s=o.child;if(xc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lyt()-ul?Il(e,0):sl|=n),El(e,t)}function Xl(e,t){t===0&&(e.mode&1?(t=Pt,Pt<<=1,!(Pt&130023424)&&(Pt=4194304)):t=1);var n=Cl();e=ao(e,t),e!==null&&(Ht(e,t,n),El(e,n))}function Zl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xl(e,n)}function Ql(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Xl(e,n)}var $l=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$i.current)Ws=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ws=!1,pc(e,t,n);Ws=!!(e.flags&131072)}else Ws=!1,ka&&t.flags&1048576&&wa(t,_a,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;dc(e,t),e=t.pendingProps;var a=ta(t,Qi.current);eo(t,n),a=Vo(null,t,i,e,a,n);var o=Ho();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,na(i)?(o=!0,oa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,so(t),a.updater=ks,t.stateNode=a,a._reactInternals=t,Ns(t,i,e,n),t=$s(null,t,i,!0,o,n)):(t.tag=0,ka&&o&&Ta(t),Gs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(dc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=iu(i),e=Ds(i,e),a){case 0:t=Zs(null,t,i,e,n);break a;case 1:t=Qs(null,t,i,e,n);break a;case 11:t=Ks(null,t,i,e,n);break a;case 14:t=qs(null,t,i,Ds(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ds(i,a),Zs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ds(i,a),Qs(e,t,i,a,n);case 3:a:{if(ec(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,co(e,t),mo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ps(Error(r(423)),t),t=tc(e,t,i,n,a);break a}else if(i!==a){a=Ps(Error(r(424)),t),t=tc(e,t,i,n,a);break a}else for(Oa=Ni(t.stateNode.containerInfo.firstChild),Da=t,ka=!0,Aa=null,n=Ka(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ra(),i===a){t=fc(e,t,n);break a}Gs(e,t,i,n)}t=t.child}return t;case 5:return Co(t),e===null&&Pa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ei(i,a)?s=null:o!==null&&Ei(i,o)&&(t.flags|=32),Xs(e,t),Gs(e,t,s,n),t.child;case 6:return e===null&&Pa(t),null;case 13:return ic(e,t,n);case 4:return xo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ga(t,null,i,n):Gs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ds(i,a),Ks(e,t,i,a,n);case 7:return Gs(e,t,t.pendingProps,n),t.child;case 8:return Gs(e,t,t.pendingProps.children,n),t.child;case 12:return Gs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Xi(qa,i._currentValue),i._currentValue=s,o!==null)if(jr(o.value,s)){if(o.children===a.children&&!$i.current){t=fc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=lo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),$a(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),$a(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Gs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,eo(t,n),a=to(a),i=i(a),t.flags|=1,Gs(e,t,i,n),t.child;case 14:return i=t.type,a=Ds(i,t.pendingProps),a=Ds(i.type,a),qs(e,t,i,a,n);case 15:return Js(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ds(i,a),dc(e,t),t.tag=1,na(i)?(e=!0,oa(t)):e=!1,eo(t,n),js(t,i,a),Ns(t,i,a,n),$s(null,t,i,!0,e,n);case 19:return uc(e,t,n);case 22:return Ys(e,t,n)}throw Error(r(156,t.tag))};function eu(e,t){return ht(e,t)}function tu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nu(e,t,n,r){return new tu(e,t,n,r)}function ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iu(e){if(typeof e==`function`)return+!!ru(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===N)return 14}return 2}function au(e,t){var n=e.alternate;return n===null?(n=nu(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ou(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ru(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return su(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=nu(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=nu(13,n,t,a),e.elementType=M,e.lanes=o,e;case ee:return e=nu(19,n,t,a),e.elementType=ee,e.lanes=o,e;case ne:return cu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case N:s=14;break a;case te:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=nu(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function su(e,t,n,r){return e=nu(7,e,r,t),e.lanes=n,e}function cu(e,t,n,r){return e=nu(22,e,r,t),e.elementType=ne,e.lanes=n,e.stateNode={isHidden:!1},e}function lu(e,t,n){return e=nu(6,e,null,t),e.lanes=n,e}function uu(e,t,n){return t=nu(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iee(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vt(0),this.expirationTimes=Vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function du(e,t,n,r,i,a,o,s,c){return e=new iee(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=nu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},so(a),e}function aee(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=s((e=>{var t=g();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),v=u(f(),1),y=_();function b(e=`This should not happen`){throw Error(e)}function x(e,t=`Assertion failed`){if(!e)return b(t)}function S(e,t){return b(t??`Hell froze over`)}function C(e,t){try{return e()}catch{return t}}function w(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&w(e[r],t[r]););return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(T.call(e,n)&&++r&&!T.call(t,n)||!(n in t)||!w(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var T,E=o((()=>{T=Object.prototype.hasOwnProperty})),D=s(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e,t){return e!=null&&n.call(e,t)}t.exports=r})),O=s(((e,t)=>{t.exports=Array.isArray})),k=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),A=s(((e,t)=>{var n=k(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),j=s(((e,t)=>{t.exports=A().Symbol})),M=s(((e,t)=>{var n=j(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),ee=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),N=s(((e,t)=>{var n=j(),r=M(),i=ee(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),te=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),ne=s(((e,t)=>{var n=N(),r=te(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),P=s(((e,t)=>{var n=O(),r=ne(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),re=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),F=s(((e,t)=>{var n=N(),r=re(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),ie=s(((e,t)=>{t.exports=A()[`__core-js_shared__`]})),ae=s(((e,t)=>{var n=ie(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),oe=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),se=s(((e,t)=>{var n=F(),r=ae(),i=re(),a=oe(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),ce=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),le=s(((e,t)=>{var n=se(),r=ce();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),ue=s(((e,t)=>{t.exports=le()(Object,`create`)})),de=s(((e,t)=>{var n=ue();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),fe=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),pe=s(((e,t)=>{var n=ue(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),me=s(((e,t)=>{var n=ue(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),he=s(((e,t)=>{var n=ue(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),ge=s(((e,t)=>{var n=de(),r=fe(),i=pe(),a=me(),o=he();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{function n(){this.__data__=[],this.size=0}t.exports=n})),ve=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),ye=s(((e,t)=>{var n=ve();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),be=s(((e,t)=>{var n=ye(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),xe=s(((e,t)=>{var n=ye();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Se=s(((e,t)=>{var n=ye();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Ce=s(((e,t)=>{var n=ye();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),we=s(((e,t)=>{var n=_e(),r=be(),i=xe(),a=Se(),o=Ce();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{t.exports=le()(A(),`Map`)})),Ee=s(((e,t)=>{var n=ge(),r=we(),i=Te();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),De=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Oe=s(((e,t)=>{var n=De();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),ke=s(((e,t)=>{var n=Oe();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),Ae=s(((e,t)=>{var n=Oe();function r(e){return n(this,e).get(e)}t.exports=r})),je=s(((e,t)=>{var n=Oe();function r(e){return n(this,e).has(e)}t.exports=r})),Me=s(((e,t)=>{var n=Oe();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Ne=s(((e,t)=>{var n=Ee(),r=ke(),i=Ae(),a=je(),o=Me();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{var n=Ne(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),Fe=s(((e,t)=>{var n=Pe(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Ie=s(((e,t)=>{var n=Fe(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),Le=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n{var n=j(),r=Le(),i=O(),a=ne(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),ze=s(((e,t)=>{var n=Re();function r(e){return e==null?``:n(e)}t.exports=r})),Be=s(((e,t)=>{var n=O(),r=P(),i=Ie(),a=ze();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Ve=s(((e,t)=>{var n=N(),r=te(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),He=s(((e,t)=>{var n=Ve(),r=te(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Ue=s(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),Ge=s(((e,t)=>{var n=ne(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),Ke=s(((e,t)=>{var n=Be(),r=He(),i=O(),a=Ue(),o=We(),s=Ge();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l{var n=D(),r=Ke();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i}));function Je(e){return`width`in e&&typeof e.width==`number`}async function Ye(e){return typeof e==`object`?e:await e()}function Xe(e){return!(e.kind===I.Loading||e.kind===I.Bubble||e.kind===I.RowID||e.kind===I.Protected||e.kind===I.Drilldown)}function Ze(e){return e.kind===at.Marker||e.kind===at.NewRow}function Qe(e){if(!Xe(e)||e.kind===I.Image)return!1;if(e.kind===I.Text||e.kind===I.Number||e.kind===I.Markdown||e.kind===I.Uri||e.kind===I.Custom||e.kind===I.Boolean)return e.readonly!==!0;S(e,`A cell was passed with an invalid kind`)}function $e(e){return(0,nt.default)(e,`editor`)}function et(e){return!(e.readonly??!1)}function tt(e){if(e.length===0)return[];let t=[...e],n=[];t.sort(function(e,t){return e[0]-t[0]}),n.push([...t[0]]);for(let e of t.slice(1)){let t=n[n.length-1];t[1]{E(),nt=u(qe(),1),(function(e){e.Uri=`uri`,e.Text=`text`,e.Image=`image`,e.RowID=`row-id`,e.Number=`number`,e.Bubble=`bubble`,e.Boolean=`boolean`,e.Loading=`loading`,e.Markdown=`markdown`,e.Drilldown=`drilldown`,e.Protected=`protected`,e.Custom=`custom`})(I||={}),(function(e){e.HeaderRowID=`headerRowID`,e.HeaderCode=`headerCode`,e.HeaderNumber=`headerNumber`,e.HeaderString=`headerString`,e.HeaderBoolean=`headerBoolean`,e.HeaderAudioUri=`headerAudioUri`,e.HeaderVideoUri=`headerVideoUri`,e.HeaderEmoji=`headerEmoji`,e.HeaderImage=`headerImage`,e.HeaderUri=`headerUri`,e.HeaderPhone=`headerPhone`,e.HeaderMarkdown=`headerMarkdown`,e.HeaderDate=`headerDate`,e.HeaderTime=`headerTime`,e.HeaderEmail=`headerEmail`,e.HeaderReference=`headerReference`,e.HeaderIfThenElse=`headerIfThenElse`,e.HeaderSingleValue=`headerSingleValue`,e.HeaderLookup=`headerLookup`,e.HeaderTextTemplate=`headerTextTemplate`,e.HeaderMath=`headerMath`,e.HeaderRollup=`headerRollup`,e.HeaderJoinStrings=`headerJoinStrings`,e.HeaderSplitString=`headerSplitString`,e.HeaderGeoDistance=`headerGeoDistance`,e.HeaderArray=`headerArray`,e.RowOwnerOverlay=`rowOwnerOverlay`,e.ProtectedColumnOverlay=`protectedColumnOverlay`})(rt||={}),(function(e){e.Triangle=`triangle`,e.Dots=`dots`})(it||={}),(function(e){e.NewRow=`new-row`,e.Marker=`marker`})(at||={}),st=class e{items;constructor(e){this.items=e}static empty=()=>ot??=new e([]);static fromSingleSelection=t=>e.empty().add(t);offset(t){if(t===0)return this;let n=this.items.map(e=>[e[0]+t,e[1]+t]);return new e(n)}add(t){let n=typeof t==`number`?[t,t+1]:t,r=tt([...this.items,n]);return new e(r)}remove(t){let n=[...this.items],r=typeof t==`number`?t:t[0],i=typeof t==`number`?t+1:t[1];for(let[e,t]of n.entries()){let[a,o]=t;if(a<=i&&r<=o){let t=[];a=n&&e{})),dt,ft,pt=o((()=>{ut(),dt=/^((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)-.*))$/,ft=lt(function(e){return dt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),mt,ht=o((()=>{mt=function(){let e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(e=>{(e?e.split(` `):[]).forEach(e=>{if(e.startsWith(`atm_`)){let[,n]=e.split(`_`);t[n]=e}else n.push(e)})});let r=[];for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(t[e]);return r.push(...n),r.join(` `)}}));function gt(e,t,n){let r=bt(t,n);if(!e){let e=typeof ft==`function`?{default:ft}:ft;Object.keys(r).forEach(t=>{e.default(t)||delete r[t]})}return r}function _t(e){return t=>{let n=(n,r)=>{let{as:i=e,class:a=``}=n,o=gt(t.propsAsIs===void 0?!(typeof i==`string`&&i.indexOf(`-`)===-1&&!vt(i[0])):t.propsAsIs,n,[`as`,`class`]);o.ref=r,o.className=t.atomic?mt(t.class,o.className||a):mt(o.className||a,t.class);let{vars:s}=t;if(s){let e={};for(let r in s){let i=s[r],a=i[0],o=i[1]||``,c=typeof a==`function`?a(n):a;t.name,e[`--${r}`]=`${c}${o}`}let r=o.style||{},i=Object.keys(r);i.length>0&&i.forEach(t=>{e[t]=r[t]}),o.style=e}return e.__linaria&&e!==i?(o.as=i,v.createElement(e,o)):v.createElement(i,o)},r=v.forwardRef?v.forwardRef(n):e=>{let t=bt(e,[`innerRef`]);return n(t,e.innerRef)};return r.displayName=t.name,r.__linaria={className:t.class||``,extends:e},r}}var vt,yt,bt,xt,St=o((()=>{pt(),ht(),vt=e=>e.toUpperCase()===e,yt=e=>t=>e.indexOf(t)===-1,bt=(e,t)=>{let n={};return Object.keys(e).filter(yt(t)).forEach(t=>{n[t]=e[t]}),n},xt=_t}));St();var Ct=xt(`div`)({name:`ImageOverlayEditorStyle`,class:`gdg-i2iowwq`,propsAsIs:!1}),wt=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Tt=s(((e,t)=>{var n=wt();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Et=s(((e,t)=>{t.exports=Tt()()})),Dt=s((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`react`,`prop-types`],n);else if(e!==void 0)n(e,f(),Et());else{var r={exports:{}};n(r.exports,t.react,t.propTypes),t.reactSwipe=r.exports}})(e,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=p;var r=a(t),i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var l=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?e:e.capture}function h(e){if(`touches`in e){var t=e.touches[0];return{x:t.pageX,y:t.pageY}}return{x:e.screenX,y:e.screenY}}var g=function(e){d(t,e);function t(){var e;c(this,t);var n=[...arguments],r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(n)));return r._handleSwipeStart=r._handleSwipeStart.bind(r),r._handleSwipeMove=r._handleSwipeMove.bind(r),r._handleSwipeEnd=r._handleSwipeEnd.bind(r),r._onMouseDown=r._onMouseDown.bind(r),r._onMouseMove=r._onMouseMove.bind(r),r._onMouseUp=r._onMouseUp.bind(r),r._setSwiperRef=r._setSwiperRef.bind(r),r}return l(t,[{key:`componentDidMount`,value:function(){this.swiper&&this.swiper.addEventListener(`touchmove`,this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:`componentWillUnmount`,value:function(){this.swiper&&this.swiper.removeEventListener(`touchmove`,this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:`_onMouseDown`,value:function(e){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener(`mouseup`,this._onMouseUp),document.addEventListener(`mousemove`,this._onMouseMove),this._handleSwipeStart(e))}},{key:`_onMouseMove`,value:function(e){this.mouseDown&&this._handleSwipeMove(e)}},{key:`_onMouseUp`,value:function(e){this.mouseDown=!1,document.removeEventListener(`mouseup`,this._onMouseUp),document.removeEventListener(`mousemove`,this._onMouseMove),this._handleSwipeEnd(e)}},{key:`_handleSwipeStart`,value:function(e){var t=h(e),n=t.x,r=t.y;this.moveStart={x:n,y:r},this.props.onSwipeStart(e)}},{key:`_handleSwipeMove`,value:function(e){if(this.moveStart){var t=h(e),n=t.x,r=t.y,i=n-this.moveStart.x,a=r-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:i,y:a},e)&&e.cancelable&&e.preventDefault(),this.movePosition={deltaX:i,deltaY:a}}}},{key:`_handleSwipeEnd`,value:function(e){this.props.onSwipeEnd(e);var t=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-t?this.props.onSwipeLeft(1,e):this.movePosition.deltaX>t&&this.props.onSwipeRight(1,e),this.movePosition.deltaY<-t?this.props.onSwipeUp(1,e):this.movePosition.deltaY>t&&this.props.onSwipeDown(1,e)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:`_setSwiperRef`,value:function(e){this.swiper=e,this.props.innerRef(e)}},{key:`render`,value:function(){var e=this.props;e.tagName;var t=e.className,n=e.style,i=e.children;e.allowMouseEvents,e.onSwipeUp,e.onSwipeDown,e.onSwipeLeft,e.onSwipeRight,e.onSwipeStart,e.onSwipeMove,e.onSwipeEnd,e.innerRef,e.tolerance;var a=s(e,[`tagName`,`className`,`style`,`children`,`allowMouseEvents`,`onSwipeUp`,`onSwipeDown`,`onSwipeLeft`,`onSwipeRight`,`onSwipeStart`,`onSwipeMove`,`onSwipeEnd`,`innerRef`,`tolerance`]);return r.default.createElement(this.props.tagName,o({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:t,style:n},a),i)}}]),t}(t.Component);g.displayName=`ReactSwipe`,g.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},g.defaultProps={tagName:`div`,allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=g})})),Ot=s((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`./react-swipe`],n);else if(e!==void 0)n(e,Dt());else{var r={exports:{}};n(r.exports,t.reactSwipe),t.index=r.exports}})(e,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(e){return e&&e.__esModule?e:{default:e}}e.default=n.default})})),kt=s(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(kt());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.default={ROOT:function(e){return(0,t.default)(r({"carousel-root":!0},e||``,!!e))},CAROUSEL:function(e){return(0,t.default)({carousel:!0,"carousel-slider":e})},WRAPPER:function(e,n){return(0,t.default)({"thumbs-wrapper":!e,"slider-wrapper":e,"axis-horizontal":n===`horizontal`,"axis-vertical":n!==`horizontal`})},SLIDER:function(e,n){return(0,t.default)({thumbs:!e,slider:e,animated:!n})},ITEM:function(e,n,r){return(0,t.default)({thumb:!e,slide:e,selected:n,previous:r})},ARROW_PREV:function(e){return(0,t.default)({"control-arrow control-prev":!0,"control-disabled":e})},ARROW_NEXT:function(e){return(0,t.default)({"control-arrow control-next":!0,"control-disabled":e})},DOT:function(e){return(0,t.default)({dot:!0,selected:e})}}})),jt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.outerWidth=void 0,e.outerWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft)+parseInt(n.marginRight),t}})),Mt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(e,t,n){var r=e===0?e:e+t;return`translate3d`+(`(`+(n===`horizontal`?[r,0,0]:[0,r,0]).join(`,`)+`)`)}})),Nt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){return window}})),Pt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(f()),n=s(At()),r=jt(),i=s(Mt()),a=s(Ot()),o=s(Nt());function s(e){return e&&e.__esModule?e:{default:e}}function c(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(e===null||u(e)!==`object`&&typeof e!=`function`)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function u(e){"@babel/helpers - typeof";return u=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},u(e)}function d(){return d=Object.assign||function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){return e.hasOwnProperty(`key`)},T=function(e){g(c,e);var s=v(c);function c(e){var n;return p(this,c),n=s.call(this,e),C(b(n),`itemsWrapperRef`,void 0),C(b(n),`itemsListRef`,void 0),C(b(n),`thumbsRef`,void 0),C(b(n),`setItemsWrapperRef`,function(e){n.itemsWrapperRef=e}),C(b(n),`setItemsListRef`,function(e){n.itemsListRef=e}),C(b(n),`setThumbsRef`,function(e,t){n.thumbsRef||=[],n.thumbsRef[t]=e}),C(b(n),`updateSizes`,function(){if(!(!n.props.children||!n.itemsWrapperRef||!n.thumbsRef)){var e=t.Children.count(n.props.children),i=n.itemsWrapperRef.clientWidth,a=n.props.thumbWidth?n.props.thumbWidth:(0,r.outerWidth)(n.thumbsRef[0]),o=Math.floor(i/a),s=o0&&(r=0),s===c&&r<0&&(r=0);var l=s+100/(n.itemsWrapperRef.clientWidth/r);return n.itemsListRef&&[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(e){n.itemsListRef.style[e]=(0,i.default)(l,`%`,n.props.axis)}),!0}),C(b(n),`slideRight`,function(e){n.moveTo(n.state.firstItem-(typeof e==`number`?e:1))}),C(b(n),`slideLeft`,function(e){n.moveTo(n.state.firstItem+(typeof e==`number`?e:1))}),C(b(n),`moveTo`,function(e){e=e<0?0:e,e=e>=n.state.lastPosition?n.state.lastPosition:e,n.setState({firstItem:e})}),n.state={selectedItem:e.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},n}return h(c,[{key:`componentDidMount`,value:function(){this.setupThumbs()}},{key:`componentDidUpdate`,value:function(e){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==e.children&&this.updateSizes()}},{key:`componentWillUnmount`,value:function(){this.destroyThumbs()}},{key:`setupThumbs`,value:function(){(0,o.default)().addEventListener(`resize`,this.updateSizes),(0,o.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.updateSizes()}},{key:`destroyThumbs`,value:function(){(0,o.default)().removeEventListener(`resize`,this.updateSizes),(0,o.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes)}},{key:`getFirstItem`,value:function(e){var t=e;return e>=this.state.lastPosition&&(t=this.state.lastPosition),e1,o=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){return document}})),It=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setPosition=e.getPosition=e.isKeyboardEvent=e.defaultStatusFormatter=e.noop=void 0;var t=f(),n=r(Mt());function r(e){return e&&e.__esModule?e:{default:e}}e.noop=function(){},e.defaultStatusFormatter=function(e,t){return`${e} of ${t}`},e.isKeyboardEvent=function(e){return e?e.hasOwnProperty(`key`):!1},e.getPosition=function(e,n){if(n.infiniteLoop&&++e,e===0)return 0;var r=t.Children.count(n.children);if(n.centerMode&&n.axis===`horizontal`){var i=-e*n.centerSlidePercentage,a=r-1;return e&&(e!==a||n.infiniteLoop)?i+=(100-n.centerSlidePercentage)/2:e===a&&(i+=100-n.centerSlidePercentage),i}return-e*100},e.setPosition=function(e,t){var r={};return[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(i){r[i]=(0,n.default)(e,`%`,t)}),r}})),Lt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fadeAnimationHandler=e.slideStopSwipingHandler=e.slideSwipeAnimationHandler=e.slideAnimationHandler=void 0;var t=f(),n=i(Mt()),r=It();function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;tl))return c<0?e.centerMode&&e.centerSlidePercentage&&e.axis===`horizontal`?a.itemListStyle=(0,r.setPosition)(-(l+2)*e.centerSlidePercentage-(100-e.centerSlidePercentage)/2,e.axis):a.itemListStyle=(0,r.setPosition)(-(l+2)*100,e.axis):c>l&&(a.itemListStyle=(0,r.setPosition)(0,e.axis)),a;var u=(0,r.getPosition)(s,e),d=(0,n.default)(u,`%`,e.axis),f=e.transitionTime+`ms`;return a.itemListStyle={WebkitTransform:d,msTransform:d,OTransform:d,transform:d},i.swiping||(a.itemListStyle=o(o({},a.itemListStyle),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),a},e.slideSwipeAnimationHandler=function(e,n,i,a){var o={},s=n.axis===`horizontal`,c=t.Children.count(n.children),l=0,u=(0,r.getPosition)(i.selectedItem,n),d=n.infiniteLoop?(0,r.getPosition)(c-1,n)-100:(0,r.getPosition)(c-1,n),f=s?e.x:e.y,p=f;u===l&&f>0&&(p=0),u===d&&f<0&&(p=0);var m=u+100/(i.itemSize/p),h=Math.abs(f)>n.swipeScrollTolerance;return n.infiniteLoop&&h&&(i.selectedItem===0&&m>-100?m-=c*100:i.selectedItem===c-1&&m<-c*100&&(m+=c*100)),(!n.preventMovementUntilSwipeScrollTolerance||h||i.swipeMovementStarted)&&(i.swipeMovementStarted||a({swipeMovementStarted:!0}),o.itemListStyle=(0,r.setPosition)(m,n.axis)),h&&!i.cancelClick&&a({cancelClick:!0}),o},e.slideStopSwipingHandler=function(e,t){var n=(0,r.getPosition)(t.selectedItem,e);return{itemListStyle:(0,r.setPosition)(n,e.axis)}},e.fadeAnimationHandler=function(e,t){var n=e.transitionTime+`ms`,r=`ease-in-out`,i={position:`absolute`,display:`block`,zIndex:-2,minHeight:`100%`,opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return t.swiping||(i=o(o({},i),{},{WebkitTransitionDuration:n,MozTransitionDuration:n,OTransitionDuration:n,transitionDuration:n,msTransitionDuration:n})),{slideStyle:i,selectedStyle:o(o({},i),{},{opacity:1,position:`relative`}),prevStyle:o({},i)}}})),Rt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=d(f()),n=l(Ot()),r=l(At()),i=l(Pt()),a=l(Ft()),o=l(Nt()),s=It(),c=Lt();function l(e){return e&&e.__esModule?e:{default:e}}function u(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return u=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(e===null||p(e)!==`object`&&typeof e!=`function`)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function p(e){"@babel/helpers - typeof";return p=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},p(e)}function m(){return m=Object.assign||function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=function(e){b(u,e);var l=S(u);function u(e){var n;_(this,u),n=l.call(this,e),D(w(n),`thumbsRef`,void 0),D(w(n),`carouselWrapperRef`,void 0),D(w(n),`listRef`,void 0),D(w(n),`itemsRef`,void 0),D(w(n),`timer`,void 0),D(w(n),`animationHandler`,void 0),D(w(n),`setThumbsRef`,function(e){n.thumbsRef=e}),D(w(n),`setCarouselWrapperRef`,function(e){n.carouselWrapperRef=e}),D(w(n),`setListRef`,function(e){n.listRef=e}),D(w(n),`setItemsRef`,function(e,t){n.itemsRef||=[],n.itemsRef[t]=e}),D(w(n),`autoPlay`,function(){t.Children.count(n.props.children)<=1||(n.clearAutoPlay(),n.props.autoPlay&&(n.timer=setTimeout(function(){n.increment()},n.props.interval)))}),D(w(n),`clearAutoPlay`,function(){n.timer&&clearTimeout(n.timer)}),D(w(n),`resetAutoPlay`,function(){n.clearAutoPlay(),n.autoPlay()}),D(w(n),`stopOnHover`,function(){n.setState({isMouseEntered:!0},n.clearAutoPlay)}),D(w(n),`startOnLeave`,function(){n.setState({isMouseEntered:!1},n.autoPlay)}),D(w(n),`isFocusWithinTheCarousel`,function(){return n.carouselWrapperRef?!!((0,a.default)().activeElement===n.carouselWrapperRef||n.carouselWrapperRef.contains((0,a.default)().activeElement)):!1}),D(w(n),`navigateWithKeyboard`,function(e){if(n.isFocusWithinTheCarousel()){var t=n.props.axis===`horizontal`,r={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},i=t?r.ArrowRight:r.ArrowDown,a=t?r.ArrowLeft:r.ArrowUp;i===e.keyCode?n.increment():a===e.keyCode&&n.decrement()}}),D(w(n),`updateSizes`,function(){if(!(!n.state.initialized||!n.itemsRef||n.itemsRef.length===0)){var e=n.props.axis===`horizontal`,t=n.itemsRef[0];if(t){var r=e?t.clientWidth:t.clientHeight;n.setState({itemSize:r}),n.thumbsRef&&n.thumbsRef.updateSizes()}}}),D(w(n),`setMountState`,function(){n.setState({hasMount:!0}),n.updateSizes()}),D(w(n),`handleClickItem`,function(e,r){if(t.Children.count(n.props.children)!==0){if(n.state.cancelClick){n.setState({cancelClick:!1});return}n.props.onClickItem(e,r),e!==n.state.selectedItem&&n.setState({selectedItem:e})}}),D(w(n),`handleOnChange`,function(e,r){t.Children.count(n.props.children)<=1||n.props.onChange(e,r)}),D(w(n),`handleClickThumb`,function(e,t){n.props.onClickThumb(e,t),n.moveTo(e)}),D(w(n),`onSwipeStart`,function(e){n.setState({swiping:!0}),n.props.onSwipeStart(e)}),D(w(n),`onSwipeEnd`,function(e){n.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),n.props.onSwipeEnd(e),n.clearAutoPlay(),n.state.autoPlay&&n.autoPlay()}),D(w(n),`onSwipeMove`,function(e,t){n.props.onSwipeMove(t);var r=n.props.swipeAnimationHandler(e,n.props,n.state,n.setState.bind(w(n)));return n.setState(g({},r)),!!Object.keys(r).length}),D(w(n),`decrement`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem-(typeof e==`number`?e:1))}),D(w(n),`increment`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem+(typeof e==`number`?e:1))}),D(w(n),`moveTo`,function(e){if(typeof e==`number`){var r=t.Children.count(n.props.children)-1;e<0&&(e=n.props.infiniteLoop?r:0),e>r&&(e=n.props.infiniteLoop?0:r),n.selectItem({selectedItem:e}),n.state.autoPlay&&n.state.isMouseEntered===!1&&n.resetAutoPlay()}}),D(w(n),`onClickNext`,function(){n.increment(1)}),D(w(n),`onClickPrev`,function(){n.decrement(1)}),D(w(n),`onSwipeForward`,function(){n.increment(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`onSwipeBackwards`,function(){n.decrement(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`changeItem`,function(e){return function(t){(!(0,s.isKeyboardEvent)(t)||t.key===`Enter`)&&n.moveTo(e)}}),D(w(n),`selectItem`,function(e){n.setState(g({previousItem:n.state.selectedItem},e),function(){n.setState(n.animationHandler(n.props,n.state))}),n.handleOnChange(e.selectedItem,t.Children.toArray(n.props.children)[e.selectedItem])}),D(w(n),`getInitialImage`,function(){var e=n.props.selectedItem,t=n.itemsRef&&n.itemsRef[e];return(t&&t.getElementsByTagName(`img`)||[])[0]}),D(w(n),`getVariableItemHeight`,function(e){var t=n.itemsRef&&n.itemsRef[e];if(n.state.hasMount&&t&&t.children.length){var r=t.children[0].getElementsByTagName(`img`)||[];if(r.length>0){var i=r[0];i.complete||i.addEventListener(`load`,function e(){n.forceUpdate(),i.removeEventListener(`load`,e)})}var a=(r[0]||t.children[0]).clientHeight;return a>0?a:null}return null});var r={initialized:!1,previousItem:e.selectedItem,selectedItem:e.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:e.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return n.animationHandler=typeof e.animationHandler==`function`&&e.animationHandler||e.animationHandler===`fade`&&c.fadeAnimationHandler||c.slideAnimationHandler,n.state=g(g({},r),n.animationHandler(e,r)),n}return y(u,[{key:`componentDidMount`,value:function(){this.props.children&&this.setupCarousel()}},{key:`componentDidUpdate`,value:function(e,t){!e.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!e.autoFocus&&this.props.autoFocus&&this.forceFocus(),t.swiping&&!this.state.swiping&&this.setState(g({},this.props.stopSwipingHandler(this.props,this.state))),(e.selectedItem!==this.props.selectedItem||e.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),e.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:`componentWillUnmount`,value:function(){this.destroyCarousel()}},{key:`setupCarousel`,value:function(){var e=this;this.bindEvents(),this.state.autoPlay&&t.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var t=e.getInitialImage();t&&!t.complete?t.addEventListener(`load`,e.setMountState):e.setMountState()})}},{key:`destroyCarousel`,value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:`setupAutoPlay`,value:function(){this.autoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.addEventListener(`mouseenter`,this.stopOnHover),e.addEventListener(`mouseleave`,this.startOnLeave))}},{key:`destroyAutoPlay`,value:function(){this.clearAutoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.removeEventListener(`mouseenter`,this.stopOnHover),e.removeEventListener(`mouseleave`,this.startOnLeave))}},{key:`bindEvents`,value:function(){(0,o.default)().addEventListener(`resize`,this.updateSizes),(0,o.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.props.useKeyboardArrows&&(0,a.default)().addEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`unbindEvents`,value:function(){(0,o.default)().removeEventListener(`resize`,this.updateSizes),(0,o.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes);var e=this.getInitialImage();e&&e.removeEventListener(`load`,this.setMountState),this.props.useKeyboardArrows&&(0,a.default)().removeEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`forceFocus`,value:function(){var e;(e=this.carouselWrapperRef)==null||e.focus()}},{key:`renderItems`,value:function(e){var n=this;return this.props.children?t.Children.map(this.props.children,function(i,a){var o=a===n.state.selectedItem,s=a===n.state.previousItem,c=o&&n.state.selectedStyle||s&&n.state.prevStyle||n.state.slideStyle||{};n.props.centerMode&&n.props.axis===`horizontal`&&(c=g(g({},c),{},{minWidth:n.props.centerSlidePercentage+`%`})),n.state.swiping&&n.state.swipeMovementStarted&&(c=g(g({},c),{},{pointerEvents:`none`}));var l={ref:function(e){return n.setItemsRef(e,a)},key:`itemKey`+a+(e?`clone`:``),className:r.default.ITEM(!0,a===n.state.selectedItem,a===n.state.previousItem),onClick:n.handleClickItem.bind(n,a,i),style:c};return t.default.createElement(`li`,l,n.props.renderItem(i,{isSelected:a===n.state.selectedItem,isPrevious:a===n.state.previousItem}))}):[]}},{key:`renderControls`,value:function(){var e=this,n=this.props,r=n.showIndicators,i=n.labels,a=n.renderIndicator,o=n.children;return r?t.default.createElement(`ul`,{className:`control-dots`},t.Children.map(o,function(t,n){return a&&a(e.changeItem(n),n===e.state.selectedItem,n,i.item)})):null}},{key:`renderStatus`,value:function(){return this.props.showStatus?t.default.createElement(`p`,{className:`carousel-status`},this.props.statusFormatter(this.state.selectedItem+1,t.Children.count(this.props.children))):null}},{key:`renderThumbs`,value:function(){return!this.props.showThumbs||!this.props.children||t.Children.count(this.props.children)===0?null:t.default.createElement(i.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:`render`,value:function(){var e=this;if(!this.props.children||t.Children.count(this.props.children)===0)return null;var i=this.props.swipeable&&t.Children.count(this.props.children)>1,a=this.props.axis===`horizontal`,o=this.props.showArrows&&t.Children.count(this.props.children)>1,s=o&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,c=o&&(this.state.selectedItem{})),Bt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Rt()),n=zt(),r=i(Pt());function i(e){return e&&e.__esModule?e:{default:e}}})),Vt=s(((e,t)=>{var n=A();t.exports=function(){return n.Date.now()}})),Ht=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),Ut=s(((e,t)=>{var n=Ht(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),Wt=s(((e,t)=>{var n=Ut(),r=re(),i=ne(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Gt=s(((e,t)=>{var n=re(),r=Vt(),i=Wt(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),L=u(f(),1),Kt=u(Gt(),1);E();function qt(e,t,n,r,i=!1){let a=L.useRef();a.current=t,L.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;let t=n,o=e=>{a.current?.call(t,e)};return t.addEventListener(e,o,{passive:r,capture:i}),()=>{t.removeEventListener(e,o,{capture:i})}},[e,n,r,i])}function Jt(e,t){return e===void 0?void 0:t}var Yt=Math.PI;function Xt(e){return e*Yt/180}var Zt=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Qt=(e,t,n,r,i)=>{switch(e){case`left`:return Math.floor(t)+r+i/2;case`center`:return Math.floor(t+n/2);case`right`:return Math.floor(t+n)-r-i/2}},$t=(e,t,n)=>Math.min(e,t-n*2),en=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,tn=e=>{let t=e.fgColor??`currentColor`;return L.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}),L.createElement(`path`,{d:`M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}))},nn=e=>{let t=e.fgColor??`currentColor`;return L.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M19 6L10.3802 17L5.34071 11.8758`,vectorEffect:`non-scaling-stroke`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}))};function rn(e,t,n){let[r,i]=L.useState(e),a=L.useRef(!0);L.useEffect(()=>()=>{a.current=!1},[]);let o=L.useRef((0,Kt.default)(e=>{a.current&&i(e)},n));return L.useLayoutEffect(()=>{a.current&&o.current(()=>e())},t),r}var an=RegExp(`^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]`);function R(e){return an.test(e)?`rtl`:`not-rtl`}var on=void 0;function sn(){if(typeof document>`u`)return 0;if(on!==void 0)return on;let e=document.createElement(`p`);e.style.width=`100%`,e.style.height=`200px`;let t=document.createElement(`div`);t.id=`testScrollbar`,t.style.position=`absolute`,t.style.top=`0px`,t.style.left=`0px`,t.style.visibility=`hidden`,t.style.width=`200px`,t.style.height=`150px`,t.style.overflow=`hidden`,t.append(e),document.body.append(t);let n=e.offsetWidth;t.style.overflow=`scroll`;let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),on=n-r,on}var cn=Symbol();function ln(e){let t=L.useRef([cn,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;let[n,r]=L.useState(e),[,i]=L.useState(),a=L.useCallback(e=>{let n=t.current[0];n!==cn&&(e=typeof e==`function`?e(n):e,e===n)||(n!==cn&&i({}),r(t=>typeof e==`function`?e(n===cn?t:n):e),t.current[0]=cn)},[]),o=L.useCallback(()=>{t.current[0]=cn,i({})},[]);return[t.current[0]===cn?n:t.current[0],a,o]}function un(e){if(e.length===0)return``;let t=0,n=0;for(let r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(`, `)}function dn(e){let t=L.useRef(e);return w(e,t.current)||(t.current=e),t.current}var fn=Bt(),pn=e=>{let{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,a=t.filter(e=>e!==``);if(a.length===0)return null;let o=a.length>1;return L.createElement(Ct,{"data-testid":`GDG-default-image-overlay-editor`},L.createElement(fn.Carousel,{showArrows:o,showThumbs:!1,swipeable:o,emulateTouch:o,infiniteLoop:o},a.map(e=>{let t=i?.(e)??L.createElement(`img`,{draggable:!1,src:e});return L.createElement(`div`,{className:`gdg-centering-container`,key:e},t)})),n&&r&&L.createElement(`button`,{className:`gdg-edit-icon`,onClick:r},L.createElement(tn,null)))};function z(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:``,highlight:null,hooks:null,langPrefix:`language-`,mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var mn=z();function hn(e){mn=e}var gn=/[&<>"']/,_n=new RegExp(gn.source,`g`),vn=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,yn=new RegExp(vn.source,`g`),bn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},xn=e=>bn[e];function Sn(e,t){if(t){if(gn.test(e))return e.replace(_n,xn)}else if(vn.test(e))return e.replace(yn,xn);return e}var Cn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function wn(e){return e.replace(Cn,(e,t)=>(t=t.toLowerCase(),t===`colon`?`:`:t.charAt(0)===`#`?t.charAt(1)===`x`?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):``))}var Tn=/(^|[^\[])\^/g;function En(e,t){e=typeof e==`string`?e:e.source,t||=``;let n={replace:(t,r)=>(r=r.source||r,r=r.replace(Tn,`$1`),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}var Dn=/[^\w:]/g,On=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function kn(e,t,n){if(e){let e;try{e=decodeURIComponent(wn(n)).replace(Dn,``).toLowerCase()}catch{return null}if(e.indexOf(`javascript:`)===0||e.indexOf(`vbscript:`)===0||e.indexOf(`data:`)===0)return null}t&&!On.test(n)&&(n=Pn(t,n));try{n=encodeURI(n).replace(/%25/g,`%`)}catch{return null}return n}var An={},jn=/^[^:]+:\/*[^/]*$/,Mn=/^([^:]+:)[\s\S]*$/,Nn=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Pn(e,t){An[` `+e]||(jn.test(e)?An[` `+e]=e+`/`:An[` `+e]=Ln(e,`/`,!0)),e=An[` `+e];let n=e.indexOf(`:`)===-1;return t.substring(0,2)===`//`?n?t:e.replace(Mn,`$1`)+t:t.charAt(0)===`/`?n?t:e.replace(Nn,`$1`)+t:e+t}var Fn={exec:function(){}};function In(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Vn(e,t,n,r){let i=t.href,a=t.title?Sn(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:Sn(o)}}function Hn(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(` `).map(e=>{let t=e.match(/^\s+/);if(t===null)return e;let[n]=t;return n.length>=r.length?e.slice(r.length):e}).join(` `)}var Un=class{constructor(e){this.options=e||mn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Ln(e,` `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Hn(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=Ln(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/^ *>[ \t]?/gm,``),n=this.lexer.state.top;this.lexer.state.top=!0;let r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:`blockquote`,raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,i,a,o,s,c,l,u,d,f,p,m=t[1].trim(),h=m.length>1,g={type:`list`,raw:``,ordered:h,start:h?+m.slice(0,-1):``,loose:!1,items:[]};m=h?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=h?m:`[*+-]`);let _=RegExp(`^( {0,3}${m})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,!(!(t=_.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),l=t[2].split(` @@ -165,17 +165,17 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`

An error -`}};function eee(e,t){return e===`normal`?[t.bgIconHeader,t.fgIconHeader]:e===`selected`?[`white`,t.accentColor]:[t.accentColor,t.bgHeader]}var fa=class{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(e,t){this.onSettled=t,this.headerIcons=e??{}}drawSprite(e,t,n,r,i,a,o,s=1){let[c,l]=eee(t,o),u=a*Math.ceil(window.devicePixelRatio),d=`${c}_${l}_${u}_${e}`,f=this.spriteMap.get(d);if(f===void 0){let t=this.headerIcons[e];if(t===void 0)return;f=document.createElement(`canvas`);let n=f.getContext(`2d`);if(n===null)return;let r=new Image;r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t({fgColor:l,bgColor:c}))}`,this.spriteMap.set(d,f);let i=r.decode();if(i===void 0)return;this.inFlight++,i.then(()=>{n.drawImage(r,0,0,u,u)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(n.globalAlpha=s),n.drawImage(f,0,0,u,u,r,i,a,a),s<1&&(n.globalAlpha=1)}};function pa(e){if(e.length===0)return;let t;for(let n of e)t=Math.min(t??n.y,n.y)}function ma(e,t,n,r,i,a,o,s,c){s??=t;let l=t,u=e,d=r-a,f=!1;for(;ls&&c(l,u,e,!1,o&&u===r-1)===!0){f=!0;break}l+=e,u++}if(!f){l=n;for(let e=0;e!e.sticky)?.sourceIndex??0;if(c>d){let e=Math.max(s,d),l=t,f=r;for(let t=a.sourceIndex-1;t>=e;t--)l-=o[t].width,f+=o[t].width;for(let e=a.sourceIndex+1;e<=c;e++)f+=o[e].width;u={x:l,y:n,width:f,height:i}}if(d>s){let e=Math.min(c,d-1),u=t,f=r;for(let e=a.sourceIndex-1;e>=s;e--)u-=o[e].width,f+=o[e].width;for(let t=a.sourceIndex+1;t<=e;t++)f+=o[t].width;l={x:u,y:n,width:f,height:i}}return[l,u]}function va(e,t,n,r){if(r===`any`)return xa(e,{x:t,y:n,width:1,height:1});if(r===`vertical`&&(t=e.x),r===`horizontal`&&(n=e.y),Mr([t,n],e))return;let i=t-e.x,a=e.x+e.width-t,o=n-e.y+1,s=e.y+e.height-n,c=Math.min(r===`vertical`?2**53-1:i,r===`vertical`?2**53-1:a,r===`horizontal`?2**53-1:o,r===`horizontal`?2**53-1:s);return c===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:c===o?{x:e.x,y:n,width:e.width,height:e.y-n}:c===a?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function ya(e,t,n,r,i,a,o,s){return e<=i+o&&i<=e+n&&t<=a+s&&a<=t+r}function ba(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function xa(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function Sa(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Ca(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;let i=t+4,a=n+4,o=-4-e.x,s=e.x+e.width-i,c=-4-e.y,l=e.y+e.height-a,u=o>0?e.x+Math.floor(o/r)*r:e.x,d=s>0?e.x+e.width-Math.floor(s/r)*r:e.x+e.width,f=c>0?e.y+Math.floor(c/r)*r:e.y,p=l>0?e.y+e.height-Math.floor(l/r)*r:e.y+e.height;return{x:u,y:f,width:d-u,height:p-f}}function wa(e,t,n,r,i){let[a,o,s,c]=t,[l,u,d,f]=i,{x:p,y:m,width:h,height:g}=e,_=[];if(h<=0||g<=0)return _;let v=p+h,y=m+g,b=ps,C=m+g>c,w=p>=a&&pa&&v<=s||ps,T=m>=o&&mo&&y<=c||mc;if(w&&T){let e=Math.max(p,a),t=Math.max(m,o),n=Math.min(v,s),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:u,width:d-l+1,height:f-u+1}})}if(b&&x){let e=p,t=m,n=Math.min(v,a),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:0,width:l+1,height:u+1}})}if(x&&w){let e=Math.max(p,a),t=m,n=Math.min(v,s),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:0,width:d-l+1,height:u+1}})}if(x&&S){let e=Math.max(p,s),t=m,r=v,i=Math.min(y,o);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:0,width:n-d+1,height:u+1}})}if(b&&T){let e=p,t=Math.max(m,o),n=Math.min(v,a),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:u,width:l+1,height:f-u+1}})}if(S&&T){let e=Math.max(p,s),t=Math.max(m,o),r=v,i=Math.min(y,c);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:u,width:n-d+1,height:f-u+1}})}if(b&&C){let e=p,t=Math.max(m,c),n=Math.min(v,a),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:0,y:f,width:l+1,height:r-f+1}})}if(C&&w){let e=Math.max(p,a),t=Math.max(m,c),n=Math.min(v,s),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:l,y:f,width:d-l+1,height:r-f+1}})}if(S&&C){let e=Math.max(p,s),t=Math.max(m,c),i=v,a=y;_.push({rect:{x:e,y:t,width:i-e,height:a-t},clip:{x:d,y:f,width:n-d+1,height:r-f+1}})}return _}ct(),Ti(),vr();var Ta={kind:I.Loading,allowOverlay:!1};function Ea(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,ee,N){let te=y?.size??2**53-1,ne=performance.now(),P=k.baseFontFull;e.font=P;let re={ctx:e},F=[0,0],ie=g>0?zr(c,g,l):0,ae,oe,se=pa(v);return ha(t,s,a,o,i,(t,a,o,s,ce)=>{let le=Math.max(0,s-a),ue=a+le,de=i+1,fe=t.width-le,pe=r-i-1;if(v.length>0){let e=!1;for(let t=0;t{e.save(),e.beginPath(),e.rect(ue,de,fe,pe),e.clip()},he=b.columns.hasIndex(t.sourceIndex),ge=d(t.group??``).overrideTheme,_e=t.themeOverride===void 0&&ge===void 0?k:xi(k,ge,t.themeOverride),ve=_e.baseFontFull;ve!==P&&(P=ve,e.font=ve),me();let ye;return ma(ce,o,r,c,l,g,_,se,(i,o,l,d,g)=>{if(o<0||(F[0]=t.sourceIndex,F[1]=o,y!==void 0&&!y.has(F)))return;if(v.length>0){let e=!1;for(let n=0;nce.span!==void 0&&e>=ce.span[0]&&e<=ce.span[1]);xe&&!m&&h?Se=0:xe&&h&&(Se=Math.max(Se,1)),Ce&&Se++,xe||(_&&Se++,he&&!g&&Se++);let we=ce.kind===I.Protected?be.bgCellMedium:be.bgCell,Te;if((d||we!==k.bgCell)&&(Te=mr(we,Te)),Se>0||se){se&&(Te=mr(be.bgHeader,Te));for(let e=0;eN&&!fe){let n=be.baseFontFull;n!==P&&(e.font=n,P=n),ye=Ma(e,ce,t.sourceIndex,o,De,Oe,le,i,ue,l,Se>0,be,Te??be.bgCell,C,w,ke?.hoverAmount??0,E,O,ne,D,ye,A,j,M,ee)}return Ee&&e.restore(),ce.style===`faded`&&(e.globalAlpha=1),te--,de&&(e.restore(),ye?.deprep?.(re),ye=void 0,me(),P=ve,e.font=ve),te<=0}),e.restore(),te<=0}),ae}var Da=[0,0],Oa={x:0,y:0,width:0,height:0},ka=[void 0,()=>void 0],Aa=!1;function ja(){Aa=!0}function Ma(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w){let T,E;g!==void 0&&g[0][0]===n&&g[0][1]===r&&(T=g[1][0],E=g[1][1]);let D;Da[0]=n,Da[1]=r,Oa.x=o,Oa.y=s,Oa.width=c,Oa.height=l,ka[0]=S.getValue(Da),ka[1]=e=>S.setValue(Da,e),Aa=!1;let O={ctx:e,theme:d,col:n,row:r,cell:t,rect:Oa,highlighted:u,cellFillColor:f,hoverAmount:h,frameTime:v,hoverX:T,drawState:ka,hoverY:E,imageLoader:p,spriteManager:m,hyperWrapping:_,overrideCursor:T===void 0?void 0:w,requestAnimationFrame:ja},k=ei(O,t.lastUpdated,v,b,i,a),A=C(t);if(A!==void 0){b?.renderer!==A&&(b?.deprep?.(O),b=void 0);let e=A.drawPrep?.(O,b);y!==void 0&&!Ze(O.cell)?y(O,()=>A.draw(O,t)):A.draw(O,t),D=e===void 0?void 0:{deprep:e?.deprep,fillStyle:e?.fillStyle,font:e?.font,renderer:A}}return(k||Aa)&&x?.(Da),D}E(),ct();function Na(e,t,n,r,i,a,o,s,c=-20,l=-20,u=32,d=`center`,f=`square`){let p=Math.floor(i+o/2),m=f===`circle`?1e4:t.roundingRadius??4,h=$t(u,o,t.cellVerticalPadding),g=h/2,_=Qt(d,r,a,t.cellHorizontalPadding,h),v=Zt(_,p,h),y=en(r+c,i+l,v);switch(n){case!0:e.beginPath(),si(e,_-h/2,p-h/2,h,h,m),f===`circle`&&(g*=.8,h*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(_-g+h/4.23,p-g+h/1.97),e.lineTo(_-g+h/2.42,p-g+h/1.44),e.lineTo(_-g+h/1.29,p-g+h/3.25),e.strokeStyle=t.bgCell,e.lineJoin=`round`,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;case null:case!1:e.beginPath(),si(e,_-h/2+.5,p-h/2+.5,h-1,h-1,m),e.lineWidth=1,e.strokeStyle=y?t.textDark:t.textMedium,e.stroke();break;case void 0:e.beginPath(),si(e,_-h/2,p-h/2,h,h,m),e.fillStyle=y?t.textMedium:t.textLight,e.fill(),f===`circle`&&(g*=.8,h*=.8),e.beginPath(),e.moveTo(_-h/3,p),e.lineTo(_+h/3,p),e.strokeStyle=t.bgCell,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;default:S(n)}}Ti(),vr(),ct();function Pa(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=o+s;if(y<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,y);let[b,x]=r?.[0]??[];e.font=d.headerFontFull,ha(t,0,a,0,y,(t,r,i,a)=>{if(g!==void 0&&!g.has([t.sourceIndex,-1]))return;let m=Math.max(0,a-r);e.save(),e.beginPath(),e.rect(r+m,s,t.width-m,o),e.clip();let y=h(t.group??``).overrideTheme,S=t.themeOverride===void 0&&y===void 0?d:xi(d,y,t.themeOverride);S.bgHeader!==d.bgHeader&&(e.fillStyle=S.bgHeader,e.fill()),S!==d&&(e.font=S.baseFontFull);let C=u.columns.hasIndex(t.sourceIndex),w=c!==void 0||l,T=!w&&x===-1&&b===t.sourceIndex,E=w?0:p.find(e=>e.item[0]===t.sourceIndex&&e.item[1]===-1)?.hoverAmount??0,D=u?.current!==void 0&&u.current.cell[0]===t.sourceIndex,O=C?S.accentColor:D?S.bgHeaderHasFocus:S.bgHeader,k=n?s:0,A=t.sourceIndex===0?0:1;C?(e.fillStyle=O,e.fillRect(r+A,k,t.width-A,o)):(D||E>0)&&(e.beginPath(),e.rect(r+A,k,t.width-A,o),D&&(e.fillStyle=S.bgHeaderHasFocus,e.fill()),E>0&&(e.globalAlpha=E,e.fillStyle=S.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Ba(e,r,k,t.width,o,t,C,S,T,D,E,f,_,v),e.restore()}),n&&Fa(e,t,i,a,s,r,d,f,p,m,h,g)}function Fa(e,t,n,r,i,a,o,s,c,l,u,d){let[f,p]=a?.[0]??[],m=0;ga(t,n,r,i,(t,n,r,c,h,g)=>{if(d!==void 0&&!d.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(r,c,h,g),e.clip();let _=u(n),v=_?.overrideTheme===void 0?o:xi(o,_.overrideTheme),y=p===-2&&f!==void 0&&f>=t[0]&&f<=t[1],b=y?v.bgHeaderHovered:v.bgHeader;if(b!==o.bgHeader&&(e.fillStyle=b,e.fill()),e.fillStyle=v.textGroupHeader??v.textHeader,_!==void 0){let t=r;if(_.icon!==void 0&&(s.drawSprite(_.icon,`normal`,e,t+8,(i-20)/2,20,v),t+=26),e.fillText(_.name,t+8,i/2+Xr(e,o.headerFontFull)),_.actions!==void 0&&y){let t=Ra({x:r,y:c,width:h,height:g},_.actions);e.beginPath();let n=t[0].x-10,o=r+h-n;e.rect(n,0,o,i);let l=e.createLinearGradient(n,0,n+o,0),u=fr(b,0);l.addColorStop(0,u),l.addColorStop(10/o,b),l.addColorStop(1,b),e.fillStyle=l,e.fill(),e.globalAlpha=.6;let[d,f]=a?.[1]??[-1,-1];for(let n=0;n<_.actions.length;n++){let i=_.actions[n],a=t[n],o=ba(a,d+r,f);o&&(e.globalAlpha=1),s.drawSprite(i.icon,`normal`,e,a.x+a.width/2-10,a.y+a.height/2-10,20,v),o&&(e.globalAlpha=.6)}e.globalAlpha=1}}r!==0&&l(t[0])&&(e.beginPath(),e.moveTo(r+.5,0),e.lineTo(r+.5,i),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=r+h}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()}var Ia=30;function La(e,t,n,r,i){return i?{x:e,y:t,width:Ia,height:Math.min(Ia,r)}:{x:e+n-Ia,y:Math.max(t,t+r/2-Ia/2),width:Ia,height:Math.min(Ia,r)}}function Ra(e,t){let n=[],r=e.x+e.width-26*t.length,i=e.y+e.height/2-13;for(let e=0;e35){let n=f?35:r-35,i=f?35*.7:r-35*.7,a=n/r,o=i/r,s=e.createLinearGradient(t,0,t+r,0),c=fr(h,0);s.addColorStop(+!!f,h),s.addColorStop(a,h),s.addColorStop(o,c),s.addColorStop(+!f,c),e.fillStyle=s}else e.fillStyle=h;if(f&&(e.textAlign=`right`),e.fillText(a.title,v,n+i/2+Xr(e,s.headerFontFull)),f&&(e.textAlign=`left`),g&&a.hasMenu===!0)if(a.menuIcon===void 0||a.menuIcon===it.Triangle){e.beginPath();let t=p.x+p.width/2-5.5,n=p.y+p.height/2-3;li(e,[{x:t,y:n},{x:t+11,y:n},{x:t+5.5,y:n+6}],1),e.fillStyle=h,e.fill()}else if(a.menuIcon===it.Dots)e.beginPath(),ci(e,p.x+p.width/2,p.y+p.height/2),e.fillStyle=h,e.fill();else{let t=p.x+(p.width-s.headerIconSize)/2,n=p.y+(p.height-s.headerIconSize)/2;u.drawSprite(a.menuIcon,`normal`,e,t,n,s.headerIconSize,s)}}function Ba(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=R(a.title)===`rtl`,h=La(t,n,r,i,m);f===void 0?za(e,t,n,r,i,a,o,s,c,u,d,p,m,h):f({ctx:e,theme:s,rect:{x:t,y:n,width:r,height:i},column:a,columnIndex:a.sourceIndex,isSelected:o,hoverAmount:u,isHovered:c,hasSelectedCell:l,spriteManager:d,menuBounds:h},()=>za(e,t,n,r,i,a,o,s,c,u,d,p,m,h))}var Va=s(((e,t)=>{var n=le();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Ha=s(((e,t)=>{var n=Va();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),Ua=s(((e,t)=>{function n(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),Ga=s(((e,t)=>{t.exports=Wa()()})),Ka=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n{function n(){return!1}t.exports=n})),Ja=s(((e,t)=>{var n=A(),r=qa(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),Ya=s(((e,t)=>{var n=N(),r=We(),i=te(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),Xa=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Za=s(((e,t)=>{var n=k(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),Qa=s(((e,t)=>{var n=Ya(),r=Xa(),i=Za(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),$a=s(((e,t)=>{var n=Ka(),r=He(),i=O(),a=Ja(),o=Ue(),s=Qa(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),eo=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),to=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),no=s(((e,t)=>{t.exports=to()(Object.keys,Object)})),ro=s(((e,t)=>{var n=eo(),r=no(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),io=s(((e,t)=>{var n=$a(),r=ro(),i=$i();function a(e){return i(e)?n(e):r(e)}t.exports=a})),ao=s(((e,t)=>{var n=Ga(),r=io();function i(e,t){return e&&n(e,t,r)}t.exports=i})),oo=s(((e,t)=>{var n=$i();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o{var n=ao();t.exports=oo()(n)})),co=s(((e,t)=>{var n=so();function r(e,t,r,i){return n(e,function(e,n,a){t(i,e,r(e),a)}),i}t.exports=r})),lo=s(((e,t)=>{var n=we();function r(){this.__data__=new n,this.size=0}t.exports=r})),uo=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),fo=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),po=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),mo=s(((e,t)=>{var n=we(),r=Te(),i=Ne(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length{var n=we(),r=lo(),i=uo(),a=fo(),o=po(),s=mo();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),go=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n{var n=Pi(),r=go(),i=Vi(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g{t.exports=A().Uint8Array})),yo=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),bo=s(((e,t)=>{var n=j(),r=vo(),i=ve(),a=_o(),o=yo(),s=Wi(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),xo=s(((e,t)=>{var n=Ji(),r=O();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),So=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n{function n(){return[]}t.exports=n})),wo=s(((e,t)=>{var n=So(),r=Co(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),To=s(((e,t)=>{var n=xo(),r=wo(),i=io();function a(e){return n(e,i,r)}t.exports=a})),Eo=s(((e,t)=>{var n=To(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f{t.exports=le()(A(),`DataView`)})),Oo=s(((e,t)=>{t.exports=le()(A(),`Promise`)})),ko=s(((e,t)=>{t.exports=le()(A(),`WeakMap`)})),Ao=s(((e,t)=>{var n=Do(),r=Te(),i=Oo(),a=Hi(),o=ko(),s=N(),c=oe(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),jo=s(((e,t)=>{var n=ho(),r=_o(),i=bo(),a=Eo(),o=Ao(),s=O(),c=Ja(),l=Qa(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),Mo=s(((e,t)=>{var n=jo(),r=te();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),No=s(((e,t)=>{var n=ho(),r=Mo(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c{var n=re();function r(e){return e===e&&!n(e)}t.exports=r})),Fo=s(((e,t)=>{var n=Po(),r=io();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),Io=s(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),tee=s(((e,t)=>{var n=No(),r=Fo(),i=Io();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Lo=s(((e,t)=>{var n=Be(),r=Ge();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i{var n=Lo();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),zo=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Bo=s(((e,t)=>{var n=zo(),r=Ke();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Vo=s(((e,t)=>{var n=Mo(),r=Ro(),i=Bo(),a=P(),o=Po(),s=Io(),c=Ge(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),Ho=s(((e,t)=>{function n(e){return e}t.exports=n})),Uo=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Wo=s(((e,t)=>{var n=Lo();function r(e){return function(t){return n(t,e)}}t.exports=r})),Go=s(((e,t)=>{var n=Uo(),r=Wo(),i=P(),a=Ge();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),Ko=s(((e,t)=>{var n=tee(),r=Vo(),i=Ho(),a=O(),o=Go();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),qo=s(((e,t)=>{var n=Ua(),r=co(),i=Ko(),a=O();function o(e,t){return function(o,s){var c=a(o)?n:r,l=t?t():{};return c(o,e,i(s,2),l)}}t.exports=o})),Jo=u(s(((e,t)=>{var n=Ha(),r=qo(),i=Object.prototype.hasOwnProperty;t.exports=r(function(e,t,r){i.call(e,r)?e[r].push(t):n(e,r,[t])})}))(),1);Ti(),vr();function Yo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){if(_!==void 0||t[t.length-1]!==n[t.length-1])return;let y=pa(g);ha(t,c,o,s,a,(n,o,s,c,_)=>{if(n!==t[t.length-1])return;o+=n.width;let b=Math.max(o,c);b>r||(e.save(),e.beginPath(),e.rect(b,a+1,1e4,i-a-1),e.clip(),ma(_,s,i,l,u,m,h,y,(t,n,r,i)=>{if(!i&&g.length>0&&!g.some(e=>ya(o,t,1e4,r,e.x,e.y,e.width,e.height)))return;let a=f.hasIndex(n),s=p.hasIndex(n);e.beginPath();let c=d?.(n),l=c===void 0?v:xi(v,c);l.bgCell!==v.bgCell&&(e.fillStyle=l.bgCell,e.fillRect(o,t,1e4,r)),s&&(e.fillStyle=l.bgHeader,e.fillRect(o,t,1e4,r)),a&&(e.fillStyle=l.accentLight,e.fillRect(o,t,1e4,r))}),e.restore())})}function Xo(e,t,n,r,i,a,o,s,c){let l=!1;for(let e of t)if(!e.sticky){l=o(e.sourceIndex);break}let u=c.horizontalBorderColor??c.borderColor,d=c.borderColor,f=l?Rr(t):0,p;if(f!==0&&(p=pr(d,c.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,r),e.strokeStyle=p,e.stroke()),i>0){let t=d===u&&p!==void 0?p:pr(u,c.bgCell),o=zr(a,i,s);e.beginPath(),e.moveTo(0,r-o+.5),e.lineTo(n,r-o+.5),e.strokeStyle=t,e.stroke()}}var Zo=(e,t,n)=>{let r=0,i=t,a=0,o=n;if(e!==void 0&&e.length>0){r=2**53-1,a=2**53-1,i=-(2**53-1),o=-(2**53-1);for(let t of e)r=Math.min(r,t.x-1),i=Math.max(i,t.x+t.width+1),a=Math.min(a,t.y-1),o=Math.max(o,t.y+t.height+1)}return{minX:r,maxX:i,minY:a,maxY:o}};function Qo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=m.bgCell,{minX:g,maxX:_,minY:v,maxY:y}=Zo(s,a,o),b=[],x=o-zr(p,f,l),S=c,C=n,w=0;for(;S+i=v&&e<=y-1){let n=u?.(C)?.bgCell;n!==void 0&&n!==h&&C>=p-f&&b.push({x:g,y:e,w:_-g,h:t,color:n})}S+=t,C0)for(let e=0;e=g&&i<=_&&d(e+1)&&b.push({x:i,y:w,w:n.width,h:E,color:a}),T+=n.width}if(b.length===0)return;let D;e.beginPath();for(let t=b.length-1;t>=0;t--){let n=b[t];D===void 0?D=n.color:n.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=n.color),e.rect(n.x,n.y,n.w,n.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function $o(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=!1){if(c!==void 0){e.beginPath(),e.save(),e.rect(0,0,a,o);for(let t of c)e.rect(t.x+1,t.y+1,t.width-1,t.height-1);e.clip(`evenodd`)}let v=g.horizontalBorderColor??g.borderColor,y=g.borderColor,{minX:b,maxX:x,minY:S,maxY:C}=Zo(s,a,o),w=[];e.beginPath();let T=.5;for(let e=0;e=b&&i<=x&&p(e+1)&&w.push({x1:i,y1:Math.max(l,S),x2:i,y2:Math.min(o,C),color:y})}let E=o+.5;for(let e=h-m;e=S&&n<=C-1){let e=f?.(t);w.push({x1:b,y1:n,x2:x,y2:n,color:e?.horizontalBorderColor??e?.borderColor??v})}e+=d(t),t++}}let D=(0,Jo.default)(w,e=>e.color);for(let t of Object.keys(D)){e.strokeStyle=t;for(let n of D[t])e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke(),e.beginPath()}c!==void 0&&e.restore()}E();function es(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=[];e.imageSmoothingEnabled=!1;let b=Math.min(i.cellYOffset,o),x=Math.max(i.cellYOffset,o),S=0;if(typeof _==`number`)S+=(x-b)*_;else for(let e=b;ei.cellYOffset&&(S=-S),S+=c-i.translateY;let C=Math.min(i.cellXOffset,a),w=Math.max(i.cellXOffset,a),T=0;for(let e=C;ei.cellXOffset&&(T=-T),T+=s-i.translateX;let E=Rr(g);if(T!==0&&S!==0)return{regions:[]};let D=l>0?zr(f,l,_):0,O=u-E-Math.abs(T),k=d-p-D-Math.abs(S)-1;if(O>150&&k>150){let i={sx:0,sy:0,sw:u*m,sh:d*m,dx:0,dy:0,dw:u*m,dh:d*m};if(S>0?(i.sy=(p+1)*m,i.sh=k*m,i.dy=(S+p+1)*m,i.dh=k*m,y.push({x:0,y:p,width:u,height:S+1})):S<0&&(i.sy=(-S+p+1)*m,i.sh=k*m,i.dy=(p+1)*m,i.dh=k*m,y.push({x:0,y:d+S-D,width:u,height:-S+D})),T>0?(i.sx=E*m,i.sw=O*m,i.dx=(T+E)*m,i.dw=O*m,y.push({x:E-1,y:0,width:T+2,height:d})):T<0&&(i.sx=(E-T)*m,i.sw=O*m,i.dx=E*m,i.dw=O*m,y.push({x:u+T,y:0,width:-T,height:d})),e.setTransform(1,0,0,1,0,0),v){if(E>0&&T!==0&&S===0&&(r===void 0||n?.[1]!==!1)){let n=E*m,r=d*m;e.drawImage(t,0,0,n,r,0,0,n,r)}if(D>0&&T===0&&S!==0&&(r===void 0||n?.[0]!==!1)){let n=(d-D)*m,r=u*m,i=D*m;e.drawImage(t,0,n,r,i,0,n,r,i)}}e.drawImage(t,i.sx,i.sy,i.sw,i.sh,i.dx,i.dy,i.dw,i.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:y}}function ts(e,t,n,r,i,a,o,s,c,l){let u=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||ha(c,n,r,i,s,(e,t,n,r)=>{if(e.sourceIndex===l){let e=Math.max(t,r)+1;return u.push({x:e,y:0,width:a-e,height:o}),!0}}),u}function ns(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;re.style!==`no-outline`);if(g===void 0||g.length===0)return;let _=Rr(s),v=zr(p,f,d),y=[c,0,s.length,p-f],b=[_,0,t,n-v],x=g.map(e=>{let m=e.range,h=e.style??`dashed`;return wa(m,y,t,n,b).map(m=>{let g=m.rect,_=ui(g.x,g.y,t,n,u,l+u,r,i,a,o,p,c,f,s,d),v=g.width===1&&g.height===1?_:ui(g.x+g.width-1,g.y+g.height-1,t,n,u,l+u,r,i,a,o,p,c,f,s,d);return g.x+g.width>=s.length&&--v.width,g.y+g.height>=p&&--v.height,{color:e.color,style:h,clip:m.clip,rect:Ca({x:_.x,y:_.y,width:v.x+v.width-_.x,height:v.y+v.height-_.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let r=!1;for(let i of x)for(let a of i)if(a?.rect!==void 0&&ya(0,0,t,n,a.rect.x,a.rect.y,a.rect.width,a.rect.height)){let t=r,n=!Sa(a.clip,a.rect);n&&(e.save(),e.rect(a.clip.x,a.clip.y,a.clip.width,a.clip.height),e.clip()),a.style===`dashed`&&!r?(e.setLineDash([5,3]),r=!0):(a.style===`solid`||a.style===`solid-outline`)&&r&&(e.setLineDash([]),r=!1),e.strokeStyle=a.style===`solid-outline`?mr(mr(a.color,h.borderColor),h.bgCell):fr(a.color,1),e.strokeRect(a.rect.x+.5,a.rect.y+.5,a.rect.width-1,a.rect.height-1),n&&(e.restore(),r=t)}r&&e.setLineDash([])};return S(),S}function is(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function as(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){if(u.current===void 0)return;let _=u.current.range,v=u.current.cell,y=[_.x+_.width-1,_.y+_.height-1];if(v[1]>=g&&y[1]>=g||!o.some(e=>e.sourceIndex===v[0]||e.sourceIndex===y[0]))return;let[b,x]=u.current.cell,S=f(u.current.cell),C=S.span??[b,b],w=x>=g-p,T=p>0&&!w?zr(g,p,d)-1:0,E=y[1],D;if(ha(o,r,i,a,l,(r,i,a,o,l)=>{if(r.sticky&&b>r.sourceIndex)return;let u=r.sourceIndexC[1],_=r.sourceIndex===y[0];if(!(!_&&(u||f)))return ma(l,a,n,g,d,p,m,void 0,(a,l,u)=>{if(l!==x&&l!==E)return;let d=i,f=r.width;if(S.span!==void 0){let e=_a(S.span,i,a,r.width,u,r,s),t=r.sticky?e[0]:e[1];t!==void 0&&(d=t.x,f=t.width)}return l===E&&_&&h&&(D=()=>{o>d&&!r.sticky&&(e.beginPath(),e.rect(o,0,t-o,n),e.clip()),e.beginPath(),e.rect(d+f-4,a+u-4,4,4),e.fillStyle=r.themeOverride?.accentColor??c.accentColor,e.fill()}),D!==void 0}),D!==void 0}),D===void 0)return;let O=()=>{e.save(),e.beginPath(),e.rect(0,l,t,n-l-T),e.clip(),D?.(),e.restore()};return O(),O}vr(),E();function os(e,t,n,r,i,a,o,s,c){c===void 0||c.size===0||(e.beginPath(),ga(t,n,a,r,(t,n,r,i,a,o)=>{c.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1})&&e.rect(r,i,a,o)}),ha(t,s,a,o,i,(t,n,a,o)=>{let s=Math.max(0,o-n),l=n+s+1,u=t.width-s-1;c.has([t.sourceIndex,-1])&&e.rect(l,r,u,i-r)}),e.clip())}function ss(e,t,n,r,i,a,o,s,c,l){let u=0;return ha(e,a,r,i,n,(e,n,r,i,a)=>(ma(a,r,t,o,s,c,l,void 0,(e,t,n,r)=>{r||(u=Math.max(t,u))}),!0)),u}function cs(e,t){let{canvasCtx:n,headerCanvasCtx:r,width:i,height:a,cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mappedColumns:u,enableGroups:d,freezeColumns:f,dragAndDropState:p,theme:m,drawFocus:h,headerHeight:g,groupHeaderHeight:_,disabledRows:v,rowHeight:y,verticalBorder:b,overrideCursor:S,isResizing:C,selection:w,fillHandle:T,freezeTrailingRows:E,rows:D,getCellContent:O,getGroupDetails:k,getRowThemeOverride:A,isFocused:j,drawHeaderCallback:M,prelightCells:ee,drawCellCallback:N,highlightRegions:te,resizeCol:ne,imageLoader:P,lastBlitData:re,hoverValues:F,hyperWrapping:ie,hoverInfo:ae,spriteManager:oe,maxScaleFactor:se,hasAppendRow:ce,touchMode:le,enqueue:ue,renderStateProvider:de,getCellRenderer:fe,renderStrategy:pe,bufferACtx:me,bufferBCtx:he,damage:ge,minimumCellWidth:_e}=e;if(i===0||a===0)return;let ve=pe===`double-buffer`,ye=Math.min(se,Math.ceil(window.devicePixelRatio??1)),be=pe!==`direct`&&ns(e,t),xe=n.canvas;(xe.width!==i*ye||xe.height!==a*ye)&&(xe.width=i*ye,xe.height=a*ye,xe.style.width=i+`px`,xe.style.height=a+`px`);let Se=r.canvas,Ce=d?_+g:g,we=Ce+1;(Se.width!==i*ye||Se.height!==we*ye)&&(Se.width=i*ye,Se.height=we*ye,Se.style.width=i+`px`,Se.style.height=we+`px`);let Te=me.canvas,Ee=he.canvas;ve&&(Te.width!==i*ye||Te.height!==a*ye)&&(Te.width=i*ye,Te.height=a*ye,re.current!==void 0&&(re.current.aBufferScroll=void 0)),ve&&(Ee.width!==i*ye||Ee.height!==a*ye)&&(Ee.width=i*ye,Ee.height=a*ye,re.current!==void 0&&(re.current.bBufferScroll=void 0));let De=re.current;if(be===!0&&o===De?.cellXOffset&&s===De?.cellYOffset&&c===De?.translateX&&l===De?.translateY)return;let Oe=null;ve&&(Oe=n);let ke=r,Ae;Ae=ve?ge===void 0?De?.lastBuffer===`b`?me:he:De?.lastBuffer===`b`?he:me:n;let je=Ae.canvas,Me=ve?je===Te?Ee:Te:xe,Ne=typeof y==`number`?()=>y:y;ke.save(),Ae.save(),ke.beginPath(),Ae.beginPath(),ke.textBaseline=`middle`,Ae.textBaseline=`middle`,ye!==1&&(ke.scale(ye,ye),Ae.scale(ye,ye));let Pe=Br(u,o,i,p,c),Fe=[],Ie=h&&w.current?.cell[1]===s&&l===0,Le=!1;if(te!==void 0){for(let e of te)if(e.style!==`no-outline`&&e.range.y===s&&l===0){Le=!0;break}}let Re=()=>{Pa(ke,Pe,d,ae,i,c,g,_,p,C,w,m,oe,F,b,k,ge,M,le),$o(ke,Pe,s,c,l,i,a,void 0,void 0,_,Ce,Ne,A,b,E,D,m,!0),ke.beginPath(),ke.moveTo(0,we-.5),ke.lineTo(i,we-.5),ke.strokeStyle=mr(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),ke.stroke(),Le&&rs(ke,i,a,o,s,c,l,u,f,g,_,y,E,D,te,m),Ie&&as(ke,i,a,s,c,l,Pe,u,m,Ce,w,Ne,O,E,ce,T,D)};if(ge!==void 0){let e=Pe[Pe.length-1].sourceIndex+1,t=ge.hasItemInRegion([{x:o,y:-2,width:e,height:2},{x:o,y:s,width:e,height:300},{x:0,y:s,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:o,y:D-E,width:e,height:E,when:E>0}]),n=e=>{Ea(e,Pe,u,a,Ce,c,l,s,D,Ne,O,k,A,v,j,h,E,ce,Fe,ge,w,ee,te,P,oe,F,ae,N,ie,m,ue,de,fe,S,_e);let t=w.current;T&&h&&t!==void 0&&ge.has(Pr(t.range))&&as(e,i,a,s,c,l,Pe,u,m,Ce,w,Ne,O,E,ce,T,D)};t&&(n(Ae),Oe!==null&&(Oe.save(),Oe.scale(ye,ye),Oe.textBaseline=`middle`,n(Oe),Oe.restore()),ge.hasHeader()&&(os(ke,Pe,i,_,Ce,c,l,s,ge),Re())),Ae.restore(),ke.restore();return}if((be!==!0||o!==De?.cellXOffset||c!==De?.translateX||Ie!==De?.mustDrawFocusOnHeader||Le!==De?.mustDrawHighlightRingsOnHeader)&&Re(),be===!0){x(Me!==void 0&&De!==void 0);let{regions:e}=es(Ae,Me,Me===Te?De.aBufferScroll:De.bBufferScroll,Me===Te?De.bBufferScroll:De.aBufferScroll,De,o,s,c,l,E,i,a,D,Ce,ye,u,Pe,y,ve);Fe=e}else be!==!1&&(x(De!==void 0),Fe=ts(De,o,s,c,l,i,a,Ce,Pe,be));Xo(Ae,Pe,i,a,E,D,b,Ne,m);let ze=rs(Ae,i,a,o,s,c,l,u,f,g,_,y,E,D,te,m),Be=h?as(Ae,i,a,s,c,l,Pe,u,m,Ce,w,Ne,O,E,ce,T,D):void 0;if(Ae.fillStyle=m.bgCell,Fe.length>0){Ae.beginPath();for(let e of Fe)Ae.rect(e.x,e.y,e.width,e.height);Ae.clip(),Ae.fill(),Ae.beginPath()}else Ae.fillRect(0,0,i,a);let Ve=Ea(Ae,Pe,u,a,Ce,c,l,s,D,Ne,O,k,A,v,j,h,E,ce,Fe,ge,w,ee,te,P,oe,F,ae,N,ie,m,ue,de,fe,S,_e);Yo(Ae,Pe,u,i,a,Ce,c,l,s,D,Ne,A,w.rows,v,E,ce,Fe,ge,m),Qo(Ae,Pe,s,c,l,i,a,Fe,Ce,Ne,A,b,E,D,m),$o(Ae,Pe,s,c,l,i,a,Fe,Ve,_,Ce,Ne,A,b,E,D,m),ze?.(),Be?.(),C&&ha(Pe,0,c,0,Ce,(e,t)=>e.sourceIndex===ne?(is(ke,t+e.width,0,Ce+1,mr(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),is(Ae,t+e.width,Ce,a,mr(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Oe!==null&&(Oe.fillStyle=m.bgCell,Oe.fillRect(0,0,i,a),Oe.drawImage(Ae.canvas,0,0));let He=ss(Pe,a,Ce,c,l,s,D,Ne,E,ce);P?.setWindow({x:o,y:s,width:Pe.length,height:He-s},f,Array.from({length:E},(e,t)=>D-1-t));let Ue=De!==void 0&&(o!==De.cellXOffset||c!==De.translateX),We=De!==void 0&&(s!==De.cellYOffset||l!==De.translateY);re.current={cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mustDrawFocusOnHeader:Ie,mustDrawHighlightRingsOnHeader:Le,lastBuffer:ve?je===Te?`a`:`b`:void 0,aBufferScroll:je===Te?[Ue,We]:De?.aBufferScroll,bBufferScroll:je===Ee?[Ue,We]:De?.bBufferScroll},Ae.restore(),ke.restore()}var ls=u(ji(),1),us=80;function ds(e){let t=e-1;return t*t*t+1}var fs=class{callback;constructor(e){this.callback=e}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=e=>{this.leavingItems.some(t=>Nr(t.item,e.item))||this.leavingItems.push(e)};removeFromLeavingItems=e=>{let t=this.leavingItems.find(t=>Nr(t.item,e));return this.leavingItems=this.leavingItems.filter(e=>e!==t),t?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(e=>e.hoverAmount>0)};shouldStep=()=>{let e=this.leavingItems.length>0,t=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return e||t};getAnimatingItems=()=>this.currentHoveredItem===void 0?this.leavingItems.map(e=>({...e,hoverAmount:ds(e.hoverAmount)})):[...this.leavingItems,this.currentHoveredItem];step=e=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=e;else{let t=(e-this.lastAnimationTime)/us;for(let e of this.leavingItems)e.hoverAmount=(0,ls.default)(e.hoverAmount-t,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,ls.default)(this.currentHoveredItem.hoverAmount+t,0,1));let n=this.getAnimatingItems();this.callback(n),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=e,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=e=>{if(!Nr(this.currentHoveredItem?.item,e)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),e!==void 0){let t=this.removeFromLeavingItems(e);this.currentHoveredItem={item:e,hoverAmount:t}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}},ps=class{fn;val;constructor(e){this.fn=e}get value(){return this.val??=this.fn()}};function ms(e){return new ps(e)}var hs=ms(()=>window.navigator.userAgent.includes(`Firefox`)),gs=ms(()=>window.navigator.userAgent.includes(`Mac OS`)&&window.navigator.userAgent.includes(`Safari`)&&!window.navigator.userAgent.includes(`Chrome`)),_s=ms(()=>window.navigator.platform.toLowerCase().startsWith(`mac`));function vs(e){let t=L.useRef([]),n=L.useRef(0),r=L.useRef(e);r.current=e;let i=L.useCallback(()=>{let e=()=>window.requestAnimationFrame(i),i=()=>{let e=t.current.map(hi);t.current=[],r.current(new vi(e)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?e:i)},[]);return L.useCallback(e=>{t.current.length===0&&i();let n=fi(e[0],e[1]);t.current.includes(n)||t.current.push(n)},[i])}var ys=`header`,bs=`group-header`,xs=`out-of-bounds`,Ss;(function(e){e[e.Start=-2]=`Start`,e[e.StartPadding=-1]=`StartPadding`,e[e.Center=0]=`Center`,e[e.EndPadding=1]=`EndPadding`,e[e.End=2]=`End`})(Ss||={});function Cs(e,t){return e===t?!0:e?.kind===`out-of-bounds`?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}ct();var ws=u(ra(),1);E();var Ts=6,Es=(e,t)=>e.kind===I.Custom?e.copyData:(t?.(e))?.getAccessibilityString(e)??``,Ds=L.memo(L.forwardRef((e,t)=>{let{width:n,height:r,accessibilityHeight:i,columns:a,cellXOffset:o,cellYOffset:s,headerHeight:c,fillHandle:l=!1,groupHeaderHeight:u,rowHeight:d,rows:f,getCellContent:p,getRowThemeOverride:m,onHeaderMenuClick:h,enableGroups:g,isFilling:_,onCanvasFocused:v,onCanvasBlur:y,isFocused:b,selection:S,freezeColumns:C,onContextMenu:w,freezeTrailingRows:T,fixedShadowX:E=!0,fixedShadowY:D=!0,drawFocusRing:O,onMouseDown:k,onMouseUp:A,onMouseMoveRaw:j,onMouseMove:M,onItemHovered:ee,dragAndDropState:N,firstColAccessible:te,onKeyDown:ne,onKeyUp:P,highlightRegions:re,canvasRef:F,onDragStart:ie,onDragEnd:ae,eventTargetRef:oe,isResizing:se,resizeColumn:ce,isDragging:le,isDraggable:ue=!1,allowResize:de,disabledRows:fe,hasAppendRow:pe,getGroupDetails:me,theme:he,prelightCells:ge,headerIcons:_e,verticalBorder:ve,drawCell:ye,drawHeader:be,onCellFocused:xe,onDragOverCell:Se,onDrop:Ce,onDragLeave:we,imageWindowLoader:Te,smoothScrollX:Ee=!1,smoothScrollY:De=!1,experimental:Oe,getCellRenderer:ke}=e,Ae=e.translateX??0,je=e.translateY??0,Me=Math.max(C,Math.min(a.length-1,o)),Ne=L.useRef(null),Pe=Te,Fe=L.useRef(),[Ie,Le]=L.useState(!1),Re=L.useRef([]),ze=L.useRef(),[Be,Ve]=L.useState(),[He,Ue]=L.useState(),We=L.useRef(null),[Ge,Ke]=L.useState(),[qe,Je]=L.useState(!1),Ye=L.useRef(qe);Ye.current=qe;let Xe=L.useMemo(()=>new fa(_e,()=>{vt.current=void 0,St.current()}),[_e]),$e=g?u+c:c,tt=L.useRef(-1),nt=(Oe?.enableFirefoxRescaling??!1)&&hs.value,rt=(Oe?.enableSafariRescaling??!1)&&gs.value;L.useLayoutEffect(()=>{window.devicePixelRatio===1||!nt&&!rt||(tt.current!==-1&&Le(!0),window.clearTimeout(tt.current),tt.current=window.setTimeout(()=>{Le(!1),tt.current=-1},200))},[s,Me,Ae,je,nt,rt]);let it=Or(a,C),ot=E?Rr(it,N):0,ct=L.useCallback((e,t,i)=>{let a=e.getBoundingClientRect();if(t>=it.length||i>=f)return;let o=a.width/n,c=ui(t,i,n,r,u,$e,Me,s,Ae,je,f,C,T,it,d);return o!==1&&(c.x*=o,c.y*=o,c.width*=o,c.height*=o),c.x+=a.x,c.y+=a.y,c},[n,r,u,$e,Me,s,Ae,je,f,C,T,it,d]),lt=L.useCallback((e,t,i,a)=>{let o=e.getBoundingClientRect(),p=o.width/n,m=(t-o.left)/p,h=(i-o.top)/p,_=Br(it,Me,n,void 0,Ae),v=0,y=0;a instanceof MouseEvent&&(v=a.button,y=a.buttons);let b=Vr(m,_,Ae),C=Hr(h,r,g,c,u,f,d,s,je,T),w=a?.shiftKey===!0,E=a?.ctrlKey===!0,D=a?.metaKey===!0,O=a!==void 0&&!(a instanceof MouseEvent)||a?.pointerType===`touch`,k=[m<0?-1:+(nn||h>r){let i=m>n?1:m<0?-1:0,a=h>r?1:h<0?-1:0,o=i*2,s=a*2;i===0&&(o=b===-1?Ss.EndPadding:Ss.Center),a===0&&(s=C===void 0?Ss.EndPadding:Ss.Center);let c=!1;if(b===-1&&C===-1){let n=ct(e,it.length-1,-1);x(n!==void 0),c=tn&&mr&&h=0?(r=!0,n=ct(e,a,C),x(n!==void 0),A={kind:g&&C===-2?bs:ys,location:[a,C],bounds:n,group:it[a].group??``,isEdge:r,shiftKey:w,ctrlKey:E,metaKey:D,isTouch:O,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:k}):A={kind:g&&C===-2?bs:ys,group:it[b].group??``,location:[b,C],bounds:n,isEdge:r,shiftKey:w,ctrlKey:E,metaKey:D,isTouch:O,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:k}}else{let n=ct(e,b,C);x(n!==void 0);let r=n!==void 0&&n.x+n.width-t<5,a=!1;if(l&&S.current!==void 0){let n=Pr(S.current.range),r=ct(e,n[0],n[1]);if(r!==void 0){let e=r.x+r.width-2,n=r.y+r.height-2;a=Math.abs(e-t){}),ft=L.useRef(Be);ft.current=Be;let[pt,mt]=L.useMemo(()=>{let e=document.createElement(`canvas`),t=document.createElement(`canvas`);return e.style.display=`none`,e.style.opacity=`0`,e.style.position=`fixed`,t.style.display=`none`,t.style.opacity=`0`,t.style.position=`fixed`,[e.getContext(`2d`,{alpha:!1}),t.getContext(`2d`,{alpha:!1})]},[]);L.useLayoutEffect(()=>{if(!(pt===null||mt===null))return document.documentElement.append(pt.canvas),document.documentElement.append(mt.canvas),()=>{pt.canvas.remove(),mt.canvas.remove()}},[pt,mt]);let ht=L.useMemo(()=>new _i,[]),gt=nt&&Ie?1:rt&&Ie?2:5,_t=Oe?.disableMinimumCellWidth===!0?1:10,vt=L.useRef(),yt=L.useRef(null),bt=L.useRef(null),xt=L.useCallback(()=>{let e=Ne.current,t=We.current;if(e===null||t===null||(yt.current===null&&(yt.current=e.getContext(`2d`,{alpha:!1}),e.width=0,e.height=0),bt.current===null&&(bt.current=t.getContext(`2d`,{alpha:!1}),t.width=0,t.height=0),yt.current===null||bt.current===null||pt===null||mt===null))return;let i=!1,a=e=>{i=!0,Ke(e)},o=vt.current,h={headerCanvasCtx:bt.current,canvasCtx:yt.current,bufferACtx:pt,bufferBCtx:mt,width:n,height:r,cellXOffset:Me,cellYOffset:s,translateX:Math.round(Ae),translateY:Math.round(je),mappedColumns:it,enableGroups:g,freezeColumns:C,dragAndDropState:N,theme:he,headerHeight:c,groupHeaderHeight:u,disabledRows:fe??st.empty(),rowHeight:d,verticalBorder:ve,isResizing:se,resizeCol:ce,isFocused:b,selection:S,fillHandle:l,drawCellCallback:ye,hasAppendRow:pe,overrideCursor:a,maxScaleFactor:gt,freezeTrailingRows:T,rows:f,drawFocus:O,getCellContent:p,getGroupDetails:me??(e=>({name:e})),getRowThemeOverride:m,drawHeaderCallback:be,prelightCells:ge,highlightRegions:re,imageLoader:Pe,lastBlitData:ze,damage:Fe.current,hoverValues:Re.current,hoverInfo:ft.current,spriteManager:Xe,scrolling:Ie,hyperWrapping:Oe?.hyperWrapping??!1,touchMode:qe,enqueue:dt.current,renderStateProvider:ht,renderStrategy:Oe?.renderStrategy??(gs.value?`double-buffer`:`single-buffer`),getCellRenderer:ke,minimumCellWidth:_t};h.damage===void 0?(vt.current=h,cs(h,o)):cs(h,void 0),!i&&(h.damage===void 0||h.damage.has(ft?.current?.[0]))&&Ke(void 0)},[pt,mt,n,r,Me,s,Ae,je,it,g,C,N,he,c,u,fe,d,ve,se,pe,ce,b,S,l,T,f,O,gt,p,me,m,ye,be,ge,re,Pe,Xe,Ie,Oe?.hyperWrapping,Oe?.renderStrategy,qe,ht,ke,_t]),St=L.useRef(xt);L.useLayoutEffect(()=>{xt(),St.current=xt},[xt]),L.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,vt.current=void 0,St.current())})()},[]);let Ct=L.useCallback(e=>{Fe.current=e,St.current(),Fe.current=void 0},[]);dt.current=vs(Ct);let wt=L.useCallback(e=>{Ct(new vi(e.map(e=>e.cell)))},[Ct]);Pe.setCallback(Ct);let[Tt,Et]=L.useState(!1),[Dt,Ot]=ut??[],kt=Dt!==void 0&&Ot===-1,At=Dt!==void 0&&Ot===-2,jt=!1,Mt=!1,Nt=Ge;if(Nt===void 0&&Dt!==void 0&&Ot!==void 0&&Ot>-1&&Ot({contain:`strict`,display:`block`,cursor:Pt}),[Pt]),It=L.useRef(`default`),Lt=oe?.current;Lt!=null&&It.current!==Ft.cursor&&(Lt.style.cursor=It.current=Ft.cursor);let Rt=L.useCallback((e,t,n,r)=>{if(me===void 0)return;let i=me(e);if(i.actions!==void 0){let e=Ra(t,i.actions);for(let[a,o]of e.entries())if(ba(o,n+t.x,r+o.y))return i.actions[a]}},[me]),zt=L.useCallback((e,t,n,r)=>{let i=a[t];if(!le&&!se&&i.hasMenu===!0&&!(He??!1)){let a=ct(e,t,-1);x(a!==void 0);let o=La(a.x,a.y,a.width,a.height,R(i.title)===`rtl`);if(n>o.x&&no.y&&r{let t=Ne.current,n=oe?.current;if(t===null||e.target!==t&&e.target!==n)return;Ht.current=!0;let r,i;if(e instanceof MouseEvent?(r=e.clientX,i=e.clientY):(r=e.touches[0].clientX,i=e.touches[0].clientY),e.target===n&&n!==null){let e=n.getBoundingClientRect();if(r>e.right||i>e.bottom)return}let a=lt(t,r,i,e);Vt.current=a.location,a.isTouch&&(Bt.current=Date.now()),Ye.current!==a.isTouch&&Je(a.isTouch),!(a.kind===`header`&&zt(t,a.location[0],r,i)!==void 0)&&(a.kind===`group-header`&&Rt(a.group,a.bounds,a.localEventX,a.localEventY)!==void 0||(k?.(a),!a.isTouch&&ue!==!0&&ue!==a.kind&&a.button<3&&a.button!==1&&e.preventDefault()))},[oe,ue,lt,Rt,zt,k]);qt(`touchstart`,Ut,window,!1),qt(`mousedown`,Ut,window,!1);let Wt=L.useRef(0),Gt=L.useCallback(e=>{let t=Wt.current;Wt.current=Date.now();let n=Ne.current;if(Ht.current=!1,A===void 0||n===null)return;let r=oe?.current,i=e.target!==n&&e.target!==r,a,o,s=!0;if(e instanceof MouseEvent){if(a=e.clientX,o=e.clientY,s=e.button<3,e.pointerType===`touch`)return}else a=e.changedTouches[0].clientX,o=e.changedTouches[0].clientY;let c=lt(n,a,o,e);c.isTouch&&Bt.current!==0&&Date.now()-Bt.current>500&&(c={...c,isLongTouch:!0}),t!==0&&Date.now()-t<(c.isTouch?1e3:500)&&(c={...c,isDoubleClick:!0}),Ye.current!==c.isTouch&&Je(c.isTouch),!i&&e.cancelable&&s&&e.preventDefault();let[l]=c.location,u=zt(n,l,a,o);if(c.kind===`header`&&u!==void 0){(c.button!==0||Vt.current?.[0]!==l||Vt.current?.[1]!==-1)&&A(c,!0);return}else if(c.kind===`group-header`){let e=Rt(c.group,c.bounds,c.localEventX,c.localEventY);if(e!==void 0){c.button===0&&e.onClick(c);return}}A(c,i)},[A,oe,lt,zt,Rt]);qt(`mouseup`,Gt,window,!1),qt(`touchend`,Gt,window,!1),qt(`click`,L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n=oe?.current,r=e.target!==t&&e.target!==n,i,a,o=!0;e instanceof MouseEvent?(i=e.clientX,a=e.clientY,o=e.button<3):(i=e.changedTouches[0].clientX,a=e.changedTouches[0].clientY);let s=lt(t,i,a,e);Ye.current!==s.isTouch&&Je(s.isTouch),!r&&e.cancelable&&o&&e.preventDefault();let[c]=s.location,l=zt(t,c,i,a);if(s.kind===`header`&&l!==void 0)s.button===0&&Vt.current?.[0]===c&&Vt.current?.[1]===-1&&h?.(c,l);else if(s.kind===`group-header`){let e=Rt(s.group,s.bounds,s.localEventX,s.localEventY);e!==void 0&&s.button===0&&e.onClick(s)}},[oe,lt,zt,h,Rt]),window,!1),qt(`contextmenu`,L.useCallback(e=>{let t=Ne.current,n=oe?.current;if(t===null||e.target!==t&&e.target!==n||w===void 0)return;let r=lt(t,e.clientX,e.clientY,e);w(r,()=>{e.cancelable&&e.preventDefault()})},[oe,lt,w]),oe?.current??null,!1);let Kt=L.useCallback(e=>{Fe.current=new vi(e.map(e=>e.item)),Re.current=e,St.current(),Fe.current=void 0},[]),Jt=L.useMemo(()=>new fs(Kt),[Kt]),Yt=L.useRef(Jt);Yt.current=Jt,L.useLayoutEffect(()=>{let e=Yt.current;if(ut===void 0||ut[1]<0){e.setHovered(ut);return}let t=p(ut,!0),n=ke(t),r=n===void 0&&t.kind===I.Custom||n?.needsHover!==void 0&&(typeof n.needsHover==`boolean`?n.needsHover:n.needsHover(t));e.setHovered(r?ut:void 0)},[p,ke,ut]);let Xt=L.useRef();qt(`mousemove`,L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n=oe?.current,r=e.target!==t&&e.target!==n,i=lt(t,e.clientX,e.clientY,e);if(i.kind!==`out-of-bounds`&&r&&!Ht.current&&!i.isTouch)return;let a=(e,t)=>{Ve(n=>n===e||n?.[0][0]===e?.[0][0]&&n?.[0][1]===e?.[0][1]&&(n?.[1][0]===e?.[1][0]&&n?.[1][1]===e?.[1][1]||!t)?n:e)};if(!Cs(i,Xt.current))Ke(void 0),ee?.(i),a(i.kind===`out-of-bounds`?void 0:[i.location,[i.localEventX,i.localEventY]],!0),Xt.current=i;else if(i.kind===`cell`||i.kind===`header`||i.kind===`group-header`){let e=!1,t=!0;if(i.kind===`cell`){let n=p(i.location);t=ke(n)?.needsHoverPosition??n.kind===I.Custom,e=t}else i.kind===`group-header`&&(e=!0);let n=[i.location,[i.localEventX,i.localEventY]];a(n,t),ft.current=n,e&&Ct(new vi([i.location]))}let o=i.location[0]>=+!te;Ue(i.kind===`header`&&i.isEdge&&o&&de===!0),Et(i.kind===`cell`&&i.isFillHandle),j?.(e),M(i)},[oe,lt,te,de,j,M,ee,p,ke,Ct]),window,!0);let Zt=L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n,r;S.current!==void 0&&(n=ct(t,S.current.cell[0],S.current.cell[1]),r=S.current.cell),ne?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[ne,S,ct]),Qt=L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n,r;S.current!==void 0&&(n=ct(t,S.current.cell[0],S.current.cell[1]),r=S.current.cell),P?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[P,S,ct]),$t=L.useCallback(e=>{Ne.current=e,F!==void 0&&(F.current=e)},[F]);qt(`dragstart`,L.useCallback(e=>{let t=Ne.current;if(t===null||ue===!1||se){e.preventDefault();return}let n,r,i=lt(t,e.clientX,e.clientY);if(ue!==!0&&i.kind!==ue){e.preventDefault();return}let a=(e,t)=>{n=e,r=t},o,s,c,l=(e,t,n)=>{o=e,s=t,c=n},u=!1;if(ie?.({...i,setData:a,setDragImage:l,preventDefault:()=>u=!0,defaultPrevented:()=>u}),!u&&n!==void 0&&r!==void 0&&e.dataTransfer!==null)if(e.dataTransfer.setData(n,r),e.dataTransfer.effectAllowed=`copyLink`,o!==void 0&&s!==void 0&&c!==void 0)e.dataTransfer.setDragImage(o,s,c);else{let[n,r]=i.location;if(r!==void 0){let i=document.createElement(`canvas`),a=ct(t,n,r);x(a!==void 0);let o=Math.ceil(window.devicePixelRatio??1);i.width=a.width*o,i.height=a.height*o;let s=i.getContext(`2d`);s!==null&&(s.scale(o,o),s.textBaseline=`middle`,r===-1?(s.font=he.headerFontFull,s.fillStyle=he.bgHeader,s.fillRect(0,0,i.width,i.height),Ba(s,0,0,a.width,a.height,it[n],!1,he,!1,!1,0,Xe,be,!1)):(s.font=he.baseFontFull,s.fillStyle=he.bgCell,s.fillRect(0,0,i.width,i.height),Ma(s,p([n,r]),0,r,!1,!1,0,0,a.width,a.height,!1,he,he.bgCell,Pe,Xe,1,void 0,!1,0,void 0,void 0,void 0,ht,ke,()=>void 0))),i.style.left=`-100%`,i.style.position=`absolute`,i.style.width=`${a.width}px`,i.style.height=`${a.height}px`,document.body.append(i),e.dataTransfer.setDragImage(i,a.width/2,a.height/2),window.setTimeout(()=>{i.remove()},0)}}else e.preventDefault()},[ue,se,lt,ie,ct,he,it,Xe,be,p,Pe,ht,ke]),oe?.current??null,!1,!1);let en=L.useRef();qt(`dragover`,L.useCallback(e=>{let t=Ne.current;if(Ce!==void 0&&e.preventDefault(),t===null||Se===void 0)return;let[n,r]=lt(t,e.clientX,e.clientY).location,i=n-+!te,[a,o]=en.current??[];(a!==i||o!==r)&&(en.current=[i,r],Se([i,r],e.dataTransfer))},[te,lt,Se,Ce]),oe?.current??null,!1,!1),qt(`dragend`,L.useCallback(()=>{en.current=void 0,ae?.()},[ae]),oe?.current??null,!1,!1),qt(`drop`,L.useCallback(e=>{let t=Ne.current;if(t===null||Ce===void 0)return;e.preventDefault();let[n,r]=lt(t,e.clientX,e.clientY).location,i=n-+!te;Ce([i,r],e.dataTransfer)},[te,lt,Ce]),oe?.current??null,!1,!1),qt(`dragleave`,L.useCallback(()=>{we?.()},[we]),oe?.current??null,!1,!1);let tn=L.useRef(S);tn.current=S;let nn=L.useRef(null),an=L.useCallback(e=>{Ne.current===null||!Ne.current.contains(document.activeElement)||(e===null&&tn.current.current!==void 0?F?.current?.focus({preventScroll:!0}):e!==null&&e.focus({preventScroll:!0}),nn.current=e)},[F]);L.useImperativeHandle(t,()=>({focus:()=>{let e=nn.current;e===null||!document.contains(e)?F?.current?.focus({preventScroll:!0}):e.focus({preventScroll:!0})},getBounds:(e,t)=>{if(!(F===void 0||F.current===null))return ct(F.current,e??0,t??-1)},damage:wt}),[F,wt,ct]);let on=L.useRef(),cn=rn(()=>{if(n<50||Oe?.disableAccessibilityTree===!0)return null;let e=Br(it,Me,n,N,Ae),t=te?0:-1;!te&&e[0]?.sourceIndex===0&&(e=e.slice(1));let[r,a]=S.current?.cell??[],o=S.current?.range,c=e.map(e=>e.sourceIndex),l=(0,ws.default)(s,Math.min(f,s+i));return r!==void 0&&a!==void 0&&!(c.includes(r)&&l.includes(a))&&an(null),L.createElement(`table`,{key:`access-tree`,role:`grid`,"aria-rowcount":f+1,"aria-multiselectable":`true`,"aria-colcount":it.length+t},L.createElement(`thead`,{role:`rowgroup`},L.createElement(`tr`,{role:`row`,"aria-rowindex":1},e.map(e=>L.createElement(`th`,{role:`columnheader`,"aria-selected":S.columns.hasIndex(e.sourceIndex),"aria-colindex":e.sourceIndex+1+t,tabIndex:-1,onFocus:t=>{if(t.target!==nn.current)return xe?.([e.sourceIndex,-1])},key:e.sourceIndex},e.title)))),L.createElement(`tbody`,{role:`rowgroup`},l.map(n=>L.createElement(`tr`,{role:`row`,"aria-selected":S.rows.hasIndex(n),key:n,"aria-rowindex":n+2},e.map(e=>{let i=e.sourceIndex,s=fi(i,n),c=r===i&&a===n,l=o!==void 0&&i>=o.x&&i=o.y&&n{let e=F?.current;if(e!=null)return ne?.({bounds:ct(e,i,n),cancel:()=>void 0,preventDefault:()=>void 0,stopPropagation:()=>void 0,ctrlKey:!1,key:`Enter`,keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:d})},onFocusCapture:e=>{if(!(e.target===nn.current||on.current?.[0]===i&&on.current?.[1]===n))return on.current=d,xe?.(d)},ref:c?an:void 0,tabIndex:-1},Es(f,ke))})))))},[n,it,Me,N,Ae,f,s,i,S,an,p,F,ne,ct,xe],200),ln=C===0||!E?0:Me>C?1:(0,ls.default)(-Ae/100,0,1),un=-s*32+je,dn=D?(0,ls.default)(-un/100,0,1):0,fn=L.useMemo(()=>{if(!ln&&!dn)return null;let e={position:`absolute`,top:0,left:ot,width:n-ot,height:r,opacity:ln,pointerEvents:`none`,transition:Ee?void 0:`opacity 0.2s`,boxShadow:`inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)`},t={position:`absolute`,top:$e,left:0,width:n,height:r,opacity:dn,pointerEvents:`none`,transition:De?void 0:`opacity 0.2s`,boxShadow:`inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)`};return L.createElement(L.Fragment,null,ln>0&&L.createElement(`div`,{id:`shadow-x`,style:e}),dn>0&&L.createElement(`div`,{id:`shadow-y`,style:t}))},[ln,dn,ot,n,Ee,$e,r,De]),pn=L.useMemo(()=>({position:`absolute`,top:0,left:0}),[]);return L.createElement(L.Fragment,null,L.createElement(`canvas`,{"data-testid":`data-grid-canvas`,tabIndex:0,onKeyDown:Zt,onKeyUp:Qt,onFocus:v,onBlur:y,ref:$t,style:Ft},cn),L.createElement(`canvas`,{ref:We,style:pn}),fn)}));function Os(e,t,n,r){return(0,ls.default)(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}var ks=e=>{let[t,n]=L.useState(),[r,i]=L.useState(),[a,o]=L.useState(),[s,c]=L.useState(),[l,u]=L.useState(!1),[d,f]=L.useState(),[p,m]=L.useState(),[h,g]=L.useState(),[_,v]=L.useState(!1),[y,b]=L.useState(),{onHeaderMenuClick:x,getCellContent:S,onColumnMoved:C,onColumnResize:w,onColumnResizeStart:T,onColumnResizeEnd:E,gridRef:D,maxColumnWidth:O,minColumnWidth:k,onRowMoved:A,lockColumns:j,onColumnProposeMove:M,onMouseDown:ee,onMouseUp:N,onItemHovered:te,onDragStart:ne,canvasRef:P}=e,re=(w??E??T)!==void 0,{columns:F,selection:ie}=e,ae=ie.columns,oe=L.useCallback(e=>{let[t,n]=e.location;a!==void 0&&s!==t&&t>=j?(u(!0),c(t)):p!==void 0&&n!==void 0?(v(!0),g(Math.max(0,n))):r===void 0&&!l&&!_&&te?.(e)},[a,p,s,te,j,r,l,_]),se=C!==void 0,ce=L.useCallback(e=>{if(e.button===0){let[t,r]=e.location;if(e.kind===`out-of-bounds`&&e.isEdge&&re){let e=D?.current?.getBounds(F.length-1,-1);e!==void 0&&(n(e.x),i(F.length-1))}else if(e.kind===`header`&&t>=j){let r=P?.current;if(e.isEdge&&re&&r){n(e.bounds.x),i(t);let a=r.getBoundingClientRect().width/r.offsetWidth,o=e.bounds.width/a;T?.(F[t],o,t,o+(F[t].growOffset??0))}else e.kind===`header`&&se&&(f(e.bounds.x),o(t))}else e.kind===`cell`&&j>0&&t===0&&r!==void 0&&A!==void 0&&(b(e.bounds.y),m(r))}ee?.(e)},[ee,re,j,A,D,F,se,T,P]),le=L.useCallback((e,t)=>{l||_||x?.(e,t)},[l,_,x]),ue=L.useRef(-1),de=L.useCallback(()=>{ue.current=-1,m(void 0),g(void 0),b(void 0),v(!1),o(void 0),c(void 0),f(void 0),u(!1),i(void 0),n(void 0)},[]),fe=L.useCallback((e,t)=>{if(e.button===0){if(r!==void 0){if(ae?.hasIndex(r)===!0)for(let e of ae){if(e===r)continue;let t=F[e],n=Os(t,ue.current,k,O);w?.(t,n,e,n+(t.growOffset??0))}let e=Os(F[r],ue.current,k,O);if(E?.(F[r],e,r,e+(F[r].growOffset??0)),ae.hasIndex(r))for(let e of ae){if(e===r)continue;let t=F[e],n=Os(t,ue.current,k,O);E?.(t,n,e,n+(t.growOffset??0))}}de(),a!==void 0&&s!==void 0&&C?.(a,s),p!==void 0&&h!==void 0&&A?.(p,h)}N?.(e,t)},[N,r,a,s,p,h,ae,E,F,k,O,w,C,A,de]),pe=L.useMemo(()=>{if(!(a===void 0||s===void 0)&&a!==s&&M?.(a,s)!==!1)return{src:a,dest:s}},[a,s,M]),me=L.useCallback(e=>{let n=P?.current;if(a!==void 0&&d!==void 0)Math.abs(e.clientX-d)>20&&u(!0);else if(p!==void 0&&y!==void 0)Math.abs(e.clientY-y)>20&&v(!0);else if(r!==void 0&&t!==void 0&&n){let i=n.getBoundingClientRect().width/n.offsetWidth,a=(e.clientX-t)/i,o=F[r],s=Os(o,a,k,O);if(w?.(o,s,r,s+(o.growOffset??0)),ue.current=a,ae?.first()===r)for(let e of ae){if(e===r)continue;let t=F[e],n=Os(t,ue.current,k,O);w?.(t,n,e,n+(t.growOffset??0))}}},[a,d,p,y,r,t,F,k,O,w,ae,P]),he=L.useCallback((e,t)=>{if(p===void 0||h===void 0)return S(e,t);let[n,r]=e;return r===h?r=p:(r>h&&--r,r>=p&&(r+=1)),S([n,r],t)},[p,h,S]),ge=L.useCallback(e=>{ne?.(e),e.defaultPrevented()||de()},[de,ne]);return L.createElement(Ds,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,width:e.width,getCellContent:he,isResizing:r!==void 0,onHeaderMenuClick:le,isDragging:l,onItemHovered:oe,onDragStart:ge,onMouseDown:ce,allowResize:re,onMouseUp:fe,dragAndDropState:pe,onMouseMoveRaw:me,ref:D})};function As(e){let t=(0,L.useRef)(null),[n,r]=(0,L.useState)({width:e?.[0],height:e?.[1]});return(0,L.useLayoutEffect)(()=>{let e=new window.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t&&t.contentRect||{};r(t=>t.width===e&&t.height===n?t:{width:e,height:n})}});return t.current&&e.observe(t.current,void 0),()=>{e.disconnect()}},[t.current]),{ref:t,...n}}var js=(e,t,n)=>{let r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useRef)(null),o=(0,L.useRef)(0),s=(0,L.useRef)(t);s.current=t;let c=n.current;(0,L.useEffect)(()=>{let t=()=>{if(i.current===!1&&c!==null){let e=[c.scrollLeft,c.scrollTop];if(a.current?.[0]===e[0]&&a.current?.[1]===e[1])if(o.current>10){a.current=null,i.current=null;return}else o.current++;else o.current=0,s.current(e[0],e[1]),a.current=e;r.current=window.setTimeout(t,1e3/120)}},n=()=>{i.current=!0,a.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},l=e=>{e.touches.length===0&&(i.current=!1,o.current=0,r.current=window.setTimeout(t,1e3/120))};if(e&&c!==null){let e=c;return e.addEventListener(`touchstart`,n),e.addEventListener(`touchend`,l),()=>{e.removeEventListener(`touchstart`,n),e.removeEventListener(`touchend`,l),r.current!==null&&window.clearTimeout(r.current)}}},[e,c])};St();var Ms=xt(`div`)({name:`ScrollRegionStyle`,class:`gdg-s1dgczr6`,propsAsIs:!1,vars:{"s1dgczr6-0":[e=>e.isSafari?`scroll`:`auto`]}});function Ns(e){let[t,n]=L.useState(!1),r=typeof window>`u`?null:window,i=L.useRef(0);return qt(`touchstart`,L.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),qt(`touchend`,L.useCallback(t=>{t.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}var Ps=e=>{let{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:a,draggable:o,className:s,preventDiagonalScrolling:c=!1,paddingBottom:l=0,paddingRight:u=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:p=!1,scrollRef:m,initialSize:h}=e,g=[],_=f?.sticky??!1,v=f?.fill??!1,y=L.useRef(0),b=L.useRef(0),x=L.useRef(null),S=typeof window>`u`?1:window.devicePixelRatio,C=L.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),w=L.useRef(null),T=Ns(200),[E,D]=L.useState(!0),O=L.useRef(0);L.useLayoutEffect(()=>{if(!E||T||C.current.lockDirection===void 0)return;let e=x.current;if(e===null)return;let[t,n]=C.current.lockDirection;t===void 0?n!==void 0&&(e.scrollTop=n):e.scrollLeft=t,C.current.lockDirection=void 0},[T,E]);let k=L.useCallback((e,t)=>{let n=x.current;if(n===null)return;t??=n.scrollTop,e??=n.scrollLeft;let i=C.current.scrollTop,o=C.current.scrollLeft,s=e-o,d=t-i;T&&s!==0&&d!==0&&(Math.abs(s)>3||Math.abs(d)>3)&&c&&C.current.lockDirection===void 0&&(C.current.lockDirection=Math.abs(s)0&&(Math.abs(g)>2e3||h===0||h===_)&&r>n.scrollHeight+5){let e=h/_,t=(r-m)*e;y.current=t-h}f!==void 0&&(window.clearTimeout(O.current),D(!1),O.current=window.setTimeout(()=>D(!0),200)),a({x:e,y:h+y.current,width:p-u,height:m-l,paddingRight:w.current?.clientWidth??0})},[l,u,r,a,c,T]);js(p&&gs.value,k,x);let A=L.useRef(k);A.current=k;let j=L.useRef(),M=L.useRef(!1);L.useLayoutEffect(()=>{M.current?k():M.current=!0},[k,l,u]);let ee=L.useCallback(e=>{x.current=e,m!==void 0&&(m.current=e)},[m]),N=0,te=0;for(g.push(L.createElement(`div`,{key:N++,style:{width:i,height:0}}));teA.current(),0),j.current={width:P,height:re}),(P??0)===0||(re??0)===0?L.createElement(`div`,{ref:ne}):L.createElement(`div`,{ref:ne},L.createElement(Ms,{isSafari:gs.value},L.createElement(`div`,{className:`dvn-underlay`},t),L.createElement(`div`,{ref:ee,style:j.current,draggable:o,onDragStart:e=>{o||(e.stopPropagation(),e.preventDefault())},className:`dvn-scroller `+(s??``),onScroll:()=>k()},L.createElement(`div`,{className:`dvn-scroll-inner`+(d===void 0?` dvn-hidden`:``)},L.createElement(`div`,{className:`dvn-stack`},g),d!==void 0&&L.createElement(L.Fragment,null,!v&&L.createElement(`div`,{className:`dvn-spacer`}),L.createElement(`div`,{ref:w,style:{height:re,maxHeight:n-Math.ceil(S%1),position:`sticky`,top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:v?1:void 0,right:_?u??0:void 0,pointerEvents:`auto`}},d))))))},Fs=e=>{let{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:a,enableGroups:o,freezeColumns:s,experimental:c,nonGrowWidth:l,clientSize:u,className:d,onVisibleRegionChanged:f,scrollRef:p,preventDiagonalScrolling:m,rightElement:h,rightElementProps:g,overscrollX:_,overscrollY:v,initialSize:y,smoothScrollX:b=!1,smoothScrollY:x=!1,isDraggable:S}=e,{paddingRight:C,paddingBottom:w}=c??{},[T,E]=u,D=L.useRef(),O=L.useRef(),k=L.useRef(),A=L.useRef(),j=l+Math.max(0,_??0),M=o?i+a:i;if(typeof r==`number`)M+=n*r;else for(let e=0;e{if(ee.current===void 0)return;let e={...ee.current},i=0,a=e.x<0?-e.x:0,o=0,c=0;e.x=e.x<0?0:e.x;let l=0;for(let e=0;e=t+n.width)i+=n.width,c++,o++;else if(e.x>t)i+=n.width,b?a+=t-e.x:c++,o++;else if(e.x+e.width>t)i+=n.width,o++;else break}let u=0,d=0,p=0;if(typeof r==`number`)x?(d=Math.floor(e.y/r),u=d*r-e.y):d=Math.ceil(e.y/r),p=Math.ceil(e.height/r)+d,u<0&&p++;else{let t=0;for(let i=0;i=t+n)t+=n,d++,p++;else if(e.y>a)t+=n,x?u+=a-e.y:d++,p++;else if(e.y+e.height>n/2+t)t+=n,p++;else break}}let m={x:c,y:d,width:o-c,height:p-d},h=D.current;(h===void 0||h.y!==m.y||h.x!==m.x||h.height!==m.height||h.width!==m.width||O.current!==a||k.current!==u||e.width!==A.current?.[0]||e.height!==A.current?.[1])&&(f?.({x:c,y:d,width:o-c,height:p-d},e.width,e.height,e.paddingRight??0,a,u),D.current=m,O.current=a,k.current=u,A.current=[e.width,e.height])},[t,r,n,f,s,b,x]),te=L.useCallback(e=>{ee.current=e,N()},[N]);return L.useEffect(()=>{N()},[N]),L.createElement(Ps,{scrollRef:p,className:d,kineticScrollPerfHack:c?.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:S===!0||typeof S==`string`,scrollWidth:j+(C??0),scrollHeight:M+(w??0),clientHeight:E,rightElement:h,paddingBottom:w,paddingRight:C,rightElementProps:g,update:te,initialSize:y},L.createElement(ks,{eventTargetRef:p,width:T,height:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}))};St();var Is=xt(`div`)({name:`SearchWrapper`,class:`gdg-seveqep`,propsAsIs:!1});ct(),E();var Ls=L.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},L.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 244l144-144 144 144M256 120v292`})),Rs=L.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},L.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 268l144 144 144-144M256 392V100`})),zs=L.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},L.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`32`,d:`M368 368L144 144M368 144L144 368`})),Bs=10,Vs=e=>{let{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:a,searchValue:o,searchResults:s,onSearchValueChange:c,getCellsForSelection:l,onSearchResultsChanged:u,showSearch:d=!1,onSearchClose:f}=e,[p]=L.useState(()=>`search-box-`+Math.round(Math.random()*1e3)),[m,h]=L.useState(``),g=o??m,_=L.useCallback(e=>{h(e),c?.(e)},[c]),[v,y]=L.useState(),b=L.useRef(v);b.current=v,L.useEffect(()=>{s!==void 0&&(s.length>0?y(e=>({rowsSearched:r,results:s.length,selectedIndex:e?.selectedIndex??-1})):y(void 0))},[r,s]);let S=L.useRef();S.current===void 0&&(S.current=new AbortController);let C=L.useRef(),[w,T]=L.useState([]),E=s??w,D=L.useCallback(()=>{C.current!==void 0&&(window.cancelAnimationFrame(C.current),C.current=void 0,S.current.abort())},[]),O=L.useRef(n);O.current=n;let k=L.useCallback(e=>{let t=new RegExp(e.replace(/([$()*+.?[\\\]^{|}-])/g,`\\$1`),`i`),n=O.current,a=Math.min(10,r),o=0;y(void 0),T([]);let s=[],c=async()=>{if(l===void 0)return;let e=performance.now(),d=r-o,f=l({x:0,y:n,width:i.length,height:Math.min(a,d,r-n)},S.current.signal);typeof f==`function`&&(f=await f());let p=!1;for(let[e,r]of f.entries())for(let[i,a]of r.entries()){let r;switch(a.kind){case I.Text:case I.Number:r=a.displayData;break;case I.Uri:case I.Markdown:r=a.data;break;case I.Boolean:r=typeof a.data==`boolean`?a.data.toString():void 0;break;case I.Image:case I.Bubble:r=a.data.join(`🐳`);break;case I.Custom:r=a.copyData;break}r!==void 0&&t.test(r)&&(s.push([i,e+n]),p=!0)}let m=performance.now();p&&T([...s]),o+=f.length,x(o<=r);let h=b.current?.selectedIndex??-1;y({results:s.length,rowsSearched:o,selectedIndex:h}),u?.(s,h),n+a>=r?n=0:n+=a;let g=m-e,_=Bs/Math.max(g,1);a=Math.ceil(a*_),o{f?.(),y(void 0),T([]),u?.([],-1),D(),t?.current?.focus()},[D,t,f,u]),j=L.useCallback(e=>{_(e.target.value),s===void 0&&(e.target.value===``?(y(void 0),T([]),D()):k(e.target.value))},[k,D,_,s]);L.useEffect(()=>{d&&a.current!==null&&(_(``),a.current.focus({preventScroll:!0}))},[d,a,_]);let M=L.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0)return;let t=(v.selectedIndex+1)%v.results;y({...v,selectedIndex:t}),u?.(E,t)},[v,u,E]),ee=L.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0)return;let t=(v.selectedIndex-1)%v.results;t<0&&(t+=v.results),y({...v,selectedIndex:t}),u?.(E,t)},[u,E,v]),N=L.useCallback(e=>{(e.ctrlKey||e.metaKey)&&e.nativeEvent.code===`KeyF`||e.key===`Escape`?(A(),e.stopPropagation(),e.preventDefault()):e.key===`Enter`&&(e.shiftKey?ee():M())},[A,M,ee]);L.useEffect(()=>()=>{D()},[D]);let[te,ne]=L.useState(!1);L.useEffect(()=>{if(d)ne(!0);else{let e=setTimeout(()=>ne(!1),150);return()=>clearTimeout(e)}},[d]);let P=L.useMemo(()=>{if(!d&&!te)return null;let e;v!==void 0&&(e=v.results>=1e3?`over 1000`:`${v.results} result${v.results===1?``:`s`}`,v.selectedIndex>=0&&(e=`${v.selectedIndex+1} of ${e}`));let t=e=>{e.stopPropagation()},n={width:`${Math.floor((v?.rowsSearched??0)/r*100)}%`};return L.createElement(Is,{className:d?``:`out`,onMouseDown:t,onMouseMove:t,onMouseUp:t,onClick:t},L.createElement(`div`,{className:`gdg-search-bar-inner`},L.createElement(`input`,{id:p,"aria-hidden":!d,"data-testid":`search-input`,ref:a,onChange:j,value:g,tabIndex:d?void 0:-1,onKeyDownCapture:N}),L.createElement(`button`,{"aria-label":`Previous Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:ee,disabled:(v?.results??0)===0},Ls),L.createElement(`button`,{"aria-label":`Next Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:M,disabled:(v?.results??0)===0},Rs),f!==void 0&&L.createElement(`button`,{"aria-label":`Close Search`,"aria-hidden":!d,"data-testid":`search-close-button`,tabIndex:d?void 0:-1,onClick:A},zs)),v===void 0?L.createElement(`div`,{className:`gdg-search-status`},L.createElement(`label`,{htmlFor:p},`Type to search`)):L.createElement(L.Fragment,null,L.createElement(`div`,{className:`gdg-search-status`},L.createElement(`div`,{"data-testid":`search-result-area`},e)),L.createElement(`div`,{className:`gdg-search-progress`,style:n})))},[d,te,v,r,p,a,j,g,N,ee,M,f,A]);return L.createElement(L.Fragment,null,L.createElement(Fs,{prelightCells:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}),P)},Hs,Us,Ws=o((()=>{Hs=u(f(),1),Us=class extends Hs.PureComponent{wrapperRef=Hs.createRef();componentDidMount(){document.addEventListener(`touchend`,this.clickOutside,!0),document.addEventListener(`mousedown`,this.clickOutside,!0),document.addEventListener(`contextmenu`,this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener(`touchend`,this.clickOutside,!0),document.removeEventListener(`mousedown`,this.clickOutside,!0),document.removeEventListener(`contextmenu`,this.clickOutside,!0)}clickOutside=e=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(e))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(e.target)){let t=e.target;for(;t!==null;){if(t.classList.contains(`click-outside-ignore`))return;t=t.parentElement}this.props.onClickOutside()}};render(){let{onClickOutside:e,isOutsideClick:t,...n}=this.props;return Hs.createElement(`div`,{...n,ref:this.wrapperRef},this.props.children)}}}));St(),Ws();var Gs=xt(`input`)({name:`RenameInput`,class:`gdg-r17m35ur`,propsAsIs:!1,vars:{"r17m35ur-0":[e=>Math.max(16,e.targetHeight-10),`px`]}}),Ks=e=>{let{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:a}=e,[o,s]=L.useState(n);return L.createElement(Us,{style:{position:`absolute`,left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:`gdg-c1tqibwd`,onClickOutside:r},L.createElement(Gs,{targetHeight:t.height,"data-testid":`group-rename-input`,value:o,onBlur:r,onFocus:e=>e.target.setSelectionRange(0,o.length),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?a(o):e.key===`Escape`&&r()},autoFocus:!0}))};function qs(e,t){return e===void 0?!1:e.length>1&&e.startsWith(`_`)?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>=`a`&&e<=`z`?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function Js(e,t,n){let r=Ys(e,t);return r&&(n.didMatch=!0),r}function Ys(e,t){if(e.length===0)return!1;if(e.includes(`|`)){let n=e.split(`|`);for(let e of n)if(Ys(e,t))return!0;return!1}let n=!1,r=!1,i=!1,a=!1,o=e.split(`+`);if(!qs(o.pop(),t))return!1;if(o[0]===`any`)return!0;for(let e of o)switch(e){case`ctrl`:n=!0;break;case`shift`:r=!0;break;case`alt`:i=!0;break;case`meta`:a=!0;break;case`primary`:_s.value?a=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===a}ct();function Xs(e,t,n,r,i,a){return[L.useCallback((o,s,c,l)=>{(a===`cell`||a===`multi-cell`)&&o!==void 0&&(o={...o,range:{x:o.cell[0],y:o.cell[1],width:1,height:1}});let u=n===`mixed`&&(c||l===`drag`),d=r===`mixed`&&u,f=i===`mixed`&&u,p={current:o===void 0?void 0:{...o,rangeStack:l===`drag`?e.current?.rangeStack??[]:[]},columns:d?e.columns:st.empty(),rows:f?e.rows:st.empty()};c&&(a===`multi-rect`||a===`multi-cell`)&&p.current!==void 0&&e.current!==void 0&&(p={...p,current:{...p.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(p,s)},[r,e,n,a,i,t]),L.useCallback((a,o,s)=>{a??=e.rows,o!==void 0&&(a=a.add(o));let c;if(i===`exclusive`&&a.length>0)c={current:void 0,columns:st.empty(),rows:a};else{let t=s&&n===`mixed`,i=s&&r===`mixed`;c={current:t?e.current:void 0,columns:i?e.columns:st.empty(),rows:a}}t(c,!1)},[r,e,n,i,t]),L.useCallback((a,o,s)=>{a??=e.columns,o!==void 0&&(a=a.add(o));let c;if(r===`exclusive`&&a.length>0)c={current:void 0,rows:st.empty(),columns:a};else{let t=s&&n===`mixed`,r=s&&i===`mixed`;c={current:t?e.current:void 0,rows:r?e.rows:st.empty(),columns:a}}t(c,!1)},[r,e,n,i,t])]}ct();function Zs(e,t,n,r,i){let a=L.useCallback(n=>{if(e===!0){let e=[];for(let r=n.y;r=i?a.push({kind:I.Loading,allowOverlay:!1}):a.push(t([e,r]));e.push(a)}return e}return e?.(n,r.signal)??[]},[r.signal,t,e,i]),o=e===void 0?void 0:a,s=L.useCallback(e=>{if(o===void 0)return[];let t={...e,x:e.x-n};if(t.x<0){t.x=0,t.width--;let e=o(t,r.signal);return typeof e==`function`?async()=>(await e()).map(e=>[{kind:I.Loading,allowOverlay:!1},...e]):e.map(e=>[{kind:I.Loading,allowOverlay:!1},...e])}return o(t,r.signal)},[r.signal,o,n]);return[e===void 0?void 0:s,o]}E(),ct();function Qs(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:`string`};switch(e.kind){case I.Boolean:return{formatted:e.data===!0?`TRUE`:e.data===!1?`FALSE`:e.data===void 0?`INDETERMINATE`:``,rawValue:e.data,format:`boolean`};case I.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:`string`};case I.Image:case I.Bubble:return{formatted:e.data,rawValue:e.data,format:`string-array`};case I.Drilldown:return{formatted:e.data.map(e=>e.text),rawValue:e.data.map(e=>e.text),format:`string-array`};case I.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:`string`};case I.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:`url`};case I.Markdown:case I.RowID:return{formatted:e.data,rawValue:e.data,format:`string`};case I.Number:return{formatted:e.displayData,rawValue:e.data,format:`number`};case I.Loading:return{formatted:`#LOADING`,rawValue:``,format:`string`};case I.Protected:return{formatted:`************`,rawValue:``,format:`string`};default:S(e)}}function $s(e,t){return e.map((e,n)=>{let r=t[n];return e.map(e=>e.span!==void 0&&e.span[0]!==r?{formatted:``,rawValue:``,format:`string`}:Qs(e))})}function ec(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,`""`)}"`),e}function tc(e){let t=[];for(let n of e){let e=[];for(let t of n)t.format===`url`?e.push(t.rawValue?.toString()??``):t.format===`string-array`?e.push(t.formatted.map(e=>ec(e,!0)).join(`,`)):e.push(ec(t.formatted,!1));t.push(e.join(` `))}return t.join(` -`)}function nc(e){return e.replace(/\t/g,` `).replace(/ {2,}/g,e=>` `.repeat(e.length))}function rc(e){return`"`+e.replace(/&/g,`&`).replace(/"/g,`"`).replace(//g,`>`)+`"`}function ic(e){return e.replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`)}function ac(e){let t=[];t.push(``,``);for(let n of e){t.push(``);for(let e of n){let n=`gdg-format="${e.format}"`;e.format===`url`?t.push(``):e.format===`string-array`?t.push(``):t.push(``)}t.push(``)}return t.push(`
${nc(e.formatted)}
    ${e.formatted.map((t,n)=>`
  1. `+nc(t)+`
  2. `).join(``)}
${nc(e.formatted)}
`),t.join(``)}function oc(e,t){let n=$s(e,t);return{textPlain:tc(n),textHtml:ac(n)}}function sc(e){let t=document.createElement(`html`);t.innerHTML=e.replace(/ /g,` `);let n=t.querySelector(`table`);if(n===null)return;let r=[n],i=[],a;for(;r.length>0;){let e=r.pop();if(e===void 0)break;if(e instanceof HTMLTableElement||e.nodeName===`TBODY`)r.push(...[...e.children].reverse());else if(e instanceof HTMLTableRowElement)a!==void 0&&i.push(a),a=[],r.push(...[...e.children].reverse());else if(e instanceof HTMLTableCellElement){let t=e.cloneNode(!0),n=t.children.length===1&&t.children[0].nodeName===`P`?t.children[0]:null,r=n?.children.length===1&&n.children[0].nodeName===`FONT`,i=t.querySelectorAll(`br`);for(let e of i)e.replaceWith(` -`);let o=t.getAttribute(`gdg-raw-value`),s=t.getAttribute(`gdg-format`)??`string`;if(t.querySelector(`a`)!==null)a?.push({rawValue:t.querySelector(`a`)?.getAttribute(`href`)??``,formatted:t.textContent??``,format:s});else if(t.querySelector(`ol`)!==null){let e=t.querySelectorAll(`li`);a?.push({rawValue:[...e].map(e=>e.getAttribute(`gdg-raw-value`)??``),formatted:[...e].map(e=>e.textContent??``),format:`string-array`})}else if(o!==null)a?.push({rawValue:ic(o),formatted:t.textContent??``,format:s});else{let e=t.textContent??``;r&&(e=e.replace(/\n(?!\n)/g,``)),a?.push({rawValue:e??``,formatted:e??``,format:s})}}}return a!==void 0&&i.push(a),i}function cc(e,t,n,r,i){let a=e;if(r===`allowPartial`||e.current===void 0||t===void 0)return e;let o=!1;do{if(e?.current===void 0)break;let r=e.current?.range,s=[];if(r.width>2){let e=t({x:r.x,y:r.y,width:1,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e);let n=t({x:r.x+r.width-1,y:r.y,width:1,height:r.height},i.signal);if(typeof n==`function`)return a;s.push(...n)}else{let e=t({x:r.x,y:r.y,width:r.width,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e)}let c=r.x-n,l=r.x+r.width-1-n;for(let e of s)for(let t of e)t.span!==void 0&&(c=Math.min(t.span[0],c),l=Math.max(t.span[1],l));c===r.x-n&&l===r.x+r.width-1-n?o=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:r.y,width:l-c+1,height:r.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!o);return e}function lc(e){return e.startsWith(`"`)&&e.endsWith(`"`)&&(e=e.slice(1,-1).replace(/""/g,`"`)),e}function uc(e){let t;(function(e){e[e.None=0]=`None`,e[e.inString=1]=`inString`,e[e.inStringPostQuote=2]=`inStringPostQuote`})(t||={});let n=[],r=[],i=0,a=t.None;e=e.replace(/\r\n/g,` +`}};function fa(e,t){return e===`normal`?[t.bgIconHeader,t.fgIconHeader]:e===`selected`?[`white`,t.accentColor]:[t.accentColor,t.bgHeader]}var pa=class{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(e,t){this.onSettled=t,this.headerIcons=e??{}}drawSprite(e,t,n,r,i,a,o,s=1){let[c,l]=fa(t,o),u=a*Math.ceil(window.devicePixelRatio),d=`${c}_${l}_${u}_${e}`,f=this.spriteMap.get(d);if(f===void 0){let t=this.headerIcons[e];if(t===void 0)return;f=document.createElement(`canvas`);let n=f.getContext(`2d`);if(n===null)return;let r=new Image;r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t({fgColor:l,bgColor:c}))}`,this.spriteMap.set(d,f);let i=r.decode();if(i===void 0)return;this.inFlight++,i.then(()=>{n.drawImage(r,0,0,u,u)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(n.globalAlpha=s),n.drawImage(f,0,0,u,u,r,i,a,a),s<1&&(n.globalAlpha=1)}};function ma(e){if(e.length===0)return;let t;for(let n of e)t=Math.min(t??n.y,n.y)}function ha(e,t,n,r,i,a,o,s,c){s??=t;let l=t,u=e,d=r-a,f=!1;for(;ls&&c(l,u,e,!1,o&&u===r-1)===!0){f=!0;break}l+=e,u++}if(!f){l=n;for(let e=0;e!e.sticky)?.sourceIndex??0;if(c>d){let e=Math.max(s,d),l=t,f=r;for(let t=a.sourceIndex-1;t>=e;t--)l-=o[t].width,f+=o[t].width;for(let e=a.sourceIndex+1;e<=c;e++)f+=o[e].width;u={x:l,y:n,width:f,height:i}}if(d>s){let e=Math.min(c,d-1),u=t,f=r;for(let e=a.sourceIndex-1;e>=s;e--)u-=o[e].width,f+=o[e].width;for(let t=a.sourceIndex+1;t<=e;t++)f+=o[t].width;l={x:u,y:n,width:f,height:i}}return[l,u]}function ya(e,t,n,r){if(r===`any`)return Sa(e,{x:t,y:n,width:1,height:1});if(r===`vertical`&&(t=e.x),r===`horizontal`&&(n=e.y),Mr([t,n],e))return;let i=t-e.x,a=e.x+e.width-t,o=n-e.y+1,s=e.y+e.height-n,c=Math.min(r===`vertical`?2**53-1:i,r===`vertical`?2**53-1:a,r===`horizontal`?2**53-1:o,r===`horizontal`?2**53-1:s);return c===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:c===o?{x:e.x,y:n,width:e.width,height:e.y-n}:c===a?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function ba(e,t,n,r,i,a,o,s){return e<=i+o&&i<=e+n&&t<=a+s&&a<=t+r}function xa(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Sa(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function Ca(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function wa(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;let i=t+4,a=n+4,o=-4-e.x,s=e.x+e.width-i,c=-4-e.y,l=e.y+e.height-a,u=o>0?e.x+Math.floor(o/r)*r:e.x,d=s>0?e.x+e.width-Math.floor(s/r)*r:e.x+e.width,f=c>0?e.y+Math.floor(c/r)*r:e.y,p=l>0?e.y+e.height-Math.floor(l/r)*r:e.y+e.height;return{x:u,y:f,width:d-u,height:p-f}}function Ta(e,t,n,r,i){let[a,o,s,c]=t,[l,u,d,f]=i,{x:p,y:m,width:h,height:g}=e,_=[];if(h<=0||g<=0)return _;let v=p+h,y=m+g,b=ps,C=m+g>c,w=p>=a&&pa&&v<=s||ps,T=m>=o&&mo&&y<=c||mc;if(w&&T){let e=Math.max(p,a),t=Math.max(m,o),n=Math.min(v,s),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:u,width:d-l+1,height:f-u+1}})}if(b&&x){let e=p,t=m,n=Math.min(v,a),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:0,width:l+1,height:u+1}})}if(x&&w){let e=Math.max(p,a),t=m,n=Math.min(v,s),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:0,width:d-l+1,height:u+1}})}if(x&&S){let e=Math.max(p,s),t=m,r=v,i=Math.min(y,o);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:0,width:n-d+1,height:u+1}})}if(b&&T){let e=p,t=Math.max(m,o),n=Math.min(v,a),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:u,width:l+1,height:f-u+1}})}if(S&&T){let e=Math.max(p,s),t=Math.max(m,o),r=v,i=Math.min(y,c);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:u,width:n-d+1,height:f-u+1}})}if(b&&C){let e=p,t=Math.max(m,c),n=Math.min(v,a),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:0,y:f,width:l+1,height:r-f+1}})}if(C&&w){let e=Math.max(p,a),t=Math.max(m,c),n=Math.min(v,s),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:l,y:f,width:d-l+1,height:r-f+1}})}if(S&&C){let e=Math.max(p,s),t=Math.max(m,c),i=v,a=y;_.push({rect:{x:e,y:t,width:i-e,height:a-t},clip:{x:d,y:f,width:n-d+1,height:r-f+1}})}return _}ct(),Ti(),vr();var Ea={kind:I.Loading,allowOverlay:!1};function Da(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,ee,N){let te=y?.size??2**53-1,ne=performance.now(),P=k.baseFontFull;e.font=P;let re={ctx:e},F=[0,0],ie=g>0?zr(c,g,l):0,ae,oe,se=ma(v);return ga(t,s,a,o,i,(t,a,o,s,ce)=>{let le=Math.max(0,s-a),ue=a+le,de=i+1,fe=t.width-le,pe=r-i-1;if(v.length>0){let e=!1;for(let t=0;t{e.save(),e.beginPath(),e.rect(ue,de,fe,pe),e.clip()},he=b.columns.hasIndex(t.sourceIndex),ge=d(t.group??``).overrideTheme,_e=t.themeOverride===void 0&&ge===void 0?k:xi(k,ge,t.themeOverride),ve=_e.baseFontFull;ve!==P&&(P=ve,e.font=ve),me();let ye;return ha(ce,o,r,c,l,g,_,se,(i,o,l,d,g)=>{if(o<0||(F[0]=t.sourceIndex,F[1]=o,y!==void 0&&!y.has(F)))return;if(v.length>0){let e=!1;for(let n=0;nce.span!==void 0&&e>=ce.span[0]&&e<=ce.span[1]);xe&&!m&&h?Se=0:xe&&h&&(Se=Math.max(Se,1)),Ce&&Se++,xe||(_&&Se++,he&&!g&&Se++);let we=ce.kind===I.Protected?be.bgCellMedium:be.bgCell,Te;if((d||we!==k.bgCell)&&(Te=mr(we,Te)),Se>0||se){se&&(Te=mr(be.bgHeader,Te));for(let e=0;eN&&!fe){let n=be.baseFontFull;n!==P&&(e.font=n,P=n),ye=Na(e,ce,t.sourceIndex,o,De,Oe,le,i,ue,l,Se>0,be,Te??be.bgCell,C,w,ke?.hoverAmount??0,E,O,ne,D,ye,A,j,M,ee)}return Ee&&e.restore(),ce.style===`faded`&&(e.globalAlpha=1),te--,de&&(e.restore(),ye?.deprep?.(re),ye=void 0,me(),P=ve,e.font=ve),te<=0}),e.restore(),te<=0}),ae}var Oa=[0,0],ka={x:0,y:0,width:0,height:0},Aa=[void 0,()=>void 0],ja=!1;function Ma(){ja=!0}function Na(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w){let T,E;g!==void 0&&g[0][0]===n&&g[0][1]===r&&(T=g[1][0],E=g[1][1]);let D;Oa[0]=n,Oa[1]=r,ka.x=o,ka.y=s,ka.width=c,ka.height=l,Aa[0]=S.getValue(Oa),Aa[1]=e=>S.setValue(Oa,e),ja=!1;let O={ctx:e,theme:d,col:n,row:r,cell:t,rect:ka,highlighted:u,cellFillColor:f,hoverAmount:h,frameTime:v,hoverX:T,drawState:Aa,hoverY:E,imageLoader:p,spriteManager:m,hyperWrapping:_,overrideCursor:T===void 0?void 0:w,requestAnimationFrame:Ma},k=ei(O,t.lastUpdated,v,b,i,a),A=C(t);if(A!==void 0){b?.renderer!==A&&(b?.deprep?.(O),b=void 0);let e=A.drawPrep?.(O,b);y!==void 0&&!Ze(O.cell)?y(O,()=>A.draw(O,t)):A.draw(O,t),D=e===void 0?void 0:{deprep:e?.deprep,fillStyle:e?.fillStyle,font:e?.font,renderer:A}}return(k||ja)&&x?.(Oa),D}E(),ct();function Pa(e,t,n,r,i,a,o,s,c=-20,l=-20,u=32,d=`center`,f=`square`){let p=Math.floor(i+o/2),m=f===`circle`?1e4:t.roundingRadius??4,h=$t(u,o,t.cellVerticalPadding),g=h/2,_=Qt(d,r,a,t.cellHorizontalPadding,h),v=Zt(_,p,h),y=en(r+c,i+l,v);switch(n){case!0:e.beginPath(),si(e,_-h/2,p-h/2,h,h,m),f===`circle`&&(g*=.8,h*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(_-g+h/4.23,p-g+h/1.97),e.lineTo(_-g+h/2.42,p-g+h/1.44),e.lineTo(_-g+h/1.29,p-g+h/3.25),e.strokeStyle=t.bgCell,e.lineJoin=`round`,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;case null:case!1:e.beginPath(),si(e,_-h/2+.5,p-h/2+.5,h-1,h-1,m),e.lineWidth=1,e.strokeStyle=y?t.textDark:t.textMedium,e.stroke();break;case void 0:e.beginPath(),si(e,_-h/2,p-h/2,h,h,m),e.fillStyle=y?t.textMedium:t.textLight,e.fill(),f===`circle`&&(g*=.8,h*=.8),e.beginPath(),e.moveTo(_-h/3,p),e.lineTo(_+h/3,p),e.strokeStyle=t.bgCell,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;default:S(n)}}Ti(),vr(),ct();function Fa(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=o+s;if(y<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,y);let[b,x]=r?.[0]??[];e.font=d.headerFontFull,ga(t,0,a,0,y,(t,r,i,a)=>{if(g!==void 0&&!g.has([t.sourceIndex,-1]))return;let m=Math.max(0,a-r);e.save(),e.beginPath(),e.rect(r+m,s,t.width-m,o),e.clip();let y=h(t.group??``).overrideTheme,S=t.themeOverride===void 0&&y===void 0?d:xi(d,y,t.themeOverride);S.bgHeader!==d.bgHeader&&(e.fillStyle=S.bgHeader,e.fill()),S!==d&&(e.font=S.baseFontFull);let C=u.columns.hasIndex(t.sourceIndex),w=c!==void 0||l,T=!w&&x===-1&&b===t.sourceIndex,E=w?0:p.find(e=>e.item[0]===t.sourceIndex&&e.item[1]===-1)?.hoverAmount??0,D=u?.current!==void 0&&u.current.cell[0]===t.sourceIndex,O=C?S.accentColor:D?S.bgHeaderHasFocus:S.bgHeader,k=n?s:0,A=t.sourceIndex===0?0:1;C?(e.fillStyle=O,e.fillRect(r+A,k,t.width-A,o)):(D||E>0)&&(e.beginPath(),e.rect(r+A,k,t.width-A,o),D&&(e.fillStyle=S.bgHeaderHasFocus,e.fill()),E>0&&(e.globalAlpha=E,e.fillStyle=S.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Va(e,r,k,t.width,o,t,C,S,T,D,E,f,_,v),e.restore()}),n&&Ia(e,t,i,a,s,r,d,f,p,m,h,g)}function Ia(e,t,n,r,i,a,o,s,c,l,u,d){let[f,p]=a?.[0]??[],m=0;_a(t,n,r,i,(t,n,r,c,h,g)=>{if(d!==void 0&&!d.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(r,c,h,g),e.clip();let _=u(n),v=_?.overrideTheme===void 0?o:xi(o,_.overrideTheme),y=p===-2&&f!==void 0&&f>=t[0]&&f<=t[1],b=y?v.bgHeaderHovered:v.bgHeader;if(b!==o.bgHeader&&(e.fillStyle=b,e.fill()),e.fillStyle=v.textGroupHeader??v.textHeader,_!==void 0){let t=r;if(_.icon!==void 0&&(s.drawSprite(_.icon,`normal`,e,t+8,(i-20)/2,20,v),t+=26),e.fillText(_.name,t+8,i/2+Xr(e,o.headerFontFull)),_.actions!==void 0&&y){let t=za({x:r,y:c,width:h,height:g},_.actions);e.beginPath();let n=t[0].x-10,o=r+h-n;e.rect(n,0,o,i);let l=e.createLinearGradient(n,0,n+o,0),u=fr(b,0);l.addColorStop(0,u),l.addColorStop(10/o,b),l.addColorStop(1,b),e.fillStyle=l,e.fill(),e.globalAlpha=.6;let[d,f]=a?.[1]??[-1,-1];for(let n=0;n<_.actions.length;n++){let i=_.actions[n],a=t[n],o=xa(a,d+r,f);o&&(e.globalAlpha=1),s.drawSprite(i.icon,`normal`,e,a.x+a.width/2-10,a.y+a.height/2-10,20,v),o&&(e.globalAlpha=.6)}e.globalAlpha=1}}r!==0&&l(t[0])&&(e.beginPath(),e.moveTo(r+.5,0),e.lineTo(r+.5,i),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=r+h}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()}var La=30;function Ra(e,t,n,r,i){return i?{x:e,y:t,width:La,height:Math.min(La,r)}:{x:e+n-La,y:Math.max(t,t+r/2-La/2),width:La,height:Math.min(La,r)}}function za(e,t){let n=[],r=e.x+e.width-26*t.length,i=e.y+e.height/2-13;for(let e=0;e35){let n=f?35:r-35,i=f?35*.7:r-35*.7,a=n/r,o=i/r,s=e.createLinearGradient(t,0,t+r,0),c=fr(h,0);s.addColorStop(+!!f,h),s.addColorStop(a,h),s.addColorStop(o,c),s.addColorStop(+!f,c),e.fillStyle=s}else e.fillStyle=h;if(f&&(e.textAlign=`right`),e.fillText(a.title,v,n+i/2+Xr(e,s.headerFontFull)),f&&(e.textAlign=`left`),g&&a.hasMenu===!0)if(a.menuIcon===void 0||a.menuIcon===it.Triangle){e.beginPath();let t=p.x+p.width/2-5.5,n=p.y+p.height/2-3;li(e,[{x:t,y:n},{x:t+11,y:n},{x:t+5.5,y:n+6}],1),e.fillStyle=h,e.fill()}else if(a.menuIcon===it.Dots)e.beginPath(),ci(e,p.x+p.width/2,p.y+p.height/2),e.fillStyle=h,e.fill();else{let t=p.x+(p.width-s.headerIconSize)/2,n=p.y+(p.height-s.headerIconSize)/2;u.drawSprite(a.menuIcon,`normal`,e,t,n,s.headerIconSize,s)}}function Va(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=R(a.title)===`rtl`,h=Ra(t,n,r,i,m);f===void 0?Ba(e,t,n,r,i,a,o,s,c,u,d,p,m,h):f({ctx:e,theme:s,rect:{x:t,y:n,width:r,height:i},column:a,columnIndex:a.sourceIndex,isSelected:o,hoverAmount:u,isHovered:c,hasSelectedCell:l,spriteManager:d,menuBounds:h},()=>Ba(e,t,n,r,i,a,o,s,c,u,d,p,m,h))}var Ha=s(((e,t)=>{var n=le();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Ua=s(((e,t)=>{var n=Ha();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),Wa=s(((e,t)=>{function n(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),Ka=s(((e,t)=>{t.exports=Ga()()})),qa=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n{function n(){return!1}t.exports=n})),Ya=s(((e,t)=>{var n=A(),r=Ja(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),Xa=s(((e,t)=>{var n=N(),r=We(),i=te(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),Za=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Qa=s(((e,t)=>{var n=k(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),$a=s(((e,t)=>{var n=Xa(),r=Za(),i=Qa(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),eo=s(((e,t)=>{var n=qa(),r=He(),i=O(),a=Ya(),o=Ue(),s=$a(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),to=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),no=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),ro=s(((e,t)=>{t.exports=no()(Object.keys,Object)})),io=s(((e,t)=>{var n=to(),r=ro(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),ao=s(((e,t)=>{var n=eo(),r=io(),i=$i();function a(e){return i(e)?n(e):r(e)}t.exports=a})),oo=s(((e,t)=>{var n=Ka(),r=ao();function i(e,t){return e&&n(e,t,r)}t.exports=i})),so=s(((e,t)=>{var n=$i();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o{var n=oo();t.exports=so()(n)})),lo=s(((e,t)=>{var n=co();function r(e,t,r,i){return n(e,function(e,n,a){t(i,e,r(e),a)}),i}t.exports=r})),uo=s(((e,t)=>{var n=we();function r(){this.__data__=new n,this.size=0}t.exports=r})),fo=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),po=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),mo=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),ho=s(((e,t)=>{var n=we(),r=Te(),i=Ne(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length{var n=we(),r=uo(),i=fo(),a=po(),o=mo(),s=ho();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),_o=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n{var n=Pi(),r=_o(),i=Vi(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g{t.exports=A().Uint8Array})),bo=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),xo=s(((e,t)=>{var n=j(),r=yo(),i=ve(),a=vo(),o=bo(),s=Wi(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),So=s(((e,t)=>{var n=Ji(),r=O();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Co=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n{function n(){return[]}t.exports=n})),To=s(((e,t)=>{var n=Co(),r=wo(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),Eo=s(((e,t)=>{var n=So(),r=To(),i=ao();function a(e){return n(e,i,r)}t.exports=a})),Do=s(((e,t)=>{var n=Eo(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f{t.exports=le()(A(),`DataView`)})),ko=s(((e,t)=>{t.exports=le()(A(),`Promise`)})),Ao=s(((e,t)=>{t.exports=le()(A(),`WeakMap`)})),jo=s(((e,t)=>{var n=Oo(),r=Te(),i=ko(),a=Hi(),o=Ao(),s=N(),c=oe(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),Mo=s(((e,t)=>{var n=go(),r=vo(),i=xo(),a=Do(),o=jo(),s=O(),c=Ya(),l=$a(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),No=s(((e,t)=>{var n=Mo(),r=te();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),Po=s(((e,t)=>{var n=go(),r=No(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c{var n=re();function r(e){return e===e&&!n(e)}t.exports=r})),Io=s(((e,t)=>{var n=Fo(),r=ao();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),Lo=s(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),Ro=s(((e,t)=>{var n=Po(),r=Io(),i=Lo();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),zo=s(((e,t)=>{var n=Be(),r=Ge();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i{var n=zo();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),Vo=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Ho=s(((e,t)=>{var n=Vo(),r=Ke();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Uo=s(((e,t)=>{var n=No(),r=Bo(),i=Ho(),a=P(),o=Fo(),s=Lo(),c=Ge(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),Wo=s(((e,t)=>{function n(e){return e}t.exports=n})),Go=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Ko=s(((e,t)=>{var n=zo();function r(e){return function(t){return n(t,e)}}t.exports=r})),qo=s(((e,t)=>{var n=Go(),r=Ko(),i=P(),a=Ge();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),Jo=s(((e,t)=>{var n=Ro(),r=Uo(),i=Wo(),a=O(),o=qo();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Yo=s(((e,t)=>{var n=Wa(),r=lo(),i=Jo(),a=O();function o(e,t){return function(o,s){var c=a(o)?n:r,l=t?t():{};return c(o,e,i(s,2),l)}}t.exports=o})),Xo=u(s(((e,t)=>{var n=Ua(),r=Yo(),i=Object.prototype.hasOwnProperty;t.exports=r(function(e,t,r){i.call(e,r)?e[r].push(t):n(e,r,[t])})}))(),1);Ti(),vr();function Zo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){if(_!==void 0||t[t.length-1]!==n[t.length-1])return;let y=ma(g);ga(t,c,o,s,a,(n,o,s,c,_)=>{if(n!==t[t.length-1])return;o+=n.width;let b=Math.max(o,c);b>r||(e.save(),e.beginPath(),e.rect(b,a+1,1e4,i-a-1),e.clip(),ha(_,s,i,l,u,m,h,y,(t,n,r,i)=>{if(!i&&g.length>0&&!g.some(e=>ba(o,t,1e4,r,e.x,e.y,e.width,e.height)))return;let a=f.hasIndex(n),s=p.hasIndex(n);e.beginPath();let c=d?.(n),l=c===void 0?v:xi(v,c);l.bgCell!==v.bgCell&&(e.fillStyle=l.bgCell,e.fillRect(o,t,1e4,r)),s&&(e.fillStyle=l.bgHeader,e.fillRect(o,t,1e4,r)),a&&(e.fillStyle=l.accentLight,e.fillRect(o,t,1e4,r))}),e.restore())})}function Qo(e,t,n,r,i,a,o,s,c){let l=!1;for(let e of t)if(!e.sticky){l=o(e.sourceIndex);break}let u=c.horizontalBorderColor??c.borderColor,d=c.borderColor,f=l?Rr(t):0,p;if(f!==0&&(p=pr(d,c.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,r),e.strokeStyle=p,e.stroke()),i>0){let t=d===u&&p!==void 0?p:pr(u,c.bgCell),o=zr(a,i,s);e.beginPath(),e.moveTo(0,r-o+.5),e.lineTo(n,r-o+.5),e.strokeStyle=t,e.stroke()}}var $o=(e,t,n)=>{let r=0,i=t,a=0,o=n;if(e!==void 0&&e.length>0){r=2**53-1,a=2**53-1,i=-(2**53-1),o=-(2**53-1);for(let t of e)r=Math.min(r,t.x-1),i=Math.max(i,t.x+t.width+1),a=Math.min(a,t.y-1),o=Math.max(o,t.y+t.height+1)}return{minX:r,maxX:i,minY:a,maxY:o}};function es(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=m.bgCell,{minX:g,maxX:_,minY:v,maxY:y}=$o(s,a,o),b=[],x=o-zr(p,f,l),S=c,C=n,w=0;for(;S+i=v&&e<=y-1){let n=u?.(C)?.bgCell;n!==void 0&&n!==h&&C>=p-f&&b.push({x:g,y:e,w:_-g,h:t,color:n})}S+=t,C0)for(let e=0;e=g&&i<=_&&d(e+1)&&b.push({x:i,y:w,w:n.width,h:E,color:a}),T+=n.width}if(b.length===0)return;let D;e.beginPath();for(let t=b.length-1;t>=0;t--){let n=b[t];D===void 0?D=n.color:n.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=n.color),e.rect(n.x,n.y,n.w,n.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function ts(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=!1){if(c!==void 0){e.beginPath(),e.save(),e.rect(0,0,a,o);for(let t of c)e.rect(t.x+1,t.y+1,t.width-1,t.height-1);e.clip(`evenodd`)}let v=g.horizontalBorderColor??g.borderColor,y=g.borderColor,{minX:b,maxX:x,minY:S,maxY:C}=$o(s,a,o),w=[];e.beginPath();let T=.5;for(let e=0;e=b&&i<=x&&p(e+1)&&w.push({x1:i,y1:Math.max(l,S),x2:i,y2:Math.min(o,C),color:y})}let E=o+.5;for(let e=h-m;e=S&&n<=C-1){let e=f?.(t);w.push({x1:b,y1:n,x2:x,y2:n,color:e?.horizontalBorderColor??e?.borderColor??v})}e+=d(t),t++}}let D=(0,Xo.default)(w,e=>e.color);for(let t of Object.keys(D)){e.strokeStyle=t;for(let n of D[t])e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke(),e.beginPath()}c!==void 0&&e.restore()}E();function ns(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=[];e.imageSmoothingEnabled=!1;let b=Math.min(i.cellYOffset,o),x=Math.max(i.cellYOffset,o),S=0;if(typeof _==`number`)S+=(x-b)*_;else for(let e=b;ei.cellYOffset&&(S=-S),S+=c-i.translateY;let C=Math.min(i.cellXOffset,a),w=Math.max(i.cellXOffset,a),T=0;for(let e=C;ei.cellXOffset&&(T=-T),T+=s-i.translateX;let E=Rr(g);if(T!==0&&S!==0)return{regions:[]};let D=l>0?zr(f,l,_):0,O=u-E-Math.abs(T),k=d-p-D-Math.abs(S)-1;if(O>150&&k>150){let i={sx:0,sy:0,sw:u*m,sh:d*m,dx:0,dy:0,dw:u*m,dh:d*m};if(S>0?(i.sy=(p+1)*m,i.sh=k*m,i.dy=(S+p+1)*m,i.dh=k*m,y.push({x:0,y:p,width:u,height:S+1})):S<0&&(i.sy=(-S+p+1)*m,i.sh=k*m,i.dy=(p+1)*m,i.dh=k*m,y.push({x:0,y:d+S-D,width:u,height:-S+D})),T>0?(i.sx=E*m,i.sw=O*m,i.dx=(T+E)*m,i.dw=O*m,y.push({x:E-1,y:0,width:T+2,height:d})):T<0&&(i.sx=(E-T)*m,i.sw=O*m,i.dx=E*m,i.dw=O*m,y.push({x:u+T,y:0,width:-T,height:d})),e.setTransform(1,0,0,1,0,0),v){if(E>0&&T!==0&&S===0&&(r===void 0||n?.[1]!==!1)){let n=E*m,r=d*m;e.drawImage(t,0,0,n,r,0,0,n,r)}if(D>0&&T===0&&S!==0&&(r===void 0||n?.[0]!==!1)){let n=(d-D)*m,r=u*m,i=D*m;e.drawImage(t,0,n,r,i,0,n,r,i)}}e.drawImage(t,i.sx,i.sy,i.sw,i.sh,i.dx,i.dy,i.dw,i.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:y}}function rs(e,t,n,r,i,a,o,s,c,l){let u=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||ga(c,n,r,i,s,(e,t,n,r)=>{if(e.sourceIndex===l){let e=Math.max(t,r)+1;return u.push({x:e,y:0,width:a-e,height:o}),!0}}),u}function is(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;re.style!==`no-outline`);if(g===void 0||g.length===0)return;let _=Rr(s),v=zr(p,f,d),y=[c,0,s.length,p-f],b=[_,0,t,n-v],x=g.map(e=>{let m=e.range,h=e.style??`dashed`;return Ta(m,y,t,n,b).map(m=>{let g=m.rect,_=ui(g.x,g.y,t,n,u,l+u,r,i,a,o,p,c,f,s,d),v=g.width===1&&g.height===1?_:ui(g.x+g.width-1,g.y+g.height-1,t,n,u,l+u,r,i,a,o,p,c,f,s,d);return g.x+g.width>=s.length&&--v.width,g.y+g.height>=p&&--v.height,{color:e.color,style:h,clip:m.clip,rect:wa({x:_.x,y:_.y,width:v.x+v.width-_.x,height:v.y+v.height-_.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let r=!1;for(let i of x)for(let a of i)if(a?.rect!==void 0&&ba(0,0,t,n,a.rect.x,a.rect.y,a.rect.width,a.rect.height)){let t=r,n=!Ca(a.clip,a.rect);n&&(e.save(),e.rect(a.clip.x,a.clip.y,a.clip.width,a.clip.height),e.clip()),a.style===`dashed`&&!r?(e.setLineDash([5,3]),r=!0):(a.style===`solid`||a.style===`solid-outline`)&&r&&(e.setLineDash([]),r=!1),e.strokeStyle=a.style===`solid-outline`?mr(mr(a.color,h.borderColor),h.bgCell):fr(a.color,1),e.strokeRect(a.rect.x+.5,a.rect.y+.5,a.rect.width-1,a.rect.height-1),n&&(e.restore(),r=t)}r&&e.setLineDash([])};return S(),S}function os(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function ss(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){if(u.current===void 0)return;let _=u.current.range,v=u.current.cell,y=[_.x+_.width-1,_.y+_.height-1];if(v[1]>=g&&y[1]>=g||!o.some(e=>e.sourceIndex===v[0]||e.sourceIndex===y[0]))return;let[b,x]=u.current.cell,S=f(u.current.cell),C=S.span??[b,b],w=x>=g-p,T=p>0&&!w?zr(g,p,d)-1:0,E=y[1],D;if(ga(o,r,i,a,l,(r,i,a,o,l)=>{if(r.sticky&&b>r.sourceIndex)return;let u=r.sourceIndexC[1],_=r.sourceIndex===y[0];if(!(!_&&(u||f)))return ha(l,a,n,g,d,p,m,void 0,(a,l,u)=>{if(l!==x&&l!==E)return;let d=i,f=r.width;if(S.span!==void 0){let e=va(S.span,i,a,r.width,u,r,s),t=r.sticky?e[0]:e[1];t!==void 0&&(d=t.x,f=t.width)}return l===E&&_&&h&&(D=()=>{o>d&&!r.sticky&&(e.beginPath(),e.rect(o,0,t-o,n),e.clip()),e.beginPath(),e.rect(d+f-4,a+u-4,4,4),e.fillStyle=r.themeOverride?.accentColor??c.accentColor,e.fill()}),D!==void 0}),D!==void 0}),D===void 0)return;let O=()=>{e.save(),e.beginPath(),e.rect(0,l,t,n-l-T),e.clip(),D?.(),e.restore()};return O(),O}vr(),E();function cs(e,t,n,r,i,a,o,s,c){c===void 0||c.size===0||(e.beginPath(),_a(t,n,a,r,(t,n,r,i,a,o)=>{c.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1})&&e.rect(r,i,a,o)}),ga(t,s,a,o,i,(t,n,a,o)=>{let s=Math.max(0,o-n),l=n+s+1,u=t.width-s-1;c.has([t.sourceIndex,-1])&&e.rect(l,r,u,i-r)}),e.clip())}function ls(e,t,n,r,i,a,o,s,c,l){let u=0;return ga(e,a,r,i,n,(e,n,r,i,a)=>(ha(a,r,t,o,s,c,l,void 0,(e,t,n,r)=>{r||(u=Math.max(t,u))}),!0)),u}function us(e,t){let{canvasCtx:n,headerCanvasCtx:r,width:i,height:a,cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mappedColumns:u,enableGroups:d,freezeColumns:f,dragAndDropState:p,theme:m,drawFocus:h,headerHeight:g,groupHeaderHeight:_,disabledRows:v,rowHeight:y,verticalBorder:b,overrideCursor:S,isResizing:C,selection:w,fillHandle:T,freezeTrailingRows:E,rows:D,getCellContent:O,getGroupDetails:k,getRowThemeOverride:A,isFocused:j,drawHeaderCallback:M,prelightCells:ee,drawCellCallback:N,highlightRegions:te,resizeCol:ne,imageLoader:P,lastBlitData:re,hoverValues:F,hyperWrapping:ie,hoverInfo:ae,spriteManager:oe,maxScaleFactor:se,hasAppendRow:ce,touchMode:le,enqueue:ue,renderStateProvider:de,getCellRenderer:fe,renderStrategy:pe,bufferACtx:me,bufferBCtx:he,damage:ge,minimumCellWidth:_e}=e;if(i===0||a===0)return;let ve=pe===`double-buffer`,ye=Math.min(se,Math.ceil(window.devicePixelRatio??1)),be=pe!==`direct`&&is(e,t),xe=n.canvas;(xe.width!==i*ye||xe.height!==a*ye)&&(xe.width=i*ye,xe.height=a*ye,xe.style.width=i+`px`,xe.style.height=a+`px`);let Se=r.canvas,Ce=d?_+g:g,we=Ce+1;(Se.width!==i*ye||Se.height!==we*ye)&&(Se.width=i*ye,Se.height=we*ye,Se.style.width=i+`px`,Se.style.height=we+`px`);let Te=me.canvas,Ee=he.canvas;ve&&(Te.width!==i*ye||Te.height!==a*ye)&&(Te.width=i*ye,Te.height=a*ye,re.current!==void 0&&(re.current.aBufferScroll=void 0)),ve&&(Ee.width!==i*ye||Ee.height!==a*ye)&&(Ee.width=i*ye,Ee.height=a*ye,re.current!==void 0&&(re.current.bBufferScroll=void 0));let De=re.current;if(be===!0&&o===De?.cellXOffset&&s===De?.cellYOffset&&c===De?.translateX&&l===De?.translateY)return;let Oe=null;ve&&(Oe=n);let ke=r,Ae;Ae=ve?ge===void 0?De?.lastBuffer===`b`?me:he:De?.lastBuffer===`b`?he:me:n;let je=Ae.canvas,Me=ve?je===Te?Ee:Te:xe,Ne=typeof y==`number`?()=>y:y;ke.save(),Ae.save(),ke.beginPath(),Ae.beginPath(),ke.textBaseline=`middle`,Ae.textBaseline=`middle`,ye!==1&&(ke.scale(ye,ye),Ae.scale(ye,ye));let Pe=Br(u,o,i,p,c),Fe=[],Ie=h&&w.current?.cell[1]===s&&l===0,Le=!1;if(te!==void 0){for(let e of te)if(e.style!==`no-outline`&&e.range.y===s&&l===0){Le=!0;break}}let Re=()=>{Fa(ke,Pe,d,ae,i,c,g,_,p,C,w,m,oe,F,b,k,ge,M,le),ts(ke,Pe,s,c,l,i,a,void 0,void 0,_,Ce,Ne,A,b,E,D,m,!0),ke.beginPath(),ke.moveTo(0,we-.5),ke.lineTo(i,we-.5),ke.strokeStyle=mr(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),ke.stroke(),Le&&as(ke,i,a,o,s,c,l,u,f,g,_,y,E,D,te,m),Ie&&ss(ke,i,a,s,c,l,Pe,u,m,Ce,w,Ne,O,E,ce,T,D)};if(ge!==void 0){let e=Pe[Pe.length-1].sourceIndex+1,t=ge.hasItemInRegion([{x:o,y:-2,width:e,height:2},{x:o,y:s,width:e,height:300},{x:0,y:s,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:o,y:D-E,width:e,height:E,when:E>0}]),n=e=>{Da(e,Pe,u,a,Ce,c,l,s,D,Ne,O,k,A,v,j,h,E,ce,Fe,ge,w,ee,te,P,oe,F,ae,N,ie,m,ue,de,fe,S,_e);let t=w.current;T&&h&&t!==void 0&&ge.has(Pr(t.range))&&ss(e,i,a,s,c,l,Pe,u,m,Ce,w,Ne,O,E,ce,T,D)};t&&(n(Ae),Oe!==null&&(Oe.save(),Oe.scale(ye,ye),Oe.textBaseline=`middle`,n(Oe),Oe.restore()),ge.hasHeader()&&(cs(ke,Pe,i,_,Ce,c,l,s,ge),Re())),Ae.restore(),ke.restore();return}if((be!==!0||o!==De?.cellXOffset||c!==De?.translateX||Ie!==De?.mustDrawFocusOnHeader||Le!==De?.mustDrawHighlightRingsOnHeader)&&Re(),be===!0){x(Me!==void 0&&De!==void 0);let{regions:e}=ns(Ae,Me,Me===Te?De.aBufferScroll:De.bBufferScroll,Me===Te?De.bBufferScroll:De.aBufferScroll,De,o,s,c,l,E,i,a,D,Ce,ye,u,Pe,y,ve);Fe=e}else be!==!1&&(x(De!==void 0),Fe=rs(De,o,s,c,l,i,a,Ce,Pe,be));Qo(Ae,Pe,i,a,E,D,b,Ne,m);let ze=as(Ae,i,a,o,s,c,l,u,f,g,_,y,E,D,te,m),Be=h?ss(Ae,i,a,s,c,l,Pe,u,m,Ce,w,Ne,O,E,ce,T,D):void 0;if(Ae.fillStyle=m.bgCell,Fe.length>0){Ae.beginPath();for(let e of Fe)Ae.rect(e.x,e.y,e.width,e.height);Ae.clip(),Ae.fill(),Ae.beginPath()}else Ae.fillRect(0,0,i,a);let Ve=Da(Ae,Pe,u,a,Ce,c,l,s,D,Ne,O,k,A,v,j,h,E,ce,Fe,ge,w,ee,te,P,oe,F,ae,N,ie,m,ue,de,fe,S,_e);Zo(Ae,Pe,u,i,a,Ce,c,l,s,D,Ne,A,w.rows,v,E,ce,Fe,ge,m),es(Ae,Pe,s,c,l,i,a,Fe,Ce,Ne,A,b,E,D,m),ts(Ae,Pe,s,c,l,i,a,Fe,Ve,_,Ce,Ne,A,b,E,D,m),ze?.(),Be?.(),C&&ga(Pe,0,c,0,Ce,(e,t)=>e.sourceIndex===ne?(os(ke,t+e.width,0,Ce+1,mr(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),os(Ae,t+e.width,Ce,a,mr(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Oe!==null&&(Oe.fillStyle=m.bgCell,Oe.fillRect(0,0,i,a),Oe.drawImage(Ae.canvas,0,0));let He=ls(Pe,a,Ce,c,l,s,D,Ne,E,ce);P?.setWindow({x:o,y:s,width:Pe.length,height:He-s},f,Array.from({length:E},(e,t)=>D-1-t));let Ue=De!==void 0&&(o!==De.cellXOffset||c!==De.translateX),We=De!==void 0&&(s!==De.cellYOffset||l!==De.translateY);re.current={cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mustDrawFocusOnHeader:Ie,mustDrawHighlightRingsOnHeader:Le,lastBuffer:ve?je===Te?`a`:`b`:void 0,aBufferScroll:je===Te?[Ue,We]:De?.aBufferScroll,bBufferScroll:je===Ee?[Ue,We]:De?.bBufferScroll},Ae.restore(),ke.restore()}var ds=u(ji(),1),fs=80;function ps(e){let t=e-1;return t*t*t+1}var ms=class{callback;constructor(e){this.callback=e}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=e=>{this.leavingItems.some(t=>Nr(t.item,e.item))||this.leavingItems.push(e)};removeFromLeavingItems=e=>{let t=this.leavingItems.find(t=>Nr(t.item,e));return this.leavingItems=this.leavingItems.filter(e=>e!==t),t?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(e=>e.hoverAmount>0)};shouldStep=()=>{let e=this.leavingItems.length>0,t=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return e||t};getAnimatingItems=()=>this.currentHoveredItem===void 0?this.leavingItems.map(e=>({...e,hoverAmount:ps(e.hoverAmount)})):[...this.leavingItems,this.currentHoveredItem];step=e=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=e;else{let t=(e-this.lastAnimationTime)/fs;for(let e of this.leavingItems)e.hoverAmount=(0,ds.default)(e.hoverAmount-t,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,ds.default)(this.currentHoveredItem.hoverAmount+t,0,1));let n=this.getAnimatingItems();this.callback(n),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=e,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=e=>{if(!Nr(this.currentHoveredItem?.item,e)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),e!==void 0){let t=this.removeFromLeavingItems(e);this.currentHoveredItem={item:e,hoverAmount:t}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}},hs=class{fn;val;constructor(e){this.fn=e}get value(){return this.val??=this.fn()}};function gs(e){return new hs(e)}var _s=gs(()=>window.navigator.userAgent.includes(`Firefox`)),vs=gs(()=>window.navigator.userAgent.includes(`Mac OS`)&&window.navigator.userAgent.includes(`Safari`)&&!window.navigator.userAgent.includes(`Chrome`)),ys=gs(()=>window.navigator.platform.toLowerCase().startsWith(`mac`));function bs(e){let t=L.useRef([]),n=L.useRef(0),r=L.useRef(e);r.current=e;let i=L.useCallback(()=>{let e=()=>window.requestAnimationFrame(i),i=()=>{let e=t.current.map(hi);t.current=[],r.current(new vi(e)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?e:i)},[]);return L.useCallback(e=>{t.current.length===0&&i();let n=fi(e[0],e[1]);t.current.includes(n)||t.current.push(n)},[i])}var xs=`header`,Ss=`group-header`,Cs=`out-of-bounds`,ws;(function(e){e[e.Start=-2]=`Start`,e[e.StartPadding=-1]=`StartPadding`,e[e.Center=0]=`Center`,e[e.EndPadding=1]=`EndPadding`,e[e.End=2]=`End`})(ws||={});function Ts(e,t){return e===t?!0:e?.kind===`out-of-bounds`?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}ct();var Es=u(ra(),1);E();var Ds=6,Os=(e,t)=>e.kind===I.Custom?e.copyData:(t?.(e))?.getAccessibilityString(e)??``,ks=L.memo(L.forwardRef((e,t)=>{let{width:n,height:r,accessibilityHeight:i,columns:a,cellXOffset:o,cellYOffset:s,headerHeight:c,fillHandle:l=!1,groupHeaderHeight:u,rowHeight:d,rows:f,getCellContent:p,getRowThemeOverride:m,onHeaderMenuClick:h,enableGroups:g,isFilling:_,onCanvasFocused:v,onCanvasBlur:y,isFocused:b,selection:S,freezeColumns:C,onContextMenu:w,freezeTrailingRows:T,fixedShadowX:E=!0,fixedShadowY:D=!0,drawFocusRing:O,onMouseDown:k,onMouseUp:A,onMouseMoveRaw:j,onMouseMove:M,onItemHovered:ee,dragAndDropState:N,firstColAccessible:te,onKeyDown:ne,onKeyUp:P,highlightRegions:re,canvasRef:F,onDragStart:ie,onDragEnd:ae,eventTargetRef:oe,isResizing:se,resizeColumn:ce,isDragging:le,isDraggable:ue=!1,allowResize:de,disabledRows:fe,hasAppendRow:pe,getGroupDetails:me,theme:he,prelightCells:ge,headerIcons:_e,verticalBorder:ve,drawCell:ye,drawHeader:be,onCellFocused:xe,onDragOverCell:Se,onDrop:Ce,onDragLeave:we,imageWindowLoader:Te,smoothScrollX:Ee=!1,smoothScrollY:De=!1,experimental:Oe,getCellRenderer:ke}=e,Ae=e.translateX??0,je=e.translateY??0,Me=Math.max(C,Math.min(a.length-1,o)),Ne=L.useRef(null),Pe=Te,Fe=L.useRef(),[Ie,Le]=L.useState(!1),Re=L.useRef([]),ze=L.useRef(),[Be,Ve]=L.useState(),[He,Ue]=L.useState(),We=L.useRef(null),[Ge,Ke]=L.useState(),[qe,Je]=L.useState(!1),Ye=L.useRef(qe);Ye.current=qe;let Xe=L.useMemo(()=>new pa(_e,()=>{vt.current=void 0,St.current()}),[_e]),$e=g?u+c:c,tt=L.useRef(-1),nt=(Oe?.enableFirefoxRescaling??!1)&&_s.value,rt=(Oe?.enableSafariRescaling??!1)&&vs.value;L.useLayoutEffect(()=>{window.devicePixelRatio===1||!nt&&!rt||(tt.current!==-1&&Le(!0),window.clearTimeout(tt.current),tt.current=window.setTimeout(()=>{Le(!1),tt.current=-1},200))},[s,Me,Ae,je,nt,rt]);let it=Or(a,C),ot=E?Rr(it,N):0,ct=L.useCallback((e,t,i)=>{let a=e.getBoundingClientRect();if(t>=it.length||i>=f)return;let o=a.width/n,c=ui(t,i,n,r,u,$e,Me,s,Ae,je,f,C,T,it,d);return o!==1&&(c.x*=o,c.y*=o,c.width*=o,c.height*=o),c.x+=a.x,c.y+=a.y,c},[n,r,u,$e,Me,s,Ae,je,f,C,T,it,d]),lt=L.useCallback((e,t,i,a)=>{let o=e.getBoundingClientRect(),p=o.width/n,m=(t-o.left)/p,h=(i-o.top)/p,_=Br(it,Me,n,void 0,Ae),v=0,y=0;a instanceof MouseEvent&&(v=a.button,y=a.buttons);let b=Vr(m,_,Ae),C=Hr(h,r,g,c,u,f,d,s,je,T),w=a?.shiftKey===!0,E=a?.ctrlKey===!0,D=a?.metaKey===!0,O=a!==void 0&&!(a instanceof MouseEvent)||a?.pointerType===`touch`,k=[m<0?-1:+(nn||h>r){let i=m>n?1:m<0?-1:0,a=h>r?1:h<0?-1:0,o=i*2,s=a*2;i===0&&(o=b===-1?ws.EndPadding:ws.Center),a===0&&(s=C===void 0?ws.EndPadding:ws.Center);let c=!1;if(b===-1&&C===-1){let n=ct(e,it.length-1,-1);x(n!==void 0),c=tn&&mr&&h=0?(r=!0,n=ct(e,a,C),x(n!==void 0),A={kind:g&&C===-2?Ss:xs,location:[a,C],bounds:n,group:it[a].group??``,isEdge:r,shiftKey:w,ctrlKey:E,metaKey:D,isTouch:O,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:k}):A={kind:g&&C===-2?Ss:xs,group:it[b].group??``,location:[b,C],bounds:n,isEdge:r,shiftKey:w,ctrlKey:E,metaKey:D,isTouch:O,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:k}}else{let n=ct(e,b,C);x(n!==void 0);let r=n!==void 0&&n.x+n.width-t<5,a=!1;if(l&&S.current!==void 0){let n=Pr(S.current.range),r=ct(e,n[0],n[1]);if(r!==void 0){let e=r.x+r.width-2,n=r.y+r.height-2;a=Math.abs(e-t){}),ft=L.useRef(Be);ft.current=Be;let[pt,mt]=L.useMemo(()=>{let e=document.createElement(`canvas`),t=document.createElement(`canvas`);return e.style.display=`none`,e.style.opacity=`0`,e.style.position=`fixed`,t.style.display=`none`,t.style.opacity=`0`,t.style.position=`fixed`,[e.getContext(`2d`,{alpha:!1}),t.getContext(`2d`,{alpha:!1})]},[]);L.useLayoutEffect(()=>{if(!(pt===null||mt===null))return document.documentElement.append(pt.canvas),document.documentElement.append(mt.canvas),()=>{pt.canvas.remove(),mt.canvas.remove()}},[pt,mt]);let ht=L.useMemo(()=>new _i,[]),gt=nt&&Ie?1:rt&&Ie?2:5,_t=Oe?.disableMinimumCellWidth===!0?1:10,vt=L.useRef(),yt=L.useRef(null),bt=L.useRef(null),xt=L.useCallback(()=>{let e=Ne.current,t=We.current;if(e===null||t===null||(yt.current===null&&(yt.current=e.getContext(`2d`,{alpha:!1}),e.width=0,e.height=0),bt.current===null&&(bt.current=t.getContext(`2d`,{alpha:!1}),t.width=0,t.height=0),yt.current===null||bt.current===null||pt===null||mt===null))return;let i=!1,a=e=>{i=!0,Ke(e)},o=vt.current,h={headerCanvasCtx:bt.current,canvasCtx:yt.current,bufferACtx:pt,bufferBCtx:mt,width:n,height:r,cellXOffset:Me,cellYOffset:s,translateX:Math.round(Ae),translateY:Math.round(je),mappedColumns:it,enableGroups:g,freezeColumns:C,dragAndDropState:N,theme:he,headerHeight:c,groupHeaderHeight:u,disabledRows:fe??st.empty(),rowHeight:d,verticalBorder:ve,isResizing:se,resizeCol:ce,isFocused:b,selection:S,fillHandle:l,drawCellCallback:ye,hasAppendRow:pe,overrideCursor:a,maxScaleFactor:gt,freezeTrailingRows:T,rows:f,drawFocus:O,getCellContent:p,getGroupDetails:me??(e=>({name:e})),getRowThemeOverride:m,drawHeaderCallback:be,prelightCells:ge,highlightRegions:re,imageLoader:Pe,lastBlitData:ze,damage:Fe.current,hoverValues:Re.current,hoverInfo:ft.current,spriteManager:Xe,scrolling:Ie,hyperWrapping:Oe?.hyperWrapping??!1,touchMode:qe,enqueue:dt.current,renderStateProvider:ht,renderStrategy:Oe?.renderStrategy??(vs.value?`double-buffer`:`single-buffer`),getCellRenderer:ke,minimumCellWidth:_t};h.damage===void 0?(vt.current=h,us(h,o)):us(h,void 0),!i&&(h.damage===void 0||h.damage.has(ft?.current?.[0]))&&Ke(void 0)},[pt,mt,n,r,Me,s,Ae,je,it,g,C,N,he,c,u,fe,d,ve,se,pe,ce,b,S,l,T,f,O,gt,p,me,m,ye,be,ge,re,Pe,Xe,Ie,Oe?.hyperWrapping,Oe?.renderStrategy,qe,ht,ke,_t]),St=L.useRef(xt);L.useLayoutEffect(()=>{xt(),St.current=xt},[xt]),L.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,vt.current=void 0,St.current())})()},[]);let Ct=L.useCallback(e=>{Fe.current=e,St.current(),Fe.current=void 0},[]);dt.current=bs(Ct);let wt=L.useCallback(e=>{Ct(new vi(e.map(e=>e.cell)))},[Ct]);Pe.setCallback(Ct);let[Tt,Et]=L.useState(!1),[Dt,Ot]=ut??[],kt=Dt!==void 0&&Ot===-1,At=Dt!==void 0&&Ot===-2,jt=!1,Mt=!1,Nt=Ge;if(Nt===void 0&&Dt!==void 0&&Ot!==void 0&&Ot>-1&&Ot({contain:`strict`,display:`block`,cursor:Pt}),[Pt]),It=L.useRef(`default`),Lt=oe?.current;Lt!=null&&It.current!==Ft.cursor&&(Lt.style.cursor=It.current=Ft.cursor);let Rt=L.useCallback((e,t,n,r)=>{if(me===void 0)return;let i=me(e);if(i.actions!==void 0){let e=za(t,i.actions);for(let[a,o]of e.entries())if(xa(o,n+t.x,r+o.y))return i.actions[a]}},[me]),zt=L.useCallback((e,t,n,r)=>{let i=a[t];if(!le&&!se&&i.hasMenu===!0&&!(He??!1)){let a=ct(e,t,-1);x(a!==void 0);let o=Ra(a.x,a.y,a.width,a.height,R(i.title)===`rtl`);if(n>o.x&&no.y&&r{let t=Ne.current,n=oe?.current;if(t===null||e.target!==t&&e.target!==n)return;Ht.current=!0;let r,i;if(e instanceof MouseEvent?(r=e.clientX,i=e.clientY):(r=e.touches[0].clientX,i=e.touches[0].clientY),e.target===n&&n!==null){let e=n.getBoundingClientRect();if(r>e.right||i>e.bottom)return}let a=lt(t,r,i,e);Vt.current=a.location,a.isTouch&&(Bt.current=Date.now()),Ye.current!==a.isTouch&&Je(a.isTouch),!(a.kind===`header`&&zt(t,a.location[0],r,i)!==void 0)&&(a.kind===`group-header`&&Rt(a.group,a.bounds,a.localEventX,a.localEventY)!==void 0||(k?.(a),!a.isTouch&&ue!==!0&&ue!==a.kind&&a.button<3&&a.button!==1&&e.preventDefault()))},[oe,ue,lt,Rt,zt,k]);qt(`touchstart`,Ut,window,!1),qt(`mousedown`,Ut,window,!1);let Wt=L.useRef(0),Gt=L.useCallback(e=>{let t=Wt.current;Wt.current=Date.now();let n=Ne.current;if(Ht.current=!1,A===void 0||n===null)return;let r=oe?.current,i=e.target!==n&&e.target!==r,a,o,s=!0;if(e instanceof MouseEvent){if(a=e.clientX,o=e.clientY,s=e.button<3,e.pointerType===`touch`)return}else a=e.changedTouches[0].clientX,o=e.changedTouches[0].clientY;let c=lt(n,a,o,e);c.isTouch&&Bt.current!==0&&Date.now()-Bt.current>500&&(c={...c,isLongTouch:!0}),t!==0&&Date.now()-t<(c.isTouch?1e3:500)&&(c={...c,isDoubleClick:!0}),Ye.current!==c.isTouch&&Je(c.isTouch),!i&&e.cancelable&&s&&e.preventDefault();let[l]=c.location,u=zt(n,l,a,o);if(c.kind===`header`&&u!==void 0){(c.button!==0||Vt.current?.[0]!==l||Vt.current?.[1]!==-1)&&A(c,!0);return}else if(c.kind===`group-header`){let e=Rt(c.group,c.bounds,c.localEventX,c.localEventY);if(e!==void 0){c.button===0&&e.onClick(c);return}}A(c,i)},[A,oe,lt,zt,Rt]);qt(`mouseup`,Gt,window,!1),qt(`touchend`,Gt,window,!1),qt(`click`,L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n=oe?.current,r=e.target!==t&&e.target!==n,i,a,o=!0;e instanceof MouseEvent?(i=e.clientX,a=e.clientY,o=e.button<3):(i=e.changedTouches[0].clientX,a=e.changedTouches[0].clientY);let s=lt(t,i,a,e);Ye.current!==s.isTouch&&Je(s.isTouch),!r&&e.cancelable&&o&&e.preventDefault();let[c]=s.location,l=zt(t,c,i,a);if(s.kind===`header`&&l!==void 0)s.button===0&&Vt.current?.[0]===c&&Vt.current?.[1]===-1&&h?.(c,l);else if(s.kind===`group-header`){let e=Rt(s.group,s.bounds,s.localEventX,s.localEventY);e!==void 0&&s.button===0&&e.onClick(s)}},[oe,lt,zt,h,Rt]),window,!1),qt(`contextmenu`,L.useCallback(e=>{let t=Ne.current,n=oe?.current;if(t===null||e.target!==t&&e.target!==n||w===void 0)return;let r=lt(t,e.clientX,e.clientY,e);w(r,()=>{e.cancelable&&e.preventDefault()})},[oe,lt,w]),oe?.current??null,!1);let Kt=L.useCallback(e=>{Fe.current=new vi(e.map(e=>e.item)),Re.current=e,St.current(),Fe.current=void 0},[]),Jt=L.useMemo(()=>new ms(Kt),[Kt]),Yt=L.useRef(Jt);Yt.current=Jt,L.useLayoutEffect(()=>{let e=Yt.current;if(ut===void 0||ut[1]<0){e.setHovered(ut);return}let t=p(ut,!0),n=ke(t),r=n===void 0&&t.kind===I.Custom||n?.needsHover!==void 0&&(typeof n.needsHover==`boolean`?n.needsHover:n.needsHover(t));e.setHovered(r?ut:void 0)},[p,ke,ut]);let Xt=L.useRef();qt(`mousemove`,L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n=oe?.current,r=e.target!==t&&e.target!==n,i=lt(t,e.clientX,e.clientY,e);if(i.kind!==`out-of-bounds`&&r&&!Ht.current&&!i.isTouch)return;let a=(e,t)=>{Ve(n=>n===e||n?.[0][0]===e?.[0][0]&&n?.[0][1]===e?.[0][1]&&(n?.[1][0]===e?.[1][0]&&n?.[1][1]===e?.[1][1]||!t)?n:e)};if(!Ts(i,Xt.current))Ke(void 0),ee?.(i),a(i.kind===`out-of-bounds`?void 0:[i.location,[i.localEventX,i.localEventY]],!0),Xt.current=i;else if(i.kind===`cell`||i.kind===`header`||i.kind===`group-header`){let e=!1,t=!0;if(i.kind===`cell`){let n=p(i.location);t=ke(n)?.needsHoverPosition??n.kind===I.Custom,e=t}else i.kind===`group-header`&&(e=!0);let n=[i.location,[i.localEventX,i.localEventY]];a(n,t),ft.current=n,e&&Ct(new vi([i.location]))}let o=i.location[0]>=+!te;Ue(i.kind===`header`&&i.isEdge&&o&&de===!0),Et(i.kind===`cell`&&i.isFillHandle),j?.(e),M(i)},[oe,lt,te,de,j,M,ee,p,ke,Ct]),window,!0);let Zt=L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n,r;S.current!==void 0&&(n=ct(t,S.current.cell[0],S.current.cell[1]),r=S.current.cell),ne?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[ne,S,ct]),Qt=L.useCallback(e=>{let t=Ne.current;if(t===null)return;let n,r;S.current!==void 0&&(n=ct(t,S.current.cell[0],S.current.cell[1]),r=S.current.cell),P?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[P,S,ct]),$t=L.useCallback(e=>{Ne.current=e,F!==void 0&&(F.current=e)},[F]);qt(`dragstart`,L.useCallback(e=>{let t=Ne.current;if(t===null||ue===!1||se){e.preventDefault();return}let n,r,i=lt(t,e.clientX,e.clientY);if(ue!==!0&&i.kind!==ue){e.preventDefault();return}let a=(e,t)=>{n=e,r=t},o,s,c,l=(e,t,n)=>{o=e,s=t,c=n},u=!1;if(ie?.({...i,setData:a,setDragImage:l,preventDefault:()=>u=!0,defaultPrevented:()=>u}),!u&&n!==void 0&&r!==void 0&&e.dataTransfer!==null)if(e.dataTransfer.setData(n,r),e.dataTransfer.effectAllowed=`copyLink`,o!==void 0&&s!==void 0&&c!==void 0)e.dataTransfer.setDragImage(o,s,c);else{let[n,r]=i.location;if(r!==void 0){let i=document.createElement(`canvas`),a=ct(t,n,r);x(a!==void 0);let o=Math.ceil(window.devicePixelRatio??1);i.width=a.width*o,i.height=a.height*o;let s=i.getContext(`2d`);s!==null&&(s.scale(o,o),s.textBaseline=`middle`,r===-1?(s.font=he.headerFontFull,s.fillStyle=he.bgHeader,s.fillRect(0,0,i.width,i.height),Va(s,0,0,a.width,a.height,it[n],!1,he,!1,!1,0,Xe,be,!1)):(s.font=he.baseFontFull,s.fillStyle=he.bgCell,s.fillRect(0,0,i.width,i.height),Na(s,p([n,r]),0,r,!1,!1,0,0,a.width,a.height,!1,he,he.bgCell,Pe,Xe,1,void 0,!1,0,void 0,void 0,void 0,ht,ke,()=>void 0))),i.style.left=`-100%`,i.style.position=`absolute`,i.style.width=`${a.width}px`,i.style.height=`${a.height}px`,document.body.append(i),e.dataTransfer.setDragImage(i,a.width/2,a.height/2),window.setTimeout(()=>{i.remove()},0)}}else e.preventDefault()},[ue,se,lt,ie,ct,he,it,Xe,be,p,Pe,ht,ke]),oe?.current??null,!1,!1);let en=L.useRef();qt(`dragover`,L.useCallback(e=>{let t=Ne.current;if(Ce!==void 0&&e.preventDefault(),t===null||Se===void 0)return;let[n,r]=lt(t,e.clientX,e.clientY).location,i=n-+!te,[a,o]=en.current??[];(a!==i||o!==r)&&(en.current=[i,r],Se([i,r],e.dataTransfer))},[te,lt,Se,Ce]),oe?.current??null,!1,!1),qt(`dragend`,L.useCallback(()=>{en.current=void 0,ae?.()},[ae]),oe?.current??null,!1,!1),qt(`drop`,L.useCallback(e=>{let t=Ne.current;if(t===null||Ce===void 0)return;e.preventDefault();let[n,r]=lt(t,e.clientX,e.clientY).location,i=n-+!te;Ce([i,r],e.dataTransfer)},[te,lt,Ce]),oe?.current??null,!1,!1),qt(`dragleave`,L.useCallback(()=>{we?.()},[we]),oe?.current??null,!1,!1);let tn=L.useRef(S);tn.current=S;let nn=L.useRef(null),an=L.useCallback(e=>{Ne.current===null||!Ne.current.contains(document.activeElement)||(e===null&&tn.current.current!==void 0?F?.current?.focus({preventScroll:!0}):e!==null&&e.focus({preventScroll:!0}),nn.current=e)},[F]);L.useImperativeHandle(t,()=>({focus:()=>{let e=nn.current;e===null||!document.contains(e)?F?.current?.focus({preventScroll:!0}):e.focus({preventScroll:!0})},getBounds:(e,t)=>{if(!(F===void 0||F.current===null))return ct(F.current,e??0,t??-1)},damage:wt}),[F,wt,ct]);let on=L.useRef(),cn=rn(()=>{if(n<50||Oe?.disableAccessibilityTree===!0)return null;let e=Br(it,Me,n,N,Ae),t=te?0:-1;!te&&e[0]?.sourceIndex===0&&(e=e.slice(1));let[r,a]=S.current?.cell??[],o=S.current?.range,c=e.map(e=>e.sourceIndex),l=(0,Es.default)(s,Math.min(f,s+i));return r!==void 0&&a!==void 0&&!(c.includes(r)&&l.includes(a))&&an(null),L.createElement(`table`,{key:`access-tree`,role:`grid`,"aria-rowcount":f+1,"aria-multiselectable":`true`,"aria-colcount":it.length+t},L.createElement(`thead`,{role:`rowgroup`},L.createElement(`tr`,{role:`row`,"aria-rowindex":1},e.map(e=>L.createElement(`th`,{role:`columnheader`,"aria-selected":S.columns.hasIndex(e.sourceIndex),"aria-colindex":e.sourceIndex+1+t,tabIndex:-1,onFocus:t=>{if(t.target!==nn.current)return xe?.([e.sourceIndex,-1])},key:e.sourceIndex},e.title)))),L.createElement(`tbody`,{role:`rowgroup`},l.map(n=>L.createElement(`tr`,{role:`row`,"aria-selected":S.rows.hasIndex(n),key:n,"aria-rowindex":n+2},e.map(e=>{let i=e.sourceIndex,s=fi(i,n),c=r===i&&a===n,l=o!==void 0&&i>=o.x&&i=o.y&&n{let e=F?.current;if(e!=null)return ne?.({bounds:ct(e,i,n),cancel:()=>void 0,preventDefault:()=>void 0,stopPropagation:()=>void 0,ctrlKey:!1,key:`Enter`,keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:d})},onFocusCapture:e=>{if(!(e.target===nn.current||on.current?.[0]===i&&on.current?.[1]===n))return on.current=d,xe?.(d)},ref:c?an:void 0,tabIndex:-1},Os(f,ke))})))))},[n,it,Me,N,Ae,f,s,i,S,an,p,F,ne,ct,xe],200),ln=C===0||!E?0:Me>C?1:(0,ds.default)(-Ae/100,0,1),un=-s*32+je,dn=D?(0,ds.default)(-un/100,0,1):0,fn=L.useMemo(()=>{if(!ln&&!dn)return null;let e={position:`absolute`,top:0,left:ot,width:n-ot,height:r,opacity:ln,pointerEvents:`none`,transition:Ee?void 0:`opacity 0.2s`,boxShadow:`inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)`},t={position:`absolute`,top:$e,left:0,width:n,height:r,opacity:dn,pointerEvents:`none`,transition:De?void 0:`opacity 0.2s`,boxShadow:`inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)`};return L.createElement(L.Fragment,null,ln>0&&L.createElement(`div`,{id:`shadow-x`,style:e}),dn>0&&L.createElement(`div`,{id:`shadow-y`,style:t}))},[ln,dn,ot,n,Ee,$e,r,De]),pn=L.useMemo(()=>({position:`absolute`,top:0,left:0}),[]);return L.createElement(L.Fragment,null,L.createElement(`canvas`,{"data-testid":`data-grid-canvas`,tabIndex:0,onKeyDown:Zt,onKeyUp:Qt,onFocus:v,onBlur:y,ref:$t,style:Ft},cn),L.createElement(`canvas`,{ref:We,style:pn}),fn)}));function As(e,t,n,r){return(0,ds.default)(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}var js=e=>{let[t,n]=L.useState(),[r,i]=L.useState(),[a,o]=L.useState(),[s,c]=L.useState(),[l,u]=L.useState(!1),[d,f]=L.useState(),[p,m]=L.useState(),[h,g]=L.useState(),[_,v]=L.useState(!1),[y,b]=L.useState(),{onHeaderMenuClick:x,getCellContent:S,onColumnMoved:C,onColumnResize:w,onColumnResizeStart:T,onColumnResizeEnd:E,gridRef:D,maxColumnWidth:O,minColumnWidth:k,onRowMoved:A,lockColumns:j,onColumnProposeMove:M,onMouseDown:ee,onMouseUp:N,onItemHovered:te,onDragStart:ne,canvasRef:P}=e,re=(w??E??T)!==void 0,{columns:F,selection:ie}=e,ae=ie.columns,oe=L.useCallback(e=>{let[t,n]=e.location;a!==void 0&&s!==t&&t>=j?(u(!0),c(t)):p!==void 0&&n!==void 0?(v(!0),g(Math.max(0,n))):r===void 0&&!l&&!_&&te?.(e)},[a,p,s,te,j,r,l,_]),se=C!==void 0,ce=L.useCallback(e=>{if(e.button===0){let[t,r]=e.location;if(e.kind===`out-of-bounds`&&e.isEdge&&re){let e=D?.current?.getBounds(F.length-1,-1);e!==void 0&&(n(e.x),i(F.length-1))}else if(e.kind===`header`&&t>=j){let r=P?.current;if(e.isEdge&&re&&r){n(e.bounds.x),i(t);let a=r.getBoundingClientRect().width/r.offsetWidth,o=e.bounds.width/a;T?.(F[t],o,t,o+(F[t].growOffset??0))}else e.kind===`header`&&se&&(f(e.bounds.x),o(t))}else e.kind===`cell`&&j>0&&t===0&&r!==void 0&&A!==void 0&&(b(e.bounds.y),m(r))}ee?.(e)},[ee,re,j,A,D,F,se,T,P]),le=L.useCallback((e,t)=>{l||_||x?.(e,t)},[l,_,x]),ue=L.useRef(-1),de=L.useCallback(()=>{ue.current=-1,m(void 0),g(void 0),b(void 0),v(!1),o(void 0),c(void 0),f(void 0),u(!1),i(void 0),n(void 0)},[]),fe=L.useCallback((e,t)=>{if(e.button===0){if(r!==void 0){if(ae?.hasIndex(r)===!0)for(let e of ae){if(e===r)continue;let t=F[e],n=As(t,ue.current,k,O);w?.(t,n,e,n+(t.growOffset??0))}let e=As(F[r],ue.current,k,O);if(E?.(F[r],e,r,e+(F[r].growOffset??0)),ae.hasIndex(r))for(let e of ae){if(e===r)continue;let t=F[e],n=As(t,ue.current,k,O);E?.(t,n,e,n+(t.growOffset??0))}}de(),a!==void 0&&s!==void 0&&C?.(a,s),p!==void 0&&h!==void 0&&A?.(p,h)}N?.(e,t)},[N,r,a,s,p,h,ae,E,F,k,O,w,C,A,de]),pe=L.useMemo(()=>{if(!(a===void 0||s===void 0)&&a!==s&&M?.(a,s)!==!1)return{src:a,dest:s}},[a,s,M]),me=L.useCallback(e=>{let n=P?.current;if(a!==void 0&&d!==void 0)Math.abs(e.clientX-d)>20&&u(!0);else if(p!==void 0&&y!==void 0)Math.abs(e.clientY-y)>20&&v(!0);else if(r!==void 0&&t!==void 0&&n){let i=n.getBoundingClientRect().width/n.offsetWidth,a=(e.clientX-t)/i,o=F[r],s=As(o,a,k,O);if(w?.(o,s,r,s+(o.growOffset??0)),ue.current=a,ae?.first()===r)for(let e of ae){if(e===r)continue;let t=F[e],n=As(t,ue.current,k,O);w?.(t,n,e,n+(t.growOffset??0))}}},[a,d,p,y,r,t,F,k,O,w,ae,P]),he=L.useCallback((e,t)=>{if(p===void 0||h===void 0)return S(e,t);let[n,r]=e;return r===h?r=p:(r>h&&--r,r>=p&&(r+=1)),S([n,r],t)},[p,h,S]),ge=L.useCallback(e=>{ne?.(e),e.defaultPrevented()||de()},[de,ne]);return L.createElement(ks,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,width:e.width,getCellContent:he,isResizing:r!==void 0,onHeaderMenuClick:le,isDragging:l,onItemHovered:oe,onDragStart:ge,onMouseDown:ce,allowResize:re,onMouseUp:fe,dragAndDropState:pe,onMouseMoveRaw:me,ref:D})};function Ms(e){let t=(0,L.useRef)(null),[n,r]=(0,L.useState)({width:e?.[0],height:e?.[1]});return(0,L.useLayoutEffect)(()=>{let e=new window.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t&&t.contentRect||{};r(t=>t.width===e&&t.height===n?t:{width:e,height:n})}});return t.current&&e.observe(t.current,void 0),()=>{e.disconnect()}},[t.current]),{ref:t,...n}}var Ns=(e,t,n)=>{let r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useRef)(null),o=(0,L.useRef)(0),s=(0,L.useRef)(t);s.current=t;let c=n.current;(0,L.useEffect)(()=>{let t=()=>{if(i.current===!1&&c!==null){let e=[c.scrollLeft,c.scrollTop];if(a.current?.[0]===e[0]&&a.current?.[1]===e[1])if(o.current>10){a.current=null,i.current=null;return}else o.current++;else o.current=0,s.current(e[0],e[1]),a.current=e;r.current=window.setTimeout(t,1e3/120)}},n=()=>{i.current=!0,a.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},l=e=>{e.touches.length===0&&(i.current=!1,o.current=0,r.current=window.setTimeout(t,1e3/120))};if(e&&c!==null){let e=c;return e.addEventListener(`touchstart`,n),e.addEventListener(`touchend`,l),()=>{e.removeEventListener(`touchstart`,n),e.removeEventListener(`touchend`,l),r.current!==null&&window.clearTimeout(r.current)}}},[e,c])};St();var Ps=xt(`div`)({name:`ScrollRegionStyle`,class:`gdg-s1dgczr6`,propsAsIs:!1,vars:{"s1dgczr6-0":[e=>e.isSafari?`scroll`:`auto`]}});function Fs(e){let[t,n]=L.useState(!1),r=typeof window>`u`?null:window,i=L.useRef(0);return qt(`touchstart`,L.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),qt(`touchend`,L.useCallback(t=>{t.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}var Is=e=>{let{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:a,draggable:o,className:s,preventDiagonalScrolling:c=!1,paddingBottom:l=0,paddingRight:u=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:p=!1,scrollRef:m,initialSize:h}=e,g=[],_=f?.sticky??!1,v=f?.fill??!1,y=L.useRef(0),b=L.useRef(0),x=L.useRef(null),S=typeof window>`u`?1:window.devicePixelRatio,C=L.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),w=L.useRef(null),T=Fs(200),[E,D]=L.useState(!0),O=L.useRef(0);L.useLayoutEffect(()=>{if(!E||T||C.current.lockDirection===void 0)return;let e=x.current;if(e===null)return;let[t,n]=C.current.lockDirection;t===void 0?n!==void 0&&(e.scrollTop=n):e.scrollLeft=t,C.current.lockDirection=void 0},[T,E]);let k=L.useCallback((e,t)=>{let n=x.current;if(n===null)return;t??=n.scrollTop,e??=n.scrollLeft;let i=C.current.scrollTop,o=C.current.scrollLeft,s=e-o,d=t-i;T&&s!==0&&d!==0&&(Math.abs(s)>3||Math.abs(d)>3)&&c&&C.current.lockDirection===void 0&&(C.current.lockDirection=Math.abs(s)0&&(Math.abs(g)>2e3||h===0||h===_)&&r>n.scrollHeight+5){let e=h/_,t=(r-m)*e;y.current=t-h}f!==void 0&&(window.clearTimeout(O.current),D(!1),O.current=window.setTimeout(()=>D(!0),200)),a({x:e,y:h+y.current,width:p-u,height:m-l,paddingRight:w.current?.clientWidth??0})},[l,u,r,a,c,T]);Ns(p&&vs.value,k,x);let A=L.useRef(k);A.current=k;let j=L.useRef(),M=L.useRef(!1);L.useLayoutEffect(()=>{M.current?k():M.current=!0},[k,l,u]);let ee=L.useCallback(e=>{x.current=e,m!==void 0&&(m.current=e)},[m]),N=0,te=0;for(g.push(L.createElement(`div`,{key:N++,style:{width:i,height:0}}));teA.current(),0),j.current={width:P,height:re}),(P??0)===0||(re??0)===0?L.createElement(`div`,{ref:ne}):L.createElement(`div`,{ref:ne},L.createElement(Ps,{isSafari:vs.value},L.createElement(`div`,{className:`dvn-underlay`},t),L.createElement(`div`,{ref:ee,style:j.current,draggable:o,onDragStart:e=>{o||(e.stopPropagation(),e.preventDefault())},className:`dvn-scroller `+(s??``),onScroll:()=>k()},L.createElement(`div`,{className:`dvn-scroll-inner`+(d===void 0?` dvn-hidden`:``)},L.createElement(`div`,{className:`dvn-stack`},g),d!==void 0&&L.createElement(L.Fragment,null,!v&&L.createElement(`div`,{className:`dvn-spacer`}),L.createElement(`div`,{ref:w,style:{height:re,maxHeight:n-Math.ceil(S%1),position:`sticky`,top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:v?1:void 0,right:_?u??0:void 0,pointerEvents:`auto`}},d))))))},Ls=e=>{let{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:a,enableGroups:o,freezeColumns:s,experimental:c,nonGrowWidth:l,clientSize:u,className:d,onVisibleRegionChanged:f,scrollRef:p,preventDiagonalScrolling:m,rightElement:h,rightElementProps:g,overscrollX:_,overscrollY:v,initialSize:y,smoothScrollX:b=!1,smoothScrollY:x=!1,isDraggable:S}=e,{paddingRight:C,paddingBottom:w}=c??{},[T,E]=u,D=L.useRef(),O=L.useRef(),k=L.useRef(),A=L.useRef(),j=l+Math.max(0,_??0),M=o?i+a:i;if(typeof r==`number`)M+=n*r;else for(let e=0;e{if(ee.current===void 0)return;let e={...ee.current},i=0,a=e.x<0?-e.x:0,o=0,c=0;e.x=e.x<0?0:e.x;let l=0;for(let e=0;e=t+n.width)i+=n.width,c++,o++;else if(e.x>t)i+=n.width,b?a+=t-e.x:c++,o++;else if(e.x+e.width>t)i+=n.width,o++;else break}let u=0,d=0,p=0;if(typeof r==`number`)x?(d=Math.floor(e.y/r),u=d*r-e.y):d=Math.ceil(e.y/r),p=Math.ceil(e.height/r)+d,u<0&&p++;else{let t=0;for(let i=0;i=t+n)t+=n,d++,p++;else if(e.y>a)t+=n,x?u+=a-e.y:d++,p++;else if(e.y+e.height>n/2+t)t+=n,p++;else break}}let m={x:c,y:d,width:o-c,height:p-d},h=D.current;(h===void 0||h.y!==m.y||h.x!==m.x||h.height!==m.height||h.width!==m.width||O.current!==a||k.current!==u||e.width!==A.current?.[0]||e.height!==A.current?.[1])&&(f?.({x:c,y:d,width:o-c,height:p-d},e.width,e.height,e.paddingRight??0,a,u),D.current=m,O.current=a,k.current=u,A.current=[e.width,e.height])},[t,r,n,f,s,b,x]),te=L.useCallback(e=>{ee.current=e,N()},[N]);return L.useEffect(()=>{N()},[N]),L.createElement(Is,{scrollRef:p,className:d,kineticScrollPerfHack:c?.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:S===!0||typeof S==`string`,scrollWidth:j+(C??0),scrollHeight:M+(w??0),clientHeight:E,rightElement:h,paddingBottom:w,paddingRight:C,rightElementProps:g,update:te,initialSize:y},L.createElement(js,{eventTargetRef:p,width:T,height:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}))};St();var Rs=xt(`div`)({name:`SearchWrapper`,class:`gdg-seveqep`,propsAsIs:!1});ct(),E();var zs=L.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},L.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 244l144-144 144 144M256 120v292`})),Bs=L.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},L.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 268l144 144 144-144M256 392V100`})),Vs=L.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},L.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`32`,d:`M368 368L144 144M368 144L144 368`})),Hs=10,Us=e=>{let{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:a,searchValue:o,searchResults:s,onSearchValueChange:c,getCellsForSelection:l,onSearchResultsChanged:u,showSearch:d=!1,onSearchClose:f}=e,[p]=L.useState(()=>`search-box-`+Math.round(Math.random()*1e3)),[m,h]=L.useState(``),g=o??m,_=L.useCallback(e=>{h(e),c?.(e)},[c]),[v,y]=L.useState(),b=L.useRef(v);b.current=v,L.useEffect(()=>{s!==void 0&&(s.length>0?y(e=>({rowsSearched:r,results:s.length,selectedIndex:e?.selectedIndex??-1})):y(void 0))},[r,s]);let S=L.useRef();S.current===void 0&&(S.current=new AbortController);let C=L.useRef(),[w,T]=L.useState([]),E=s??w,D=L.useCallback(()=>{C.current!==void 0&&(window.cancelAnimationFrame(C.current),C.current=void 0,S.current.abort())},[]),O=L.useRef(n);O.current=n;let k=L.useCallback(e=>{let t=new RegExp(e.replace(/([$()*+.?[\\\]^{|}-])/g,`\\$1`),`i`),n=O.current,a=Math.min(10,r),o=0;y(void 0),T([]);let s=[],c=async()=>{if(l===void 0)return;let e=performance.now(),d=r-o,f=l({x:0,y:n,width:i.length,height:Math.min(a,d,r-n)},S.current.signal);typeof f==`function`&&(f=await f());let p=!1;for(let[e,r]of f.entries())for(let[i,a]of r.entries()){let r;switch(a.kind){case I.Text:case I.Number:r=a.displayData;break;case I.Uri:case I.Markdown:r=a.data;break;case I.Boolean:r=typeof a.data==`boolean`?a.data.toString():void 0;break;case I.Image:case I.Bubble:r=a.data.join(`🐳`);break;case I.Custom:r=a.copyData;break}r!==void 0&&t.test(r)&&(s.push([i,e+n]),p=!0)}let m=performance.now();p&&T([...s]),o+=f.length,x(o<=r);let h=b.current?.selectedIndex??-1;y({results:s.length,rowsSearched:o,selectedIndex:h}),u?.(s,h),n+a>=r?n=0:n+=a;let g=m-e,_=Hs/Math.max(g,1);a=Math.ceil(a*_),o{f?.(),y(void 0),T([]),u?.([],-1),D(),t?.current?.focus()},[D,t,f,u]),j=L.useCallback(e=>{_(e.target.value),s===void 0&&(e.target.value===``?(y(void 0),T([]),D()):k(e.target.value))},[k,D,_,s]);L.useEffect(()=>{d&&a.current!==null&&(_(``),a.current.focus({preventScroll:!0}))},[d,a,_]);let M=L.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0)return;let t=(v.selectedIndex+1)%v.results;y({...v,selectedIndex:t}),u?.(E,t)},[v,u,E]),ee=L.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0)return;let t=(v.selectedIndex-1)%v.results;t<0&&(t+=v.results),y({...v,selectedIndex:t}),u?.(E,t)},[u,E,v]),N=L.useCallback(e=>{(e.ctrlKey||e.metaKey)&&e.nativeEvent.code===`KeyF`||e.key===`Escape`?(A(),e.stopPropagation(),e.preventDefault()):e.key===`Enter`&&(e.shiftKey?ee():M())},[A,M,ee]);L.useEffect(()=>()=>{D()},[D]);let[te,ne]=L.useState(!1);L.useEffect(()=>{if(d)ne(!0);else{let e=setTimeout(()=>ne(!1),150);return()=>clearTimeout(e)}},[d]);let P=L.useMemo(()=>{if(!d&&!te)return null;let e;v!==void 0&&(e=v.results>=1e3?`over 1000`:`${v.results} result${v.results===1?``:`s`}`,v.selectedIndex>=0&&(e=`${v.selectedIndex+1} of ${e}`));let t=e=>{e.stopPropagation()},n={width:`${Math.floor((v?.rowsSearched??0)/r*100)}%`};return L.createElement(Rs,{className:d?``:`out`,onMouseDown:t,onMouseMove:t,onMouseUp:t,onClick:t},L.createElement(`div`,{className:`gdg-search-bar-inner`},L.createElement(`input`,{id:p,"aria-hidden":!d,"data-testid":`search-input`,ref:a,onChange:j,value:g,tabIndex:d?void 0:-1,onKeyDownCapture:N}),L.createElement(`button`,{"aria-label":`Previous Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:ee,disabled:(v?.results??0)===0},zs),L.createElement(`button`,{"aria-label":`Next Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:M,disabled:(v?.results??0)===0},Bs),f!==void 0&&L.createElement(`button`,{"aria-label":`Close Search`,"aria-hidden":!d,"data-testid":`search-close-button`,tabIndex:d?void 0:-1,onClick:A},Vs)),v===void 0?L.createElement(`div`,{className:`gdg-search-status`},L.createElement(`label`,{htmlFor:p},`Type to search`)):L.createElement(L.Fragment,null,L.createElement(`div`,{className:`gdg-search-status`},L.createElement(`div`,{"data-testid":`search-result-area`},e)),L.createElement(`div`,{className:`gdg-search-progress`,style:n})))},[d,te,v,r,p,a,j,g,N,ee,M,f,A]);return L.createElement(L.Fragment,null,L.createElement(Ls,{prelightCells:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}),P)},Ws,Gs,Ks=o((()=>{Ws=u(f(),1),Gs=class extends Ws.PureComponent{wrapperRef=Ws.createRef();componentDidMount(){document.addEventListener(`touchend`,this.clickOutside,!0),document.addEventListener(`mousedown`,this.clickOutside,!0),document.addEventListener(`contextmenu`,this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener(`touchend`,this.clickOutside,!0),document.removeEventListener(`mousedown`,this.clickOutside,!0),document.removeEventListener(`contextmenu`,this.clickOutside,!0)}clickOutside=e=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(e))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(e.target)){let t=e.target;for(;t!==null;){if(t.classList.contains(`click-outside-ignore`))return;t=t.parentElement}this.props.onClickOutside()}};render(){let{onClickOutside:e,isOutsideClick:t,...n}=this.props;return Ws.createElement(`div`,{...n,ref:this.wrapperRef},this.props.children)}}}));St(),Ks();var qs=xt(`input`)({name:`RenameInput`,class:`gdg-r17m35ur`,propsAsIs:!1,vars:{"r17m35ur-0":[e=>Math.max(16,e.targetHeight-10),`px`]}}),Js=e=>{let{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:a}=e,[o,s]=L.useState(n);return L.createElement(Gs,{style:{position:`absolute`,left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:`gdg-c1tqibwd`,onClickOutside:r},L.createElement(qs,{targetHeight:t.height,"data-testid":`group-rename-input`,value:o,onBlur:r,onFocus:e=>e.target.setSelectionRange(0,o.length),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?a(o):e.key===`Escape`&&r()},autoFocus:!0}))};function Ys(e,t){return e===void 0?!1:e.length>1&&e.startsWith(`_`)?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>=`a`&&e<=`z`?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function Xs(e,t,n){let r=Zs(e,t);return r&&(n.didMatch=!0),r}function Zs(e,t){if(e.length===0)return!1;if(e.includes(`|`)){let n=e.split(`|`);for(let e of n)if(Zs(e,t))return!0;return!1}let n=!1,r=!1,i=!1,a=!1,o=e.split(`+`);if(!Ys(o.pop(),t))return!1;if(o[0]===`any`)return!0;for(let e of o)switch(e){case`ctrl`:n=!0;break;case`shift`:r=!0;break;case`alt`:i=!0;break;case`meta`:a=!0;break;case`primary`:ys.value?a=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===a}ct();function Qs(e,t,n,r,i,a){return[L.useCallback((o,s,c,l)=>{(a===`cell`||a===`multi-cell`)&&o!==void 0&&(o={...o,range:{x:o.cell[0],y:o.cell[1],width:1,height:1}});let u=n===`mixed`&&(c||l===`drag`),d=r===`mixed`&&u,f=i===`mixed`&&u,p={current:o===void 0?void 0:{...o,rangeStack:l===`drag`?e.current?.rangeStack??[]:[]},columns:d?e.columns:st.empty(),rows:f?e.rows:st.empty()};c&&(a===`multi-rect`||a===`multi-cell`)&&p.current!==void 0&&e.current!==void 0&&(p={...p,current:{...p.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(p,s)},[r,e,n,a,i,t]),L.useCallback((a,o,s)=>{a??=e.rows,o!==void 0&&(a=a.add(o));let c;if(i===`exclusive`&&a.length>0)c={current:void 0,columns:st.empty(),rows:a};else{let t=s&&n===`mixed`,i=s&&r===`mixed`;c={current:t?e.current:void 0,columns:i?e.columns:st.empty(),rows:a}}t(c,!1)},[r,e,n,i,t]),L.useCallback((a,o,s)=>{a??=e.columns,o!==void 0&&(a=a.add(o));let c;if(r===`exclusive`&&a.length>0)c={current:void 0,rows:st.empty(),columns:a};else{let t=s&&n===`mixed`,r=s&&i===`mixed`;c={current:t?e.current:void 0,rows:r?e.rows:st.empty(),columns:a}}t(c,!1)},[r,e,n,i,t])]}ct();function $s(e,t,n,r,i){let a=L.useCallback(n=>{if(e===!0){let e=[];for(let r=n.y;r=i?a.push({kind:I.Loading,allowOverlay:!1}):a.push(t([e,r]));e.push(a)}return e}return e?.(n,r.signal)??[]},[r.signal,t,e,i]),o=e===void 0?void 0:a,s=L.useCallback(e=>{if(o===void 0)return[];let t={...e,x:e.x-n};if(t.x<0){t.x=0,t.width--;let e=o(t,r.signal);return typeof e==`function`?async()=>(await e()).map(e=>[{kind:I.Loading,allowOverlay:!1},...e]):e.map(e=>[{kind:I.Loading,allowOverlay:!1},...e])}return o(t,r.signal)},[r.signal,o,n]);return[e===void 0?void 0:s,o]}E(),ct();function ec(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:`string`};switch(e.kind){case I.Boolean:return{formatted:e.data===!0?`TRUE`:e.data===!1?`FALSE`:e.data===void 0?`INDETERMINATE`:``,rawValue:e.data,format:`boolean`};case I.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:`string`};case I.Image:case I.Bubble:return{formatted:e.data,rawValue:e.data,format:`string-array`};case I.Drilldown:return{formatted:e.data.map(e=>e.text),rawValue:e.data.map(e=>e.text),format:`string-array`};case I.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:`string`};case I.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:`url`};case I.Markdown:case I.RowID:return{formatted:e.data,rawValue:e.data,format:`string`};case I.Number:return{formatted:e.displayData,rawValue:e.data,format:`number`};case I.Loading:return{formatted:`#LOADING`,rawValue:``,format:`string`};case I.Protected:return{formatted:`************`,rawValue:``,format:`string`};default:S(e)}}function tc(e,t){return e.map((e,n)=>{let r=t[n];return e.map(e=>e.span!==void 0&&e.span[0]!==r?{formatted:``,rawValue:``,format:`string`}:ec(e))})}function nc(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,`""`)}"`),e}function rc(e){let t=[];for(let n of e){let e=[];for(let t of n)t.format===`url`?e.push(t.rawValue?.toString()??``):t.format===`string-array`?e.push(t.formatted.map(e=>nc(e,!0)).join(`,`)):e.push(nc(t.formatted,!1));t.push(e.join(` `))}return t.join(` +`)}function ic(e){return e.replace(/\t/g,` `).replace(/ {2,}/g,e=>` `.repeat(e.length))}function ac(e){return`"`+e.replace(/&/g,`&`).replace(/"/g,`"`).replace(//g,`>`)+`"`}function oc(e){return e.replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`)}function sc(e){let t=[];t.push(``,``);for(let n of e){t.push(``);for(let e of n){let n=`gdg-format="${e.format}"`;e.format===`url`?t.push(``):e.format===`string-array`?t.push(``):t.push(``)}t.push(``)}return t.push(`
${ic(e.formatted)}
    ${e.formatted.map((t,n)=>`
  1. `+ic(t)+`
  2. `).join(``)}
${ic(e.formatted)}
`),t.join(``)}function cc(e,t){let n=tc(e,t);return{textPlain:rc(n),textHtml:sc(n)}}function lc(e){let t=document.createElement(`html`);t.innerHTML=e.replace(/ /g,` `);let n=t.querySelector(`table`);if(n===null)return;let r=[n],i=[],a;for(;r.length>0;){let e=r.pop();if(e===void 0)break;if(e instanceof HTMLTableElement||e.nodeName===`TBODY`)r.push(...[...e.children].reverse());else if(e instanceof HTMLTableRowElement)a!==void 0&&i.push(a),a=[],r.push(...[...e.children].reverse());else if(e instanceof HTMLTableCellElement){let t=e.cloneNode(!0),n=t.children.length===1&&t.children[0].nodeName===`P`?t.children[0]:null,r=n?.children.length===1&&n.children[0].nodeName===`FONT`,i=t.querySelectorAll(`br`);for(let e of i)e.replaceWith(` +`);let o=t.getAttribute(`gdg-raw-value`),s=t.getAttribute(`gdg-format`)??`string`;if(t.querySelector(`a`)!==null)a?.push({rawValue:t.querySelector(`a`)?.getAttribute(`href`)??``,formatted:t.textContent??``,format:s});else if(t.querySelector(`ol`)!==null){let e=t.querySelectorAll(`li`);a?.push({rawValue:[...e].map(e=>e.getAttribute(`gdg-raw-value`)??``),formatted:[...e].map(e=>e.textContent??``),format:`string-array`})}else if(o!==null)a?.push({rawValue:oc(o),formatted:t.textContent??``,format:s});else{let e=t.textContent??``;r&&(e=e.replace(/\n(?!\n)/g,``)),a?.push({rawValue:e??``,formatted:e??``,format:s})}}}return a!==void 0&&i.push(a),i}function uc(e,t,n,r,i){let a=e;if(r===`allowPartial`||e.current===void 0||t===void 0)return e;let o=!1;do{if(e?.current===void 0)break;let r=e.current?.range,s=[];if(r.width>2){let e=t({x:r.x,y:r.y,width:1,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e);let n=t({x:r.x+r.width-1,y:r.y,width:1,height:r.height},i.signal);if(typeof n==`function`)return a;s.push(...n)}else{let e=t({x:r.x,y:r.y,width:r.width,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e)}let c=r.x-n,l=r.x+r.width-1-n;for(let e of s)for(let t of e)t.span!==void 0&&(c=Math.min(t.span[0],c),l=Math.max(t.span[1],l));c===r.x-n&&l===r.x+r.width-1-n?o=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:r.y,width:l-c+1,height:r.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!o);return e}function dc(e){return e.startsWith(`"`)&&e.endsWith(`"`)&&(e=e.slice(1,-1).replace(/""/g,`"`)),e}function fc(e){let t;(function(e){e[e.None=0]=`None`,e[e.inString=1]=`inString`,e[e.inStringPostQuote=2]=`inStringPostQuote`})(t||={});let n=[],r=[],i=0,a=t.None;e=e.replace(/\r\n/g,` `);let o=0;for(let s of e){switch(a){case t.None:s===` `||s===` `?(r.push(e.slice(i,o)),i=o+1,s===` `&&(n.push(r),r=[])):s===`"`&&(a=t.inString);break;case t.inString:s===`"`&&(a=t.inStringPostQuote);break;case t.inStringPostQuote:s===`"`?a=t.inString:s===` `||s===` -`?(r.push(lc(e.slice(i,o))),i=o+1,s===` -`&&(n.push(r),r=[]),a=t.None):a=t.None;break}o++}return ie.map(e=>({rawValue:e,formatted:e,format:`string`})))}function nee(e,t,n){let r=oc(e,t),i=e=>{window.navigator.clipboard?.writeText(e)},a=(e,t)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),"text/html":new Blob([t],{type:`text/html`})})]),!0);window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?((e,t)=>{try{if(n===void 0||n.clipboardData===null)throw Error(`No clipboard data`);n?.clipboardData?.setData(`text/plain`,e),n?.clipboardData?.setData(`text/html`,t)}catch{a(e,t)||i(e)}})(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function dc(e){return e!==!0}St();function fc(e){return typeof e==`string`?e:`${e}px`}var pc=xt(`div`)({name:`Wrapper`,class:`gdg-wmyidgi`,propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),mc=e=>{let{inWidth:t,inHeight:n,children:r,...i}=e;return L.createElement(pc,{innerHeight:fc(n),innerWidth:fc(t),...i},r)},hc=2,gc=1300;function _c(e,t,n){let r=L.useRef(0),[i,a]=e??[0,0];L.useEffect(()=>{if(i===0&&a===0){r.current=0;return}let e=!1,o=0,s=c=>{if(!e){if(o===0)o=c;else{let e=c-o;r.current=Math.min(1,r.current+e/gc);let s=r.current**1.618*e*hc;t.current?.scrollBy(i*s,a*s),o=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{e=!0}},[t,i,a,n])}Ti();function vc({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:a,scaleToRem:o,remSize:s}){let[c,l,u,d,f,p]=L.useMemo(()=>{if(!o||s===16)return[e,t,n,r,i,a];let c=s/16,l=e,u=bi();return[typeof l==`number`?l*c:e=>Math.ceil(l(e)*c),Math.ceil(t*c),Math.ceil(n*c),{...r,headerIconSize:(r?.headerIconSize??u.headerIconSize)*c,cellHorizontalPadding:(r?.cellHorizontalPadding??u.cellHorizontalPadding)*c,cellVerticalPadding:(r?.cellVerticalPadding??u.cellVerticalPadding)*c},Math.ceil((i??0)*c),Math.ceil((a??0)*c)]},[n,t,i,a,s,e,o,r]);return{rowHeight:c,headerHeight:l,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:p}}var yc={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function bc(e,t){return e===!0?t:e===!1?``:e}function xc(e){let t=_s.value;return{activateCell:bc(e.activateCell,` |Enter|shift+Enter`),clear:bc(e.clear,`any+Escape`),closeOverlay:bc(e.closeOverlay,`any+Escape`),acceptOverlayDown:bc(e.acceptOverlayDown,`Enter`),acceptOverlayUp:bc(e.acceptOverlayUp,`shift+Enter`),acceptOverlayLeft:bc(e.acceptOverlayLeft,`shift+Tab`),acceptOverlayRight:bc(e.acceptOverlayRight,`Tab`),copy:e.copy,cut:e.cut,delete:bc(e.delete,t?`Backspace|Delete`:`Delete`),downFill:bc(e.downFill,`primary+_68`),scrollToSelectedCell:bc(e.scrollToSelectedCell,`primary+Enter`),goDownCell:bc(e.goDownCell,`ArrowDown`),goDownCellRetainSelection:bc(e.goDownCellRetainSelection,`alt+ArrowDown`),goLeftCell:bc(e.goLeftCell,`ArrowLeft|shift+Tab`),goLeftCellRetainSelection:bc(e.goLeftCellRetainSelection,`alt+ArrowLeft`),goRightCell:bc(e.goRightCell,`ArrowRight|Tab`),goRightCellRetainSelection:bc(e.goRightCellRetainSelection,`alt+ArrowRight`),goUpCell:bc(e.goUpCell,`ArrowUp`),goUpCellRetainSelection:bc(e.goUpCellRetainSelection,`alt+ArrowUp`),goToFirstCell:bc(e.goToFirstCell,`primary+Home`),goToFirstColumn:bc(e.goToFirstColumn,`Home|primary+ArrowLeft`),goToFirstRow:bc(e.goToFirstRow,`primary+ArrowUp`),goToLastCell:bc(e.goToLastCell,`primary+End`),goToLastColumn:bc(e.goToLastColumn,`End|primary+ArrowRight`),goToLastRow:bc(e.goToLastRow,`primary+ArrowDown`),goToNextPage:bc(e.goToNextPage,`PageDown`),goToPreviousPage:bc(e.goToPreviousPage,`PageUp`),paste:e.paste,rightFill:bc(e.rightFill,`primary+_82`),search:bc(e.search,`primary+f`),selectAll:bc(e.selectAll,`primary+a`),selectColumn:bc(e.selectColumn,`ctrl+ `),selectGrowDown:bc(e.selectGrowDown,`shift+ArrowDown`),selectGrowLeft:bc(e.selectGrowLeft,`shift+ArrowLeft`),selectGrowRight:bc(e.selectGrowRight,`shift+ArrowRight`),selectGrowUp:bc(e.selectGrowUp,`shift+ArrowUp`),selectRow:bc(e.selectRow,`shift+ `),selectToFirstCell:bc(e.selectToFirstCell,`primary+shift+Home`),selectToFirstColumn:bc(e.selectToFirstColumn,`primary+shift+ArrowLeft`),selectToFirstRow:bc(e.selectToFirstRow,`primary+shift+ArrowUp`),selectToLastCell:bc(e.selectToLastCell,`primary+shift+End`),selectToLastColumn:bc(e.selectToLastColumn,`primary+shift+ArrowRight`),selectToLastRow:bc(e.selectToLastRow,`primary+shift+ArrowDown`)}}function Sc(e){let t=dn(e);return L.useMemo(()=>{if(t===void 0)return xc(yc);let e={...t,goToNextPage:t?.goToNextPage??t?.pageDown??yc.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??yc.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??yc.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??yc.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??yc.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??yc.selectToLastCell};return xc({...yc,...e})},[t])}var Cc=g(),wc=`modulepreload`,Tc=function(e,t){return new URL(e,t).href},Ec={},Dc=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Tc(t,n),t=s(t),t in Ec)return;Ec[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:wc,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Oc,kc,Ac,jc,Mc,Nc,Pc,Fc=o((()=>{St(),Oc=()=>e=>e.targetX,kc=()=>e=>e.targetY,Ac=()=>e=>e.targetWidth,jc=()=>e=>e.targetHeight,Mc=()=>e=>e.targetY+10,Nc=()=>e=>Math.max(0,(e.targetHeight-28)/2),Pc=xt(`div`)({name:`DataGridOverlayEditorStyle`,class:`gdg-d19meir1`,propsAsIs:!1,vars:{"d19meir1-0":[kc(),`px`],"d19meir1-1":[Oc(),`px`],"d19meir1-2":[Ac(),`px`],"d19meir1-3":[jc(),`px`],"d19meir1-4":[Mc(),`px`],"d19meir1-5":[Nc(),`px`]}})}));function Ic(){let[e,t]=Rc.useState();return[e??void 0,t]}function Lc(){let[e,t]=Ic(),[n,r]=Rc.useState(0),[i,a]=Rc.useState(!0);return Rc.useLayoutEffect(()=>{if(e===void 0||!(`IntersectionObserver`in window))return;let t=new IntersectionObserver(e=>{e.length!==0&&a(e[0].isIntersecting)},{threshold:1});return t.observe(e),()=>t.disconnect()},[e]),Rc.useEffect(()=>{if(i||e===void 0)return;let t,n=()=>{let{right:i}=e.getBoundingClientRect();r(e=>Math.min(e+window.innerWidth-i-10,0)),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>{t!==void 0&&cancelAnimationFrame(t)}},[e,i]),{ref:t,style:Rc.useMemo(()=>({transform:`translateX(${n}px)`}),[n])}}var Rc,zc=o((()=>{Rc=u(f(),1)})),Bc=c({default:()=>Hc}),Vc,Hc,Uc=o((()=>{Vc=u(f(),1),Ws(),Ti(),ct(),Fc(),zc(),Hc=e=>{let{target:t,content:n,onFinishEditing:r,forceEditMode:i,initialValue:a,imageEditorOverride:o,markdownDivCreateNode:s,highlight:c,className:l,theme:u,id:d,cell:f,bloom:p,validateCell:m,getCellRenderer:h,provideEditor:g,isOutsideClick:_}=e,[v,y]=Vc.useState(i?n:void 0),b=Vc.useRef(v??n);b.current=v??n;let[x,S]=Vc.useState(()=>m===void 0||!(Xe(n)&&m?.(f,n,b.current)===!1)),C=Vc.useCallback((e,t)=>{r(x?e:void 0,t)},[x,r]),w=Vc.useCallback(e=>{if(m!==void 0&&e!==void 0&&Xe(e)){let t=m(f,e,b.current);t===!1?S(!1):(typeof t==`object`&&(e=t),S(!0))}y(e)},[f,m]),T=Vc.useRef(!1),E=Vc.useRef(void 0),D=Vc.useCallback(()=>{C(v,[0,0]),T.current=!0},[v,C]),O=Vc.useCallback((e,t)=>{C(e,t??E.current??[0,0]),T.current=!0},[C]),k=Vc.useCallback(async e=>{let t=!1;e.key===`Escape`?(e.stopPropagation(),e.preventDefault(),E.current=[0,0]):e.key===`Enter`&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),E.current=[0,1],t=!0):e.key===`Tab`&&(e.stopPropagation(),e.preventDefault(),E.current=[e.shiftKey?-1:1,0],t=!0),window.setTimeout(()=>{!T.current&&E.current!==void 0&&(C(t?v:void 0,E.current),T.current=!0)},0)},[C,v]),A=v??n,[j,M]=Vc.useMemo(()=>{if(Ze(n))return[];let e=g?.(n);return e===void 0?[h(n)?.provideEditor?.(n),!1]:[e,!1]},[n,h,g]),{ref:ee,style:N}=Lc(),te=!0,ne,P=!0,re;if(j!==void 0){te=j.disablePadding!==!0,P=j.disableStyling!==!0;let e=$e(j);e&&(re=j.styleOverride);let n=e?j.editor:j;ne=Vc.createElement(n,{isHighlighted:c,onChange:w,value:A,initialValue:a,onFinishedEditing:O,validatedSelection:Xe(A)?A.selectionRange:void 0,forceEditMode:i,target:t,imageEditorOverride:o,markdownDivCreateNode:s,isValid:x,theme:u})}re={...re,...N};let F=document.getElementById(`portal`);if(F===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `

` as the last child of your ``.'),null;let ie=P?`gdg-style`:`gdg-unstyle`;x||(ie+=` gdg-invalid`),te&&(ie+=` gdg-pad`);let ae=p?.[0]??1,oe=p?.[1]??1;return(0,Cc.createPortal)(Vc.createElement(wi.Provider,{value:u},Vc.createElement(Us,{style:yi(u),className:l,onClickOutside:D,isOutsideClick:_},Vc.createElement(Pc,{ref:ee,id:d,className:ie,style:re,as:M===!0?`label`:void 0,targetX:t.x-ae,targetY:t.y-oe,targetWidth:t.width+ae*2,targetHeight:t.height+oe*2},Vc.createElement(`div`,{className:`gdg-clip-region`,onKeyDown:k},ne)))),F)}}));E();var Wc=u(qi(),1),Gc=u(Zi(),1);ct(),Ti(),vr();var Kc=L.lazy(async()=>await Dc(()=>Promise.resolve().then(()=>(Uc(),Bc)),void 0,import.meta.url)),qc=0;function Jc(e){return(0,Wc.default)((0,Gc.default)((0,Gc.default)(e).filter(e=>e.span!==void 0).map(e=>(0,ws.default)((e.span?.[0]??0)+1,(e.span?.[1]??0)+1))))}function Yc(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(e=>({...e,x:e.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var Xc={kind:I.Loading,allowOverlay:!1},Zc={columns:st.empty(),rows:st.empty(),current:void 0},Qc=L.forwardRef((e,t)=>{let[n,r]=L.useState(Zc),[i,a]=L.useState(),o=L.useRef(null),s=L.useRef(null),[c,l]=L.useState(),u=L.useRef(null),d=L.useRef(),f=typeof window>`u`?null:window,{imageEditorOverride:p,getRowThemeOverride:m,markdownDivCreateNode:h,width:g,height:_,columns:v,rows:y,getCellContent:b,onCellClicked:w,onCellActivated:T,onFillPattern:E,onFinishedEditing:D,coercePasteValue:O,drawHeader:k,drawCell:A,editorBloom:j,onHeaderClicked:M,onColumnProposeMove:ee,spanRangeBehavior:N=`default`,onGroupHeaderClicked:te,onCellContextMenu:ne,className:P,onHeaderContextMenu:re,getCellsForSelection:F,onGroupHeaderContextMenu:ie,onGroupHeaderRenamed:ae,onCellEdited:oe,onCellsEdited:se,onSearchResultsChanged:ce,searchResults:le,onSearchValueChange:ue,searchValue:de,onKeyDown:fe,onKeyUp:pe,keybindings:me,editOnType:he=!0,onRowAppended:ge,onColumnMoved:_e,validateCell:ve,highlightRegions:ye,rangeSelect:be=`rect`,columnSelect:xe=`multi`,rowSelect:Se=`multi`,rangeSelectionBlending:Ce=`exclusive`,columnSelectionBlending:we=`exclusive`,rowSelectionBlending:Te=`exclusive`,onDelete:Ee,onDragStart:De,onMouseMove:Oe,onPaste:ke,copyHeaders:Ae=!1,freezeColumns:je=0,cellActivationBehavior:Me=`second-click`,rowSelectionMode:Ne=`auto`,onHeaderMenuClick:Pe,getGroupDetails:Fe,onSearchClose:Ie,onItemHovered:Le,onSelectionCleared:Re,showSearch:ze,onVisibleRegionChanged:Be,gridSelection:Ve,onGridSelectionChange:He,minColumnWidth:Ue=50,maxColumnWidth:We=500,maxColumnAutoWidth:Ge,provideEditor:Ke,trailingRowOptions:qe,freezeTrailingRows:Je=0,allowedFillDirections:Ye=`orthogonal`,scrollOffsetX:et,scrollOffsetY:tt,verticalBorder:nt,onDragOverCell:rt,onDrop:it,onColumnResize:ot,onColumnResizeEnd:ct,onColumnResizeStart:lt,customRenderers:ut,fillHandle:dt,drawFocusRing:ft=!0,experimental:pt,fixedShadowX:mt,fixedShadowY:ht,headerIcons:gt,imageWindowLoader:_t,initialSize:vt,isDraggable:yt,onDragLeave:bt,onRowMoved:xt,overscrollX:St,overscrollY:Ct,preventDiagonalScrolling:wt,rightElement:Tt,rightElementProps:Et,trapFocus:Dt=!1,smoothScrollX:Ot,smoothScrollY:kt,scaleToRem:At=!1,rowHeight:jt=34,headerHeight:Mt=36,groupHeaderHeight:Nt=Mt,theme:Pt,isOutsideClick:Ft,renderers:It}=e,Lt=typeof e.rowMarkers==`string`?void 0:e.rowMarkers,Rt=Lt?.kind??e.rowMarkers??`none`,zt=Lt?.width??e.rowMarkerWidth,Bt=Lt?.startIndex??e.rowMarkerStartIndex??1,Vt=Lt?.theme??e.rowMarkerTheme,Ht=Lt?.checkboxStyle??`square`,Ut=Math.max(Ue,20),Wt=Math.max(We,Ut),Gt=Math.max(Ge??Wt,Ut),Yt=L.useMemo(()=>typeof window>`u`?{fontSize:`16px`}:window.getComputedStyle(document.documentElement),[]),{rowHeight:Xt,headerHeight:Zt,groupHeaderHeight:Qt,theme:$t,overscrollX:en,overscrollY:tn}=vc({groupHeaderHeight:Nt,headerHeight:Mt,overscrollX:St,overscrollY:Ct,remSize:L.useMemo(()=>Number.parseFloat(Yt.fontSize),[Yt]),rowHeight:jt,scaleToRem:At,theme:Pt}),nn=Sc(me),rn=zt??(y>1e4?48:y>1e3?44:y>100?36:32),an=Rt!==`none`,R=+!!an,on=ge!==void 0,cn=qe?.sticky===!0,[un,dn]=L.useState(!1),fn=ze??un,pn=L.useCallback(()=>{Ie===void 0?dn(!1):Ie()},[Ie]),z=L.useMemo(()=>Ve===void 0?void 0:Yc(Ve,R),[Ve,R])??n,mn=L.useRef();mn.current===void 0&&(mn.current=new AbortController),L.useEffect(()=>()=>mn?.current.abort(),[]);let[hn,gn]=Zs(F,b,R,mn.current,y),_n=L.useCallback((e,t,n)=>{if(ve===void 0)return!0;let r=[e[0]-R,e[1]];return ve?.(r,t,n)},[R,ve]),vn=L.useRef(Ve),yn=L.useCallback((e,t)=>{t&&(e=cc(e,hn,R,N,mn.current)),He===void 0?r(e):(vn.current=Yc(e,-R),He(vn.current))},[He,hn,R,N]),bn=Jt(ot,L.useCallback((e,t,n,r)=>{ot?.(v[n-R],t,n-R,r)},[ot,R,v])),xn=Jt(ct,L.useCallback((e,t,n,r)=>{ct?.(v[n-R],t,n-R,r)},[ct,R,v])),Sn=Jt(lt,L.useCallback((e,t,n,r)=>{lt?.(v[n-R],t,n-R,r)},[lt,R,v])),Cn=Jt(k,L.useCallback((e,t)=>k?.({...e,columnIndex:e.columnIndex-R},t)??!1,[k,R])),wn=Jt(A,L.useCallback((e,t)=>A?.({...e,col:e.col-R},t)??!1,[A,R])),Tn=L.useCallback(e=>{if(Ee!==void 0){let t=Ee(Yc(e,-R));return typeof t==`boolean`?t:Yc(t,R)}return!0},[Ee,R]),[En,Dn,On]=Xs(z,yn,Ce,we,Te,be),kn=L.useMemo(()=>xi(bi(),$t),[$t]),[An,jn]=L.useState([0,0,0]),Mn=L.useMemo(()=>{if(It===void 0)return{};let e={};for(let t of It)e[t.kind]=t;return e},[It]),Nn=L.useCallback(e=>e.kind===I.Custom?ut?.find(t=>t.isMatch(e)):Mn[e.kind],[ut,Mn]),{sizedColumns:Pn,nonGrowWidth:Fn}=ki(v,y,gn,An[0]-(R===0?0:rn)-An[2],Ut,Gt,kn,Nn,mn.current);Rt!==`none`&&(Fn+=rn);let In=L.useMemo(()=>Pn.some(e=>e.group!==void 0),[Pn]),Ln=In?Zt+Qt:Zt,Rn=z.rows.length,zn=Rt===`none`?void 0:Rn===0?!1:Rn===y||void 0,Bn=L.useMemo(()=>Rt===`none`?Pn:[{title:``,width:rn,icon:void 0,hasMenu:!1,style:`normal`,themeOverride:Vt,rowMarker:Ht,rowMarkerChecked:zn},...Pn],[Rt,Pn,rn,Vt,Ht,zn]),[Vn,Hn]=L.useMemo(()=>[tt!==void 0&&typeof Xt==`number`?Math.floor(tt/Xt):0,tt!==void 0&&typeof Xt==`number`?-(tt%Xt):0],[tt,Xt]),Un=L.useRef({height:1,width:1,x:0,y:0}),Wn=L.useMemo(()=>({x:Un.current.x,y:Vn,width:Un.current.width??1,height:Un.current.height??1,ty:Hn}),[Hn,Vn]),Gn=L.useRef(!1),[Kn,qn,Jn]=ln(Wn);Un.current=Kn;let Yn=(Kn.height??1)>1;L.useLayoutEffect(()=>{if(tt!==void 0&&u.current!==null&&Yn){if(u.current.scrollTop===tt)return;u.current.scrollTop=tt,u.current.scrollTop!==tt&&Jn(),Gn.current=!0}},[tt,Yn,Jn]);let Xn=(Kn.width??1)>1;L.useLayoutEffect(()=>{if(et!==void 0&&u.current!==null&&Xn){if(u.current.scrollLeft===et)return;u.current.scrollLeft=et,u.current.scrollLeft!==et&&Jn(),Gn.current=!0}},[et,Xn,Jn]);let Zn=Kn.x+R,Qn=Kn.y,$n=L.useRef(null),er=L.useCallback(e=>{e===!0?$n.current?.focus():window.requestAnimationFrame(()=>{$n.current?.focus()})},[]),tr=on?y+1:y,nr=L.useCallback(e=>{let t=R===0?e:e.map(e=>({...e,location:[e.location[0]-R,e.location[1]]})),n=se?.(t);if(n!==!0)for(let e of t)oe?.(e.location,e.value);return n},[oe,se,R]),[rr,ir]=L.useState(),ar=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,or=ft?z.current?.cell:void 0,sr=or?.[0],cr=or?.[1],lr=L.useMemo(()=>{if((ye===void 0||ye.length===0)&&(ar??sr??cr??rr)===void 0)return;let e=[];if(ye!==void 0)for(let t of ye){let n=Bn.length-t.range.x-R;n>0&&e.push({color:t.color,range:{...t.range,x:t.range.x+R,width:Math.min(n,t.range.width)},style:t.style})}return rr!==void 0&&e.push({color:fr(kn.accentColor,0),range:rr,style:`dashed`}),ar!==void 0&&e.push({color:fr(kn.accentColor,.5),range:ar,style:`solid-outline`}),sr!==void 0&&cr!==void 0&&e.push({color:kn.accentColor,range:{x:sr,y:cr,width:1,height:1},style:`solid-outline`}),e.length>0?e:void 0},[rr,ar,sr,cr,ye,Bn.length,kn.accentColor,R]),ur=L.useRef(Bn);ur.current=Bn;let dr=L.useCallback(([e,t],n=!1)=>{let r=on&&t===tr-1;if(e===0&&an)return r?Xc:{kind:at.Marker,allowOverlay:!1,checkboxStyle:Ht,checked:z?.rows.hasIndex(t)===!0,markerKind:Rt===`clickable-number`?`number`:Rt,row:Bt+t,drawHandle:xt!==void 0,cursor:Rt===`clickable-number`?`pointer`:void 0};if(r){let t=e===R?qe?.hint??``:``,n=ur.current[e];if(n?.trailingRowOptions?.disabled===!0)return Xc;{let e=n?.trailingRowOptions?.hint??t,r=n?.trailingRowOptions?.addIcon??qe?.addIcon;return{kind:at.NewRow,hint:e,allowOverlay:!1,icon:r}}}else{let r=e-R;if(n||pt?.strict===!0){let e=Un.current,n=e.x>r||r>e.x+e.width||e.y>t||t>e.y+e.height||t>=br.current,i=r===e.extras?.selected?.[0]&&t===e.extras?.selected[1],a=!1;if(e.extras?.freezeRegions!==void 0){for(let n of e.extras.freezeRegions)if(ba(n,r,t)){a=!0;break}}if(n&&!i&&!a)return Xc}let i=b([r,t]);return R!==0&&i.span!==void 0&&(i={...i,span:[i.span[0]+R,i.span[1]+R]}),i}},[on,tr,an,Ht,z?.rows,Rt,Bt,xt,R,qe?.hint,qe?.addIcon,pt?.strict,b]),pr=L.useCallback(e=>{let t=Fe?.(e)??{name:e};return ae!==void 0&&e!==``&&(t={icon:t.icon,name:t.name,overrideTheme:t.overrideTheme,actions:[...t.actions??[],{title:`Rename`,icon:`renameIcon`,onClick:e=>Lr({group:t.name,bounds:e.bounds})}]}),t},[Fe,ae]),mr=L.useCallback(e=>{let[t,n]=e.cell,r=Bn[t],i=r?.group===void 0?void 0:pr(r.group)?.overrideTheme,o=r?.themeOverride,s=m?.(n);a({...e,theme:xi(kn,i,o,s,e.content.themeOverride)})},[m,Bn,pr,kn]),hr=L.useCallback((e,t,n)=>{if(z.current===void 0)return;let[r,i]=z.current.cell,a=dr([r,i]);if(a.kind!==I.Boolean&&a.allowOverlay){let t=a;if(n!==void 0)switch(t.kind){case I.Number:{let e=C(()=>n===`-`?-0:Number.parseFloat(n),0);t={...t,data:Number.isNaN(e)?0:e};break}case I.Text:case I.Markdown:case I.Uri:t={...t,data:n};break}mr({target:e,content:t,initialValue:n,cell:[r,i],highlight:n===void 0,forceEditMode:n!==void 0})}else a.kind===I.Boolean&&t&&a.readonly!==!0&&(nr([{location:z.current.cell,value:{...a,data:dc(a.data)}}]),$n.current?.damage([{cell:z.current.cell}]))},[dr,z,nr,mr]),gr=L.useCallback((e,t)=>{let n=$n.current?.getBounds(e,t);if(n===void 0||u.current===null)return;let r=dr([e,t]);r.allowOverlay&&mr({target:n,content:r,initialValue:void 0,highlight:!0,cell:[e,t],forceEditMode:!0})},[dr,mr]),_r=L.useCallback((e,t,n=`both`,r=0,i=0,a=void 0)=>{if(u.current!==null){let o=$n.current,c=s.current,l=typeof e==`number`?e:e.unit===`cell`?e.amount:void 0,d=typeof t==`number`?t:t.unit===`cell`?t.amount:void 0,f=typeof e!=`number`&&e.unit===`px`?e.amount:void 0,p=typeof t!=`number`&&t.unit===`px`?t.amount:void 0;if(o!==null&&c!==null){let s={x:0,y:0,width:0,height:0},m=0,h=0;if((l!==void 0||d!==void 0)&&(s=o.getBounds((l??0)+R,d??0)??s,s.width===0||s.height===0))return;let g=c.getBoundingClientRect(),_=g.width/c.offsetWidth;if(f!==void 0&&(s={...s,x:f-g.left-u.current.scrollLeft,width:1}),p!==void 0&&(s={...s,y:p+g.top-u.current.scrollTop,height:1}),s!==void 0){let o={x:s.x-r,y:s.y-i,width:s.width+2*r,height:s.height+2*i},c=0;for(let e=0;e0&&(l=zr(tr,d,Xt));let f=c*_+g.left+R*rn*_,p=g.right,v=g.top+Ln*_,y=g.bottom-l*_,b=s.width+r*2;switch(a?.hAlign){case`start`:p=f+b;break;case`end`:f=p-b;break;case`center`:f=Math.floor((f+p)/2)-b/2,p=f+b;break}let x=s.height+i*2;switch(a?.vAlign){case`start`:y=v+x;break;case`end`:v=y-x;break;case`center`:v=Math.floor((v+y)/2)-x/2,y=v+x;break}f>o.x?m=o.x-f:po.y?h=o.y-v:y=tr-d)&&(h=0),(m!==0||h!==0)&&(_!==1&&(m/=_,h/=_),u.current.scrollTo(m+u.current.scrollLeft,h+u.current.scrollTop))}}}},[R,Je,rn,Ln,je,Pn,tr,cn,Xt]),vr=L.useRef(gr),yr=L.useRef(b),br=L.useRef(y);vr.current=gr,yr.current=b,br.current=y;let xr=L.useCallback(async(e,t=!0)=>{if(Bn[e]?.trailingRowOptions?.disabled===!0)return;let n=ge?.(),r,i=!0;n!==void 0&&(r=await n,r===`top`&&(i=!1),typeof r==`number`&&(i=!1));let a=0,o=()=>{if(br.current<=y){a<500&&window.setTimeout(o,a),a=50+a*2;return}let n=typeof r==`number`?r:i?y:0;vi.current(e-R,n),En({cell:[e,n],range:{x:e,y:n,width:1,height:1}},!1,!1,`edit`);let s=yr.current([e-R,n]);s.allowOverlay&&Qe(s)&&s.readonly!==!0&&t&&window.setTimeout(()=>{vr.current(e,n)},0)};o()},[Bn,ge,R,y,En]),Sr=L.useCallback(e=>{let t=Pn[e]?.trailingRowOptions?.targetColumn??qe?.targetColumn;if(typeof t==`number`)return t+ +!!an;if(typeof t==`object`){let e=v.indexOf(t);if(e>=0)return e+ +!!an}},[Pn,v,an,qe?.targetColumn]),Cr=L.useRef(),wr=L.useRef(),Tr=L.useCallback((e,t)=>{let[n,r]=t;return xi(kn,Bn[n]?.themeOverride,m?.(r),e.themeOverride)},[m,Bn,kn]),Er=L.useCallback(e=>{let t=_s.value?e.metaKey:e.ctrlKey,n=t&&Se===`multi`,r=t&&xe===`multi`,[i,o]=e.location,s=z.columns,c=z.rows,[l,u]=z.current?.cell??[];if(e.kind===`cell`){if(wr.current=void 0,Or.current=[i,o],i===0&&an){if(on===!0&&o===y||Rt===`number`||Se===`none`)return;let r=dr(e.location);if(r.kind!==at.Marker)return;if(xt!==void 0){let t=Nn(r);x(t?.kind===at.Marker);let n=t?.onClick?.({...e,cell:r,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,theme:Tr(r,e.location),preventDefault:()=>void 0});if(n===void 0||n.checked===r.checked)return}a(void 0),er();let i=c.hasIndex(o),s=Cr.current;if(Se===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&s!==void 0&&c.hasIndex(s)){let e=[Math.min(s,o),Math.max(s,o)+1];n||Ne===`multi`?Dn(void 0,e,!0):Dn(st.fromSingleSelection(e),void 0,n)}else n||e.isTouch||Ne===`multi`?i?Dn(c.remove(o),void 0,!0):(Dn(void 0,o,!0),Cr.current=o):i&&c.length===1?Dn(st.empty(),void 0,t):(Dn(st.fromSingleSelection(o),void 0,t),Cr.current=o)}else if(i>=R&&on&&o===y){let e=Sr(i);xr(e??i)}else if(l!==i||u!==o){let n=dr(e.location),r=Nn(n);if(r?.onSelect!==void 0){let t=!1;if(r.onSelect({...e,cell:n,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,preventDefault:()=>t=!0,theme:Tr(n,e.location)}),t)return}let s=cn&&o===y,c=cn&&z!==void 0&&z.current?.cell[1]===y;if((e.shiftKey||e.isLongTouch===!0)&&l!==void 0&&u!==void 0&&z.current!==void 0&&!c){if(s)return;let e=Math.min(i,l),n=Math.max(i,l),r=Math.min(o,u),a=Math.max(o,u);En({...z.current,range:{x:e,y:r,width:n-e+1,height:a-r+1}},!0,t,`click`),Cr.current=void 0,er()}else En({cell:[i,o],range:{x:i,y:o,width:1,height:1}},!0,t,`click`),Cr.current=void 0,a(void 0),er()}}else if(e.kind===`header`)if(Or.current=[i,o],a(void 0),an&&i===0)Cr.current=void 0,wr.current=void 0,Se===`multi`&&(c.length===y?Dn(st.empty(),void 0,t):Dn(st.fromSingleSelection([0,y]),void 0,t),er());else{let n=wr.current;if(xe===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&n!==void 0&&s.hasIndex(n)){let e=[Math.min(n,i),Math.max(n,i)+1];r?On(void 0,e,t):On(st.fromSingleSelection(e),void 0,t)}else r?(s.hasIndex(i)?On(s.remove(i),void 0,t):On(void 0,i,t),wr.current=i):xe!==`none`&&(On(st.fromSingleSelection(i),void 0,t),wr.current=i);Cr.current=void 0,er()}else e.kind===`group-header`?Or.current=[i,o]:e.kind===`out-of-bounds`&&!e.isMaybeScrollbar&&(yn(Zc,!1),a(void 0),er(),Re?.(),Cr.current=void 0,wr.current=void 0)},[xr,xe,er,Nn,Sr,dr,z,an,cn,Re,xt,R,Rt,Se,Ne,y,En,yn,On,Dn,on,Tr]),Dr=L.useRef(!1),Or=L.useRef(),jr=L.useRef(Kn),Pr=L.useRef(),Fr=L.useCallback(e=>{if(Br.current=!1,jr.current=Un.current,e.button!==0&&e.button!==1){Pr.current=void 0;return}let t=performance.now();Pr.current={button:e.button,time:t,location:e.location},e?.kind===`header`&&(Dr.current=!0);let n=e.kind===`cell`&&e.isFillHandle;!n&&e.kind!==`cell`&&e.isEdge||(l({previousSelection:z,fillHandle:n}),Or.current=void 0,!e.isTouch&&e.button===0&&!n?Er(e):!e.isTouch&&e.button===1&&(Or.current=e.location))},[z,Er]),[Ir,Lr]=L.useState(),Rr=L.useCallback(e=>{if(e.kind!==`group-header`||xe!==`multi`)return;let t=_s.value?e.metaKey:e.ctrlKey,[n]=e.location,r=z.columns;if(n=R&&Ar(i.group,Bn[e].group);e--)a--;for(let e=n+1;e{if(hn!==void 0&&bn!==void 0){let t=Un.current.y,n=Un.current.height,r=hn({x:e,y:t,width:1,height:Math.min(n,y-t)},mn.current.signal);typeof r!=`object`&&(r=await r());let i=Pn[e-R],a=document.createElement(`canvas`).getContext(`2d`,{alpha:!1});if(a!==null){a.font=kn.baseFontFull;let t=Oi(a,kn,i,0,r,Ut,Wt,!1,Nn);bn?.(i,t.width,e,t.width)}}},[Pn,hn,Wt,kn,Ut,bn,R,y,Nn]),[Hr,Ur]=L.useState(),Wr=L.useCallback(async(e,t)=>{let n=e.current?.range;if(n===void 0||hn===void 0||t.current===void 0)return;let r=t.current.range;if(E!==void 0){let e=!1;if(E({fillDestination:{...r,x:r.x-R},patternSource:{...n,x:n.x-R},preventDefault:()=>e=!0}),e)return}let i=hn(n,mn.current.signal);typeof i!=`object`&&(i=await i());let a=i,o=[];for(let e=0;e({cell:e.location})))},[hn,nr,E,R]),Gr=L.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;let e={...z,current:{...z.current,range:{...z.current.range,width:1}}};Wr(e,z)},[Wr,z]),Kr=L.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;let e={...z,current:{...z.current,range:{...z.current.range,height:1}}};Wr(e,z)},[Wr,z]),qr=L.useCallback((e,t)=>{let n=c;if(l(void 0),ir(void 0),Ur(void 0),Dr.current=!1,t)return;if(n?.fillHandle===!0&&z.current!==void 0&&n.previousSelection?.current!==void 0){if(rr===void 0)return;let e={...z,current:{...z.current,range:xa(n.previousSelection.current.range,rr)}};Wr(n.previousSelection,e),yn(e,!0);return}let[r,i]=e.location,[a,o]=Or.current??[],s=()=>{Br.current=!0},u=t=>{let c=t.isTouch||a===r&&o===i;if(c&&w?.([r-R,i],{...t,preventDefault:s}),t.button===1)return!Br.current;if(!Br.current){let a=dr(e.location),o=Nn(a);if(o!==void 0&&o.onClick!==void 0&&c){let n=o.onClick({...t,cell:a,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,theme:Tr(a,e.location),preventDefault:s});n!==void 0&&!Ze(n)&&Xe(n)&&(nr([{location:t.location,value:n}]),$n.current?.damage([{cell:t.location}]))}if(Br.current||z.current===void 0)return!1;let l=!1;switch(a.activationBehaviorOverride??Me){case`double-click`:case`second-click`:{if(n?.previousSelection?.current?.cell===void 0)break;let[e,a]=z.current.cell,[o,s]=n.previousSelection.current.cell;l=r===e&&r===o&&i===a&&i===s&&(t.isDoubleClick===!0||Me===`second-click`);break}case`single-click`:l=!0;break}if(l)return T?.([r-R,i]),hr(t.bounds,!1),!0}return!1},d=e.location[0]-R;if(e.isTouch){let t=Un.current,n=jr.current;if(t.x!==n.x||t.y!==n.y)return;if(e.isLongTouch===!0){if(e.kind===`cell`&&Nr(z.current?.cell,e.location)){ne?.([d,e.location[1]],{...e,preventDefault:s});return}else if(e.kind===`header`&&z.columns.hasIndex(r)){re?.(d,{...e,preventDefault:s});return}else if(e.kind===`group-header`){if(d<0)return;ie?.(d,{...e,preventDefault:s});return}}e.kind===`cell`?u(e)||Er(e):e.kind===`group-header`?te?.(d,{...e,preventDefault:s}):(e.kind===`header`&&M?.(d,{...e,preventDefault:s}),Er(e));return}if(e.kind===`header`){if(d<0)return;e.isEdge?e.isDoubleClick===!0&&Vr(r):e.button===0&&r===a&&i===o&&M?.(d,{...e,preventDefault:s})}if(e.kind===`group-header`){if(d<0)return;e.button===0&&r===a&&i===o&&(te?.(d,{...e,preventDefault:s}),Br.current||Rr(e))}e.kind===`cell`&&(e.button===0||e.button===1)&&u(e),Or.current=void 0},[c,z,R,rr,Wr,yn,w,dr,Nn,Me,Tr,nr,T,hr,ne,re,ie,Er,te,M,Vr,Rr]),Jr=L.useCallback(e=>{let t={...e,location:[e.location[0]-R,e.location[1]]};Oe?.(t),c!==void 0&&e.buttons===0&&(l(void 0),ir(void 0),Ur(void 0),Dr.current=!1),Ur(t=>Dr.current?[e.scrollEdge[0],0]:e.scrollEdge[0]===t?.[0]&&e.scrollEdge[1]===t[1]?t:c===void 0||(Pr.current?.location[0]??0){Pe?.(e-R,t)},[Pe,R]),Xr=z?.current?.cell,Zr=L.useCallback((e,t,n,r,i,a)=>{Gn.current=!1;let o=Xr;o!==void 0&&(o=[o[0]-R,o[1]]);let s=je===0?void 0:{x:0,y:e.y,width:je,height:e.height},c=[];s!==void 0&&c.push(s),Je>0&&(c.push({x:e.x-R,y:y-Je,width:e.width,height:Je}),je>0&&c.push({x:0,y:y-Je,width:je,height:Je}));let l={x:e.x-R,y:e.y,width:e.width,height:on&&e.y+e.height>=y?e.height-1:e.height,tx:i,ty:a,extras:{selected:o,freezeRegion:s,freezeRegions:c}};Un.current=l,qn(l),jn([t,n,r]),Be?.(l,l.tx,l.ty,l.extras)},[Xr,R,on,y,je,Je,qn,Be]),Qr=Jt(_e,L.useCallback((e,t)=>{_e?.(e-R,t-R),xe!==`none`&&On(st.fromSingleSelection(t),void 0,!0)},[xe,_e,R,On])),$r=L.useRef(!1),ei=L.useCallback(e=>{if(e.location[0]===0&&R>0){e.preventDefault();return}De?.({...e,location:[e.location[0]-R,e.location[1]]}),e.defaultPrevented()||($r.current=!0),l(void 0)},[De,R]),ti=L.useCallback(()=>{$r.current=!1},[]),ni=L.useRef(),ri=L.useCallback(e=>{if(!Cs(e,ni.current)&&(ni.current=e,!(Pr?.current?.button!==void 0&&Pr.current.button>=1))){if(e.buttons!==0&&c!==void 0&&Pr.current?.location[0]===0&&e.location[0]===0&&R===1&&Se===`multi`&&c.previousSelection&&!c.previousSelection.rows.hasIndex(Pr.current.location[1])&&z.rows.hasIndex(Pr.current.location[1])){let t=Math.min(Pr.current.location[1],e.location[1]),n=Math.max(Pr.current.location[1],e.location[1])+1;Dn(st.fromSingleSelection([t,n]),void 0,!1)}if(e.buttons!==0&&c!==void 0&&z.current!==void 0&&!$r.current&&!Dr.current&&(be===`rect`||be===`multi-rect`)){let[t,n]=z.current.cell,[r,i]=e.location;if(i<0&&(i=Un.current.y),c.fillHandle===!0&&c.previousSelection?.current!==void 0){let e=c.previousSelection.current.range;i=Math.min(i,on?y-1:y);let t=va(e,r,i,Ye);ir(t)}else{if(on&&n===y)return;if(on&&i===y)if(e.kind===`out-of-bounds`)i--;else return;r=Math.max(r,R);let a=r-t,o=i-n,s={x:a>=0?t:r,y:o>=0?n:i,width:Math.abs(a)+1,height:Math.abs(o)+1};En({...z.current,range:s},!0,!1,`drag`)}}Le?.({...e,location:[e.location[0]-R,e.location[1]]})}},[Ye,c,R,Se,z,be,Le,Dn,on,y,En]);_c(Hr,u,L.useCallback(()=>{let e=ni.current;if(e===void 0)return;let[t,n]=e.scrollEdge,[r,i]=e.location,a=Un.current;t===-1?r=a.extras?.freezeRegion?.x??a.x:t===1&&(r=a.x+a.width),n===-1?i=Math.max(0,a.y):n===1&&(i=Math.min(y-1,a.y+a.height)),r=(0,ls.default)(r,0,Bn.length-1),i=(0,ls.default)(i,0,y-1),ri({...e,location:[r,i]})},[Bn.length,ri,y]));let ii=L.useCallback(e=>{if(z.current===void 0)return;let[t,n]=e,[r,i]=z.current.cell,a=z.current.range,o=a.x,s=a.x+a.width,c=a.y,l=a.y+a.height;if(n!==0)switch(n){case 2:l=y,c=i,_r(0,l,`vertical`);break;case-2:c=0,l=i+1,_r(0,c,`vertical`);break;case 1:ci+1?(l--,_r(0,l,`vertical`)):(c=Math.max(0,c-1),_r(0,c,`vertical`));break;default:S(n)}if(t!==0)if(t===2)s=Bn.length,o=r,_r(s-1-R,0,`horizontal`);else if(t===-2)o=R,s=r+1,_r(o-R,0,`horizontal`);else{let e=[];if(hn!==void 0){let t=hn({x:o,y:c,width:s-o-R,height:l-c},mn.current.signal);typeof t==`object`&&(e=Jc(t))}if(t===1){let t=!1;if(o0){let n=(0,ws.default)(o+1,r+1).find(t=>!e.includes(t-R));n!==void 0&&(o=n,t=!0)}else o++,t=!0;t&&_r(o,0,`horizontal`)}t||(s=Math.min(Bn.length,s+1),_r(s-1-R,0,`horizontal`))}else if(t===-1){let t=!1;if(s>r+1){if(e.length>0){let n=(0,ws.default)(s-1,r,-1).find(t=>!e.includes(t-R));n!==void 0&&(s=n,t=!0)}else s--,t=!0;t&&_r(s-R,0,`horizontal`)}t||(o=Math.max(R,o-1),_r(o-R,0,`horizontal`))}else S(t)}En({cell:z.current.cell,range:{x:o,y:c,width:s-o,height:l-c}},!0,!1,`keyboard-select`)},[hn,z,Bn.length,R,y,_r,En]),ai=L.useCallback((e,t,n,r)=>{let i=tr-+!n;if(e=(0,ls.default)(e,R,Pn.length-1+R),t=(0,ls.default)(t,0,i),e===Xr?.[0]&&t===Xr?.[1])return!1;if(r&&z.current!==void 0){let n=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&n.push(z.current.range),yn({...z,current:{cell:[e,t],range:{x:e,y:t,width:1,height:1},rangeStack:n}},!0)}else En({cell:[e,t],range:{x:e,y:t,width:1,height:1}},!0,!1,`keyboard-nav`);return d.current!==void 0&&d.current[0]===e&&d.current[1]===t&&(d.current=void 0),_r(e-R,t),!0},[tr,R,Pn.length,Xr,z,_r,yn,En]),oi=L.useCallback((e,t)=>{i?.cell!==void 0&&e!==void 0&&Xe(e)&&(nr([{location:i.cell,value:e}]),window.requestAnimationFrame(()=>{$n.current?.damage([{cell:i.cell}])})),er(!0),a(void 0);let[n,r]=t;if(z.current!==void 0&&(n!==0||r!==0)){let t=z.current.cell[1]===tr-1&&e!==void 0;ai((0,ls.default)(z.current.cell[0]+n,0,Bn.length-1),(0,ls.default)(z.current.cell[1]+r,0,tr-1),t,!1)}D?.(e,t)},[i?.cell,er,z,D,nr,tr,ai,Bn.length]),si=L.useMemo(()=>`gdg-overlay-${qc++}`,[]),ci=L.useCallback(e=>{er();let t=[];for(let n=e.x;n({cell:e.location})))},[er,b,Nn,nr,R]),li=i!==void 0,ui=L.useCallback(e=>{let t=()=>{e.stopPropagation(),e.preventDefault()},n={didMatch:!1},{bounds:r}=e,i=z.columns,s=z.rows,c=nn;if(!li&&Js(c.clear,e,n))yn(Zc,!1),Re?.();else if(!li&&Js(c.selectAll,e,n))yn({columns:st.empty(),rows:st.empty(),current:{cell:z.current?.cell??[R,0],range:{x:R,y:0,width:v.length,height:y},rangeStack:[]}},!1);else if(Js(c.search,e,n))o?.current?.focus({preventScroll:!0}),dn(!0);else if(Js(c.delete,e,n)){let e=Tn?.(z)??!0;if(e!==!1){let t=e===!0?z:e;if(t.current!==void 0){ci(t.current.range);for(let e of t.current.rangeStack)ci(e)}for(let e of t.rows)ci({x:R,y:e,width:v.length,height:1});for(let e of t.columns)ci({x:e,y:0,width:1,height:y})}}if(n.didMatch)return t(),!0;if(z.current===void 0)return!1;let[l,u]=z.current.cell,d=!1,f=!1;Js(c.scrollToSelectedCell,e,n)?vi.current(l-R,u):xe!==`none`&&Js(c.selectColumn,e,n)?i.hasIndex(l)?On(i.remove(l),void 0,!0):xe===`single`?On(st.fromSingleSelection(l),void 0,!0):On(void 0,l,!0):Se!==`none`&&Js(c.selectRow,e,n)?s.hasIndex(u)?Dn(s.remove(u),void 0,!0):Se===`single`?Dn(st.fromSingleSelection(u),void 0,!0):Dn(void 0,u,!0):!li&&r!==void 0&&Js(c.activateCell,e,n)?u===y&&on?window.setTimeout(()=>{let e=Sr(l);xr(e??l)},0):(T?.([l-R,u]),hr(r,!0)):z.current.range.height>1&&Js(c.downFill,e,n)?Kr():z.current.range.width>1&&Js(c.rightFill,e,n)?Gr():Js(c.goToNextPage,e,n)?u+=Math.max(1,Un.current.height-4):Js(c.goToPreviousPage,e,n)?u-=Math.max(1,Un.current.height-4):Js(c.goToFirstCell,e,n)?(a(void 0),u=0,l=0):Js(c.goToLastCell,e,n)?(a(void 0),u=2**53-1,l=2**53-1):Js(c.selectToFirstCell,e,n)?(a(void 0),ii([-2,-2])):Js(c.selectToLastCell,e,n)?(a(void 0),ii([2,2])):li?(Js(c.closeOverlay,e,n)&&a(void 0),Js(c.acceptOverlayDown,e,n)&&(a(void 0),u++),Js(c.acceptOverlayUp,e,n)&&(a(void 0),u--),Js(c.acceptOverlayLeft,e,n)&&(a(void 0),l--),Js(c.acceptOverlayRight,e,n)&&(a(void 0),l++)):(Js(c.goDownCell,e,n)?u+=1:Js(c.goUpCell,e,n)?--u:Js(c.goRightCell,e,n)?l+=1:Js(c.goLeftCell,e,n)?--l:Js(c.goDownCellRetainSelection,e,n)?(u+=1,d=!0):Js(c.goUpCellRetainSelection,e,n)?(--u,d=!0):Js(c.goRightCellRetainSelection,e,n)?(l+=1,d=!0):Js(c.goLeftCellRetainSelection,e,n)?(--l,d=!0):Js(c.goToLastRow,e,n)?u=y-1:Js(c.goToFirstRow,e,n)?u=-(2**53-1):Js(c.goToLastColumn,e,n)?l=2**53-1:Js(c.goToFirstColumn,e,n)?l=-(2**53-1):(be===`rect`||be===`multi-rect`)&&(Js(c.selectGrowDown,e,n)?ii([0,1]):Js(c.selectGrowUp,e,n)?ii([0,-1]):Js(c.selectGrowRight,e,n)?ii([1,0]):Js(c.selectGrowLeft,e,n)?ii([-1,0]):Js(c.selectToLastRow,e,n)?ii([0,2]):Js(c.selectToFirstRow,e,n)?ii([0,-2]):Js(c.selectToLastColumn,e,n)?ii([2,0]):Js(c.selectToFirstColumn,e,n)&&ii([-2,0])),f=n.didMatch);let p=ai(l,u,!1,d),m=n.didMatch;return m&&(p||!f||Dt)&&t(),m},[li,z,nn,xe,Se,be,R,y,ai,yn,Re,v.length,Tn,Dt,ci,On,Dn,on,Sr,xr,T,hr,Kr,Gr,ii]),di=L.useCallback(e=>{let t=!1;if(fe!==void 0&&fe({...e,cancel:()=>{t=!0}}),t||ui(e)||z.current===void 0)return;let[n,r]=z.current.cell,i=Un.current;if(he&&!e.metaKey&&!e.ctrlKey&&z.current!==void 0&&e.key.length===1&&/[ -~]/g.test(e.key)&&e.bounds!==void 0&&Qe(b([n-R,Math.max(0,Math.min(r,y-1))]))){if((!on||r!==y)&&(i.y>r||r>i.y+i.height||i.x>n||n>i.x+i.width))return;hr(e.bounds,!0,e.key),e.stopPropagation(),e.preventDefault()}},[he,fe,ui,z,b,R,y,on,hr]),fi=L.useCallback((e,t)=>{let n=e.location[0]-R;if(e.kind===`header`&&re?.(n,{...e,preventDefault:t}),e.kind===`group-header`){if(n<0)return;ie?.(n,{...e,preventDefault:t})}if(e.kind===`cell`){let[r,i]=e.location;ne?.([n,i],{...e,preventDefault:t}),kr(z,e.location)||ai(r,i,!1,!1)}},[z,ne,ie,re,R,ai]),pi=L.useCallback(async e=>{if(!nn.paste)return;function t(e,t,n,r){let i=typeof n==`object`?n?.join(` +`?(r.push(dc(e.slice(i,o))),i=o+1,s===` +`&&(n.push(r),r=[]),a=t.None):a=t.None;break}o++}return ie.map(e=>({rawValue:e,formatted:e,format:`string`})))}function pc(e,t,n){let r=cc(e,t),i=e=>{window.navigator.clipboard?.writeText(e)},a=(e,t)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),"text/html":new Blob([t],{type:`text/html`})})]),!0);window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?((e,t)=>{try{if(n===void 0||n.clipboardData===null)throw Error(`No clipboard data`);n?.clipboardData?.setData(`text/plain`,e),n?.clipboardData?.setData(`text/html`,t)}catch{a(e,t)||i(e)}})(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function mc(e){return e!==!0}St();function hc(e){return typeof e==`string`?e:`${e}px`}var eee=xt(`div`)({name:`Wrapper`,class:`gdg-wmyidgi`,propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),gc=e=>{let{inWidth:t,inHeight:n,children:r,...i}=e;return L.createElement(eee,{innerHeight:hc(n),innerWidth:hc(t),...i},r)},_c=2,tee=1300;function nee(e,t,n){let r=L.useRef(0),[i,a]=e??[0,0];L.useEffect(()=>{if(i===0&&a===0){r.current=0;return}let e=!1,o=0,s=c=>{if(!e){if(o===0)o=c;else{let e=c-o;r.current=Math.min(1,r.current+e/tee);let s=r.current**1.618*e*_c;t.current?.scrollBy(i*s,a*s),o=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{e=!0}},[t,i,a,n])}Ti();function vc({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:a,scaleToRem:o,remSize:s}){let[c,l,u,d,f,p]=L.useMemo(()=>{if(!o||s===16)return[e,t,n,r,i,a];let c=s/16,l=e,u=bi();return[typeof l==`number`?l*c:e=>Math.ceil(l(e)*c),Math.ceil(t*c),Math.ceil(n*c),{...r,headerIconSize:(r?.headerIconSize??u.headerIconSize)*c,cellHorizontalPadding:(r?.cellHorizontalPadding??u.cellHorizontalPadding)*c,cellVerticalPadding:(r?.cellVerticalPadding??u.cellVerticalPadding)*c},Math.ceil((i??0)*c),Math.ceil((a??0)*c)]},[n,t,i,a,s,e,o,r]);return{rowHeight:c,headerHeight:l,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:p}}var yc={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function bc(e,t){return e===!0?t:e===!1?``:e}function xc(e){let t=ys.value;return{activateCell:bc(e.activateCell,` |Enter|shift+Enter`),clear:bc(e.clear,`any+Escape`),closeOverlay:bc(e.closeOverlay,`any+Escape`),acceptOverlayDown:bc(e.acceptOverlayDown,`Enter`),acceptOverlayUp:bc(e.acceptOverlayUp,`shift+Enter`),acceptOverlayLeft:bc(e.acceptOverlayLeft,`shift+Tab`),acceptOverlayRight:bc(e.acceptOverlayRight,`Tab`),copy:e.copy,cut:e.cut,delete:bc(e.delete,t?`Backspace|Delete`:`Delete`),downFill:bc(e.downFill,`primary+_68`),scrollToSelectedCell:bc(e.scrollToSelectedCell,`primary+Enter`),goDownCell:bc(e.goDownCell,`ArrowDown`),goDownCellRetainSelection:bc(e.goDownCellRetainSelection,`alt+ArrowDown`),goLeftCell:bc(e.goLeftCell,`ArrowLeft|shift+Tab`),goLeftCellRetainSelection:bc(e.goLeftCellRetainSelection,`alt+ArrowLeft`),goRightCell:bc(e.goRightCell,`ArrowRight|Tab`),goRightCellRetainSelection:bc(e.goRightCellRetainSelection,`alt+ArrowRight`),goUpCell:bc(e.goUpCell,`ArrowUp`),goUpCellRetainSelection:bc(e.goUpCellRetainSelection,`alt+ArrowUp`),goToFirstCell:bc(e.goToFirstCell,`primary+Home`),goToFirstColumn:bc(e.goToFirstColumn,`Home|primary+ArrowLeft`),goToFirstRow:bc(e.goToFirstRow,`primary+ArrowUp`),goToLastCell:bc(e.goToLastCell,`primary+End`),goToLastColumn:bc(e.goToLastColumn,`End|primary+ArrowRight`),goToLastRow:bc(e.goToLastRow,`primary+ArrowDown`),goToNextPage:bc(e.goToNextPage,`PageDown`),goToPreviousPage:bc(e.goToPreviousPage,`PageUp`),paste:e.paste,rightFill:bc(e.rightFill,`primary+_82`),search:bc(e.search,`primary+f`),selectAll:bc(e.selectAll,`primary+a`),selectColumn:bc(e.selectColumn,`ctrl+ `),selectGrowDown:bc(e.selectGrowDown,`shift+ArrowDown`),selectGrowLeft:bc(e.selectGrowLeft,`shift+ArrowLeft`),selectGrowRight:bc(e.selectGrowRight,`shift+ArrowRight`),selectGrowUp:bc(e.selectGrowUp,`shift+ArrowUp`),selectRow:bc(e.selectRow,`shift+ `),selectToFirstCell:bc(e.selectToFirstCell,`primary+shift+Home`),selectToFirstColumn:bc(e.selectToFirstColumn,`primary+shift+ArrowLeft`),selectToFirstRow:bc(e.selectToFirstRow,`primary+shift+ArrowUp`),selectToLastCell:bc(e.selectToLastCell,`primary+shift+End`),selectToLastColumn:bc(e.selectToLastColumn,`primary+shift+ArrowRight`),selectToLastRow:bc(e.selectToLastRow,`primary+shift+ArrowDown`)}}function Sc(e){let t=dn(e);return L.useMemo(()=>{if(t===void 0)return xc(yc);let e={...t,goToNextPage:t?.goToNextPage??t?.pageDown??yc.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??yc.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??yc.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??yc.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??yc.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??yc.selectToLastCell};return xc({...yc,...e})},[t])}var Cc=g(),wc=`modulepreload`,Tc=function(e,t){return new URL(e,t).href},Ec={},Dc=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Tc(t,n),t=s(t),t in Ec)return;Ec[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:wc,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Oc,kc,Ac,jc,Mc,Nc,Pc,Fc=o((()=>{St(),Oc=()=>e=>e.targetX,kc=()=>e=>e.targetY,Ac=()=>e=>e.targetWidth,jc=()=>e=>e.targetHeight,Mc=()=>e=>e.targetY+10,Nc=()=>e=>Math.max(0,(e.targetHeight-28)/2),Pc=xt(`div`)({name:`DataGridOverlayEditorStyle`,class:`gdg-d19meir1`,propsAsIs:!1,vars:{"d19meir1-0":[kc(),`px`],"d19meir1-1":[Oc(),`px`],"d19meir1-2":[Ac(),`px`],"d19meir1-3":[jc(),`px`],"d19meir1-4":[Mc(),`px`],"d19meir1-5":[Nc(),`px`]}})}));function Ic(){let[e,t]=Rc.useState();return[e??void 0,t]}function Lc(){let[e,t]=Ic(),[n,r]=Rc.useState(0),[i,a]=Rc.useState(!0);return Rc.useLayoutEffect(()=>{if(e===void 0||!(`IntersectionObserver`in window))return;let t=new IntersectionObserver(e=>{e.length!==0&&a(e[0].isIntersecting)},{threshold:1});return t.observe(e),()=>t.disconnect()},[e]),Rc.useEffect(()=>{if(i||e===void 0)return;let t,n=()=>{let{right:i}=e.getBoundingClientRect();r(e=>Math.min(e+window.innerWidth-i-10,0)),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>{t!==void 0&&cancelAnimationFrame(t)}},[e,i]),{ref:t,style:Rc.useMemo(()=>({transform:`translateX(${n}px)`}),[n])}}var Rc,zc=o((()=>{Rc=u(f(),1)})),Bc=c({default:()=>Hc}),Vc,Hc,Uc=o((()=>{Vc=u(f(),1),Ks(),Ti(),ct(),Fc(),zc(),Hc=e=>{let{target:t,content:n,onFinishEditing:r,forceEditMode:i,initialValue:a,imageEditorOverride:o,markdownDivCreateNode:s,highlight:c,className:l,theme:u,id:d,cell:f,bloom:p,validateCell:m,getCellRenderer:h,provideEditor:g,isOutsideClick:_}=e,[v,y]=Vc.useState(i?n:void 0),b=Vc.useRef(v??n);b.current=v??n;let[x,S]=Vc.useState(()=>m===void 0||!(Xe(n)&&m?.(f,n,b.current)===!1)),C=Vc.useCallback((e,t)=>{r(x?e:void 0,t)},[x,r]),w=Vc.useCallback(e=>{if(m!==void 0&&e!==void 0&&Xe(e)){let t=m(f,e,b.current);t===!1?S(!1):(typeof t==`object`&&(e=t),S(!0))}y(e)},[f,m]),T=Vc.useRef(!1),E=Vc.useRef(void 0),D=Vc.useCallback(()=>{C(v,[0,0]),T.current=!0},[v,C]),O=Vc.useCallback((e,t)=>{C(e,t??E.current??[0,0]),T.current=!0},[C]),k=Vc.useCallback(async e=>{let t=!1;e.key===`Escape`?(e.stopPropagation(),e.preventDefault(),E.current=[0,0]):e.key===`Enter`&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),E.current=[0,1],t=!0):e.key===`Tab`&&(e.stopPropagation(),e.preventDefault(),E.current=[e.shiftKey?-1:1,0],t=!0),window.setTimeout(()=>{!T.current&&E.current!==void 0&&(C(t?v:void 0,E.current),T.current=!0)},0)},[C,v]),A=v??n,[j,M]=Vc.useMemo(()=>{if(Ze(n))return[];let e=g?.(n);return e===void 0?[h(n)?.provideEditor?.(n),!1]:[e,!1]},[n,h,g]),{ref:ee,style:N}=Lc(),te=!0,ne,P=!0,re;if(j!==void 0){te=j.disablePadding!==!0,P=j.disableStyling!==!0;let e=$e(j);e&&(re=j.styleOverride);let n=e?j.editor:j;ne=Vc.createElement(n,{isHighlighted:c,onChange:w,value:A,initialValue:a,onFinishedEditing:O,validatedSelection:Xe(A)?A.selectionRange:void 0,forceEditMode:i,target:t,imageEditorOverride:o,markdownDivCreateNode:s,isValid:x,theme:u})}re={...re,...N};let F=document.getElementById(`portal`);if(F===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `
` as the last child of your ``.'),null;let ie=P?`gdg-style`:`gdg-unstyle`;x||(ie+=` gdg-invalid`),te&&(ie+=` gdg-pad`);let ae=p?.[0]??1,oe=p?.[1]??1;return(0,Cc.createPortal)(Vc.createElement(wi.Provider,{value:u},Vc.createElement(Gs,{style:yi(u),className:l,onClickOutside:D,isOutsideClick:_},Vc.createElement(Pc,{ref:ee,id:d,className:ie,style:re,as:M===!0?`label`:void 0,targetX:t.x-ae,targetY:t.y-oe,targetWidth:t.width+ae*2,targetHeight:t.height+oe*2},Vc.createElement(`div`,{className:`gdg-clip-region`,onKeyDown:k},ne)))),F)}}));E();var Wc=u(qi(),1),Gc=u(Zi(),1);ct(),Ti(),vr();var Kc=L.lazy(async()=>await Dc(()=>Promise.resolve().then(()=>(Uc(),Bc)),void 0,import.meta.url)),qc=0;function Jc(e){return(0,Wc.default)((0,Gc.default)((0,Gc.default)(e).filter(e=>e.span!==void 0).map(e=>(0,Es.default)((e.span?.[0]??0)+1,(e.span?.[1]??0)+1))))}function Yc(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(e=>({...e,x:e.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var Xc={kind:I.Loading,allowOverlay:!1},Zc={columns:st.empty(),rows:st.empty(),current:void 0},Qc=L.forwardRef((e,t)=>{let[n,r]=L.useState(Zc),[i,a]=L.useState(),o=L.useRef(null),s=L.useRef(null),[c,l]=L.useState(),u=L.useRef(null),d=L.useRef(),f=typeof window>`u`?null:window,{imageEditorOverride:p,getRowThemeOverride:m,markdownDivCreateNode:h,width:g,height:_,columns:v,rows:y,getCellContent:b,onCellClicked:w,onCellActivated:T,onFillPattern:E,onFinishedEditing:D,coercePasteValue:O,drawHeader:k,drawCell:A,editorBloom:j,onHeaderClicked:M,onColumnProposeMove:ee,spanRangeBehavior:N=`default`,onGroupHeaderClicked:te,onCellContextMenu:ne,className:P,onHeaderContextMenu:re,getCellsForSelection:F,onGroupHeaderContextMenu:ie,onGroupHeaderRenamed:ae,onCellEdited:oe,onCellsEdited:se,onSearchResultsChanged:ce,searchResults:le,onSearchValueChange:ue,searchValue:de,onKeyDown:fe,onKeyUp:pe,keybindings:me,editOnType:he=!0,onRowAppended:ge,onColumnMoved:_e,validateCell:ve,highlightRegions:ye,rangeSelect:be=`rect`,columnSelect:xe=`multi`,rowSelect:Se=`multi`,rangeSelectionBlending:Ce=`exclusive`,columnSelectionBlending:we=`exclusive`,rowSelectionBlending:Te=`exclusive`,onDelete:Ee,onDragStart:De,onMouseMove:Oe,onPaste:ke,copyHeaders:Ae=!1,freezeColumns:je=0,cellActivationBehavior:Me=`second-click`,rowSelectionMode:Ne=`auto`,onHeaderMenuClick:Pe,getGroupDetails:Fe,onSearchClose:Ie,onItemHovered:Le,onSelectionCleared:Re,showSearch:ze,onVisibleRegionChanged:Be,gridSelection:Ve,onGridSelectionChange:He,minColumnWidth:Ue=50,maxColumnWidth:We=500,maxColumnAutoWidth:Ge,provideEditor:Ke,trailingRowOptions:qe,freezeTrailingRows:Je=0,allowedFillDirections:Ye=`orthogonal`,scrollOffsetX:et,scrollOffsetY:tt,verticalBorder:nt,onDragOverCell:rt,onDrop:it,onColumnResize:ot,onColumnResizeEnd:ct,onColumnResizeStart:lt,customRenderers:ut,fillHandle:dt,drawFocusRing:ft=!0,experimental:pt,fixedShadowX:mt,fixedShadowY:ht,headerIcons:gt,imageWindowLoader:_t,initialSize:vt,isDraggable:yt,onDragLeave:bt,onRowMoved:xt,overscrollX:St,overscrollY:Ct,preventDiagonalScrolling:wt,rightElement:Tt,rightElementProps:Et,trapFocus:Dt=!1,smoothScrollX:Ot,smoothScrollY:kt,scaleToRem:At=!1,rowHeight:jt=34,headerHeight:Mt=36,groupHeaderHeight:Nt=Mt,theme:Pt,isOutsideClick:Ft,renderers:It}=e,Lt=typeof e.rowMarkers==`string`?void 0:e.rowMarkers,Rt=Lt?.kind??e.rowMarkers??`none`,zt=Lt?.width??e.rowMarkerWidth,Bt=Lt?.startIndex??e.rowMarkerStartIndex??1,Vt=Lt?.theme??e.rowMarkerTheme,Ht=Lt?.checkboxStyle??`square`,Ut=Math.max(Ue,20),Wt=Math.max(We,Ut),Gt=Math.max(Ge??Wt,Ut),Yt=L.useMemo(()=>typeof window>`u`?{fontSize:`16px`}:window.getComputedStyle(document.documentElement),[]),{rowHeight:Xt,headerHeight:Zt,groupHeaderHeight:Qt,theme:$t,overscrollX:en,overscrollY:tn}=vc({groupHeaderHeight:Nt,headerHeight:Mt,overscrollX:St,overscrollY:Ct,remSize:L.useMemo(()=>Number.parseFloat(Yt.fontSize),[Yt]),rowHeight:jt,scaleToRem:At,theme:Pt}),nn=Sc(me),rn=zt??(y>1e4?48:y>1e3?44:y>100?36:32),an=Rt!==`none`,R=+!!an,on=ge!==void 0,cn=qe?.sticky===!0,[un,dn]=L.useState(!1),fn=ze??un,pn=L.useCallback(()=>{Ie===void 0?dn(!1):Ie()},[Ie]),z=L.useMemo(()=>Ve===void 0?void 0:Yc(Ve,R),[Ve,R])??n,mn=L.useRef();mn.current===void 0&&(mn.current=new AbortController),L.useEffect(()=>()=>mn?.current.abort(),[]);let[hn,gn]=$s(F,b,R,mn.current,y),_n=L.useCallback((e,t,n)=>{if(ve===void 0)return!0;let r=[e[0]-R,e[1]];return ve?.(r,t,n)},[R,ve]),vn=L.useRef(Ve),yn=L.useCallback((e,t)=>{t&&(e=uc(e,hn,R,N,mn.current)),He===void 0?r(e):(vn.current=Yc(e,-R),He(vn.current))},[He,hn,R,N]),bn=Jt(ot,L.useCallback((e,t,n,r)=>{ot?.(v[n-R],t,n-R,r)},[ot,R,v])),xn=Jt(ct,L.useCallback((e,t,n,r)=>{ct?.(v[n-R],t,n-R,r)},[ct,R,v])),Sn=Jt(lt,L.useCallback((e,t,n,r)=>{lt?.(v[n-R],t,n-R,r)},[lt,R,v])),Cn=Jt(k,L.useCallback((e,t)=>k?.({...e,columnIndex:e.columnIndex-R},t)??!1,[k,R])),wn=Jt(A,L.useCallback((e,t)=>A?.({...e,col:e.col-R},t)??!1,[A,R])),Tn=L.useCallback(e=>{if(Ee!==void 0){let t=Ee(Yc(e,-R));return typeof t==`boolean`?t:Yc(t,R)}return!0},[Ee,R]),[En,Dn,On]=Qs(z,yn,Ce,we,Te,be),kn=L.useMemo(()=>xi(bi(),$t),[$t]),[An,jn]=L.useState([0,0,0]),Mn=L.useMemo(()=>{if(It===void 0)return{};let e={};for(let t of It)e[t.kind]=t;return e},[It]),Nn=L.useCallback(e=>e.kind===I.Custom?ut?.find(t=>t.isMatch(e)):Mn[e.kind],[ut,Mn]),{sizedColumns:Pn,nonGrowWidth:Fn}=ki(v,y,gn,An[0]-(R===0?0:rn)-An[2],Ut,Gt,kn,Nn,mn.current);Rt!==`none`&&(Fn+=rn);let In=L.useMemo(()=>Pn.some(e=>e.group!==void 0),[Pn]),Ln=In?Zt+Qt:Zt,Rn=z.rows.length,zn=Rt===`none`?void 0:Rn===0?!1:Rn===y||void 0,Bn=L.useMemo(()=>Rt===`none`?Pn:[{title:``,width:rn,icon:void 0,hasMenu:!1,style:`normal`,themeOverride:Vt,rowMarker:Ht,rowMarkerChecked:zn},...Pn],[Rt,Pn,rn,Vt,Ht,zn]),[Vn,Hn]=L.useMemo(()=>[tt!==void 0&&typeof Xt==`number`?Math.floor(tt/Xt):0,tt!==void 0&&typeof Xt==`number`?-(tt%Xt):0],[tt,Xt]),Un=L.useRef({height:1,width:1,x:0,y:0}),Wn=L.useMemo(()=>({x:Un.current.x,y:Vn,width:Un.current.width??1,height:Un.current.height??1,ty:Hn}),[Hn,Vn]),Gn=L.useRef(!1),[Kn,qn,Jn]=ln(Wn);Un.current=Kn;let Yn=(Kn.height??1)>1;L.useLayoutEffect(()=>{if(tt!==void 0&&u.current!==null&&Yn){if(u.current.scrollTop===tt)return;u.current.scrollTop=tt,u.current.scrollTop!==tt&&Jn(),Gn.current=!0}},[tt,Yn,Jn]);let Xn=(Kn.width??1)>1;L.useLayoutEffect(()=>{if(et!==void 0&&u.current!==null&&Xn){if(u.current.scrollLeft===et)return;u.current.scrollLeft=et,u.current.scrollLeft!==et&&Jn(),Gn.current=!0}},[et,Xn,Jn]);let Zn=Kn.x+R,Qn=Kn.y,$n=L.useRef(null),er=L.useCallback(e=>{e===!0?$n.current?.focus():window.requestAnimationFrame(()=>{$n.current?.focus()})},[]),tr=on?y+1:y,nr=L.useCallback(e=>{let t=R===0?e:e.map(e=>({...e,location:[e.location[0]-R,e.location[1]]})),n=se?.(t);if(n!==!0)for(let e of t)oe?.(e.location,e.value);return n},[oe,se,R]),[rr,ir]=L.useState(),ar=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,or=ft?z.current?.cell:void 0,sr=or?.[0],cr=or?.[1],lr=L.useMemo(()=>{if((ye===void 0||ye.length===0)&&(ar??sr??cr??rr)===void 0)return;let e=[];if(ye!==void 0)for(let t of ye){let n=Bn.length-t.range.x-R;n>0&&e.push({color:t.color,range:{...t.range,x:t.range.x+R,width:Math.min(n,t.range.width)},style:t.style})}return rr!==void 0&&e.push({color:fr(kn.accentColor,0),range:rr,style:`dashed`}),ar!==void 0&&e.push({color:fr(kn.accentColor,.5),range:ar,style:`solid-outline`}),sr!==void 0&&cr!==void 0&&e.push({color:kn.accentColor,range:{x:sr,y:cr,width:1,height:1},style:`solid-outline`}),e.length>0?e:void 0},[rr,ar,sr,cr,ye,Bn.length,kn.accentColor,R]),ur=L.useRef(Bn);ur.current=Bn;let dr=L.useCallback(([e,t],n=!1)=>{let r=on&&t===tr-1;if(e===0&&an)return r?Xc:{kind:at.Marker,allowOverlay:!1,checkboxStyle:Ht,checked:z?.rows.hasIndex(t)===!0,markerKind:Rt===`clickable-number`?`number`:Rt,row:Bt+t,drawHandle:xt!==void 0,cursor:Rt===`clickable-number`?`pointer`:void 0};if(r){let t=e===R?qe?.hint??``:``,n=ur.current[e];if(n?.trailingRowOptions?.disabled===!0)return Xc;{let e=n?.trailingRowOptions?.hint??t,r=n?.trailingRowOptions?.addIcon??qe?.addIcon;return{kind:at.NewRow,hint:e,allowOverlay:!1,icon:r}}}else{let r=e-R;if(n||pt?.strict===!0){let e=Un.current,n=e.x>r||r>e.x+e.width||e.y>t||t>e.y+e.height||t>=br.current,i=r===e.extras?.selected?.[0]&&t===e.extras?.selected[1],a=!1;if(e.extras?.freezeRegions!==void 0){for(let n of e.extras.freezeRegions)if(xa(n,r,t)){a=!0;break}}if(n&&!i&&!a)return Xc}let i=b([r,t]);return R!==0&&i.span!==void 0&&(i={...i,span:[i.span[0]+R,i.span[1]+R]}),i}},[on,tr,an,Ht,z?.rows,Rt,Bt,xt,R,qe?.hint,qe?.addIcon,pt?.strict,b]),pr=L.useCallback(e=>{let t=Fe?.(e)??{name:e};return ae!==void 0&&e!==``&&(t={icon:t.icon,name:t.name,overrideTheme:t.overrideTheme,actions:[...t.actions??[],{title:`Rename`,icon:`renameIcon`,onClick:e=>Lr({group:t.name,bounds:e.bounds})}]}),t},[Fe,ae]),mr=L.useCallback(e=>{let[t,n]=e.cell,r=Bn[t],i=r?.group===void 0?void 0:pr(r.group)?.overrideTheme,o=r?.themeOverride,s=m?.(n);a({...e,theme:xi(kn,i,o,s,e.content.themeOverride)})},[m,Bn,pr,kn]),hr=L.useCallback((e,t,n)=>{if(z.current===void 0)return;let[r,i]=z.current.cell,a=dr([r,i]);if(a.kind!==I.Boolean&&a.allowOverlay){let t=a;if(n!==void 0)switch(t.kind){case I.Number:{let e=C(()=>n===`-`?-0:Number.parseFloat(n),0);t={...t,data:Number.isNaN(e)?0:e};break}case I.Text:case I.Markdown:case I.Uri:t={...t,data:n};break}mr({target:e,content:t,initialValue:n,cell:[r,i],highlight:n===void 0,forceEditMode:n!==void 0})}else a.kind===I.Boolean&&t&&a.readonly!==!0&&(nr([{location:z.current.cell,value:{...a,data:mc(a.data)}}]),$n.current?.damage([{cell:z.current.cell}]))},[dr,z,nr,mr]),gr=L.useCallback((e,t)=>{let n=$n.current?.getBounds(e,t);if(n===void 0||u.current===null)return;let r=dr([e,t]);r.allowOverlay&&mr({target:n,content:r,initialValue:void 0,highlight:!0,cell:[e,t],forceEditMode:!0})},[dr,mr]),_r=L.useCallback((e,t,n=`both`,r=0,i=0,a=void 0)=>{if(u.current!==null){let o=$n.current,c=s.current,l=typeof e==`number`?e:e.unit===`cell`?e.amount:void 0,d=typeof t==`number`?t:t.unit===`cell`?t.amount:void 0,f=typeof e!=`number`&&e.unit===`px`?e.amount:void 0,p=typeof t!=`number`&&t.unit===`px`?t.amount:void 0;if(o!==null&&c!==null){let s={x:0,y:0,width:0,height:0},m=0,h=0;if((l!==void 0||d!==void 0)&&(s=o.getBounds((l??0)+R,d??0)??s,s.width===0||s.height===0))return;let g=c.getBoundingClientRect(),_=g.width/c.offsetWidth;if(f!==void 0&&(s={...s,x:f-g.left-u.current.scrollLeft,width:1}),p!==void 0&&(s={...s,y:p+g.top-u.current.scrollTop,height:1}),s!==void 0){let o={x:s.x-r,y:s.y-i,width:s.width+2*r,height:s.height+2*i},c=0;for(let e=0;e0&&(l=zr(tr,d,Xt));let f=c*_+g.left+R*rn*_,p=g.right,v=g.top+Ln*_,y=g.bottom-l*_,b=s.width+r*2;switch(a?.hAlign){case`start`:p=f+b;break;case`end`:f=p-b;break;case`center`:f=Math.floor((f+p)/2)-b/2,p=f+b;break}let x=s.height+i*2;switch(a?.vAlign){case`start`:y=v+x;break;case`end`:v=y-x;break;case`center`:v=Math.floor((v+y)/2)-x/2,y=v+x;break}f>o.x?m=o.x-f:po.y?h=o.y-v:y=tr-d)&&(h=0),(m!==0||h!==0)&&(_!==1&&(m/=_,h/=_),u.current.scrollTo(m+u.current.scrollLeft,h+u.current.scrollTop))}}}},[R,Je,rn,Ln,je,Pn,tr,cn,Xt]),vr=L.useRef(gr),yr=L.useRef(b),br=L.useRef(y);vr.current=gr,yr.current=b,br.current=y;let xr=L.useCallback(async(e,t=!0)=>{if(Bn[e]?.trailingRowOptions?.disabled===!0)return;let n=ge?.(),r,i=!0;n!==void 0&&(r=await n,r===`top`&&(i=!1),typeof r==`number`&&(i=!1));let a=0,o=()=>{if(br.current<=y){a<500&&window.setTimeout(o,a),a=50+a*2;return}let n=typeof r==`number`?r:i?y:0;vi.current(e-R,n),En({cell:[e,n],range:{x:e,y:n,width:1,height:1}},!1,!1,`edit`);let s=yr.current([e-R,n]);s.allowOverlay&&Qe(s)&&s.readonly!==!0&&t&&window.setTimeout(()=>{vr.current(e,n)},0)};o()},[Bn,ge,R,y,En]),Sr=L.useCallback(e=>{let t=Pn[e]?.trailingRowOptions?.targetColumn??qe?.targetColumn;if(typeof t==`number`)return t+ +!!an;if(typeof t==`object`){let e=v.indexOf(t);if(e>=0)return e+ +!!an}},[Pn,v,an,qe?.targetColumn]),Cr=L.useRef(),wr=L.useRef(),Tr=L.useCallback((e,t)=>{let[n,r]=t;return xi(kn,Bn[n]?.themeOverride,m?.(r),e.themeOverride)},[m,Bn,kn]),Er=L.useCallback(e=>{let t=ys.value?e.metaKey:e.ctrlKey,n=t&&Se===`multi`,r=t&&xe===`multi`,[i,o]=e.location,s=z.columns,c=z.rows,[l,u]=z.current?.cell??[];if(e.kind===`cell`){if(wr.current=void 0,Or.current=[i,o],i===0&&an){if(on===!0&&o===y||Rt===`number`||Se===`none`)return;let r=dr(e.location);if(r.kind!==at.Marker)return;if(xt!==void 0){let t=Nn(r);x(t?.kind===at.Marker);let n=t?.onClick?.({...e,cell:r,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,theme:Tr(r,e.location),preventDefault:()=>void 0});if(n===void 0||n.checked===r.checked)return}a(void 0),er();let i=c.hasIndex(o),s=Cr.current;if(Se===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&s!==void 0&&c.hasIndex(s)){let e=[Math.min(s,o),Math.max(s,o)+1];n||Ne===`multi`?Dn(void 0,e,!0):Dn(st.fromSingleSelection(e),void 0,n)}else n||e.isTouch||Ne===`multi`?i?Dn(c.remove(o),void 0,!0):(Dn(void 0,o,!0),Cr.current=o):i&&c.length===1?Dn(st.empty(),void 0,t):(Dn(st.fromSingleSelection(o),void 0,t),Cr.current=o)}else if(i>=R&&on&&o===y){let e=Sr(i);xr(e??i)}else if(l!==i||u!==o){let n=dr(e.location),r=Nn(n);if(r?.onSelect!==void 0){let t=!1;if(r.onSelect({...e,cell:n,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,preventDefault:()=>t=!0,theme:Tr(n,e.location)}),t)return}let s=cn&&o===y,c=cn&&z!==void 0&&z.current?.cell[1]===y;if((e.shiftKey||e.isLongTouch===!0)&&l!==void 0&&u!==void 0&&z.current!==void 0&&!c){if(s)return;let e=Math.min(i,l),n=Math.max(i,l),r=Math.min(o,u),a=Math.max(o,u);En({...z.current,range:{x:e,y:r,width:n-e+1,height:a-r+1}},!0,t,`click`),Cr.current=void 0,er()}else En({cell:[i,o],range:{x:i,y:o,width:1,height:1}},!0,t,`click`),Cr.current=void 0,a(void 0),er()}}else if(e.kind===`header`)if(Or.current=[i,o],a(void 0),an&&i===0)Cr.current=void 0,wr.current=void 0,Se===`multi`&&(c.length===y?Dn(st.empty(),void 0,t):Dn(st.fromSingleSelection([0,y]),void 0,t),er());else{let n=wr.current;if(xe===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&n!==void 0&&s.hasIndex(n)){let e=[Math.min(n,i),Math.max(n,i)+1];r?On(void 0,e,t):On(st.fromSingleSelection(e),void 0,t)}else r?(s.hasIndex(i)?On(s.remove(i),void 0,t):On(void 0,i,t),wr.current=i):xe!==`none`&&(On(st.fromSingleSelection(i),void 0,t),wr.current=i);Cr.current=void 0,er()}else e.kind===`group-header`?Or.current=[i,o]:e.kind===`out-of-bounds`&&!e.isMaybeScrollbar&&(yn(Zc,!1),a(void 0),er(),Re?.(),Cr.current=void 0,wr.current=void 0)},[xr,xe,er,Nn,Sr,dr,z,an,cn,Re,xt,R,Rt,Se,Ne,y,En,yn,On,Dn,on,Tr]),Dr=L.useRef(!1),Or=L.useRef(),jr=L.useRef(Kn),Pr=L.useRef(),Fr=L.useCallback(e=>{if(Br.current=!1,jr.current=Un.current,e.button!==0&&e.button!==1){Pr.current=void 0;return}let t=performance.now();Pr.current={button:e.button,time:t,location:e.location},e?.kind===`header`&&(Dr.current=!0);let n=e.kind===`cell`&&e.isFillHandle;!n&&e.kind!==`cell`&&e.isEdge||(l({previousSelection:z,fillHandle:n}),Or.current=void 0,!e.isTouch&&e.button===0&&!n?Er(e):!e.isTouch&&e.button===1&&(Or.current=e.location))},[z,Er]),[Ir,Lr]=L.useState(),Rr=L.useCallback(e=>{if(e.kind!==`group-header`||xe!==`multi`)return;let t=ys.value?e.metaKey:e.ctrlKey,[n]=e.location,r=z.columns;if(n=R&&Ar(i.group,Bn[e].group);e--)a--;for(let e=n+1;e{if(hn!==void 0&&bn!==void 0){let t=Un.current.y,n=Un.current.height,r=hn({x:e,y:t,width:1,height:Math.min(n,y-t)},mn.current.signal);typeof r!=`object`&&(r=await r());let i=Pn[e-R],a=document.createElement(`canvas`).getContext(`2d`,{alpha:!1});if(a!==null){a.font=kn.baseFontFull;let t=Oi(a,kn,i,0,r,Ut,Wt,!1,Nn);bn?.(i,t.width,e,t.width)}}},[Pn,hn,Wt,kn,Ut,bn,R,y,Nn]),[Hr,Ur]=L.useState(),Wr=L.useCallback(async(e,t)=>{let n=e.current?.range;if(n===void 0||hn===void 0||t.current===void 0)return;let r=t.current.range;if(E!==void 0){let e=!1;if(E({fillDestination:{...r,x:r.x-R},patternSource:{...n,x:n.x-R},preventDefault:()=>e=!0}),e)return}let i=hn(n,mn.current.signal);typeof i!=`object`&&(i=await i());let a=i,o=[];for(let e=0;e({cell:e.location})))},[hn,nr,E,R]),Gr=L.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;let e={...z,current:{...z.current,range:{...z.current.range,width:1}}};Wr(e,z)},[Wr,z]),Kr=L.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;let e={...z,current:{...z.current,range:{...z.current.range,height:1}}};Wr(e,z)},[Wr,z]),qr=L.useCallback((e,t)=>{let n=c;if(l(void 0),ir(void 0),Ur(void 0),Dr.current=!1,t)return;if(n?.fillHandle===!0&&z.current!==void 0&&n.previousSelection?.current!==void 0){if(rr===void 0)return;let e={...z,current:{...z.current,range:Sa(n.previousSelection.current.range,rr)}};Wr(n.previousSelection,e),yn(e,!0);return}let[r,i]=e.location,[a,o]=Or.current??[],s=()=>{Br.current=!0},u=t=>{let c=t.isTouch||a===r&&o===i;if(c&&w?.([r-R,i],{...t,preventDefault:s}),t.button===1)return!Br.current;if(!Br.current){let a=dr(e.location),o=Nn(a);if(o!==void 0&&o.onClick!==void 0&&c){let n=o.onClick({...t,cell:a,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,theme:Tr(a,e.location),preventDefault:s});n!==void 0&&!Ze(n)&&Xe(n)&&(nr([{location:t.location,value:n}]),$n.current?.damage([{cell:t.location}]))}if(Br.current||z.current===void 0)return!1;let l=!1;switch(a.activationBehaviorOverride??Me){case`double-click`:case`second-click`:{if(n?.previousSelection?.current?.cell===void 0)break;let[e,a]=z.current.cell,[o,s]=n.previousSelection.current.cell;l=r===e&&r===o&&i===a&&i===s&&(t.isDoubleClick===!0||Me===`second-click`);break}case`single-click`:l=!0;break}if(l)return T?.([r-R,i]),hr(t.bounds,!1),!0}return!1},d=e.location[0]-R;if(e.isTouch){let t=Un.current,n=jr.current;if(t.x!==n.x||t.y!==n.y)return;if(e.isLongTouch===!0){if(e.kind===`cell`&&Nr(z.current?.cell,e.location)){ne?.([d,e.location[1]],{...e,preventDefault:s});return}else if(e.kind===`header`&&z.columns.hasIndex(r)){re?.(d,{...e,preventDefault:s});return}else if(e.kind===`group-header`){if(d<0)return;ie?.(d,{...e,preventDefault:s});return}}e.kind===`cell`?u(e)||Er(e):e.kind===`group-header`?te?.(d,{...e,preventDefault:s}):(e.kind===`header`&&M?.(d,{...e,preventDefault:s}),Er(e));return}if(e.kind===`header`){if(d<0)return;e.isEdge?e.isDoubleClick===!0&&Vr(r):e.button===0&&r===a&&i===o&&M?.(d,{...e,preventDefault:s})}if(e.kind===`group-header`){if(d<0)return;e.button===0&&r===a&&i===o&&(te?.(d,{...e,preventDefault:s}),Br.current||Rr(e))}e.kind===`cell`&&(e.button===0||e.button===1)&&u(e),Or.current=void 0},[c,z,R,rr,Wr,yn,w,dr,Nn,Me,Tr,nr,T,hr,ne,re,ie,Er,te,M,Vr,Rr]),Jr=L.useCallback(e=>{let t={...e,location:[e.location[0]-R,e.location[1]]};Oe?.(t),c!==void 0&&e.buttons===0&&(l(void 0),ir(void 0),Ur(void 0),Dr.current=!1),Ur(t=>Dr.current?[e.scrollEdge[0],0]:e.scrollEdge[0]===t?.[0]&&e.scrollEdge[1]===t[1]?t:c===void 0||(Pr.current?.location[0]??0){Pe?.(e-R,t)},[Pe,R]),Xr=z?.current?.cell,Zr=L.useCallback((e,t,n,r,i,a)=>{Gn.current=!1;let o=Xr;o!==void 0&&(o=[o[0]-R,o[1]]);let s=je===0?void 0:{x:0,y:e.y,width:je,height:e.height},c=[];s!==void 0&&c.push(s),Je>0&&(c.push({x:e.x-R,y:y-Je,width:e.width,height:Je}),je>0&&c.push({x:0,y:y-Je,width:je,height:Je}));let l={x:e.x-R,y:e.y,width:e.width,height:on&&e.y+e.height>=y?e.height-1:e.height,tx:i,ty:a,extras:{selected:o,freezeRegion:s,freezeRegions:c}};Un.current=l,qn(l),jn([t,n,r]),Be?.(l,l.tx,l.ty,l.extras)},[Xr,R,on,y,je,Je,qn,Be]),Qr=Jt(_e,L.useCallback((e,t)=>{_e?.(e-R,t-R),xe!==`none`&&On(st.fromSingleSelection(t),void 0,!0)},[xe,_e,R,On])),$r=L.useRef(!1),ei=L.useCallback(e=>{if(e.location[0]===0&&R>0){e.preventDefault();return}De?.({...e,location:[e.location[0]-R,e.location[1]]}),e.defaultPrevented()||($r.current=!0),l(void 0)},[De,R]),ti=L.useCallback(()=>{$r.current=!1},[]),ni=L.useRef(),ri=L.useCallback(e=>{if(!Ts(e,ni.current)&&(ni.current=e,!(Pr?.current?.button!==void 0&&Pr.current.button>=1))){if(e.buttons!==0&&c!==void 0&&Pr.current?.location[0]===0&&e.location[0]===0&&R===1&&Se===`multi`&&c.previousSelection&&!c.previousSelection.rows.hasIndex(Pr.current.location[1])&&z.rows.hasIndex(Pr.current.location[1])){let t=Math.min(Pr.current.location[1],e.location[1]),n=Math.max(Pr.current.location[1],e.location[1])+1;Dn(st.fromSingleSelection([t,n]),void 0,!1)}if(e.buttons!==0&&c!==void 0&&z.current!==void 0&&!$r.current&&!Dr.current&&(be===`rect`||be===`multi-rect`)){let[t,n]=z.current.cell,[r,i]=e.location;if(i<0&&(i=Un.current.y),c.fillHandle===!0&&c.previousSelection?.current!==void 0){let e=c.previousSelection.current.range;i=Math.min(i,on?y-1:y);let t=ya(e,r,i,Ye);ir(t)}else{if(on&&n===y)return;if(on&&i===y)if(e.kind===`out-of-bounds`)i--;else return;r=Math.max(r,R);let a=r-t,o=i-n,s={x:a>=0?t:r,y:o>=0?n:i,width:Math.abs(a)+1,height:Math.abs(o)+1};En({...z.current,range:s},!0,!1,`drag`)}}Le?.({...e,location:[e.location[0]-R,e.location[1]]})}},[Ye,c,R,Se,z,be,Le,Dn,on,y,En]);nee(Hr,u,L.useCallback(()=>{let e=ni.current;if(e===void 0)return;let[t,n]=e.scrollEdge,[r,i]=e.location,a=Un.current;t===-1?r=a.extras?.freezeRegion?.x??a.x:t===1&&(r=a.x+a.width),n===-1?i=Math.max(0,a.y):n===1&&(i=Math.min(y-1,a.y+a.height)),r=(0,ds.default)(r,0,Bn.length-1),i=(0,ds.default)(i,0,y-1),ri({...e,location:[r,i]})},[Bn.length,ri,y]));let ii=L.useCallback(e=>{if(z.current===void 0)return;let[t,n]=e,[r,i]=z.current.cell,a=z.current.range,o=a.x,s=a.x+a.width,c=a.y,l=a.y+a.height;if(n!==0)switch(n){case 2:l=y,c=i,_r(0,l,`vertical`);break;case-2:c=0,l=i+1,_r(0,c,`vertical`);break;case 1:ci+1?(l--,_r(0,l,`vertical`)):(c=Math.max(0,c-1),_r(0,c,`vertical`));break;default:S(n)}if(t!==0)if(t===2)s=Bn.length,o=r,_r(s-1-R,0,`horizontal`);else if(t===-2)o=R,s=r+1,_r(o-R,0,`horizontal`);else{let e=[];if(hn!==void 0){let t=hn({x:o,y:c,width:s-o-R,height:l-c},mn.current.signal);typeof t==`object`&&(e=Jc(t))}if(t===1){let t=!1;if(o0){let n=(0,Es.default)(o+1,r+1).find(t=>!e.includes(t-R));n!==void 0&&(o=n,t=!0)}else o++,t=!0;t&&_r(o,0,`horizontal`)}t||(s=Math.min(Bn.length,s+1),_r(s-1-R,0,`horizontal`))}else if(t===-1){let t=!1;if(s>r+1){if(e.length>0){let n=(0,Es.default)(s-1,r,-1).find(t=>!e.includes(t-R));n!==void 0&&(s=n,t=!0)}else s--,t=!0;t&&_r(s-R,0,`horizontal`)}t||(o=Math.max(R,o-1),_r(o-R,0,`horizontal`))}else S(t)}En({cell:z.current.cell,range:{x:o,y:c,width:s-o,height:l-c}},!0,!1,`keyboard-select`)},[hn,z,Bn.length,R,y,_r,En]),ai=L.useCallback((e,t,n,r)=>{let i=tr-+!n;if(e=(0,ds.default)(e,R,Pn.length-1+R),t=(0,ds.default)(t,0,i),e===Xr?.[0]&&t===Xr?.[1])return!1;if(r&&z.current!==void 0){let n=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&n.push(z.current.range),yn({...z,current:{cell:[e,t],range:{x:e,y:t,width:1,height:1},rangeStack:n}},!0)}else En({cell:[e,t],range:{x:e,y:t,width:1,height:1}},!0,!1,`keyboard-nav`);return d.current!==void 0&&d.current[0]===e&&d.current[1]===t&&(d.current=void 0),_r(e-R,t),!0},[tr,R,Pn.length,Xr,z,_r,yn,En]),oi=L.useCallback((e,t)=>{i?.cell!==void 0&&e!==void 0&&Xe(e)&&(nr([{location:i.cell,value:e}]),window.requestAnimationFrame(()=>{$n.current?.damage([{cell:i.cell}])})),er(!0),a(void 0);let[n,r]=t;if(z.current!==void 0&&(n!==0||r!==0)){let t=z.current.cell[1]===tr-1&&e!==void 0;ai((0,ds.default)(z.current.cell[0]+n,0,Bn.length-1),(0,ds.default)(z.current.cell[1]+r,0,tr-1),t,!1)}D?.(e,t)},[i?.cell,er,z,D,nr,tr,ai,Bn.length]),si=L.useMemo(()=>`gdg-overlay-${qc++}`,[]),ci=L.useCallback(e=>{er();let t=[];for(let n=e.x;n({cell:e.location})))},[er,b,Nn,nr,R]),li=i!==void 0,ui=L.useCallback(e=>{let t=()=>{e.stopPropagation(),e.preventDefault()},n={didMatch:!1},{bounds:r}=e,i=z.columns,s=z.rows,c=nn;if(!li&&Xs(c.clear,e,n))yn(Zc,!1),Re?.();else if(!li&&Xs(c.selectAll,e,n))yn({columns:st.empty(),rows:st.empty(),current:{cell:z.current?.cell??[R,0],range:{x:R,y:0,width:v.length,height:y},rangeStack:[]}},!1);else if(Xs(c.search,e,n))o?.current?.focus({preventScroll:!0}),dn(!0);else if(Xs(c.delete,e,n)){let e=Tn?.(z)??!0;if(e!==!1){let t=e===!0?z:e;if(t.current!==void 0){ci(t.current.range);for(let e of t.current.rangeStack)ci(e)}for(let e of t.rows)ci({x:R,y:e,width:v.length,height:1});for(let e of t.columns)ci({x:e,y:0,width:1,height:y})}}if(n.didMatch)return t(),!0;if(z.current===void 0)return!1;let[l,u]=z.current.cell,d=!1,f=!1;Xs(c.scrollToSelectedCell,e,n)?vi.current(l-R,u):xe!==`none`&&Xs(c.selectColumn,e,n)?i.hasIndex(l)?On(i.remove(l),void 0,!0):xe===`single`?On(st.fromSingleSelection(l),void 0,!0):On(void 0,l,!0):Se!==`none`&&Xs(c.selectRow,e,n)?s.hasIndex(u)?Dn(s.remove(u),void 0,!0):Se===`single`?Dn(st.fromSingleSelection(u),void 0,!0):Dn(void 0,u,!0):!li&&r!==void 0&&Xs(c.activateCell,e,n)?u===y&&on?window.setTimeout(()=>{let e=Sr(l);xr(e??l)},0):(T?.([l-R,u]),hr(r,!0)):z.current.range.height>1&&Xs(c.downFill,e,n)?Kr():z.current.range.width>1&&Xs(c.rightFill,e,n)?Gr():Xs(c.goToNextPage,e,n)?u+=Math.max(1,Un.current.height-4):Xs(c.goToPreviousPage,e,n)?u-=Math.max(1,Un.current.height-4):Xs(c.goToFirstCell,e,n)?(a(void 0),u=0,l=0):Xs(c.goToLastCell,e,n)?(a(void 0),u=2**53-1,l=2**53-1):Xs(c.selectToFirstCell,e,n)?(a(void 0),ii([-2,-2])):Xs(c.selectToLastCell,e,n)?(a(void 0),ii([2,2])):li?(Xs(c.closeOverlay,e,n)&&a(void 0),Xs(c.acceptOverlayDown,e,n)&&(a(void 0),u++),Xs(c.acceptOverlayUp,e,n)&&(a(void 0),u--),Xs(c.acceptOverlayLeft,e,n)&&(a(void 0),l--),Xs(c.acceptOverlayRight,e,n)&&(a(void 0),l++)):(Xs(c.goDownCell,e,n)?u+=1:Xs(c.goUpCell,e,n)?--u:Xs(c.goRightCell,e,n)?l+=1:Xs(c.goLeftCell,e,n)?--l:Xs(c.goDownCellRetainSelection,e,n)?(u+=1,d=!0):Xs(c.goUpCellRetainSelection,e,n)?(--u,d=!0):Xs(c.goRightCellRetainSelection,e,n)?(l+=1,d=!0):Xs(c.goLeftCellRetainSelection,e,n)?(--l,d=!0):Xs(c.goToLastRow,e,n)?u=y-1:Xs(c.goToFirstRow,e,n)?u=-(2**53-1):Xs(c.goToLastColumn,e,n)?l=2**53-1:Xs(c.goToFirstColumn,e,n)?l=-(2**53-1):(be===`rect`||be===`multi-rect`)&&(Xs(c.selectGrowDown,e,n)?ii([0,1]):Xs(c.selectGrowUp,e,n)?ii([0,-1]):Xs(c.selectGrowRight,e,n)?ii([1,0]):Xs(c.selectGrowLeft,e,n)?ii([-1,0]):Xs(c.selectToLastRow,e,n)?ii([0,2]):Xs(c.selectToFirstRow,e,n)?ii([0,-2]):Xs(c.selectToLastColumn,e,n)?ii([2,0]):Xs(c.selectToFirstColumn,e,n)&&ii([-2,0])),f=n.didMatch);let p=ai(l,u,!1,d),m=n.didMatch;return m&&(p||!f||Dt)&&t(),m},[li,z,nn,xe,Se,be,R,y,ai,yn,Re,v.length,Tn,Dt,ci,On,Dn,on,Sr,xr,T,hr,Kr,Gr,ii]),di=L.useCallback(e=>{let t=!1;if(fe!==void 0&&fe({...e,cancel:()=>{t=!0}}),t||ui(e)||z.current===void 0)return;let[n,r]=z.current.cell,i=Un.current;if(he&&!e.metaKey&&!e.ctrlKey&&z.current!==void 0&&e.key.length===1&&/[ -~]/g.test(e.key)&&e.bounds!==void 0&&Qe(b([n-R,Math.max(0,Math.min(r,y-1))]))){if((!on||r!==y)&&(i.y>r||r>i.y+i.height||i.x>n||n>i.x+i.width))return;hr(e.bounds,!0,e.key),e.stopPropagation(),e.preventDefault()}},[he,fe,ui,z,b,R,y,on,hr]),fi=L.useCallback((e,t)=>{let n=e.location[0]-R;if(e.kind===`header`&&re?.(n,{...e,preventDefault:t}),e.kind===`group-header`){if(n<0)return;ie?.(n,{...e,preventDefault:t})}if(e.kind===`cell`){let[r,i]=e.location;ne?.([n,i],{...e,preventDefault:t}),kr(z,e.location)||ai(r,i,!1,!1)}},[z,ne,ie,re,R,ai]),pi=L.useCallback(async e=>{if(!nn.paste)return;function t(e,t,n,r){let i=typeof n==`object`?n?.join(` `)??``:n?.toString()??``;if(!Ze(e)&&Qe(e)&&e.readonly!==!0){let a=O?.(i,e);if(a!==void 0&&Xe(a))return{location:t,value:a};let o=Nn(e);if(o===void 0)return;if(o.kind===I.Custom){x(e.kind===I.Custom);let n=o.onPaste?.(i,e.data);return n===void 0?void 0:{location:t,value:{...e,data:n}}}else{let a=o.onPaste?.(i,e,{formatted:r,formattedString:typeof r==`string`?r:r?.join(` -`),rawValue:n});return a===void 0?void 0:(x(a.kind===e.kind),{location:t,value:a})}}}let n=z.columns,r=z.rows,i=u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0,a;if(z.current===void 0?n.length===1?a=[n.first()??0,0]:r.length===1&&(a=[R,r.first()??0]):a=[z.current.range.x,z.current.range.y],i&&a!==void 0){let n,r,i=`text/plain`,o=`text/html`;if(navigator.clipboard.read!==void 0){let e=await navigator.clipboard.read();for(let t of e){if(t.types.includes(o)){let e=sc(await(await t.getType(o)).text());if(e!==void 0){n=e;break}}t.types.includes(i)&&(r=await(await t.getType(i)).text())}}else if(navigator.clipboard.readText!==void 0)r=await navigator.clipboard.readText();else if(e!==void 0&&e?.clipboardData!==null)e.clipboardData.types.includes(o)&&(n=sc(e.clipboardData.getData(o))),n===void 0&&e.clipboardData.types.includes(i)&&(r=e.clipboardData.getData(i));else return;let[s,c]=a,l=[];do{if(ke===void 0){let e=dr(a),i=r??n?.map(e=>e.map(e=>e.rawValue).join(` `)).join(` `)??``,o=t(e,a,i,void 0);o!==void 0&&l.push(o);break}if(n===void 0){if(r===void 0)return;n=uc(r)}if(ke===!1||typeof ke==`function`&&ke?.([a[0]-R,a[1]],n.map(e=>e.map(e=>e.rawValue?.toString()??``)))!==!0)return;for(let[e,r]of n.entries()){if(e+c>=y)break;for(let[n,i]of r.entries()){let r=[n+s,e+c],[a,o]=r;if(a>=Bn.length||o>=tr)continue;let u=t(dr(r),r,i.rawValue,i.formatted);u!==void 0&&l.push(u)}}}while(!1);nr(l),$n.current?.damage(l.map(e=>({cell:e.location})))}},[O,Nn,dr,z,nn.paste,Bn.length,nr,tr,ke,R,y]);qt(`paste`,pi,f,!1,!0);let mi=L.useCallback(async(e,t)=>{if(!nn.copy)return;let n=t===!0||u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0,r=z.columns,i=z.rows,a=(t,n)=>{nee(Ae?[n.map(e=>({kind:I.Text,data:v[e].title,displayData:v[e].title,allowOverlay:!1})),...t]:t,n,e)};if(n&&hn!==void 0){if(z.current!==void 0){let e=hn(z.current.range,mn.current.signal);typeof e!=`object`&&(e=await e()),a(e,(0,ws.default)(z.current.range.x-R,z.current.range.x+z.current.range.width-R))}else if(i!==void 0&&i.length>0){let e=[...i].map(e=>{let t=hn({x:R,y:e,width:v.length,height:1},mn.current.signal);return typeof t==`object`?t[0]:t().then(e=>e[0])});e.some(e=>e instanceof Promise)?a(await Promise.all(e),(0,ws.default)(v.length)):a(e,(0,ws.default)(v.length))}else if(r.length>0){let e=[],t=[];for(let n of r){let r=hn({x:n,y:0,width:1,height:y},mn.current.signal);typeof r!=`object`&&(r=await r()),e.push(r),t.push(n-R)}e.length===1?a(e[0],t):a(e.reduce((e,t)=>e.map((e,n)=>[...e,...t[n]])),t)}}},[v,hn,z,nn.copy,R,y,Ae]);qt(`copy`,mi,f,!1,!1),qt(`cut`,L.useCallback(async e=>{if(nn.cut&&(u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0)&&(await mi(e),z.current!==void 0)){let e={current:{cell:z.current.cell,range:z.current.range,rangeStack:[]},rows:st.empty(),columns:st.empty()},t=Tn?.(e);if(t===!1||(e=t===!0?e:t,e.current===void 0))return;ci(e.current.range)}},[ci,z,nn.cut,mi,Tn]),f,!1,!1);let hi=L.useCallback((e,t)=>{if(ce!==void 0){R!==0&&(e=e.map(e=>[e[0]-R,e[1]])),ce(e,t);return}if(e.length===0||t===-1)return;let[n,r]=e[t];d.current!==void 0&&d.current[0]===n&&d.current[1]===r||(d.current=[n,r],ai(n,r,!1,!1))},[ce,R,ai]),[gi,_i]=Ve?.current?.cell??[],vi=L.useRef(_r);vi.current=_r,L.useLayoutEffect(()=>{!Gn.current&&gi!==void 0&&_i!==void 0&&(gi!==vn.current?.current?.cell[0]||_i!==vn.current?.current?.cell[1])&&vi.current(gi,_i),Gn.current=!1},[gi,_i]);let Si=z.current!==void 0&&(z.current.cell[0]>=Bn.length||z.current.cell[1]>=tr);L.useLayoutEffect(()=>{Si&&yn(Zc,!1)},[Si,yn]);let Ci=L.useMemo(()=>on===!0&&qe?.tint===!0?st.fromSingleSelection(tr-1):st.empty(),[tr,on,qe?.tint]),Ti=L.useCallback(e=>typeof nt==`boolean`?nt:nt?.(e-R)??!0,[R,nt]),Ei=L.useMemo(()=>{if(Ir===void 0||s.current===null)return null;let{bounds:e,group:t}=Ir,n=s.current.getBoundingClientRect();return L.createElement(Ks,{bounds:e,group:t,canvasBounds:n,onClose:()=>Lr(void 0),onFinish:e=>{Lr(void 0),ae?.(t,e)}})},[ae,Ir]),Di=Math.min(Bn.length,je+ +!!an);L.useImperativeHandle(t,()=>({appendRow:(e,t)=>xr(e+R,t),updateCells:e=>(R!==0&&(e=e.map(e=>({cell:[e.cell[0]+R,e.cell[1]]}))),$n.current?.damage(e)),getBounds:(e,t)=>{if(!(s?.current===null||u?.current===null)){if(e===void 0&&t===void 0){let e=s.current.getBoundingClientRect(),t=e.width/u.current.clientWidth;return{x:e.x-u.current.scrollLeft*t,y:e.y-u.current.scrollTop*t,width:u.current.scrollWidth*t,height:u.current.scrollHeight*t}}return $n.current?.getBounds((e??0)+R,t)}},focus:()=>$n.current?.focus(),emit:async e=>{switch(e){case`delete`:di({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!1,key:`Delete`,keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`fill-right`:di({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!0,key:`r`,keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`fill-down`:di({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!0,key:`d`,keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`copy`:await mi(void 0,!0);break;case`paste`:await pi();break}},scrollTo:_r,remeasureColumns:e=>{for(let t of e)Vr(t+R)}}),[xr,Vr,mi,di,pi,R,_r]);let[Ai,ji]=Xr??[],Mi=L.useCallback(e=>{let[t,n]=e;if(n===-1){xe!==`none`&&(On(st.fromSingleSelection(t),void 0,!1),er());return}Ai===t&&ji===n||(En({cell:e,range:{x:t,y:n,width:1,height:1}},!0,!1,`keyboard-nav`),_r(t,n))},[xe,er,_r,Ai,ji,En,On]),[Ni,Pi]=L.useState(!1),Fi=L.useRef((0,Kt.default)(e=>{Pi(e)},5)),Ii=L.useCallback(()=>{Fi.current(!0),z.current===void 0&&z.columns.length===0&&z.rows.length===0&&c===void 0&&En({cell:[R,Qn],range:{x:R,y:Qn,width:1,height:1}},!0,!1,`keyboard-select`)},[Qn,z,c,R,En]),Li=L.useCallback(()=>{Fi.current(!1)},[]),[Ri,zi]=L.useMemo(()=>{let e,t=pt?.scrollbarWidthOverride??sn(),n=y+ +!!on;if(typeof Xt==`number`)e=Ln+n*Xt;else{let t=0,r=Math.min(n,10);for(let e=0;et.width+e,0)+t;return[`${Math.min(1e5,r)}px`,`${Math.min(1e5,e)}px`]},[Bn,pt?.scrollbarWidthOverride,Xt,y,on,Ln]),Bi=L.useMemo(()=>yi(kn),[kn]);return L.createElement(wi.Provider,{value:kn},L.createElement(mc,{style:Bi,className:P,inWidth:g??Ri,inHeight:_??zi},L.createElement(Vs,{fillHandle:dt,drawFocusRing:ft,experimental:pt,fixedShadowX:mt,fixedShadowY:ht,getRowThemeOverride:m,headerIcons:gt,imageWindowLoader:_t,initialSize:vt,isDraggable:yt,onDragLeave:bt,onRowMoved:xt,overscrollX:en,overscrollY:tn,preventDiagonalScrolling:wt,rightElement:Tt,rightElementProps:Et,smoothScrollX:Ot,smoothScrollY:kt,className:P,enableGroups:In,onCanvasFocused:Ii,onCanvasBlur:Li,canvasRef:s,onContextMenu:fi,theme:kn,cellXOffset:Zn,cellYOffset:Qn,accessibilityHeight:Kn.height,onDragEnd:ti,columns:Bn,nonGrowWidth:Fn,drawHeader:Cn,onColumnProposeMove:ee,drawCell:wn,disabledRows:Ci,freezeColumns:Di,lockColumns:R,firstColAccessible:R===0,getCellContent:dr,minColumnWidth:Ut,maxColumnWidth:Wt,searchInputRef:o,showSearch:fn,onSearchClose:pn,highlightRegions:lr,getCellsForSelection:hn,getGroupDetails:pr,headerHeight:Zt,isFocused:Ni,groupHeaderHeight:In?Qt:0,freezeTrailingRows:Je+(on&&qe?.sticky===!0?1:0),hasAppendRow:on,onColumnResize:bn,onColumnResizeEnd:xn,onColumnResizeStart:Sn,onCellFocused:Mi,onColumnMoved:Qr,onDragStart:ei,onHeaderMenuClick:Yr,onItemHovered:ri,isFilling:c?.fillHandle===!0,onMouseMove:Jr,onKeyDown:di,onKeyUp:pe,onMouseDown:Fr,onMouseUp:qr,onDragOverCell:rt,onDrop:it,onSearchResultsChanged:hi,onVisibleRegionChanged:Zr,clientSize:An,rowHeight:Xt,searchResults:le,searchValue:de,onSearchValueChange:ue,rows:tr,scrollRef:u,selection:z,translateX:Kn.tx,translateY:Kn.ty,verticalBorder:Ti,gridRef:$n,getCellRenderer:Nn}),Ei,i!==void 0&&L.createElement(L.Suspense,{fallback:null},L.createElement(Kc,{...i,validateCell:_n,bloom:j,id:si,getCellRenderer:Nn,className:pt?.isSubGrid===!0?`click-outside-ignore`:void 0,provideEditor:Ke,imageEditorOverride:p,onFinishEditing:oi,markdownDivCreateNode:h,isOutsideClick:Ft}))))});ct();var $c=20,el={getAccessibilityString:e=>e.data?.toString()??`false`,kind:I.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>tl(e,e.cell.data,et(e.cell),e.cell.maxSize??$c),onDelete:e=>({...e,data:!1}),onClick:e=>{let{cell:t,posX:n,posY:r,bounds:i,theme:a}=e,{width:o,height:s,x:c,y:l}=i,u=t.maxSize??$c,d=Math.floor(i.y+s/2),f=$t(u,s,a.cellVerticalPadding),p=Zt(Qt(t.contentAlign??`center`,c,o,a.cellHorizontalPadding,f),d,f),m=en(c+n,l+r,p);if(et(t)&&m)return{...t,data:dc(t.data)}},onPaste:(e,t)=>{let n=null;return e.toLowerCase()===`true`?n=!0:e.toLowerCase()===`false`?n=!1:e.toLowerCase()===`indeterminate`&&(n=void 0),n===t.data?void 0:{...t,data:n}}};function tl(e,t,n,r){if(!n&&t===null)return;let{ctx:i,hoverAmount:a,theme:o,rect:s,highlighted:c,hoverX:l,hoverY:u,cell:{contentAlign:d}}=e,{x:f,y:p,width:m,height:h}=s,g=.35,_=n?1-g+g*a:.4;t===null&&(_*=a),_!==0&&(i.globalAlpha=_,Na(i,o,t,f,p,m,h,c,l,u,r,d),i.globalAlpha=1)}St();var nl=xt(`div`)({name:`BubblesOverlayEditorStyle`,class:`gdg-b1ygi5by`,propsAsIs:!1}),rl=e=>{let{bubbles:t}=e;return L.createElement(nl,null,t.map((e,t)=>L.createElement(`div`,{key:t,className:`boe-bubble`},e)),L.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))};ct();var il={getAccessibilityString:e=>un(e.data),kind:I.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((t,n)=>e.measureText(n).width+t+20,0)+2*n.cellHorizontalPadding-4,draw:e=>ol(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return L.createElement(rl,{bubbles:t.data})},onPaste:()=>void 0},al=4;function ol(e,t){let{rect:n,theme:r,ctx:i,highlighted:a}=e,{x:o,y:s,width:c,height:l}=n,u=al,d=o+r.cellHorizontalPadding,f=[];for(let e of t){if(d>o+c)break;let t=Jr(e,i,r.baseFontFull).width;f.push({x:d,width:t}),d+=t+16+u}i.beginPath();for(let e of f)si(i,e.x,s+(l-20)/2,e.width+16,20,r.roundingRadius??20/2);i.fillStyle=a?r.bgBubbleSelected:r.bgBubble,i.fill();for(let[e,n]of f.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[e],n.x+8,s+l/2+Xr(i,r))}St();var sl=xt(`div`)({name:`DrilldownOverlayEditorStyle`,class:`gdg-d4zsq0x`,propsAsIs:!1}),cl=e=>{let{drilldowns:t}=e;return L.createElement(sl,null,t.map((e,t)=>L.createElement(`div`,{key:t,className:`doe-bubble`},e.img!==void 0&&L.createElement(`img`,{src:e.img}),L.createElement(`div`,null,e.text))))};ct();var ll={getAccessibilityString:e=>un(e.data.map(e=>e.text)),kind:I.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((t,n)=>e.measureText(n.text).width+t+20+(n.img===void 0?0:18),0)+2*n.cellHorizontalPadding-4,draw:e=>pl(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return L.createElement(cl,{drilldowns:t.data})},onPaste:()=>void 0},ul=4,dl={};function fl(e,t,n,r){let i=Math.ceil(window.devicePixelRatio),a=n-10,o=n*i,s=r+5,c=r*3,l=(c+10)*i,u=`${e},${t},${i},${n}`;if(dl[u]!==void 0)return{el:dl[u],height:o,width:l,middleWidth:4*i,sideWidth:s*i,padding:5*i,dpr:i};let d=document.createElement(`canvas`),f=d.getContext(`2d`);return f===null?null:(d.width=l,d.height=o,f.scale(i,i),dl[u]=d,f.beginPath(),si(f,5,5,c,a,r),f.shadowColor=`rgba(24, 25, 34, 0.4)`,f.shadowBlur=1,f.fillStyle=e,f.fill(),f.shadowColor=`rgba(24, 25, 34, 0.3)`,f.shadowOffsetY=1,f.shadowBlur=5,f.fillStyle=e,f.fill(),f.shadowOffsetY=0,f.shadowBlur=0,f.shadowBlur=0,f.beginPath(),si(f,5.5,5.5,c,a,r),f.strokeStyle=t,f.lineWidth=1,f.stroke(),{el:d,height:o,width:l,sideWidth:s*i,middleWidth:r*i,padding:5*i,dpr:i})}function pl(e,t){let{rect:n,theme:r,ctx:i,imageLoader:a,col:o,row:s}=e,{x:c,width:l}=n,u=r.baseFontFull,d=ri(i,u),f=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),p=Math.floor(n.y+(n.height-f)/2),m=f-10,h=ul,g=c+r.cellHorizontalPadding,_=r.roundingRadius??6,v=fl(r.bgCell,r.drilldownBorder,f,_),y=[];for(let e of t){if(g>c+l)break;let t=Jr(e.text,i,u).width,n=0;e.img!==void 0&&a.loadOrGetImage(e.img,o,s)!==void 0&&(n=m-8+4);let r=t+n+16;y.push({x:g,width:r}),g+=r+h}if(v!==null){let{el:e,height:t,middleWidth:n,sideWidth:r,width:a,dpr:o,padding:s}=v,c=r/o,l=s/o;for(let o of y){let s=Math.floor(o.x),u=Math.floor(o.width),d=u-(c-l)*2;i.imageSmoothingEnabled=!1,i.drawImage(e,0,0,r,t,s-l,p,c,f),d>0&&i.drawImage(e,r,0,n,t,s+(c-l),p,d,f),i.drawImage(e,a-r,0,r,t,s+u-(c-l),p,c,f),i.imageSmoothingEnabled=!0}}i.beginPath();for(let[e,n]of y.entries()){let c=t[e],l=n.x+8;if(c.img!==void 0){let e=a.loadOrGetImage(c.img,o,s);if(e!==void 0){let t=m-8,n=0,a=0,o=e.width,s=e.height;o>s?(n+=(o-s)/2,o=s):s>o&&(a+=(s-o)/2,s=o),i.beginPath(),si(i,l,p+f/2-t/2,t,t,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(e,n,a,o,s,l,p+f/2-t/2,t,t),i.restore(),l+=t+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(c.text,l,p+f/2+Xr(i,r))}}ct();var ml={getAccessibilityString:e=>e.data.join(`, `),kind:I.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>gl(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??pn;return L.createElement(i,{urls:t.data,canWrite:t.readonly!==!1,onCancel:n,onChange:e=>{n({...t,data:[e]})}})},onPaste:(e,t)=>{e=e.trim();let n=e.split(`,`).map(e=>{try{return new URL(e),e}catch{return}}).filter(e=>e!==void 0);if(!(n.length===t.data.length&&n.every((e,n)=>e===t.data[n])))return{...t,data:n}}},hl=4;function gl(e,t,n,r){let{rect:i,col:a,row:o,theme:s,ctx:c,imageLoader:l}=e,{x:u,y:d,height:f,width:p}=i,m=f-s.cellVerticalPadding*2,h=[],g=0;for(let e=0;e0&&(c.beginPath(),si(c,_,d+s.cellVerticalPadding,t,m,n),c.save(),c.clip()),c.drawImage(e,_,d+s.cellVerticalPadding,t,m),n>0&&c.restore(),_+=t+hl}}vr(),ct();function _l(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}var vl={getAccessibilityString:()=>``,kind:I.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{let{cell:t,col:n,row:r,ctx:i,rect:a,theme:o}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(_l(n,r)*t.skeletonWidthVariability));let c=o.cellHorizontalPadding,l=t.skeletonHeight??Math.min(18,a.height-2*o.cellVerticalPadding);si(i,a.x+c,a.y+(a.height-l)/2,s,l,o.roundingRadius??3),i.fillStyle=fr(o.textDark,.1),i.fill()},onPaste:()=>void 0};St();var yl=xt(`div`)({name:`MarkdownOverlayEditorStyle`,class:`gdg-m1pnx84e`,propsAsIs:!1,vars:{"m1pnx84e-0":[e=>e.targetWidth,`px`]}}),bl=e=>{let{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:a,onFinish:o,validatedSelection:s}=e,c=t.data,l=t.readonly===!0,[u,d]=L.useState(c===``||r),f=L.useCallback(()=>{d(e=>!e)},[]),p=c?`gdg-ml-6`:``;return u?L.createElement(yl,{targetWidth:a.width-20},L.createElement(lr,{autoFocus:!0,highlight:!1,validatedSelection:s,value:c,onKeyDown:e=>{e.key===`Enter`&&e.stopPropagation()},onChange:n}),L.createElement(`div`,{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,onClick:()=>o(t)},L.createElement(nn,null))):L.createElement(yl,{targetWidth:a.width},L.createElement(ir,{contents:c,createNode:i}),!l&&L.createElement(L.Fragment,null,L.createElement(`div`,{className:`spacer`}),L.createElement(`div`,{className:`gdg-edit-icon gdg-edit-hover ${p}`,onClick:f},L.createElement(tn,null))),L.createElement(`textarea`,{className:`gdg-md-edit-textarea gdg-input`,autoFocus:!0}))};ct();var xl={getAccessibilityString:e=>e.data?.toString()??``,kind:I.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:ti,measure:(e,t,n)=>{let r=t.data.split(` -`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>oi(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:``}),provideEditor:()=>e=>{let{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:a,forceEditMode:o,validatedSelection:s}=e;return L.createElement(bl,{onFinish:i,targetRect:r,value:n,validatedSelection:s,onChange:e=>t({...n,data:e.target.value}),forceEditMode:o,createNode:a})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}};ct();var Sl={getAccessibilityString:e=>e.row.toString(),kind:at.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Cl,measure:()=>44,draw:e=>Tl(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{let{bounds:t,cell:n,posX:r,posY:i}=e,{width:a,height:o}=t,s=n.drawHandle?7+(a-7)/2:a/2,c=o/2;if(Math.abs(r-s)<=10&&Math.abs(i-c)<=10)return{...n,checked:!n.checked}},onPaste:()=>void 0};function Cl(e,t){let{ctx:n,theme:r}=e,i=r.markerFontFull,a=t??{};return a?.font!==i&&(n.font=i,a.font=i),a.deprep=wl,n.textAlign=`center`,a}function wl(e){let{ctx:t}=e;t.textAlign=`start`}function Tl(e,t,n,r,i,a){let{ctx:o,rect:s,hoverAmount:c,theme:l}=e,{x:u,y:d,width:f,height:p}=s,m=n?1:r===`checkbox-visible`?.6+.4*c:c;if(r!==`number`&&m>0){o.globalAlpha=m;let e=7*(n?c:1);if(Na(o,l,n,i?u+e:u,d,i?f-e:f,p,!0,void 0,void 0,18,`center`,a),i){o.globalAlpha=c,o.beginPath();for(let e of[3,6])for(let t of[-5,-1,3])o.rect(u+e,d+p/2+t,2,2);o.fillStyle=l.textLight,o.fill(),o.beginPath()}o.globalAlpha=1}if(r===`number`||r===`both`&&!n){let e=t.toString(),n=l.markerFontFull,i=u+f/2;r===`both`&&c!==0&&(o.globalAlpha=1-c),o.fillStyle=l.textLight,o.font=n,o.fillText(e,i,d+p/2+Xr(o,n)),c!==0&&(o.globalAlpha=1)}}ct();var El={getAccessibilityString:()=>``,kind:at.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Dl(e,e.cell.hint,e.cell.icon),onPaste:()=>void 0};function Dl(e,t,n){let{ctx:r,rect:i,hoverAmount:a,theme:o,spriteManager:s}=e,{x:c,y:l,width:u,height:d}=i;r.beginPath(),r.globalAlpha=a,r.rect(c+1,l+1,u,d-2),r.fillStyle=o.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();let f=t!==``,p=0;if(n!==void 0){let e=d-8,t=c+8/2,i=l+8/2;s.drawSprite(n,`normal`,r,t,i,e,o,f?1:a),p=e}else{p=24;let e=f?12:a*12,t=f?0:(1-a)*12*.5,n=o.cellHorizontalPadding+4;e>0&&(r.moveTo(c+n+t,l+d/2),r.lineTo(c+n+t+e,l+d/2),r.moveTo(c+n+t+e*.5,l+d/2-e*.5),r.lineTo(c+n+t+e*.5,l+d/2+e*.5),r.lineWidth=2,r.strokeStyle=o.bgIconHeader,r.lineCap=`round`,r.stroke())}r.fillStyle=o.textMedium,r.fillText(t,p+c+o.cellHorizontalPadding+.5,l+d/2+Xr(r,o)),r.beginPath()}var Ol,kl=o((()=>{St(),Ol=xt(`div`)({name:`NumberOverlayEditorStyle`,class:`gdg-n15fjm3e`,propsAsIs:!1})}));function Al(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i=s?i+=Wl(`0`,o-s):i=(i.substring(0,o)||`0`)+`.`+i.substring(o),n+i}function Kl(e,t,n){if([``,`-`].indexOf(e)!==-1)return e;var r=(e.indexOf(`.`)!==-1||n)&&t,i=Vl(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,c=parseFloat(`0.`+(o||`0`)),l=(o.length<=t?`0.`+o:c.toFixed(t)).split(`.`),u=a;a&&Number(l[0])&&(u=a.split(``).reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},l[0]));var d=Ul(l[1]||``,t,n),f=s?`-`:``,p=r?`.`:``;return``+f+u+p+d}function ql(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move(`character`,t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function Jl(e,t,n){return Math.min(Math.max(e,t),n)}function Yl(e){return Math.max(e.selectionStart,e.selectionEnd)}function Xl(){return typeof navigator<`u`&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Zl(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:``}}function Ql(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function $l(e,t,n,r,i,a,o){o===void 0&&(o=Ql);var s=i.findIndex(function(e){return e}),c=e.slice(0,s);!t&&!n.startsWith(c)&&(t=c,n=c+n,r+=c.length);for(var l=n.length,u=e.length,d={},f=Array(l),p=0;p0&&f[g]===-1;)g--;var v=g===-1||f[g]===-1?0:f[g]+1;return v>_?_:r-v<_-r?v:_}function eu(e,t,n,r){var i=e.length;if(t=Jl(t,0,i),r===`left`){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function tu(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nC.length-o.length||SD||d>e.length-o.length)&&(E=d),e=e.substring(0,E),e=cu(y?`-`+e:e,i),e=(e.match(lu(m,!0))||[]).join(``);var O=e.indexOf(m);e=e.replace(new RegExp(Ll(m),`g`),function(e,t){return t===O?`.`:``});var k=Vl(e,i),A=k.beforeDecimal,j=k.afterDecimal,M=k.addNegation;return l.end-l.starte.map(e=>e.rawValue).join(` `)).join(` `)??``,o=t(e,a,i,void 0);o!==void 0&&l.push(o);break}if(n===void 0){if(r===void 0)return;n=fc(r)}if(ke===!1||typeof ke==`function`&&ke?.([a[0]-R,a[1]],n.map(e=>e.map(e=>e.rawValue?.toString()??``)))!==!0)return;for(let[e,r]of n.entries()){if(e+c>=y)break;for(let[n,i]of r.entries()){let r=[n+s,e+c],[a,o]=r;if(a>=Bn.length||o>=tr)continue;let u=t(dr(r),r,i.rawValue,i.formatted);u!==void 0&&l.push(u)}}}while(!1);nr(l),$n.current?.damage(l.map(e=>({cell:e.location})))}},[O,Nn,dr,z,nn.paste,Bn.length,nr,tr,ke,R,y]);qt(`paste`,pi,f,!1,!0);let mi=L.useCallback(async(e,t)=>{if(!nn.copy)return;let n=t===!0||u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0,r=z.columns,i=z.rows,a=(t,n)=>{pc(Ae?[n.map(e=>({kind:I.Text,data:v[e].title,displayData:v[e].title,allowOverlay:!1})),...t]:t,n,e)};if(n&&hn!==void 0){if(z.current!==void 0){let e=hn(z.current.range,mn.current.signal);typeof e!=`object`&&(e=await e()),a(e,(0,Es.default)(z.current.range.x-R,z.current.range.x+z.current.range.width-R))}else if(i!==void 0&&i.length>0){let e=[...i].map(e=>{let t=hn({x:R,y:e,width:v.length,height:1},mn.current.signal);return typeof t==`object`?t[0]:t().then(e=>e[0])});e.some(e=>e instanceof Promise)?a(await Promise.all(e),(0,Es.default)(v.length)):a(e,(0,Es.default)(v.length))}else if(r.length>0){let e=[],t=[];for(let n of r){let r=hn({x:n,y:0,width:1,height:y},mn.current.signal);typeof r!=`object`&&(r=await r()),e.push(r),t.push(n-R)}e.length===1?a(e[0],t):a(e.reduce((e,t)=>e.map((e,n)=>[...e,...t[n]])),t)}}},[v,hn,z,nn.copy,R,y,Ae]);qt(`copy`,mi,f,!1,!1),qt(`cut`,L.useCallback(async e=>{if(nn.cut&&(u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0)&&(await mi(e),z.current!==void 0)){let e={current:{cell:z.current.cell,range:z.current.range,rangeStack:[]},rows:st.empty(),columns:st.empty()},t=Tn?.(e);if(t===!1||(e=t===!0?e:t,e.current===void 0))return;ci(e.current.range)}},[ci,z,nn.cut,mi,Tn]),f,!1,!1);let hi=L.useCallback((e,t)=>{if(ce!==void 0){R!==0&&(e=e.map(e=>[e[0]-R,e[1]])),ce(e,t);return}if(e.length===0||t===-1)return;let[n,r]=e[t];d.current!==void 0&&d.current[0]===n&&d.current[1]===r||(d.current=[n,r],ai(n,r,!1,!1))},[ce,R,ai]),[gi,_i]=Ve?.current?.cell??[],vi=L.useRef(_r);vi.current=_r,L.useLayoutEffect(()=>{!Gn.current&&gi!==void 0&&_i!==void 0&&(gi!==vn.current?.current?.cell[0]||_i!==vn.current?.current?.cell[1])&&vi.current(gi,_i),Gn.current=!1},[gi,_i]);let Si=z.current!==void 0&&(z.current.cell[0]>=Bn.length||z.current.cell[1]>=tr);L.useLayoutEffect(()=>{Si&&yn(Zc,!1)},[Si,yn]);let Ci=L.useMemo(()=>on===!0&&qe?.tint===!0?st.fromSingleSelection(tr-1):st.empty(),[tr,on,qe?.tint]),Ti=L.useCallback(e=>typeof nt==`boolean`?nt:nt?.(e-R)??!0,[R,nt]),Ei=L.useMemo(()=>{if(Ir===void 0||s.current===null)return null;let{bounds:e,group:t}=Ir,n=s.current.getBoundingClientRect();return L.createElement(Js,{bounds:e,group:t,canvasBounds:n,onClose:()=>Lr(void 0),onFinish:e=>{Lr(void 0),ae?.(t,e)}})},[ae,Ir]),Di=Math.min(Bn.length,je+ +!!an);L.useImperativeHandle(t,()=>({appendRow:(e,t)=>xr(e+R,t),updateCells:e=>(R!==0&&(e=e.map(e=>({cell:[e.cell[0]+R,e.cell[1]]}))),$n.current?.damage(e)),getBounds:(e,t)=>{if(!(s?.current===null||u?.current===null)){if(e===void 0&&t===void 0){let e=s.current.getBoundingClientRect(),t=e.width/u.current.clientWidth;return{x:e.x-u.current.scrollLeft*t,y:e.y-u.current.scrollTop*t,width:u.current.scrollWidth*t,height:u.current.scrollHeight*t}}return $n.current?.getBounds((e??0)+R,t)}},focus:()=>$n.current?.focus(),emit:async e=>{switch(e){case`delete`:di({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!1,key:`Delete`,keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`fill-right`:di({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!0,key:`r`,keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`fill-down`:di({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!0,key:`d`,keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`copy`:await mi(void 0,!0);break;case`paste`:await pi();break}},scrollTo:_r,remeasureColumns:e=>{for(let t of e)Vr(t+R)}}),[xr,Vr,mi,di,pi,R,_r]);let[Ai,ji]=Xr??[],Mi=L.useCallback(e=>{let[t,n]=e;if(n===-1){xe!==`none`&&(On(st.fromSingleSelection(t),void 0,!1),er());return}Ai===t&&ji===n||(En({cell:e,range:{x:t,y:n,width:1,height:1}},!0,!1,`keyboard-nav`),_r(t,n))},[xe,er,_r,Ai,ji,En,On]),[Ni,Pi]=L.useState(!1),Fi=L.useRef((0,Kt.default)(e=>{Pi(e)},5)),Ii=L.useCallback(()=>{Fi.current(!0),z.current===void 0&&z.columns.length===0&&z.rows.length===0&&c===void 0&&En({cell:[R,Qn],range:{x:R,y:Qn,width:1,height:1}},!0,!1,`keyboard-select`)},[Qn,z,c,R,En]),Li=L.useCallback(()=>{Fi.current(!1)},[]),[Ri,zi]=L.useMemo(()=>{let e,t=pt?.scrollbarWidthOverride??sn(),n=y+ +!!on;if(typeof Xt==`number`)e=Ln+n*Xt;else{let t=0,r=Math.min(n,10);for(let e=0;et.width+e,0)+t;return[`${Math.min(1e5,r)}px`,`${Math.min(1e5,e)}px`]},[Bn,pt?.scrollbarWidthOverride,Xt,y,on,Ln]),Bi=L.useMemo(()=>yi(kn),[kn]);return L.createElement(wi.Provider,{value:kn},L.createElement(gc,{style:Bi,className:P,inWidth:g??Ri,inHeight:_??zi},L.createElement(Us,{fillHandle:dt,drawFocusRing:ft,experimental:pt,fixedShadowX:mt,fixedShadowY:ht,getRowThemeOverride:m,headerIcons:gt,imageWindowLoader:_t,initialSize:vt,isDraggable:yt,onDragLeave:bt,onRowMoved:xt,overscrollX:en,overscrollY:tn,preventDiagonalScrolling:wt,rightElement:Tt,rightElementProps:Et,smoothScrollX:Ot,smoothScrollY:kt,className:P,enableGroups:In,onCanvasFocused:Ii,onCanvasBlur:Li,canvasRef:s,onContextMenu:fi,theme:kn,cellXOffset:Zn,cellYOffset:Qn,accessibilityHeight:Kn.height,onDragEnd:ti,columns:Bn,nonGrowWidth:Fn,drawHeader:Cn,onColumnProposeMove:ee,drawCell:wn,disabledRows:Ci,freezeColumns:Di,lockColumns:R,firstColAccessible:R===0,getCellContent:dr,minColumnWidth:Ut,maxColumnWidth:Wt,searchInputRef:o,showSearch:fn,onSearchClose:pn,highlightRegions:lr,getCellsForSelection:hn,getGroupDetails:pr,headerHeight:Zt,isFocused:Ni,groupHeaderHeight:In?Qt:0,freezeTrailingRows:Je+(on&&qe?.sticky===!0?1:0),hasAppendRow:on,onColumnResize:bn,onColumnResizeEnd:xn,onColumnResizeStart:Sn,onCellFocused:Mi,onColumnMoved:Qr,onDragStart:ei,onHeaderMenuClick:Yr,onItemHovered:ri,isFilling:c?.fillHandle===!0,onMouseMove:Jr,onKeyDown:di,onKeyUp:pe,onMouseDown:Fr,onMouseUp:qr,onDragOverCell:rt,onDrop:it,onSearchResultsChanged:hi,onVisibleRegionChanged:Zr,clientSize:An,rowHeight:Xt,searchResults:le,searchValue:de,onSearchValueChange:ue,rows:tr,scrollRef:u,selection:z,translateX:Kn.tx,translateY:Kn.ty,verticalBorder:Ti,gridRef:$n,getCellRenderer:Nn}),Ei,i!==void 0&&L.createElement(L.Suspense,{fallback:null},L.createElement(Kc,{...i,validateCell:_n,bloom:j,id:si,getCellRenderer:Nn,className:pt?.isSubGrid===!0?`click-outside-ignore`:void 0,provideEditor:Ke,imageEditorOverride:p,onFinishEditing:oi,markdownDivCreateNode:h,isOutsideClick:Ft}))))});ct();var $c=20,el={getAccessibilityString:e=>e.data?.toString()??`false`,kind:I.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>tl(e,e.cell.data,et(e.cell),e.cell.maxSize??$c),onDelete:e=>({...e,data:!1}),onClick:e=>{let{cell:t,posX:n,posY:r,bounds:i,theme:a}=e,{width:o,height:s,x:c,y:l}=i,u=t.maxSize??$c,d=Math.floor(i.y+s/2),f=$t(u,s,a.cellVerticalPadding),p=Zt(Qt(t.contentAlign??`center`,c,o,a.cellHorizontalPadding,f),d,f),m=en(c+n,l+r,p);if(et(t)&&m)return{...t,data:mc(t.data)}},onPaste:(e,t)=>{let n=null;return e.toLowerCase()===`true`?n=!0:e.toLowerCase()===`false`?n=!1:e.toLowerCase()===`indeterminate`&&(n=void 0),n===t.data?void 0:{...t,data:n}}};function tl(e,t,n,r){if(!n&&t===null)return;let{ctx:i,hoverAmount:a,theme:o,rect:s,highlighted:c,hoverX:l,hoverY:u,cell:{contentAlign:d}}=e,{x:f,y:p,width:m,height:h}=s,g=.35,_=n?1-g+g*a:.4;t===null&&(_*=a),_!==0&&(i.globalAlpha=_,Pa(i,o,t,f,p,m,h,c,l,u,r,d),i.globalAlpha=1)}St();var nl=xt(`div`)({name:`BubblesOverlayEditorStyle`,class:`gdg-b1ygi5by`,propsAsIs:!1}),rl=e=>{let{bubbles:t}=e;return L.createElement(nl,null,t.map((e,t)=>L.createElement(`div`,{key:t,className:`boe-bubble`},e)),L.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))};ct();var il={getAccessibilityString:e=>un(e.data),kind:I.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((t,n)=>e.measureText(n).width+t+20,0)+2*n.cellHorizontalPadding-4,draw:e=>ol(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return L.createElement(rl,{bubbles:t.data})},onPaste:()=>void 0},al=4;function ol(e,t){let{rect:n,theme:r,ctx:i,highlighted:a}=e,{x:o,y:s,width:c,height:l}=n,u=al,d=o+r.cellHorizontalPadding,f=[];for(let e of t){if(d>o+c)break;let t=Jr(e,i,r.baseFontFull).width;f.push({x:d,width:t}),d+=t+16+u}i.beginPath();for(let e of f)si(i,e.x,s+(l-20)/2,e.width+16,20,r.roundingRadius??20/2);i.fillStyle=a?r.bgBubbleSelected:r.bgBubble,i.fill();for(let[e,n]of f.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[e],n.x+8,s+l/2+Xr(i,r))}St();var sl=xt(`div`)({name:`DrilldownOverlayEditorStyle`,class:`gdg-d4zsq0x`,propsAsIs:!1}),cl=e=>{let{drilldowns:t}=e;return L.createElement(sl,null,t.map((e,t)=>L.createElement(`div`,{key:t,className:`doe-bubble`},e.img!==void 0&&L.createElement(`img`,{src:e.img}),L.createElement(`div`,null,e.text))))};ct();var ll={getAccessibilityString:e=>un(e.data.map(e=>e.text)),kind:I.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((t,n)=>e.measureText(n.text).width+t+20+(n.img===void 0?0:18),0)+2*n.cellHorizontalPadding-4,draw:e=>pl(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return L.createElement(cl,{drilldowns:t.data})},onPaste:()=>void 0},ul=4,dl={};function fl(e,t,n,r){let i=Math.ceil(window.devicePixelRatio),a=n-10,o=n*i,s=r+5,c=r*3,l=(c+10)*i,u=`${e},${t},${i},${n}`;if(dl[u]!==void 0)return{el:dl[u],height:o,width:l,middleWidth:4*i,sideWidth:s*i,padding:5*i,dpr:i};let d=document.createElement(`canvas`),f=d.getContext(`2d`);return f===null?null:(d.width=l,d.height=o,f.scale(i,i),dl[u]=d,f.beginPath(),si(f,5,5,c,a,r),f.shadowColor=`rgba(24, 25, 34, 0.4)`,f.shadowBlur=1,f.fillStyle=e,f.fill(),f.shadowColor=`rgba(24, 25, 34, 0.3)`,f.shadowOffsetY=1,f.shadowBlur=5,f.fillStyle=e,f.fill(),f.shadowOffsetY=0,f.shadowBlur=0,f.shadowBlur=0,f.beginPath(),si(f,5.5,5.5,c,a,r),f.strokeStyle=t,f.lineWidth=1,f.stroke(),{el:d,height:o,width:l,sideWidth:s*i,middleWidth:r*i,padding:5*i,dpr:i})}function pl(e,t){let{rect:n,theme:r,ctx:i,imageLoader:a,col:o,row:s}=e,{x:c,width:l}=n,u=r.baseFontFull,d=ri(i,u),f=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),p=Math.floor(n.y+(n.height-f)/2),m=f-10,h=ul,g=c+r.cellHorizontalPadding,_=r.roundingRadius??6,v=fl(r.bgCell,r.drilldownBorder,f,_),y=[];for(let e of t){if(g>c+l)break;let t=Jr(e.text,i,u).width,n=0;e.img!==void 0&&a.loadOrGetImage(e.img,o,s)!==void 0&&(n=m-8+4);let r=t+n+16;y.push({x:g,width:r}),g+=r+h}if(v!==null){let{el:e,height:t,middleWidth:n,sideWidth:r,width:a,dpr:o,padding:s}=v,c=r/o,l=s/o;for(let o of y){let s=Math.floor(o.x),u=Math.floor(o.width),d=u-(c-l)*2;i.imageSmoothingEnabled=!1,i.drawImage(e,0,0,r,t,s-l,p,c,f),d>0&&i.drawImage(e,r,0,n,t,s+(c-l),p,d,f),i.drawImage(e,a-r,0,r,t,s+u-(c-l),p,c,f),i.imageSmoothingEnabled=!0}}i.beginPath();for(let[e,n]of y.entries()){let c=t[e],l=n.x+8;if(c.img!==void 0){let e=a.loadOrGetImage(c.img,o,s);if(e!==void 0){let t=m-8,n=0,a=0,o=e.width,s=e.height;o>s?(n+=(o-s)/2,o=s):s>o&&(a+=(s-o)/2,s=o),i.beginPath(),si(i,l,p+f/2-t/2,t,t,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(e,n,a,o,s,l,p+f/2-t/2,t,t),i.restore(),l+=t+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(c.text,l,p+f/2+Xr(i,r))}}ct();var ml={getAccessibilityString:e=>e.data.join(`, `),kind:I.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>gl(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??pn;return L.createElement(i,{urls:t.data,canWrite:t.readonly!==!1,onCancel:n,onChange:e=>{n({...t,data:[e]})}})},onPaste:(e,t)=>{e=e.trim();let n=e.split(`,`).map(e=>{try{return new URL(e),e}catch{return}}).filter(e=>e!==void 0);if(!(n.length===t.data.length&&n.every((e,n)=>e===t.data[n])))return{...t,data:n}}},hl=4;function gl(e,t,n,r){let{rect:i,col:a,row:o,theme:s,ctx:c,imageLoader:l}=e,{x:u,y:d,height:f,width:p}=i,m=f-s.cellVerticalPadding*2,h=[],g=0;for(let e=0;e0&&(c.beginPath(),si(c,_,d+s.cellVerticalPadding,t,m,n),c.save(),c.clip()),c.drawImage(e,_,d+s.cellVerticalPadding,t,m),n>0&&c.restore(),_+=t+hl}}vr(),ct();function _l(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}var vl={getAccessibilityString:()=>``,kind:I.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{let{cell:t,col:n,row:r,ctx:i,rect:a,theme:o}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(_l(n,r)*t.skeletonWidthVariability));let c=o.cellHorizontalPadding,l=t.skeletonHeight??Math.min(18,a.height-2*o.cellVerticalPadding);si(i,a.x+c,a.y+(a.height-l)/2,s,l,o.roundingRadius??3),i.fillStyle=fr(o.textDark,.1),i.fill()},onPaste:()=>void 0};St();var yl=xt(`div`)({name:`MarkdownOverlayEditorStyle`,class:`gdg-m1pnx84e`,propsAsIs:!1,vars:{"m1pnx84e-0":[e=>e.targetWidth,`px`]}}),bl=e=>{let{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:a,onFinish:o,validatedSelection:s}=e,c=t.data,l=t.readonly===!0,[u,d]=L.useState(c===``||r),f=L.useCallback(()=>{d(e=>!e)},[]),p=c?`gdg-ml-6`:``;return u?L.createElement(yl,{targetWidth:a.width-20},L.createElement(lr,{autoFocus:!0,highlight:!1,validatedSelection:s,value:c,onKeyDown:e=>{e.key===`Enter`&&e.stopPropagation()},onChange:n}),L.createElement(`div`,{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,onClick:()=>o(t)},L.createElement(nn,null))):L.createElement(yl,{targetWidth:a.width},L.createElement(ir,{contents:c,createNode:i}),!l&&L.createElement(L.Fragment,null,L.createElement(`div`,{className:`spacer`}),L.createElement(`div`,{className:`gdg-edit-icon gdg-edit-hover ${p}`,onClick:f},L.createElement(tn,null))),L.createElement(`textarea`,{className:`gdg-md-edit-textarea gdg-input`,autoFocus:!0}))};ct();var xl={getAccessibilityString:e=>e.data?.toString()??``,kind:I.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:ti,measure:(e,t,n)=>{let r=t.data.split(` +`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>oi(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:``}),provideEditor:()=>e=>{let{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:a,forceEditMode:o,validatedSelection:s}=e;return L.createElement(bl,{onFinish:i,targetRect:r,value:n,validatedSelection:s,onChange:e=>t({...n,data:e.target.value}),forceEditMode:o,createNode:a})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}};ct();var Sl={getAccessibilityString:e=>e.row.toString(),kind:at.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Cl,measure:()=>44,draw:e=>Tl(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{let{bounds:t,cell:n,posX:r,posY:i}=e,{width:a,height:o}=t,s=n.drawHandle?7+(a-7)/2:a/2,c=o/2;if(Math.abs(r-s)<=10&&Math.abs(i-c)<=10)return{...n,checked:!n.checked}},onPaste:()=>void 0};function Cl(e,t){let{ctx:n,theme:r}=e,i=r.markerFontFull,a=t??{};return a?.font!==i&&(n.font=i,a.font=i),a.deprep=wl,n.textAlign=`center`,a}function wl(e){let{ctx:t}=e;t.textAlign=`start`}function Tl(e,t,n,r,i,a){let{ctx:o,rect:s,hoverAmount:c,theme:l}=e,{x:u,y:d,width:f,height:p}=s,m=n?1:r===`checkbox-visible`?.6+.4*c:c;if(r!==`number`&&m>0){o.globalAlpha=m;let e=7*(n?c:1);if(Pa(o,l,n,i?u+e:u,d,i?f-e:f,p,!0,void 0,void 0,18,`center`,a),i){o.globalAlpha=c,o.beginPath();for(let e of[3,6])for(let t of[-5,-1,3])o.rect(u+e,d+p/2+t,2,2);o.fillStyle=l.textLight,o.fill(),o.beginPath()}o.globalAlpha=1}if(r===`number`||r===`both`&&!n){let e=t.toString(),n=l.markerFontFull,i=u+f/2;r===`both`&&c!==0&&(o.globalAlpha=1-c),o.fillStyle=l.textLight,o.font=n,o.fillText(e,i,d+p/2+Xr(o,n)),c!==0&&(o.globalAlpha=1)}}ct();var El={getAccessibilityString:()=>``,kind:at.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Dl(e,e.cell.hint,e.cell.icon),onPaste:()=>void 0};function Dl(e,t,n){let{ctx:r,rect:i,hoverAmount:a,theme:o,spriteManager:s}=e,{x:c,y:l,width:u,height:d}=i;r.beginPath(),r.globalAlpha=a,r.rect(c+1,l+1,u,d-2),r.fillStyle=o.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();let f=t!==``,p=0;if(n!==void 0){let e=d-8,t=c+8/2,i=l+8/2;s.drawSprite(n,`normal`,r,t,i,e,o,f?1:a),p=e}else{p=24;let e=f?12:a*12,t=f?0:(1-a)*12*.5,n=o.cellHorizontalPadding+4;e>0&&(r.moveTo(c+n+t,l+d/2),r.lineTo(c+n+t+e,l+d/2),r.moveTo(c+n+t+e*.5,l+d/2-e*.5),r.lineTo(c+n+t+e*.5,l+d/2+e*.5),r.lineWidth=2,r.strokeStyle=o.bgIconHeader,r.lineCap=`round`,r.stroke())}r.fillStyle=o.textMedium,r.fillText(t,p+c+o.cellHorizontalPadding+.5,l+d/2+Xr(r,o)),r.beginPath()}var Ol,kl=o((()=>{St(),Ol=xt(`div`)({name:`NumberOverlayEditorStyle`,class:`gdg-n15fjm3e`,propsAsIs:!1})}));function Al(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i=s?i+=Ul(`0`,o-s):i=(i.substring(0,o)||`0`)+`.`+i.substring(o),n+i}function Gl(e,t,n){if([``,`-`].indexOf(e)!==-1)return e;var r=(e.indexOf(`.`)!==-1||n)&&t,i=Vl(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,c=parseFloat(`0.`+(o||`0`)),l=(o.length<=t?`0.`+o:c.toFixed(t)).split(`.`),u=a;a&&Number(l[0])&&(u=a.split(``).reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},l[0]));var d=Hl(l[1]||``,t,n),f=s?`-`:``,p=r?`.`:``;return``+f+u+p+d}function Kl(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move(`character`,t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function ql(e,t,n){return Math.min(Math.max(e,t),n)}function Jl(e){return Math.max(e.selectionStart,e.selectionEnd)}function Yl(){return typeof navigator<`u`&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Xl(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:``}}function Zl(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function Ql(e,t,n,r,i,a,o){o===void 0&&(o=Zl);var s=i.findIndex(function(e){return e}),c=e.slice(0,s);!t&&!n.startsWith(c)&&(t=c,n=c+n,r+=c.length);for(var l=n.length,u=e.length,d={},f=Array(l),p=0;p0&&f[g]===-1;)g--;var v=g===-1||f[g]===-1?0:f[g]+1;return v>_?_:r-v<_-r?v:_}function $l(e,t,n,r){var i=e.length;if(t=ql(t,0,i),r===`left`){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function eu(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nC.length-o.length||SD||d>e.length-o.length)&&(E=d),e=e.substring(0,E),e=su(y?`-`+e:e,i),e=(e.match(cu(m,!0))||[]).join(``);var O=e.indexOf(m);e=e.replace(new RegExp(Ll(m),`g`),function(e,t){return t===O?`.`:``});var k=Vl(e,i),A=k.beforeDecimal,j=k.afterDecimal,M=k.addNegation;return l.end-l.startAn error Prefix can't start with '-' when allowNegative is true. prefix: `+i+` allowNegative: `+a+` - `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function mu(e){e=pu(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=jl);var a=e.onBlur;a===void 0&&(a=jl);var o=e.thousandSeparator,s=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l=``);var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,p=e.onValueChange,m=Al(e,[`decimalSeparator`,`allowedDecimalSeparators`,`thousandsGroupStyle`,`suffix`,`allowNegative`,`allowLeadingZeros`,`onKeyDown`,`onBlur`,`thousandSeparator`,`decimalScale`,`fixedDecimalScale`,`prefix`,`defaultValue`,`value`,`valueIsNumericString`,`onValueChange`]),h=su(e),g=h.decimalSeparator,_=h.allowedDecimalSeparators,v=function(t){return ou(t,e)},y=function(t,n){return du(t,n,e)},b=Pl(d)?u:d,x=f??uu(b,l,t);Pl(d)?Pl(u)||(x||=typeof u==`number`):x||=typeof d==`number`;var S=function(e){return Il(e)?e:(typeof e==`number`&&(e=Gl(e)),x&&typeof s==`number`?Kl(e,s,!!c):e)},C=nu(S(d),S(u),!!x,v,y,p),w=C[0],T=w.numAsString,E=w.formattedValue,D=C[1];return Object.assign(Object.assign({},m),{value:E,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===g||Nl(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,i=e.currentValueIndex,a=e.formattedValueIndex,o=t[i],u=r[a],f=vu(n,t).to,p=function(e){return y(e).indexOf(`.`)+l.length};return d===0&&c&&s&&t[f.start]===g&&p(t)a?!1:i>=f.start&&i{gu=u(f()),(function(e){e.event=`event`,e.props=`prop`})(_u||={}),vu=Ml(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),yu=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}}})),xu=c({default:()=>Tu});function Su(){return Intl.NumberFormat()?.formatToParts(1.1)?.find(e=>e.type===`decimal`)?.value??`.`}function Cu(){return Su()===`.`?`,`:`.`}var wu,Tu,Eu=o((()=>{wu=u(f(),1),kl(),bu(),Tu=e=>{let{value:t,onChange:n,disabled:r,highlight:i,validatedSelection:a,fixedDecimals:o,allowNegative:s,thousandSeparator:c,decimalSeparator:l}=e,u=wu.useRef();return wu.useLayoutEffect(()=>{if(a!==void 0){let e=typeof a==`number`?[a,null]:a;u.current?.setSelectionRange(e[0],e[1])}},[a]),wu.createElement(Ol,null,wu.createElement(hu,{autoFocus:!0,getInputRef:u,className:`gdg-input`,onFocus:e=>e.target.setSelectionRange(i?0:e.target.value.length,e.target.value.length),disabled:r===!0,decimalScale:o,allowNegative:s,thousandSeparator:c??Cu(),decimalSeparator:l??Su(),value:Object.is(t,-0)?`-`:t??``,onValueChange:n}))}}));ct();var Du=L.lazy(async()=>await Dc(()=>Promise.resolve().then(()=>(Eu(),xu)),void 0,import.meta.url)),Ou={getAccessibilityString:e=>e.data?.toString()??``,kind:I.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:ti,draw:e=>oi(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return L.createElement(L.Suspense,{fallback:null},L.createElement(Du,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:e=>n({...r,data:Number.isNaN(e.floatValue??0)?0:e.floatValue})}))},onPaste:(e,t,n)=>{let r=typeof n.rawValue==`number`?n.rawValue:Number.parseFloat(typeof n.rawValue==`string`?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}};ct();var ku={getAccessibilityString:()=>``,measure:()=>108,kind:I.Protected,needsHover:!1,needsHoverPosition:!1,draw:Au,onPaste:()=>void 0};function Au(e){let{ctx:t,theme:n,rect:r}=e,{x:i,y:a,height:o}=r;t.beginPath();let s=2.5,c=i+n.cellHorizontalPadding+s,l=a+o/2,u=Math.cos(Xt(30))*s,d=Math.sin(Xt(30))*s;for(let e=0;e<12;e++)t.moveTo(c,l-s),t.lineTo(c,l+s),t.moveTo(c+u,l-d),t.lineTo(c-u,l+d),t.moveTo(c-u,l-d),t.lineTo(c+u,l+d),c+=8;t.lineWidth=1.1,t.lineCap=`square`,t.strokeStyle=n.textLight,t.stroke()}ct();var ju={getAccessibilityString:e=>e.data?.toString()??``,kind:I.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>ti(e,t,e.theme.textLight),draw:e=>oi(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return L.createElement(lr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:e=>n({...r,data:e.target.value})})},onPaste:()=>void 0};ct(),vr();var ree={getAccessibilityString:e=>e.data?.toString()??``,kind:I.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:ti,useLabel:!0,draw:e=>{let{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:a,theme:o,overrideCursor:s}=e,{displayData:c,contentAlign:l,hoverEffect:u,allowWrapping:d}=t;if(u===!0&&n>0){i.textBaseline=`alphabetic`;let e=o.cellHorizontalPadding,t=o.cellVerticalPadding,r=Jr(c,i,o.baseFontFull,`alphabetic`),l=a.height-t,u=Math.min(l,r.actualBoundingBoxAscent*2.5);i.beginPath(),si(i,a.x+e/2,a.y+(a.height-u)/2+1,r.width+e*3,u-1,o.roundingRadius??4),i.globalAlpha=n,i.fillStyle=fr(o.textDark,.1),i.fill(),i.globalAlpha=1,i.fillStyle=o.textDark,i.textBaseline=`middle`,s?.(`text`)}oi(e,c,l,d,r)},measure:(e,t,n)=>{let r=t.displayData.split(` -`,t.allowWrapping===!0?void 0:1),i=0;for(let t of r)i=Math.max(i,e.measureText(t).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:``}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:n,onChange:r,value:i,validatedSelection:a}=t;return L.createElement(lr,{style:e.allowWrapping===!0?{padding:`3px 8.5px`}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:a,onChange:e=>r({...i,data:e.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}};St();var Mu=xt(`div`)({name:`UriOverlayEditorStyle`,class:`gdg-u1rrojo`,propsAsIs:!1}),iee=e=>{let{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:a,preview:o}=e,[s,c]=L.useState(!i&&(t===``||r)),l=L.useCallback(()=>{c(!0)},[]);return s?L.createElement(lr,{validatedSelection:a,highlight:!0,autoFocus:!0,value:t,onChange:n}):L.createElement(Mu,null,L.createElement(`a`,{className:`gdg-link-area`,href:t,target:`_blank`,rel:`noopener noreferrer`},o),!i&&L.createElement(`div`,{className:`gdg-edit-icon`,onClick:l},L.createElement(tn,null)),L.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))};ct();function aee(e,t,n,r){let i=n.cellHorizontalPadding,a=t.height/2-e.actualBoundingBoxAscent/2,o=e.width,s=e.actualBoundingBoxAscent;return r===`right`?i=t.width-o-n.cellHorizontalPadding:r===`center`&&(i=t.width/2-o/2),{x:i,y:a,width:o,height:s}}var oee=[Sl,El,el,il,ll,ml,vl,xl,Ou,ku,ju,ree,{getAccessibilityString:e=>e.data?.toString()??``,kind:I.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:ti,draw:e=>{let{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:a,rect:o,ctx:s}=e,c=t.displayData??t.data,l=t.hoverEffect===!0;if(r!==void 0&&l&&i!==void 0&&a!==void 0){let{x:l,y:u,width:d,height:f}=aee(Jr(c,s,n.baseFontFull),o,n,t.contentAlign);if(i>=l-4&&i<=l-4+d+8&&a>=u-4&&a<=u-4+f+8){let i=Xr(s,n.baseFontFull);r(`pointer`);let a=u-i;s.beginPath(),s.moveTo(o.x+l,Math.floor(o.y+a+f+5)+.5),s.lineTo(o.x+l+d,Math.floor(o.y+a+f+5)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,oi({...e,rect:{...o,x:o.x-1}},c,t.contentAlign),oi({...e,rect:{...o,x:o.x-2}},c,t.contentAlign),oi({...e,rect:{...o,x:o.x+1}},c,t.contentAlign),oi({...e,rect:{...o,x:o.x+2}},c,t.contentAlign),s.restore()}}s.fillStyle=l?n.linkColor:n.textDark,oi(e,c,t.contentAlign)},onClick:e=>{let{cell:t,bounds:n,posX:r,posY:i,theme:a}=e,o=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;let s=Yr(o,a.baseFontFull);if(s===void 0)return;let c=aee(s,n,a,t.contentAlign);ba({x:c.x-4,y:c.y-4,width:c.width+8,height:c.height+8},r,i)&&t.onClickUri(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:``}),provideEditor:e=>t=>{let{onChange:n,value:r,forceEditMode:i,validatedSelection:a}=t;return L.createElement(iee,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:a,readonly:r.readonly===!0,onChange:e=>n({...r,data:e.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}}],see=u(s(((e,t)=>{var n=Gt(),r=re(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))(),1),Nu=[],cee=class extends gi{imageLoaded=()=>void 0;loadedLocations=[];cache={};setCallback(e){this.imageLoaded=e}sendLoaded=(0,see.default)(()=>{this.imageLoaded(new vi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{let e=Object.keys(this.cache);for(let t of e){let e=this.cache[t],n=!1;for(let t=0;t{o||(o=!0,Nu.length<12?Nu.unshift(a):i||(a.src=``))}},c=new Promise(e=>a.addEventListener(`load`,()=>e(null)));requestAnimationFrame(async()=>{try{a.src=e,await c,await a.decode();let t=this.cache[r];if(t!==void 0&&!o){t.img=a;for(let e of t.cells)this.loadedLocations.push(hi(e));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[r]=s}loadOrGetImage(e,t,n){let r=e,i=this.cache[r];if(i!==void 0){let e=fi(t,n);return i.cells.includes(e)||i.cells.push(e),i.img}else this.loadImage(e,t,n,r)}},lee=L.forwardRef((e,t)=>{let n=L.useMemo(()=>({...da,...e.headerIcons}),[e.headerIcons]),r=L.useMemo(()=>e.imageWindowLoader??new cee,[e.imageWindowLoader]);return L.createElement(Qc,{...e,renderers:oee,headerIcons:n,ref:t,imageWindowLoader:r})}),Pu=[`all_time`,`today`,`yesterday`,`this_week`,`last_week`,`this_month`,`last_month`,`this_quarter`,`last_quarter`,`this_year`,`last_year`,`ytd`,`ytd_last_year`,`ltm`,`past_week`,`past_month`,`past_year`,`last_n_days`,`next_n_days`,`custom`],Fu=new Set([`last_n_days`,`next_n_days`]),Iu={all_time:`all time`,today:`today`,yesterday:`yesterday`,this_week:`this week`,last_week:`last week`,this_month:`this month`,last_month:`last month`,this_quarter:`this quarter`,last_quarter:`last quarter`,this_year:`this year`,last_year:`last year`,ytd:`year to date`,ytd_last_year:`last year to date`,ltm:`the last 12 months`,past_week:`the past week`,past_month:`the past month`,past_year:`the past year`,last_n_days:`the last {n} days`,next_n_days:`the next {n} days`,custom:`a custom range`},Lu=[`today`,`yesterday`,`one_week_ago`,`one_month_ago`,`n_days_ago`,`exact`],uee=new Set([`today`,`yesterday`,`one_week_ago`,`one_month_ago`]),Ru={today:`today`,yesterday:`yesterday`,one_week_ago:`one week ago`,one_month_ago:`one month ago`,n_days_ago:`{n} days ago`,exact:`an exact date`};function zu(e){let t=String(e??``).trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return null;let n=new Date(`${t}T00:00:00Z`);return Number.isNaN(n.getTime())?null:n}function Bu(e){return e.toISOString().slice(0,10)}function Vu(e,t){return new Date(e.getTime()+t*864e5)}function Hu(e){return[e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate()]}function Uu(e,t,n){return new Date(Date.UTC(e,t-1,n))}function Wu(e){let[t,n]=Hu(e);return Uu(t,n,1)}function Gu(e){let[t,n]=Hu(e);return n===12?Uu(t,12,31):Vu(Uu(t,n+1,1),-1)}function Ku(e){return(e.getUTCDay()+6)%7}function qu(e){let[t,n]=Hu(e);return Uu(t,3*Math.floor((n-1)/3)+1,1)}function dee(e,t){return new Date(Date.UTC(t===12?e+1:e,t===12?0:t,1)-864e5).getUTCDate()}function Ju(e,t){let[n,r,i]=Hu(e),a=n*12+(r-1)+t,o=Math.floor(a/12),s=a-o*12+1;return Uu(o,s,Math.min(i,dee(o,s)))}function Yu(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.kind;if(!Pu.includes(n))return null;let r={kind:n};if(Fu.has(n)){let e=Number(t.n);if(!Number.isInteger(e)||e<1||e>3650)return null;r.n=e}if(n===`custom`){let e=zu(t.from),n=zu(t.to);if(!e&&!n)return null;e&&n&&e>n&&([e,n]=[n,e]),e&&(r.from=Bu(e)),n&&(r.to=Bu(n))}return r}function Xu(e,t){let n=Yu(e);if(!n)return null;let r=zu(t);if(!r)throw Error("resolveWindow() needs an explicit `today`");switch(n.kind){case`all_time`:return[null,null];case`today`:return[Bu(r),Bu(r)];case`yesterday`:{let e=Vu(r,-1);return[Bu(e),Bu(e)]}case`this_week`:{let e=Vu(r,-Ku(r));return[Bu(e),Bu(Vu(e,6))]}case`last_week`:{let e=Vu(r,-Ku(r)-7);return[Bu(e),Bu(Vu(e,6))]}case`this_month`:return[Bu(Wu(r)),Bu(Gu(r))];case`last_month`:{let e=Vu(Wu(r),-1);return[Bu(Wu(e)),Bu(e)]}case`this_quarter`:{let e=qu(r),[t,n]=Hu(e);return[Bu(e),Bu(Gu(Uu(t,n+2,1)))]}case`last_quarter`:{let e=Vu(qu(r),-1);return[Bu(qu(e)),Bu(e)]}case`this_year`:{let[e]=Hu(r);return[Bu(Uu(e,1,1)),Bu(Uu(e,12,31))]}case`last_year`:{let[e]=Hu(r);return[Bu(Uu(e-1,1,1)),Bu(Uu(e-1,12,31))]}case`ytd`:{let[e]=Hu(r);return[Bu(Uu(e,1,1)),Bu(r)]}case`ytd_last_year`:{let[e]=Hu(r);return[Bu(Uu(e-1,1,1)),Bu(Ju(r,-12))]}case`ltm`:return[Bu(Vu(r,-364)),Bu(r)];case`past_week`:return[Bu(Vu(r,-6)),Bu(r)];case`past_month`:return[Bu(Vu(Ju(r,-1),1)),Bu(r)];case`past_year`:return[Bu(Vu(Ju(r,-12),1)),Bu(r)];case`last_n_days`:return[Bu(Vu(r,-(n.n-1))),Bu(r)];case`next_n_days`:return[Bu(r),Bu(Vu(r,n.n-1))];case`custom`:return[n.from??null,n.to??null]}}function Zu(e){let t=Yu(e);return t?Iu[t.kind].replace(`{n}`,String(t.n??``)):`an invalid range`}function Qu(e,t,n){let r=e||`exact`;if(!Lu.includes(r))return null;let i=zu(n);if(!i)throw Error("resolveAnchor() needs an explicit `today`");switch(r){case`today`:return Bu(i);case`yesterday`:return Bu(Vu(i,-1));case`one_week_ago`:return Bu(Vu(i,-7));case`one_month_ago`:return Bu(Ju(i,-1));case`n_days_ago`:{let e=String(t??``).trim();if(!/^[0-9]+$/.test(e))return null;let n=Number(e);return n>3650?null:Bu(Vu(i,-n))}default:{let e=zu(t);return e?Bu(e):null}}}var $u=[`text`,`select`,`multiselect`,`user`,`int`,`currency`,`pct`,`date`,`checkbox`,`phone`,`email`,`url`,`rating`,`created_time`,`formula`],fee=new Set([`formula`,`created_time`]);function ed(e){return e===`select`||e===`user`||e===`multiselect`}function pee(e){let t=new Set,n=[];for(let r of e.split(` -`)){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n.slice(0,50)}function td(e,t,n=120){let r=Math.max(1,Math.floor(n)),i=e=>e.trim().replace(/\s+/g,` `),a=(i(e)||`Untitled`).slice(0,r).trimEnd(),o=new Set(t.map(e=>i(e).toLocaleLowerCase()));if(!o.has(a.toLocaleLowerCase()))return a;for(let e=2;;e+=1){let t=` ${e}`,n=a.slice(0,Math.max(0,r-t.length)).trimEnd(),i=n?`${n}${t}`:String(e).slice(-r);if(!o.has(i.toLocaleLowerCase()))return i}}function mee(e){return e.filter(e=>e.filterable!==!1)}function nd(e){return Array.isArray(e.options)?e.options:[]}function hee(e){return typeof e.formula==`string`&&e.formula.trim()!==``?e.formula:void 0}function rd(e){let t=typeof e.max==`number`&&Number.isFinite(e.max)?Math.round(e.max):5;return Math.max(2,Math.min(10,t))}var gee=[`grid`,`chart`,`dashboard`,`list`,`calendar`,`kanban`,`map`,`timeseries`],_ee={dashboard:`chart`};function vee(e){return _ee[e]??e}var id=[`week`,`month`,`quarter`,`year`],ad=[`abs`,`pct`,`yoy`,`ytd`],yee=[`note`,`formula`],bee=/^[A-Za-z0-9_ .+\-*/()[\]]*$/;function xee(e){let t=e.bucket===void 0||id.includes(e.bucket),n=e.span,r;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n.lastN;if(typeof e==`number`&&Number.isFinite(e)){let t=Math.round(e);t>=1&&t<=120&&(r={lastN:t})}}let i=e.span===void 0?r===void 0:!!r&&r.lastN===n?.lastN;if(t&&i)return e;let a={...e};return t||delete a.bucket,i||(r?a.span=r:delete a.span),a}function od(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(typeof t.mode!=`string`||!gee.includes(t.mode))return;let n={mode:vee(t.mode)};for(let e of[`dateField`,`stackField`,`titleField`,`colorField`,`sizeField`]){let r=t[e];typeof r==`string`&&r!==``&&(n[e]=r)}if(Array.isArray(t.charts)){let e=t.charts.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`string`).map(xee);e.length&&(n.charts=e.slice(0,12))}if(t.kanbanClamp===!1&&(n.kanbanClamp=!1),(t.calendarMode===`records`||t.calendarMode===`summary`)&&(n.calendarMode=t.calendarMode),Array.isArray(t.calendarMetrics)){let e=[];for(let n of t.calendarMetrics){if(!n||typeof n!=`object`)continue;let t=n;typeof t.id!=`string`||!t.id||typeof t.field!=`string`||!t.field||typeof t.agg!=`string`||!t.agg||e.push({id:t.id,field:t.field,agg:t.agg})}e.length&&(n.calendarMetrics=e.slice(0,4))}if(id.includes(t.tsBucket)&&(n.tsBucket=t.tsBucket),t.tsSpan&&typeof t.tsSpan==`object`&&!Array.isArray(t.tsSpan)){let e=t.tsSpan,r={};if(typeof e.from==`string`&&e.from&&(r.from=e.from),typeof e.to==`string`&&e.to&&(r.to=e.to),typeof e.lastN==`number`&&Number.isFinite(e.lastN)){let t=Math.round(e.lastN);t>=1&&t<=120&&(r.lastN=t)}(r.from||r.to||r.lastN!=null)&&(n.tsSpan=r)}if(Array.isArray(t.tsFields)){let e=t.tsFields.filter(e=>typeof e==`string`&&e!==``);e.length&&(n.tsFields=e.slice(0,12))}if(Array.isArray(t.tsDeltas)){let e=new Set,r=[];for(let n of t.tsDeltas)typeof n!=`string`||!ad.includes(n)||e.has(n)||(e.add(n),r.push(n));r.length&&(n.tsDeltas=r.slice(0,ad.length))}if(t.tsGridlines===!1&&(n.tsGridlines=!1),t.tsSparkline===!0&&(n.tsSparkline=!0),Array.isArray(t.tsRows)){let e=[],r=new Set;for(let n of t.tsRows){if(!n||typeof n!=`object`)continue;let t=n;if(typeof t.id!=`string`||!t.id||t.id.length>40||r.has(t.id)||typeof t.kind!=`string`||!yee.includes(t.kind)||typeof t.label!=`string`||t.label.length>120)continue;r.add(t.id);let i={id:t.id,kind:t.kind,label:t.label};i.kind===`formula`&&typeof t.expr==`string`&&t.expr.length<=200&&bee.test(t.expr)&&(i.expr=t.expr),e.push(i)}e.length&&(n.tsRows=e.slice(0,12))}if(t.tsStyles&&typeof t.tsStyles==`object`&&!Array.isArray(t.tsStyles)){let e={},r=0;for(let[n,i]of Object.entries(t.tsStyles)){if(r>=200)break;if(!n||!i||typeof i!=`object`||Array.isArray(i))continue;let t=i,a={};t.bold===!0&&(a.bold=!0),t.line===!0&&(a.line=!0),!(!a.bold&&!a.line)&&(e[n]=a,r+=1)}r&&(n.tsStyles=e)}if(!(n.mode===`grid`&&!n.dateField&&!n.stackField&&!n.titleField&&!n.colorField&&!n.sizeField&&!n.charts&&n.kanbanClamp===void 0&&!n.calendarMode&&!n.calendarMetrics&&!n.tsBucket&&!n.tsSpan&&!n.tsFields&&!n.tsDeltas&&n.tsGridlines===void 0&&n.tsSparkline===void 0&&!n.tsRows&&!n.tsStyles))return n}function sd(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.round(e);if(!(t<=1))return Math.min(8,t)}function See(e,t){if(e.source!==`overlay`||fee.has(e.type))return!1;let n=e.permissions?.edit??`everyone`;return n===`everyone`?!0:t?t.isAdmin?!0:n===`creator`&&e.createdBy===t.name:!1}function cd(e){return e===`currency`||e===`int`||e===`pct`||e===`rating`||e===`formula`}function ld(e){return e===`date`||e===`created_time`}function ud(e,t){return cd(e)?t===`asc`?`1 → 9`:`9 → 1`:ld(e)?t===`asc`?`Oldest → Newest`:`Newest → Oldest`:t===`asc`?`A → Z`:`Z → A`}function Cee(e,t){return e.type===`status`||e.type===`select`||e.type===`multiselect`||e.type===`checkbox`||e.type===`text`&&e.source!==`overlay`&&e.key!==t}var wee=[`topN`,`bottomN`,`inTopPct`,`inBottomPct`,`aboveAvg`,`belowAvg`,`inQuartile`,`inDecile`];function dd(e){return wee.includes(e)}var Tee=[`contains`,`doesNotContain`,`eq`,`neq`,`isEmpty`,`isNotEmpty`,`gt`,`gte`,`lt`,`lte`,`between`,`within`,`topN`,`bottomN`,`inTopPct`,`inBottomPct`,`aboveAvg`,`belowAvg`,`inQuartile`,`inDecile`],fd=new Set([`isEmpty`,`isNotEmpty`,`aboveAvg`,`belowAvg`]),pd=`__cohort__`;function Eee(e){return!yd(e)&&e.colId===`__cohort__`}var Dee=[`anyOf`,`allOf`,`noneOf`],Oee={eq:`anyOf`,neq:`noneOf`};function md(e){return Dee.includes(e)?e:Oee[e]??`anyOf`}function hd(e){let t=[];for(let n of String(e??``).split(`,`)){let e=n.trim();if(!(e===``||t.includes(e))&&(t.push(e),t.length>=20))break}return t}var kee=[`avg`,`median`,`p10`,`p25`,`p75`,`p90`],Aee={avg:`the average`,median:`the median`,p10:`the bottom 10%`,p25:`the bottom quartile`,p75:`the top quartile`,p90:`the top 10%`};function gd(e){return e&&e.kind!==`stat`?e.colId:void 0}function jee(e){return e?e.kind===`stat`?kee.includes(e.stat):e.colId?e.kind===`measure`?Yu(e.window)!=null:e.kind===`field`:!1:!1}function _d(e){return e.colId===`__cohort__`?hd(e.value).length>0:fd.has(e.op)?!0:e.op===`within`?Yu(e.dateWindow)!=null:e.rhs?jee(e.rhs):e.dateMode&&uee.has(e.dateMode)?!0:e.op===`between`?e.value!==``&&e.value2!=null&&e.value2!==``:e.value!==``}var Mee=[`gte`,`gt`,`lte`,`lt`,`eq`,`neq`],Nee=[`gte`,`gt`,`lte`,`lt`];function vd(e){return!yd(e)&&e.window!=null}function yd(e){return e!=null&&Array.isArray(e.children)}function bd(e){return Array.isArray(e?.nodes)?e.nodes:[]}function xd(e){return e?.conj===`or`?`or`:`and`}var Pee=new Set([`all-customers`]),Fee={key:`customer_data`,scope:`customer`,rowsPath:`customers`,noun:`customer`,nouns:`customers`,measures:!0},Iee={key:`product_data`,scope:`product`,rowsPath:`products`,noun:`product`,nouns:`products`,measures:!1};function Sd(e){return e===`product`?Iee:Fee}function Cd(e){return Pee.has(e.id)}function wd(e){return e.config?.display?.mode??`grid`}function Td(e){return e.kind===`system`||Cd(e)?!1:!!e.locked}function Ed(e,t){return t?t.isAdmin?!0:!!e.createdBy&&e.createdBy===t.name:!1}var Dd=[`personal`,`collaborative`,`users`],Lee={personal:`Personal`,collaborative:`Collaborative`,users:`Specific users`},Ree={personal:`Only you can change this view.`,collaborative:`Anyone who can see this table can change it.`,users:`Only the people you pick can change it.`};function zee(e,t,n){let r=e&&typeof e==`object`&&!Array.isArray(e)?e:{},i=Dd.includes(r.edit)?r.edit:t;if(i!==`users`)return{edit:i};let a=new Set,o=[];for(let e of(Array.isArray(r.users)?r.users:[]).slice(0,50)){let t=String(e??``).trim();!t||a.has(t.toLowerCase())||n&&!n.includes(t)||(a.add(t.toLowerCase()),o.push(t))}return o.length?{edit:`users`,users:o}:{edit:`personal`}}function Bee(e){return e.permissions?.edit??`collaborative`}function Od(e,t){let n=Bee(e);return n===`collaborative`||!e.createdBy?!0:t?t.isAdmin||e.createdBy&&e.createdBy===t.name?!0:n===`users`&&(e.permissions?.users??[]).includes(t.name):!1}var kd=[`folder`,`star`,`flag`,`tag`,`bookmark`,`grid`,`chart`,`map`,`users`,`clock`,`heart`,`bolt`],Ad=[`neutral`,`blue`,`green`,`yellow`,`red`],jd=`folder`,Md=`neutral`;function Vee(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(!kd.includes(t.shape))return;let n=t.shape,r=Ad.includes(t.tone)?t.tone:Md;if(!(n===`folder`&&r===`neutral`))return{shape:n,tone:r}}var Nd=5*1024*1024;function Hee(e){return e?.windowed?`server-windowed`:`whole-book`}var Pd=`/api/v1`,Fd=`same-origin`,Id=`aios:unauthorized`,Ld=`aios:data-error`,Rd=`aios:toast`,zd=`aios:workspace-stale`,Bd=`aios:nav-minimize`;function Vd(e,t){typeof window>`u`||window.dispatchEvent(new CustomEvent(e,{detail:t}))}var Uee=`streamlit:componentReady`,Wee=`streamlit:render`,Gee=`streamlit:setComponentValue`,Kee=`streamlit:setFrameHeight`,Hd=`aios:grid-host-render`;function Ud(e,t){window.parent.postMessage({isStreamlitMessage:!0,type:e,...t},`*`)}function Wd(){return typeof window>`u`||window.parent===window?!1:new URLSearchParams(window.location.search).has(`streamlitUrl`)}function qee(){Wd()&&(window.addEventListener(`message`,e=>{let t=e.data;if(!t||t.type!==Wee)return;window.__AIOS_STREAMLIT_ARGS__=t.args??{},window.dispatchEvent(new CustomEvent(Hd));let n=Number(t.args?.height??760);Ud(Kee,{height:Number.isFinite(n)?n:760})}),Ud(Uee,{apiVersion:1}))}function Jee(){return window.__AIOS_STREAMLIT_ARGS__??null}function Yee(e){return window.addEventListener(Hd,e),()=>window.removeEventListener(Hd,e)}var Gd=[],Kd=null;function Xee(e){Kd=e}function qd(e){return Wd()?(Gd.push(e),Gd.length>24&&Gd.shift(),Ud(Gee,{value:{events:[...Gd]},dataType:`json`}),!0):Kd?Kd(e):!1}function Jd(e){return`${e}:${typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}`}var Yd={"Content-Type":`application/json`};async function Xd(e){try{return await e.json()}catch{return null}}function Zd(e){return e===401?(Qd.clear(),Vd(Id),!0):!1}var Zee=5*6e4,Qd=new Map;function $d(){Qd.clear()}async function Qee(e){let t=Qd.get(e.rowsPath);if(t&&Date.now()-t.ate.pid===t);n&&Object.assign(n,e)}}return r.ok}catch{return!1}}async function tf(e,t=af){try{let n=await fetch(`${Pd}/grid/timeseries?scope=${encodeURIComponent(t)}`,{method:`POST`,credentials:Fd,headers:Yd,body:JSON.stringify(e)});if(Zd(n.status)||!n.ok)return{payload:null,status:n.status};let r=await Xd(n);return!r||!Array.isArray(r.columns)||!Array.isArray(r.rows)?{payload:null,status:n.status}:{payload:r,status:n.status}}catch{return{payload:null,status:0}}}async function ete(e,t=af){try{let n=await fetch(`${Pd}/grid/calendar_metrics?scope=${encodeURIComponent(t)}`,{method:`POST`,credentials:Fd,headers:Yd,body:JSON.stringify(e)});if(Zd(n.status)||!n.ok)return{payload:null,status:n.status};let r=await Xd(n);return!r||!r.values||typeof r.values!=`object`?{payload:null,status:n.status}:{payload:r,status:n.status}}catch{return{payload:null,status:0}}}var nf=[],rf=!1,af=`customer`;function tte(e){af=e}async function of(){if(rf||nf.length===0)return;rf=!0;let e=nf;nf=[];let t=!1;try{let n=await fetch(`${Pd}/grid/events`,{method:`POST`,credentials:Fd,headers:Yd,body:JSON.stringify({events:e,scopeKey:af})});Zd(n.status)||(n.ok?nte(await Xd(n)):t=!0)}catch{t=!0}finally{rf=!1,t?nf=[...e,...nf].slice(-24):nf.length&&of()}}function nte(e){let t=e,n=t?.toast;typeof n==`string`&&n.trim()!==``&&Vd(Rd,n.trim());let r=Array.isArray(t?.results)?t.results:[];(t?.rerender===!0||r.some(e=>e?.rerender===!0))&&Vd(zd)}function rte(e){return nf.push(e),nf.length>24&&nf.shift(),of(),!0}function ite(){Xee(rte)}function sf(e){return JSON.stringify([e.config?.filters??[],e.config?.filterConj===`or`?`or`:`and`])}function ate(e,t,n){let r=sf(e);return r===sf(t)||r===n?null:r}function cf(e,t){for(let n of e??[]){if(yd(n)){cf(n.children,t);continue}let e=n;vd(n)&&e.id&&t.set(e.id,e)}}function ote(e,t,n,r){if(!t||n==null||r-n>12e4)return e;let i=e,a=t.config?t.config.display:void 0;if(t.config&&JSON.stringify(a??null)!==JSON.stringify(e.config?.display??null)){let t={...e.config};a===void 0?delete t.display:t.display=a,i={...e,config:t}}let o=t.config?t.config.cohortLock:void 0;if(t.config&&o!==i.config?.cohortLock){let e={...i.config};o===void 0?delete e.cohortLock:e.cohortLock=o,i={...i,config:e}}let s=t.config?t.config.filters:void 0;if(!Array.isArray(s)||s.length===0)return i;let c=new Map;if(cf(s,c),c.size===0)return i;let l=new Map;cf(e.config?e.config.filters:void 0,l);let u=!1;for(let[e,t]of c){if(!_d(t))continue;let n=l.get(e);if(!n||!_d(n)){u=!0;break}}return u?{...i,config:{...i.config,filters:s,filterConj:t.config.filterConj??e.config.filterConj}}:i}function lf(e,t){let n=e=>{let n={};for(let[r,i]of Object.entries(e??{}))typeof i==`number`&&t-i<=12e4&&(n[r]=i);return n};return{edited:n(e?.edited),deleted:n(e?.deleted)}}function uf(e){if(Array.isArray(e))return e.map(uf);if(e&&typeof e==`object`){let t={};for(let n of Object.keys(e).sort()){let r=e[n];r!==void 0&&(t[n]=uf(r))}return t}return e}function df(e){let{createdBy:t,permissions:n,editRequestId:r,labelCorrectedFrom:i,labelCorrectionId:a,...o}=e;return JSON.stringify(uf(o))}function ste(e,t,n,r,i){let a=e=>typeof e==`number`&&r-e<=12e4,o=new Map(t.map(e=>[e.key,e])),s=[];for(let t of e){let e=o.get(t.key);if(o.delete(t.key),!a(n?.deleted?.[t.key])){if(!e){s.push(t);continue}if(!i){s.push({...e,...t,note:t.note??e.note});continue}if(t.labelCorrectedFrom===e.label&&t.label!==e.label&&typeof t.labelCorrectionId==`string`&&t.labelCorrectionId===e.editRequestId){s.push(t);continue}if(a(n?.edited?.[t.key])&&df(e)!==df(t)){s.push({...e,...t.createdBy==null?{}:{createdBy:t.createdBy}});continue}s.push(t.note==null&&e.note!=null?{...t,note:e.note}:t)}}for(let e of o.values())if(e.custom&&!a(n?.deleted?.[e.key])){if(e.source===`overlay`){s.push(e);continue}(!i||a(n?.edited?.[e.key]))&&s.push(e)}return s}function cte(e,t){let n=e.filter(e=>!(e.pid===t.pid&&e.key===t.key));return n.push(t),n.slice(-64)}function lte(e,t,n){let r=[],i={};for(let a of e){if(a==null||typeof a.pid!=`number`||typeof a.key!=`string`||typeof a.at!=`number`)continue;let e=t(a.pid),o=e?e[a.key]:void 0;String(o??``)!==String(a.value??``)&&(n-a.at>12e4||(r.push(a),i[a.pid]={...i[a.pid],[a.key]:a.value}))}return{keep:r,seeds:i}}function ff(){if(typeof window>`u`)return null;let e=window.__AIOS_GRID__;return e&&Array.isArray(e.rows)&&Array.isArray(e.fields)?e:null}function pf(){let e=Jee()?.payload;return e&&Array.isArray(e.rows)&&Array.isArray(e.fields)?e:null}function mf(e,t){let n={...e,workspace:t};Array.isArray(t.measures)&&(n.measures=t.measures),t.measureSets&&typeof t.measureSets==`object`&&(n.measureSets=t.measureSets),t.viewer&&typeof t.viewer.name==`string`&&(n.viewer=t.viewer),Array.isArray(t.userOptions)&&(n.userOptions=t.userOptions);let r=t.derived;return r&&typeof r==`object`&&Object.keys(r).length>0&&(n.rows=e.rows.map(e=>{let t=r[String(e.pid)];return t?{...e,...t}:e})),n}function hf(){return pf()??ff()}var gf=Wd(),ute=ff()!==null;function _f(e){return`aios-grid-cells:${e}`}function vf(e){try{let t=localStorage.getItem(_f(e)),n=t?JSON.parse(t):null;return Array.isArray(n)?n:[]}catch{return[]}}function yf(e,t){try{localStorage.setItem(_f(e),JSON.stringify(t))}catch{}}function bf(e){let t=e?.workspace?.storageKey;if(!e||!t)return{};let n=new Map(e.rows.map(e=>[e.pid,e])),{keep:r,seeds:i}=lte(vf(t),e=>n.get(e),Date.now());return yf(t,r),i}function dte(e=`customer`){tte(e);let t=Sd(e),[n,r]=(0,L.useState)(()=>hf()),[i,a]=(0,L.useState)(()=>gf?bf(hf()):{}),o=(0,L.useRef)(n);o.current=n,(0,L.useEffect)(()=>{if(gf){let e=()=>{let e=pf();if(!e)return;let t=bf(e);Object.keys(t).length&&a(e=>{let n={...e};for(let[e,r]of Object.entries(t))n[Number(e)]={...r,...n[Number(e)]};return n}),r(e)};return e(),Yee(e)}if(ff())return;let n=!1;async function i(){let[i,a]=await Promise.all([Qee(t),ef(e)]);n||!i||r(a?mf(i,a):i)}i();async function o(){let t=await ef(e);n||!t||r(e=>e&&mf(e,t))}let s=()=>{o()};return typeof window<`u`&&window.addEventListener(zd,s),()=>{n=!0,typeof window<`u`&&window.removeEventListener(zd,s)}},[e,t]);let s=(0,L.useCallback)((e,n)=>{let r;if(a(t=>(r=t[e],{...t,[e]:{...t[e],...n}})),gf){let t=o.current?.workspace?.storageKey;if(t){let r=vf(t),i=Date.now();for(let[t,a]of Object.entries(n))r=cte(r,{pid:e,key:t,value:a??null,at:i});yf(t,r)}qd({id:Jd(`overlay`),type:`overlay_patch`,pid:e,updates:n});return}ute||$ee(t,e,n).then(t=>{t||(console.warn(`customer-grid: overlay PATCH failed for pid ${e}; rolling back`),a(t=>{let n={...t};return r===void 0?delete n[e]:n[e]=r,n}))})},[t]);return{fields:n?.fields??[],rawRows:n?.rows??[],payload:n,loading:n===null,overlayEdits:i,setOverlayEdits:a,patchOverlay:s}}var xf=`#202433`,Sf=`#6B7280`,Cf=`#E6E9EF`,fte=`#FFFFFF`,pte=`#FAFBFC`,mte=`#9DBFF2`,wf=`#EDF3FD`,hte=`#F5D989`,Tf=`#FBF4E0`,gte=`#F0A8A0`,_te=`#FCEEEC`,Ef=`#A5D8B4`,Df=`#EBF6EF`,Of=`#F1EEFB`,vte=`#6B57A8`,yte=`#768FB6`,bte=`#4F6079`,kf=`#7E6428`,xte=`#A3453C`,Af=`#35754E`,jf={accentColor:yte,accentLight:wf,textDark:xf,textMedium:Sf,textLight:`#8B92A0`,textHeader:xf,bgCell:fte,bgHeader:pte,bgHeaderHovered:`#F1F3F6`,bgHeaderHasFocus:wf,borderColor:Cf,horizontalBorderColor:Cf,fgIconHeader:Sf,bgIconHeader:Cf,fontFamily:`Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,baseFontStyle:`13px`,headerFontStyle:`600 13px`},Ste={growing:{bgBubble:Df,textBubble:Af},new:{bgBubble:wf,textBubble:bte},declining:{bgBubble:Tf,textBubble:kf},dormant:{bgBubble:Cf,textBubble:xf},lost:{bgBubble:_te,textBubble:xte},reactivated:{bgBubble:Ef,textBubble:xf}},Cte={growing:{bgCell:`rgba(165, 216, 180, 0.40)`},new:{bgCell:`rgba(157, 191, 242, 0.38)`},declining:{bgCell:`rgba(245, 217, 137, 0.42)`},dormant:{bgCell:`rgba(107, 114, 128, 0.13)`},lost:{bgCell:`rgba(240, 168, 160, 0.38)`},reactivated:{bgCell:`rgba(165, 216, 180, 0.72)`}},wte={growing:{bgCell:`rgba(165, 216, 180, 0.62)`},new:{bgCell:`rgba(157, 191, 242, 0.60)`},declining:{bgCell:`rgba(245, 217, 137, 0.64)`},dormant:{bgCell:`rgba(107, 114, 128, 0.22)`},lost:{bgCell:`rgba(240, 168, 160, 0.60)`},reactivated:{bgCell:`rgba(165, 216, 180, 0.92)`}},Tte={bgCell:`rgba(32, 36, 51, 0.06)`},Ete=Tte,Dte=Tte,Mf=`700 13px`;function Nf(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}var Ote={filter:{bgHeader:Df,bgHeaderHovered:Df,bgHeaderHasFocus:Df,bgCell:Nf(Af,.06),headerFontStyle:Mf},sort:{bgHeader:Tf,bgHeaderHovered:Tf,bgHeaderHasFocus:Tf,bgCell:Nf(kf,.06),headerFontStyle:Mf},group:{bgHeader:Of,bgHeaderHovered:Of,bgHeaderHasFocus:Of,bgCell:Nf(vte,.06),headerFontStyle:Mf}},kte=Sf,Pf=(e,t,n)=>`M${e-n} ${t}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0`,Ate=[{d:`M3.2 4.6h9.6v8.2H3.2z`},{d:`M3.2 7.2h9.6`},{d:`M5.8 3v3.2`},{d:`M10.2 3v3.2`}],Ff={text:[{d:`M3 5h10M3 8h10M3 11h6`}],status:[{d:`M4 13V3.5h7.6L10.1 6l1.5 2.5H4`}],currency:[{d:`M8 2.8v10.4`},{d:`M10.6 5.4A2.6 2.6 0 0 0 8.2 4.2H7.4a2 2 0 0 0 0 4h1.2a2 2 0 0 1 0 4H7.8a2.6 2.6 0 0 1-2.4-1.4`}],int:[{d:`M6.2 3L4.8 13M11.2 3l-1.4 10M3.4 6.2h9.2M2.9 9.8h9.2`}],date:Ate,pct:[{d:Pf(4.6,4.6,1.6)},{d:Pf(11.4,11.4,1.6)},{d:`M12.2 3.9L3.8 12.3`}],select:[{d:`M3.2 3.8h9.6v8.4H3.2z`},{d:`M6.2 7.2l1.8 1.8 1.8-1.8`}],user:[{d:Pf(8,6,2.4)},{d:`M3.6 13c0-2.4 2-3.8 4.4-3.8s4.4 1.4 4.4 3.8`}],multiselect:[{d:`M3 4.6h2.2v2.2H3zM3 9.2h2.2v2.2H3z`},{d:`M7.2 5.7h6M7.2 10.3h6`}],checkbox:[{d:`M3.4 3.4h9.2v9.2H3.4z`},{d:`M5.8 8.1l1.8 1.9 3.4-3.9`}],phone:[{d:`M5.1 3.2L7 5.1 5.6 7a7.2 7.2 0 0 0 3.4 3.4l1.9-1.4 1.9 1.9-1.5 1.6c-3 .5-8.3-4.8-7.8-7.8z`}],email:[{d:`M3 4.4h10v7.2H3z`},{d:`M3 4.9l5 3.9 5-3.9`}],url:[{d:`M7 5.4L8.4 4a2.6 2.6 0 0 1 3.7 3.7L10.7 9`},{d:`M9 10.6L7.6 12a2.6 2.6 0 0 1-3.7-3.7L5.3 7`},{d:`M6.2 9.8l3.6-3.6`}],rating:[{d:`M8 2.9l1.63 3.3 3.64.53-2.63 2.57.62 3.63L8 11.24 4.74 12.93l.62-3.63L2.73 6.73l3.64-.53z`,fill:!0}],created_time:[{d:Pf(8,8,5.2)},{d:`M8 4.9v3.4l2.3 1.4`}],formula:[{d:`M5.6 12.8V5.4a2 2 0 0 1 3.2-1.6`},{d:`M4.2 7.6h4.6`},{d:`M10.2 8.4l3 3.4M13.2 8.4l-3 3.4`}]},If={grid:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M2.6 6.5h10.8M2.6 9.5h10.8M6.4 3.4v9.2M10 3.4v9.2`}],list:[{d:`M3 4.6h1.4M6.4 4.6h6.6M3 8h1.4M6.4 8h6.6M3 11.4h1.4M6.4 11.4h6.6`}],chart:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M5.4 10.6V7.2M8 10.6V5.4M10.6 10.6V8.6`}],dashboard:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M5.4 10.6V7.2M8 10.6V5.4M10.6 10.6V8.6`}],calendar:Ate,kanban:[{d:`M2.8 3.4h3.1v9.2H2.8zM6.5 3.4h3.1v6.2H6.5zM10.2 3.4h3.1v7.6h-3.1z`}],map:[{d:`M8 2.6a3.6 3.6 0 0 1 3.6 3.6c0 2.7-3.6 7.2-3.6 7.2S4.4 8.9 4.4 6.2A3.6 3.6 0 0 1 8 2.6z`},{d:Pf(8,6.1,1.3)}],timeseries:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M2.6 6.6h10.8M6.2 3.4v9.2`},{d:`M7.2 10.8l2-2.4 1.6 1.2 1.8-2.6`}]},jte={bar:[{d:`M3.2 12.8V7.4M6.4 12.8V4.2M9.6 12.8V8.8M12.8 12.8V5.8`}],line:[{d:`M2.6 11.2l3.2-3.4 2.6 2 4.9-5.2`},{d:Pf(5.8,7.8,.9)},{d:Pf(8.4,9.8,.9)}],area:[{d:`M2.6 12.4V9.2l3.2-3.2 2.6 2 4.9-4.6v9z`},{d:`M2.6 9.2l3.2-3.2 2.6 2 4.9-4.6`}],donut:[{d:Pf(8,8,5)},{d:Pf(8,8,2.1)}],kpi:[{d:`M2.6 3.8h10.8v8.4H2.6z`},{d:`M5.4 9.6V6.4l1.9 3.2V6.4M9.4 6.4v3.2h1.8`}],table:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M2.6 6.2h10.8M7.2 6.2v6.4M2.6 9.4h10.8`}]},Mte={bar:`blue`,line:`green`,area:`green`,donut:`yellow`,kpi:`neutral`,table:`neutral`},Nte={folder:[{d:`M2.4 12.6V4.2a.6.6 0 0 1 .6-.6h3.2l1.5 1.7h5.3a.6.6 0 0 1 .6.6v6.7a.6.6 0 0 1-.6.6H3a.6.6 0 0 1-.6-.6z`}],star:[{d:`M8 2.9l1.63 3.3 3.64.53-2.63 2.57.62 3.63L8 11.24 4.74 12.93l.62-3.63L2.73 6.73l3.64-.53z`}],flag:[{d:`M4.2 13.4V2.9`},{d:`M4.2 3.4h7.6l-1.5 2.6 1.5 2.6H4.2z`}],tag:[{d:`M2.9 8.2V3.5a.6.6 0 0 1 .6-.6h4.7l5 5-5.3 5.3z`},{d:Pf(5.6,5.6,1)}],bookmark:[{d:`M4.4 2.9h7.2v10.4L8 10.7l-3.6 2.6z`}],grid:If.grid,chart:If.dashboard,map:If.map,users:Ff.user,clock:Ff.created_time,heart:[{d:`M8 13.1S2.7 9.8 2.7 6.4a2.9 2.9 0 0 1 5.3-1.6 2.9 2.9 0 0 1 5.3 1.6c0 3.4-5.3 6.7-5.3 6.7z`}],bolt:[{d:`M9.1 2.4L4.2 9.1h3.3l-.6 4.5 4.9-6.7H8.5z`}]},Lf={neutral:{fill:Cf,stroke:Sf},blue:{fill:mte,stroke:yte},green:{fill:Ef,stroke:Af},yellow:{fill:hte,stroke:kf},red:{fill:gte,stroke:xte}},Pte={neutral:`Neutral`,blue:`Blue`,green:`Green`,yellow:`Yellow`,red:`Red`},Fte={folder:`Folder`,star:`Star`,flag:`Flag`,tag:`Tag`,bookmark:`Bookmark`,grid:`Table`,chart:`Chart`,map:`Map`,users:`People`,clock:`Clock`,heart:`Heart`,bolt:`Priority`},Rf={grid:`Grid`,chart:`Chart`,dashboard:`Chart`,list:`List`,calendar:`Calendar`,kanban:`Kanban`,map:`Map`,timeseries:`Time series`},Ite=[`grid`,`chart`,`calendar`,`kanban`,`timeseries`,`map`,`list`],Lte={grid:`blue`,list:`blue`,chart:`green`,dashboard:`green`,calendar:`yellow`,kanban:`yellow`,map:`red`,timeseries:`green`},zf={text:`Single line text`,select:`Single select`,multiselect:`Multi select`,user:`Assignee`,int:`Number`,currency:`Currency`,pct:`Percent`,date:`Date`,checkbox:`Checkbox`,phone:`Phone number`,email:`Email`,url:`URL`,rating:`Rating`,created_time:`Created time`,formula:`Formula`,status:`Lifecycle status (Odoo)`};function Rte(e,t){return e.fill?``:``}function zte(e){return({fgColor:t})=>``+e.map(e=>Rte(e,t)).join(``)+``}function Bte(e){return`t_${e}`}var Vte={...Object.fromEntries(Object.keys(Ff).map(e=>[Bte(e),zte(Ff[e])])),aiosInfo:()=>``};function Hte(e,t,n){return e&&t>Math.max(0,n-16)?e:null}function Ute(e,t,n,r=8){let i=Math.min(n,280);return Math.round(Math.max(r,Math.min(e,t-r-i)))}var Wte=`600 13px`;function Gte(e,t,n,r,i){let a=t=>`${e} ${t} (${n})`,o=a(t);if(r==null||r<=0||i(o)<=r)return o;let s=r-i(a(``));return s<=0?o:a(Yte(t,s,i))}function Kte(e,t,n,r=4){if(n.length===0)return null;let i=[],a=e.x+e.width-t-r;for(let t of n){let n=a-t;if(n-e.x<68)return null;i.push({x:Math.round(n),y:Math.round(e.y+(e.height-t)/2),size:t}),a=n-6}return i}function qte(e,t){let n=[];return e&&n.push(16),t&&n.push(6),n}function Jte(e,t,n=30){let r=Kte({x:0,y:0,width:e,height:32},n,t===!0?[16]:t===!1?[]:t);return r?Math.max(0,r[r.length-1].x-32-6):null}function Yte(e,t,n){if(t==null||!e||n(e)<=t)return e;let r=n(`…`);if(r>t)return e;let i=0,a=e.length;for(;it.x+t.width||at.y+t.height)?null:{x:i,y:a,size:n}}function Zte(e){let{placement:t,target:n,panel:r,viewport:i}=e,a=i.left+8,o=i.left+i.width-8,s=i.top+8,c=i.top+i.height-8,l=Math.max(1,o-a),u=Math.min(r.width,l),d=r.height,f,p,m,h;if(t===`right-start`){let e=Math.max(0,o-(n.right+6)),t=Math.max(0,n.left-6-a),r=u<=e||e>=t;h=r?`right`:`left`;let i=r?n.right+6:n.left-6-u;f=Math.min(Math.max(i,a),Math.max(a,o-u)),m=Math.max(1,c-s),p=Math.min(Math.max(n.top,s),Math.max(s,c-Math.min(d,m)))}else{let e=Math.max(0,c-(n.bottom+6)),r=Math.max(0,n.top-6-s),i=d<=e||e>=r;h=i?`below`:`above`,m=Math.max(1,i?e:r);let l=t===`bottom-end`?n.right-u:n.left;f=Math.min(Math.max(l,a),o-u),p=i?Math.min(n.bottom+6,c-m):Math.max(s,n.top-6-Math.min(d,m))}return{left:Math.round(f),top:Math.round(p),maxWidth:Math.floor(l),maxHeight:Math.floor(m),side:h}}var Qte=150,Bf={base:void 0,bold:void 0};function $te(e,t=!1){let n=t?`bold`:`base`;if(Bf[n]===void 0){let e=document.createElement(`canvas`).getContext(`2d`);e&&(e.font=`${(t?`700 13px`:jf.headerFontStyle)??`600 13px`} ${jf.fontFamily??`Inter, sans-serif`}`),Bf[n]=e}let r=Bf[n];return r?r.measureText(e).width:0}function ene(e){return!!(e.note||e.description)}function tne(e,t){for(let n of e??[]){if(yd(n)){tne(n.children,t);continue}_d(n)&&t.add(n.colId)}}function nne(e){return e?Ote[e]:void 0}function rne(e){let t=new Map;e.groupBy&&t.set(e.groupBy,`group`);for(let n of e.sorts??[])t.set(n.colId,`sort`);let n=new Set;tne(e.filters??[],n);for(let e of n)t.set(e,`filter`);return t}function Vf(e){return e.default!==!1||e.source===`overlay`}function Hf(e){let t=e.filter(Vf).map(e=>e.key),n=e.filter(e=>!Vf(e)).map(e=>e.key);return{filters:[],filterConj:`and`,sorts:[],groupBy:null,colorBy:null,rowHeightMode:`short`,order:[...t,...n],visible:t,widths:{},memberPids:[]}}function ine(e,t){let n=new Set(t.map(e=>e.key)),r=e.filter((t,r)=>n.has(t)&&e.indexOf(t)===r);for(let e of t)r.includes(e.key)||r.push(e.key);let i=t.find(e=>e.pinned)?.key??t[0]?.key;return i&&r[0]!==i?[i,...r.filter(e=>e!==i)]:r}function ane(e,t,n){let r=new Set(t.map(e=>e.key)),i=new Set(e.filter(e=>r.has(e)));if(i.size===0)for(let e of t)Vf(e)&&i.add(e.key);return n&&i.add(n),i}function one(e,t,n){let r=(0,L.useMemo)(()=>new Map(e.map(e=>[e.key,e])),[e]),i=(0,L.useMemo)(()=>e.find(e=>e.pinned)?.key??e[0]?.key??``,[e]),a=(0,L.useMemo)(()=>ine(t.order,e),[t.order,e]),o=(0,L.useMemo)(()=>ane(t.visible,e,i),[t.visible,e,i]),s=(0,L.useMemo)(()=>rne(t),[t.filters,t.sorts,t.groupBy]),c=(0,L.useMemo)(()=>a.filter(e=>o.has(e)).map(e=>{let n=r.get(e),i=t.widths[e]??Qte,a=s.has(e),o=qte(ene(n),n.source===`overlay`);return{id:e,title:Yte(n.label,Jte(i,o),e=>$te(e,a)),width:i,hasMenu:!0,menuIcon:`dots`,icon:Bte(n.type),themeOverride:nne(s.get(e))}}),[a,o,t.widths,r,s]),l=(0,L.useCallback)((e,r)=>{e.id&&n({...t,widths:{...t.widths,[e.id]:Math.round(r)}})},[t,n]),u=(0,L.useCallback)((e,r)=>{if(e===0||r===0)return;let i=a.filter(e=>o.has(e));if(e<0||e>=i.length||r<0||r>=i.length)return;let s=i.slice(),[c]=s.splice(e,1);s.splice(r,0,c);let l=0,u=a.map(e=>o.has(e)?s[l++]:e);n({...t,order:u})},[t,n,a,o]),d=(0,L.useCallback)((e,t)=>e!==0&&t!==0,[]),f=(0,L.useCallback)((e,r)=>{if(!r&&e===i)return;let a=new Set(o);r?a.add(e):a.delete(e),n({...t,visible:[...a]})},[t,i,n,o]),p=(0,L.useCallback)((e,r,i)=>{let s=a.filter(t=>t!==e);if(i===`end`||!r)s.push(e);else{let t=Math.max(0,s.indexOf(r));s.splice(t+ +(i===`right`),0,e)}let c=new Set(o);c.add(e),n({...t,order:s,visible:[...c]})},[t,n,a,o]);return{visibleCols:c,fieldByKey:r,order:a,visible:o,widths:t.widths,lockedKey:i,onColumnResize:l,onColumnMoved:u,onColumnProposeMove:d,setColumnVisible:f,insertColumn:p}}function sne(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:0}function cne(e,t){let n={};for(let r of t){if(r.agg!==`sum`)continue;let t=0;for(let n of e)t+=sne(n[r.key]);let i=Math.round(t*100)/100;n[r.key]=r.type===`currency`?`$`+i.toLocaleString():i.toLocaleString()}return n}var lne={sets:new Map,unanswerable:0};function une(e){return e===`currency`||e===`int`||e===`pct`||e===`rating`||e===`formula`}function Uf(e){return!yd(e)&&!vd(e)&&dd(e.op)}function dne(e){for(let t of e??[]){if(yd(t)){if(dne(t.children))return!0;continue}if(Uf(t))return!0}return!1}function fne(e){let t=[];for(let n of e??[]){if(yd(n)){let e=fne(n.children);e.length&&t.push({conj:n.conj,children:e});continue}Uf(n)||t.push(n)}return t}function pne(e){let t=[];for(let n of e??[]){if(yd(n)){t.push(...pne(n.children));continue}if(!Uf(n))continue;let e=n;_d(e)&&t.push(e)}return t}function mne(e,t,n){let r=[];for(let n of e){let e=n[t];if(e==null||e===``)continue;let i=typeof e==`number`?e:Number(e);Number.isFinite(i)&&r.push({pid:n.pid,v:i})}return r.sort((e,t)=>e.v===t.v?e.pid-t.pid:n===`asc`?e.v-t.v:t.v-e.v),r}function Wf(e,t,n){let r=Number(e);if(!Number.isFinite(r))return null;let i=Math.trunc(r);return i!==r||in?null:i}function hne(e,t,n){return Math.min(n,Math.floor(e*n/t)+1)}function Gf(e,t){return Math.min(e,Math.max(1,Math.ceil(e*t/100)))}function gne(e,t,n){let r=pne(e);if(!r.length)return lne;let i=new Map,a=0,o=new Map,s=(e,n)=>{let r=`${n}:${e}`,i=o.get(r);return i||(i=mne(t,e,n),o.set(r,i)),i},c=e=>{i.set(e,new Set),a+=1};for(let e of r){let r=n.get(e.colId);if(!r||!une(r.type)){c(e);continue}let o=s(e.colId,`asc`);if(!o.length){i.set(e,new Set),t.length&&(a+=1);continue}let l=o.length,u=null;switch(e.op){case`topN`:{let t=Wf(e.value,1,1e4);u=t==null?null:s(e.colId,`desc`).slice(0,t);break}case`bottomN`:{let t=Wf(e.value,1,1e4);u=t==null?null:o.slice(0,t);break}case`inTopPct`:{let t=Wf(e.value,1,100);u=t==null?null:s(e.colId,`desc`).slice(0,Gf(l,t));break}case`inBottomPct`:{let t=Wf(e.value,1,100);u=t==null?null:o.slice(0,Gf(l,t));break}case`aboveAvg`:case`belowAvg`:{let t=o.reduce((e,t)=>e+t.v,0)/l;u=o.filter(n=>e.op===`aboveAvg`?n.v>t:n.vhne(r,l,t)===n);break}default:u=null}if(u==null){c(e);continue}i.set(e,new Set(u.map(e=>e.pid)))}return{sets:i,unanswerable:a}}function Kf(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:0}function qf(e){return e===`currency`||e===`int`||e===`pct`||e===`rating`||e===`formula`}function _ne(e){return e===`date`||e===`created_time`}function vne(e,t,n){for(let r of n){if(r.type!==`text`&&r.type!==`status`)continue;let n=t[r.key];if(n!=null&&String(n).toLowerCase().includes(e))return!0}return!1}function Jf(e){return e==null||e===``}function yne(e,t,n,r){let i=n.get(e.colId);if(!i)return!0;let a=t[e.colId];if(e.op===`isEmpty`)return Jf(a);if(e.op===`isNotEmpty`)return!Jf(a);if(dd(e.op))return!1;let o=e.rhs!=null,s=o?t[gd(e.rhs)??``]:void 0;if(qf(i.type)){let t=Kf(a);if(o)return Yf(e.op,t,Kf(s));if(e.op===`between`){if(e.value===``||e.value2==null||e.value2===``)return!0;let n=Math.min(Kf(e.value),Kf(e.value2)),r=Math.max(Kf(e.value),Kf(e.value2));return t>=n&&t<=r}return e.value===``||Yf(e.op,t,Kf(e.value))}if(_ne(i.type)){let t=String(a??``).slice(0,10);if(e.op===`within`){if(!r)return!1;let n=Xu(e.dateWindow,r);if(!n||t===``)return!1;let[i,a]=n;return(i==null||t>=i)&&(a==null||t<=a)}if(o)return Xf(e.op,t,String(s??``).slice(0,10));if(e.op===`between`){if(e.value===``||e.value2==null||e.value2===``)return!0;let n=e.value=n&&t<=r}if(!bne.has(e.op)||!e.dateMode&&e.value===``)return!0;let n=e.dateMode||`exact`;if(n!==`exact`&&!r)return!1;let i=Qu(n,e.value,r||`1970-01-01`);return i!=null&&Xf(e.op,t,i)}let c=String(a??``).toLowerCase();return o?Zf(e.op,c,String(s??``).toLowerCase()):e.value===``||Zf(e.op,c,e.value.toLowerCase())}var bne=new Set([`eq`,`neq`,`lt`,`lte`,`gt`,`gte`]);function Yf(e,t,n){switch(e){case`gt`:return t>n;case`gte`:return t>=n;case`lt`:return tn;case`gte`:return t>=n;default:return!0}}function Zf(e,t,n){switch(e){case`contains`:return t.includes(n);case`doesNotContain`:return!t.includes(n);case`eq`:return t===n;case`neq`:return t!==n;default:return!0}}function Qf(e,t,n,r){if(yd(e)){let i=!1,a=!0,o=!1;for(let s of e.children){let e=Qf(s,t,n,r);e!==null&&(i=!0,a&&=e,o||=e)}return i?e.conj===`or`?o:a:null}if(Eee(e)){if(!_d(e))return null;let n=hd(e.value).map(e=>r?.cohortSets?.[e]);if(n.some(e=>!e))return!1;let i=md(e.op);if(i===`allOf`)return n.every(e=>e.has(t.pid));let a=n.some(e=>e.has(t.pid));return i===`noneOf`?!a:a}if(vd(e)){if(!_d(e))return null;let n=e.id?r?.measureSets?.[e.id]:void 0;return n?n.has(t.pid):!1}if(!n.has(e.colId)||e.rhs&&!n.has(gd(e.rhs)??``)||!_d(e))return null;if(dd(e.op)){let n=r?.rankSets?.get(e);return n?n.has(t.pid):!1}return Tee.includes(e.op)?yne(e,t,n,r?.today):!1}function $f(e,t){let n=0;for(let r of e??[]){if(yd(r)){n+=$f(r.children,t);continue}!vd(r)||!_d(r)||(!r.id||!t?.[r.id])&&(n+=1)}return n}function ep(e){let t=[];for(let n of e??[]){if(yd(n)){t.push(...ep(n.children));continue}!vd(n)||!_d(n)||t.push(n.id||`(no-id)`)}return t}function tp(e,t){let n=0;for(let r of e??[]){if(yd(r)){n+=tp(r.children,t);continue}if(_d(r)){if(Eee(r)){hd(r.value).some(e=>!t?.cohortSets?.[e])&&(n+=1);continue}vd(r)||(r.op===`within`?(!t?.today||!Xu(r.dateWindow,t.today))&&(n+=1):r.dateMode&&(!t?.today||Qu(r.dateMode,r.value,t.today)==null)&&(n+=1))}}return n}function np(e,t,n,r,i){let a=Qf({conj:t,children:e},n,r,i);return a===null||a}function xne(e,t){return(n,r)=>{for(let i of e){let e=t.get(i.colId),a=e?qf(e.type):!1,o=n[i.colId],s=r[i.colId],c=Jf(o),l=Jf(s);if(c!==l)return c?1:-1;if(c&&l)continue;let u=a?Kf(o)-Kf(s):String(o??``).localeCompare(String(s??``));if(u!==0)return i.dir===`asc`?u:-u}return 0}}function Sne(e,t,n,r){let i=[],a=new Map,o=r.some(e=>e.key===t&&(e.multi||e.type===`multiselect`)),s=r.some(e=>e.key===t&&e.type===`checkbox`),c=e=>s?e===`1`?`Checked`:`Unchecked`:e===``?`(empty)`:e;for(let n of e){let e=n[t],r=e==null?``:String(e),s=o?r.split(`,`).map(e=>e.trim()).filter(e=>e!==``):[r];for(let e of s.length?s:[``]){let t=a.get(e);t||(t=[],a.set(e,t),i.push(e)),t.push(n)}}let l=[];for(let e of i){let t=a.get(e),i=n.has(e),o=cne(t,r);if(l.push({kind:`group-header`,groupKey:e,label:c(e),count:t.length,collapsed:i,aggs:o}),!i){for(let e of t)l.push({kind:`data`,record:e});l.push({kind:`group-footer`,groupKey:e,aggs:o})}}return l}function rp(e){let{rawRows:t,fields:n,filters:r,search:i,sorts:a,groupBy:o,collapsed:s,memberPids:c=[],filterConj:l=`and`,serverWindowed:u=!1,measureSets:d,cohortSets:f,today:p,cohortLock:m}=e,h={measureSets:d,cohortSets:f,today:p},g=0,_=e=>{let t=e.map(e=>({kind:`data`,record:e})),n=new Map;return t.forEach((e,t)=>{e.kind===`data`&&n.set(e.record.pid,t)}),{visibleRows:t,pidToIndex:n,unresolvedRank:g}};if(u)return _(t);let v=new Map;for(let e of n)v.set(e.key,e);let y=t;if(m){let e=f?.[m];if(!e)return _([]);y=y.filter(t=>e.has(t.pid))}if(r.length){if(dne(r)){let e=fne(r),t=y,n=gne(r,e.length?t.filter(t=>np(e,l,t,v,h)):t,v);h.rankSets=n.sets,g=n.unanswerable}else h.rankSets=lne.sets;let e=new Set(c);y=y.filter(t=>e.has(t.pid)||np(r,l,t,v,h))}let b=i.trim().toLowerCase();if(b&&(y=y.filter(e=>vne(b,e,n))),a.length&&(y=[...y].sort(xne(a,v))),!o)return _(y);let x=Sne(y,o,s,n),S=new Map;return x.forEach((e,t)=>{e.kind===`data`&&!S.has(e.record.pid)&&S.set(e.record.pid,t)}),{visibleRows:x,pidToIndex:S,unresolvedRank:g}}function Cne(e,t,n,r,i,a,o,s=[],c=`and`,l=!1,u,d,f,p){return(0,L.useMemo)(()=>rp({rawRows:e,fields:t,filters:n,search:r,sorts:i,groupBy:a,collapsed:o,memberPids:s,filterConj:c,serverWindowed:l,measureSets:u,cohortSets:d,today:f,cohortLock:p}),[e,t,n,c,r,i,a,o,s,l,u,d,f,p])}var ip=[{bg:`#EDF3FD`,fg:`#4F6079`},{bg:`#EBF6EF`,fg:`#35754E`},{bg:`#FBF4E0`,fg:`#7E6428`},{bg:`#FCEEEC`,fg:`#A3453C`},{bg:`#F1EEFB`,fg:`#6B57A8`},{bg:`#EEF1F4`,fg:`#4B5563`}];function ap(e){if(!(typeof e!=`string`||!/^#[0-9a-f]{6}$/i.test(e.trim())))return e.trim().toUpperCase()}var op=`#182230`,sp=[{id:`blue-tint`,hue:`blue`,strength:`tint`,bg:`#EDF3FD`,fg:`#4F6079`,label:`Light blue`},{id:`green-tint`,hue:`green`,strength:`tint`,bg:`#EBF6EF`,fg:`#35754E`,label:`Light green`},{id:`yellow-tint`,hue:`yellow`,strength:`tint`,bg:`#FBF4E0`,fg:`#7E6428`,label:`Light yellow`},{id:`red-tint`,hue:`red`,strength:`tint`,bg:`#FCEEEC`,fg:`#A3453C`,label:`Light red`},{id:`purple-tint`,hue:`purple`,strength:`tint`,bg:`#F1EEFB`,fg:`#6B57A8`,label:`Light purple`},{id:`blue-pastel`,hue:`blue`,strength:`pastel`,bg:`#9DBFF2`,fg:op,label:`Blue`},{id:`green-pastel`,hue:`green`,strength:`pastel`,bg:`#A5D8B4`,fg:op,label:`Green`},{id:`yellow-pastel`,hue:`yellow`,strength:`pastel`,bg:`#F5D989`,fg:op,label:`Yellow`},{id:`red-pastel`,hue:`red`,strength:`pastel`,bg:`#F0A8A0`,fg:op,label:`Red`},{id:`purple-pastel`,hue:`purple`,strength:`pastel`,bg:`#C3B3EE`,fg:op,label:`Purple`}];function cp(e){let t=ap(e);if(!t)return;let n=up(t,1),r=up(t,3),i=up(t,5),a=sp[0],o=1/0;for(let e of sp){let t=n-up(e.bg,1),s=r-up(e.bg,3),c=i-up(e.bg,5),l=(n+up(e.bg,1))/2,u=(2+l/256)*t*t+4*s*s+(2+(255-l)/256)*c*c;u>>0;return ip[t%ip.length]}function Tne(e,t){let n=e.optionColors;if(!n)return;let r=ap(n[t]);if(r)return r;let i=t.trim().toLowerCase();for(let[e,t]of Object.entries(n))if(e.trim().toLowerCase()===i)return ap(t)}function up(e,t){return Number.parseInt(e.slice(t,t+2),16)}function dp(e){let t=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(up(e,1))+.7152*t(up(e,3))+.0722*t(up(e,5))}function Ene(e){let t=dp(ap(e)??`#FFFFFF`),n=dp(`#182230`),r=dp(`#FFFFFF`);return(t+.05)/(n+.05)>=(r+.05)/(t+.05)?`#182230`:`#FFFFFF`}function fp(e,t){if(!t||e.colorCodeOptions===!1)return;let n=Tne(e,t);return n?wne(n):lp(t)}function pp(e){return lp(e).bg}function mp(e){let t=e.split(`@`)[0].trim().split(/[\s._]+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function Dne(e){return Math.max(14,Math.min(22,e-6))}function One(e,t){return{data:{kind:`aios-user`,name:e,photo:t?.[e]},copyData:e}}function hp(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:0}function gp(e){return e===`1`||e===1||e===!0}function _p(e,t){if(t?.abbrev&&Math.abs(e)>=1e3){let t=Math.abs(e),[n,r]=t>=1e9?[1e9,`B`]:t>=1e6?[1e6,`M`]:[1e3,`k`];return(e/n).toFixed(1)+r}let n=t&&Number.isInteger(t.decimals)&&t.decimals>=0&&t.decimals<=4?t.decimals:null,r=t?.thousands!==!1;return n==null?r?e.toLocaleString():String(e):r?e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n}):e.toFixed(n)}function kne(e){let t=e.includes(` `)?e.replace(` `,`T`):e,n=/T\d{2}:\d{2}/.test(t)&&!/(?:[zZ]|[+-]\d{2}:?\d{2})$/.test(t)?t+`Z`:t,r=new Date(n);return Number.isNaN(r.getTime())?null:r}function vp(e,t){if(t==null||t===``)return``;let n=String(t),r=kne(n);if(!r)return n;let i=e.format,a=i?.time??e.type===`created_time`,o=i?.tz===`utc`?{timeZone:`UTC`}:void 0;return a?r.toLocaleString(void 0,o):r.toLocaleDateString(void 0,o)}function yp(e,t){switch(e.type){case`currency`:return t==null||t===``?``:`$`+_p(hp(t),e.format);case`int`:case`formula`:return t==null||t===``?``:_p(hp(t),e.format);case`pct`:return t==null||t===``?``:hp(t).toFixed(1)+`%`;case`date`:case`created_time`:return vp(e,t);case`checkbox`:return gp(t)?`Checked`:``;case`rating`:{let n=hp(t);return n>=1?`${Math.round(n)} of ${rd(e)}`:``}case`multiselect`:return String(t??``).split(`,`).map(e=>e.trim()).filter(e=>e!==``).join(`, `);default:return String(t??``)}}ct();function Ane(e,t,n,r,i){e.beginPath();for(let i=0;i<10;i+=1){let a=Math.PI/5*i-Math.PI/2,o=i%2==0?r:r*.45,s=t+Math.cos(a)*o,c=n+Math.sin(a)*o;i===0?e.moveTo(s,c):e.lineTo(s,c)}e.closePath(),i?(e.fillStyle=`#A98A3E`,e.fill()):(e.strokeStyle=`rgba(118, 143, 182, 0.55)`,e.lineWidth=1,e.stroke())}var bp=new Map,xp;function Sp(e){xp=e}function jne(e){let t=bp.get(e);if(t!==void 0)return t;if(typeof Image>`u`)return bp.set(e,null),null;let n=new Image;return bp.set(e,n),n.onload=()=>xp?.(),n.onerror=()=>{bp.set(e,null),xp?.()},n.src=e,n}function Mne(e,t,n,r,i,a,o){let s=a?jne(a):null;if(s&&s.complete&&s.naturalWidth>0){e.save(),e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.clip();let i=Math.max(r*2/s.naturalWidth,r*2/s.naturalHeight),a=s.naturalWidth*i,o=s.naturalHeight*i;e.drawImage(s,t-a/2,n-o/2,a,o),e.restore();return}let c=lp(i);e.save(),e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fillStyle=c.bg,e.fill(),e.fillStyle=c.fg,e.font=`600 ${Math.round(r*.9)}px ${o}`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(mp(i),t,n+.5),e.restore()}var Nne={kind:I.Custom,isMatch:e=>e.data?.kind===`aios-user`,draw:(e,t)=>{let{ctx:n,rect:r,theme:i}=e,{name:a,photo:o}=t.data;if(!a)return!0;let s=Dne(r.height),c=r.x+i.cellHorizontalPadding+s/2,l=r.y+r.height/2;return c+s/2>r.x+r.width-i.cellHorizontalPadding||Mne(n,c,l,s/2,a,o,i.fontFamily),!0}},Pne={kind:I.Custom,isMatch:e=>e.data?.kind===`aios-rating`,draw:(e,t)=>{let{ctx:n,rect:r,theme:i}=e,{value:a,max:o}=t.data,s=r.y+r.height/2,c=r.x+i.cellHorizontalPadding+13/2,l=r.x+r.width-i.cellHorizontalPadding;for(let e=0;el);e+=1)Ane(n,c,s,13/2,ee.trim()).filter(e=>e!==``),r=n.length?fp(e,n[0]):void 0;return{kind:I.Bubble,data:n,allowOverlay:!1,themeOverride:r?{bgBubble:r.bg,textBubble:r.fg}:void 0}}default:return{kind:I.Text,data:String(t??``),displayData:String(t??``),...i}}}ct();var Cp={kind:I.Text,data:``,displayData:``,allowOverlay:!1};function Ine(e,t,n,r,i){let a=e.collapsed?`▶`:`▼`,o=e.count.toLocaleString(),s=`${a} ${e.label} (${o})`,c=i?Gte(a,e.label,o,r,i):s;return{kind:I.Text,data:s,displayData:t===0?c:``,allowOverlay:!1,span:[0,Math.max(0,n-1)],themeOverride:{bgCell:`#eef0f3`,bgCellMedium:`#eef0f3`,textDark:`#33333d`,baseFontStyle:Wte}}}function Lne(e,t){let n=t?e.aggs[t.key]:void 0;return{kind:I.Text,data:n??``,displayData:n??``,contentAlign:`right`,allowOverlay:!1,themeOverride:{bgCell:`#f6f7f9`,bgCellMedium:`#f6f7f9`,textDark:`#4a4a55`,baseFontStyle:`600 12px`}}}function Rne(e,t,n,r,i,a,o=0,s=null,c){return(0,L.useCallback)(([o,l])=>{let u=e[l];if(!u)return Cp;let d=t[o],f=d?n.get(d.id):void 0;return u.kind===`group-header`?Ine(u,o,t.length,s,c):u.kind===`group-footer`?Lne(u,f):f?Fne(f,r[u.record.pid]?.[f.key]??u.record[f.key],i(f),a):Cp},[e,t,n,r,i,a,o,s,c])}ct();function zne(e,t,n){let[r,i]=(0,L.useState)(new Set),[a,o]=(0,L.useState)(void 0),s=(0,L.useRef)(null);return(0,L.useEffect)(()=>{o(e=>{if(!e)return e;let n=s.current,r=n==null?void 0:t.get(n);if(r!==void 0)return r===e.cell[1]?e:{cell:[e.cell[0],r],range:{x:e.cell[0],y:r,width:1,height:1},rangeStack:[]}})},[e,t]),{gridSelection:(0,L.useMemo)(()=>{let i=st.empty();for(let e of r){let n=t.get(e);n!==void 0&&(i=i.add(n))}return{current:a&&a.cell[1]{o(t.current);let n=t.current?e[t.current.cell[1]]:void 0;s.current=n&&n.kind===`data`?n.record.pid:null;let r=new Set;for(let n of t.rows){let t=e[n];t&&t.kind===`data`&&r.add(t.record.pid)}i(r)},[e]),selectPids:(0,L.useCallback)((e,t)=>{i(n=>{let r=t===`add`?new Set(n):new Set;for(let t of e)r.add(t);return r})},[]),togglePid:(0,L.useCallback)(e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),setActiveCell:(0,L.useCallback)((t,n)=>{let r=e[n];s.current=r&&r.kind===`data`?r.record.pid:null,o({cell:[t,n],range:{x:t,y:n,width:1,height:1},rangeStack:[]})},[e]),clearSelection:(0,L.useCallback)(()=>{i(new Set),o(void 0),s.current=null},[])}}var wp=[{key:`filters`,label:`Filter conditions`,blurb:`Which records the view shows, and how the conditions combine.`},{key:`sorts`,label:`Sorts`,blurb:`The order records are listed in.`},{key:`groupBy`,label:`Groups`,blurb:`The field records are bucketed by.`},{key:`visible`,label:`Hidden fields`,blurb:`Which columns are shown.`},{key:`order`,label:`Field order`,blurb:`Left-to-right column order.`},{key:`rowHeightMode`,label:`Row height`,blurb:`Short, medium or tall rows.`}],Tp=wp.map(e=>e.key);function Bne(e){return typeof e==`string`&&Tp.includes(e)}function Ep(e){return JSON.parse(JSON.stringify(e))}function Vne(e,t,n){let r={};if(!e)return r;let i=new Set;for(let e of t)Bne(e)&&i.add(e);if(i.size===0)return r;if(i.has(`filters`)&&(r.filters=Ep(Array.isArray(e.filters)?e.filters:[]),r.filterConj=e.filterConj),i.has(`sorts`)&&(r.sorts=Ep(Array.isArray(e.sorts)?e.sorts:[])),i.has(`groupBy`)&&(r.groupBy=e.groupBy??null),i.has(`visible`)){let t=Ep(Array.isArray(e.visible)?e.visible:[]);r.visible=n&&!t.includes(n)?[n,...t]:t}return i.has(`order`)&&(r.order=Ep(Array.isArray(e.order)?e.order:[])),i.has(`rowHeightMode`)&&e.rowHeightMode&&(r.rowHeightMode=e.rowHeightMode),r}var Hne=s((e=>{var t=f(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),Dp=s(((e,t)=>{t.exports=Hne()})),Une=g(),B=Dp(),Op=(0,L.createContext)(null),kp=[`[data-overlay-autofocus]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[href]`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function Ap({children:e}){let t=(0,L.useRef)([]),n=(0,L.useMemo)(()=>({register:e=>(t.current=[...t.current.filter(t=>t!==e),e],()=>{t.current=t.current.filter(t=>t!==e)}),isTop:e=>t.current.at(-1)===e}),[]);return(0,B.jsx)(Op.Provider,{value:n,children:e})}function Wne(e){if(`getBoundingClientRect`in e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}}return e}function Gne(e,t){return e.left===t.left&&e.top===t.top&&e.maxWidth===t.maxWidth&&e.maxHeight===t.maxHeight&&e.visibility===t.visibility}function jp({panelRef:e,onDismiss:t,dismissOnOutside:n=!0,initialFocus:r=`first`,restoreFocus:i=!0,trapFocus:a=!1,outsideElements:o=[]}){let s=(0,L.useId)(),c=(0,L.useContext)(Op),l=(0,L.useRef)(t),u=(0,L.useRef)(o);l.current=t,u.current=o,(0,L.useEffect)(()=>c?.register(s),[s,c]),(0,L.useEffect)(()=>{let t=t=>{if(!n||c&&!c.isTop(s))return;let r=t.target;!r||e.current?.contains(r)||u.current.some(e=>e?.contains(r))||(document.activeElement instanceof HTMLElement&&e.current?.contains(document.activeElement)&&document.activeElement.blur(),l.current())},r=t=>{if(c&&!c.isTop(s))return;if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),document.activeElement instanceof HTMLElement&&e.current?.contains(document.activeElement)&&document.activeElement.blur(),l.current();return}if(t.key!==`Tab`||!a)return;let n=Array.from(e.current?.querySelectorAll(kp)??[]).filter(e=>e.getClientRects().length>0);if(!n.length){t.preventDefault(),e.current?.focus();return}let r=n[0],i=n.at(-1),o=document.activeElement;t.shiftKey&&(o===r||!e.current?.contains(o))?(t.preventDefault(),i.focus()):!t.shiftKey&&o===i&&(t.preventDefault(),r.focus())};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`keydown`,r,!0)}},[n,s,e,c,a]),(0,L.useLayoutEffect)(()=>{let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=window.requestAnimationFrame(()=>{if(r===`none`)return;let t=r===`first`?kp:r;(e.current?.querySelector(t))?.focus({preventScroll:!0})});return()=>{window.cancelAnimationFrame(n),i&&t?.isConnected&&t.focus({preventScroll:!0})}},[r,e,i])}function Mp({children:e}){return(0,Une.createPortal)(e,document.body)}function Np({anchor:e,className:t,children:n,onDismiss:r,placement:i=`bottom-start`,role:a,ariaLabel:o,id:s,initialFocus:c=`first`,restoreFocus:l=!0,dismissOnOutside:u=!0,onKeyDown:d,dataKind:f}){let p=(0,L.useRef)(null),[m,h]=(0,L.useState)({position:`fixed`,left:0,top:0,visibility:`hidden`}),g=`getBoundingClientRect`in e?e:null;jp({panelRef:p,onDismiss:r,dismissOnOutside:u,initialFocus:c,restoreFocus:l,outsideElements:[g]});let _=(0,L.useCallback)(()=>{let t=p.current;if(!t)return;let n=Wne(e),r=window.visualViewport,a=r?.offsetLeft??0,o=r?.offsetTop??0,s=r?.width??window.innerWidth,c=r?.height??window.innerHeight,l=t.getBoundingClientRect(),u=Zte({placement:i,target:n,panel:{width:Math.max(l.width,t.scrollWidth),height:Math.max(l.height,t.scrollHeight)},viewport:{left:a,top:o,width:s,height:c}}),d={position:`fixed`,left:u.left,top:u.top,maxWidth:u.maxWidth,maxHeight:u.maxHeight,visibility:`visible`};h(e=>Gne(e,d)?e:d)},[e,i]);return(0,L.useLayoutEffect)(()=>{_();let e=window.requestAnimationFrame(_),t=new ResizeObserver(_);return p.current&&t.observe(p.current),g&&t.observe(g),window.addEventListener(`resize`,_),window.addEventListener(`scroll`,_,!0),window.visualViewport?.addEventListener(`resize`,_),window.visualViewport?.addEventListener(`scroll`,_),()=>{window.cancelAnimationFrame(e),t.disconnect(),window.removeEventListener(`resize`,_),window.removeEventListener(`scroll`,_,!0),window.visualViewport?.removeEventListener(`resize`,_),window.visualViewport?.removeEventListener(`scroll`,_)}},[g,_]),(0,B.jsx)(Mp,{children:(0,B.jsx)(`div`,{ref:p,id:s,className:t,style:m,role:a,"aria-label":o,"data-overlay-kind":f,onKeyDown:d,children:n})})}function Pp({shapes:e}){return(0,B.jsx)(B.Fragment,{children:e.map((e,t)=>e.fill?(0,B.jsx)(`path`,{d:e.d,fill:`currentColor`},t):(0,B.jsx)(`path`,{d:e.d,fill:`none`,stroke:`currentColor`,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},t))})}function Fp({type:e,size:t=14,title:n}){return(0,B.jsxs)(`svg`,{className:`cg-type-icon`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!n||void 0,role:n?`img`:void 0,"aria-label":n,children:[n&&(0,B.jsx)(`title`,{children:n}),(0,B.jsx)(Pp,{shapes:Ff[e===`measure`?`currency`:e]})]})}function Ip({mode:e,size:t=14}){return(0,B.jsx)(`svg`,{className:`cg-mode-icon`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!0,children:(0,B.jsx)(Pp,{shapes:If[e]})})}function Lp({mode:e,tone:t,size:n=15}){let r=Lf[t];return(0,B.jsx)(`svg`,{className:`cg-mode-icon cg-tone-icon`,width:n,height:n,viewBox:`0 0 16 16`,"aria-hidden":!0,children:If[e].map((e,t)=>e.fill?(0,B.jsx)(`path`,{d:e.d,fill:r.stroke},t):(0,B.jsx)(`path`,{d:e.d,fill:`none`,stroke:r.stroke,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},t))})}function Kne({kind:e,size:t=15}){let n=Lf[Mte[e]];return(0,B.jsx)(`svg`,{className:`cg-mode-icon cg-tone-icon`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!0,children:jte[e].map((t,r)=>(0,B.jsx)(`path`,{d:t.d,fill:r===0&&(e===`area`||e===`donut`||e===`kpi`||e===`table`)?n.fill:`none`,stroke:n.stroke,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},r))})}var qne={width:16,height:16,viewBox:`0 0 16 16`,fill:`none`},Rp={stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`,strokeLinejoin:`round`},Jne={duplicate:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`rect`,{x:`5.5`,y:`5.5`,width:`8`,height:`8`,rx:`1.5`,...Rp}),(0,B.jsx)(`path`,{d:`M10.5 2.5h-7a1 1 0 0 0-1 1v7`,...Rp})]}),insertLeft:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`line`,{x1:`3`,y1:`2.5`,x2:`3`,y2:`13.5`,...Rp}),(0,B.jsx)(`path`,{d:`M13.5 8H6.5M9.2 5.3 6.5 8l2.7 2.7`,...Rp})]}),insertRight:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`line`,{x1:`13`,y1:`2.5`,x2:`13`,y2:`13.5`,...Rp}),(0,B.jsx)(`path`,{d:`M2.5 8h7M6.8 5.3 9.5 8l-2.7 2.7`,...Rp})]}),addEnd:(0,B.jsx)(`path`,{d:`M8 3v10M3 8h10`,...Rp}),rename:(0,B.jsx)(`path`,{d:`m9.8 3.2 3 3L6.2 12.8l-3.6.6.6-3.6 6.6-6.6Z`,...Rp}),description:(0,B.jsx)(`path`,{d:`M3 4.5h10M3 8h10M3 11.5h6`,...Rp}),permissions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`rect`,{x:`3.5`,y:`7`,width:`9`,height:`6`,rx:`1`,...Rp}),(0,B.jsx)(`path`,{d:`M5.5 7V5.2a2.5 2.5 0 0 1 5 0V7`,...Rp})]}),unlock:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`rect`,{x:`3.5`,y:`7`,width:`9`,height:`6`,rx:`1`,...Rp}),(0,B.jsx)(`path`,{d:`M5.5 7V5.2a2.5 2.5 0 0 1 5 0`,...Rp})]}),format:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M3 5h5.5M12.5 5H13M3 11h1M7 11h6`,...Rp}),(0,B.jsx)(`circle`,{cx:`10.5`,cy:`5`,r:`1.6`,...Rp}),(0,B.jsx)(`circle`,{cx:`4.9`,cy:`11`,r:`1.6`,...Rp})]}),swap:(0,B.jsx)(`path`,{d:`M3.5 6h9M10.2 3.7 12.5 6l-2.3 2.3M12.5 10.5h-9M5.8 8.2 3.5 10.5l2.3 2.3`,...Rp}),sortAsc:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M4.5 3v10M4.5 13l-2-2M4.5 13l2-2`,...Rp}),(0,B.jsx)(`path`,{d:`M8.5 4.5h2M8.5 8h3.5M8.5 11.5h5`,...Rp})]}),sortDesc:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M4.5 3v10M4.5 13l-2-2M4.5 13l2-2`,...Rp}),(0,B.jsx)(`path`,{d:`M8.5 4.5h5M8.5 8h3.5M8.5 11.5h2`,...Rp})]}),off:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,...Rp}),(0,B.jsx)(`line`,{x1:`4.4`,y1:`11.6`,x2:`11.6`,y2:`4.4`,...Rp})]}),filter:(0,B.jsx)(`path`,{d:`M2.5 3.5h11L9.5 8.5v3.8L6.5 14V8.5L2.5 3.5Z`,...Rp}),group:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`line`,{x1:`2.5`,y1:`4`,x2:`13.5`,y2:`4`,...Rp}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`8`,x2:`13.5`,y2:`8`,...Rp}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`12`,x2:`13.5`,y2:`12`,...Rp})]}),pin:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M6 2.5h4l-.5 4L12 9v1H4V9l2.5-2.5L6 2.5Z`,...Rp}),(0,B.jsx)(`line`,{x1:`8`,y1:`10`,x2:`8`,y2:`13.5`,...Rp})]}),unpin:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M6 2.5h4l-.5 4L12 9v1H4V9l2.5-2.5L6 2.5Z`,...Rp}),(0,B.jsx)(`line`,{x1:`8`,y1:`10`,x2:`8`,y2:`13.5`,...Rp}),(0,B.jsx)(`line`,{x1:`3`,y1:`13`,x2:`13`,y2:`3`,...Rp})]}),hide:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M2.5 8s2-3.5 5.5-3.5S13.5 8 13.5 8s-2 3.5-5.5 3.5S2.5 8 2.5 8Z`,...Rp}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`,...Rp}),(0,B.jsx)(`line`,{x1:`3.5`,y1:`12.5`,x2:`12.5`,y2:`3.5`,...Rp})]}),trash:(0,B.jsx)(`path`,{d:`M3.5 4.5h9M6.5 4.5V3h3v1.5M5 4.5l.6 8.5h4.8l.6-8.5`,...Rp}),download:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M8 2.5v7M5.3 6.8 8 9.5l2.7-2.7`,...Rp}),(0,B.jsx)(`path`,{d:`M3 11v1.5a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V11`,...Rp})]}),cohortAdd:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M2.5 4h7M2.5 7.5h5M2.5 11h4`,...Rp}),(0,B.jsx)(`path`,{d:`M11.5 8.5v5M9 11h5`,...Rp})]})};function Yne({name:e}){return(0,B.jsx)(`svg`,{...qne,"aria-hidden":!0,children:Jne[e]})}function zp({icon:e,text:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`cg-mi-ic`,"aria-hidden":!0,children:typeof e==`string`?(0,B.jsx)(Yne,{name:e}):e}),(0,B.jsx)(`span`,{className:`cg-mi-text`,children:t})]})}function Bp({size:e=14}){return(0,B.jsxs)(`svg`,{className:`cg-eyeoff-icon`,width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:[(0,B.jsx)(`path`,{d:`M2.5 8s2-3.5 5.5-3.5S13.5 8 13.5 8s-2 3.5-5.5 3.5S2.5 8 2.5 8Z`,stroke:`currentColor`,strokeWidth:1.4,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M9.6 8a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0Z`,stroke:`currentColor`,strokeWidth:1.4,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M3.3 12.7 12.7 3.3`,stroke:`currentColor`,strokeWidth:1.4,strokeLinecap:`round`})]})}function Vp({size:e=11}){return(0,B.jsxs)(`svg`,{className:`cg-lock-mark`,width:e,height:e,viewBox:`0 0 16 16`,"aria-hidden":!0,children:[(0,B.jsx)(`path`,{d:`M4.2 7.2h7.6v5.6H4.2z`,fill:`none`,stroke:`currentColor`,strokeWidth:1.35,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M5.9 7.2V5.5a2.1 2.1 0 0 1 4.2 0v1.7`,fill:`none`,stroke:`currentColor`,strokeWidth:1.35,strokeLinecap:`round`})]})}function Hp({icon:e,size:t=14}){let n=e?.shape??`folder`,r=Lf[e?.tone??`neutral`];return(0,B.jsx)(`svg`,{className:`cg-folder-mark`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!0,children:Nte[n].map((e,t)=>(0,B.jsx)(`path`,{d:e.d,fill:`none`,stroke:r.stroke,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},t))})}function Up({item:e}){return e.icon?(0,B.jsx)(B.Fragment,{children:e.icon}):e.type?(0,B.jsx)(Fp,{type:e.type,title:e.type===`measure`?`Metric`:zf[e.type]}):(0,B.jsx)(`span`,{className:`cg-fsel-nomark`,"aria-hidden":!0})}function Xne(){return(0,B.jsx)(`svg`,{className:`cg-fsel-caret`,width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M4 6l4 4 4-4`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Zne(){return(0,B.jsx)(`svg`,{className:`cg-type-check`,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`m3.5 8.5 3 3 6-6.5`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`})})}var Wp=8;function Gp({fields:e,value:t,onChange:n,placeholder:r=`Choose a field…`,allow:i,ariaLabel:a,className:o,disabled:s,title:c,keepOpen:l,overlayAutofocus:u}){let[d,f]=(0,L.useState)(!1),[p,m]=(0,L.useState)(``),h=(0,L.useRef)(null),g=(0,L.useRef)(null),_=(0,L.useMemo)(()=>i?e.filter(e=>e.type!=null&&i.includes(e.type)):e,[e,i]),v=t!=null,y=v?e.find(e=>e.key===t):void 0,b=p.trim().toLowerCase(),x=b?_.filter(e=>e.label.toLowerCase().includes(b)):_,S=()=>{f(!1),m(``)},C=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`&&e.key!==`Home`&&e.key!==`End`)return;let t=Array.from(g.current?.querySelectorAll(`button.cg-type-row`)??[]).filter(e=>!e.disabled);if(!t.length)return;e.preventDefault();let n=t.indexOf(document.activeElement);if(e.key===`Home`)return t[0].focus();if(e.key===`End`)return t[t.length-1].focus();let r=e.key===`ArrowDown`?1:-1;t[n<0?r===1?0:t.length-1:(n+r+t.length)%t.length].focus()},w;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{ref:h,type:`button`,disabled:s,className:`cg-select cg-fsel`+(y?``:v&&t!==``?` is-missing`:` is-empty`)+(o?` ${o}`:``),"aria-label":a,"aria-haspopup":`listbox`,"aria-expanded":d,"data-overlay-autofocus":u?!0:void 0,onClick:()=>f(e=>!e),children:[y?(0,B.jsx)(Up,{item:y}):(0,B.jsx)(`span`,{className:`cg-fsel-nomark`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`cg-fsel-label`,children:y?.label??(v&&t!==``?t:r)}),(0,B.jsx)(Xne,{})]}),d&&h.current&&(0,B.jsx)(Np,{anchor:h.current,className:`cg-pop cg-fsel-pop`,onDismiss:S,role:`dialog`,ariaLabel:a??c??`Choose a field`,initialFocus:_.length>=Wp?`.cg-fsel-search input`:`button.cg-type-row`,dataKind:`field-select`,children:(0,B.jsxs)(`div`,{className:`cg-fsel-body`,onKeyDown:C,children:[c&&(0,B.jsx)(`div`,{className:`cg-pop-title`,children:c}),_.length>=Wp&&(0,B.jsxs)(`div`,{className:`cg-type-search cg-fsel-search`,children:[(0,B.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:[(0,B.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.4`,stroke:`currentColor`,strokeWidth:`1.35`}),(0,B.jsx)(`path`,{d:`m10.4 10.4 3.1 3.1`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`})]}),(0,B.jsx)(`input`,{type:`text`,value:p,placeholder:`Find a field…`,"aria-label":`Find a field`,onChange:e=>m(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`cg-type-list`,role:`listbox`,ref:g,"aria-label":a??c??`Fields`,children:[x.map(e=>{let r=e.group&&e.group!==w?e.group:null;return w=e.group,(0,B.jsxs)(L.Fragment,{children:[r&&(0,B.jsx)(`div`,{className:`cg-fsel-group`,role:`presentation`,children:r}),(0,B.jsxs)(`button`,{type:`button`,role:`option`,disabled:e.disabled,"aria-selected":e.key===t,className:`cg-type-row`+(e.key===t?` is-on`:``),onClick:()=>{n(e.key),l?m(``):S()},children:[(0,B.jsx)(Up,{item:e}),(0,B.jsxs)(`span`,{className:`cg-type-label`,children:[e.label,e.hint&&(0,B.jsx)(`span`,{className:`cg-fsel-hint`,children:e.hint})]}),e.key===t&&(0,B.jsx)(Zne,{})]})]},e.key)}),x.length===0&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:_.length===0?`No field to choose here.`:`No field matches.`})]})]})})]})}function Kp(e,t){let n=e=>e.toLocaleString();if(!t?.windowed)return`${n(e)} ${e===1?`record`:`records`}`;let r=t.matched===1?`record`:`records`,i=t.matched=t.matched?`${n(t.matched)} ${r}${i}`:`showing ${n(t.shown)} of ${n(t.matched)} ${r}${i}`}function qp(e){if(!e?.partial)return null;let t=typeof e.loaded==`number`&&Number.isFinite(e.loaded)&&e.loaded>=0?Math.floor(e.loaded):0,n=typeof e.total==`number`&&Number.isFinite(e.total)&&e.total>0?Math.floor(e.total).toLocaleString():`…`;return`${t.toLocaleString()} of ${n}`}function Qne(e,t){if(!t?.windowed)return Kp(e,t);let n=e=>e.toLocaleString();return t.shown>=t.matched?`${n(t.matched)} ${t.matched===1?`record`:`records`}`:`showing ${n(t.shown)} of ${n(t.matched)}`}function Jp({window:e,onWindow:t,kinds:n=Pu}){let r=e.kind;return(0,B.jsxs)(`span`,{className:`cg-cond-window`,children:[(0,B.jsx)(`select`,{className:`cg-select cg-cond-win-kind`,value:r,"aria-label":`Date window`,onChange:n=>{let r=n.target.value;Fu.has(r)?t({kind:r,n:e.n??30}):t(r===`custom`?{kind:r,from:e.from??``,to:e.to??``}:{kind:r})},children:(n.includes(r)?n:[...n,r]).map(e=>(0,B.jsx)(`option`,{value:e,children:Fu.has(e)?Iu[e].replace(`{n}`,`N`):Iu[e]},e))}),Fu.has(r)&&(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-n`,type:`number`,min:1,max:3650,"aria-label":`Number of days`,value:e.n??``,onChange:n=>t({...e,n:n.target.value===``?void 0:Number(n.target.value)})}),r===`custom`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-date`,type:`date`,"aria-label":`Window start`,value:e.from??``,onChange:n=>t({...e,from:n.target.value})}),(0,B.jsx)(`span`,{className:`cg-cond-and`,children:`and`}),(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-date`,type:`date`,"aria-label":`Window end`,value:e.to??``,onChange:n=>t({...e,to:n.target.value})})]})]})}var Yp=cd,Xp=ld;function Zp(e){return e===`checkbox`?[`isNotEmpty`,`isEmpty`]:Yp(e)?[`gte`,`gt`,`lte`,`lt`,`eq`,`neq`,`between`,`isEmpty`,`isNotEmpty`]:Xp(e)?[`eq`,`within`,`lt`,`gt`,`lte`,`gte`,`neq`,`isEmpty`,`isNotEmpty`]:e===`status`||e===`select`||e===`user`?[`eq`,`neq`,`isEmpty`,`isNotEmpty`]:[`contains`,`doesNotContain`,`eq`,`neq`,`isEmpty`,`isNotEmpty`]}var $ne={topN:`top N`,bottomN:`bottom N`,inTopPct:`top N%`,inBottomPct:`bottom N%`,aboveAvg:`above average`,belowAvg:`below average`,inQuartile:`in quartile`,inDecile:`in decile`};function ere(e){switch(e){case`topN`:case`bottomN`:case`inTopPct`:case`inBottomPct`:case`inDecile`:return`10`;case`inQuartile`:return`4`;default:return``}}function Qp(e){for(let t of e??[]){if(yd(t)){if(Qp(t.children))return!0;continue}if(dd(t.op)&&!vd(t))return!0}return!1}function $p(e,t){if(dd(e))return $ne[e]??e;if(t===`checkbox`){if(e===`isNotEmpty`)return`is checked`;if(e===`isEmpty`)return`is unchecked`}if(e===`isEmpty`)return`is empty`;if(e===`isNotEmpty`)return`is not empty`;if(Xp(t))switch(e){case`eq`:return`is`;case`neq`:return`is not`;case`within`:return`is within`;case`lt`:return`is before`;case`lte`:return`is on or before`;case`gt`:return`is after`;case`gte`:return`is on or after`;case`between`:return`is between`}if(Yp(t))switch(e){case`gte`:return`≥`;case`gt`:return`>`;case`lte`:return`≤`;case`lt`:return`<`;case`eq`:return`=`;case`neq`:return`≠`;case`between`:return`is between`;default:return e}if(t===`multiselect`)switch(e){case`contains`:return`has`;case`doesNotContain`:return`does not have`;case`eq`:return`is exactly`;case`neq`:return`is not exactly`;default:return e}switch(e){case`contains`:return`contains`;case`doesNotContain`:return`does not contain`;case`eq`:return`is`;case`neq`:return`is not`;default:return e}}function tre(e,t){return t&&!e.includes(t)?[...e,t]:[...e]}function nre(e){return e===`or`?`Any of the following are true…`:`All of the following are true…`}var em=[...Mee],tm=[...Nee],nm=[...Dee];function rre(e){switch(md(e)){case`allOf`:return`is all of`;case`noneOf`:return`is none of`;default:return`is any of`}}var rm=`measure`,im={kind:`ltm`},am={kind:`past_month`},ire=[`last_n_days`,`past_week`,`past_month`,`past_year`,`this_week`,`this_month`,`this_year`,`custom`];function are(e,t,n,r,i){let a=e.map(e=>({key:e.key,label:e.label,type:e.type})),o=new Set(a.map(e=>e.key));if(!t||o.has(t)||r.has(t)||t===`__cohort__`&&i)return a;let s=n.get(t);return a.push({key:t,label:s?s.label:t,type:s?.type}),a}var om=0;function sm(){return om+=1,`r${Date.now().toString(36)}${om.toString(36)}`}function cm(e){let t=e[0];return t?{colId:t.key,op:Zp(t.type)[0],value:``}:null}function lm(e){let t=0;for(let n of e)t+=yd(n)?lm(n.children):1;return t}function ore({rule:e,onPatch:t}){let n=e.dateMode??`exact`;return(0,B.jsxs)(`span`,{className:`cg-cond-anchor`,children:[(0,B.jsx)(`select`,{className:`cg-select cg-cond-anchor-mode`,value:n,"aria-label":`Date`,onChange:e=>{let n=e.target.value;t({dateMode:n,value:``})},children:Lu.map(e=>(0,B.jsx)(`option`,{value:e,children:e===`n_days_ago`?Ru[e].replace(`{n}`,`N`):Ru[e]},e))}),n===`n_days_ago`&&(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-n`,type:`number`,min:0,max:3650,"aria-label":`Number of days ago`,value:e.value,onChange:e=>t({value:e.target.value})}),n===`exact`&&(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:`date`,"aria-label":`Date`,value:e.value,onChange:e=>t({value:e.target.value})})]})}function sre({rule:e,options:t,isMeasure:n,onPatch:r}){let i=e.rhs,a=gd(i)??``;return(0,B.jsxs)(`span`,{className:`cg-cond-rhs`,children:[(0,B.jsx)(Gp,{className:`cg-cond-field`,ariaLabel:`Compare with field`,placeholder:`Select a field…`,value:a||void 0,fields:t,onChange:e=>{r({rhs:n?{kind:`measure`,colId:e,window:i?.kind===`measure`&&i.window||im}:{kind:`field`,colId:e}})}}),n&&a!==``&&(0,B.jsx)(Jp,{window:i?.kind===`measure`&&i.window||im,onWindow:e=>r({rhs:{kind:`measure`,colId:a,window:e}})})]})}function cre({rule:e,type:t,statusOptions:n,onValue:r,onValue2:i}){if(e.op===`between`){let n=t===`date`||t===`created_time`?`date`:`number`;return(0,B.jsxs)(`span`,{className:`cg-cond-between`,children:[(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:n,value:e.value,onChange:e=>r(e.target.value)}),(0,B.jsx)(`span`,{className:`cg-cond-and`,children:`and`}),(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:n,value:e.value2??``,onChange:e=>i(e.target.value)})]})}return t===`status`||t===`select`||t===`user`||t===`multiselect`?(0,B.jsxs)(`select`,{className:`cg-select cg-cond-val`,value:e.value,onChange:e=>r(e.target.value),children:[(0,B.jsx)(`option`,{value:``,children:`Select…`}),n.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}):(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:t===`date`||t===`created_time`?`date`:Yp(t)?`number`:`text`,placeholder:`Value`,value:e.value,onChange:e=>r(e.target.value)})}function lre({rule:e,onValue:t}){let n=e.op===`inQuartile`?4:e.op===`inDecile`?10:0;if(n)return(0,B.jsx)(`select`,{className:`cg-select cg-cond-val`,value:e.value,"aria-label":e.op===`inQuartile`?`Quartile`:`Decile`,onChange:e=>t(e.target.value),children:Array.from({length:n},(e,t)=>String(t+1)).map(e=>(0,B.jsx)(`option`,{value:e,children:e===`1`?`${e} (lowest)`:e===String(n)?`${e} (highest)`:e},e))});let r=e.op===`inTopPct`||e.op===`inBottomPct`;return(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:`number`,min:1,max:r?100:1e4,step:1,placeholder:`10`,"aria-label":r?`Percent`:`How many`,value:e.value,onChange:e=>t(e.target.value)})}function ure({rule:e,lists:t,onPatch:n}){let r=hd(e.value),i=new Map(t.map(e=>[e.id,e.name])),a=t.filter(e=>!r.includes(e.id)),o=a.length>0&&r.length<20,s=e=>n({value:e.join(`,`)});return(0,B.jsxs)(`span`,{className:`cg-cond-cohorts`,children:[r.map(e=>(0,B.jsxs)(`span`,{className:`cg-chip`+(i.has(e)?``:` cg-chip--gone`),children:[(0,B.jsx)(`span`,{className:`cg-chip-text`,children:i.get(e)??`(deleted list)`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-chip-x`,"aria-label":`Remove ${i.get(e)??e}`,onClick:()=>s(r.filter(t=>t!==e)),children:`×`})]},e)),(0,B.jsxs)(`select`,{className:`cg-select cg-cond-val cg-cond-cohort-add`,value:``,"aria-label":`Cohort`,disabled:!o,onChange:e=>e.target.value&&s([...r,e.target.value]),children:[(0,B.jsx)(`option`,{value:``,children:o?r.length?`Add a cohort…`:`Select a cohort…`:`all added`}),a.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})}function dre({index:e,conj:t,onConj:n}){return e===0?(0,B.jsx)(`span`,{className:`cg-cond-prefix`,children:`Where`}):e===1?(0,B.jsxs)(`select`,{className:`cg-select cg-cond-conj`,value:t,"aria-label":`Combine conditions with`,onChange:e=>n(e.target.value),children:[(0,B.jsx)(`option`,{value:`and`,children:`and`}),(0,B.jsx)(`option`,{value:`or`,children:`or`})]}):(0,B.jsx)(`span`,{className:`cg-cond-prefix cg-cond-conj-echo`,children:t})}function um({nodes:e,conj:t,depth:n,ctx:r,onNodes:i,onConj:a}){let[o,s]=(0,L.useState)(null),c=(t,n)=>i(e.map((e,r)=>r===t?n:e)),l=t=>i(e.filter((e,n)=>n!==t)),u=()=>{let t=cm(r.fields);t&&i([...e,t])},d=()=>{let t=cm(r.fields);t&&i([...e,{conj:`or`,children:[t]}])},f=n<3;return(0,B.jsxs)(B.Fragment,{children:[e.map((e,i)=>(0,B.jsxs)(`div`,{className:`cg-cond-line`,children:[(0,B.jsx)(dre,{index:i,conj:t,onConj:a}),yd(e)?(0,B.jsx)(pre,{group:e,depth:n+1,ctx:r,onGroup:e=>c(i,e),onRemove:()=>l(i)}):(0,B.jsx)(fre,{rule:e,ctx:r,onRule:e=>c(i,e),onRemove:()=>l(i)})]},i)),(0,B.jsxs)(`div`,{className:`cg-builder-add`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`+(o===`condition`?` is-on`:``),onClick:()=>{s(`condition`),u()},children:`+ Add condition`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`+(o===`group`?` is-on`:``),onClick:()=>{s(`group`),d()},disabled:!f,title:f?`Group conditions so they evaluate together`:`Condition groups can nest 3 levels deep`,children:`+ Add condition group`})]})]})}function fre({rule:e,ctx:t,onRule:n,onRemove:r}){let{fields:i,fieldByKey:a,measures:o,measureByKey:s,lists:c,choicesFor:l}=t,u=vd(e),d=e.colId===pd,f=c.length>0,p=u?s.get(e.colId)?.type??`currency`:a.get(e.colId)?.type??`text`,m=t=>n({...e,...t}),h=t=>{if(t===`__cohort__`){n({colId:pd,op:nm[0],value:``});return}if(s.get(t)){n({id:e.id??sm(),colId:t,op:em[0],value:``,value2:void 0,window:e.window??im});return}n({colId:t,op:Zp(a.get(t)?.type??`text`)[0],value:``,value2:void 0})},g=t=>{if(d)return m({op:t});if(dd(t))return n({...e,op:t,value:ere(t),value2:void 0,rhs:void 0,dateWindow:void 0});if(fd.has(t))return n({...e,op:t,value:``,value2:void 0,rhs:void 0});if(t===`within`)return n({...e,op:t,value:``,value2:void 0,rhs:void 0,dateWindow:e.dateWindow??am});if(e.op===`within`)return n({...e,op:t,dateWindow:void 0,value:``});m({op:t})},_=u?o.map(e=>({key:e.key,label:e.label,type:rm})):i.filter(t=>t.key!==e.colId&&(Yp(p)?Yp(t.type):t.type===p)).map(e=>({key:e.key,label:e.label,type:e.type})),v=!d&&e.op!==`within`&&!fd.has(e.op)&&!dd(e.op)&&_.length>0&&(u||Yp(p)||Xp(p)),y=e.rhs?.kind===`stat`,b=e.rhs!=null&&!y,x=u?b||y?tm:em:d?nm:Zp(p),S=d?md(e.op):e.op,C=tre(!u&&!d&&Yp(p)?[...x,...wee]:x,S),w=C.filter(e=>!dd(e)),T=C.filter(e=>dd(e));return(0,B.jsxs)(`span`,{className:`cg-cond-row`+(u?` is-measure`:``)+(d?` is-cohort`:``)+(e.rhs==null?``:` has-rhs`),children:[(0,B.jsx)(Gp,{className:`cg-cond-field`,ariaLabel:`Field`,value:e.colId,onChange:h,fields:[...are(i,e.colId,a,s,f),...o.map(e=>({key:e.key,label:e.label,type:rm})),...f?[{key:pd,label:`Cohort`,type:`multiselect`}]:[]]}),u&&(0,B.jsx)(Jp,{window:e.window??im,onWindow:e=>m({window:e})}),(0,B.jsxs)(`select`,{className:`cg-select cg-cond-op`,value:S,"aria-label":`Condition`,onChange:e=>g(e.target.value),children:[w.map(e=>(0,B.jsx)(`option`,{value:e,children:d?rre(e):$p(e,p)},e)),T.length>0&&(0,B.jsx)(`optgroup`,{label:`Ranked`,children:T.map(e=>(0,B.jsx)(`option`,{value:e,children:$p(e,p)},e))})]}),v&&(0,B.jsxs)(`select`,{className:`cg-select cg-cond-mode`,value:y?`stat`:b?`field`:`value`,"aria-label":`Compare against`,onChange:t=>{let n=t.target.value;if(n===`stat`)return m({rhs:{kind:`stat`,stat:`median`},value:``,value2:void 0,op:tm.includes(e.op)?e.op:tm[1]});if(n===`field`)return m({rhs:u?{kind:`measure`,colId:``,window:im}:{kind:`field`,colId:``},value:``,value2:void 0});m({rhs:void 0,value:``})},children:[(0,B.jsx)(`option`,{value:`value`,children:`a value`}),(0,B.jsx)(`option`,{value:`field`,children:`another field`}),u&&(0,B.jsx)(`option`,{value:`stat`,children:`a statistic`})]}),fd.has(e.op)?(0,B.jsx)(`span`,{className:`cg-cond-val cg-cond-noval`,"aria-hidden":!0}):y?(0,B.jsx)(`select`,{className:`cg-select cg-cond-val cg-cond-stat`,value:e.rhs?.kind===`stat`?e.rhs.stat:`median`,"aria-label":`Statistic`,onChange:e=>m({rhs:{kind:`stat`,stat:e.target.value}}),children:kee.map(e=>(0,B.jsx)(`option`,{value:e,children:Aee[e]},e))}):b?(0,B.jsx)(sre,{rule:e,options:_,isMeasure:u,onPatch:m}):d?(0,B.jsx)(ure,{rule:e,lists:c,onPatch:m}):dd(e.op)?(0,B.jsx)(lre,{rule:e,onValue:e=>m({value:e})}):e.op===`within`?(0,B.jsx)(Jp,{window:e.dateWindow??am,onWindow:e=>m({dateWindow:e}),kinds:ire}):Xp(p)?(0,B.jsx)(ore,{rule:e,onPatch:m}):(0,B.jsx)(cre,{rule:e,type:p,statusOptions:l(e.colId),onValue:e=>m({value:e}),onValue2:e=>m({value2:e})}),(0,B.jsx)(`button`,{type:`button`,className:`cg-cond-x`,"aria-label":`Remove condition`,onClick:r,children:`×`})]})}function pre({group:e,depth:t,ctx:n,onGroup:r,onRemove:i}){return(0,B.jsxs)(`span`,{className:`cg-cond-group`,"data-depth":t,children:[(0,B.jsxs)(`span`,{className:`cg-cond-group-head`,children:[(0,B.jsx)(`span`,{className:`cg-cond-group-sum`,children:e.children.length?nre(e.conj):`Add a condition to this group…`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-cond-x`,"aria-label":`Remove condition group`,onClick:i,children:`×`})]}),(0,B.jsx)(`span`,{className:`cg-cond-group-body`,children:(0,B.jsx)(um,{nodes:e.children,conj:e.conj,depth:t,ctx:n,onNodes:t=>r({...e,children:t}),onConj:t=>r({...e,conj:t})})})]})}function dm({fields:e,filters:t,onChange:n,cohorts:r=[],measures:i=[],userOptions:a,statusValues:o,cohortLock:s,footerExtra:c}){let l=bd(t),u=xd(t),d=(0,L.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.key,n);return t},[e]),f=(0,L.useMemo)(()=>mee(e),[e]),p=(0,L.useMemo)(()=>{let e=new Map;for(let t of i)e.set(t.key,t);return e},[i]),m=(0,L.useCallback)(e=>{let t=o?.[e];if(t)return t;let n=d.get(e);return n?n.type===`user`?a??[]:nd(n):[]},[o,d,a]),h=(0,L.useMemo)(()=>({fields:f,fieldByKey:d,measures:i,measureByKey:p,lists:r,choicesFor:m}),[f,d,i,p,r,m]);return(0,B.jsxs)(`div`,{className:`cg-pop-body cg-builder`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Filter`}),s&&(0,B.jsx)(`div`,{className:`cg-flt-lockchip`,children:s.name?`Customer list locked to ${s.name}`+(typeof s.count==`number`?` · ${s.count.toLocaleString()} ${s.count===1?`customer`:`customers`}`:``):`Customer list locked to a set you cannot see`}),l.length===0?(0,B.jsx)(`div`,{className:`cg-builder-empty`,children:`No conditions. Add one to narrow the list.`}):(0,B.jsx)(`div`,{className:`cg-builder-caption`,children:`In this view, show records`}),(0,B.jsx)(um,{nodes:l,conj:u,depth:1,ctx:h,onNodes:e=>n({conj:u,nodes:e}),onConj:e=>n({conj:e,nodes:l})}),Qp(l)&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`Ranked among the records your other conditions keep — so “top 10” inside a filtered view means the top 10 of that view. Records with no value are not ranked at all. Quartiles and deciles are equal-size slices BY RANK, not by value.`}),(l.length>0||c)&&(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-builder-footer`,children:[l.length>0&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>n({conj:u,nodes:[]}),children:`Clear all`}),c]})]})}function fm({fields:e,hidden:t,onToggle:n,onHideAll:r,onShowAll:i,lockedKey:a,onFieldOrder:o,deletableKeys:s,onDeleteField:c}){let[l,u]=(0,L.useState)(``),[d,f]=(0,L.useState)(null),[p,m]=(0,L.useState)(null),[h,g]=(0,L.useState)(null),_=l.trim().toLowerCase(),v=_?e.filter(e=>e.label.toLowerCase().includes(_)):e,y=!!o&&_===``,b=(t,n)=>{if(t===n||t===a||n===a)return null;let r=e.map(e=>e.key),i=r.indexOf(t),o=r.indexOf(n);if(i<0||o<0)return null;let s=r.slice();return s.splice(i,1),s.splice(o,0,t),s},x=(t,n)=>{if(!y)return;let r=e.map(e=>e.key),i=r[r.indexOf(t)+n];if(i===void 0)return;let a=b(t,i);a&&o(a)};return(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Hide fields`}),(0,B.jsx)(`input`,{type:`text`,className:`cg-input cg-fields-search`,placeholder:`Find a field…`,"aria-label":`Find a field`,value:l,onChange:e=>u(e.target.value)}),(0,B.jsxs)(`div`,{className:`cg-pop-list`,children:[v.map(e=>{let r=a!==void 0&&e.key===a,i=!t.has(e.key),l=!!c&&!!s?.has(e.key),u=d===e.key;return(0,B.jsxs)(`label`,{className:`cg-check-row`+(i?``:` is-off`)+(r?` is-locked`:``)+(p===e.key?` is-dragging`:``)+(h===e.key&&p!==null&&p!==e.key?` is-drop-target`:``),title:r?`Always visible`:void 0,onDragOver:y&&p&&p!==e.key?t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,h!==e.key&&g(e.key)}:void 0,onDrop:y&&p?t=>{t.preventDefault(),t.stopPropagation();let n=b(p,e.key);m(null),g(null),n&&o(n)}:void 0,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-field-grip`,draggable:y&&!r,"aria-label":r?`${e.label} is always first`:y?`Reorder ${e.label} — drag, or use the arrow keys`:`Reorder ${e.label} (clear the search first)`,title:y&&!r?`Drag to reorder, or use the arrow keys`:r?`This column is always first`:`Clear the search to reorder`,onDragStart:t=>{t.dataTransfer.setData(`text/plain`,e.key),t.dataTransfer.effectAllowed=`move`,m(e.key)},onDragEnd:()=>{m(null),g(null)},onClick:e=>{e.preventDefault(),e.stopPropagation()},onKeyDown:t=>{t.key!==`ArrowUp`&&t.key!==`ArrowDown`||(t.preventDefault(),t.stopPropagation(),x(e.key,t.key===`ArrowUp`?-1:1))},children:(0,B.jsx)(`svg`,{width:`10`,height:`16`,viewBox:`0 0 10 16`,"aria-hidden":!0,focusable:`false`,children:[4,8,12].map(e=>[2.5,7.5].map(t=>(0,B.jsx)(`circle`,{cx:t,cy:e,r:`1.15`,fill:`currentColor`},`${t}-${e}`)))})}),(0,B.jsx)(`input`,{type:`checkbox`,checked:i,disabled:r,onChange:()=>n(e.key)}),(0,B.jsx)(Fp,{type:e.type,title:zf[e.type]}),(0,B.jsx)(`span`,{className:`cg-check-label`,children:e.label}),e.source===`odoo`&&!e.custom&&(0,B.jsx)(`span`,{className:`cg-preset-tag`,children:`Pre-set`}),e.scope===`cohort`&&(0,B.jsx)(`span`,{className:`cg-preset-tag cg-scope-tag`,children:`Cohort-only`}),r&&(0,B.jsx)(`span`,{className:`cg-lock-tag`,children:`Locked`}),l&&(0,B.jsx)(`button`,{type:`button`,className:`cg-check-del`+(u?` is-armed`:``),"aria-label":u?`Permanently delete ${e.label}?`:`Delete ${e.label}`,title:u?void 0:`Removes this field and its values on every row.`,onClick:t=>{if(t.preventDefault(),t.stopPropagation(),!u){f(e.key);return}f(null),c(e.key)},children:u?`Delete permanently?`:(0,B.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M3.5 4.5h9M6.5 4.5V3h3v1.5M5 4.5l.6 8.5h4.8l.6-8.5`,stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`,strokeLinejoin:`round`})})})]},e.key)}),v.length===0&&(0,B.jsx)(`div`,{className:`cg-builder-empty`,children:`No field matches your search.`})]}),(i||r)&&(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-fields-footer`,children:[i&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:i,children:`Show all`}),r&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:r,children:`Hide all`})]})]})}var mre={stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`};function hre(){return(0,B.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M4 6l4 4 4-4`,...mre})})}function pm({label:e,icon:t,active:n,tone:r,wide:i,measureWide:a,pairWide:o,forceOpenSignal:s,children:c}){let[l,u]=(0,L.useState)(!1),d=(0,L.useRef)(null),f=(0,L.useId)();return(0,L.useEffect)(()=>{s&&s>0&&u(!0)},[s]),(0,B.jsxs)(`div`,{className:`cg-pop-wrap`,children:[(0,B.jsxs)(`button`,{ref:d,type:`button`,className:`cg-tb-btn`+(r?` cg-tb-btn--${r}`:``)+(n||l?` is-active`:``),onClick:()=>u(e=>!e),"aria-expanded":l,"aria-haspopup":`dialog`,"aria-controls":l?f:void 0,title:e,"aria-label":e,children:[t,(0,B.jsx)(`span`,{className:`cg-tb-label`,children:e}),(0,B.jsx)(hre,{})]}),l&&d.current&&(0,B.jsx)(Np,{anchor:d.current,className:`cg-pop`+(i?` cg-pop--wide`:``)+(a?` cg-pop--measures`:``)+(o?` cg-pop--pair`:``),onDismiss:()=>u(!1),role:`dialog`,ariaLabel:`${e} options`,id:f,dataKind:`toolbar-${e.split(` `)[0].toLowerCase()}`,children:c(()=>u(!1))})]})}var mm={width:14,height:14,viewBox:`0 0 16 16`,fill:`none`},hm={stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`};function gre(){return(0,B.jsxs)(`svg`,{...mm,"aria-hidden":!0,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`1.5`,...hm}),(0,B.jsx)(`line`,{x1:`6.5`,y1:`3`,x2:`6.5`,y2:`13`,...hm}),(0,B.jsx)(`line`,{x1:`10.5`,y1:`3`,x2:`10.5`,y2:`13`,...hm})]})}function gm(){return(0,B.jsx)(`svg`,{...mm,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M2.5 4h11L9.5 9v3.5L6.5 14V9L2.5 4Z`,...hm})})}function _m(){return(0,B.jsxs)(`svg`,{...mm,"aria-hidden":!0,children:[(0,B.jsx)(`path`,{d:`M5 3v10M5 13l-2-2M5 13l2-2`,...hm}),(0,B.jsx)(`path`,{d:`M11 13V3M11 3l-2 2M11 3l2 2`,...hm})]})}function _re(){return(0,B.jsx)(`svg`,{...mm,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M8 2s4.5 4.2 4.5 7a4.5 4.5 0 0 1-9 0C3.5 6.2 8 2 8 2Z`,...hm})})}function vm(){return(0,B.jsxs)(`svg`,{...mm,"aria-hidden":!0,children:[(0,B.jsx)(`line`,{x1:`2.5`,y1:`5`,x2:`13.5`,y2:`5`,...hm}),(0,B.jsx)(`line`,{x1:`2.5`,y1:`8`,x2:`13.5`,y2:`8`,...hm}),(0,B.jsx)(`line`,{x1:`2.5`,y1:`11`,x2:`13.5`,y2:`11`,...hm})]})}function ym(){return(0,B.jsxs)(`svg`,{...mm,"aria-hidden":!0,children:[(0,B.jsx)(`line`,{x1:`2.5`,y1:`4`,x2:`13.5`,y2:`4`,...hm}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`8`,x2:`13.5`,y2:`8`,...hm}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`12`,x2:`13.5`,y2:`12`,...hm})]})}function vre(){return(0,B.jsxs)(`svg`,{...mm,"aria-hidden":!0,children:[(0,B.jsx)(`rect`,{x:`3.5`,y:`7`,width:`9`,height:`6`,rx:`1.2`,...hm}),(0,B.jsx)(`path`,{d:`M5.75 7V5.25a2.25 2.25 0 0 1 4.5 0V7`,...hm})]})}function yre(){return(0,B.jsxs)(`svg`,{...mm,"aria-hidden":!0,children:[(0,B.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4`,...hm}),(0,B.jsx)(`line`,{x1:`10.2`,y1:`10.2`,x2:`13.5`,y2:`13.5`,...hm})]})}var bre={filters:(0,B.jsx)(gm,{}),sorts:(0,B.jsx)(_m,{}),groupBy:(0,B.jsx)(ym,{}),visible:(0,B.jsx)(Bp,{}),order:(0,B.jsx)(gre,{}),rowHeightMode:(0,B.jsx)(vm,{})};function xre({views:e,lockedKey:t,onApply:n,onClose:r}){let[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(()=>new Set([`filters`])),c=e.find(e=>e.id===i),l=e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,B.jsxs)(`div`,{className:`cg-pop-body cg-copycfg`,children:[(0,B.jsxs)(`div`,{className:`cg-copycfg-head`,children:[(0,B.jsx)(`span`,{children:`Copy configuration from`}),(0,B.jsx)(Gp,{className:`cg-copycfg-source`,ariaLabel:`View to copy from`,placeholder:`Choose a view…`,value:i||void 0,onChange:a,fields:e.map(e=>({key:e.id,label:e.name,icon:(0,B.jsx)(Ip,{mode:wd(e)})}))}),(0,B.jsx)(`span`,{children:`to this view`})]}),(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`Select what to copy. This view keeps everything else.`}),(0,B.jsx)(`div`,{className:`cg-pop-list`,children:wp.map(e=>(0,B.jsxs)(`label`,{className:`cg-check-row`,title:e.blurb,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:o.has(e.key),onChange:()=>l(e.key)}),(0,B.jsx)(`span`,{className:`cg-mi-ic`,"aria-hidden":!0,children:bre[e.key]}),(0,B.jsx)(`span`,{className:`cg-check-label`,children:e.label})]},e.key))}),(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-copycfg-bulk`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>s(new Set(Tp)),children:`Select all`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>s(new Set),children:`Clear all`})]}),(0,B.jsxs)(`div`,{className:`cg-form-actions cg-copycfg-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!c||o.size===0,title:c?o.size===0?`Choose at least one thing to copy`:void 0:`Choose the view to copy from`,onClick:()=>{c&&(n(Vne(c.config,o,t)),r())},children:`Copy configuration`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:r,children:`Cancel`})]})]})}function Sre({views:e,lockedKey:t,onApply:n}){let[r,i]=(0,L.useState)(!1),a=(0,L.useRef)(null);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{ref:a,type:`button`,className:`cg-link-btn cg-copy-link`+(r?` is-on`:``),"aria-expanded":r,onClick:()=>i(e=>!e),children:`Copy from another view`}),r&&a.current&&(0,B.jsx)(Np,{anchor:a.current,className:`cg-pop cg-copycfg-pop`,placement:`bottom-end`,onDismiss:()=>i(!1),role:`dialog`,ariaLabel:`Copy configuration from another view`,dataKind:`copy-config`,children:(0,B.jsx)(xre,{views:e,lockedKey:t,onApply:n,onClose:()=>i(!1)})})]})}function Cre({fields:e,fieldByKey:t,sorts:n,onSorts:r}){let i=(e,t)=>r(n.map((n,r)=>r===e?{...n,...t}:n)),a=e=>r(n.filter((t,n)=>n!==e));return(0,B.jsxs)(`div`,{className:`cg-pop-body cg-builder`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Sort`}),n.length===0&&(0,B.jsx)(`div`,{className:`cg-builder-empty`,children:`No sorts. Add one to order the list.`}),n.map((n,r)=>{let o=t.get(n.colId)?.type??`text`;return(0,B.jsxs)(`div`,{className:`cg-cond-line`,children:[(0,B.jsx)(`span`,{className:`cg-cond-prefix`,children:r===0?`Sort by`:`then by`}),(0,B.jsxs)(`span`,{className:`cg-cond-row`,children:[(0,B.jsx)(Gp,{className:`cg-cond-field`,ariaLabel:`Sort field`,value:n.colId,onChange:e=>i(r,{colId:e}),fields:e.map(e=>({key:e.key,label:e.label,type:e.type}))}),(0,B.jsxs)(`select`,{className:`cg-select cg-cond-op`,value:n.dir,"aria-label":`Sort direction`,onChange:e=>i(r,{dir:e.target.value}),children:[(0,B.jsx)(`option`,{value:`asc`,children:ud(o,`asc`)}),(0,B.jsx)(`option`,{value:`desc`,children:ud(o,`desc`)})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-cond-x`,"aria-label":`Remove sort`,onClick:()=>a(r),children:`×`})]})]},r)}),(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-builder-footer`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>{let t=new Set(n.map(e=>e.colId)),i=e.find(e=>!t.has(e.key))??e[0];i&&r([...n,{colId:i.key,dir:`asc`}])},children:`+ Add another sort`}),n.length>0&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>r([]),children:`Clear`})]})]})}var wre=[{mode:`short`,label:`Short`},{mode:`medium`,label:`Medium`},{mode:`tall`,label:`Tall`}];function Tre({fields:e,visible:t,nouns:n=`customers`,lockedKey:r,onColumnVisible:i,onColumnsVisible:a,orderedFields:o,onFieldOrder:s,deletableKeys:c,onDeleteField:l,colorOn:u,onToggleColor:d,rowHeightMode:f,onRowHeightMode:p,filters:m,onFilters:h,filterConj:g,onFilterConj:_,sorts:v,onSorts:y,groupBy:b,onGroupBy:x,statusValues:S,measures:C=[],pendingMeasureCount:w=0,unresolvedCount:T=0,lists:E=[],cohortLock:D,copyViews:O,onCopyConfig:k,search:A,onSearch:j,recordCount:M,scopeCounts:ee,pool:N,serverWindowed:te=!1,cohortAction:ne,filterSeed:P=null,modeControl:re}){let F=e.filter(e=>t.has(e.key)).length,ie=(0,L.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.key,n);return t},[e]),ae=(0,L.useMemo)(()=>{let e=new Map;for(let t of C)e.set(t.key,t);return e},[C]),oe=o??e,se=(0,L.useMemo)(()=>new Set(oe.filter(e=>!t.has(e.key)).map(e=>e.key)),[oe,t]),ce=(0,L.useMemo)(()=>({conj:g,nodes:m}),[g,m]),le=e=>{let t=bd(e),n=xd(e);t!==m&&h(t),n!==g&&_(n)},ue=!!D,de=!!k&&(O?.length??0)>0,fe=(0,L.useMemo)(()=>e.filter(e=>Cee(e,r)),[e,r]),pe=(0,L.useRef)(0);(0,L.useEffect)(()=>{if(!P||P.n===pe.current)return;if(pe.current=P.n,P.measure){let e=ae.get(P.measure.key);if(!e)return;h([...m,{id:sm(),colId:e.key,op:em[0],value:``,window:P.measure.window}]);return}let e=P.key?ie.get(P.key):void 0;!e||e.filterable===!1||h([...m,{colId:e.key,op:Zp(e.type)[0],value:``}])},[P,ie,ae,m,h]);let me=(0,L.useMemo)(()=>lm(m),[m]),he=(0,L.useMemo)(()=>{let e=t=>t.some(t=>yd(t)?e(t.children):t.rhs!=null&&t.rhs.kind!==`stat`);return e(m)},[m]),ge=me?`Filter · ${me}`:`Filter`,_e=v.length?`Sort · ${v.length}`:`Sort`,ve=b?`Group: ${ie.get(b)?.label??`?`}`:`Group`;return(0,B.jsxs)(`div`,{className:`cg-toolbar`,children:[re,(0,B.jsx)(pm,{label:`Hide fields`,icon:(0,B.jsx)(Bp,{}),active:F(0,B.jsx)(fm,{fields:oe,hidden:se,onToggle:e=>i(e,!t.has(e)),onShowAll:()=>a(e.map(e=>e.key)),onHideAll:()=>a([r]),lockedKey:r,onFieldOrder:s,deletableKeys:c,onDeleteField:l})}),(0,B.jsx)(pm,{label:ge,icon:(0,B.jsx)(gm,{}),active:me>0,tone:`filter`,wide:!0,measureWide:C.length>0,pairWide:he,forceOpenSignal:P?.n,children:()=>(0,B.jsx)(dm,{fields:e,measures:C,cohorts:E,filters:ce,onChange:le,statusValues:S,cohortLock:D,footerExtra:de?(0,B.jsx)(Sre,{views:O,lockedKey:r,onApply:e=>k(e)}):void 0})}),(0,B.jsx)(pm,{label:_e,icon:(0,B.jsx)(_m,{}),active:v.length>0,tone:`sort`,wide:!0,children:()=>(0,B.jsx)(Cre,{fields:e,fieldByKey:ie,sorts:v,onSorts:y})}),(0,B.jsx)(pm,{label:ve,icon:(0,B.jsx)(ym,{}),active:b!==null,tone:`group`,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Group by`}),te?(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`Not available on this table. It loads one page at a time, so a group would count only the rows currently fetched.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-group`,checked:b===null,onChange:()=>x(null)}),(0,B.jsx)(`span`,{children:`No grouping`})]}),fe.map(e=>(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-group`,checked:b===e.key,onChange:()=>x(e.key)}),(0,B.jsx)(Fp,{type:e.type,title:zf[e.type]}),(0,B.jsx)(`span`,{children:e.label})]},e.key))]})]})}),ue&&(0,B.jsxs)(`span`,{className:`cg-tb-lock`,title:(D?.name?`Locked to ${D.name}. `:`Locked to a set of records you cannot see. `)+`Only the records locked into that view are shown. Filters and sort narrow WITHIN the lock; the lock itself is changed from the view menu in the rail.`,children:[(0,B.jsx)(vre,{}),(0,B.jsx)(`span`,{className:`cg-tb-label`,children:`Locked`})]}),(0,B.jsx)(`span`,{className:`cg-tb-divider`,"aria-hidden":!0}),(0,B.jsx)(pm,{label:`Color`,icon:(0,B.jsx)(_re,{}),active:u,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Color`}),(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-color`,checked:!u,onChange:()=>d(!1)}),(0,B.jsx)(`span`,{children:`No color`})]}),(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-color`,checked:u,onChange:()=>d(!0)}),(0,B.jsx)(`span`,{children:`Color by status`})]})]})}),(0,B.jsx)(pm,{label:`Rows`,icon:(0,B.jsx)(vm,{}),active:f!==`short`,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Row height`}),wre.map(e=>(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-rowh`,checked:f===e.mode,onChange:()=>p(e.mode)}),(0,B.jsx)(`span`,{children:e.label})]},e.mode))]})}),(0,B.jsxs)(`div`,{className:`cg-search`,children:[(0,B.jsx)(`span`,{className:`cg-search-icon`,"aria-hidden":!0,children:(0,B.jsx)(yre,{})}),(0,B.jsx)(`input`,{type:`text`,className:`cg-search-input`,placeholder:`Search ${n}…`,value:A,onChange:e=>j(e.target.value)}),A&&(0,B.jsx)(`button`,{type:`button`,className:`cg-search-clear`,"aria-label":`Clear search`,onClick:()=>j(``),children:`×`})]}),ne,(0,B.jsx)(`span`,{className:`cg-tb-spacer`}),w>0&&(0,B.jsx)(`span`,{className:`cg-count cg-count-pending`,title:`${w} measure condition${w===1?``:`s`} still being calculated over the period you chose. Rows are hidden until the answer arrives rather than shown under a count that would be wrong.`,children:`Calculating…`}),T>0&&(0,B.jsx)(`span`,{className:`cg-count cg-count-pending`,title:`${T} condition${T===1?``:`s`} cannot be evaluated — a date that does not resolve, or a list this view refers to that no longer exists. Rows are hidden rather than shown under a count that would be wrong.`,children:`Filter unresolved`}),qp(N)==null?(0,B.jsxs)(`span`,{className:`cg-count`,title:Kp(M,ee),children:[(0,B.jsx)(`span`,{className:`cg-count-full`,children:Kp(M,ee)}),(0,B.jsx)(`span`,{className:`cg-count-compact`,children:Qne(M,ee)})]}):(0,B.jsxs)(`span`,{className:`cg-count cg-count-partial`,title:`Loading the rest of your ${n} in the background — you can browse, filter and sort what is already here.`,children:[(0,B.jsx)(`span`,{className:`lp-spin`,role:`status`,"aria-label":`Loading`}),qp(N)]})]})}function bm({on:e}){return(0,B.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 20 20`,"aria-hidden":!0,children:(0,B.jsx)(`polygon`,{points:`10,1.8 12.5,7.2 18.4,7.7 13.9,11.6 15.3,17.4 10,14.3 4.7,17.4 6.1,11.6 1.6,7.7 7.5,7.2`,fill:e?`#A98A3E`:`none`,stroke:e?`#A98A3E`:`rgba(118,143,182,0.55)`,strokeWidth:`1.2`,strokeLinejoin:`round`})})}function Ere({value:e,max:t}){return(0,B.jsx)(`span`,{className:`cg-stars cg-stars--static`,"aria-label":`${e} of ${t}`,children:Array.from({length:t},(t,n)=>(0,B.jsx)(bm,{on:n=0?n.splice(r,1):n.push(t),Are(n)}function wm(e,t,n){let r=e.type===`user`?t??[]:nd(e),i=r.map(e=>({value:e,label:e})),a=e.type===`multiselect`?Cm(n):[xm(n).trim()];for(let e of a)e===``||r.includes(e)||i.push({value:e,label:`${e} (no longer a choice)`,stale:!0});return i}function Tm(e){let t=xm(e).trim();if(t===``)return``;let n=Number(t);return Number.isFinite(n)?String(n):``}function Mre(e){let t=e.trim();if(t===``)return``;let n=Number(t);return Number.isFinite(n)?t:null}function Em(e,t){let n=Math.round(Number(xm(t)));return Number.isFinite(n)?Math.max(0,Math.min(rd(e),n)):0}function Nre(e,t,n){let r=Em(e,t),i=Math.max(1,Math.min(rd(e),Math.round(n)));return i===r?``:String(i)}function Pre(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length?t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase():`?`}var Fre=[`csv`,`xlsx`,`pdf`,`json`],Ire={csv:`CSV`,xlsx:`Excel`,pdf:`PDF`,json:`JSON`};function Lre(e,t,n){let r=(e.trim()||`export`).replace(/[\\/:*?"<>|]/g,`_`);return t?`${r} - ${t}.${n}`:`${r}.${n}`}function Dm(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Rre(e,t){let n=[e.map(e=>Dm(e.label)).join(`,`)];for(let r of t)n.push(e.map(e=>Dm(yp(e,r[e.key]))).join(`,`));return n.join(`\r + `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function aee(e){e=du(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=jl);var a=e.onBlur;a===void 0&&(a=jl);var o=e.thousandSeparator,s=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l=``);var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,p=e.onValueChange,m=Al(e,[`decimalSeparator`,`allowedDecimalSeparators`,`thousandsGroupStyle`,`suffix`,`allowNegative`,`allowLeadingZeros`,`onKeyDown`,`onBlur`,`thousandSeparator`,`decimalScale`,`fixedDecimalScale`,`prefix`,`defaultValue`,`value`,`valueIsNumericString`,`onValueChange`]),h=ou(e),g=h.decimalSeparator,_=h.allowedDecimalSeparators,v=function(t){return au(t,e)},y=function(t,n){return uu(t,n,e)},b=Pl(d)?u:d,x=f??lu(b,l,t);Pl(d)?Pl(u)||(x||=typeof u==`number`):x||=typeof d==`number`;var S=function(e){return Il(e)?e:(typeof e==`number`&&(e=Wl(e)),x&&typeof s==`number`?Gl(e,s,!!c):e)},C=tu(S(d),S(u),!!x,v,y,p),w=C[0],T=w.numAsString,E=w.formattedValue,D=C[1];return Object.assign(Object.assign({},m),{value:E,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===g||Nl(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,i=e.currentValueIndex,a=e.formattedValueIndex,o=t[i],u=r[a],f=hu(n,t).to,p=function(e){return y(e).indexOf(`.`)+l.length};return d===0&&c&&s&&t[f.start]===g&&p(t)a?!1:i>=f.start&&i{pu=u(f()),(function(e){e.event=`event`,e.props=`prop`})(mu||={}),hu=Ml(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),gu=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}}})),oee=c({default:()=>xu});function vu(){return Intl.NumberFormat()?.formatToParts(1.1)?.find(e=>e.type===`decimal`)?.value??`.`}function yu(){return vu()===`.`?`,`:`.`}var bu,xu,Su=o((()=>{bu=u(f(),1),kl(),_u(),xu=e=>{let{value:t,onChange:n,disabled:r,highlight:i,validatedSelection:a,fixedDecimals:o,allowNegative:s,thousandSeparator:c,decimalSeparator:l}=e,u=bu.useRef();return bu.useLayoutEffect(()=>{if(a!==void 0){let e=typeof a==`number`?[a,null]:a;u.current?.setSelectionRange(e[0],e[1])}},[a]),bu.createElement(Ol,null,bu.createElement(fu,{autoFocus:!0,getInputRef:u,className:`gdg-input`,onFocus:e=>e.target.setSelectionRange(i?0:e.target.value.length,e.target.value.length),disabled:r===!0,decimalScale:o,allowNegative:s,thousandSeparator:c??yu(),decimalSeparator:l??vu(),value:Object.is(t,-0)?`-`:t??``,onValueChange:n}))}}));ct();var Cu=L.lazy(async()=>await Dc(()=>Promise.resolve().then(()=>(Su(),oee)),void 0,import.meta.url)),wu={getAccessibilityString:e=>e.data?.toString()??``,kind:I.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:ti,draw:e=>oi(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return L.createElement(L.Suspense,{fallback:null},L.createElement(Cu,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:e=>n({...r,data:Number.isNaN(e.floatValue??0)?0:e.floatValue})}))},onPaste:(e,t,n)=>{let r=typeof n.rawValue==`number`?n.rawValue:Number.parseFloat(typeof n.rawValue==`string`?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}};ct();var Tu={getAccessibilityString:()=>``,measure:()=>108,kind:I.Protected,needsHover:!1,needsHoverPosition:!1,draw:Eu,onPaste:()=>void 0};function Eu(e){let{ctx:t,theme:n,rect:r}=e,{x:i,y:a,height:o}=r;t.beginPath();let s=2.5,c=i+n.cellHorizontalPadding+s,l=a+o/2,u=Math.cos(Xt(30))*s,d=Math.sin(Xt(30))*s;for(let e=0;e<12;e++)t.moveTo(c,l-s),t.lineTo(c,l+s),t.moveTo(c+u,l-d),t.lineTo(c-u,l+d),t.moveTo(c-u,l-d),t.lineTo(c+u,l+d),c+=8;t.lineWidth=1.1,t.lineCap=`square`,t.strokeStyle=n.textLight,t.stroke()}ct();var Du={getAccessibilityString:e=>e.data?.toString()??``,kind:I.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>ti(e,t,e.theme.textLight),draw:e=>oi(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return L.createElement(lr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:e=>n({...r,data:e.target.value})})},onPaste:()=>void 0};ct(),vr();var Ou={getAccessibilityString:e=>e.data?.toString()??``,kind:I.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:ti,useLabel:!0,draw:e=>{let{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:a,theme:o,overrideCursor:s}=e,{displayData:c,contentAlign:l,hoverEffect:u,allowWrapping:d}=t;if(u===!0&&n>0){i.textBaseline=`alphabetic`;let e=o.cellHorizontalPadding,t=o.cellVerticalPadding,r=Jr(c,i,o.baseFontFull,`alphabetic`),l=a.height-t,u=Math.min(l,r.actualBoundingBoxAscent*2.5);i.beginPath(),si(i,a.x+e/2,a.y+(a.height-u)/2+1,r.width+e*3,u-1,o.roundingRadius??4),i.globalAlpha=n,i.fillStyle=fr(o.textDark,.1),i.fill(),i.globalAlpha=1,i.fillStyle=o.textDark,i.textBaseline=`middle`,s?.(`text`)}oi(e,c,l,d,r)},measure:(e,t,n)=>{let r=t.displayData.split(` +`,t.allowWrapping===!0?void 0:1),i=0;for(let t of r)i=Math.max(i,e.measureText(t).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:``}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:n,onChange:r,value:i,validatedSelection:a}=t;return L.createElement(lr,{style:e.allowWrapping===!0?{padding:`3px 8.5px`}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:a,onChange:e=>r({...i,data:e.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}};St();var ku=xt(`div`)({name:`UriOverlayEditorStyle`,class:`gdg-u1rrojo`,propsAsIs:!1}),see=e=>{let{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:a,preview:o}=e,[s,c]=L.useState(!i&&(t===``||r)),l=L.useCallback(()=>{c(!0)},[]);return s?L.createElement(lr,{validatedSelection:a,highlight:!0,autoFocus:!0,value:t,onChange:n}):L.createElement(ku,null,L.createElement(`a`,{className:`gdg-link-area`,href:t,target:`_blank`,rel:`noopener noreferrer`},o),!i&&L.createElement(`div`,{className:`gdg-edit-icon`,onClick:l},L.createElement(tn,null)),L.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))};ct();function Au(e,t,n,r){let i=n.cellHorizontalPadding,a=t.height/2-e.actualBoundingBoxAscent/2,o=e.width,s=e.actualBoundingBoxAscent;return r===`right`?i=t.width-o-n.cellHorizontalPadding:r===`center`&&(i=t.width/2-o/2),{x:i,y:a,width:o,height:s}}var cee=[Sl,El,el,il,ll,ml,vl,xl,wu,Tu,Du,Ou,{getAccessibilityString:e=>e.data?.toString()??``,kind:I.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:ti,draw:e=>{let{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:a,rect:o,ctx:s}=e,c=t.displayData??t.data,l=t.hoverEffect===!0;if(r!==void 0&&l&&i!==void 0&&a!==void 0){let{x:l,y:u,width:d,height:f}=Au(Jr(c,s,n.baseFontFull),o,n,t.contentAlign);if(i>=l-4&&i<=l-4+d+8&&a>=u-4&&a<=u-4+f+8){let i=Xr(s,n.baseFontFull);r(`pointer`);let a=u-i;s.beginPath(),s.moveTo(o.x+l,Math.floor(o.y+a+f+5)+.5),s.lineTo(o.x+l+d,Math.floor(o.y+a+f+5)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,oi({...e,rect:{...o,x:o.x-1}},c,t.contentAlign),oi({...e,rect:{...o,x:o.x-2}},c,t.contentAlign),oi({...e,rect:{...o,x:o.x+1}},c,t.contentAlign),oi({...e,rect:{...o,x:o.x+2}},c,t.contentAlign),s.restore()}}s.fillStyle=l?n.linkColor:n.textDark,oi(e,c,t.contentAlign)},onClick:e=>{let{cell:t,bounds:n,posX:r,posY:i,theme:a}=e,o=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;let s=Yr(o,a.baseFontFull);if(s===void 0)return;let c=Au(s,n,a,t.contentAlign);xa({x:c.x-4,y:c.y-4,width:c.width+8,height:c.height+8},r,i)&&t.onClickUri(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:``}),provideEditor:e=>t=>{let{onChange:n,value:r,forceEditMode:i,validatedSelection:a}=t;return L.createElement(see,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:a,readonly:r.readonly===!0,onChange:e=>n({...r,data:e.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}}],lee=u(s(((e,t)=>{var n=Gt(),r=re(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))(),1),ju=[],uee=class extends gi{imageLoaded=()=>void 0;loadedLocations=[];cache={};setCallback(e){this.imageLoaded=e}sendLoaded=(0,lee.default)(()=>{this.imageLoaded(new vi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{let e=Object.keys(this.cache);for(let t of e){let e=this.cache[t],n=!1;for(let t=0;t{o||(o=!0,ju.length<12?ju.unshift(a):i||(a.src=``))}},c=new Promise(e=>a.addEventListener(`load`,()=>e(null)));requestAnimationFrame(async()=>{try{a.src=e,await c,await a.decode();let t=this.cache[r];if(t!==void 0&&!o){t.img=a;for(let e of t.cells)this.loadedLocations.push(hi(e));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[r]=s}loadOrGetImage(e,t,n){let r=e,i=this.cache[r];if(i!==void 0){let e=fi(t,n);return i.cells.includes(e)||i.cells.push(e),i.img}else this.loadImage(e,t,n,r)}},dee=L.forwardRef((e,t)=>{let n=L.useMemo(()=>({...da,...e.headerIcons}),[e.headerIcons]),r=L.useMemo(()=>e.imageWindowLoader??new uee,[e.imageWindowLoader]);return L.createElement(Qc,{...e,renderers:cee,headerIcons:n,ref:t,imageWindowLoader:r})}),Mu=[`all_time`,`today`,`yesterday`,`this_week`,`last_week`,`this_month`,`last_month`,`this_quarter`,`last_quarter`,`this_year`,`last_year`,`ytd`,`ytd_last_year`,`ltm`,`past_week`,`past_month`,`past_year`,`last_n_days`,`next_n_days`,`custom`],Nu=new Set([`last_n_days`,`next_n_days`]),Pu={all_time:`all time`,today:`today`,yesterday:`yesterday`,this_week:`this week`,last_week:`last week`,this_month:`this month`,last_month:`last month`,this_quarter:`this quarter`,last_quarter:`last quarter`,this_year:`this year`,last_year:`last year`,ytd:`year to date`,ytd_last_year:`last year to date`,ltm:`the last 12 months`,past_week:`the past week`,past_month:`the past month`,past_year:`the past year`,last_n_days:`the last {n} days`,next_n_days:`the next {n} days`,custom:`a custom range`},Fu=[`today`,`yesterday`,`one_week_ago`,`one_month_ago`,`n_days_ago`,`exact`],fee=new Set([`today`,`yesterday`,`one_week_ago`,`one_month_ago`]),Iu={today:`today`,yesterday:`yesterday`,one_week_ago:`one week ago`,one_month_ago:`one month ago`,n_days_ago:`{n} days ago`,exact:`an exact date`};function Lu(e){let t=String(e??``).trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return null;let n=new Date(`${t}T00:00:00Z`);return Number.isNaN(n.getTime())?null:n}function Ru(e){return e.toISOString().slice(0,10)}function zu(e,t){return new Date(e.getTime()+t*864e5)}function Bu(e){return[e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate()]}function Vu(e,t,n){return new Date(Date.UTC(e,t-1,n))}function Hu(e){let[t,n]=Bu(e);return Vu(t,n,1)}function Uu(e){let[t,n]=Bu(e);return n===12?Vu(t,12,31):zu(Vu(t,n+1,1),-1)}function Wu(e){return(e.getUTCDay()+6)%7}function Gu(e){let[t,n]=Bu(e);return Vu(t,3*Math.floor((n-1)/3)+1,1)}function pee(e,t){return new Date(Date.UTC(t===12?e+1:e,t===12?0:t,1)-864e5).getUTCDate()}function Ku(e,t){let[n,r,i]=Bu(e),a=n*12+(r-1)+t,o=Math.floor(a/12),s=a-o*12+1;return Vu(o,s,Math.min(i,pee(o,s)))}function qu(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.kind;if(!Mu.includes(n))return null;let r={kind:n};if(Nu.has(n)){let e=Number(t.n);if(!Number.isInteger(e)||e<1||e>3650)return null;r.n=e}if(n===`custom`){let e=Lu(t.from),n=Lu(t.to);if(!e&&!n)return null;e&&n&&e>n&&([e,n]=[n,e]),e&&(r.from=Ru(e)),n&&(r.to=Ru(n))}return r}function Ju(e,t){let n=qu(e);if(!n)return null;let r=Lu(t);if(!r)throw Error("resolveWindow() needs an explicit `today`");switch(n.kind){case`all_time`:return[null,null];case`today`:return[Ru(r),Ru(r)];case`yesterday`:{let e=zu(r,-1);return[Ru(e),Ru(e)]}case`this_week`:{let e=zu(r,-Wu(r));return[Ru(e),Ru(zu(e,6))]}case`last_week`:{let e=zu(r,-Wu(r)-7);return[Ru(e),Ru(zu(e,6))]}case`this_month`:return[Ru(Hu(r)),Ru(Uu(r))];case`last_month`:{let e=zu(Hu(r),-1);return[Ru(Hu(e)),Ru(e)]}case`this_quarter`:{let e=Gu(r),[t,n]=Bu(e);return[Ru(e),Ru(Uu(Vu(t,n+2,1)))]}case`last_quarter`:{let e=zu(Gu(r),-1);return[Ru(Gu(e)),Ru(e)]}case`this_year`:{let[e]=Bu(r);return[Ru(Vu(e,1,1)),Ru(Vu(e,12,31))]}case`last_year`:{let[e]=Bu(r);return[Ru(Vu(e-1,1,1)),Ru(Vu(e-1,12,31))]}case`ytd`:{let[e]=Bu(r);return[Ru(Vu(e,1,1)),Ru(r)]}case`ytd_last_year`:{let[e]=Bu(r);return[Ru(Vu(e-1,1,1)),Ru(Ku(r,-12))]}case`ltm`:return[Ru(zu(r,-364)),Ru(r)];case`past_week`:return[Ru(zu(r,-6)),Ru(r)];case`past_month`:return[Ru(zu(Ku(r,-1),1)),Ru(r)];case`past_year`:return[Ru(zu(Ku(r,-12),1)),Ru(r)];case`last_n_days`:return[Ru(zu(r,-(n.n-1))),Ru(r)];case`next_n_days`:return[Ru(r),Ru(zu(r,n.n-1))];case`custom`:return[n.from??null,n.to??null]}}function Yu(e){let t=qu(e);return t?Pu[t.kind].replace(`{n}`,String(t.n??``)):`an invalid range`}function Xu(e,t,n){let r=e||`exact`;if(!Fu.includes(r))return null;let i=Lu(n);if(!i)throw Error("resolveAnchor() needs an explicit `today`");switch(r){case`today`:return Ru(i);case`yesterday`:return Ru(zu(i,-1));case`one_week_ago`:return Ru(zu(i,-7));case`one_month_ago`:return Ru(Ku(i,-1));case`n_days_ago`:{let e=String(t??``).trim();if(!/^[0-9]+$/.test(e))return null;let n=Number(e);return n>3650?null:Ru(zu(i,-n))}default:{let e=Lu(t);return e?Ru(e):null}}}var Zu=[`text`,`select`,`multiselect`,`user`,`int`,`currency`,`pct`,`date`,`checkbox`,`phone`,`email`,`url`,`rating`,`created_time`,`formula`],mee=new Set([`formula`,`created_time`]);function Qu(e){return e===`select`||e===`user`||e===`multiselect`}function hee(e){let t=new Set,n=[];for(let r of e.split(` +`)){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n.slice(0,50)}function $u(e,t,n=120){let r=Math.max(1,Math.floor(n)),i=e=>e.trim().replace(/\s+/g,` `),a=(i(e)||`Untitled`).slice(0,r).trimEnd(),o=new Set(t.map(e=>i(e).toLocaleLowerCase()));if(!o.has(a.toLocaleLowerCase()))return a;for(let e=2;;e+=1){let t=` ${e}`,n=a.slice(0,Math.max(0,r-t.length)).trimEnd(),i=n?`${n}${t}`:String(e).slice(-r);if(!o.has(i.toLocaleLowerCase()))return i}}function gee(e){return e.filter(e=>e.filterable!==!1)}function ed(e){return Array.isArray(e.options)?e.options:[]}function _ee(e){return typeof e.formula==`string`&&e.formula.trim()!==``?e.formula:void 0}function td(e){let t=typeof e.max==`number`&&Number.isFinite(e.max)?Math.round(e.max):5;return Math.max(2,Math.min(10,t))}var vee=[`grid`,`chart`,`dashboard`,`list`,`calendar`,`kanban`,`map`,`timeseries`],yee={dashboard:`chart`};function bee(e){return yee[e]??e}var nd=[`week`,`month`,`quarter`,`year`],rd=[`abs`,`pct`,`yoy`,`ytd`],xee=[`note`,`formula`],See=/^[A-Za-z0-9_ .+\-*/()[\]]*$/;function Cee(e){let t=e.bucket===void 0||nd.includes(e.bucket),n=e.span,r;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n.lastN;if(typeof e==`number`&&Number.isFinite(e)){let t=Math.round(e);t>=1&&t<=120&&(r={lastN:t})}}let i=e.span===void 0?r===void 0:!!r&&r.lastN===n?.lastN;if(t&&i)return e;let a={...e};return t||delete a.bucket,i||(r?a.span=r:delete a.span),a}function id(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(typeof t.mode!=`string`||!vee.includes(t.mode))return;let n={mode:bee(t.mode)};for(let e of[`dateField`,`stackField`,`titleField`,`colorField`,`sizeField`]){let r=t[e];typeof r==`string`&&r!==``&&(n[e]=r)}if(Array.isArray(t.charts)){let e=t.charts.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`string`).map(Cee);e.length&&(n.charts=e.slice(0,12))}if(t.kanbanClamp===!1&&(n.kanbanClamp=!1),(t.calendarMode===`records`||t.calendarMode===`summary`)&&(n.calendarMode=t.calendarMode),Array.isArray(t.calendarMetrics)){let e=[];for(let n of t.calendarMetrics){if(!n||typeof n!=`object`)continue;let t=n;typeof t.id!=`string`||!t.id||typeof t.field!=`string`||!t.field||typeof t.agg!=`string`||!t.agg||e.push({id:t.id,field:t.field,agg:t.agg})}e.length&&(n.calendarMetrics=e.slice(0,4))}if(nd.includes(t.tsBucket)&&(n.tsBucket=t.tsBucket),t.tsSpan&&typeof t.tsSpan==`object`&&!Array.isArray(t.tsSpan)){let e=t.tsSpan,r={};if(typeof e.from==`string`&&e.from&&(r.from=e.from),typeof e.to==`string`&&e.to&&(r.to=e.to),typeof e.lastN==`number`&&Number.isFinite(e.lastN)){let t=Math.round(e.lastN);t>=1&&t<=120&&(r.lastN=t)}(r.from||r.to||r.lastN!=null)&&(n.tsSpan=r)}if(Array.isArray(t.tsFields)){let e=t.tsFields.filter(e=>typeof e==`string`&&e!==``);e.length&&(n.tsFields=e.slice(0,12))}if(Array.isArray(t.tsDeltas)){let e=new Set,r=[];for(let n of t.tsDeltas)typeof n!=`string`||!rd.includes(n)||e.has(n)||(e.add(n),r.push(n));r.length&&(n.tsDeltas=r.slice(0,rd.length))}if(t.tsGridlines===!1&&(n.tsGridlines=!1),t.tsSparkline===!0&&(n.tsSparkline=!0),Array.isArray(t.tsRows)){let e=[],r=new Set;for(let n of t.tsRows){if(!n||typeof n!=`object`)continue;let t=n;if(typeof t.id!=`string`||!t.id||t.id.length>40||r.has(t.id)||typeof t.kind!=`string`||!xee.includes(t.kind)||typeof t.label!=`string`||t.label.length>120)continue;r.add(t.id);let i={id:t.id,kind:t.kind,label:t.label};i.kind===`formula`&&typeof t.expr==`string`&&t.expr.length<=200&&See.test(t.expr)&&(i.expr=t.expr),e.push(i)}e.length&&(n.tsRows=e.slice(0,12))}if(t.tsStyles&&typeof t.tsStyles==`object`&&!Array.isArray(t.tsStyles)){let e={},r=0;for(let[n,i]of Object.entries(t.tsStyles)){if(r>=200)break;if(!n||!i||typeof i!=`object`||Array.isArray(i))continue;let t=i,a={};t.bold===!0&&(a.bold=!0),t.line===!0&&(a.line=!0),!(!a.bold&&!a.line)&&(e[n]=a,r+=1)}r&&(n.tsStyles=e)}if(!(n.mode===`grid`&&!n.dateField&&!n.stackField&&!n.titleField&&!n.colorField&&!n.sizeField&&!n.charts&&n.kanbanClamp===void 0&&!n.calendarMode&&!n.calendarMetrics&&!n.tsBucket&&!n.tsSpan&&!n.tsFields&&!n.tsDeltas&&n.tsGridlines===void 0&&n.tsSparkline===void 0&&!n.tsRows&&!n.tsStyles))return n}function ad(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.round(e);if(!(t<=1))return Math.min(8,t)}function od(e,t){if(e.source!==`overlay`||mee.has(e.type))return!1;let n=e.permissions?.edit??`everyone`;return n===`everyone`?!0:t?t.isAdmin?!0:n===`creator`&&e.createdBy===t.name:!1}function sd(e){return e===`currency`||e===`int`||e===`pct`||e===`rating`||e===`formula`}function cd(e){return e===`date`||e===`created_time`}function ld(e,t){return sd(e)?t===`asc`?`1 → 9`:`9 → 1`:cd(e)?t===`asc`?`Oldest → Newest`:`Newest → Oldest`:t===`asc`?`A → Z`:`Z → A`}function ud(e,t){return e.type===`status`||e.type===`select`||e.type===`multiselect`||e.type===`checkbox`||e.type===`text`&&e.source!==`overlay`&&e.key!==t}var dd=[`topN`,`bottomN`,`inTopPct`,`inBottomPct`,`aboveAvg`,`belowAvg`,`inQuartile`,`inDecile`];function fd(e){return dd.includes(e)}var wee=[`contains`,`doesNotContain`,`eq`,`neq`,`isEmpty`,`isNotEmpty`,`gt`,`gte`,`lt`,`lte`,`between`,`within`,`topN`,`bottomN`,`inTopPct`,`inBottomPct`,`aboveAvg`,`belowAvg`,`inQuartile`,`inDecile`],pd=new Set([`isEmpty`,`isNotEmpty`,`aboveAvg`,`belowAvg`]),md=`__cohort__`;function hd(e){return!Cd(e)&&e.colId===`__cohort__`}var gd=[`anyOf`,`allOf`,`noneOf`],Tee={eq:`anyOf`,neq:`noneOf`};function _d(e){return gd.includes(e)?e:Tee[e]??`anyOf`}function vd(e){let t=[];for(let n of String(e??``).split(`,`)){let e=n.trim();if(!(e===``||t.includes(e))&&(t.push(e),t.length>=20))break}return t}var yd=[`avg`,`median`,`p10`,`p25`,`p75`,`p90`],Eee={avg:`the average`,median:`the median`,p10:`the bottom 10%`,p25:`the bottom quartile`,p75:`the top quartile`,p90:`the top 10%`};function bd(e){return e&&e.kind!==`stat`?e.colId:void 0}function Dee(e){return e?e.kind===`stat`?yd.includes(e.stat):e.colId?e.kind===`measure`?qu(e.window)!=null:e.kind===`field`:!1:!1}function xd(e){return e.colId===`__cohort__`?vd(e.value).length>0:pd.has(e.op)?!0:e.op===`within`?qu(e.dateWindow)!=null:e.rhs?Dee(e.rhs):e.dateMode&&fee.has(e.dateMode)?!0:e.op===`between`?e.value!==``&&e.value2!=null&&e.value2!==``:e.value!==``}var Oee=[`gte`,`gt`,`lte`,`lt`,`eq`,`neq`],kee=[`gte`,`gt`,`lte`,`lt`];function Sd(e){return!Cd(e)&&e.window!=null}function Cd(e){return e!=null&&Array.isArray(e.children)}function wd(e){return Array.isArray(e?.nodes)?e.nodes:[]}function Td(e){return e?.conj===`or`?`or`:`and`}var Aee=new Set([`all-customers`]),jee={key:`customer_data`,scope:`customer`,rowsPath:`customers`,noun:`customer`,nouns:`customers`,measures:!0},Mee={key:`product_data`,scope:`product`,rowsPath:`products`,noun:`product`,nouns:`products`,measures:!1};function Ed(e){return e===`product`?Mee:jee}function Dd(e){return Aee.has(e.id)}function Od(e){return e.config?.display?.mode??`grid`}function kd(e){return e.kind===`system`||Dd(e)?!1:!!e.locked}function Ad(e,t){return t?t.isAdmin?!0:!!e.createdBy&&e.createdBy===t.name:!1}var jd=[`personal`,`collaborative`,`users`],Nee={personal:`Personal`,collaborative:`Collaborative`,users:`Specific users`},Pee={personal:`Only you can change this view.`,collaborative:`Anyone who can see this table can change it.`,users:`Only the people you pick can change it.`};function Fee(e,t,n){let r=e&&typeof e==`object`&&!Array.isArray(e)?e:{},i=jd.includes(r.edit)?r.edit:t;if(i!==`users`)return{edit:i};let a=new Set,o=[];for(let e of(Array.isArray(r.users)?r.users:[]).slice(0,50)){let t=String(e??``).trim();!t||a.has(t.toLowerCase())||n&&!n.includes(t)||(a.add(t.toLowerCase()),o.push(t))}return o.length?{edit:`users`,users:o}:{edit:`personal`}}function Iee(e){return e.permissions?.edit??`collaborative`}function Md(e,t){let n=Iee(e);return n===`collaborative`||!e.createdBy?!0:t?t.isAdmin||e.createdBy&&e.createdBy===t.name?!0:n===`users`&&(e.permissions?.users??[]).includes(t.name):!1}var Nd=[`folder`,`star`,`flag`,`tag`,`bookmark`,`grid`,`chart`,`map`,`users`,`clock`,`heart`,`bolt`],Pd=[`neutral`,`blue`,`green`,`yellow`,`red`],Fd=`folder`,Id=`neutral`;function Lee(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(!Nd.includes(t.shape))return;let n=t.shape,r=Pd.includes(t.tone)?t.tone:Id;if(!(n===`folder`&&r===`neutral`))return{shape:n,tone:r}}var Ld=5*1024*1024;function Ree(e){return e?.windowed?`server-windowed`:`whole-book`}var Rd=`/api/v1`,zd=`same-origin`,Bd=`aios:unauthorized`,Vd=`aios:data-error`,Hd=`aios:toast`,Ud=`aios:derived-cells`,Wd=`aios:workspace-stale`,Gd=`aios:nav-minimize`;function Kd(e,t){typeof window>`u`||window.dispatchEvent(new CustomEvent(e,{detail:t}))}var zee=`streamlit:componentReady`,Bee=`streamlit:render`,Vee=`streamlit:setComponentValue`,Hee=`streamlit:setFrameHeight`,qd=`aios:grid-host-render`;function Jd(e,t){window.parent.postMessage({isStreamlitMessage:!0,type:e,...t},`*`)}function Yd(){return typeof window>`u`||window.parent===window?!1:new URLSearchParams(window.location.search).has(`streamlitUrl`)}function Uee(){Yd()&&(window.addEventListener(`message`,e=>{let t=e.data;if(!t||t.type!==Bee)return;window.__AIOS_STREAMLIT_ARGS__=t.args??{},window.dispatchEvent(new CustomEvent(qd));let n=Number(t.args?.height??760);Jd(Hee,{height:Number.isFinite(n)?n:760})}),Jd(zee,{apiVersion:1}))}function Wee(){return window.__AIOS_STREAMLIT_ARGS__??null}function Gee(e){return window.addEventListener(qd,e),()=>window.removeEventListener(qd,e)}var Xd=[],Zd=null;function Kee(e){Zd=e}function Qd(e){return Yd()?(Xd.push(e),Xd.length>24&&Xd.shift(),Jd(Vee,{value:{events:[...Xd]},dataType:`json`}),!0):Zd?Zd(e):!1}function $d(e){return`${e}:${typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}`}var ef={"Content-Type":`application/json`};async function tf(e){try{return await e.json()}catch{return null}}function nf(e){return e===401?(rf.clear(),Kd(Bd),!0):!1}var qee=5*6e4,rf=new Map;function Jee(){rf.clear()}async function Yee(e){let t=rf.get(e.rowsPath);if(t&&Date.now()-t.ate.pid===t);n&&Object.assign(n,e)}}return r.ok}catch{return!1}}async function Qee(e,t=sf){try{let n=await fetch(`${Rd}/grid/timeseries?scope=${encodeURIComponent(t)}`,{method:`POST`,credentials:zd,headers:ef,body:JSON.stringify(e)});if(nf(n.status)||!n.ok)return{payload:null,status:n.status};let r=await tf(n);return!r||!Array.isArray(r.columns)||!Array.isArray(r.rows)?{payload:null,status:n.status}:{payload:r,status:n.status}}catch{return{payload:null,status:0}}}async function $ee(e,t=sf){try{let n=await fetch(`${Rd}/grid/calendar_metrics?scope=${encodeURIComponent(t)}`,{method:`POST`,credentials:zd,headers:ef,body:JSON.stringify(e)});if(nf(n.status)||!n.ok)return{payload:null,status:n.status};let r=await tf(n);return!r||!r.values||typeof r.values!=`object`?{payload:null,status:n.status}:{payload:r,status:n.status}}catch{return{payload:null,status:0}}}var af=[],of=!1,sf=`customer`;function ete(e){sf=e}async function tte(){if(of||af.length===0)return;of=!0;let e=af;af=[];let t=!1;try{let n=await fetch(`${Rd}/grid/events`,{method:`POST`,credentials:zd,headers:ef,body:JSON.stringify({events:e,scopeKey:sf})});nf(n.status)||(n.ok?nte(await tf(n)):t=!0)}catch{t=!0}finally{of=!1,t?af=[...e,...af].slice(-24):af.length&&tte()}}function nte(e){let t=e,n=t?.toast;typeof n==`string`&&n.trim()!==``&&Kd(Hd,n.trim()),t?.derived&&typeof t.derived==`object`&&!Array.isArray(t.derived)&&Kd(Ud,t.derived);let r=Array.isArray(t?.results)?t.results:[];(t?.rerender===!0||r.some(e=>e?.rerender===!0))&&Kd(Wd)}function rte(e){return af.push(e),af.length>24&&af.shift(),tte(),!0}function ite(){Kee(rte)}function ate(e){return JSON.stringify([e.config?.filters??[],e.config?.filterConj===`or`?`or`:`and`])}function ote(e,t,n){let r=ate(e);return r===ate(t)||r===n?null:r}function cf(e,t){for(let n of e??[]){if(Cd(n)){cf(n.children,t);continue}let e=n;Sd(n)&&e.id&&t.set(e.id,e)}}function ste(e,t,n,r){if(!t||n==null||r-n>12e4)return e;let i=e,a=t.config?t.config.display:void 0;if(t.config&&JSON.stringify(a??null)!==JSON.stringify(e.config?.display??null)){let t={...e.config};a===void 0?delete t.display:t.display=a,i={...e,config:t}}let o=t.config?t.config.cohortLock:void 0;if(t.config&&o!==i.config?.cohortLock){let e={...i.config};o===void 0?delete e.cohortLock:e.cohortLock=o,i={...i,config:e}}let s=t.config?t.config.filters:void 0;if(!Array.isArray(s)||s.length===0)return i;let c=new Map;if(cf(s,c),c.size===0)return i;let l=new Map;cf(e.config?e.config.filters:void 0,l);let u=!1;for(let[e,t]of c){if(!xd(t))continue;let n=l.get(e);if(!n||!xd(n)){u=!0;break}}return u?{...i,config:{...i.config,filters:s,filterConj:t.config.filterConj??e.config.filterConj}}:i}function lf(e,t){let n=e=>{let n={};for(let[r,i]of Object.entries(e??{}))typeof i==`number`&&t-i<=12e4&&(n[r]=i);return n};return{edited:n(e?.edited),deleted:n(e?.deleted)}}function uf(e){if(Array.isArray(e))return e.map(uf);if(e&&typeof e==`object`){let t={};for(let n of Object.keys(e).sort()){let r=e[n];r!==void 0&&(t[n]=uf(r))}return t}return e}function cte(e){let{createdBy:t,permissions:n,editRequestId:r,labelCorrectedFrom:i,labelCorrectionId:a,...o}=e;return JSON.stringify(uf(o))}function lte(e,t,n,r,i){let a=e=>typeof e==`number`&&r-e<=12e4,o=new Map(t.map(e=>[e.key,e])),s=[];for(let t of e){let e=o.get(t.key);if(o.delete(t.key),!a(n?.deleted?.[t.key])){if(!e){s.push(t);continue}if(!i){s.push({...e,...t,note:t.note??e.note});continue}if(t.labelCorrectedFrom===e.label&&t.label!==e.label&&typeof t.labelCorrectionId==`string`&&t.labelCorrectionId===e.editRequestId){s.push(t);continue}if(a(n?.edited?.[t.key])&&cte(e)!==cte(t)){s.push({...e,...t.createdBy==null?{}:{createdBy:t.createdBy}});continue}s.push(t.note==null&&e.note!=null?{...t,note:e.note}:t)}}for(let e of o.values())if(e.custom&&!a(n?.deleted?.[e.key])){if(e.source===`overlay`){s.push(e);continue}(!i||a(n?.edited?.[e.key]))&&s.push(e)}return s}function ute(e,t){let n=e.filter(e=>!(e.pid===t.pid&&e.key===t.key));return n.push(t),n.slice(-64)}function dte(e,t,n){let r=[],i={};for(let a of e){if(a==null||typeof a.pid!=`number`||typeof a.key!=`string`||typeof a.at!=`number`)continue;let e=t(a.pid),o=e?e[a.key]:void 0;String(o??``)!==String(a.value??``)&&(n-a.at>12e4||(r.push(a),i[a.pid]={...i[a.pid],[a.key]:a.value}))}return{keep:r,seeds:i}}function df(){if(typeof window>`u`)return null;let e=window.__AIOS_GRID__;return e&&Array.isArray(e.rows)&&Array.isArray(e.fields)?e:null}function fte(){let e=Wee()?.payload;return e&&Array.isArray(e.rows)&&Array.isArray(e.fields)?e:null}function pte(e,t){let n={...e,workspace:t};Array.isArray(t.measures)&&(n.measures=t.measures),t.measureSets&&typeof t.measureSets==`object`&&(n.measureSets=t.measureSets),t.viewer&&typeof t.viewer.name==`string`&&(n.viewer=t.viewer),Array.isArray(t.userOptions)&&(n.userOptions=t.userOptions);let r=t.derived;return r&&typeof r==`object`&&Object.keys(r).length>0&&(n.rows=e.rows.map(e=>{let t=r[String(e.pid)];return t?{...e,...t}:e})),n}function mte(){return fte()??df()}var ff=Yd(),hte=df()!==null;function gte(e){return`aios-grid-cells:${e}`}function _te(e){try{let t=localStorage.getItem(gte(e)),n=t?JSON.parse(t):null;return Array.isArray(n)?n:[]}catch{return[]}}function vte(e,t){try{localStorage.setItem(gte(e),JSON.stringify(t))}catch{}}function yte(e){let t=e?.workspace?.storageKey;if(!e||!t)return{};let n=new Map(e.rows.map(e=>[e.pid,e])),{keep:r,seeds:i}=dte(_te(t),e=>n.get(e),Date.now());return vte(t,r),i}function bte(e=`customer`){ete(e);let t=Ed(e),[n,r]=(0,L.useState)(()=>mte()),[i,a]=(0,L.useState)(()=>ff?yte(mte()):{}),o=(0,L.useRef)(n);o.current=n,(0,L.useEffect)(()=>{if(ff){let e=()=>{let e=fte();if(!e)return;let t=yte(e);Object.keys(t).length&&a(e=>{let n={...e};for(let[e,r]of Object.entries(t))n[Number(e)]={...r,...n[Number(e)]};return n}),r(e)};return e(),Gee(e)}if(df())return;let n=!1;async function i(){let[i,a]=await Promise.all([Yee(t),Xee(e)]);n||!i||r(a?pte(i,a):i)}i();async function o(){let t=await Xee(e);n||!t||r(e=>e&&pte(e,t))}let s=e=>{let t=e.detail;!t||typeof t!=`object`||r(e=>{if(!e)return e;let n=!1,r=e.rows.map(e=>{let r=t[String(e.pid)];if(!r||typeof r!=`object`)return e;let i={};for(let[e,t]of Object.entries(r))(t===null||typeof t==`string`||typeof t==`number`)&&(i[e]=t);return Object.keys(i).length===0?e:(n=!0,{...e,...i})});return n?{...e,rows:r}:e})},c=()=>{o()};return typeof window<`u`&&(window.addEventListener(Wd,c),window.addEventListener(Ud,s)),()=>{n=!0,typeof window<`u`&&(window.removeEventListener(Wd,c),window.removeEventListener(Ud,s))}},[e,t]);let s=(0,L.useCallback)((e,n)=>{let r;if(a(t=>(r=t[e],{...t,[e]:{...t[e],...n}})),ff){let t=o.current?.workspace?.storageKey;if(t){let r=_te(t),i=Date.now();for(let[t,a]of Object.entries(n))r=ute(r,{pid:e,key:t,value:a??null,at:i});vte(t,r)}Qd({id:$d(`overlay`),type:`overlay_patch`,pid:e,updates:n});return}hte||Zee(t,e,n).then(t=>{t||(console.warn(`customer-grid: overlay PATCH failed for pid ${e}; rolling back`),a(t=>{let n={...t};return r===void 0?delete n[e]:n[e]=r,n}))})},[t]);return{fields:n?.fields??[],rawRows:n?.rows??[],payload:n,loading:n===null,overlayEdits:i,setOverlayEdits:a,patchOverlay:s}}var pf=`#202433`,mf=`#6B7280`,hf=`#E6E9EF`,xte=`#FFFFFF`,Ste=`#FAFBFC`,Cte=`#9DBFF2`,gf=`#EDF3FD`,wte=`#F5D989`,_f=`#FBF4E0`,Tte=`#F0A8A0`,Ete=`#FCEEEC`,Dte=`#A5D8B4`,vf=`#EBF6EF`,yf=`#F1EEFB`,Ote=`#6B57A8`,kte=`#768FB6`,Ate=`#4F6079`,bf=`#7E6428`,jte=`#A3453C`,xf=`#35754E`,Sf={accentColor:kte,accentLight:gf,textDark:pf,textMedium:mf,textLight:`#8B92A0`,textHeader:pf,bgCell:xte,bgHeader:Ste,bgHeaderHovered:`#F1F3F6`,bgHeaderHasFocus:gf,borderColor:hf,horizontalBorderColor:hf,fgIconHeader:mf,bgIconHeader:hf,fontFamily:`Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,baseFontStyle:`13px`,headerFontStyle:`600 13px`},Mte={growing:{bgBubble:vf,textBubble:xf},new:{bgBubble:gf,textBubble:Ate},declining:{bgBubble:_f,textBubble:bf},dormant:{bgBubble:hf,textBubble:pf},lost:{bgBubble:Ete,textBubble:jte},reactivated:{bgBubble:Dte,textBubble:pf}},Nte={growing:{bgCell:`rgba(165, 216, 180, 0.40)`},new:{bgCell:`rgba(157, 191, 242, 0.38)`},declining:{bgCell:`rgba(245, 217, 137, 0.42)`},dormant:{bgCell:`rgba(107, 114, 128, 0.13)`},lost:{bgCell:`rgba(240, 168, 160, 0.38)`},reactivated:{bgCell:`rgba(165, 216, 180, 0.72)`}},Pte={growing:{bgCell:`rgba(165, 216, 180, 0.62)`},new:{bgCell:`rgba(157, 191, 242, 0.60)`},declining:{bgCell:`rgba(245, 217, 137, 0.64)`},dormant:{bgCell:`rgba(107, 114, 128, 0.22)`},lost:{bgCell:`rgba(240, 168, 160, 0.60)`},reactivated:{bgCell:`rgba(165, 216, 180, 0.92)`}},Fte={bgCell:`rgba(32, 36, 51, 0.06)`},Ite=Fte,Lte=Fte,Cf=`700 13px`;function wf(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}var Rte={filter:{bgHeader:vf,bgHeaderHovered:vf,bgHeaderHasFocus:vf,bgCell:wf(xf,.06),headerFontStyle:Cf},sort:{bgHeader:_f,bgHeaderHovered:_f,bgHeaderHasFocus:_f,bgCell:wf(bf,.06),headerFontStyle:Cf},group:{bgHeader:yf,bgHeaderHovered:yf,bgHeaderHasFocus:yf,bgCell:wf(Ote,.06),headerFontStyle:Cf}},zte=mf,Tf=(e,t,n)=>`M${e-n} ${t}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0`,Ef=[{d:`M3.2 4.6h9.6v8.2H3.2z`},{d:`M3.2 7.2h9.6`},{d:`M5.8 3v3.2`},{d:`M10.2 3v3.2`}],Df={text:[{d:`M3 5h10M3 8h10M3 11h6`}],status:[{d:`M4 13V3.5h7.6L10.1 6l1.5 2.5H4`}],currency:[{d:`M8 2.8v10.4`},{d:`M10.6 5.4A2.6 2.6 0 0 0 8.2 4.2H7.4a2 2 0 0 0 0 4h1.2a2 2 0 0 1 0 4H7.8a2.6 2.6 0 0 1-2.4-1.4`}],int:[{d:`M6.2 3L4.8 13M11.2 3l-1.4 10M3.4 6.2h9.2M2.9 9.8h9.2`}],date:Ef,pct:[{d:Tf(4.6,4.6,1.6)},{d:Tf(11.4,11.4,1.6)},{d:`M12.2 3.9L3.8 12.3`}],select:[{d:`M3.2 3.8h9.6v8.4H3.2z`},{d:`M6.2 7.2l1.8 1.8 1.8-1.8`}],user:[{d:Tf(8,6,2.4)},{d:`M3.6 13c0-2.4 2-3.8 4.4-3.8s4.4 1.4 4.4 3.8`}],multiselect:[{d:`M3 4.6h2.2v2.2H3zM3 9.2h2.2v2.2H3z`},{d:`M7.2 5.7h6M7.2 10.3h6`}],checkbox:[{d:`M3.4 3.4h9.2v9.2H3.4z`},{d:`M5.8 8.1l1.8 1.9 3.4-3.9`}],phone:[{d:`M5.1 3.2L7 5.1 5.6 7a7.2 7.2 0 0 0 3.4 3.4l1.9-1.4 1.9 1.9-1.5 1.6c-3 .5-8.3-4.8-7.8-7.8z`}],email:[{d:`M3 4.4h10v7.2H3z`},{d:`M3 4.9l5 3.9 5-3.9`}],url:[{d:`M7 5.4L8.4 4a2.6 2.6 0 0 1 3.7 3.7L10.7 9`},{d:`M9 10.6L7.6 12a2.6 2.6 0 0 1-3.7-3.7L5.3 7`},{d:`M6.2 9.8l3.6-3.6`}],rating:[{d:`M8 2.9l1.63 3.3 3.64.53-2.63 2.57.62 3.63L8 11.24 4.74 12.93l.62-3.63L2.73 6.73l3.64-.53z`,fill:!0}],created_time:[{d:Tf(8,8,5.2)},{d:`M8 4.9v3.4l2.3 1.4`}],formula:[{d:`M5.6 12.8V5.4a2 2 0 0 1 3.2-1.6`},{d:`M4.2 7.6h4.6`},{d:`M10.2 8.4l3 3.4M13.2 8.4l-3 3.4`}]},Of={grid:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M2.6 6.5h10.8M2.6 9.5h10.8M6.4 3.4v9.2M10 3.4v9.2`}],list:[{d:`M3 4.6h1.4M6.4 4.6h6.6M3 8h1.4M6.4 8h6.6M3 11.4h1.4M6.4 11.4h6.6`}],chart:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M5.4 10.6V7.2M8 10.6V5.4M10.6 10.6V8.6`}],dashboard:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M5.4 10.6V7.2M8 10.6V5.4M10.6 10.6V8.6`}],calendar:Ef,kanban:[{d:`M2.8 3.4h3.1v9.2H2.8zM6.5 3.4h3.1v6.2H6.5zM10.2 3.4h3.1v7.6h-3.1z`}],map:[{d:`M8 2.6a3.6 3.6 0 0 1 3.6 3.6c0 2.7-3.6 7.2-3.6 7.2S4.4 8.9 4.4 6.2A3.6 3.6 0 0 1 8 2.6z`},{d:Tf(8,6.1,1.3)}],timeseries:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M2.6 6.6h10.8M6.2 3.4v9.2`},{d:`M7.2 10.8l2-2.4 1.6 1.2 1.8-2.6`}]},Bte={bar:[{d:`M3.2 12.8V7.4M6.4 12.8V4.2M9.6 12.8V8.8M12.8 12.8V5.8`}],line:[{d:`M2.6 11.2l3.2-3.4 2.6 2 4.9-5.2`},{d:Tf(5.8,7.8,.9)},{d:Tf(8.4,9.8,.9)}],area:[{d:`M2.6 12.4V9.2l3.2-3.2 2.6 2 4.9-4.6v9z`},{d:`M2.6 9.2l3.2-3.2 2.6 2 4.9-4.6`}],donut:[{d:Tf(8,8,5)},{d:Tf(8,8,2.1)}],kpi:[{d:`M2.6 3.8h10.8v8.4H2.6z`},{d:`M5.4 9.6V6.4l1.9 3.2V6.4M9.4 6.4v3.2h1.8`}],table:[{d:`M2.6 3.4h10.8v9.2H2.6z`},{d:`M2.6 6.2h10.8M7.2 6.2v6.4M2.6 9.4h10.8`}]},Vte={bar:`blue`,line:`green`,area:`green`,donut:`yellow`,kpi:`neutral`,table:`neutral`},Hte={folder:[{d:`M2.4 12.6V4.2a.6.6 0 0 1 .6-.6h3.2l1.5 1.7h5.3a.6.6 0 0 1 .6.6v6.7a.6.6 0 0 1-.6.6H3a.6.6 0 0 1-.6-.6z`}],star:[{d:`M8 2.9l1.63 3.3 3.64.53-2.63 2.57.62 3.63L8 11.24 4.74 12.93l.62-3.63L2.73 6.73l3.64-.53z`}],flag:[{d:`M4.2 13.4V2.9`},{d:`M4.2 3.4h7.6l-1.5 2.6 1.5 2.6H4.2z`}],tag:[{d:`M2.9 8.2V3.5a.6.6 0 0 1 .6-.6h4.7l5 5-5.3 5.3z`},{d:Tf(5.6,5.6,1)}],bookmark:[{d:`M4.4 2.9h7.2v10.4L8 10.7l-3.6 2.6z`}],grid:Of.grid,chart:Of.dashboard,map:Of.map,users:Df.user,clock:Df.created_time,heart:[{d:`M8 13.1S2.7 9.8 2.7 6.4a2.9 2.9 0 0 1 5.3-1.6 2.9 2.9 0 0 1 5.3 1.6c0 3.4-5.3 6.7-5.3 6.7z`}],bolt:[{d:`M9.1 2.4L4.2 9.1h3.3l-.6 4.5 4.9-6.7H8.5z`}]},kf={neutral:{fill:hf,stroke:mf},blue:{fill:Cte,stroke:kte},green:{fill:Dte,stroke:xf},yellow:{fill:wte,stroke:bf},red:{fill:Tte,stroke:jte}},Af={neutral:`Neutral`,blue:`Blue`,green:`Green`,yellow:`Yellow`,red:`Red`},jf={folder:`Folder`,star:`Star`,flag:`Flag`,tag:`Tag`,bookmark:`Bookmark`,grid:`Table`,chart:`Chart`,map:`Map`,users:`People`,clock:`Clock`,heart:`Heart`,bolt:`Priority`},Mf={grid:`Grid`,chart:`Chart`,dashboard:`Chart`,list:`List`,calendar:`Calendar`,kanban:`Kanban`,map:`Map`,timeseries:`Time series`},Nf=[`grid`,`chart`,`calendar`,`kanban`,`timeseries`,`map`,`list`],Pf={grid:`blue`,list:`blue`,chart:`green`,dashboard:`green`,calendar:`yellow`,kanban:`yellow`,map:`red`,timeseries:`green`},Ff={text:`Single line text`,select:`Single select`,multiselect:`Multi select`,user:`Assignee`,int:`Number`,currency:`Currency`,pct:`Percent`,date:`Date`,checkbox:`Checkbox`,phone:`Phone number`,email:`Email`,url:`URL`,rating:`Rating`,created_time:`Created time`,formula:`Formula`,status:`Lifecycle status (Odoo)`};function Ute(e,t){return e.fill?``:``}function Wte(e){return({fgColor:t})=>``+e.map(e=>Ute(e,t)).join(``)+``}function If(e){return`t_${e}`}var Gte={...Object.fromEntries(Object.keys(Df).map(e=>[If(e),Wte(Df[e])])),aiosInfo:()=>``};function Kte(e,t,n){return e&&t>Math.max(0,n-16)?e:null}function qte(e,t,n,r=8){let i=Math.min(n,280);return Math.round(Math.max(r,Math.min(e,t-r-i)))}var Lf=`600 13px`;function Jte(e,t,n,r,i){let a=t=>`${e} ${t} (${n})`,o=a(t);if(r==null||r<=0||i(o)<=r)return o;let s=r-i(a(``));return s<=0?o:a(Qte(t,s,i))}function Yte(e,t,n,r=4){if(n.length===0)return null;let i=[],a=e.x+e.width-t-r;for(let t of n){let n=a-t;if(n-e.x<68)return null;i.push({x:Math.round(n),y:Math.round(e.y+(e.height-t)/2),size:t}),a=n-6}return i}function Xte(e,t){let n=[];return e&&n.push(16),t&&n.push(6),n}function Zte(e,t,n=30){let r=Yte({x:0,y:0,width:e,height:32},n,t===!0?[16]:t===!1?[]:t);return r?Math.max(0,r[r.length-1].x-32-6):null}function Qte(e,t,n){if(t==null||!e||n(e)<=t)return e;let r=n(`…`);if(r>t)return e;let i=0,a=e.length;for(;it.x+t.width||at.y+t.height)?null:{x:i,y:a,size:n}}function ene(e){let{placement:t,target:n,panel:r,viewport:i}=e,a=i.left+8,o=i.left+i.width-8,s=i.top+8,c=i.top+i.height-8,l=Math.max(1,o-a),u=Math.min(r.width,l),d=r.height,f,p,m,h;if(t===`right-start`){let e=Math.max(0,o-(n.right+6)),t=Math.max(0,n.left-6-a),r=u<=e||e>=t;h=r?`right`:`left`;let i=r?n.right+6:n.left-6-u;f=Math.min(Math.max(i,a),Math.max(a,o-u)),m=Math.max(1,c-s),p=Math.min(Math.max(n.top,s),Math.max(s,c-Math.min(d,m)))}else{let e=Math.max(0,c-(n.bottom+6)),r=Math.max(0,n.top-6-s),i=d<=e||e>=r;h=i?`below`:`above`,m=Math.max(1,i?e:r);let l=t===`bottom-end`?n.right-u:n.left;f=Math.min(Math.max(l,a),o-u),p=i?Math.min(n.bottom+6,c-m):Math.max(s,n.top-6-Math.min(d,m))}return{left:Math.round(f),top:Math.round(p),maxWidth:Math.floor(l),maxHeight:Math.floor(m),side:h}}var tne=150,Rf={base:void 0,bold:void 0};function nne(e,t=!1){let n=t?`bold`:`base`;if(Rf[n]===void 0){let e=document.createElement(`canvas`).getContext(`2d`);e&&(e.font=`${(t?`700 13px`:Sf.headerFontStyle)??`600 13px`} ${Sf.fontFamily??`Inter, sans-serif`}`),Rf[n]=e}let r=Rf[n];return r?r.measureText(e).width:0}function rne(e){return!!(e.note||e.description)}function zf(e,t){for(let n of e??[]){if(Cd(n)){zf(n.children,t);continue}xd(n)&&t.add(n.colId)}}function ine(e){return e?Rte[e]:void 0}function ane(e){let t=new Map;e.groupBy&&t.set(e.groupBy,`group`);for(let n of e.sorts??[])t.set(n.colId,`sort`);let n=new Set;zf(e.filters??[],n);for(let e of n)t.set(e,`filter`);return t}function Bf(e){return e.default!==!1||e.source===`overlay`}function Vf(e){let t=e.filter(Bf).map(e=>e.key),n=e.filter(e=>!Bf(e)).map(e=>e.key);return{filters:[],filterConj:`and`,sorts:[],groupBy:null,colorBy:null,rowHeightMode:`short`,order:[...t,...n],visible:t,widths:{},memberPids:[]}}function one(e,t){let n=new Set(t.map(e=>e.key)),r=e.filter((t,r)=>n.has(t)&&e.indexOf(t)===r);for(let e of t)r.includes(e.key)||r.push(e.key);let i=t.find(e=>e.pinned)?.key??t[0]?.key;return i&&r[0]!==i?[i,...r.filter(e=>e!==i)]:r}function sne(e,t,n){let r=new Set(t.map(e=>e.key)),i=new Set(e.filter(e=>r.has(e)));if(i.size===0)for(let e of t)Bf(e)&&i.add(e.key);return n&&i.add(n),i}function cne(e,t,n){let r=(0,L.useMemo)(()=>new Map(e.map(e=>[e.key,e])),[e]),i=(0,L.useMemo)(()=>e.find(e=>e.pinned)?.key??e[0]?.key??``,[e]),a=(0,L.useMemo)(()=>one(t.order,e),[t.order,e]),o=(0,L.useMemo)(()=>sne(t.visible,e,i),[t.visible,e,i]),s=(0,L.useMemo)(()=>ane(t),[t.filters,t.sorts,t.groupBy]),c=(0,L.useMemo)(()=>a.filter(e=>o.has(e)).map(e=>{let n=r.get(e),i=t.widths[e]??tne,a=s.has(e),o=Xte(rne(n),n.source===`overlay`);return{id:e,title:Qte(n.label,Zte(i,o),e=>nne(e,a)),width:i,hasMenu:!0,menuIcon:`dots`,icon:If(n.type),themeOverride:ine(s.get(e))}}),[a,o,t.widths,r,s]),l=(0,L.useCallback)((e,r)=>{e.id&&n({...t,widths:{...t.widths,[e.id]:Math.round(r)}})},[t,n]),u=(0,L.useCallback)((e,r)=>{if(e===0||r===0)return;let i=a.filter(e=>o.has(e));if(e<0||e>=i.length||r<0||r>=i.length)return;let s=i.slice(),[c]=s.splice(e,1);s.splice(r,0,c);let l=0,u=a.map(e=>o.has(e)?s[l++]:e);n({...t,order:u})},[t,n,a,o]),d=(0,L.useCallback)((e,t)=>e!==0&&t!==0,[]),f=(0,L.useCallback)((e,r)=>{if(!r&&e===i)return;let a=new Set(o);r?a.add(e):a.delete(e),n({...t,visible:[...a]})},[t,i,n,o]),p=(0,L.useCallback)((e,r,i)=>{let s=a.filter(t=>t!==e);if(i===`end`||!r)s.push(e);else{let t=Math.max(0,s.indexOf(r));s.splice(t+ +(i===`right`),0,e)}let c=new Set(o);c.add(e),n({...t,order:s,visible:[...c]})},[t,n,a,o]);return{visibleCols:c,fieldByKey:r,order:a,visible:o,widths:t.widths,lockedKey:i,onColumnResize:l,onColumnMoved:u,onColumnProposeMove:d,setColumnVisible:f,insertColumn:p}}function lne(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:0}function une(e,t){let n={};for(let r of t){if(r.agg!==`sum`)continue;let t=0;for(let n of e)t+=lne(n[r.key]);let i=Math.round(t*100)/100;n[r.key]=r.type===`currency`?`$`+i.toLocaleString():i.toLocaleString()}return n}var Hf={sets:new Map,unanswerable:0};function dne(e){return e===`currency`||e===`int`||e===`pct`||e===`rating`||e===`formula`}function Uf(e){return!Cd(e)&&!Sd(e)&&fd(e.op)}function Wf(e){for(let t of e??[]){if(Cd(t)){if(Wf(t.children))return!0;continue}if(Uf(t))return!0}return!1}function Gf(e){let t=[];for(let n of e??[]){if(Cd(n)){let e=Gf(n.children);e.length&&t.push({conj:n.conj,children:e});continue}Uf(n)||t.push(n)}return t}function Kf(e){let t=[];for(let n of e??[]){if(Cd(n)){t.push(...Kf(n.children));continue}if(!Uf(n))continue;let e=n;xd(e)&&t.push(e)}return t}function fne(e,t,n){let r=[];for(let n of e){let e=n[t];if(e==null||e===``)continue;let i=typeof e==`number`?e:Number(e);Number.isFinite(i)&&r.push({pid:n.pid,v:i})}return r.sort((e,t)=>e.v===t.v?e.pid-t.pid:n===`asc`?e.v-t.v:t.v-e.v),r}function qf(e,t,n){let r=Number(e);if(!Number.isFinite(r))return null;let i=Math.trunc(r);return i!==r||in?null:i}function pne(e,t,n){return Math.min(n,Math.floor(e*n/t)+1)}function Jf(e,t){return Math.min(e,Math.max(1,Math.ceil(e*t/100)))}function mne(e,t,n){let r=Kf(e);if(!r.length)return Hf;let i=new Map,a=0,o=new Map,s=(e,n)=>{let r=`${n}:${e}`,i=o.get(r);return i||(i=fne(t,e,n),o.set(r,i)),i},c=e=>{i.set(e,new Set),a+=1};for(let e of r){let r=n.get(e.colId);if(!r||!dne(r.type)){c(e);continue}let o=s(e.colId,`asc`);if(!o.length){i.set(e,new Set),t.length&&(a+=1);continue}let l=o.length,u=null;switch(e.op){case`topN`:{let t=qf(e.value,1,1e4);u=t==null?null:s(e.colId,`desc`).slice(0,t);break}case`bottomN`:{let t=qf(e.value,1,1e4);u=t==null?null:o.slice(0,t);break}case`inTopPct`:{let t=qf(e.value,1,100);u=t==null?null:s(e.colId,`desc`).slice(0,Jf(l,t));break}case`inBottomPct`:{let t=qf(e.value,1,100);u=t==null?null:o.slice(0,Jf(l,t));break}case`aboveAvg`:case`belowAvg`:{let t=o.reduce((e,t)=>e+t.v,0)/l;u=o.filter(n=>e.op===`aboveAvg`?n.v>t:n.vpne(r,l,t)===n);break}default:u=null}if(u==null){c(e);continue}i.set(e,new Set(u.map(e=>e.pid)))}return{sets:i,unanswerable:a}}function Yf(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:0}function Xf(e){return e===`currency`||e===`int`||e===`pct`||e===`rating`||e===`formula`}function hne(e){return e===`date`||e===`created_time`}function gne(e,t,n){for(let r of n){if(r.type!==`text`&&r.type!==`status`)continue;let n=t[r.key];if(n!=null&&String(n).toLowerCase().includes(e))return!0}return!1}function Zf(e){return e==null||e===``}function _ne(e,t,n,r){let i=n.get(e.colId);if(!i)return!0;let a=t[e.colId];if(e.op===`isEmpty`)return Zf(a);if(e.op===`isNotEmpty`)return!Zf(a);if(fd(e.op))return!1;let o=e.rhs!=null,s=o?t[bd(e.rhs)??``]:void 0;if(Xf(i.type)){let t=Yf(a);if(o)return Qf(e.op,t,Yf(s));if(e.op===`between`){if(e.value===``||e.value2==null||e.value2===``)return!0;let n=Math.min(Yf(e.value),Yf(e.value2)),r=Math.max(Yf(e.value),Yf(e.value2));return t>=n&&t<=r}return e.value===``||Qf(e.op,t,Yf(e.value))}if(hne(i.type)){let t=String(a??``).slice(0,10);if(e.op===`within`){if(!r)return!1;let n=Ju(e.dateWindow,r);if(!n||t===``)return!1;let[i,a]=n;return(i==null||t>=i)&&(a==null||t<=a)}if(o)return $f(e.op,t,String(s??``).slice(0,10));if(e.op===`between`){if(e.value===``||e.value2==null||e.value2===``)return!0;let n=e.value=n&&t<=r}if(!vne.has(e.op)||!e.dateMode&&e.value===``)return!0;let n=e.dateMode||`exact`;if(n!==`exact`&&!r)return!1;let i=Xu(n,e.value,r||`1970-01-01`);return i!=null&&$f(e.op,t,i)}let c=String(a??``).toLowerCase();return o?ep(e.op,c,String(s??``).toLowerCase()):e.value===``||ep(e.op,c,e.value.toLowerCase())}var vne=new Set([`eq`,`neq`,`lt`,`lte`,`gt`,`gte`]);function Qf(e,t,n){switch(e){case`gt`:return t>n;case`gte`:return t>=n;case`lt`:return tn;case`gte`:return t>=n;default:return!0}}function ep(e,t,n){switch(e){case`contains`:return t.includes(n);case`doesNotContain`:return!t.includes(n);case`eq`:return t===n;case`neq`:return t!==n;default:return!0}}function tp(e,t,n,r){if(Cd(e)){let i=!1,a=!0,o=!1;for(let s of e.children){let e=tp(s,t,n,r);e!==null&&(i=!0,a&&=e,o||=e)}return i?e.conj===`or`?o:a:null}if(hd(e)){if(!xd(e))return null;let n=vd(e.value).map(e=>r?.cohortSets?.[e]);if(n.some(e=>!e))return!1;let i=_d(e.op);if(i===`allOf`)return n.every(e=>e.has(t.pid));let a=n.some(e=>e.has(t.pid));return i===`noneOf`?!a:a}if(Sd(e)){if(!xd(e))return null;let n=e.id?r?.measureSets?.[e.id]:void 0;return n?n.has(t.pid):!1}if(!n.has(e.colId)||e.rhs&&!n.has(bd(e.rhs)??``)||!xd(e))return null;if(fd(e.op)){let n=r?.rankSets?.get(e);return n?n.has(t.pid):!1}return wee.includes(e.op)?_ne(e,t,n,r?.today):!1}function np(e,t){let n=0;for(let r of e??[]){if(Cd(r)){n+=np(r.children,t);continue}!Sd(r)||!xd(r)||(!r.id||!t?.[r.id])&&(n+=1)}return n}function rp(e){let t=[];for(let n of e??[]){if(Cd(n)){t.push(...rp(n.children));continue}!Sd(n)||!xd(n)||t.push(n.id||`(no-id)`)}return t}function ip(e,t){let n=0;for(let r of e??[]){if(Cd(r)){n+=ip(r.children,t);continue}if(xd(r)){if(hd(r)){vd(r.value).some(e=>!t?.cohortSets?.[e])&&(n+=1);continue}Sd(r)||(r.op===`within`?(!t?.today||!Ju(r.dateWindow,t.today))&&(n+=1):r.dateMode&&(!t?.today||Xu(r.dateMode,r.value,t.today)==null)&&(n+=1))}}return n}function ap(e,t,n,r,i){let a=tp({conj:t,children:e},n,r,i);return a===null||a}function yne(e,t){return(n,r)=>{for(let i of e){let e=t.get(i.colId),a=e?Xf(e.type):!1,o=n[i.colId],s=r[i.colId],c=Zf(o),l=Zf(s);if(c!==l)return c?1:-1;if(c&&l)continue;let u=a?Yf(o)-Yf(s):String(o??``).localeCompare(String(s??``));if(u!==0)return i.dir===`asc`?u:-u}return 0}}function bne(e,t,n,r){let i=[],a=new Map,o=r.some(e=>e.key===t&&(e.multi||e.type===`multiselect`)),s=r.some(e=>e.key===t&&e.type===`checkbox`),c=e=>s?e===`1`?`Checked`:`Unchecked`:e===``?`(empty)`:e;for(let n of e){let e=n[t],r=e==null?``:String(e),s=o?r.split(`,`).map(e=>e.trim()).filter(e=>e!==``):[r];for(let e of s.length?s:[``]){let t=a.get(e);t||(t=[],a.set(e,t),i.push(e)),t.push(n)}}let l=[];for(let e of i){let t=a.get(e),i=n.has(e),o=une(t,r);if(l.push({kind:`group-header`,groupKey:e,label:c(e),count:t.length,collapsed:i,aggs:o}),!i){for(let e of t)l.push({kind:`data`,record:e});l.push({kind:`group-footer`,groupKey:e,aggs:o})}}return l}function op(e){let{rawRows:t,fields:n,filters:r,search:i,sorts:a,groupBy:o,collapsed:s,memberPids:c=[],filterConj:l=`and`,serverWindowed:u=!1,measureSets:d,cohortSets:f,today:p,cohortLock:m}=e,h={measureSets:d,cohortSets:f,today:p},g=0,_=e=>{let t=e.map(e=>({kind:`data`,record:e})),n=new Map;return t.forEach((e,t)=>{e.kind===`data`&&n.set(e.record.pid,t)}),{visibleRows:t,pidToIndex:n,unresolvedRank:g}};if(u)return _(t);let v=new Map;for(let e of n)v.set(e.key,e);let y=t;if(m){let e=f?.[m];if(!e)return _([]);y=y.filter(t=>e.has(t.pid))}if(r.length){if(Wf(r)){let e=Gf(r),t=y,n=mne(r,e.length?t.filter(t=>ap(e,l,t,v,h)):t,v);h.rankSets=n.sets,g=n.unanswerable}else h.rankSets=Hf.sets;let e=new Set(c);y=y.filter(t=>e.has(t.pid)||ap(r,l,t,v,h))}let b=i.trim().toLowerCase();if(b&&(y=y.filter(e=>gne(b,e,n))),a.length&&(y=[...y].sort(yne(a,v))),!o)return _(y);let x=bne(y,o,s,n),S=new Map;return x.forEach((e,t)=>{e.kind===`data`&&!S.has(e.record.pid)&&S.set(e.record.pid,t)}),{visibleRows:x,pidToIndex:S,unresolvedRank:g}}function xne(e,t,n,r,i,a,o,s=[],c=`and`,l=!1,u,d,f,p){return(0,L.useMemo)(()=>op({rawRows:e,fields:t,filters:n,search:r,sorts:i,groupBy:a,collapsed:o,memberPids:s,filterConj:c,serverWindowed:l,measureSets:u,cohortSets:d,today:f,cohortLock:p}),[e,t,n,c,r,i,a,o,s,l,u,d,f,p])}var sp=[{bg:`#EDF3FD`,fg:`#4F6079`},{bg:`#EBF6EF`,fg:`#35754E`},{bg:`#FBF4E0`,fg:`#7E6428`},{bg:`#FCEEEC`,fg:`#A3453C`},{bg:`#F1EEFB`,fg:`#6B57A8`},{bg:`#EEF1F4`,fg:`#4B5563`}];function cp(e){if(!(typeof e!=`string`||!/^#[0-9a-f]{6}$/i.test(e.trim())))return e.trim().toUpperCase()}var lp=`#182230`,up=[{id:`blue-tint`,hue:`blue`,strength:`tint`,bg:`#EDF3FD`,fg:`#4F6079`,label:`Light blue`},{id:`green-tint`,hue:`green`,strength:`tint`,bg:`#EBF6EF`,fg:`#35754E`,label:`Light green`},{id:`yellow-tint`,hue:`yellow`,strength:`tint`,bg:`#FBF4E0`,fg:`#7E6428`,label:`Light yellow`},{id:`red-tint`,hue:`red`,strength:`tint`,bg:`#FCEEEC`,fg:`#A3453C`,label:`Light red`},{id:`purple-tint`,hue:`purple`,strength:`tint`,bg:`#F1EEFB`,fg:`#6B57A8`,label:`Light purple`},{id:`blue-pastel`,hue:`blue`,strength:`pastel`,bg:`#9DBFF2`,fg:lp,label:`Blue`},{id:`green-pastel`,hue:`green`,strength:`pastel`,bg:`#A5D8B4`,fg:lp,label:`Green`},{id:`yellow-pastel`,hue:`yellow`,strength:`pastel`,bg:`#F5D989`,fg:lp,label:`Yellow`},{id:`red-pastel`,hue:`red`,strength:`pastel`,bg:`#F0A8A0`,fg:lp,label:`Red`},{id:`purple-pastel`,hue:`purple`,strength:`pastel`,bg:`#C3B3EE`,fg:lp,label:`Purple`}];function dp(e){let t=cp(e);if(!t)return;let n=pp(t,1),r=pp(t,3),i=pp(t,5),a=up[0],o=1/0;for(let e of up){let t=n-pp(e.bg,1),s=r-pp(e.bg,3),c=i-pp(e.bg,5),l=(n+pp(e.bg,1))/2,u=(2+l/256)*t*t+4*s*s+(2+(255-l)/256)*c*c;u>>0;return sp[t%sp.length]}function Cne(e,t){let n=e.optionColors;if(!n)return;let r=cp(n[t]);if(r)return r;let i=t.trim().toLowerCase();for(let[e,t]of Object.entries(n))if(e.trim().toLowerCase()===i)return cp(t)}function pp(e,t){return Number.parseInt(e.slice(t,t+2),16)}function mp(e){let t=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(pp(e,1))+.7152*t(pp(e,3))+.0722*t(pp(e,5))}function wne(e){let t=mp(cp(e)??`#FFFFFF`),n=mp(`#182230`),r=mp(`#FFFFFF`);return(t+.05)/(n+.05)>=(r+.05)/(t+.05)?`#182230`:`#FFFFFF`}function hp(e,t){if(!t||e.colorCodeOptions===!1)return;let n=Cne(e,t);return n?Sne(n):fp(t)}function gp(e){return fp(e).bg}function _p(e){let t=e.split(`@`)[0].trim().split(/[\s._]+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function Tne(e){return Math.max(14,Math.min(22,e-6))}function Ene(e,t){return{data:{kind:`aios-user`,name:e,photo:t?.[e]},copyData:e}}function vp(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:0}function yp(e){return e===`1`||e===1||e===!0}function bp(e,t){if(t?.abbrev&&Math.abs(e)>=1e3){let t=Math.abs(e),[n,r]=t>=1e9?[1e9,`B`]:t>=1e6?[1e6,`M`]:[1e3,`k`];return(e/n).toFixed(1)+r}let n=t&&Number.isInteger(t.decimals)&&t.decimals>=0&&t.decimals<=4?t.decimals:null,r=t?.thousands!==!1;return n==null?r?e.toLocaleString():String(e):r?e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n}):e.toFixed(n)}function Dne(e){let t=e.includes(` `)?e.replace(` `,`T`):e,n=/T\d{2}:\d{2}/.test(t)&&!/(?:[zZ]|[+-]\d{2}:?\d{2})$/.test(t)?t+`Z`:t,r=new Date(n);return Number.isNaN(r.getTime())?null:r}function xp(e,t){if(t==null||t===``)return``;let n=String(t),r=Dne(n);if(!r)return n;let i=e.format,a=i?.time??e.type===`created_time`,o=i?.tz===`utc`?{timeZone:`UTC`}:void 0;return a?r.toLocaleString(void 0,o):r.toLocaleDateString(void 0,o)}function Sp(e,t){switch(e.type){case`currency`:return t==null||t===``?``:`$`+bp(vp(t),e.format);case`int`:case`formula`:return t==null||t===``?``:bp(vp(t),e.format);case`pct`:return t==null||t===``?``:vp(t).toFixed(1)+`%`;case`date`:case`created_time`:return xp(e,t);case`checkbox`:return yp(t)?`Checked`:``;case`rating`:{let n=vp(t);return n>=1?`${Math.round(n)} of ${td(e)}`:``}case`multiselect`:return String(t??``).split(`,`).map(e=>e.trim()).filter(e=>e!==``).join(`, `);default:return String(t??``)}}ct();function One(e,t,n,r,i){e.beginPath();for(let i=0;i<10;i+=1){let a=Math.PI/5*i-Math.PI/2,o=i%2==0?r:r*.45,s=t+Math.cos(a)*o,c=n+Math.sin(a)*o;i===0?e.moveTo(s,c):e.lineTo(s,c)}e.closePath(),i?(e.fillStyle=`#A98A3E`,e.fill()):(e.strokeStyle=`rgba(118, 143, 182, 0.55)`,e.lineWidth=1,e.stroke())}var Cp=new Map,wp;function Tp(e){wp=e}function kne(e){let t=Cp.get(e);if(t!==void 0)return t;if(typeof Image>`u`)return Cp.set(e,null),null;let n=new Image;return Cp.set(e,n),n.onload=()=>wp?.(),n.onerror=()=>{Cp.set(e,null),wp?.()},n.src=e,n}function Ane(e,t,n,r,i,a,o){let s=a?kne(a):null;if(s&&s.complete&&s.naturalWidth>0){e.save(),e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.clip();let i=Math.max(r*2/s.naturalWidth,r*2/s.naturalHeight),a=s.naturalWidth*i,o=s.naturalHeight*i;e.drawImage(s,t-a/2,n-o/2,a,o),e.restore();return}let c=fp(i);e.save(),e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fillStyle=c.bg,e.fill(),e.fillStyle=c.fg,e.font=`600 ${Math.round(r*.9)}px ${o}`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(_p(i),t,n+.5),e.restore()}var jne={kind:I.Custom,isMatch:e=>e.data?.kind===`aios-user`,draw:(e,t)=>{let{ctx:n,rect:r,theme:i}=e,{name:a,photo:o}=t.data;if(!a)return!0;let s=Tne(r.height),c=r.x+i.cellHorizontalPadding+s/2,l=r.y+r.height/2;return c+s/2>r.x+r.width-i.cellHorizontalPadding||Ane(n,c,l,s/2,a,o,i.fontFamily),!0}},Mne={kind:I.Custom,isMatch:e=>e.data?.kind===`aios-rating`,draw:(e,t)=>{let{ctx:n,rect:r,theme:i}=e,{value:a,max:o}=t.data,s=r.y+r.height/2,c=r.x+i.cellHorizontalPadding+13/2,l=r.x+r.width-i.cellHorizontalPadding;for(let e=0;el);e+=1)One(n,c,s,13/2,ee.trim()).filter(e=>e!==``),r=n.length?hp(e,n[0]):void 0;return{kind:I.Bubble,data:n,allowOverlay:!1,themeOverride:r?{bgBubble:r.bg,textBubble:r.fg}:void 0}}default:return{kind:I.Text,data:String(t??``),displayData:String(t??``),...i}}}ct();var Ep={kind:I.Text,data:``,displayData:``,allowOverlay:!1},Pne=new Set;function Fne(e,t,n,r,i){let a=e.collapsed?`▶`:`▼`,o=e.count.toLocaleString(),s=`${a} ${e.label} (${o})`,c=i?Jte(a,e.label,o,r,i):s;return{kind:I.Text,data:s,displayData:t===0?c:``,allowOverlay:!1,span:[0,Math.max(0,n-1)],themeOverride:{bgCell:`#eef0f3`,bgCellMedium:`#eef0f3`,textDark:`#33333d`,baseFontStyle:Lf}}}var Dp=[`#1b1b22`,`#33333d`,`#4d4d59`,`#33333d`];function Ine(e,t,n){let r=Math.max(22,Math.round((e??120)*.42));return{kind:I.Loading,allowOverlay:!1,skeletonWidth:r,skeletonWidthVariability:Math.min(20,Math.round(r*.35)),skeletonHeight:10,themeOverride:{textDark:Dp[(n+t)%Dp.length]},copyData:``}}function Lne(e,t){let n=t?e.aggs[t.key]:void 0;return{kind:I.Text,data:n??``,displayData:n??``,contentAlign:`right`,allowOverlay:!1,themeOverride:{bgCell:`#f6f7f9`,bgCellMedium:`#f6f7f9`,textDark:`#4a4a55`,baseFontStyle:`600 12px`}}}function Rne(e,t,n,r,i,a,o=0,s=null,c,l=Pne,u=0){return(0,L.useCallback)(([o,d])=>{let f=e[d];if(!f)return Ep;let p=t[o],m=p?n.get(p.id):void 0;if(f.kind===`group-header`)return Fne(f,o,t.length,s,c);if(f.kind===`group-footer`)return Lne(f,m);if(!m)return Ep;let h=r[f.record.pid]?.[m.key]??f.record[m.key];return(h==null||h===``)&&l.has(m.key)?Ine(p?.width,d,u):Nne(m,h,i(m),a)},[e,t,n,r,i,a,o,s,c,l,u])}ct();function zne(e,t,n){let[r,i]=(0,L.useState)(new Set),[a,o]=(0,L.useState)(void 0),s=(0,L.useRef)(null);return(0,L.useEffect)(()=>{o(e=>{if(!e)return e;let n=s.current,r=n==null?void 0:t.get(n);if(r!==void 0)return r===e.cell[1]?e:{cell:[e.cell[0],r],range:{x:e.cell[0],y:r,width:1,height:1},rangeStack:[]}})},[e,t]),{gridSelection:(0,L.useMemo)(()=>{let i=st.empty();for(let e of r){let n=t.get(e);n!==void 0&&(i=i.add(n))}return{current:a&&a.cell[1]{o(t.current);let n=t.current?e[t.current.cell[1]]:void 0;s.current=n&&n.kind===`data`?n.record.pid:null;let r=new Set;for(let n of t.rows){let t=e[n];t&&t.kind===`data`&&r.add(t.record.pid)}i(r)},[e]),selectPids:(0,L.useCallback)((e,t)=>{i(n=>{let r=t===`add`?new Set(n):new Set;for(let t of e)r.add(t);return r})},[]),togglePid:(0,L.useCallback)(e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),setActiveCell:(0,L.useCallback)((t,n)=>{let r=e[n];s.current=r&&r.kind===`data`?r.record.pid:null,o({cell:[t,n],range:{x:t,y:n,width:1,height:1},rangeStack:[]})},[e]),clearSelection:(0,L.useCallback)(()=>{i(new Set),o(void 0),s.current=null},[])}}var Bne=[{key:`filters`,label:`Filter conditions`,blurb:`Which records the view shows, and how the conditions combine.`},{key:`sorts`,label:`Sorts`,blurb:`The order records are listed in.`},{key:`groupBy`,label:`Groups`,blurb:`The field records are bucketed by.`},{key:`visible`,label:`Hidden fields`,blurb:`Which columns are shown.`},{key:`order`,label:`Field order`,blurb:`Left-to-right column order.`},{key:`rowHeightMode`,label:`Row height`,blurb:`Short, medium or tall rows.`}],Vne=Bne.map(e=>e.key);function Hne(e){return typeof e==`string`&&Vne.includes(e)}function Op(e){return JSON.parse(JSON.stringify(e))}function Une(e,t,n){let r={};if(!e)return r;let i=new Set;for(let e of t)Hne(e)&&i.add(e);if(i.size===0)return r;if(i.has(`filters`)&&(r.filters=Op(Array.isArray(e.filters)?e.filters:[]),r.filterConj=e.filterConj),i.has(`sorts`)&&(r.sorts=Op(Array.isArray(e.sorts)?e.sorts:[])),i.has(`groupBy`)&&(r.groupBy=e.groupBy??null),i.has(`visible`)){let t=Op(Array.isArray(e.visible)?e.visible:[]);r.visible=n&&!t.includes(n)?[n,...t]:t}return i.has(`order`)&&(r.order=Op(Array.isArray(e.order)?e.order:[])),i.has(`rowHeightMode`)&&e.rowHeightMode&&(r.rowHeightMode=e.rowHeightMode),r}var Wne=s((e=>{var t=f(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),Gne=s(((e,t)=>{t.exports=Wne()})),Kne=g(),B=Gne(),qne=(0,L.createContext)(null),Jne=[`[data-overlay-autofocus]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[href]`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function Yne({children:e}){let t=(0,L.useRef)([]),n=(0,L.useMemo)(()=>({register:e=>(t.current=[...t.current.filter(t=>t!==e),e],()=>{t.current=t.current.filter(t=>t!==e)}),isTop:e=>t.current.at(-1)===e}),[]);return(0,B.jsx)(qne.Provider,{value:n,children:e})}function Xne(e){if(`getBoundingClientRect`in e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}}return e}function Zne(e,t){return e.left===t.left&&e.top===t.top&&e.maxWidth===t.maxWidth&&e.maxHeight===t.maxHeight&&e.visibility===t.visibility}function Qne({panelRef:e,onDismiss:t,dismissOnOutside:n=!0,initialFocus:r=`first`,restoreFocus:i=!0,trapFocus:a=!1,outsideElements:o=[]}){let s=(0,L.useId)(),c=(0,L.useContext)(qne),l=(0,L.useRef)(t),u=(0,L.useRef)(o);l.current=t,u.current=o,(0,L.useEffect)(()=>c?.register(s),[s,c]),(0,L.useEffect)(()=>{let t=t=>{if(!n||c&&!c.isTop(s))return;let r=t.target;!r||e.current?.contains(r)||u.current.some(e=>e?.contains(r))||(document.activeElement instanceof HTMLElement&&e.current?.contains(document.activeElement)&&document.activeElement.blur(),l.current())},r=t=>{if(c&&!c.isTop(s))return;if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),document.activeElement instanceof HTMLElement&&e.current?.contains(document.activeElement)&&document.activeElement.blur(),l.current();return}if(t.key!==`Tab`||!a)return;let n=Array.from(e.current?.querySelectorAll(Jne)??[]).filter(e=>e.getClientRects().length>0);if(!n.length){t.preventDefault(),e.current?.focus();return}let r=n[0],i=n.at(-1),o=document.activeElement;t.shiftKey&&(o===r||!e.current?.contains(o))?(t.preventDefault(),i.focus()):!t.shiftKey&&o===i&&(t.preventDefault(),r.focus())};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`keydown`,r,!0)}},[n,s,e,c,a]),(0,L.useLayoutEffect)(()=>{let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=window.requestAnimationFrame(()=>{if(r===`none`)return;let t=r===`first`?Jne:r;(e.current?.querySelector(t))?.focus({preventScroll:!0})});return()=>{window.cancelAnimationFrame(n),i&&t?.isConnected&&t.focus({preventScroll:!0})}},[r,e,i])}function $ne({children:e}){return(0,Kne.createPortal)(e,document.body)}function kp({anchor:e,className:t,children:n,onDismiss:r,placement:i=`bottom-start`,role:a,ariaLabel:o,id:s,initialFocus:c=`first`,restoreFocus:l=!0,dismissOnOutside:u=!0,onKeyDown:d,dataKind:f}){let p=(0,L.useRef)(null),[m,h]=(0,L.useState)({position:`fixed`,left:0,top:0,visibility:`hidden`}),g=`getBoundingClientRect`in e?e:null;Qne({panelRef:p,onDismiss:r,dismissOnOutside:u,initialFocus:c,restoreFocus:l,outsideElements:[g]});let _=(0,L.useCallback)(()=>{let t=p.current;if(!t)return;let n=Xne(e),r=window.visualViewport,a=r?.offsetLeft??0,o=r?.offsetTop??0,s=r?.width??window.innerWidth,c=r?.height??window.innerHeight,l=t.getBoundingClientRect(),u=ene({placement:i,target:n,panel:{width:Math.max(l.width,t.scrollWidth),height:Math.max(l.height,t.scrollHeight)},viewport:{left:a,top:o,width:s,height:c}}),d={position:`fixed`,left:u.left,top:u.top,maxWidth:u.maxWidth,maxHeight:u.maxHeight,visibility:`visible`};h(e=>Zne(e,d)?e:d)},[e,i]);return(0,L.useLayoutEffect)(()=>{_();let e=window.requestAnimationFrame(_),t=new ResizeObserver(_);return p.current&&t.observe(p.current),g&&t.observe(g),window.addEventListener(`resize`,_),window.addEventListener(`scroll`,_,!0),window.visualViewport?.addEventListener(`resize`,_),window.visualViewport?.addEventListener(`scroll`,_),()=>{window.cancelAnimationFrame(e),t.disconnect(),window.removeEventListener(`resize`,_),window.removeEventListener(`scroll`,_,!0),window.visualViewport?.removeEventListener(`resize`,_),window.visualViewport?.removeEventListener(`scroll`,_)}},[g,_]),(0,B.jsx)($ne,{children:(0,B.jsx)(`div`,{ref:p,id:s,className:t,style:m,role:a,"aria-label":o,"data-overlay-kind":f,onKeyDown:d,children:n})})}function ere({shapes:e}){return(0,B.jsx)(B.Fragment,{children:e.map((e,t)=>e.fill?(0,B.jsx)(`path`,{d:e.d,fill:`currentColor`},t):(0,B.jsx)(`path`,{d:e.d,fill:`none`,stroke:`currentColor`,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},t))})}function Ap({type:e,size:t=14,title:n}){return(0,B.jsxs)(`svg`,{className:`cg-type-icon`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!n||void 0,role:n?`img`:void 0,"aria-label":n,children:[n&&(0,B.jsx)(`title`,{children:n}),(0,B.jsx)(ere,{shapes:Df[e===`measure`?`currency`:e]})]})}function jp({mode:e,size:t=14}){return(0,B.jsx)(`svg`,{className:`cg-mode-icon`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!0,children:(0,B.jsx)(ere,{shapes:Of[e]})})}function tre({mode:e,tone:t,size:n=15}){let r=kf[t];return(0,B.jsx)(`svg`,{className:`cg-mode-icon cg-tone-icon`,width:n,height:n,viewBox:`0 0 16 16`,"aria-hidden":!0,children:Of[e].map((e,t)=>e.fill?(0,B.jsx)(`path`,{d:e.d,fill:r.stroke},t):(0,B.jsx)(`path`,{d:e.d,fill:`none`,stroke:r.stroke,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},t))})}function nre({kind:e,size:t=15}){let n=kf[Vte[e]];return(0,B.jsx)(`svg`,{className:`cg-mode-icon cg-tone-icon`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!0,children:Bte[e].map((t,r)=>(0,B.jsx)(`path`,{d:t.d,fill:r===0&&(e===`area`||e===`donut`||e===`kpi`||e===`table`)?n.fill:`none`,stroke:n.stroke,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},r))})}var rre={width:16,height:16,viewBox:`0 0 16 16`,fill:`none`},Mp={stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`,strokeLinejoin:`round`},ire={duplicate:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`rect`,{x:`5.5`,y:`5.5`,width:`8`,height:`8`,rx:`1.5`,...Mp}),(0,B.jsx)(`path`,{d:`M10.5 2.5h-7a1 1 0 0 0-1 1v7`,...Mp})]}),insertLeft:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`line`,{x1:`3`,y1:`2.5`,x2:`3`,y2:`13.5`,...Mp}),(0,B.jsx)(`path`,{d:`M13.5 8H6.5M9.2 5.3 6.5 8l2.7 2.7`,...Mp})]}),insertRight:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`line`,{x1:`13`,y1:`2.5`,x2:`13`,y2:`13.5`,...Mp}),(0,B.jsx)(`path`,{d:`M2.5 8h7M6.8 5.3 9.5 8l-2.7 2.7`,...Mp})]}),addEnd:(0,B.jsx)(`path`,{d:`M8 3v10M3 8h10`,...Mp}),rename:(0,B.jsx)(`path`,{d:`m9.8 3.2 3 3L6.2 12.8l-3.6.6.6-3.6 6.6-6.6Z`,...Mp}),description:(0,B.jsx)(`path`,{d:`M3 4.5h10M3 8h10M3 11.5h6`,...Mp}),permissions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`rect`,{x:`3.5`,y:`7`,width:`9`,height:`6`,rx:`1`,...Mp}),(0,B.jsx)(`path`,{d:`M5.5 7V5.2a2.5 2.5 0 0 1 5 0V7`,...Mp})]}),unlock:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`rect`,{x:`3.5`,y:`7`,width:`9`,height:`6`,rx:`1`,...Mp}),(0,B.jsx)(`path`,{d:`M5.5 7V5.2a2.5 2.5 0 0 1 5 0`,...Mp})]}),format:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M3 5h5.5M12.5 5H13M3 11h1M7 11h6`,...Mp}),(0,B.jsx)(`circle`,{cx:`10.5`,cy:`5`,r:`1.6`,...Mp}),(0,B.jsx)(`circle`,{cx:`4.9`,cy:`11`,r:`1.6`,...Mp})]}),swap:(0,B.jsx)(`path`,{d:`M3.5 6h9M10.2 3.7 12.5 6l-2.3 2.3M12.5 10.5h-9M5.8 8.2 3.5 10.5l2.3 2.3`,...Mp}),sortAsc:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M4.5 3v10M4.5 13l-2-2M4.5 13l2-2`,...Mp}),(0,B.jsx)(`path`,{d:`M8.5 4.5h2M8.5 8h3.5M8.5 11.5h5`,...Mp})]}),sortDesc:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M4.5 3v10M4.5 13l-2-2M4.5 13l2-2`,...Mp}),(0,B.jsx)(`path`,{d:`M8.5 4.5h5M8.5 8h3.5M8.5 11.5h2`,...Mp})]}),off:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,...Mp}),(0,B.jsx)(`line`,{x1:`4.4`,y1:`11.6`,x2:`11.6`,y2:`4.4`,...Mp})]}),filter:(0,B.jsx)(`path`,{d:`M2.5 3.5h11L9.5 8.5v3.8L6.5 14V8.5L2.5 3.5Z`,...Mp}),group:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`line`,{x1:`2.5`,y1:`4`,x2:`13.5`,y2:`4`,...Mp}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`8`,x2:`13.5`,y2:`8`,...Mp}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`12`,x2:`13.5`,y2:`12`,...Mp})]}),pin:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M6 2.5h4l-.5 4L12 9v1H4V9l2.5-2.5L6 2.5Z`,...Mp}),(0,B.jsx)(`line`,{x1:`8`,y1:`10`,x2:`8`,y2:`13.5`,...Mp})]}),unpin:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M6 2.5h4l-.5 4L12 9v1H4V9l2.5-2.5L6 2.5Z`,...Mp}),(0,B.jsx)(`line`,{x1:`8`,y1:`10`,x2:`8`,y2:`13.5`,...Mp}),(0,B.jsx)(`line`,{x1:`3`,y1:`13`,x2:`13`,y2:`3`,...Mp})]}),hide:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M2.5 8s2-3.5 5.5-3.5S13.5 8 13.5 8s-2 3.5-5.5 3.5S2.5 8 2.5 8Z`,...Mp}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`,...Mp}),(0,B.jsx)(`line`,{x1:`3.5`,y1:`12.5`,x2:`12.5`,y2:`3.5`,...Mp})]}),trash:(0,B.jsx)(`path`,{d:`M3.5 4.5h9M6.5 4.5V3h3v1.5M5 4.5l.6 8.5h4.8l.6-8.5`,...Mp}),download:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M8 2.5v7M5.3 6.8 8 9.5l2.7-2.7`,...Mp}),(0,B.jsx)(`path`,{d:`M3 11v1.5a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V11`,...Mp})]}),cohortAdd:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{d:`M2.5 4h7M2.5 7.5h5M2.5 11h4`,...Mp}),(0,B.jsx)(`path`,{d:`M11.5 8.5v5M9 11h5`,...Mp})]})};function are({name:e}){return(0,B.jsx)(`svg`,{...rre,"aria-hidden":!0,children:ire[e]})}function Np({icon:e,text:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`cg-mi-ic`,"aria-hidden":!0,children:typeof e==`string`?(0,B.jsx)(are,{name:e}):e}),(0,B.jsx)(`span`,{className:`cg-mi-text`,children:t})]})}function ore({size:e=14}){return(0,B.jsxs)(`svg`,{className:`cg-eyeoff-icon`,width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:[(0,B.jsx)(`path`,{d:`M2.5 8s2-3.5 5.5-3.5S13.5 8 13.5 8s-2 3.5-5.5 3.5S2.5 8 2.5 8Z`,stroke:`currentColor`,strokeWidth:1.4,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M9.6 8a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0Z`,stroke:`currentColor`,strokeWidth:1.4,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M3.3 12.7 12.7 3.3`,stroke:`currentColor`,strokeWidth:1.4,strokeLinecap:`round`})]})}function sre({size:e=11}){return(0,B.jsxs)(`svg`,{className:`cg-lock-mark`,width:e,height:e,viewBox:`0 0 16 16`,"aria-hidden":!0,children:[(0,B.jsx)(`path`,{d:`M4.2 7.2h7.6v5.6H4.2z`,fill:`none`,stroke:`currentColor`,strokeWidth:1.35,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M5.9 7.2V5.5a2.1 2.1 0 0 1 4.2 0v1.7`,fill:`none`,stroke:`currentColor`,strokeWidth:1.35,strokeLinecap:`round`})]})}function Pp({icon:e,size:t=14}){let n=e?.shape??`folder`,r=kf[e?.tone??`neutral`];return(0,B.jsx)(`svg`,{className:`cg-folder-mark`,width:t,height:t,viewBox:`0 0 16 16`,"aria-hidden":!0,children:Hte[n].map((e,t)=>(0,B.jsx)(`path`,{d:e.d,fill:`none`,stroke:r.stroke,strokeWidth:1.35,strokeLinecap:`round`,strokeLinejoin:`round`},t))})}function cre({item:e}){return e.icon?(0,B.jsx)(B.Fragment,{children:e.icon}):e.type?(0,B.jsx)(Ap,{type:e.type,title:e.type===`measure`?`Metric`:Ff[e.type]}):(0,B.jsx)(`span`,{className:`cg-fsel-nomark`,"aria-hidden":!0})}function lre(){return(0,B.jsx)(`svg`,{className:`cg-fsel-caret`,width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M4 6l4 4 4-4`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ure(){return(0,B.jsx)(`svg`,{className:`cg-type-check`,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`m3.5 8.5 3 3 6-6.5`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`})})}var dre=8;function Fp({fields:e,value:t,onChange:n,placeholder:r=`Choose a field…`,allow:i,ariaLabel:a,className:o,disabled:s,title:c,keepOpen:l,overlayAutofocus:u}){let[d,f]=(0,L.useState)(!1),[p,m]=(0,L.useState)(``),h=(0,L.useRef)(null),g=(0,L.useRef)(null),_=(0,L.useMemo)(()=>i?e.filter(e=>e.type!=null&&i.includes(e.type)):e,[e,i]),v=t!=null,y=v?e.find(e=>e.key===t):void 0,b=p.trim().toLowerCase(),x=b?_.filter(e=>e.label.toLowerCase().includes(b)):_,S=()=>{f(!1),m(``)},C=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`&&e.key!==`Home`&&e.key!==`End`)return;let t=Array.from(g.current?.querySelectorAll(`button.cg-type-row`)??[]).filter(e=>!e.disabled);if(!t.length)return;e.preventDefault();let n=t.indexOf(document.activeElement);if(e.key===`Home`)return t[0].focus();if(e.key===`End`)return t[t.length-1].focus();let r=e.key===`ArrowDown`?1:-1;t[n<0?r===1?0:t.length-1:(n+r+t.length)%t.length].focus()},w;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{ref:h,type:`button`,disabled:s,className:`cg-select cg-fsel`+(y?``:v&&t!==``?` is-missing`:` is-empty`)+(o?` ${o}`:``),"aria-label":a,"aria-haspopup":`listbox`,"aria-expanded":d,"data-overlay-autofocus":u?!0:void 0,onClick:()=>f(e=>!e),children:[y?(0,B.jsx)(cre,{item:y}):(0,B.jsx)(`span`,{className:`cg-fsel-nomark`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`cg-fsel-label`,children:y?.label??(v&&t!==``?t:r)}),(0,B.jsx)(lre,{})]}),d&&h.current&&(0,B.jsx)(kp,{anchor:h.current,className:`cg-pop cg-fsel-pop`,onDismiss:S,role:`dialog`,ariaLabel:a??c??`Choose a field`,initialFocus:_.length>=dre?`.cg-fsel-search input`:`button.cg-type-row`,dataKind:`field-select`,children:(0,B.jsxs)(`div`,{className:`cg-fsel-body`,onKeyDown:C,children:[c&&(0,B.jsx)(`div`,{className:`cg-pop-title`,children:c}),_.length>=dre&&(0,B.jsxs)(`div`,{className:`cg-type-search cg-fsel-search`,children:[(0,B.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:[(0,B.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.4`,stroke:`currentColor`,strokeWidth:`1.35`}),(0,B.jsx)(`path`,{d:`m10.4 10.4 3.1 3.1`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`})]}),(0,B.jsx)(`input`,{type:`text`,value:p,placeholder:`Find a field…`,"aria-label":`Find a field`,onChange:e=>m(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`cg-type-list`,role:`listbox`,ref:g,"aria-label":a??c??`Fields`,children:[x.map(e=>{let r=e.group&&e.group!==w?e.group:null;return w=e.group,(0,B.jsxs)(L.Fragment,{children:[r&&(0,B.jsx)(`div`,{className:`cg-fsel-group`,role:`presentation`,children:r}),(0,B.jsxs)(`button`,{type:`button`,role:`option`,disabled:e.disabled,"aria-selected":e.key===t,className:`cg-type-row`+(e.key===t?` is-on`:``),onClick:()=>{n(e.key),l?m(``):S()},children:[(0,B.jsx)(cre,{item:e}),(0,B.jsxs)(`span`,{className:`cg-type-label`,children:[e.label,e.hint&&(0,B.jsx)(`span`,{className:`cg-fsel-hint`,children:e.hint})]}),e.key===t&&(0,B.jsx)(ure,{})]})]},e.key)}),x.length===0&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:_.length===0?`No field to choose here.`:`No field matches.`})]})]})})]})}function Ip(e,t){let n=e=>e.toLocaleString();if(!t?.windowed)return`${n(e)} ${e===1?`record`:`records`}`;let r=t.matched===1?`record`:`records`,i=t.matched=t.matched?`${n(t.matched)} ${r}${i}`:`showing ${n(t.shown)} of ${n(t.matched)} ${r}${i}`}function fre(e){if(!e?.partial)return null;let t=typeof e.loaded==`number`&&Number.isFinite(e.loaded)&&e.loaded>=0?Math.floor(e.loaded):0,n=typeof e.total==`number`&&Number.isFinite(e.total)&&e.total>0?Math.floor(e.total).toLocaleString():`…`;return`${t.toLocaleString()} of ${n}`}function pre(e,t){if(!t?.windowed)return Ip(e,t);let n=e=>e.toLocaleString();return t.shown>=t.matched?`${n(t.matched)} ${t.matched===1?`record`:`records`}`:`showing ${n(t.shown)} of ${n(t.matched)}`}function Lp({window:e,onWindow:t,kinds:n=Mu}){let r=e.kind;return(0,B.jsxs)(`span`,{className:`cg-cond-window`,children:[(0,B.jsx)(`select`,{className:`cg-select cg-cond-win-kind`,value:r,"aria-label":`Date window`,onChange:n=>{let r=n.target.value;Nu.has(r)?t({kind:r,n:e.n??30}):t(r===`custom`?{kind:r,from:e.from??``,to:e.to??``}:{kind:r})},children:(n.includes(r)?n:[...n,r]).map(e=>(0,B.jsx)(`option`,{value:e,children:Nu.has(e)?Pu[e].replace(`{n}`,`N`):Pu[e]},e))}),Nu.has(r)&&(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-n`,type:`number`,min:1,max:3650,"aria-label":`Number of days`,value:e.n??``,onChange:n=>t({...e,n:n.target.value===``?void 0:Number(n.target.value)})}),r===`custom`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-date`,type:`date`,"aria-label":`Window start`,value:e.from??``,onChange:n=>t({...e,from:n.target.value})}),(0,B.jsx)(`span`,{className:`cg-cond-and`,children:`and`}),(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-date`,type:`date`,"aria-label":`Window end`,value:e.to??``,onChange:n=>t({...e,to:n.target.value})})]})]})}var Rp=sd,zp=cd;function Bp(e){return e===`checkbox`?[`isNotEmpty`,`isEmpty`]:Rp(e)?[`gte`,`gt`,`lte`,`lt`,`eq`,`neq`,`between`,`isEmpty`,`isNotEmpty`]:zp(e)?[`eq`,`within`,`lt`,`gt`,`lte`,`gte`,`neq`,`isEmpty`,`isNotEmpty`]:e===`status`||e===`select`||e===`user`?[`eq`,`neq`,`isEmpty`,`isNotEmpty`]:[`contains`,`doesNotContain`,`eq`,`neq`,`isEmpty`,`isNotEmpty`]}var mre={topN:`top N`,bottomN:`bottom N`,inTopPct:`top N%`,inBottomPct:`bottom N%`,aboveAvg:`above average`,belowAvg:`below average`,inQuartile:`in quartile`,inDecile:`in decile`};function hre(e){switch(e){case`topN`:case`bottomN`:case`inTopPct`:case`inBottomPct`:case`inDecile`:return`10`;case`inQuartile`:return`4`;default:return``}}function gre(e){for(let t of e??[]){if(Cd(t)){if(gre(t.children))return!0;continue}if(fd(t.op)&&!Sd(t))return!0}return!1}function _re(e,t){if(fd(e))return mre[e]??e;if(t===`checkbox`){if(e===`isNotEmpty`)return`is checked`;if(e===`isEmpty`)return`is unchecked`}if(e===`isEmpty`)return`is empty`;if(e===`isNotEmpty`)return`is not empty`;if(zp(t))switch(e){case`eq`:return`is`;case`neq`:return`is not`;case`within`:return`is within`;case`lt`:return`is before`;case`lte`:return`is on or before`;case`gt`:return`is after`;case`gte`:return`is on or after`;case`between`:return`is between`}if(Rp(t))switch(e){case`gte`:return`≥`;case`gt`:return`>`;case`lte`:return`≤`;case`lt`:return`<`;case`eq`:return`=`;case`neq`:return`≠`;case`between`:return`is between`;default:return e}if(t===`multiselect`)switch(e){case`contains`:return`has`;case`doesNotContain`:return`does not have`;case`eq`:return`is exactly`;case`neq`:return`is not exactly`;default:return e}switch(e){case`contains`:return`contains`;case`doesNotContain`:return`does not contain`;case`eq`:return`is`;case`neq`:return`is not`;default:return e}}function vre(e,t){return t&&!e.includes(t)?[...e,t]:[...e]}function yre(e){return e===`or`?`Any of the following are true…`:`All of the following are true…`}var Vp=[...Oee],Hp=[...kee],bre=[...gd];function xre(e){switch(_d(e)){case`allOf`:return`is all of`;case`noneOf`:return`is none of`;default:return`is any of`}}var Sre=`measure`,Up={kind:`ltm`},Cre={kind:`past_month`},wre=[`last_n_days`,`past_week`,`past_month`,`past_year`,`this_week`,`this_month`,`this_year`,`custom`];function Tre(e,t,n,r,i){let a=e.map(e=>({key:e.key,label:e.label,type:e.type})),o=new Set(a.map(e=>e.key));if(!t||o.has(t)||r.has(t)||t===`__cohort__`&&i)return a;let s=n.get(t);return a.push({key:t,label:s?s.label:t,type:s?.type}),a}var Ere=0;function Dre(){return Ere+=1,`r${Date.now().toString(36)}${Ere.toString(36)}`}function Ore(e){let t=e[0];return t?{colId:t.key,op:Bp(t.type)[0],value:``}:null}function kre(e){let t=0;for(let n of e)t+=Cd(n)?kre(n.children):1;return t}function Are({rule:e,onPatch:t}){let n=e.dateMode??`exact`;return(0,B.jsxs)(`span`,{className:`cg-cond-anchor`,children:[(0,B.jsx)(`select`,{className:`cg-select cg-cond-anchor-mode`,value:n,"aria-label":`Date`,onChange:e=>{let n=e.target.value;t({dateMode:n,value:``})},children:Fu.map(e=>(0,B.jsx)(`option`,{value:e,children:e===`n_days_ago`?Iu[e].replace(`{n}`,`N`):Iu[e]},e))}),n===`n_days_ago`&&(0,B.jsx)(`input`,{className:`cg-input cg-cond-win-n`,type:`number`,min:0,max:3650,"aria-label":`Number of days ago`,value:e.value,onChange:e=>t({value:e.target.value})}),n===`exact`&&(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:`date`,"aria-label":`Date`,value:e.value,onChange:e=>t({value:e.target.value})})]})}function jre({rule:e,options:t,isMeasure:n,onPatch:r}){let i=e.rhs,a=bd(i)??``;return(0,B.jsxs)(`span`,{className:`cg-cond-rhs`,children:[(0,B.jsx)(Fp,{className:`cg-cond-field`,ariaLabel:`Compare with field`,placeholder:`Select a field…`,value:a||void 0,fields:t,onChange:e=>{r({rhs:n?{kind:`measure`,colId:e,window:i?.kind===`measure`&&i.window||Up}:{kind:`field`,colId:e}})}}),n&&a!==``&&(0,B.jsx)(Lp,{window:i?.kind===`measure`&&i.window||Up,onWindow:e=>r({rhs:{kind:`measure`,colId:a,window:e}})})]})}function Mre({rule:e,type:t,statusOptions:n,onValue:r,onValue2:i}){if(e.op===`between`){let n=t===`date`||t===`created_time`?`date`:`number`;return(0,B.jsxs)(`span`,{className:`cg-cond-between`,children:[(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:n,value:e.value,onChange:e=>r(e.target.value)}),(0,B.jsx)(`span`,{className:`cg-cond-and`,children:`and`}),(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:n,value:e.value2??``,onChange:e=>i(e.target.value)})]})}return t===`status`||t===`select`||t===`user`||t===`multiselect`?(0,B.jsxs)(`select`,{className:`cg-select cg-cond-val`,value:e.value,onChange:e=>r(e.target.value),children:[(0,B.jsx)(`option`,{value:``,children:`Select…`}),n.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}):(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:t===`date`||t===`created_time`?`date`:Rp(t)?`number`:`text`,placeholder:`Value`,value:e.value,onChange:e=>r(e.target.value)})}function Nre({rule:e,onValue:t}){let n=e.op===`inQuartile`?4:e.op===`inDecile`?10:0;if(n)return(0,B.jsx)(`select`,{className:`cg-select cg-cond-val`,value:e.value,"aria-label":e.op===`inQuartile`?`Quartile`:`Decile`,onChange:e=>t(e.target.value),children:Array.from({length:n},(e,t)=>String(t+1)).map(e=>(0,B.jsx)(`option`,{value:e,children:e===`1`?`${e} (lowest)`:e===String(n)?`${e} (highest)`:e},e))});let r=e.op===`inTopPct`||e.op===`inBottomPct`;return(0,B.jsx)(`input`,{className:`cg-input cg-cond-val`,type:`number`,min:1,max:r?100:1e4,step:1,placeholder:`10`,"aria-label":r?`Percent`:`How many`,value:e.value,onChange:e=>t(e.target.value)})}function Pre({rule:e,lists:t,onPatch:n}){let r=vd(e.value),i=new Map(t.map(e=>[e.id,e.name])),a=t.filter(e=>!r.includes(e.id)),o=a.length>0&&r.length<20,s=e=>n({value:e.join(`,`)});return(0,B.jsxs)(`span`,{className:`cg-cond-cohorts`,children:[r.map(e=>(0,B.jsxs)(`span`,{className:`cg-chip`+(i.has(e)?``:` cg-chip--gone`),children:[(0,B.jsx)(`span`,{className:`cg-chip-text`,children:i.get(e)??`(deleted list)`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-chip-x`,"aria-label":`Remove ${i.get(e)??e}`,onClick:()=>s(r.filter(t=>t!==e)),children:`×`})]},e)),(0,B.jsxs)(`select`,{className:`cg-select cg-cond-val cg-cond-cohort-add`,value:``,"aria-label":`Cohort`,disabled:!o,onChange:e=>e.target.value&&s([...r,e.target.value]),children:[(0,B.jsx)(`option`,{value:``,children:o?r.length?`Add a cohort…`:`Select a cohort…`:`all added`}),a.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})}function Fre({index:e,conj:t,onConj:n}){return e===0?(0,B.jsx)(`span`,{className:`cg-cond-prefix`,children:`Where`}):e===1?(0,B.jsxs)(`select`,{className:`cg-select cg-cond-conj`,value:t,"aria-label":`Combine conditions with`,onChange:e=>n(e.target.value),children:[(0,B.jsx)(`option`,{value:`and`,children:`and`}),(0,B.jsx)(`option`,{value:`or`,children:`or`})]}):(0,B.jsx)(`span`,{className:`cg-cond-prefix cg-cond-conj-echo`,children:t})}function Ire({nodes:e,conj:t,depth:n,ctx:r,onNodes:i,onConj:a}){let[o,s]=(0,L.useState)(null),c=(t,n)=>i(e.map((e,r)=>r===t?n:e)),l=t=>i(e.filter((e,n)=>n!==t)),u=()=>{let t=Ore(r.fields);t&&i([...e,t])},d=()=>{let t=Ore(r.fields);t&&i([...e,{conj:`or`,children:[t]}])},f=n<3;return(0,B.jsxs)(B.Fragment,{children:[e.map((e,i)=>(0,B.jsxs)(`div`,{className:`cg-cond-line`,children:[(0,B.jsx)(Fre,{index:i,conj:t,onConj:a}),Cd(e)?(0,B.jsx)(Rre,{group:e,depth:n+1,ctx:r,onGroup:e=>c(i,e),onRemove:()=>l(i)}):(0,B.jsx)(Lre,{rule:e,ctx:r,onRule:e=>c(i,e),onRemove:()=>l(i)})]},i)),(0,B.jsxs)(`div`,{className:`cg-builder-add`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`+(o===`condition`?` is-on`:``),onClick:()=>{s(`condition`),u()},children:`+ Add condition`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`+(o===`group`?` is-on`:``),onClick:()=>{s(`group`),d()},disabled:!f,title:f?`Group conditions so they evaluate together`:`Condition groups can nest 3 levels deep`,children:`+ Add condition group`})]})]})}function Lre({rule:e,ctx:t,onRule:n,onRemove:r}){let{fields:i,fieldByKey:a,measures:o,measureByKey:s,lists:c,choicesFor:l}=t,u=Sd(e),d=e.colId===md,f=c.length>0,p=u?s.get(e.colId)?.type??`currency`:a.get(e.colId)?.type??`text`,m=t=>n({...e,...t}),h=t=>{if(t===`__cohort__`){n({colId:md,op:bre[0],value:``});return}if(s.get(t)){n({id:e.id??Dre(),colId:t,op:Vp[0],value:``,value2:void 0,window:e.window??Up});return}n({colId:t,op:Bp(a.get(t)?.type??`text`)[0],value:``,value2:void 0})},g=t=>{if(d)return m({op:t});if(fd(t))return n({...e,op:t,value:hre(t),value2:void 0,rhs:void 0,dateWindow:void 0});if(pd.has(t))return n({...e,op:t,value:``,value2:void 0,rhs:void 0});if(t===`within`)return n({...e,op:t,value:``,value2:void 0,rhs:void 0,dateWindow:e.dateWindow??Cre});if(e.op===`within`)return n({...e,op:t,dateWindow:void 0,value:``});m({op:t})},_=u?o.map(e=>({key:e.key,label:e.label,type:Sre})):i.filter(t=>t.key!==e.colId&&(Rp(p)?Rp(t.type):t.type===p)).map(e=>({key:e.key,label:e.label,type:e.type})),v=!d&&e.op!==`within`&&!pd.has(e.op)&&!fd(e.op)&&_.length>0&&(u||Rp(p)||zp(p)),y=e.rhs?.kind===`stat`,b=e.rhs!=null&&!y,x=u?b||y?Hp:Vp:d?bre:Bp(p),S=d?_d(e.op):e.op,C=vre(!u&&!d&&Rp(p)?[...x,...dd]:x,S),w=C.filter(e=>!fd(e)),T=C.filter(e=>fd(e));return(0,B.jsxs)(`span`,{className:`cg-cond-row`+(u?` is-measure`:``)+(d?` is-cohort`:``)+(e.rhs==null?``:` has-rhs`),children:[(0,B.jsx)(Fp,{className:`cg-cond-field`,ariaLabel:`Field`,value:e.colId,onChange:h,fields:[...Tre(i,e.colId,a,s,f),...o.map(e=>({key:e.key,label:e.label,type:Sre})),...f?[{key:md,label:`Cohort`,type:`multiselect`}]:[]]}),u&&(0,B.jsx)(Lp,{window:e.window??Up,onWindow:e=>m({window:e})}),(0,B.jsxs)(`select`,{className:`cg-select cg-cond-op`,value:S,"aria-label":`Condition`,onChange:e=>g(e.target.value),children:[w.map(e=>(0,B.jsx)(`option`,{value:e,children:d?xre(e):_re(e,p)},e)),T.length>0&&(0,B.jsx)(`optgroup`,{label:`Ranked`,children:T.map(e=>(0,B.jsx)(`option`,{value:e,children:_re(e,p)},e))})]}),v&&(0,B.jsxs)(`select`,{className:`cg-select cg-cond-mode`,value:y?`stat`:b?`field`:`value`,"aria-label":`Compare against`,onChange:t=>{let n=t.target.value;if(n===`stat`)return m({rhs:{kind:`stat`,stat:`median`},value:``,value2:void 0,op:Hp.includes(e.op)?e.op:Hp[1]});if(n===`field`)return m({rhs:u?{kind:`measure`,colId:``,window:Up}:{kind:`field`,colId:``},value:``,value2:void 0});m({rhs:void 0,value:``})},children:[(0,B.jsx)(`option`,{value:`value`,children:`a value`}),(0,B.jsx)(`option`,{value:`field`,children:`another field`}),u&&(0,B.jsx)(`option`,{value:`stat`,children:`a statistic`})]}),pd.has(e.op)?(0,B.jsx)(`span`,{className:`cg-cond-val cg-cond-noval`,"aria-hidden":!0}):y?(0,B.jsx)(`select`,{className:`cg-select cg-cond-val cg-cond-stat`,value:e.rhs?.kind===`stat`?e.rhs.stat:`median`,"aria-label":`Statistic`,onChange:e=>m({rhs:{kind:`stat`,stat:e.target.value}}),children:yd.map(e=>(0,B.jsx)(`option`,{value:e,children:Eee[e]},e))}):b?(0,B.jsx)(jre,{rule:e,options:_,isMeasure:u,onPatch:m}):d?(0,B.jsx)(Pre,{rule:e,lists:c,onPatch:m}):fd(e.op)?(0,B.jsx)(Nre,{rule:e,onValue:e=>m({value:e})}):e.op===`within`?(0,B.jsx)(Lp,{window:e.dateWindow??Cre,onWindow:e=>m({dateWindow:e}),kinds:wre}):zp(p)?(0,B.jsx)(Are,{rule:e,onPatch:m}):(0,B.jsx)(Mre,{rule:e,type:p,statusOptions:l(e.colId),onValue:e=>m({value:e}),onValue2:e=>m({value2:e})}),(0,B.jsx)(`button`,{type:`button`,className:`cg-cond-x`,"aria-label":`Remove condition`,onClick:r,children:`×`})]})}function Rre({group:e,depth:t,ctx:n,onGroup:r,onRemove:i}){return(0,B.jsxs)(`span`,{className:`cg-cond-group`,"data-depth":t,children:[(0,B.jsxs)(`span`,{className:`cg-cond-group-head`,children:[(0,B.jsx)(`span`,{className:`cg-cond-group-sum`,children:e.children.length?yre(e.conj):`Add a condition to this group…`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-cond-x`,"aria-label":`Remove condition group`,onClick:i,children:`×`})]}),(0,B.jsx)(`span`,{className:`cg-cond-group-body`,children:(0,B.jsx)(Ire,{nodes:e.children,conj:e.conj,depth:t,ctx:n,onNodes:t=>r({...e,children:t}),onConj:t=>r({...e,conj:t})})})]})}function zre({fields:e,filters:t,onChange:n,cohorts:r=[],measures:i=[],userOptions:a,statusValues:o,cohortLock:s,footerExtra:c}){let l=wd(t),u=Td(t),d=(0,L.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.key,n);return t},[e]),f=(0,L.useMemo)(()=>gee(e),[e]),p=(0,L.useMemo)(()=>{let e=new Map;for(let t of i)e.set(t.key,t);return e},[i]),m=(0,L.useCallback)(e=>{let t=o?.[e];if(t)return t;let n=d.get(e);return n?n.type===`user`?a??[]:ed(n):[]},[o,d,a]),h=(0,L.useMemo)(()=>({fields:f,fieldByKey:d,measures:i,measureByKey:p,lists:r,choicesFor:m}),[f,d,i,p,r,m]);return(0,B.jsxs)(`div`,{className:`cg-pop-body cg-builder`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Filter`}),s&&(0,B.jsx)(`div`,{className:`cg-flt-lockchip`,children:s.name?`Customer list locked to ${s.name}`+(typeof s.count==`number`?` · ${s.count.toLocaleString()} ${s.count===1?`customer`:`customers`}`:``):`Customer list locked to a set you cannot see`}),l.length===0?(0,B.jsx)(`div`,{className:`cg-builder-empty`,children:`No conditions. Add one to narrow the list.`}):(0,B.jsx)(`div`,{className:`cg-builder-caption`,children:`In this view, show records`}),(0,B.jsx)(Ire,{nodes:l,conj:u,depth:1,ctx:h,onNodes:e=>n({conj:u,nodes:e}),onConj:e=>n({conj:e,nodes:l})}),gre(l)&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`Ranked among the records your other conditions keep — so “top 10” inside a filtered view means the top 10 of that view. Records with no value are not ranked at all. Quartiles and deciles are equal-size slices BY RANK, not by value.`}),(l.length>0||c)&&(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-builder-footer`,children:[l.length>0&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>n({conj:u,nodes:[]}),children:`Clear all`}),c]})]})}function Bre({fields:e,hidden:t,onToggle:n,onHideAll:r,onShowAll:i,lockedKey:a,onFieldOrder:o,deletableKeys:s,onDeleteField:c}){let[l,u]=(0,L.useState)(``),[d,f]=(0,L.useState)(null),[p,m]=(0,L.useState)(null),[h,g]=(0,L.useState)(null),_=l.trim().toLowerCase(),v=_?e.filter(e=>e.label.toLowerCase().includes(_)):e,y=!!o&&_===``,b=(t,n)=>{if(t===n||t===a||n===a)return null;let r=e.map(e=>e.key),i=r.indexOf(t),o=r.indexOf(n);if(i<0||o<0)return null;let s=r.slice();return s.splice(i,1),s.splice(o,0,t),s},x=(t,n)=>{if(!y)return;let r=e.map(e=>e.key),i=r[r.indexOf(t)+n];if(i===void 0)return;let a=b(t,i);a&&o(a)};return(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Hide fields`}),(0,B.jsx)(`input`,{type:`text`,className:`cg-input cg-fields-search`,placeholder:`Find a field…`,"aria-label":`Find a field`,value:l,onChange:e=>u(e.target.value)}),(0,B.jsxs)(`div`,{className:`cg-pop-list`,children:[v.map(e=>{let r=a!==void 0&&e.key===a,i=!t.has(e.key),l=!!c&&!!s?.has(e.key),u=d===e.key;return(0,B.jsxs)(`label`,{className:`cg-check-row`+(i?``:` is-off`)+(r?` is-locked`:``)+(p===e.key?` is-dragging`:``)+(h===e.key&&p!==null&&p!==e.key?` is-drop-target`:``),title:r?`Always visible`:void 0,onDragOver:y&&p&&p!==e.key?t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,h!==e.key&&g(e.key)}:void 0,onDrop:y&&p?t=>{t.preventDefault(),t.stopPropagation();let n=b(p,e.key);m(null),g(null),n&&o(n)}:void 0,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-field-grip`,draggable:y&&!r,"aria-label":r?`${e.label} is always first`:y?`Reorder ${e.label} — drag, or use the arrow keys`:`Reorder ${e.label} (clear the search first)`,title:y&&!r?`Drag to reorder, or use the arrow keys`:r?`This column is always first`:`Clear the search to reorder`,onDragStart:t=>{t.dataTransfer.setData(`text/plain`,e.key),t.dataTransfer.effectAllowed=`move`,m(e.key)},onDragEnd:()=>{m(null),g(null)},onClick:e=>{e.preventDefault(),e.stopPropagation()},onKeyDown:t=>{t.key!==`ArrowUp`&&t.key!==`ArrowDown`||(t.preventDefault(),t.stopPropagation(),x(e.key,t.key===`ArrowUp`?-1:1))},children:(0,B.jsx)(`svg`,{width:`10`,height:`16`,viewBox:`0 0 10 16`,"aria-hidden":!0,focusable:`false`,children:[4,8,12].map(e=>[2.5,7.5].map(t=>(0,B.jsx)(`circle`,{cx:t,cy:e,r:`1.15`,fill:`currentColor`},`${t}-${e}`)))})}),(0,B.jsx)(`input`,{type:`checkbox`,checked:i,disabled:r,onChange:()=>n(e.key)}),(0,B.jsx)(Ap,{type:e.type,title:Ff[e.type]}),(0,B.jsx)(`span`,{className:`cg-check-label`,children:e.label}),e.source===`odoo`&&!e.custom&&(0,B.jsx)(`span`,{className:`cg-preset-tag`,children:`Pre-set`}),e.scope===`cohort`&&(0,B.jsx)(`span`,{className:`cg-preset-tag cg-scope-tag`,children:`Cohort-only`}),r&&(0,B.jsx)(`span`,{className:`cg-lock-tag`,children:`Locked`}),l&&(0,B.jsx)(`button`,{type:`button`,className:`cg-check-del`+(u?` is-armed`:``),"aria-label":u?`Permanently delete ${e.label}?`:`Delete ${e.label}`,title:u?void 0:`Removes this field and its values on every row.`,onClick:t=>{if(t.preventDefault(),t.stopPropagation(),!u){f(e.key);return}f(null),c(e.key)},children:u?`Delete permanently?`:(0,B.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M3.5 4.5h9M6.5 4.5V3h3v1.5M5 4.5l.6 8.5h4.8l.6-8.5`,stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`,strokeLinejoin:`round`})})})]},e.key)}),v.length===0&&(0,B.jsx)(`div`,{className:`cg-builder-empty`,children:`No field matches your search.`})]}),(i||r)&&(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-fields-footer`,children:[i&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:i,children:`Show all`}),r&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:r,children:`Hide all`})]})]})}var Vre={stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`};function Hre(){return(0,B.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M4 6l4 4 4-4`,...Vre})})}function Wp({label:e,icon:t,active:n,tone:r,wide:i,measureWide:a,pairWide:o,forceOpenSignal:s,children:c}){let[l,u]=(0,L.useState)(!1),d=(0,L.useRef)(null),f=(0,L.useId)();return(0,L.useEffect)(()=>{s&&s>0&&u(!0)},[s]),(0,B.jsxs)(`div`,{className:`cg-pop-wrap`,children:[(0,B.jsxs)(`button`,{ref:d,type:`button`,className:`cg-tb-btn`+(r?` cg-tb-btn--${r}`:``)+(n||l?` is-active`:``),onClick:()=>u(e=>!e),"aria-expanded":l,"aria-haspopup":`dialog`,"aria-controls":l?f:void 0,title:e,"aria-label":e,children:[t,(0,B.jsx)(`span`,{className:`cg-tb-label`,children:e}),(0,B.jsx)(Hre,{})]}),l&&d.current&&(0,B.jsx)(kp,{anchor:d.current,className:`cg-pop`+(i?` cg-pop--wide`:``)+(a?` cg-pop--measures`:``)+(o?` cg-pop--pair`:``),onDismiss:()=>u(!1),role:`dialog`,ariaLabel:`${e} options`,id:f,dataKind:`toolbar-${e.split(` `)[0].toLowerCase()}`,children:c(()=>u(!1))})]})}var Gp={width:14,height:14,viewBox:`0 0 16 16`,fill:`none`},Kp={stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`};function Ure(){return(0,B.jsxs)(`svg`,{...Gp,"aria-hidden":!0,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`1.5`,...Kp}),(0,B.jsx)(`line`,{x1:`6.5`,y1:`3`,x2:`6.5`,y2:`13`,...Kp}),(0,B.jsx)(`line`,{x1:`10.5`,y1:`3`,x2:`10.5`,y2:`13`,...Kp})]})}function Wre(){return(0,B.jsx)(`svg`,{...Gp,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M2.5 4h11L9.5 9v3.5L6.5 14V9L2.5 4Z`,...Kp})})}function Gre(){return(0,B.jsxs)(`svg`,{...Gp,"aria-hidden":!0,children:[(0,B.jsx)(`path`,{d:`M5 3v10M5 13l-2-2M5 13l2-2`,...Kp}),(0,B.jsx)(`path`,{d:`M11 13V3M11 3l-2 2M11 3l2 2`,...Kp})]})}function Kre(){return(0,B.jsx)(`svg`,{...Gp,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M8 2s4.5 4.2 4.5 7a4.5 4.5 0 0 1-9 0C3.5 6.2 8 2 8 2Z`,...Kp})})}function qre(){return(0,B.jsxs)(`svg`,{...Gp,"aria-hidden":!0,children:[(0,B.jsx)(`line`,{x1:`2.5`,y1:`5`,x2:`13.5`,y2:`5`,...Kp}),(0,B.jsx)(`line`,{x1:`2.5`,y1:`8`,x2:`13.5`,y2:`8`,...Kp}),(0,B.jsx)(`line`,{x1:`2.5`,y1:`11`,x2:`13.5`,y2:`11`,...Kp})]})}function Jre(){return(0,B.jsxs)(`svg`,{...Gp,"aria-hidden":!0,children:[(0,B.jsx)(`line`,{x1:`2.5`,y1:`4`,x2:`13.5`,y2:`4`,...Kp}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`8`,x2:`13.5`,y2:`8`,...Kp}),(0,B.jsx)(`line`,{x1:`5.5`,y1:`12`,x2:`13.5`,y2:`12`,...Kp})]})}function Yre(){return(0,B.jsxs)(`svg`,{...Gp,"aria-hidden":!0,children:[(0,B.jsx)(`rect`,{x:`3.5`,y:`7`,width:`9`,height:`6`,rx:`1.2`,...Kp}),(0,B.jsx)(`path`,{d:`M5.75 7V5.25a2.25 2.25 0 0 1 4.5 0V7`,...Kp})]})}function Xre(){return(0,B.jsxs)(`svg`,{...Gp,"aria-hidden":!0,children:[(0,B.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4`,...Kp}),(0,B.jsx)(`line`,{x1:`10.2`,y1:`10.2`,x2:`13.5`,y2:`13.5`,...Kp})]})}var Zre={filters:(0,B.jsx)(Wre,{}),sorts:(0,B.jsx)(Gre,{}),groupBy:(0,B.jsx)(Jre,{}),visible:(0,B.jsx)(ore,{}),order:(0,B.jsx)(Ure,{}),rowHeightMode:(0,B.jsx)(qre,{})};function Qre({views:e,lockedKey:t,onApply:n,onClose:r}){let[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(()=>new Set([`filters`])),c=e.find(e=>e.id===i),l=e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,B.jsxs)(`div`,{className:`cg-pop-body cg-copycfg`,children:[(0,B.jsxs)(`div`,{className:`cg-copycfg-head`,children:[(0,B.jsx)(`span`,{children:`Copy configuration from`}),(0,B.jsx)(Fp,{className:`cg-copycfg-source`,ariaLabel:`View to copy from`,placeholder:`Choose a view…`,value:i||void 0,onChange:a,fields:e.map(e=>({key:e.id,label:e.name,icon:(0,B.jsx)(jp,{mode:Od(e)})}))}),(0,B.jsx)(`span`,{children:`to this view`})]}),(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`Select what to copy. This view keeps everything else.`}),(0,B.jsx)(`div`,{className:`cg-pop-list`,children:Bne.map(e=>(0,B.jsxs)(`label`,{className:`cg-check-row`,title:e.blurb,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:o.has(e.key),onChange:()=>l(e.key)}),(0,B.jsx)(`span`,{className:`cg-mi-ic`,"aria-hidden":!0,children:Zre[e.key]}),(0,B.jsx)(`span`,{className:`cg-check-label`,children:e.label})]},e.key))}),(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-copycfg-bulk`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>s(new Set(Vne)),children:`Select all`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>s(new Set),children:`Clear all`})]}),(0,B.jsxs)(`div`,{className:`cg-form-actions cg-copycfg-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!c||o.size===0,title:c?o.size===0?`Choose at least one thing to copy`:void 0:`Choose the view to copy from`,onClick:()=>{c&&(n(Une(c.config,o,t)),r())},children:`Copy configuration`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:r,children:`Cancel`})]})]})}function $re({views:e,lockedKey:t,onApply:n}){let[r,i]=(0,L.useState)(!1),a=(0,L.useRef)(null);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{ref:a,type:`button`,className:`cg-link-btn cg-copy-link`+(r?` is-on`:``),"aria-expanded":r,onClick:()=>i(e=>!e),children:`Copy from another view`}),r&&a.current&&(0,B.jsx)(kp,{anchor:a.current,className:`cg-pop cg-copycfg-pop`,placement:`bottom-end`,onDismiss:()=>i(!1),role:`dialog`,ariaLabel:`Copy configuration from another view`,dataKind:`copy-config`,children:(0,B.jsx)(Qre,{views:e,lockedKey:t,onApply:n,onClose:()=>i(!1)})})]})}function eie({fields:e,fieldByKey:t,sorts:n,onSorts:r}){let i=(e,t)=>r(n.map((n,r)=>r===e?{...n,...t}:n)),a=e=>r(n.filter((t,n)=>n!==e));return(0,B.jsxs)(`div`,{className:`cg-pop-body cg-builder`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Sort`}),n.length===0&&(0,B.jsx)(`div`,{className:`cg-builder-empty`,children:`No sorts. Add one to order the list.`}),n.map((n,r)=>{let o=t.get(n.colId)?.type??`text`;return(0,B.jsxs)(`div`,{className:`cg-cond-line`,children:[(0,B.jsx)(`span`,{className:`cg-cond-prefix`,children:r===0?`Sort by`:`then by`}),(0,B.jsxs)(`span`,{className:`cg-cond-row`,children:[(0,B.jsx)(Fp,{className:`cg-cond-field`,ariaLabel:`Sort field`,value:n.colId,onChange:e=>i(r,{colId:e}),fields:e.map(e=>({key:e.key,label:e.label,type:e.type}))}),(0,B.jsxs)(`select`,{className:`cg-select cg-cond-op`,value:n.dir,"aria-label":`Sort direction`,onChange:e=>i(r,{dir:e.target.value}),children:[(0,B.jsx)(`option`,{value:`asc`,children:ld(o,`asc`)}),(0,B.jsx)(`option`,{value:`desc`,children:ld(o,`desc`)})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-cond-x`,"aria-label":`Remove sort`,onClick:()=>a(r),children:`×`})]})]},r)}),(0,B.jsxs)(`div`,{className:`cg-pop-footer cg-builder-footer`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>{let t=new Set(n.map(e=>e.colId)),i=e.find(e=>!t.has(e.key))??e[0];i&&r([...n,{colId:i.key,dir:`asc`}])},children:`+ Add another sort`}),n.length>0&&(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>r([]),children:`Clear`})]})]})}var tie=[{mode:`short`,label:`Short`},{mode:`medium`,label:`Medium`},{mode:`tall`,label:`Tall`}];function nie({fields:e,visible:t,nouns:n=`customers`,lockedKey:r,onColumnVisible:i,onColumnsVisible:a,orderedFields:o,onFieldOrder:s,deletableKeys:c,onDeleteField:l,colorOn:u,onToggleColor:d,rowHeightMode:f,onRowHeightMode:p,filters:m,onFilters:h,filterConj:g,onFilterConj:_,sorts:v,onSorts:y,groupBy:b,onGroupBy:x,statusValues:S,measures:C=[],pendingMeasureCount:w=0,unresolvedCount:T=0,lists:E=[],cohortLock:D,copyViews:O,onCopyConfig:k,search:A,onSearch:j,recordCount:M,scopeCounts:ee,pool:N,serverWindowed:te=!1,cohortAction:ne,filterSeed:P=null,modeControl:re}){let F=e.filter(e=>t.has(e.key)).length,ie=(0,L.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.key,n);return t},[e]),ae=(0,L.useMemo)(()=>{let e=new Map;for(let t of C)e.set(t.key,t);return e},[C]),oe=o??e,se=(0,L.useMemo)(()=>new Set(oe.filter(e=>!t.has(e.key)).map(e=>e.key)),[oe,t]),ce=(0,L.useMemo)(()=>({conj:g,nodes:m}),[g,m]),le=e=>{let t=wd(e),n=Td(e);t!==m&&h(t),n!==g&&_(n)},ue=!!D,de=!!k&&(O?.length??0)>0,fe=(0,L.useMemo)(()=>e.filter(e=>ud(e,r)),[e,r]),pe=(0,L.useRef)(0);(0,L.useEffect)(()=>{if(!P||P.n===pe.current)return;if(pe.current=P.n,P.measure){let e=ae.get(P.measure.key);if(!e)return;h([...m,{id:Dre(),colId:e.key,op:Vp[0],value:``,window:P.measure.window}]);return}let e=P.key?ie.get(P.key):void 0;!e||e.filterable===!1||h([...m,{colId:e.key,op:Bp(e.type)[0],value:``}])},[P,ie,ae,m,h]);let me=(0,L.useMemo)(()=>kre(m),[m]),he=(0,L.useMemo)(()=>{let e=t=>t.some(t=>Cd(t)?e(t.children):t.rhs!=null&&t.rhs.kind!==`stat`);return e(m)},[m]),ge=me?`Filter · ${me}`:`Filter`,_e=v.length?`Sort · ${v.length}`:`Sort`,ve=b?`Group: ${ie.get(b)?.label??`?`}`:`Group`;return(0,B.jsxs)(`div`,{className:`cg-toolbar`,children:[re,(0,B.jsx)(Wp,{label:`Hide fields`,icon:(0,B.jsx)(ore,{}),active:F(0,B.jsx)(Bre,{fields:oe,hidden:se,onToggle:e=>i(e,!t.has(e)),onShowAll:()=>a(e.map(e=>e.key)),onHideAll:()=>a([r]),lockedKey:r,onFieldOrder:s,deletableKeys:c,onDeleteField:l})}),(0,B.jsx)(Wp,{label:ge,icon:(0,B.jsx)(Wre,{}),active:me>0,tone:`filter`,wide:!0,measureWide:C.length>0,pairWide:he,forceOpenSignal:P?.n,children:()=>(0,B.jsx)(zre,{fields:e,measures:C,cohorts:E,filters:ce,onChange:le,statusValues:S,cohortLock:D,footerExtra:de?(0,B.jsx)($re,{views:O,lockedKey:r,onApply:e=>k(e)}):void 0})}),(0,B.jsx)(Wp,{label:_e,icon:(0,B.jsx)(Gre,{}),active:v.length>0,tone:`sort`,wide:!0,children:()=>(0,B.jsx)(eie,{fields:e,fieldByKey:ie,sorts:v,onSorts:y})}),(0,B.jsx)(Wp,{label:ve,icon:(0,B.jsx)(Jre,{}),active:b!==null,tone:`group`,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Group by`}),te?(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`Not available on this table. It loads one page at a time, so a group would count only the rows currently fetched.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-group`,checked:b===null,onChange:()=>x(null)}),(0,B.jsx)(`span`,{children:`No grouping`})]}),fe.map(e=>(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-group`,checked:b===e.key,onChange:()=>x(e.key)}),(0,B.jsx)(Ap,{type:e.type,title:Ff[e.type]}),(0,B.jsx)(`span`,{children:e.label})]},e.key))]})]})}),(0,B.jsx)(`span`,{className:`cg-tb-divider`,"aria-hidden":!0}),(0,B.jsx)(Wp,{label:`Color`,icon:(0,B.jsx)(Kre,{}),active:u,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Color`}),(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-color`,checked:!u,onChange:()=>d(!1)}),(0,B.jsx)(`span`,{children:`No color`})]}),(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-color`,checked:u,onChange:()=>d(!0)}),(0,B.jsx)(`span`,{children:`Color by status`})]})]})}),(0,B.jsx)(Wp,{label:`Rows`,icon:(0,B.jsx)(qre,{}),active:f!==`short`,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Row height`}),tie.map(e=>(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-rowh`,checked:f===e.mode,onChange:()=>p(e.mode)}),(0,B.jsx)(`span`,{children:e.label})]},e.mode))]})}),ue&&(0,B.jsxs)(`span`,{className:`cg-tb-lock`,title:(D?.name?`Locked to ${D.name}. `:`Locked to a set of records you cannot see. `)+`Only the records locked into that view are shown. Filters and sort narrow WITHIN the lock; the lock itself is changed from the view menu in the rail.`,children:[(0,B.jsx)(Yre,{}),(0,B.jsx)(`span`,{className:`cg-tb-label`,children:`Locked`})]}),(0,B.jsxs)(`div`,{className:`cg-search`,children:[(0,B.jsx)(`span`,{className:`cg-search-icon`,"aria-hidden":!0,children:(0,B.jsx)(Xre,{})}),(0,B.jsx)(`input`,{type:`text`,className:`cg-search-input`,placeholder:`Search ${n}…`,value:A,onChange:e=>j(e.target.value)}),A&&(0,B.jsx)(`button`,{type:`button`,className:`cg-search-clear`,"aria-label":`Clear search`,onClick:()=>j(``),children:`×`})]}),ne,(0,B.jsx)(`span`,{className:`cg-tb-spacer`}),w>0&&(0,B.jsx)(`span`,{className:`cg-count cg-count-pending`,title:`${w} measure condition${w===1?``:`s`} still being calculated over the period you chose. Rows are hidden until the answer arrives rather than shown under a count that would be wrong.`,children:`Calculating…`}),T>0&&(0,B.jsx)(`span`,{className:`cg-count cg-count-pending`,title:`${T} condition${T===1?``:`s`} cannot be evaluated — a date that does not resolve, or a list this view refers to that no longer exists. Rows are hidden rather than shown under a count that would be wrong.`,children:`Filter unresolved`}),fre(N)==null?(0,B.jsxs)(`span`,{className:`cg-count`,title:Ip(M,ee),children:[(0,B.jsx)(`span`,{className:`cg-count-full`,children:Ip(M,ee)}),(0,B.jsx)(`span`,{className:`cg-count-compact`,children:pre(M,ee)})]}):(0,B.jsxs)(`span`,{className:`cg-count cg-count-partial`,title:`Loading the rest of your ${n} in the background — you can browse, filter and sort what is already here.`,children:[(0,B.jsx)(`span`,{className:`lp-spin`,role:`status`,"aria-label":`Loading`}),fre(N)]})]})}function qp({on:e}){return(0,B.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 20 20`,"aria-hidden":!0,children:(0,B.jsx)(`polygon`,{points:`10,1.8 12.5,7.2 18.4,7.7 13.9,11.6 15.3,17.4 10,14.3 4.7,17.4 6.1,11.6 1.6,7.7 7.5,7.2`,fill:e?`#A98A3E`:`none`,stroke:e?`#A98A3E`:`rgba(118,143,182,0.55)`,strokeWidth:`1.2`,strokeLinejoin:`round`})})}function rie({value:e,max:t}){return(0,B.jsx)(`span`,{className:`cg-stars cg-stars--static`,"aria-label":`${e} of ${t}`,children:Array.from({length:t},(t,n)=>(0,B.jsx)(qp,{on:n=0?n.splice(r,1):n.push(t),sie(n)}function Zp(e,t,n){let r=e.type===`user`?t??[]:ed(e),i=r.map(e=>({value:e,label:e})),a=e.type===`multiselect`?Xp(n):[Jp(n).trim()];for(let e of a)e===``||r.includes(e)||i.push({value:e,label:`${e} (no longer a choice)`,stale:!0});return i}function Qp(e){let t=Jp(e).trim();if(t===``)return``;let n=Number(t);return Number.isFinite(n)?String(n):``}function lie(e){let t=e.trim();if(t===``)return``;let n=Number(t);return Number.isFinite(n)?t:null}function $p(e,t){let n=Math.round(Number(Jp(t)));return Number.isFinite(n)?Math.max(0,Math.min(td(e),n)):0}function uie(e,t,n){let r=$p(e,t),i=Math.max(1,Math.min(td(e),Math.round(n)));return i===r?``:String(i)}function die(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length?t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase():`?`}var fie=new Set([`sum`,`count`]);function pie(e){return fie.has(e)}var em=`month`;function tm(e){let t=nd.includes(e.bucket??``)?e.bucket:em,n=e.span??{},r;return r=typeof n.lastN==`number`&&Number.isFinite(n.lastN)?{lastN:Math.max(1,Math.min(120,Math.round(n.lastN)))}:n.from||n.to?{from:n.from,to:n.to}:{lastN:12},{pids:e.pids,bucket:t,span:r,fields:e.fields.slice(0,12)}}function nm(e,t){return e==null||t==null||t===0||!Number.isFinite(e)||!Number.isFinite(t)?null:(e-t)/Math.abs(t)*100}function rm(e){return e.toLocaleString(void 0,{maximumFractionDigits:2})}function mie(e,t){return e==null?`—`:t?t(e):String(e)}function im(e){return e==null?``:rm(e)}function am(e,t){return e==null?``:t?om(e):`${e>0?`+`:``}${rm(e)}`}function om(e){return e==null?`—`:`${e>0?`+`:``}${e.toFixed(1)}%`}function hie(e){switch(e){case`not_a_measure_field`:return`not a measure — only measure fields have a time dimension`;case`unresolvable`:return`a composite measure has no single aggregate to bucket`;case`window_fixed`:return`its period is a fixed date range, so it cannot slide across buckets`;default:return e}}function sm(e){if(!e)return{columns:[],rows:[],notes:[],pool:0,empty:!0};let t=e.columns??[],n=(e.rows??[]).map(e=>{let n=e.values??[],r=t.map((e,t)=>({value:n[t]??null,delta:nm(n[t]??null,t>0?n[t-1]??null:null),partial:e.partial===!0})),i=pie(e.agg)&&typeof e.total==`number`&&Number.isFinite(e.total)?e.total:void 0;return{field:e.field,label:e.label,agg:e.agg,cells:r,total:i,allUnanswered:r.length>0&&r.every(e=>e.value==null),window:e.window}}),r=[],i=e.meta??{pool:0};for(let e of i.dropped??[])r.push(`${e.field} is not shown — ${hie(e.reason)}.`);for(let e of i.problems??[])r.push(e);let a=t.filter(e=>e.partial).length;a>0&&r.push(a===1?`The last column is a partial period — it is still filling.`:`${a} columns are partial periods — they are still filling.`);let o=n.filter(e=>e.allUnanswered).length;return o>0&&r.push(`${o} of ${n.length} metrics returned no values for this span (shown as "—").`),{columns:t,rows:n,notes:r,pool:i.pool??0,empty:n.length===0}}var gie=new Set([`currency`,`int`,`pct`]),_ie=/(^|_)days(_|$)/;function vie(e){return e.agg===`sum`||e.agg===`count`?`sum`:e.agg===`avg`||e.type===`pct`||_ie.test(e.key)?`avg`:`sum`}function cm(e){return e.measure&&typeof e.measure==`object`?`server`:gie.has(e.type)?`snapshot`:`refused`}function yie(e){return e.formula?`a formula column has no time dimension of its own`:`${e.type} is not a number, so it has nothing to plot over time`}function bie(e,t,n,r){let i=vie(e),a=0,o=0;for(let n of t){let t=n?.[e.key];if(t==null||t===``)continue;let r=typeof t==`number`?t:Number(t);Number.isFinite(r)&&(a+=r,o+=1)}let s=o===0?null:i===`avg`?a/o:a,c=n.map(e=>({value:s,delta:null,partial:e.partial===!0}));return{field:e.key,label:e.label,agg:`snapshot`,cells:c,total:void 0,allUnanswered:s==null,window:{kind:`snapshot`,label:r?`Snapshot · the current value as of ${r}, not per period`:`Snapshot · the current value, not per period`}}}function xie(e,t){return`${e.length===1?e[0]:`${e.length} rows`} ${e.length===1?`has`:`have`} no time dimension, so ${e.length===1?`it is`:`they are`} shown as the current value${t?` as of ${t}`:``} repeated across every period — a flat line here means "not measured over time", not "unchanged". No total and no comparison is offered for ${e.length===1?`it`:`them`}.`}function Sie(e){let t=[],n=0;for(;nt[n],i=e=>{let t=r();return t&&t.k===`op`&&t.v===e?(n+=1,!0):!1};function a(){let e=r();if(!e)return null;if(e.k===`num`)return n+=1,{t:`num`,v:e.v};if(e.k===`ref`)return n+=1,{t:`ref`,name:e.name};if(i(`(`)){let e=c();return!e||!i(`)`)?null:e}return null}function o(){if(i(`-`)){let e=o();return e?{t:`neg`,a:e}:null}return i(`+`)?o():a()}function s(){let e=o();if(!e)return null;for(;;){let t=r();if(!t||t.k!==`op`||t.v!==`*`&&t.v!==`/`)return e;n+=1;let i=o();if(!i)return null;e={t:`bin`,op:t.v,a:e,b:i}}}function c(){let e=s();if(!e)return null;for(;;){let t=r();if(!t||t.k!==`op`||t.v!==`+`&&t.v!==`-`)return e;n+=1;let i=s();if(!i)return null;e={t:`bin`,op:t.v,a:e,b:i}}}let l=c();return l&&n===t.length?l:null}function wie(e,t){let n,r=e=>{switch(e.t){case`num`:return e.v;case`ref`:{let r=t(e.name);return r===void 0?(n??=`unknown_ref`,null):r}case`neg`:{let t=r(e.a);return t==null?null:-t}case`bin`:{let t=r(e.a),i=r(e.b);if(t==null||i==null)return null;if(e.op===`+`)return t+i;if(e.op===`-`)return t-i;if(e.op===`*`)return t*i;if(i===0)return n??=`div_zero`,null;let a=t/i;return Number.isFinite(a)?a:null}}},i=r(e);return n?{value:null,error:n}:{value:i}}function Tie(e,t){switch(t){case`syntax`:return`${e}: that formula could not be read — use + - * / ( ) with numbers and [row] references.`;case`unknown_ref`:return`${e}: a row it refers to is not on this sheet, so it is left blank rather than treated as zero.`;case`cycle`:return`${e}: it refers back to itself, so it has no value.`;case`div_zero`:return`${e}: divided by zero in at least one period — those cells are blank, not zero.`}}var lm={week:52,month:12,quarter:4,year:1},um={abs:`Change`,pct:`Change %`,yoy:`vs last year`,ytd:`YTD growth`};function Eie(e){return e!==`abs`}function dm(e,t,n){let r=e.cells.map(e=>e.value),i=lm[n]??12,a=[];for(let n of t){let t=Eie(n),o,s;n===`abs`?s=r.map((e,t)=>t===0||e==null||r[t-1]==null?null:e-r[t-1]):n===`pct`?s=r.map((e,t)=>nm(e,t>0?r[t-1]:null)):n===`yoy`||e.window?.kind===`ytd`?(s=r.map((e,t)=>nm(e,t>=i?r[t-i]:null)),r.length<=i&&(o=`This span is shorter than a year, so there is no earlier period to compare against.`)):(s=r.map(()=>null),o=e.window==null?`Year-to-date growth needs the metric's own period, which this server did not report.`:`Year-to-date growth is only meaningful on a year-to-date metric — this one is "${e.window.label}".`),a.push({kind:n,label:um[n],percent:t,values:s,refusal:o})}return a}function Die(e,t){let n=lm[t]??12,r={value:null,delta:null,partial:!1},i=e.cells.map((t,i)=>i>=n?e.cells[i-n]:r),a=e.cells.length<=n?`This span is shorter than a year, so there is no earlier period to compare against.`:void 0;return{label:`${e.label} (last year)`,cells:a?[]:i,back:n,refusal:a}}function fm(e,t,n){if(!e)return{};let r=e[t],i=n?e[`${t}:${n}`]:void 0;return!r&&!i?{}:{...r,...i}}function Oie(e,t,n){let r=e.filter(e=>e!=null&&Number.isFinite(e));if(r.length<2)return[];let i=Math.min(...r),a=Math.max(...r)-i,o=e.length>1?t/(e.length-1):0,s=[],c=[];return e.forEach((e,t)=>{if(e==null||!Number.isFinite(e)){c.length>1&&s.push({points:c}),c=[];return}let r=a===0?n/2:n-(e-i)/a*n;c.push({x:t*o,y:r})}),c.length>1&&s.push({points:c}),s}function kie(e){return e.points.map(e=>`${Math.round(e.x*10)/10},${Math.round(e.y*10)/10}`).join(` `)}function pm(e){return e.trim().toLowerCase()}function Aie(e,t){let n=[...e.notes],r=t.deltas??[],i=(t.customRows??[]).filter(e=>e&&typeof e.id==`string`),a=new Map,o=new Map;e.rows.forEach((e,t)=>{a.has(e.field)||a.set(e.field,{kind:`metric`,index:t});let n=pm(e.label);n&&!o.has(n)&&o.set(n,{kind:`metric`,index:t})}),i.forEach((e,t)=>{if(e.kind!==`formula`)return;a.has(e.id)||a.set(e.id,{kind:`formula`,index:t});let n=pm(e.label);n&&!o.has(n)&&o.set(n,{kind:`formula`,index:t})});let s=i.map(e=>e.kind===`formula`?Cie(e.expr??``):null),c=new Map,l=new Map,u=(t,n)=>{let r=c.get(t);if(r)return r;let i=e.columns.length;if(n.has(t))return l.set(t,`cycle`),Array(i).fill(null);let d=s[t];if(!d){l.set(t,`syntax`);let e=Array(i).fill(null);return c.set(t,e),e}n.add(t);let f=[];for(let r=0;r{let i=a.get(t.trim())??o.get(pm(t));if(i)return i.kind===`metric`?e.rows[i.index]?.cells[r]?.value??null:u(i.index,n)[r]??null});i.error&&!l.has(t)&&l.set(t,i.error),f.push(i.value)}return n.delete(t),c.set(t,f),f},d=e.rows.map(e=>({id:e.field,kind:`metric`,label:e.label,sublabel:e.window?.label,agg:e.agg,cells:e.cells,total:e.total,deltas:e.agg===`snapshot`?[]:dm(e,r,t.bucket),allUnanswered:e.allUnanswered})),f=e.rows.filter(e=>e.agg===`snapshot`);f.length>0&&n.push(xie(f.map(e=>e.label),t.today)),i.forEach((i,a)=>{if(i.kind===`note`){d.push({id:i.id,kind:`note`,label:i.label,cells:e.columns.map(e=>({value:null,delta:null,partial:e.partial===!0})),deltas:[],allUnanswered:!1});return}let o=u(a,new Set),s=e.columns.map((e,t)=>({value:o[t]??null,delta:nm(o[t]??null,t>0?o[t-1]??null:null),partial:e.partial===!0})),c=l.get(a);c&&n.push(Tie(i.label||i.id,c)),d.push({id:i.id,kind:`formula`,label:i.label,expr:i.expr,cells:s,deltas:dm({cells:s,window:void 0},r,t.bucket),allUnanswered:s.length>0&&s.every(e=>e.value==null)})});let p=new Set;for(let e of d)for(let t of e.deltas)t.refusal&&p.add(t.refusal);for(let e of p)n.push(e);return{columns:e.columns,rows:d,notes:n,pool:e.pool,empty:d.length===0}}function mm(e,t){let n=e.cells.map((e,n)=>({cell:e,col:t[n]})).filter(e=>e.col&&e.cell.value!=null).map(t=>({key:t.col.key,label:t.col.label,value:t.cell.value,n:1,seriesKey:e.field,seriesLabel:e.label}));return{points:n,xOrder:t.map(e=>e.key),seriesOrder:[e.field],omitted:0,omittedValue:0,omittedSeries:0,omittedSeriesValue:0,blanks:e.cells.filter(e=>e.value==null).length,missingY:0,rows:n.length,nonPositive:0,nonPositiveValue:0}}function jie(e,t,n,r){let i=Die(e,n),a=Math.max(1,Math.min(Math.round(r),t.length)),o=t.length-a,s=t.slice(o),c=`${e.field}::prior_year`,l=(e,t,n)=>s.map((t,n)=>({col:t,cell:e[o+n]})).filter(e=>e.cell&&e.cell.value!=null).map(e=>({key:e.col.key,label:e.col.label,value:e.cell.value,n:1,seriesKey:t,seriesLabel:n})),u=l(e.cells,e.field,e.label),d=i.refusal?[]:l(i.cells,c,i.label);return{points:[...u,...d],xOrder:s.map(e=>e.key),seriesOrder:i.refusal?[e.field]:[e.field,c],omitted:0,omittedValue:0,omittedSeries:0,omittedSeriesValue:0,blanks:e.cells.slice(o).filter(e=>e.value==null).length,missingY:0,rows:u.length,nonPositive:0,nonPositiveValue:0}}function hm(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Mie(e){let t=[[`Metric`,...e.columns.map(e=>e.label),`Total`].map(hm).join(`,`)];for(let n of e.rows){t.push([hm(n.sublabel?`${n.label} (${n.sublabel})`:n.label),...n.cells.map(e=>hm(im(e.value))),hm(im(n.total??null))].join(`,`));for(let e of n.deltas)t.push([hm(`${n.label} — ${e.label}${e.percent?` (%)`:``}`),...e.values.map(t=>hm(am(t,e.percent))),``].join(`,`))}if(e.notes.length>0){t.push(``);for(let n of e.notes)t.push(hm(n))}return t.join(`\r `)+`\r -`}function zre(e,t){return JSON.stringify({fields:e.map(e=>({key:e.key,label:e.label,type:e.type})),rows:t.map(t=>{let n={pid:t.pid};for(let r of e)n[r.key]=t[r.key]??null;return n})},null,1)}var Bre=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t+=1){let n=t;for(let e=0;e<8;e+=1)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function Vre(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Hre(e){let t=e?/^(\d{4})-(\d{2})-(\d{2})/.exec(e):null,n=t?Number(t[1]):2020,r=t?Number(t[2]):1,i=t?Number(t[3]):1;return{date:Math.max(1980,n)-1980<<9|r<<5|i,time:0}}function Ure(e,t){let n=new TextEncoder,r=Hre(t),i=[],a=[],o=0,s=e=>[e&255,e>>8&255],c=e=>[e&255,e>>8&255,e>>16&255,e>>24&255];for(let t of e){let e=n.encode(t.name),l=Vre(t.data),u=new Uint8Array([...c(67324752),...s(20),...s(2048),...s(0),...s(r.time),...s(r.date),...c(l),...c(t.data.length),...c(t.data.length),...s(e.length),...s(0)]);i.push(u,e,t.data),a.push(new Uint8Array([...c(33639248),...s(20),...s(20),...s(2048),...s(0),...s(r.time),...s(r.date),...c(l),...c(t.data.length),...c(t.data.length),...s(e.length),...s(0),...s(0),...s(0),...s(0),...c(0),...c(o)]),e),o+=u.length+e.length+t.data.length}let l=o,u=0;for(let e of a)u+=e.length;let d=new Uint8Array([...c(101010256),...s(0),...s(0),...s(e.length),...s(e.length),...c(u),...c(l),...s(0)]),f=o+u+d.length,p=new Uint8Array(f),m=0;for(let e of[...i,...a,d])p.set(e,m),m+=e.length;return p}function Om(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,``)}function Wre(e){return(e.replace(/[[\]:*?/\\]/g,`_`).trim()||`Export`).slice(0,31)}function Gre(e,t,n,r){let i=new TextEncoder,a=e=>`${Om(e)}`,o=e=>`${e.join(``)}`,s=`${[o(e.map(e=>a(e.label))),...t.map(t=>o(e.map(e=>a(yp(e,t[e.key])))))].join(``)}`,c=``;return Ure([{name:`[Content_Types].xml`,data:i.encode(``)},{name:`_rels/.rels`,data:i.encode(``)},{name:`xl/workbook.xml`,data:i.encode(c)},{name:`xl/_rels/workbook.xml.rels`,data:i.encode(``)},{name:`xl/worksheets/sheet1.xml`,data:i.encode(s)}],r)}var km=792,Am=612,jm=36,Mm=8,Nm=13,Pm=17,Fm=Mm*.52,Kre={"…":133,"–":150,"—":151,"‘":145,"’":146,"“":147,"”":148,"·":183,"€":128,"•":149};function Im(e){let t=``;for(let n of e){let e=n.codePointAt(0)??63,r=e<=255?e:Kre[n]??63,i=String.fromCharCode(r);t+=i===`\\`?`\\\\`:i===`(`?`\\(`:i===`)`?`\\)`:i}return t}function Lm(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function qre(e,t,n,r){let i=km-jm*2,a=t.slice(0,200),o=e.map(e=>{let t=e.label.length;for(let n of a)t=Math.max(t,yp(e,n[e.key]).length);return Math.min(170,Math.max(42,t*Fm+8))}),s=Math.min(1,i/o.reduce((e,t)=>e+t,0)),c=o.map(e=>e*s),l=Math.max(1,Math.floor((Am-jm*2-26-Pm-14)/Nm)),u=Math.max(1,Math.ceil(t.length/l)),d=r?`${n} — ${r}`:n,f=[];for(let n=0;n`${5+t*2} 0 R`).join(` `);p.push(`1 0 obj -<< /Type /Catalog /Pages 2 0 R >> -endobj -`),p.push(`2 0 obj\n<< /Type /Pages /Kids [${m}] /Count ${f.length} >>\nendobj\n`),p.push(`3 0 obj -<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> -endobj -`),p.push(`4 0 obj -<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> -endobj -`),f.forEach((e,t)=>{let n=5+t*2;p.push(`${n} 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${km} ${Am}] /Resources << /Font << /F1 3 0 R /F2 4 0 R >> >> /Contents ${n+1} 0 R >>\nendobj\n`),p.push(`${n+1} 0 obj\n<< /Length ${e.length} >>\nstream\n${e}endstream\nendobj\n`)});let h=`%PDF-1.4 -`,g=[];for(let e of p)g.push(h.length),h+=e;let _=h.length;h+=`xref\n0 ${p.length+1}\n0000000000 65535 f \n`;for(let e of g)h+=`${String(e).padStart(10,`0`)} 00000 n \n`;h+=`trailer\n<< /Size ${p.length+1} /Root 1 0 R >>\nstartxref\n${_}\n%%EOF\n`;let v=new Uint8Array(h.length);for(let e=0;eURL.revokeObjectURL(n),4e3)}function Jre(e,t,n,r,i){let a=Lre(t,n,e);if(e===`csv`){Rm(a,new Blob([``,Rre(r,i)],{type:`text/csv;charset=utf-8`}));return}if(e===`json`){Rm(a,new Blob([zre(r,i)],{type:`application/json`}));return}if(e===`xlsx`){Rm(a,new Blob([Gre(r,i,t,n).buffer],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`}));return}Rm(a,new Blob([qre(r,i,t,n).buffer],{type:`application/pdf`}))}var Yre=new Set([`sum`,`count`]);function Xre(e){return Yre.has(e)}var zm=`month`;function Bm(e){let t=id.includes(e.bucket??``)?e.bucket:zm,n=e.span??{},r;return r=typeof n.lastN==`number`&&Number.isFinite(n.lastN)?{lastN:Math.max(1,Math.min(120,Math.round(n.lastN)))}:n.from||n.to?{from:n.from,to:n.to}:{lastN:12},{pids:e.pids,bucket:t,span:r,fields:e.fields.slice(0,12)}}function Vm(e,t){return e==null||t==null||t===0||!Number.isFinite(e)||!Number.isFinite(t)?null:(e-t)/Math.abs(t)*100}function Hm(e){return e.toLocaleString(void 0,{maximumFractionDigits:2})}function Zre(e,t){return e==null?`—`:t?t(e):String(e)}function Um(e){return e==null?``:Hm(e)}function Qre(e,t){return e==null?``:t?Wm(e):`${e>0?`+`:``}${Hm(e)}`}function Wm(e){return e==null?`—`:`${e>0?`+`:``}${e.toFixed(1)}%`}function $re(e){switch(e){case`not_a_measure_field`:return`not a measure — only measure fields have a time dimension`;case`unresolvable`:return`a composite measure has no single aggregate to bucket`;case`window_fixed`:return`its period is a fixed date range, so it cannot slide across buckets`;default:return e}}function Gm(e){if(!e)return{columns:[],rows:[],notes:[],pool:0,empty:!0};let t=e.columns??[],n=(e.rows??[]).map(e=>{let n=e.values??[],r=t.map((e,t)=>({value:n[t]??null,delta:Vm(n[t]??null,t>0?n[t-1]??null:null),partial:e.partial===!0})),i=Xre(e.agg)&&typeof e.total==`number`&&Number.isFinite(e.total)?e.total:void 0;return{field:e.field,label:e.label,agg:e.agg,cells:r,total:i,allUnanswered:r.length>0&&r.every(e=>e.value==null),window:e.window}}),r=[],i=e.meta??{pool:0};for(let e of i.dropped??[])r.push(`${e.field} is not shown — ${$re(e.reason)}.`);for(let e of i.problems??[])r.push(e);let a=t.filter(e=>e.partial).length;a>0&&r.push(a===1?`The last column is a partial period — it is still filling.`:`${a} columns are partial periods — they are still filling.`);let o=n.filter(e=>e.allUnanswered).length;return o>0&&r.push(`${o} of ${n.length} metrics returned no values for this span (shown as "—").`),{columns:t,rows:n,notes:r,pool:i.pool??0,empty:n.length===0}}var eie=new Set([`currency`,`int`,`pct`]),tie=/(^|_)days(_|$)/;function nie(e){return e.agg===`sum`||e.agg===`count`?`sum`:e.agg===`avg`||e.type===`pct`||tie.test(e.key)?`avg`:`sum`}function Km(e){return e.measure&&typeof e.measure==`object`?`server`:eie.has(e.type)?`snapshot`:`refused`}function rie(e){return e.formula?`a formula column has no time dimension of its own`:`${e.type} is not a number, so it has nothing to plot over time`}function iie(e,t,n,r){let i=nie(e),a=0,o=0;for(let n of t){let t=n?.[e.key];if(t==null||t===``)continue;let r=typeof t==`number`?t:Number(t);Number.isFinite(r)&&(a+=r,o+=1)}let s=o===0?null:i===`avg`?a/o:a,c=n.map(e=>({value:s,delta:null,partial:e.partial===!0}));return{field:e.key,label:e.label,agg:`snapshot`,cells:c,total:void 0,allUnanswered:s==null,window:{kind:`snapshot`,label:r?`Snapshot · the current value as of ${r}, not per period`:`Snapshot · the current value, not per period`}}}function aie(e,t){return`${e.length===1?e[0]:`${e.length} rows`} ${e.length===1?`has`:`have`} no time dimension, so ${e.length===1?`it is`:`they are`} shown as the current value${t?` as of ${t}`:``} repeated across every period — a flat line here means "not measured over time", not "unchanged". No total and no comparison is offered for ${e.length===1?`it`:`them`}.`}function oie(e){let t=[],n=0;for(;nt[n],i=e=>{let t=r();return t&&t.k===`op`&&t.v===e?(n+=1,!0):!1};function a(){let e=r();if(!e)return null;if(e.k===`num`)return n+=1,{t:`num`,v:e.v};if(e.k===`ref`)return n+=1,{t:`ref`,name:e.name};if(i(`(`)){let e=c();return!e||!i(`)`)?null:e}return null}function o(){if(i(`-`)){let e=o();return e?{t:`neg`,a:e}:null}return i(`+`)?o():a()}function s(){let e=o();if(!e)return null;for(;;){let t=r();if(!t||t.k!==`op`||t.v!==`*`&&t.v!==`/`)return e;n+=1;let i=o();if(!i)return null;e={t:`bin`,op:t.v,a:e,b:i}}}function c(){let e=s();if(!e)return null;for(;;){let t=r();if(!t||t.k!==`op`||t.v!==`+`&&t.v!==`-`)return e;n+=1;let i=s();if(!i)return null;e={t:`bin`,op:t.v,a:e,b:i}}}let l=c();return l&&n===t.length?l:null}function cie(e,t){let n,r=e=>{switch(e.t){case`num`:return e.v;case`ref`:{let r=t(e.name);return r===void 0?(n??=`unknown_ref`,null):r}case`neg`:{let t=r(e.a);return t==null?null:-t}case`bin`:{let t=r(e.a),i=r(e.b);if(t==null||i==null)return null;if(e.op===`+`)return t+i;if(e.op===`-`)return t-i;if(e.op===`*`)return t*i;if(i===0)return n??=`div_zero`,null;let a=t/i;return Number.isFinite(a)?a:null}}},i=r(e);return n?{value:null,error:n}:{value:i}}function lie(e,t){switch(t){case`syntax`:return`${e}: that formula could not be read — use + - * / ( ) with numbers and [row] references.`;case`unknown_ref`:return`${e}: a row it refers to is not on this sheet, so it is left blank rather than treated as zero.`;case`cycle`:return`${e}: it refers back to itself, so it has no value.`;case`div_zero`:return`${e}: divided by zero in at least one period — those cells are blank, not zero.`}}var qm={week:52,month:12,quarter:4,year:1},Jm={abs:`Change`,pct:`Change %`,yoy:`vs last year`,ytd:`YTD growth`};function uie(e){return e!==`abs`}function Ym(e,t,n){let r=e.cells.map(e=>e.value),i=qm[n]??12,a=[];for(let n of t){let t=uie(n),o,s;n===`abs`?s=r.map((e,t)=>t===0||e==null||r[t-1]==null?null:e-r[t-1]):n===`pct`?s=r.map((e,t)=>Vm(e,t>0?r[t-1]:null)):n===`yoy`||e.window?.kind===`ytd`?(s=r.map((e,t)=>Vm(e,t>=i?r[t-i]:null)),r.length<=i&&(o=`This span is shorter than a year, so there is no earlier period to compare against.`)):(s=r.map(()=>null),o=e.window==null?`Year-to-date growth needs the metric's own period, which this server did not report.`:`Year-to-date growth is only meaningful on a year-to-date metric — this one is "${e.window.label}".`),a.push({kind:n,label:Jm[n],percent:t,values:s,refusal:o})}return a}function die(e,t){let n=qm[t]??12,r={value:null,delta:null,partial:!1},i=e.cells.map((t,i)=>i>=n?e.cells[i-n]:r),a=e.cells.length<=n?`This span is shorter than a year, so there is no earlier period to compare against.`:void 0;return{label:`${e.label} (last year)`,cells:a?[]:i,back:n,refusal:a}}function Xm(e,t,n){if(!e)return{};let r=e[t],i=n?e[`${t}:${n}`]:void 0;return!r&&!i?{}:{...r,...i}}function fie(e,t,n){let r=e.filter(e=>e!=null&&Number.isFinite(e));if(r.length<2)return[];let i=Math.min(...r),a=Math.max(...r)-i,o=e.length>1?t/(e.length-1):0,s=[],c=[];return e.forEach((e,t)=>{if(e==null||!Number.isFinite(e)){c.length>1&&s.push({points:c}),c=[];return}let r=a===0?n/2:n-(e-i)/a*n;c.push({x:t*o,y:r})}),c.length>1&&s.push({points:c}),s}function pie(e){return e.points.map(e=>`${Math.round(e.x*10)/10},${Math.round(e.y*10)/10}`).join(` `)}function Zm(e){return e.trim().toLowerCase()}function mie(e,t){let n=[...e.notes],r=t.deltas??[],i=(t.customRows??[]).filter(e=>e&&typeof e.id==`string`),a=new Map,o=new Map;e.rows.forEach((e,t)=>{a.has(e.field)||a.set(e.field,{kind:`metric`,index:t});let n=Zm(e.label);n&&!o.has(n)&&o.set(n,{kind:`metric`,index:t})}),i.forEach((e,t)=>{if(e.kind!==`formula`)return;a.has(e.id)||a.set(e.id,{kind:`formula`,index:t});let n=Zm(e.label);n&&!o.has(n)&&o.set(n,{kind:`formula`,index:t})});let s=i.map(e=>e.kind===`formula`?sie(e.expr??``):null),c=new Map,l=new Map,u=(t,n)=>{let r=c.get(t);if(r)return r;let i=e.columns.length;if(n.has(t))return l.set(t,`cycle`),Array(i).fill(null);let d=s[t];if(!d){l.set(t,`syntax`);let e=Array(i).fill(null);return c.set(t,e),e}n.add(t);let f=[];for(let r=0;r{let i=a.get(t.trim())??o.get(Zm(t));if(i)return i.kind===`metric`?e.rows[i.index]?.cells[r]?.value??null:u(i.index,n)[r]??null});i.error&&!l.has(t)&&l.set(t,i.error),f.push(i.value)}return n.delete(t),c.set(t,f),f},d=e.rows.map(e=>({id:e.field,kind:`metric`,label:e.label,sublabel:e.window?.label,agg:e.agg,cells:e.cells,total:e.total,deltas:e.agg===`snapshot`?[]:Ym(e,r,t.bucket),allUnanswered:e.allUnanswered})),f=e.rows.filter(e=>e.agg===`snapshot`);f.length>0&&n.push(aie(f.map(e=>e.label),t.today)),i.forEach((i,a)=>{if(i.kind===`note`){d.push({id:i.id,kind:`note`,label:i.label,cells:e.columns.map(e=>({value:null,delta:null,partial:e.partial===!0})),deltas:[],allUnanswered:!1});return}let o=u(a,new Set),s=e.columns.map((e,t)=>({value:o[t]??null,delta:Vm(o[t]??null,t>0?o[t-1]??null:null),partial:e.partial===!0})),c=l.get(a);c&&n.push(lie(i.label||i.id,c)),d.push({id:i.id,kind:`formula`,label:i.label,expr:i.expr,cells:s,deltas:Ym({cells:s,window:void 0},r,t.bucket),allUnanswered:s.length>0&&s.every(e=>e.value==null)})});let p=new Set;for(let e of d)for(let t of e.deltas)t.refusal&&p.add(t.refusal);for(let e of p)n.push(e);return{columns:e.columns,rows:d,notes:n,pool:e.pool,empty:d.length===0}}function Qm(e,t){let n=e.cells.map((e,n)=>({cell:e,col:t[n]})).filter(e=>e.col&&e.cell.value!=null).map(t=>({key:t.col.key,label:t.col.label,value:t.cell.value,n:1,seriesKey:e.field,seriesLabel:e.label}));return{points:n,xOrder:t.map(e=>e.key),seriesOrder:[e.field],omitted:0,omittedValue:0,omittedSeries:0,omittedSeriesValue:0,blanks:e.cells.filter(e=>e.value==null).length,missingY:0,rows:n.length,nonPositive:0,nonPositiveValue:0}}function hie(e,t,n,r){let i=die(e,n),a=Math.max(1,Math.min(Math.round(r),t.length)),o=t.length-a,s=t.slice(o),c=`${e.field}::prior_year`,l=(e,t,n)=>s.map((t,n)=>({col:t,cell:e[o+n]})).filter(e=>e.cell&&e.cell.value!=null).map(e=>({key:e.col.key,label:e.col.label,value:e.cell.value,n:1,seriesKey:t,seriesLabel:n})),u=l(e.cells,e.field,e.label),d=i.refusal?[]:l(i.cells,c,i.label);return{points:[...u,...d],xOrder:s.map(e=>e.key),seriesOrder:i.refusal?[e.field]:[e.field,c],omitted:0,omittedValue:0,omittedSeries:0,omittedSeriesValue:0,blanks:e.cells.slice(o).filter(e=>e.value==null).length,missingY:0,rows:u.length,nonPositive:0,nonPositiveValue:0}}function $m(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function gie(e){let t=[[`Metric`,...e.columns.map(e=>e.label),`Total`].map($m).join(`,`)];for(let n of e.rows){t.push([$m(n.sublabel?`${n.label} (${n.sublabel})`:n.label),...n.cells.map(e=>$m(Um(e.value))),$m(Um(n.total??null))].join(`,`));for(let e of n.deltas)t.push([$m(`${n.label} — ${e.label}${e.percent?` (%)`:``}`),...e.values.map(t=>$m(Qre(t,e.percent))),``].join(`,`))}if(e.notes.length>0){t.push(``);for(let n of e.notes)t.push($m(n))}return t.join(`\r -`)+`\r -`}var _ie={brand:[`#1F4E78`,`#C8A24B`,`#6F96B8`,`#E0C979`,`#3E6F98`,`#A17C2D`],categorical:[`#2F6B9A`,`#C28A2C`,`#4C8A68`,`#8A5C9D`,`#C25B56`,`#4B8793`,`#8B704A`,`#6A78A8`,`#A45D7D`,`#708B3D`,`#B66B32`,`#52749C`],sequential:[`#E7F0F7`,`#C5D9E9`,`#9CBCD5`,`#719DBE`,`#477CA3`,`#1F4E78`],diverging:[`#2F6B9A`,`#7EA5C3`,`#D8E4ED`,`#F0E6C6`,`#D5B66A`,`#9B7222`]};function vie(e){switch(e.axis?.y?.format){case`number`:return{format:`,.2~f`};case`currency`:return{format:`$,.0f`};case`percent`:return{labelExpr:`format(datum.value, ',.2~f') + '%'`};case`compact`:return{format:`~s`};default:return{}}}function yie(e,t){let n=new Map(e.xOrder.map((e,t)=>[e,t])),r=new Map(e.seriesOrder.map((e,t)=>[e,t]));return e.points.map(e=>({xKey:e.key,xLabel:e.label,xIndex:n.get(e.key)??0,value:e.value,valueText:t(e.value),n:e.n,seriesKey:e.seriesKey,seriesLabel:e.seriesLabel,seriesIndex:r.get(e.seriesKey)??0}))}function bie(){return{font:`Inter, ui-sans-serif, system-ui, sans-serif`,view:{stroke:null},axis:{labelColor:`#536273`,labelFont:`Inter, ui-sans-serif, system-ui, sans-serif`,labelFontSize:10,labelLimit:110,titleColor:`#344355`,titleFont:`Inter, ui-sans-serif, system-ui, sans-serif`,titleFontSize:11,titleFontWeight:500,gridColor:`#E7EBEF`,domainColor:`#C9D1D9`,tickColor:`#C9D1D9`},legend:{labelColor:`#536273`,labelFont:`Inter, ui-sans-serif, system-ui, sans-serif`,labelFontSize:10,titleColor:`#344355`,titleFont:`Inter, ui-sans-serif, system-ui, sans-serif`,titleFontSize:10,symbolType:`circle`,orient:`bottom`,direction:`horizontal`}}}function xie(e,t){return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,data:{values:t},width:`container`,height:`container`,autosize:{type:`fit`,contains:`padding`,resize:!0},padding:4,config:bie(),usermeta:{rendererBoundary:`aios-chart-spec-v1`,chartId:e.id}}}function eh(e){return[{field:`xLabel`,type:`nominal`,title:`Group`},...e?[{field:`seriesLabel`,type:`nominal`,title:`Series`}]:[],{field:`valueText`,type:`nominal`,title:`Value`},{field:`n`,type:`quantitative`,title:`Records`,format:`,`}]}function th({spec:e,model:t,xTitle:n,yTitle:r,formatValue:i}){let a=yie(t,i).filter(t=>e.kind!==`donut`||t.value>0),o=[..._ie[e.palette??`brand`]],s=t.seriesOrder.length>0,c=s?{field:`seriesLabel`,type:`nominal`,title:null,sort:{field:`seriesIndex`,op:`min`},scale:{range:o},legend:{columns:4}}:{value:o[0]},l={field:`xLabel`,type:`nominal`,title:n??null,sort:{field:`xIndex`,op:`min`,order:`ascending`},axis:{labelAngle:t.xOrder.length>7?-35:0,labelOverlap:`greedy`}},u={field:`value`,type:`quantitative`,title:r??null,axis:vie(e)},d=xie(e,a);if(e.kind===`kpi`)return{...d,mark:{type:`text`,align:`center`,baseline:`middle`,font:`Inter, ui-sans-serif, system-ui, sans-serif`,fontSize:32,fontWeight:600,color:`#172433`},encoding:{text:{field:`valueText`,type:`nominal`},tooltip:[{field:`valueText`,type:`nominal`,title:`Value`},{field:`n`,type:`quantitative`,title:`Records`,format:`,`}]}};if(e.kind===`donut`)return{...d,mark:{type:`arc`,innerRadius:44,outerRadius:76,cornerRadius:2,padAngle:.01},encoding:{theta:{field:`value`,type:`quantitative`,stack:!0},color:{field:`xLabel`,type:`nominal`,title:null,sort:{field:`xIndex`,op:`min`},scale:{range:o},legend:{orient:`right`,direction:`vertical`,labelLimit:110}},order:{field:`xIndex`,type:`quantitative`},tooltip:eh(!1)}};let f={x:l,y:{...u,stack:(e.kind===`bar`||e.kind===`area`)&&s?e.stacked?`zero`:null:void 0},color:c,tooltip:eh(s)};return s&&e.kind===`bar`&&!e.stacked&&(f.xOffset={field:`seriesLabel`,type:`nominal`,sort:{field:`seriesIndex`,op:`min`}}),(e.kind===`line`||e.kind===`area`)&&(f.order={field:`xIndex`,type:`quantitative`},s&&(f.detail={field:`seriesKey`,type:`nominal`})),{...d,mark:e.kind===`bar`?{type:`bar`,cornerRadiusTopLeft:2,cornerRadiusTopRight:2}:e.kind===`area`?{type:`area`,opacity:s?.68:.48,line:!0,point:!0}:{type:`line`,strokeWidth:2,point:{filled:!0,size:46}},encoding:f}}function nh(e,t={}){let n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),r=n===``?1/0:t.maxLength===void 0?80:t.maxLength,{replacer:i}=t;return(function e(t,a,o){t&&typeof t.toJSON==`function`&&(t=t.toJSON());let s=JSON.stringify(t,i);if(s===void 0)return s;let c=r-a.length-o;if(s.length<=c){let e=s.replace(rh,(e,t)=>t||`${e} `);if(e.length<=c)return e}if(i!=null&&(t=JSON.parse(s),i=void 0),typeof t==`object`&&t){let r=a+n,i=[],o=0,s,c;if(Array.isArray(t)){s=`[`,c=`]`;let{length:n}=t;for(;o0)return[s,n+i.join(`,\n${r}`),c].join(`\n${a}`)}return s})(e,``,0)}var rh,Sie=o((()=>{rh=/("(?:[^\\"]|\\.)*")|[:,]/g}));function ih(e,t,n){return Object.assign(e,{fields:t||[],fname:n})}function ah(e){return e==null?null:e.fname}function oh(e){return e==null?null:e.fields}var sh=o((()=>{}));function ch(e){return e.length===1?lh(e[0]):uh(e)}var lh,uh,dh=o((()=>{lh=e=>function(t){return t[e]},uh=e=>{let t=e.length;return function(n){for(let r=0;r{}));function ph(e){let t=[],n=e.length,r=null,i=0,a=``,o,s,c;e+=``;function l(){t.push(a+e.substring(o,s)),a=``,o=s+1}for(o=s=0;so?l():o=s+1:c===`[`?(s>o&&l(),i=o=s+1):c===`]`&&(i||V(`Access path missing open bracket: `+e),i>0&&l(),i=0,o=s+1);return i&&V(`Access path missing closing bracket: `+e),r&&V(`Access path missing closing quote: `+e),s>o&&(s++,l()),t}var mh=o((()=>{fh()}));function hh(e,t,n){let r=ph(e),i=r.length===1?r[0]:e;return ih((n&&n.get||ch)(r),[i],t||i)}var gh=o((()=>{sh(),dh(),mh()})),_h,vh,yh,bh,xh,Sh,Cie=o((()=>{sh(),gh(),_h=hh(`id`),vh=ih(e=>e,[],`identity`),yh=ih(()=>0,[],`zero`),bh=ih(()=>1,[],`one`),xh=ih(()=>!0,[],`true`),Sh=ih(()=>!1,[],`false`)})),Ch,wie=o((()=>{Ch=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]==`function`),`__proto__`])}));function Tie(e,t,n){let r=[t,...n];console[e](...r)}function wh(e,t,n=Tie){let r=e||0;return{level(e){return arguments.length?(r=+e,this):r},error(...e){return r>=1&&n(t||`error`,`ERROR`,e),this},warn(...e){return r>=2&&n(t||`warn`,`WARN`,e),this},info(...e){return r>=3&&n(t||`log`,`INFO`,e),this},debug(...e){return r>=4&&n(t||`log`,`DEBUG`,e),this}}}var Eie=o((()=>{})),H,Th=o((()=>{H=Array.isArray}));function Eh(e){return e===Object(e)}var Dh=o((()=>{}));function Oh(...e){return e.reduce((e,t)=>{for(let n in t)if(n===`signals`)e.signals=Die(e.signals,t.signals);else{let r=n===`legend`?{layout:1}:n===`style`||null;kh(e,n,t[n],r)}return e},{})}function kh(e,t,n,r){if(!Ah(t))return;let i=e,a,o;if(Eh(n)&&!H(n)){let e=n;for(a in o=Eh(i[t])?i[t]:i[t]={},e)r&&(r===!0||r[a])?kh(o,a,e[a]):Ah(a)&&(o[a]=e[a])}else i[t]=n}function Die(e,t){if(e==null)return t;if(t==null)return e;let n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}var Ah,Oie=o((()=>{Th(),Dh(),Ah=e=>e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}));function jh(e){return e[e.length-1]}var Mh=o((()=>{}));function Nh(e){return e==null||e===``?null:+e}var Ph=o((()=>{}));function Fh(e){return e.length>0}function Ih(e,t,n,r){Fh(e)||V(`Domain array must not be empty`);let i=n(e[0]),a=n(jh(e)),o=(a-i)*t;return[r(i-o),r(a-o)]}function Lh(e,t){return Ih(e,t,Zh,Qh)}function Rh(e,t){let n=Math.sign(e[0]);return Ih(e,t,qh(n),Kh(n))}function zh(e,t,n){return Ih(e,t,Xh(n),Xh(1/n))}function Bh(e,t,n){return Ih(e,t,Jh(n),Yh(n))}function Vh(e,t,n,r,i){Fh(e)||V(`Domain array must not be empty`);let a=r(e[0]),o=r(jh(e)),s=t==null?(a+o)/2:r(t);return[i(s+(a-s)*n),i(s+(o-s)*n)]}function Hh(e,t,n){return Vh(e,t,n,Zh,Qh)}function Uh(e,t,n){let r=Math.sign(e[0]);return Vh(e,t,n,qh(r),Kh(r))}function Wh(e,t,n,r){return Vh(e,t,n,Xh(r),Xh(1/r))}function Gh(e,t,n,r){return Vh(e,t,n,Jh(r),Yh(r))}var Kh,qh,Jh,Yh,Xh,Zh,Qh,kie=o((()=>{fh(),Mh(),Ph(),Kh=e=>t=>e*Math.exp(t),qh=e=>t=>Math.log(e*t),Jh=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Yh=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Xh=e=>t=>t<0?-((-t)**+e):t**+e,Zh=e=>Nh(e)??0,Qh=e=>e}));function $h(e){return 1+~~(new Date(e).getMonth()/3)}function eg(e){return 1+~~(new Date(e).getUTCMonth()/3)}var Aie=o((()=>{}));function tg(e){return e==null?[]:H(e)?e:[e]}var ng=o((()=>{Th()}));function rg(e,t,n){let r=e[0],i=e[1],a;return i=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-a),r+a]}var jie=o((()=>{}));function ig(e){return typeof e==`function`}var ag=o((()=>{}));function og(e,t,n){let r=n||{},i=tg(t)||[],a=[],o=[],s={},c=r.comparator||Nie;return tg(e).forEach((e,t)=>{if(e==null)return;a.push(i[t]===Mie?-1:1);let n=ig(e)?e:hh(e,void 0,r);o.push(n),(oh(n)||[]).forEach(e=>s[e]=1)}),o.length===0?null:ih(c(o,a),Object.keys(s))}var Mie,sg,Nie,Pie,Fie,Iie=o((()=>{sh(),ng(),gh(),ag(),Mie=`descending`,sg=(e,t)=>{let n=e,r=t;return(nr||r==null)&&n!=null?1:(r=r instanceof Date?+r:r,n=n instanceof Date?+n:n)!==n&&r===r?-1:+(r!==r&&n===n)},Nie=(e,t)=>e.length===1?Pie(e[0],t[0]):Fie(e,t,e.length),Pie=(e,t)=>function(n,r){return sg(e(n),e(r))*t},Fie=(e,t,n)=>(t.push(0),function(r,i){let a,o=0,s=-1;for(;o===0&&++se}var Lie=o((()=>{ag()}));function lg(e,t){let n=null;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}var Rie=o((()=>{}));function ug(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}var zie=o((()=>{}));function dg(e,t){let n=0,r,i,a,o;if(e&&(r=e.length))if(t==null){for(i=e[n];no&&(o=i))}else{for(i=t(e[n]);no&&(o=i))}return[a,o]}var Bie=o((()=>{}));function Vie(e,t){let n=e.length,r=-1,i,a,o,s,c;if(t==null){for(;++r=s){o=c=s;break}if(r===n)return[-1,-1];for(i=a=r;++rs&&(o=s,i=r),c=s){o=c=s;break}if(r===n)return[-1,-1];for(i=a=r;++rs&&(o=s,i=r),c{}));function fg(e,t){return Object.hasOwn(e,t)}var pg=o((()=>{}));function mg(e){let t={},n;function r(e){return fg(t,e)&&t[e]!==hg}let i={size:0,empty:0,object:t,has:r,get(e){return r(e)?t[e]:void 0},set(e,n){return r(e)||(++i.size,t[e]===hg&&--i.empty),t[e]=n,this},delete(e){return r(e)&&(--i.size,++i.empty,t[e]=hg),this},clear(){i.size=i.empty=0,i.object=t={}},test(e){return arguments.length?(n=e,i):n},clean(){let e={},r=0;for(let i in t){let a=t[i];a!==hg&&(!n||!n(a))&&(e[i]=a,++r)}i.size=r,i.empty=0,i.object=t=e}};return e&&Object.keys(e).forEach(t=>{i.set(t,e[t])}),i}var hg,Uie=o((()=>{pg(),hg={}}));function Wie(e,t,n,r,i,a){if(!n&&n!==0)return a;let o=+n,s=e[0],c=jh(e),l;if(c===void 0)return a;c{Mh()}));function U(e,t,n){let r=e.prototype=Object.create(t.prototype);return Object.defineProperty(r,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),ug(r,n)}var Kie=o((()=>{zie()}));function gg(e,t,n,r){let i=t[0],a=t[t.length-1],o;return i>a&&(o=i,i=a,a=o),n=n===void 0||n,r=r===void 0||r,(n?i<=e:i{}));function _g(e){return typeof e==`boolean`}var Jie=o((()=>{}));function vg(e){return Object.prototype.toString.call(e)===`[object Date]`}var Yie=o((()=>{}));function Xie(e){return e!=null&&ig(e[Symbol.iterator])}var Zie=o((()=>{ag()}));function yg(e){return typeof e==`number`}var Qie=o((()=>{}));function bg(e){return Object.prototype.toString.call(e)===`[object RegExp]`}var $ie=o((()=>{}));function xg(e){return typeof e==`string`}var eae=o((()=>{}));function Sg(e,t,n){let r=e?t?tg(e).map(e=>e.replace(/\\(.)/g,`$1`)):tg(e):void 0,i=r?.length,a=n&&n.get||ch,o=e=>a(t?[e]:ph(e)),s;if(!i||!r)s=function(){return``};else if(i===1){let e=o(r[0]);s=function(t){return``+e(t)}}else{let e=r.map(o);s=function(t){let n=``+e[0](t),r=0;for(;++r{sh(),ng(),dh(),mh()}));function nae(e,t){let n=e[0],r=jh(e),i=+t;return r===void 0?n:i?i===1?r:n+i*(r-n):n}var rae=o((()=>{Mh()}));function iae(e){e=+e||aae;let t,n,r,i=()=>{t={},n={},r=0},a=(i,a)=>(++r>e&&(n=t,t={},r=1),t[i]=a);return i(),{clear:i,has:e=>fg(t,e)||fg(n,e),get:e=>fg(t,e)?t[e]:fg(n,e)?a(e,n[e]):void 0,set:(e,n)=>fg(t,e)?t[e]=n:a(e,n)}}var aae,oae=o((()=>{pg(),aae=1e4}));function sae(e){return e===Array||typeof e==`function`&&e.prototype&&ArrayBuffer.isView(e.prototype)}function cae(e,t,n,r){let i=t.length,a=n.length;if(!a)return t;if(!i)return n;let o=t.constructor,s=r||(sae(o)?new o(i+a):Array(i+a)),c=0,l=0,u=0;for(;c0?n[l++]:t[c++];for(;c{}));function Cg(e,t){let n=``;for(;--t>=0;)n+=e;return n}var uae=o((()=>{}));function dae(e,t,n,r){let i=n||` `,a=e+``,o=t-a.length;return o<=0?a:r===`left`?Cg(i,o)+a:r===`center`?Cg(i,~~(o/2))+a+Cg(i,Math.ceil(o/2)):a+Cg(i,o)}var fae=o((()=>{uae()}));function wg(e){return e&&jh(e)-e[0]||0}var pae=o((()=>{Mh()}));function W(e){return H(e)?`[${e.map(e=>e===null?`null`:W(e))}]`:Eh(e)||xg(e)?JSON.stringify(e).replaceAll(`\u2028`,`\\u2028`).replaceAll(`\u2029`,`\\u2029`):e}var mae=o((()=>{Th(),Dh(),eae()}));function Tg(e){return e==null||e===``?null:!e||e===`false`||e===`0`?!1:!!e}var hae=o((()=>{}));function Eg(e,t){return t||=gae,e==null||e===``?null:t(e)}var gae,_ae=o((()=>{Yie(),Qie(),gae=e=>yg(e)||vg(e)?e:Date.parse(e)}));function Dg(e){return e==null||e===``?null:e+``}var vae=o((()=>{}));function Og(e){let t={},n=e.length;for(let r=0;r{}));function bae(e,t,n,r){let i=r??`…`,a=e+``,o=a.length,s=Math.max(0,t-i.length);return o<=t?a:n===`left`?i+a.slice(o-s):n===`center`?a.slice(0,Math.ceil(s/2))+i+a.slice(o-~~(s/2)):a.slice(0,s)+i}var xae=o((()=>{}));function kg(e,t,n){if(e)if(t){let r=e.length;for(let i=0;i{})),Ag=o((()=>{sh(),Cie(),wie(),Eie(),Oie(),kie(),Aie(),ng(),jie(),Iie(),Lie(),Rie(),fh(),zie(),Bie(),Hie(),Uie(),gh(),Gie(),pg(),Kie(),qie(),Th(),Jie(),Yie(),ag(),Zie(),Qie(),Dh(),$ie(),eae(),tae(),rae(),oae(),lae(),fae(),Mh(),uae(),pae(),mh(),mae(),hae(),_ae(),Ph(),vae(),yae(),xae(),Sae()}));function Cae(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function wae(e,t){var n=Cae(e);return function(r,i){return t(n(r),i,e)}}function Tae(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function jg(e,t){var n=e+``,r=n.length;return r9999?`+`+jg(e,6):jg(e,4)}function Dae(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:Eae(e.getUTCFullYear(),4)+`-`+jg(e.getUTCMonth()+1,2)+`-`+jg(e.getUTCDate(),2)+(i?`T`+jg(t,2)+`:`+jg(n,2)+`:`+jg(r,2)+`.`+jg(i,3)+`Z`:r?`T`+jg(t,2)+`:`+jg(n,2)+`:`+jg(r,2)+`Z`:n||t?`T`+jg(t,2)+`:`+jg(n,2)+`Z`:``)}function Oae(e){var t=RegExp(`["`+e+` -\r]`),n=e.charCodeAt(0);function r(e,t){var n,r,a=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?wae(e,t):Cae(e)});return a.columns=r||[],a}function i(e,t){var r=[],i=e.length,a=0,o=0,s,c=i<=0,l=!1;e.charCodeAt(i-1)===Fg&&--i,e.charCodeAt(i-1)===Ig&&--i;function u(){if(c)return Ng;if(l)return l=!1,Mg;var t,r=a,o;if(e.charCodeAt(r)===Pg){for(;a++=i?c=!0:(o=e.charCodeAt(a++))===Fg?l=!0:o===Ig&&(l=!0,e.charCodeAt(a)===Fg&&++a),e.slice(r+1,t-1).replace(/""/g,`"`)}for(;a({key:e,label:t,type:`text`,source:`odoo`}),n=[t(`metric`,`Metric`),...e.columns.map(e=>t(`c_${e.key}`,e.partial?`${e.label} (partial)`:e.label)),t(`total`,`Total`)],r=[],i=(t,n,i)=>{let a={pid:r.length+1,metric:t,total:i};e.columns.forEach((e,t)=>{a[`c_${e.key}`]=n[t]??``}),r.push(a)};for(let t of e.rows){i(t.sublabel?`${t.label} (${t.sublabel})`:t.label,t.cells.map(e=>im(e.value)),im(t.total??null));for(let e of t.deltas)i(`${t.label} — ${e.label}${e.percent?` (%)`:``}`,e.values.map(t=>am(t,e.percent)),``)}if(e.notes.length>0){i(``,[],``);for(let t of e.notes)i(t,[],``)}return{fields:n,rows:r}}var Pie={brand:[`#1F4E78`,`#C8A24B`,`#6F96B8`,`#E0C979`,`#3E6F98`,`#A17C2D`],categorical:[`#2F6B9A`,`#C28A2C`,`#4C8A68`,`#8A5C9D`,`#C25B56`,`#4B8793`,`#8B704A`,`#6A78A8`,`#A45D7D`,`#708B3D`,`#B66B32`,`#52749C`],sequential:[`#E7F0F7`,`#C5D9E9`,`#9CBCD5`,`#719DBE`,`#477CA3`,`#1F4E78`],diverging:[`#2F6B9A`,`#7EA5C3`,`#D8E4ED`,`#F0E6C6`,`#D5B66A`,`#9B7222`]};function Fie(e){switch(e.axis?.y?.format){case`number`:return{format:`,.2~f`};case`currency`:return{format:`$,.0f`};case`percent`:return{labelExpr:`format(datum.value, ',.2~f') + '%'`};case`compact`:return{format:`~s`};default:return{}}}function Iie(e,t){let n=new Map(e.xOrder.map((e,t)=>[e,t])),r=new Map(e.seriesOrder.map((e,t)=>[e,t]));return e.points.map(e=>({xKey:e.key,xLabel:e.label,xIndex:n.get(e.key)??0,value:e.value,valueText:t(e.value),n:e.n,seriesKey:e.seriesKey,seriesLabel:e.seriesLabel,seriesIndex:r.get(e.seriesKey)??0}))}function Lie(){return{font:`Inter, ui-sans-serif, system-ui, sans-serif`,view:{stroke:null},axis:{labelColor:`#536273`,labelFont:`Inter, ui-sans-serif, system-ui, sans-serif`,labelFontSize:10,labelLimit:110,titleColor:`#344355`,titleFont:`Inter, ui-sans-serif, system-ui, sans-serif`,titleFontSize:11,titleFontWeight:500,gridColor:`#E7EBEF`,domainColor:`#C9D1D9`,tickColor:`#C9D1D9`},legend:{labelColor:`#536273`,labelFont:`Inter, ui-sans-serif, system-ui, sans-serif`,labelFontSize:10,titleColor:`#344355`,titleFont:`Inter, ui-sans-serif, system-ui, sans-serif`,titleFontSize:10,symbolType:`circle`,orient:`bottom`,direction:`horizontal`}}}function Rie(e,t){return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,data:{values:t},width:`container`,height:`container`,autosize:{type:`fit`,contains:`padding`,resize:!0},padding:4,config:Lie(),usermeta:{rendererBoundary:`aios-chart-spec-v1`,chartId:e.id}}}function gm(e){return[{field:`xLabel`,type:`nominal`,title:`Group`},...e?[{field:`seriesLabel`,type:`nominal`,title:`Series`}]:[],{field:`valueText`,type:`nominal`,title:`Value`},{field:`n`,type:`quantitative`,title:`Records`,format:`,`}]}function _m({spec:e,model:t,xTitle:n,yTitle:r,formatValue:i}){let a=Iie(t,i).filter(t=>e.kind!==`donut`||t.value>0),o=[...Pie[e.palette??`brand`]],s=t.seriesOrder.length>0,c=s?{field:`seriesLabel`,type:`nominal`,title:null,sort:{field:`seriesIndex`,op:`min`},scale:{range:o},legend:{columns:4}}:{value:o[0]},l={field:`xLabel`,type:`nominal`,title:n??null,sort:{field:`xIndex`,op:`min`,order:`ascending`},axis:{labelAngle:t.xOrder.length>7?-35:0,labelOverlap:`greedy`}},u={field:`value`,type:`quantitative`,title:r??null,axis:Fie(e)},d=Rie(e,a);if(e.kind===`kpi`)return{...d,mark:{type:`text`,align:`center`,baseline:`middle`,font:`Inter, ui-sans-serif, system-ui, sans-serif`,fontSize:32,fontWeight:600,color:`#172433`},encoding:{text:{field:`valueText`,type:`nominal`},tooltip:[{field:`valueText`,type:`nominal`,title:`Value`},{field:`n`,type:`quantitative`,title:`Records`,format:`,`}]}};if(e.kind===`donut`)return{...d,mark:{type:`arc`,innerRadius:44,outerRadius:76,cornerRadius:2,padAngle:.01},encoding:{theta:{field:`value`,type:`quantitative`,stack:!0},color:{field:`xLabel`,type:`nominal`,title:null,sort:{field:`xIndex`,op:`min`},scale:{range:o},legend:{orient:`right`,direction:`vertical`,labelLimit:110}},order:{field:`xIndex`,type:`quantitative`},tooltip:gm(!1)}};let f={x:l,y:{...u,stack:(e.kind===`bar`||e.kind===`area`)&&s?e.stacked?`zero`:null:void 0},color:c,tooltip:gm(s)};return s&&e.kind===`bar`&&!e.stacked&&(f.xOffset={field:`seriesLabel`,type:`nominal`,sort:{field:`seriesIndex`,op:`min`}}),(e.kind===`line`||e.kind===`area`)&&(f.order={field:`xIndex`,type:`quantitative`},s&&(f.detail={field:`seriesKey`,type:`nominal`})),{...d,mark:e.kind===`bar`?{type:`bar`,cornerRadiusTopLeft:2,cornerRadiusTopRight:2}:e.kind===`area`?{type:`area`,opacity:s?.68:.48,line:!0,point:!0}:{type:`line`,strokeWidth:2,point:{filled:!0,size:46}},encoding:f}}function vm(e,t={}){let n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),r=n===``?1/0:t.maxLength===void 0?80:t.maxLength,{replacer:i}=t;return(function e(t,a,o){t&&typeof t.toJSON==`function`&&(t=t.toJSON());let s=JSON.stringify(t,i);if(s===void 0)return s;let c=r-a.length-o;if(s.length<=c){let e=s.replace(ym,(e,t)=>t||`${e} `);if(e.length<=c)return e}if(i!=null&&(t=JSON.parse(s),i=void 0),typeof t==`object`&&t){let r=a+n,i=[],o=0,s,c;if(Array.isArray(t)){s=`[`,c=`]`;let{length:n}=t;for(;o0)return[s,n+i.join(`,\n${r}`),c].join(`\n${a}`)}return s})(e,``,0)}var ym,zie=o((()=>{ym=/("(?:[^\\"]|\\.)*")|[:,]/g}));function bm(e,t,n){return Object.assign(e,{fields:t||[],fname:n})}function xm(e){return e==null?null:e.fname}function Sm(e){return e==null?null:e.fields}var Cm=o((()=>{}));function wm(e){return e.length===1?Tm(e[0]):Em(e)}var Tm,Em,Dm=o((()=>{Tm=e=>function(t){return t[e]},Em=e=>{let t=e.length;return function(n){for(let r=0;r{}));function km(e){let t=[],n=e.length,r=null,i=0,a=``,o,s,c;e+=``;function l(){t.push(a+e.substring(o,s)),a=``,o=s+1}for(o=s=0;so?l():o=s+1:c===`[`?(s>o&&l(),i=o=s+1):c===`]`&&(i||V(`Access path missing open bracket: `+e),i>0&&l(),i=0,o=s+1);return i&&V(`Access path missing closing bracket: `+e),r&&V(`Access path missing closing quote: `+e),s>o&&(s++,l()),t}var Am=o((()=>{Om()}));function jm(e,t,n){let r=km(e),i=r.length===1?r[0]:e;return bm((n&&n.get||wm)(r),[i],t||i)}var Mm=o((()=>{Cm(),Dm(),Am()})),Nm,Pm,Fm,Im,Lm,Rm,Bie=o((()=>{Cm(),Mm(),Nm=jm(`id`),Pm=bm(e=>e,[],`identity`),Fm=bm(()=>0,[],`zero`),Im=bm(()=>1,[],`one`),Lm=bm(()=>!0,[],`true`),Rm=bm(()=>!1,[],`false`)})),zm,Vie=o((()=>{zm=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]==`function`),`__proto__`])}));function Hie(e,t,n){let r=[t,...n];console[e](...r)}function Bm(e,t,n=Hie){let r=e||0;return{level(e){return arguments.length?(r=+e,this):r},error(...e){return r>=1&&n(t||`error`,`ERROR`,e),this},warn(...e){return r>=2&&n(t||`warn`,`WARN`,e),this},info(...e){return r>=3&&n(t||`log`,`INFO`,e),this},debug(...e){return r>=4&&n(t||`log`,`DEBUG`,e),this}}}var Uie=o((()=>{})),H,Vm=o((()=>{H=Array.isArray}));function Hm(e){return e===Object(e)}var Um=o((()=>{}));function Wm(...e){return e.reduce((e,t)=>{for(let n in t)if(n===`signals`)e.signals=Wie(e.signals,t.signals);else{let r=n===`legend`?{layout:1}:n===`style`||null;Gm(e,n,t[n],r)}return e},{})}function Gm(e,t,n,r){if(!Km(t))return;let i=e,a,o;if(Hm(n)&&!H(n)){let e=n;for(a in o=Hm(i[t])?i[t]:i[t]={},e)r&&(r===!0||r[a])?Gm(o,a,e[a]):Km(a)&&(o[a]=e[a])}else i[t]=n}function Wie(e,t){if(e==null)return t;if(t==null)return e;let n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}var Km,Gie=o((()=>{Vm(),Um(),Km=e=>e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}));function qm(e){return e[e.length-1]}var Jm=o((()=>{}));function Ym(e){return e==null||e===``?null:+e}var Xm=o((()=>{}));function Zm(e){return e.length>0}function Qm(e,t,n,r){Zm(e)||V(`Domain array must not be empty`);let i=n(e[0]),a=n(qm(e)),o=(a-i)*t;return[r(i-o),r(a-o)]}function $m(e,t){return Qm(e,t,ph,mh)}function eh(e,t){let n=Math.sign(e[0]);return Qm(e,t,lh(n),ch(n))}function th(e,t,n){return Qm(e,t,fh(n),fh(1/n))}function nh(e,t,n){return Qm(e,t,uh(n),dh(n))}function rh(e,t,n,r,i){Zm(e)||V(`Domain array must not be empty`);let a=r(e[0]),o=r(qm(e)),s=t==null?(a+o)/2:r(t);return[i(s+(a-s)*n),i(s+(o-s)*n)]}function ih(e,t,n){return rh(e,t,n,ph,mh)}function ah(e,t,n){let r=Math.sign(e[0]);return rh(e,t,n,lh(r),ch(r))}function oh(e,t,n,r){return rh(e,t,n,fh(r),fh(1/r))}function sh(e,t,n,r){return rh(e,t,n,uh(r),dh(r))}var ch,lh,uh,dh,fh,ph,mh,Kie=o((()=>{Om(),Jm(),Xm(),ch=e=>t=>e*Math.exp(t),lh=e=>t=>Math.log(e*t),uh=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),dh=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,fh=e=>t=>t<0?-((-t)**+e):t**+e,ph=e=>Ym(e)??0,mh=e=>e}));function hh(e){return 1+~~(new Date(e).getMonth()/3)}function gh(e){return 1+~~(new Date(e).getUTCMonth()/3)}var qie=o((()=>{}));function _h(e){return e==null?[]:H(e)?e:[e]}var vh=o((()=>{Vm()}));function yh(e,t,n){let r=e[0],i=e[1],a;return i=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-a),r+a]}var Jie=o((()=>{}));function bh(e){return typeof e==`function`}var xh=o((()=>{}));function Sh(e,t,n){let r=n||{},i=_h(t)||[],a=[],o=[],s={},c=r.comparator||Th;return _h(e).forEach((e,t)=>{if(e==null)return;a.push(i[t]===Ch?-1:1);let n=bh(e)?e:jm(e,void 0,r);o.push(n),(Sm(n)||[]).forEach(e=>s[e]=1)}),o.length===0?null:bm(c(o,a),Object.keys(s))}var Ch,wh,Th,Eh,Dh,Yie=o((()=>{Cm(),vh(),Mm(),xh(),Ch=`descending`,wh=(e,t)=>{let n=e,r=t;return(nr||r==null)&&n!=null?1:(r=r instanceof Date?+r:r,n=n instanceof Date?+n:n)!==n&&r===r?-1:+(r!==r&&n===n)},Th=(e,t)=>e.length===1?Eh(e[0],t[0]):Dh(e,t,e.length),Eh=(e,t)=>function(n,r){return wh(e(n),e(r))*t},Dh=(e,t,n)=>(t.push(0),function(r,i){let a,o=0,s=-1;for(;o===0&&++se}var Xie=o((()=>{xh()}));function kh(e,t){let n=null;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}var Zie=o((()=>{}));function Ah(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}var jh=o((()=>{}));function Mh(e,t){let n=0,r,i,a,o;if(e&&(r=e.length))if(t==null){for(i=e[n];no&&(o=i))}else{for(i=t(e[n]);no&&(o=i))}return[a,o]}var Qie=o((()=>{}));function Nh(e,t){let n=e.length,r=-1,i,a,o,s,c;if(t==null){for(;++r=s){o=c=s;break}if(r===n)return[-1,-1];for(i=a=r;++rs&&(o=s,i=r),c=s){o=c=s;break}if(r===n)return[-1,-1];for(i=a=r;++rs&&(o=s,i=r),c{}));function Ph(e,t){return Object.hasOwn(e,t)}var Fh=o((()=>{}));function Ih(e){let t={},n;function r(e){return Ph(t,e)&&t[e]!==Lh}let i={size:0,empty:0,object:t,has:r,get(e){return r(e)?t[e]:void 0},set(e,n){return r(e)||(++i.size,t[e]===Lh&&--i.empty),t[e]=n,this},delete(e){return r(e)&&(--i.size,++i.empty,t[e]=Lh),this},clear(){i.size=i.empty=0,i.object=t={}},test(e){return arguments.length?(n=e,i):n},clean(){let e={},r=0;for(let i in t){let a=t[i];a!==Lh&&(!n||!n(a))&&(e[i]=a,++r)}i.size=r,i.empty=0,i.object=t=e}};return e&&Object.keys(e).forEach(t=>{i.set(t,e[t])}),i}var Lh,eae=o((()=>{Fh(),Lh={}}));function Rh(e,t,n,r,i,a){if(!n&&n!==0)return a;let o=+n,s=e[0],c=qm(e),l;if(c===void 0)return a;c{Jm()}));function U(e,t,n){let r=e.prototype=Object.create(t.prototype);return Object.defineProperty(r,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),Ah(r,n)}var nae=o((()=>{jh()}));function zh(e,t,n,r){let i=t[0],a=t[t.length-1],o;return i>a&&(o=i,i=a,a=o),n=n===void 0||n,r=r===void 0||r,(n?i<=e:i{}));function Bh(e){return typeof e==`boolean`}var iae=o((()=>{}));function Vh(e){return Object.prototype.toString.call(e)===`[object Date]`}var Hh=o((()=>{}));function Uh(e){return e!=null&&bh(e[Symbol.iterator])}var aae=o((()=>{xh()}));function Wh(e){return typeof e==`number`}var Gh=o((()=>{}));function Kh(e){return Object.prototype.toString.call(e)===`[object RegExp]`}var oae=o((()=>{}));function qh(e){return typeof e==`string`}var Jh=o((()=>{}));function Yh(e,t,n){let r=e?t?_h(e).map(e=>e.replace(/\\(.)/g,`$1`)):_h(e):void 0,i=r?.length,a=n&&n.get||wm,o=e=>a(t?[e]:km(e)),s;if(!i||!r)s=function(){return``};else if(i===1){let e=o(r[0]);s=function(t){return``+e(t)}}else{let e=r.map(o);s=function(t){let n=``+e[0](t),r=0;for(;++r{Cm(),vh(),Dm(),Am()}));function Xh(e,t){let n=e[0],r=qm(e),i=+t;return r===void 0?n:i?i===1?r:n+i*(r-n):n}var cae=o((()=>{Jm()}));function Zh(e){e=+e||Qh;let t,n,r,i=()=>{t={},n={},r=0},a=(i,a)=>(++r>e&&(n=t,t={},r=1),t[i]=a);return i(),{clear:i,has:e=>Ph(t,e)||Ph(n,e),get:e=>Ph(t,e)?t[e]:Ph(n,e)?a(e,n[e]):void 0,set:(e,n)=>Ph(t,e)?t[e]=n:a(e,n)}}var Qh,lae=o((()=>{Fh(),Qh=1e4}));function uae(e){return e===Array||typeof e==`function`&&e.prototype&&ArrayBuffer.isView(e.prototype)}function $h(e,t,n,r){let i=t.length,a=n.length;if(!a)return t;if(!i)return n;let o=t.constructor,s=r||(uae(o)?new o(i+a):Array(i+a)),c=0,l=0,u=0;for(;c0?n[l++]:t[c++];for(;c{}));function eg(e,t){let n=``;for(;--t>=0;)n+=e;return n}var tg=o((()=>{}));function ng(e,t,n,r){let i=n||` `,a=e+``,o=t-a.length;return o<=0?a:r===`left`?eg(i,o)+a:r===`center`?eg(i,~~(o/2))+a+eg(i,Math.ceil(o/2)):a+eg(i,o)}var fae=o((()=>{tg()}));function rg(e){return e&&qm(e)-e[0]||0}var pae=o((()=>{Jm()}));function W(e){return H(e)?`[${e.map(e=>e===null?`null`:W(e))}]`:Hm(e)||qh(e)?JSON.stringify(e).replaceAll(`\u2028`,`\\u2028`).replaceAll(`\u2029`,`\\u2029`):e}var mae=o((()=>{Vm(),Um(),Jh()}));function ig(e){return e==null||e===``?null:!e||e===`false`||e===`0`?!1:!!e}var hae=o((()=>{}));function ag(e,t){return t||=og,e==null||e===``?null:t(e)}var og,gae=o((()=>{Hh(),Gh(),og=e=>Wh(e)||Vh(e)?e:Date.parse(e)}));function sg(e){return e==null||e===``?null:e+``}var _ae=o((()=>{}));function cg(e){let t={},n=e.length;for(let r=0;r{}));function lg(e,t,n,r){let i=r??`…`,a=e+``,o=a.length,s=Math.max(0,t-i.length);return o<=t?a:n===`left`?i+a.slice(o-s):n===`center`?a.slice(0,Math.ceil(s/2))+i+a.slice(o-~~(s/2)):a.slice(0,s)+i}var yae=o((()=>{}));function ug(e,t,n){if(e)if(t){let r=e.length;for(let i=0;i{})),dg=o((()=>{Cm(),Bie(),Vie(),Uie(),Gie(),Kie(),qie(),vh(),Jie(),Yie(),Xie(),Zie(),Om(),jh(),Qie(),$ie(),eae(),Mm(),tae(),Fh(),nae(),rae(),Vm(),iae(),Hh(),xh(),aae(),Gh(),Um(),oae(),Jh(),sae(),cae(),lae(),dae(),fae(),Jm(),tg(),pae(),Am(),mae(),hae(),gae(),Xm(),_ae(),vae(),yae(),bae()}));function fg(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function xae(e,t){var n=fg(e);return function(r,i){return t(n(r),i,e)}}function pg(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function mg(e,t){var n=e+``,r=n.length;return r9999?`+`+mg(e,6):mg(e,4)}function Cae(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:Sae(e.getUTCFullYear(),4)+`-`+mg(e.getUTCMonth()+1,2)+`-`+mg(e.getUTCDate(),2)+(i?`T`+mg(t,2)+`:`+mg(n,2)+`:`+mg(r,2)+`.`+mg(i,3)+`Z`:r?`T`+mg(t,2)+`:`+mg(n,2)+`:`+mg(r,2)+`Z`:n||t?`T`+mg(t,2)+`:`+mg(n,2)+`Z`:``)}function wae(e){var t=RegExp(`["`+e+` +\r]`),n=e.charCodeAt(0);function r(e,t){var n,r,a=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?xae(e,t):fg(e)});return a.columns=r||[],a}function i(e,t){var r=[],i=e.length,a=0,o=0,s,c=i<=0,l=!1;e.charCodeAt(i-1)===vg&&--i,e.charCodeAt(i-1)===yg&&--i;function u(){if(c)return gg;if(l)return l=!1,hg;var t,r=a,o;if(e.charCodeAt(r)===_g){for(;a++=i?c=!0:(o=e.charCodeAt(a++))===vg?l=!0:o===yg&&(l=!0,e.charCodeAt(a)===vg&&++a),e.slice(r+1,t-1).replace(/""/g,`"`)}for(;a{Mg={},Ng={},Pg=34,Fg=10,Ig=13})),Aae=o((()=>{kae()}));function jae(e){return e}var Mae=o((()=>{}));function Nae(e){if(e==null)return jae;var t,n,r=e.scale[0],i=e.scale[1],a=e.translate[0],o=e.translate[1];return function(e,s){s||(t=n=0);var c=2,l=e.length,u=Array(l);for(u[0]=(t+=e[0])*r+a,u[1]=(n+=e[1])*i+o;c{Mae()}));function Fae(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}var Iae=o((()=>{}));function Lae(e,t){return typeof t==`string`&&(t=e.objects[t]),t.type===`GeometryCollection`?{type:`FeatureCollection`,features:t.geometries.map(function(t){return Rae(e,t)})}:Rae(e,t)}function Rae(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=zae(e,t);return n==null&&r==null?{type:`Feature`,properties:i,geometry:a}:r==null?{type:`Feature`,id:n,properties:i,geometry:a}:{type:`Feature`,id:n,bbox:r,properties:i,geometry:a}}function zae(e,t){var n=Nae(e.transform),r=e.arcs;function i(e,t){t.length&&t.pop();for(var i=r[e<0?~e:e],a=0,o=i.length;a{Iae(),Pae()}));function Vae(e,t){var n={},r={},i={},a=[],o=-1;t.forEach(function(n,r){var i=e.arcs[n<0?~n:n],a;i.length<3&&!i[1][0]&&!i[1][1]&&(a=t[++o],t[o]=n,t[r]=a)}),t.forEach(function(e){var t=s(e),n=t[0],a=t[1],o,c;if(o=i[n])if(delete i[o.end],o.push(e),o.end=a,c=r[a]){delete r[c.start];var l=c===o?o:o.concat(c);r[l.start=o.start]=i[l.end=c.end]=l}else r[o.start]=i[o.end]=o;else if(o=r[a])if(delete r[o.start],o.unshift(e),o.start=n,c=i[n]){delete i[c.end];var u=c===o?o:c.concat(o);r[u.start=c.start]=i[u.end=o.end]=u}else r[o.start]=i[o.end]=o;else o=[e],r[o.start=n]=i[o.end=a]=o});function s(t){var n=e.arcs[t<0?~t:t],r=n[0],i;return e.transform?(i=[0,0],n.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=n[n.length-1],t<0?[i,r]:[r,i]}function c(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[e<0?~e:e]=1}),a.push(i)}}return c(i,r),c(r,i),t.forEach(function(e){n[e<0?~e:e]||a.push([e])}),a}var Hae=o((()=>{}));function Uae(e){return zae(e,Wae.apply(this,arguments))}function Wae(e,t,n){var r,i,a;if(arguments.length>1)r=Gae(e,t,n);else for(i=0,r=Array(a=e.arcs.length);i{Bae(),Hae()})),qae=o((()=>{Pae(),Bae(),Kae(),Hae(),Mae()}));function Lg(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var Rg=o((()=>{}));function Jae(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var Yae=o((()=>{}));function zg(e){let t,n,r;e.length===2?(t=e===Lg||e===Jae?e:Xae,n=e,r=e):(t=Lg,n=(t,n)=>Lg(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(in&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Xae(){return 0}var Zae=o((()=>{Rg(),Yae()}));function Qae(e){return e===null?NaN:+e}function*$ae(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var eoe=o((()=>{})),Bg,Vg,Hg,toe=o((()=>{Rg(),Zae(),eoe(),Bg=zg(Lg),Vg=Bg.right,Hg=Bg.left,zg(Qae).center}));function noe(e,t){let n=0,r,i=0,a=0;if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(r=t-i,i+=r/++n,a+=r*(t-i));else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,a+=r*(s-i))}if(n>1)return a/(n-1)}var roe=o((()=>{}));function ioe(e,t){let n=noe(e,t);return n&&Math.sqrt(n)}var aoe=o((()=>{roe()})),Ug,ooe=o((()=>{Ug=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let t=this._partials,n=0;for(let r=0;r0){for(a=e[--t];t>0&&(n=a,r=e[--t],a=n+r,i=r-(a-n),!i););t>0&&(i<0&&e[t-1]<0||i>0&&e[t-1]>0)&&(r=i*2,n=a+r,r==n-a&&(a=n))}return a}}}));function Wg({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function soe({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function coe({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function loe(e){return typeof e==`object`&&e?e.valueOf():e}var Gg,Kg,qg=o((()=>{Gg=class extends Map{constructor(e,t=loe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(Wg(this,e))}has(e){return super.has(Wg(this,e))}set(e,t){return super.set(soe(this,e),t)}delete(e){return super.delete(coe(this,e))}},Kg=class extends Set{constructor(e,t=loe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let t of e)this.add(t)}has(e){return super.has(Wg(this,e))}add(e){return super.add(soe(this,e))}delete(e){return super.delete(coe(this,e))}}}));function uoe(e,t){return Array.from(t,t=>e[t])}var doe=o((()=>{}));function foe(e=Lg){if(e===Lg)return poe;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function poe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et))}var moe=o((()=>{Rg()}));function Jg(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=hoe?10:a>=goe?5:a>=_oe?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];let r=t=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e{hoe=Math.sqrt(50),goe=Math.sqrt(10),_oe=Math.sqrt(2)}));function Qg(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}var yoe=o((()=>{}));function $g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}var boe=o((()=>{}));function xoe(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?poe:foe(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));xoe(e,t,u,d,i)}let a=e[t],o=n,s=r;for(e_(e,n,t),i(e[r],a)>0&&e_(e,n,r);o0;)--s}i(e[n],a)===0?e_(e,n,s):(++s,e_(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function e_(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}var Soe=o((()=>{moe()}));function t_(e,t,n){if(e=Float64Array.from($ae(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return $g(e);if(t>=1)return Qg(e);var r,i=(r-1)*t,a=Math.floor(i),o=Qg(xoe(e,a).subarray(0,a+1));return o+($g(e.subarray(a+1))-o)*(i-a)}}function Coe(e,t,n=Qae){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}var woe=o((()=>{yoe(),boe(),Soe(),eoe()}));function Toe(e,t){let n=0,r=0;if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}var Eoe=o((()=>{}));function Doe(e,t){return t_(e,.5,t)}var Ooe=o((()=>{woe()}));function*koe(e){for(let t of e)yield*t}function Aoe(e){return Array.from(koe(e))}var joe=o((()=>{}));function n_(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r{}));function Noe(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}var Poe=o((()=>{}));function Foe(e,...t){e=new Kg(e),t=t.map(Ioe);out:for(let n of e)for(let r of t)if(!r.has(n)){e.delete(n);continue out}return e}function Ioe(e){return e instanceof Kg?e:new Kg(e)}var Loe=o((()=>{qg()}));function Roe(...e){let t=new Kg;for(let n of e)for(let e of n)t.add(e);return t}var zoe=o((()=>{qg()})),r_=o((()=>{toe(),Rg(),Zae(),Yae(),aoe(),ooe(),qg(),moe(),voe(),woe(),yoe(),Eoe(),Ooe(),joe(),boe(),doe(),Soe(),Moe(),Poe(),roe(),Loe(),zoe()}));function Boe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function i_(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var a_=o((()=>{}));function o_(e){return e=i_(Math.abs(e)),e?e[1]:NaN}var s_=o((()=>{a_()}));function Voe(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}var Hoe=o((()=>{}));function Uoe(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Woe=o((()=>{}));function c_(e){if(!(t=Goe.exec(e)))throw Error(`invalid format: `+e);var t;return new l_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function l_(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}var Goe,Koe=o((()=>{Goe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i,c_.prototype=l_.prototype,l_.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 qoe(e){out:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Joe=o((()=>{}));function Yoe(e,t){var n=i_(e,t);if(!n)return u_=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(u_=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+i_(e,Math.max(0,t+a-1))[0]}var u_,Xoe=o((()=>{a_()}));function Zoe(e,t){var n=i_(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Qoe=o((()=>{a_()})),d_,$oe=o((()=>{a_(),Xoe(),Qoe(),d_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Boe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Zoe(e*100,t),r:Zoe,s:Yoe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}}));function ese(e){return e}var tse=o((()=>{}));function nse(e){var t=e.grouping===void 0||e.thousands===void 0?ese:Voe(f_.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?ese:Uoe(f_.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=c_(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):d_[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=d_[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=qoe(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&u_!==void 0?p_[8+u_/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++op||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(o_(t)/3)))*3,r=10**-n,i=l((e=c_(e),e.type=`f`,e),{suffix:p_[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var f_,p_,rse=o((()=>{s_(),Hoe(),Woe(),Koe(),Joe(),$oe(),Xoe(),tse(),f_=Array.prototype.map,p_=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`]}));function ise(e){return m_=nse(e),h_=m_.format,g_=m_.formatPrefix,m_}var m_,h_,g_,ase=o((()=>{rse(),ise({thousands:`,`,grouping:[3],currency:[`$`,``]})}));function __(e){return Math.max(0,-o_(Math.abs(e)))}var ose=o((()=>{s_()}));function v_(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(o_(t)/3)))*3-o_(Math.abs(e)))}var sse=o((()=>{s_()}));function y_(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,o_(t)-o_(e))+1}var cse=o((()=>{s_()})),b_=o((()=>{ase(),rse(),Koe(),ose(),sse(),cse()}));function x_(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(sx_(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(S_.setTime(+t),C_.setTime(+r),e(S_),e(C_),Math.floor(n(S_,C_))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var S_,C_,w_=o((()=>{S_=new Date,C_=new Date})),T_,E_=o((()=>{w_(),T_=x_(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e),T_.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?x_(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):T_),T_.range})),D_,O_,k_,A_,j_,M_,N_,P_=o((()=>{D_=1e3,O_=D_*60,k_=O_*60,A_=k_*24,j_=A_*7,M_=A_*30,N_=A_*365})),F_,I_=o((()=>{w_(),P_(),F_=x_(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*D_)},(e,t)=>(t-e)/D_,e=>e.getUTCSeconds()),F_.range})),L_,R_,z_=o((()=>{w_(),P_(),L_=x_(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*D_)},(e,t)=>{e.setTime(+e+t*O_)},(e,t)=>(t-e)/O_,e=>e.getMinutes()),L_.range,R_=x_(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*O_)},(e,t)=>(t-e)/O_,e=>e.getUTCMinutes()),R_.range})),B_,V_,H_=o((()=>{w_(),P_(),B_=x_(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*D_-e.getMinutes()*O_)},(e,t)=>{e.setTime(+e+t*k_)},(e,t)=>(t-e)/k_,e=>e.getHours()),B_.range,V_=x_(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*k_)},(e,t)=>(t-e)/k_,e=>e.getUTCHours()),V_.range})),U_,W_,G_,K_=o((()=>{w_(),P_(),U_=x_(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*O_)/A_,e=>e.getDate()-1),U_.range,W_=x_(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/A_,e=>e.getUTCDate()-1),W_.range,G_=x_(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/A_,e=>Math.floor(e/A_)),G_.range}));function q_(e){return x_(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*O_)/j_)}function J_(e){return x_(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/j_)}var Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv=o((()=>{w_(),P_(),Y_=q_(0),X_=q_(1),Z_=q_(2),Q_=q_(3),$_=q_(4),ev=q_(5),tv=q_(6),Y_.range,X_.range,Z_.range,Q_.range,$_.range,ev.range,tv.range,nv=J_(0),rv=J_(1),iv=J_(2),av=J_(3),ov=J_(4),sv=J_(5),cv=J_(6),nv.range,rv.range,iv.range,av.range,ov.range,sv.range,cv.range})),uv,dv,fv=o((()=>{w_(),uv=x_(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),uv.range,dv=x_(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),dv.range})),pv,mv,hv=o((()=>{w_(),pv=x_(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()),pv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:x_(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),pv.range,mv=x_(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear()),mv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:x_(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),mv.range}));function gv(e,t,n,r,i,a){let o=[[F_,1,D_],[F_,5,5*D_],[F_,15,15*D_],[F_,30,30*D_],[a,1,O_],[a,5,5*O_],[a,15,15*O_],[a,30,30*O_],[i,1,k_],[i,3,3*k_],[i,6,6*k_],[i,12,12*k_],[r,1,A_],[r,2,2*A_],[n,1,j_],[t,1,M_],[t,3,3*M_],[e,1,N_]];function s(e,t,n){let r=te).right(o,i);if(a===o.length)return e.every(Zg(t/N_,n/N_,r));if(a===0)return T_.every(Math.max(Zg(t,n,r),1));let[s,c]=o[i/o[a-1][2]{r_(),P_(),E_(),I_(),z_(),H_(),K_(),lv(),fv(),hv(),[_v,vv]=gv(mv,dv,nv,G_,V_,R_),[yv,bv]=gv(pv,uv,Y_,U_,B_,L_)})),xv=o((()=>{w_(),E_(),I_(),z_(),H_(),K_(),lv(),fv(),hv(),lse()}));function Sv(e){let t=tg(e).slice(),n={};return t.length||V(`Missing time unit.`),t.forEach(e=>{fg(oy,e)?n[e]=1:V(`Invalid time unit: ${e}.`)}),(n.week||n.day?1:0)+(n.quarter||n.month||n.date?1:0)+ +!!n.dayofyear>1&&V(`Incompatible time units: ${e}`),t.sort((e,t)=>oy[e]-oy[t]),t}function Cv(e,t){let n=ug({},sy,t),r=Sv(e),i=r.length,a=``,o=0,s,c;for(o=0;oo;--s)if(c=r.slice(o,s).join(`-`),n[c]!=null){a+=n[c],o=s;break}return a.trim()}function wv(e){return cy.setFullYear(e),cy.setMonth(0),cy.setDate(1),cy.setHours(0,0,0,0),cy}function Tv(e){return Dv(new Date(e))}function Ev(e){return Ov(new Date(e))}function Dv(e){return U_.count(wv(e.getFullYear())-1,e)}function Ov(e){return Y_.count(wv(e.getFullYear())-1,e)}function kv(e){return wv(e).getDay()}function use(e,t,n,r,i,a,o){if(0<=e&&e<100){let s=new Date(-1,t,n,r,i,a,o);return s.setFullYear(e),s}return new Date(e,t,n,r,i,a,o)}function Av(e){return Mv(new Date(e))}function jv(e){return Nv(new Date(e))}function Mv(e){let t=Date.UTC(e.getUTCFullYear(),0,1);return W_.count(t-1,e)}function Nv(e){let t=Date.UTC(e.getUTCFullYear(),0,1);return nv.count(t-1,e)}function Pv(e){return cy.setTime(Date.UTC(e,0,1)),cy.getUTCDay()}function dse(e,t,n,r,i,a,o){if(0<=e&&e<100){let e=new Date(Date.UTC(-1,t,n,r,i,a,o));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,a,o))}function Fv(e,t,n,r,i){let a=t||1,o=jh(e),s=(e,t,i)=>(i||=e,fse(n[i],r[i],e===o&&a,t)),c=new Date,l=Og(e),u=l.year?s(Yv):cg(2012),d=l.month?s(Zv):l.quarter?s(Xv):yh,f=l.week&&l.day?s(`day`,1,`weekday`):l.week?s(Qv,1):l.day?s(`day`,1):l.date?s($v,1):l.dayofyear?s(ey,1):bh,p=l.hours?s(ty):yh,m=l.minutes?s(ny):yh,h=l.seconds?s(ry):yh,g=l.milliseconds?s(iy):yh;return function(e){c.setTime(+e);let t=u(c);return i(t,d(c),f(c,t),p(c),m(c),h(c),g(c))}}function fse(e,t,n,r){let i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}function Iv(e,t,n){return t+e*7-(n+6)%7}function Lv(e,t){return Fv(e,t||1,ly,uy,use)}function Rv(e,t){return Fv(e,t||1,dy,fy,dse)}function zv(e){return py[e]}function Bv(e){return my[e]}function Vv(e,t,n){return e?e.offset(t,n):void 0}function Hv(e,t,n){return Vv(zv(e),t,n)}function Uv(e,t,n){return Vv(Bv(e),t,n)}function Wv(e,t,n,r){return e?e.range(t,n,r):void 0}function Gv(e,t,n,r){return Wv(zv(e),t,n,r)}function Kv(e,t,n,r){return Wv(Bv(e),t,n,r)}function qv(e){let t=e.extent,n=e.maxbins||40,r=Math.abs(wg(t))/n,i=zg(e=>e[2]).right(Ay,r),a,o;return i===Ay.length?(a=ky,o=Zg(t[0]/xy,t[1]/xy,n)):i?(i=Ay[r/Ay[i-1][2]{let n=t(e),r=new Date(n);return Number.isNaN(+r)&&V(`Invalid date: ${n}`),r}),a=Ny.findIndex(e=>!e.aligned(i,r)),o=Ny.findIndex(e=>!e.skippable&&!e.aligned(i,r)),s=o>a+1?o:a,{units:c,step:l}=Ny[s-1];return{units:c,step:l}}var Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y,vy,yy,by,xy,Sy,Cy,wy,Ty,Ey,Dy,Oy,ky,Ay,jy,My,Ny,Py=o((()=>{Ag(),xv(),r_(),Yv=`year`,Xv=`quarter`,Zv=`month`,Qv=`week`,$v=`date`,ey=`dayofyear`,ty=`hours`,ny=`minutes`,ry=`seconds`,iy=`milliseconds`,ay=[Yv,Xv,Zv,Qv,$v,`day`,ey,ty,ny,ry,iy],oy=ay.reduce((e,t,n)=>(e[t]=1+n,e),{}),sy={[Yv]:`%Y `,[Xv]:`Q%q `,[Zv]:`%b `,[$v]:`%d `,[Qv]:`W%U `,day:`%a `,[ey]:`%j `,[ty]:`%H:00`,[ny]:`00:%M`,[ry]:`:%S`,[iy]:`.%L`,[`${Yv}-${Zv}`]:`%Y-%m `,[`${Yv}-${Zv}-${$v}`]:`%Y-%m-%d `,[`${ty}-${ny}`]:`%H:%M`},cy=new Date,ly={[Yv]:e=>e.getFullYear(),[Xv]:e=>Math.floor(e.getMonth()/3),[Zv]:e=>e.getMonth(),[$v]:e=>e.getDate(),[ty]:e=>e.getHours(),[ny]:e=>e.getMinutes(),[ry]:e=>e.getSeconds(),[iy]:e=>e.getMilliseconds(),[ey]:e=>Dv(e),[Qv]:e=>Ov(e),weekday:(e,t)=>Iv(Ov(e),e.getDay(),kv(t)),day:(e,t)=>Iv(1,e.getDay(),kv(t))},uy={[Xv]:e=>3*e,[Qv]:(e,t)=>Iv(e,0,kv(t))},dy={[Yv]:e=>e.getUTCFullYear(),[Xv]:e=>Math.floor(e.getUTCMonth()/3),[Zv]:e=>e.getUTCMonth(),[$v]:e=>e.getUTCDate(),[ty]:e=>e.getUTCHours(),[ny]:e=>e.getUTCMinutes(),[ry]:e=>e.getUTCSeconds(),[iy]:e=>e.getUTCMilliseconds(),[ey]:e=>Mv(e),[Qv]:e=>Nv(e),day:(e,t)=>Iv(1,e.getUTCDay(),Pv(t)),weekday:(e,t)=>Iv(Nv(e),e.getUTCDay(),Pv(t))},fy={[Xv]:e=>3*e,[Qv]:(e,t)=>Iv(e,0,Pv(t))},py={[Yv]:pv,[Xv]:uv.every(3),[Zv]:uv,[Qv]:Y_,[$v]:U_,day:U_,[ey]:U_,[ty]:B_,[ny]:L_,[ry]:F_,[iy]:T_},my={[Yv]:mv,[Xv]:dv.every(3),[Zv]:dv,[Qv]:nv,[$v]:W_,day:W_,[ey]:W_,[ty]:V_,[ny]:R_,[ry]:F_,[iy]:T_},hy=1e3,gy=hy*60,_y=gy*60,vy=_y*24,yy=vy*7,by=vy*30,xy=vy*365,Sy=[Yv,Zv,$v,ty,ny,ry,iy],Cy=Sy.slice(0,-1),wy=Cy.slice(0,-1),Ty=wy.slice(0,-1),Ey=Ty.slice(0,-1),Dy=[Yv,Qv],Oy=[Yv,Zv],ky=[Yv],Ay=[[Cy,1,hy],[Cy,5,5*hy],[Cy,15,15*hy],[Cy,30,30*hy],[wy,1,gy],[wy,5,5*gy],[wy,15,15*gy],[wy,30,30*gy],[Ty,1,_y],[Ty,3,3*_y],[Ty,6,6*_y],[Ty,12,12*_y],[Ey,1,vy],[Dy,1,yy],[Oy,1,by],[Oy,3,3*by],[ky,1,xy]],jy={[Yv]:e=>e.getFullYear(),[Zv]:e=>e.getMonth(),[$v]:e=>e.getDate(),day:e=>e.getDay(),[ty]:e=>e.getHours(),[ny]:e=>e.getMinutes(),[ry]:e=>e.getSeconds(),[iy]:e=>e.getMilliseconds()},My={[Yv]:e=>e.getUTCFullYear(),[Zv]:e=>e.getUTCMonth(),[$v]:e=>e.getUTCDate(),day:e=>e.getUTCDay(),[ty]:e=>e.getUTCHours(),[ny]:e=>e.getUTCMinutes(),[ry]:e=>e.getUTCSeconds(),[iy]:e=>e.getUTCMilliseconds()},Ny=[{units:[Yv,Zv,$v,ty,ny,ry,iy],step:1,aligned:()=>!0},{units:[Yv,Zv,$v,ty,ny,ry],step:1,aligned:(e,t)=>e.every(e=>t[iy](e)===0)},{units:[Yv,Zv,$v,ty,ny],step:1,aligned:(e,t)=>e.every(e=>t[ry](e)===0)},{units:[Yv,Zv,$v,ty,ny],step:5,aligned:(e,t)=>e.every(e=>t[ny](e)%5==0)},{units:[Yv,Zv,$v,ty,ny],step:10,aligned:(e,t)=>e.every(e=>t[ny](e)%10==0)},{units:[Yv,Zv,$v,ty],step:1,aligned:(e,t)=>e.every(e=>t[ny](e)===0)},{units:[Yv,Zv,$v],step:1,aligned:(e,t)=>e.every(e=>t[ty](e)===0)},{units:[Yv,Qv],step:1,skippable:!0,aligned:(e,t)=>new Set(e.map(e=>t.day(e))).size===1},{units:[Yv,Zv],step:1,aligned:(e,t)=>e.every(e=>t[$v](e)===1)},{units:[Yv,Zv],step:3,aligned:(e,t)=>e.every(e=>t[Zv](e)%3==0)},{units:[Yv],step:1,aligned:(e,t)=>e.every(e=>t[Zv](e)===0)},{units:[Yv],step:10,aligned:(e,t)=>e.every(e=>t[Yv](e)%10==0)},{aligned:()=>!1}]}));function Fy(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Iy(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ly(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ry(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=By(i),u=Vy(i),d=By(a),f=Vy(a),p=By(o),m=Vy(o),h=By(s),g=Vy(s),_=By(c),v=Vy(c),y={a:ee,A:N,b:te,B:ne,c:null,d:Ky,e:Ky,f:Nse,g:Use,G:Gse,H:Ase,I:jse,j:Mse,L:qy,m:Pse,M:Fse,p:P,q:re,Q:$y,s:eb,S:Ise,u:Lse,U:Rse,V:zse,w:Bse,W:Vse,x:null,X:null,y:Hse,Y:Wse,Z:Kse,"%":Qy},b={a:F,A:ie,b:ae,B:oe,c:null,d:Yy,e:Yy,f:Xse,g:oce,G:cce,H:qse,I:Jse,j:Yse,L:Xy,m:Zse,M:Qse,p:se,q:ce,Q:$y,s:eb,S:$se,u:ece,U:tce,V:nce,w:rce,W:ice,x:null,X:null,y:ace,Y:sce,Z:lce,"%":Qy},x={a:E,A:D,b:O,B:k,c:A,d:Wy,e:Wy,f:Ese,g:Uy,G:Hy,H:Gy,I:Gy,j:Sse,L:Tse,m:xse,M:Cse,p:T,q:bse,Q:Ose,s:kse,S:wse,u:hse,U:gse,V:_se,w:mse,W:vse,x:j,X:M,y:Uy,Y:Hy,Z:yse,"%":Dse};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i53)return null;`w`in r||(r.w=1),`Z`in r?(a=Iy(Ly(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?rv.ceil(a):rv(a),a=W_.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Fy(Ly(r.y,0,1)),o=a.getDay(),a=o>4||o===0?X_.ceil(a):X_(a),a=U_.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Iy(Ly(r.y,0,1)).getUTCDay():Fy(Ly(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Iy(r)):Fy(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in tb?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function ee(e){return o[e.getDay()]}function N(e){return a[e.getDay()]}function te(e){return c[e.getMonth()]}function ne(e){return s[e.getMonth()]}function P(e){return i[+(e.getHours()>=12)]}function re(e){return 1+~~(e.getMonth()/3)}function F(e){return o[e.getUTCDay()]}function ie(e){return a[e.getUTCDay()]}function ae(e){return c[e.getUTCMonth()]}function oe(e){return s[e.getUTCMonth()]}function se(e){return i[+(e.getUTCHours()>=12)]}function ce(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}function zy(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a[e.toLowerCase(),t]))}function mse(e,t,n){var r=nb.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function hse(e,t,n){var r=nb.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gse(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function _se(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function vse(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Hy(e,t,n){var r=nb.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Uy(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function yse(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function bse(e,t,n){var r=nb.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function xse(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Wy(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Sse(e,t,n){var r=nb.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Gy(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Cse(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function wse(e,t,n){var r=nb.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Tse(e,t,n){var r=nb.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ese(e,t,n){var r=nb.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Dse(e,t,n){var r=rb.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ose(e,t,n){var r=nb.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function kse(e,t,n){var r=nb.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Ky(e,t){return zy(e.getDate(),t,2)}function Ase(e,t){return zy(e.getHours(),t,2)}function jse(e,t){return zy(e.getHours()%12||12,t,2)}function Mse(e,t){return zy(1+U_.count(pv(e),e),t,3)}function qy(e,t){return zy(e.getMilliseconds(),t,3)}function Nse(e,t){return qy(e,t)+`000`}function Pse(e,t){return zy(e.getMonth()+1,t,2)}function Fse(e,t){return zy(e.getMinutes(),t,2)}function Ise(e,t){return zy(e.getSeconds(),t,2)}function Lse(e){var t=e.getDay();return t===0?7:t}function Rse(e,t){return zy(Y_.count(pv(e)-1,e),t,2)}function Jy(e){var t=e.getDay();return t>=4||t===0?$_(e):$_.ceil(e)}function zse(e,t){return e=Jy(e),zy($_.count(pv(e),e)+(pv(e).getDay()===4),t,2)}function Bse(e){return e.getDay()}function Vse(e,t){return zy(X_.count(pv(e)-1,e),t,2)}function Hse(e,t){return zy(e.getFullYear()%100,t,2)}function Use(e,t){return e=Jy(e),zy(e.getFullYear()%100,t,2)}function Wse(e,t){return zy(e.getFullYear()%1e4,t,4)}function Gse(e,t){var n=e.getDay();return e=n>=4||n===0?$_(e):$_.ceil(e),zy(e.getFullYear()%1e4,t,4)}function Kse(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+zy(t/60|0,`0`,2)+zy(t%60,`0`,2)}function Yy(e,t){return zy(e.getUTCDate(),t,2)}function qse(e,t){return zy(e.getUTCHours(),t,2)}function Jse(e,t){return zy(e.getUTCHours()%12||12,t,2)}function Yse(e,t){return zy(1+W_.count(mv(e),e),t,3)}function Xy(e,t){return zy(e.getUTCMilliseconds(),t,3)}function Xse(e,t){return Xy(e,t)+`000`}function Zse(e,t){return zy(e.getUTCMonth()+1,t,2)}function Qse(e,t){return zy(e.getUTCMinutes(),t,2)}function $se(e,t){return zy(e.getUTCSeconds(),t,2)}function ece(e){var t=e.getUTCDay();return t===0?7:t}function tce(e,t){return zy(nv.count(mv(e)-1,e),t,2)}function Zy(e){var t=e.getUTCDay();return t>=4||t===0?ov(e):ov.ceil(e)}function nce(e,t){return e=Zy(e),zy(ov.count(mv(e),e)+(mv(e).getUTCDay()===4),t,2)}function rce(e){return e.getUTCDay()}function ice(e,t){return zy(rv.count(mv(e)-1,e),t,2)}function ace(e,t){return zy(e.getUTCFullYear()%100,t,2)}function oce(e,t){return e=Zy(e),zy(e.getUTCFullYear()%100,t,2)}function sce(e,t){return zy(e.getUTCFullYear()%1e4,t,4)}function cce(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ov(e):ov.ceil(e),zy(e.getUTCFullYear()%1e4,t,4)}function lce(){return`+0000`}function Qy(){return`%`}function $y(e){return+e}function eb(e){return Math.floor(e/1e3)}var tb,nb,rb,ib,ab=o((()=>{xv(),tb={"-":``,_:` `,0:`0`},nb=/^\s*\d+/,rb=/^%/,ib=/[\\^$*+?|[\]().{}]/g}));function uce(e){return ob=Ry(e),sb=ob.format,cb=ob.parse,lb=ob.utcFormat,ub=ob.utcParse,ob}var ob,sb,cb,lb,ub,dce=o((()=>{ab(),uce({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`]})})),db=o((()=>{dce(),ab()}));function fb(e){let t={};return n=>t[n]||(t[n]=e(n))}function fce(e,t){return n=>{let r=e(n),i=r.indexOf(t);if(i<0)return r;let a=pce(r,i),o=ai;)if(r[a]!==`0`){++a;break}return r.slice(0,a)+o}}function pce(e,t){let n=e.lastIndexOf(`e`),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function pb(e){let t=fb(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){let n=c_(e||`,`);if(n.precision==null){switch(n.precision=12,n.type){case`%`:n.precision-=2;break;case`e`:--n.precision;break}return fce(t(n),t(`.1f`)(1)[1])}else return t(n)},formatSpan(e,r,i,a){a=c_(a??`,f`);let o=Zg(e,r,i),s=Math.max(Math.abs(e),Math.abs(r)),c;if(a.precision==null)switch(a.type){case`s`:return isNaN(c=v_(o,s))||(a.precision=c),n(a,s);case``:case`e`:case`g`:case`p`:case`r`:isNaN(c=y_(o,s))||(a.precision=c-(a.type===`e`));break;case`f`:case`%`:isNaN(c=__(o))||(a.precision=c-(a.type===`%`)*2);break}return t(a)}}}function mb(){return wb=pb({format:h_,formatPrefix:g_})}function hb(e){return pb(nse(e))}function gb(e){return arguments.length?wb=hb(e):wb}function _b(e,t,n){n||={},Eh(n)||V(`Invalid time multi-format specifier: ${n}`);let r=t(ry),i=t(ny),a=t(ty),o=t($v),s=t(Qv),c=t(Zv),l=t(Xv),u=t(Yv),d=e(n.milliseconds||`.%L`),f=e(n.seconds||`:%S`),p=e(n.minutes||`%I:%M`),m=e(n.hours||`%I %p`),h=e(n.date||n.day||`%a %d`),g=e(n.week||`%b %d`),_=e(n.month||`%B`),v=e(n.quarter||`%B`),y=e(n.year||`%Y`);return e=>(r(e)xg(e)?t(e):_b(t,zv,e),utcFormat:e=>xg(e)?n(e):_b(n,Bv,e),timeParse:fb(e.parse),utcParse:fb(e.utcParse)}}function yb(){return Tb=vb({format:sb,parse:cb,utcFormat:lb,utcParse:ub})}function bb(e){return vb(Ry(e))}function xb(e){return arguments.length?Tb=bb(e):Tb}function Sb(e,t){let n=e?hb(e):gb(),r=t?bb(t):xb();return Eb(n,r)}function Cb(e,t){let n=arguments.length;return n&&n!==2&&V(`defaultLocale expects either zero or two arguments.`),n?Eb(gb(e),xb(t)):Eb(gb(),xb())}function mce(){return mb(),yb(),Cb()}var wb,Tb,Eb,Db=o((()=>{r_(),b_(),Py(),Ag(),db(),mb(),yb(),Eb=(e,t)=>ug({},e,t)}));function hce(e){return t=>({options:t||{},sanitize:_ce,load:gce,fileAccess:!1,file:vce(e),http:bce})}async function gce(e,t){let n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t?.http)}async function _ce(e,t){t=ug({},this.options,t);let n=this.fileAccess,r={href:null},i,a,o,s=Rb.test(e.replace(zb,``));(e==null||typeof e!=`string`||!s)&&V(`Sanitize failure, invalid URI: `+W(e));let c=Lb.test(e);return(o=t.baseURL)&&!c&&(!e.startsWith(`/`)&&!o.endsWith(`/`)&&(e=`/`+e),e=o+e),a=(i=e.startsWith(Bb))||t.mode===`file`||t.mode!==`http`&&!c&&n,i?e=e.slice(7):e.startsWith(`//`)&&(t.defaultProtocol===`file`?(e=e.slice(2),a=!0):e=(t.defaultProtocol||`http`)+`:`+e),Object.defineProperty(r,"localFile",{value:!!a}),r.href=e,t.target&&(r.target=t.target+``),t.rel&&(r.rel=t.rel+``),t.context===`image`&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+``),r}function vce(e){return e?t=>new Promise((n,r)=>{e.readFile(t,(e,t)=>{e?r(e):n(t)})}):yce}async function yce(){V(`No file system access.`)}async function bce(e,t){let n=ug({},this.options.http,t),r=t&&t.response,i=await fetch(e,n);return i.ok?ig(i[r])?i[r]():i.text():V(i.status+``+i.statusText)}function Ob(e,t){if(!e||!e.length)return`unknown`;let n=e.length,r=qb.length,i=qb.map((e,t)=>t+1);for(let a=0,o=0,s,c;ae===0?t:e,0)-1]}function kb(e,t){return t.reduce((t,n)=>(t[n]=Ob(e,n),t),{})}function Ab(e){let t=function(t,n){let r={delimiter:e};return jb(t,n?ug(n,r):r)};return t.responseType=`text`,t}function jb(e,t){return t.header&&(e=t.header.map(W).join(t.delimiter)+` -`+e),Oae(t.delimiter).parse(e+``)}function xce(e){return typeof Buffer==`function`&&ig(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Mb(e,t){let n=t&&t.property?hh(t.property):vh;return Eh(e)&&!xce(e)?Sce(n(e),t):n(JSON.parse(e))}function Sce(e,t){return!H(e)&&Xie(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}function Nb(e,t){let n,r,i,a;return e=Mb(e,t),t&&t.feature?(n=Lae,i=t.feature):t&&t.mesh?(n=Uae,i=t.mesh,a=Yb[t.filter]):V(`Missing TopoJSON feature or mesh parameter.`),r=(r=e.objects[i])?n(e,r,a):V(`Invalid TopoJSON object: `+i),r&&r.features||[r]}function Pb(e,t){return arguments.length>1?(Xb[e]=t,this):fg(Xb,e)?Xb[e]:null}function Fb(e){let t=Pb(e);return t&&t.responseType||`text`}function Ib(e,t,n,r){t||={};let i=Pb(t.type||`json`);return i||V(`Unknown data format type: `+t.type),e=i(e,t),t.parse&&Cce(e,t.parse,n,r),fg(e,`columns`)&&delete e.columns,e}function Cce(e,t,n,r){if(!e.length)return;let i=xb();n||=i.timeParse,r||=i.utcParse;let a=e.columns||Object.keys(e[0]),o,s,c,l,u,d;t===`auto`&&(t=kb(e,a)),a=Object.keys(t);let f=a.map(e=>{let i=t[e],a,o;if(i&&(i.startsWith(`date:`)||i.startsWith(`utc:`)))return a=i.split(/:(.+)?/,2),o=a[1],(o[0]===`'`&&o[o.length-1]===`'`||o[0]===`"`&&o[o.length-1]===`"`)&&(o=o.slice(1,-1)),(a[0]===`utc`?r:n)(o);if(!Kb[i])throw Error(`Illegal format pattern: `+e+`:`+i);return Kb[i]});for(c=0,u=e.length,d=a.length;c{Ag(),Aae(),qae(),Db(),Lb=/^(data:|([A-Za-z]+:)?\/\/)/,Rb=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,zb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Bb=`file://`,Vb=e=>e!=null&&e===e,Hb=e=>e===`true`||e===`false`||e===!0||e===!1,Ub=e=>!Number.isNaN(Date.parse(e)),Wb=e=>!Number.isNaN(+e)&&!(e instanceof Date),Gb=e=>Wb(e)&&Number.isInteger(+e),Kb={boolean:Tg,integer:Nh,number:Nh,date:Eg,string:Dg,unknown:vh},qb=[Hb,Gb,Wb,Ub],Jb=[`boolean`,`integer`,`number`,`date`],jb.responseType=`text`,Mb.responseType=`json`,Yb={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t},Nb.responseType=`json`,Xb={dsv:jb,csv:Ab(`,`),tsv:Ab(` `),json:Mb,topojson:Nb},Zb=hce(null)}));function $b(e){let t=e||vh,n=[],r={};return n.add=e=>{let i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{let i=t(e);if(r[i]){r[i]=0;let t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function ex(e,t){try{await t(e)}catch(t){e.error(t)}}function tx(e){return!!(e&&nx(e))}function nx(e){return e[Dx]}function rx(e,t){return e[Dx]=t,e}function ix(e){let t=e===Object(e)?e:{data:e};return nx(t)?t:rx(t,Ox++)}function ax(e){return ox(e,ix({}))}function ox(e,t){for(let n in e)t[n]=e[n];return t}function sx(e,t){return rx(t,nx(e))}function cx(e,t){return e?t?(n,r)=>e(n,r)||nx(t(n))-nx(t(r)):(t,n)=>e(t,n)||nx(t)-nx(n):null}function lx(e){return e&&e.constructor===ux}function ux(){let e=[],t=[],n=[],r=[],i=[],a=null,o=!1;return{constructor:ux,insert(t){let n=tg(t),r=n.length;for(let t=0;t{m(e)&&(l[nx(e)]=-1)});for(d=0,f=e.length;d0&&(_(h,m,p.value),s.modifies(m));for(d=0,f=i.length;d{m(e)&&l[nx(e)]>0&&_(e,p.field,p.value)}),s.modifies(p.field);if(o)s.mod=t.length||r.length?c.filter(e=>l[nx(e)]>0):c.slice();else for(g in u)s.mod.push(u[g]);return(a||a==null&&(t.length||r.length))&&s.clean(!0),s}}}function dx(){Object.defineProperty(this,kx,{writable:!0,value:{}})}function fx(e,t,n,r){this.id=++Ax,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,r)}function px(e){return function(t){let n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}function wce(e,t,n,r){let i=1,a;return e instanceof fx?a=e:e&&e.prototype instanceof fx?a=new e:ig(e)?a=new fx(null,e):(i=0,a=new fx(e,t)),this.rank(a),i&&(r=n,n=t),n&&this.connect(a,a.parameters(n,r)),this.touch(a),a}function Tce(e,t){let n=e.rank,r=t.length;for(let i=0;it=e);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}function Mce(e,t,n,r,i){return(e instanceof fx?Pce:Nce)(this,e,t,n,r,i),this}function Nce(e,t,n,r,i,a){let o=ug({},a,Ix),s,c;ig(n)||(n=cg(n)),r===void 0?s=t=>e.touch(n(t)):ig(r)?(c=new fx(null,r,i,!1),s=t=>{c.evaluate(t);let r=n(t),i=c.value;lx(i)?e.pulse(r,i,a):e.update(r,i,o)}):s=t=>e.update(n(t),r,o),t.apply(s)}function Pce(e,t,n,r,i,a){if(r===void 0)t.targets().add(n);else{let o=a||{},s=new fx(null,Fce(n,r),i,!1);s.modified(o.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}function Fce(e,t){return t=ig(t)?t:cg(t),e?function(n,r){let i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function Ice(e){e.rank=++this._rank}function Lce(e){let t=[e],n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&V(`Cycle detected in dataflow graph.`)}function gx(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function _x(e,t){let n=[];return kg(e,t,e=>n.push(e)),n}function vx(e,t){let n={};return e.visit(t,e=>{n[nx(e)]=1}),e=>n[nx(e)]?null:e}function yx(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function bx(e,t,n,r){let i=this,a=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(let e of n)if(e.stamp===t){if(e.fields){let t=i.fields||={};for(let n in e.fields)t[n]=1}e.changed(i.ADD)&&(a|=i.ADD),e.changed(i.REM)&&(a|=i.REM),e.changed(i.MOD)&&(a|=i.MOD)}this.changes=a}async function Rce(e,t,n){let r=this,i=[];if(r._pulse)return xx(r);if(r._pending&&await r._pending,t&&await ex(r,t),!r._touched.length)return r.debug(`Dataflow invoked, but nothing to do.`),r;let a=++r._clock;r._pulse=new gx(r,a,e),r._touched.forEach(e=>r._enqueue(e,!0)),r._touched=$b(_h);let o=0,s,c,l;try{for(;r._heap.size()>0;){if(s=r._heap.pop(),s.rank!==s.qrank){r._enqueue(s,!0);continue}c=s.run(r._getPulse(s,e)),c.then?c=await c:c.async&&(i.push(c.async),c=Lx),c!==Lx&&s._targets&&s._targets.forEach(e=>r._enqueue(e)),++o}}catch(e){r._heap.clear(),l=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${a}: ${o} operators`),l&&(r._postrun=[],r.error(l)),r._postrun.length){let e=r._postrun.sort((e,t)=>t.priority-e.priority);r._postrun=[];for(let t=0;tr.runAsync(null,()=>{e.forEach(e=>{try{e(r)}catch(e){r.error(e)}})})),r}async function zce(e,t,n){for(;this._running;)await this._running;let r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function Bce(e,t,n){return this._pulse?xx(this):(this.evaluate(e,t,n),this)}function Vce(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}}function xx(e){return e.error(`Dataflow already running. Use runAsync() to chain invocations.`),e}function Hce(e,t){let n=e.stampe.pulse),t):this._input[e.id]||Wce(this._pulse,n&&n.pulse)}function Wce(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Lx&&(e.source=t.source),e)}function Gce(e,t){let n=t||Jx;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function Kce(e,t,n){let r=n||Jx;return(e.set(t)||r.force)&&this.touch(e,r),this}function qce(e,t,n){this.touch(e,n||Jx);let r=new gx(this,this._clock+ +!this._pulse),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function Jce(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),Sx(t,0,t.length-1,e)),pop:()=>{let n=t.pop(),r;return t.length?(r=t[0],t[0]=n,Yce(t,0,e)):r=n,r}}}function Sx(e,t,n,r){let i,a,o=e[n];for(;n>t;){if(a=n-1>>1,i=e[a],r(o,i)<0){e[n]=i,n=a;continue}break}return e[n]=o}function Yce(e,t,n){let r=t,i=e.length,a=e[t],o=(t<<1)+1,s;for(;o=0&&(o=s),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=a,Sx(e,r,t,n)}function Cx(){this.logger(wh()),this.logLevel(1),this._clock=0,this._rank=0,this._locale=Cb();try{this._loader=Zb()}catch{}this._touched=$b(_h),this._input={},this._pulse=null,this._heap=Jce((e,t)=>e.qrank-t.qrank),this._postrun=[]}function wx(e){return function(){return this._log[e].apply(this,arguments)}}function G(e,t){fx.call(this,e,null,t)}function Tx(e){let t=Ex(e);return t&&t.Definition||null}function Ex(e){return e&&=e.toLowerCase(),fg(Yx,e)?Yx[e]:null}var Dx,Ox,kx,Ax,jx,Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx,Ux,Wx,Gx,Kx,qx,Jx,Yx,Xx=o((()=>{Ag(),Qb(),Db(),Dx=Symbol(`vega_id`),Ox=1,kx=`_:mod:_`,dx.prototype={set(e,t,n,r){let i=this,a=i[e],o=i[kx];return t!=null&&t>=0?(a[t]!==n||r)&&(a[t]=n,o[t+`:`+e]=-1,o[e]=-1):(a!==n||r)&&(i[e]=n,o[e]=H(n)?1+n.length:-1),i},modified(e,t){let n=this[kx];if(!arguments.length){for(let e in n)if(n[e])return!0;return!1}else if(H(e)){for(let t=0;t=0?t+1{o instanceof fx?(o!==this&&(t&&o.targets().add(this),a.push(o)),i.push({op:o,name:e,index:n})):r.set(e,n,o)};for(o in e)if(s=e[o],o===jx)tg(s).forEach(e=>{e instanceof fx?e!==this&&(e.targets().add(this),a.push(e)):V(`Pulse parameters must be operator instances.`)}),this.source=s;else if(H(s))for(r.set(o,-1,Array(c=s.length)),l=0;l{let n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){let t=hx();return this.targets().add(hx(null,null,lg(e,e=>{let n=e.dataflow;t.receive(e),n&&n.run&&n.run()}))),t},between(e,t){let n=!1;return e.targets().add(hx(null,null,()=>n=!0)),t.targets().add(hx(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=xh,this._targets=null}},Ix={skip:!0},Lx={},Rx=1,zx=2,Bx=4,Vx=3,Hx=5,Ux=7,Wx=8,Gx=16,Kx=32,qx=64,gx.prototype={StopPropagation:Lx,ADD:Rx,REM:zx,MOD:Bx,ADD_REM:Vx,ADD_MOD:Hx,ALL:Ux,REFLOW:Wx,SOURCE:Gx,NO_SOURCE:Kx,NO_FIELDS:qx,fork(e){return new gx(this.dataflow).init(this,e)},clone(){let e=this.fork(Ux);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&=e.source.slice(),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length?e:(e=new gx(this.dataflow).init(this),e.add=e.source,e.rem=[],e)},init(e,t){let n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&qx)&&(n.fields=e.fields),t&Rx?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&zx?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Bx?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&Kx?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){let t=e||Ux;return t&Rx&&this.add.length||t&zx&&this.rem.length||t&Bx&&this.mod.length},reflow(e){if(e)return this.fork(Ux).reflow();let t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Bx,vx(this,Rx))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){let t=this.fields||={};return H(e)?e.forEach(e=>t[e]=!0):t[e]=!0,this},modified(e,t){let n=this.fields;return(t||this.mod.length)&&n?arguments.length?H(e)?e.some(e=>n[e]):n[e]:!!n:!1},filter(e,t){let n=this;return e&Rx&&(n.addF=yx(n.addF,t)),e&zx&&(n.remF=yx(n.remF,t)),e&Bx&&(n.modF=yx(n.modF,t)),e&Gx&&(n.srcF=yx(n.srcF,t)),n},materialize(e){e||=Ux;let t=this;return e&Rx&&t.addF&&(t.add=_x(t.add,t.addF),t.addF=null),e&zx&&t.remF&&(t.rem=_x(t.rem,t.remF),t.remF=null),e&Bx&&t.modF&&(t.mod=_x(t.mod,t.modF),t.modF=null),e&Gx&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){let n=this,r=t;if(e&Gx)return kg(n.source,n.srcF,r),n;e&Rx&&kg(n.add,n.addF,r),e&zx&&kg(n.rem,n.remF,r),e&Bx&&kg(n.mod,n.modF,r);let i=n.source;if(e&Wx&&i){let e=n.add.length+n.mod.length;e===i.length||(e?kg(i,vx(n,Hx),r):kg(i,n.srcF,r))}return n}},U(bx,gx,{fork(e){let t=new gx(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,e=>t.add.push(e)),e&t.REM&&this.visit(t.REM,e=>t.rem.push(e)),e&t.MOD&&this.visit(t.MOD,e=>t.mod.push(e))),t},changed(e){return this.changes&e},modified(e){let t=this,n=t.fields;return n&&t.changes&t.MOD?H(e)?e.some(e=>n[e]):n[e]:0},filter(){V(`MultiPulse does not support filtering.`)},materialize(){V(`MultiPulse does not support materialization.`)},visit(e,t){let n=this,r=n.pulses,i=r.length,a=0;if(e&n.SOURCE)for(;athis.pulse=e):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){let t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}}),Yx={}}));function*Zx(e,t){if(t==null)for(let t of e)t!=null&&t!==``&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==``&&(r=+r)>=r&&(yield r)}}function Qx(e,t,n){let r=Float64Array.from(Zx(e,n));return r.sort(Lg),t.map(e=>Coe(r,e))}function $x(e,t){return Qx(e,[.25,.5,.75],t)}function eS(e,t){let n=e.length,r=ioe(e,t),i=$x(e,t),a=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,a)||r||Math.abs(i[0])||1)*n**-.2}function tS(e){let t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2],a=e.extent[0],o=e.extent[1],s,c,l,u,d,f,p=e.span||o-a||Math.abs(a)||1;if(e.step)s=e.step;else if(e.steps){for(u=p/t,d=0,f=e.steps.length;dt;)s*=n;for(d=0,f=i.length;d=l&&p/u<=t&&(s=u)}u=Math.log(s);let m=n**(-(u>=0?0:~~(-u/r)+1)-1);return(e.nice||e.nice===void 0)&&(u=Math.floor(a/s+m)*s,a=ae);let i=e.length,a=new Float64Array(i),o=0,s=1,c=r(e[0]),l=c,u=c+t,d;for(;s=u){for(l=(c+l)/2;o>1);oi;)e[o--]=e[r]}r=i,i=a}return e}function Qce(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function $ce(e,t){t??(t=e,e=0);let n,r,i,a={min(e){return arguments.length?(n=e||0,i=r-n,a):n},max(e){return arguments.length?(r=e||0,i=r-n,a):r},sample(){return n+Math.floor(i*PS())},pdf(e){return e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf(e){return e>=0&&e<=1?n-1+Math.floor(e*i):NaN}};return a.min(e).max(t)}function iS(e,t){e||=0,t??=1;let n=0,r=0,i,a;if(LS===LS)n=LS,LS=NaN;else{do n=PS()*2-1,r=PS()*2-1,i=n*n+r*r;while(i===0||i>1);a=Math.sqrt(-2*Math.log(i)/i),n*=a,LS=r*a}return e+n*t}function aS(e,t,n){n??=1;let r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*FS)}function oS(e,t,n){t||=0,n??=1;let r=(e-t)/n,i=Math.abs(r),a;if(i>37)a=0;else{let e=Math.exp(-i*i/2),t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,a=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,a/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,a=e/t/2.506628274631)}return r>0?1-a:a}function sS(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*IS*ele(2*e-1)}function ele(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=1.0512122733215323e-9+n*t,n=-4.112633980346984e-9+n*t,n=-2.9070369957882005e-8+n*t,n=4.2347877827932404e-7+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=2.2137376921775787e-9,n=9.075656193888539e-8+n*t,n=-2.7517406297064545e-7+n*t,n=1.8239629214389228e-8+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=1.5076572693500548e-9+n*t,n=-3.789465440126737e-9+n*t,n=7.61570120807834e-9+n*t,n=-1.496002662714924e-8+n*t,n=2.914795345090108e-8+n*t,n=-6.771199775845234e-8+n*t,n=2.2900482228026655e-7+n*t,n=-9.9298272942317e-7+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function cS(e,t){let n,r,i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=e??1,i):r},sample:()=>iS(n,r),pdf:e=>aS(e,n,r),cdf:e=>oS(e,n,r),icdf:e=>sS(e,n,r)};return i.mean(e).stdev(t)}function lS(e,t){let n=cS(),r=0,i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(t=n,!t&&e&&(t=eS(e)),i):t},sample(){return e[~~(PS()*r)]+t*n.sample()},pdf(i){let a=0,o=0;for(;ouS(n,r),pdf:e=>dS(e,n,r),cdf:e=>fS(e,n,r),icdf:e=>pS(e,n,r)};return i.mean(e).stdev(t)}function hS(e,t){let n=0,r;function i(e){let t=[],r=0,i;for(i=0;i=t&&e<=n?1/(n-t):0}function vS(e,t,n){return n??(n=t??1,t=0),en?1:(e-t)/(n-t)}function yS(e,t,n){return n??(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function bS(e,t){let n,r,i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=e??1,i):r},sample:()=>gS(n,r),pdf:e=>_S(e,n,r),cdf:e=>vS(e,n,r),icdf:e=>yS(e,n,r)};return t??(t=e??1,e=0),i.min(e).max(t)}function xS(e,t,n){let r=0,i=0;for(let a of e){let e=n(a);t(a)==null||e==null||isNaN(e)||(r+=(e-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function SS(e,t,n,r){let i=r-e*e,a=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-a*e,a]}function CS(e,t,n,r){e=e.filter(e=>{let r=t(e),i=n(e);return r!=null&&(r=+r)>=r&&i!=null&&(i=+i)>=i}),r&&e.sort((e,n)=>t(e)-t(n));let i=e.length,a=new Float64Array(i),o=new Float64Array(i),s=0,c=0,l=0,u,d,f;for(f of e)a[s]=u=+t(f),o[s]=d=+n(f),++s,c+=(u-c)/s,l+=(d-l)/s;for(s=0;s=a&&o!=null&&(o=+o)>=o&&r(a,o,++i)}function TS(e,t,n,r,i){let a=0,o=0;return wS(e,t,n,(e,t)=>{let n=t-i(e),s=t-r;a+=n*n,o+=s*s}),1-a/o}function ES(e,t,n){let r=0,i=0,a=0,o=0,s=0;wS(e,t,n,(e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,a+=(e*t-a)/s,o+=(e*e-o)/s});let c=SS(r,i,a,o),l=e=>c[0]+c[1]*e;return{coef:c,predict:l,rSquared:TS(e,t,n,i,l)}}function DS(e,t,n){let r=0,i=0,a=0,o=0,s=0;wS(e,t,n,(e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,a+=(e*t-a)/s,o+=(e*e-o)/s});let c=SS(r,i,a,o),l=e=>c[0]+c[1]*Math.log(e);return{coef:c,predict:l,rSquared:TS(e,t,n,i,l)}}function OS(e,t,n){let[r,i,a,o]=CS(e,t,n),s=0,c=0,l=0,u=0,d=0,f,p,m;wS(e,t,n,(e,t)=>{f=r[d++],p=Math.log(t),m=f*t,s+=(t*p-s)/d,c+=(m-c)/d,l+=(m*p-l)/d,u+=(f*m-u)/d});let[h,g]=SS(c/o,s/o,l/o,u/o),_=e=>Math.exp(h+g*(e-a));return{coef:[Math.exp(h-g*a),g],predict:_,rSquared:TS(e,t,n,o,_)}}function kS(e,t,n){let r=0,i=0,a=0,o=0,s=0,c=0;wS(e,t,n,(e,t)=>{let n=Math.log(e),l=Math.log(t);++c,r+=(n-r)/c,i+=(l-i)/c,a+=(n*l-a)/c,o+=(n*n-o)/c,s+=(t-s)/c});let l=SS(r,i,a,o),u=e=>l[0]*e**+l[1];return l[0]=Math.exp(l[0]),{coef:l,predict:u,rSquared:TS(e,t,n,s,u)}}function AS(e,t,n){let[r,i,a,o]=CS(e,t,n),s=r.length,c=0,l=0,u=0,d=0,f=0,p,m,h,g;for(p=0;p(e-=a,y*e*e+b*e+x+o);return{coef:[x-b*a+y*a*a+o,b-2*y*a,y],predict:S,rSquared:TS(e,t,n,o,S)}}function jS(e,t,n,r){if(r===0)return xS(e,t,n);if(r===1)return ES(e,t,n);if(r===2)return AS(e,t,n);let[i,a,o,s]=CS(e,t,n),c=i.length,l=[],u=[],d=r+1,f,p,m,h,g;for(f=0;f{e-=o;let t=s+_[0]+_[1]*e+_[2]*e*e;for(f=3;f=0;--a)for(s=t[a],c=1,i[a]+=s,o=1;o<=a;++o)c*=(a+1-o)/o,i[a-o]+=s*n**+o*c;return i[0]+=r,i}function nle(e){let t=e.length-1,n=[],r,i,a,o,s;for(r=0;rMath.abs(e[r][o])&&(o=i);for(a=r;a=r;a--)e[a][i]-=e[a][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,a=i+1;ai[o]-n?r:o,c=0,l=0,p=0,m=0,h=0,g=1/Math.abs(i[s]-n||1);for(let e=r;e<=o;++e){let t=i[e],r=a[e],o=rle(Math.abs(n-t)*g)*f[e],s=t*o;c+=o,l+=s,p+=r*o,m+=r*s,h+=t*s}let[_,v]=SS(l/c,p/c,m/c,h/c);u[e]=_+v*n,d[e]=Math.abs(a[e]-u[e]),ile(i,e+1,t)}if(e===RS)break;let n=Doe(d);if(Math.abs(n)=1?zS:(r=1-t*t)*r}return ale(i,u,o,s)}function rle(e){return(e=1-e*e*e)*e*e}function ile(e,t,n){let r=e[t],i=n[0],a=n[1]+1;if(!(a>=e.length))for(;t>i&&e[a]-r<=r-e[i];)n[0]=++i,n[1]=a,++a}function ale(e,t,n,r){let i=e.length,a=[],o=0,s=0,c=[],l;for(;o[t,e(t)],a=t[0],o=t[1],s=o-a,c=s/r,l=[i(a)],u=[];if(n===r){for(let e=1;e0;)u.push(i(a+e/n*s))}let d=l[0],f=u[u.length-1],p=1/s,m=ole(d[1],u);for(;f;){let e=i((d[0]+f[0])/2);e[0]-d[0]>=c&&sle(d,e,f,p,m)>BS?u.push(e):(d=f,l.push(f),u.pop()),f=u[u.length-1]}return l}function ole(e,t){let n=e,r=e,i=t.length;for(let e=0;er&&(r=i)}return 1/(r-n)}function sle(e,t,n,r,i){let a=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),o=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(a-o)}var PS,FS,IS,LS,RS,zS,BS,VS=o((()=>{r_(),PS=Math.random,FS=Math.sqrt(2*Math.PI),IS=Math.SQRT2,LS=NaN,RS=2,zS=1e-12,BS=.5*Math.PI/180})),cle=c({aggregate:()=>JS,bin:()=>YS,collect:()=>ZS,compare:()=>QS,countpattern:()=>$S,cross:()=>eC,density:()=>nC,dotbin:()=>aC,expression:()=>oC,extent:()=>sC,facet:()=>lC,field:()=>uC,filter:()=>dC,flatten:()=>fC,fold:()=>pC,formula:()=>mC,generate:()=>hC,impute:()=>gC,joinaggregate:()=>_C,kde:()=>vC,key:()=>yC,load:()=>bC,lookup:()=>SC,multiextent:()=>CC,multivalues:()=>wC,params:()=>TC,pivot:()=>EC,prefacet:()=>DC,project:()=>OC,proxy:()=>kC,quantile:()=>AC,relay:()=>jC,sample:()=>MC,sequence:()=>NC,sieve:()=>PC,subflow:()=>cC,timeunit:()=>FC,tupleindex:()=>IC,values:()=>LC,window:()=>zC});function lle(e){return t=>{let n=e.length,r=1,i=String(e[0](t));for(;rug({name:e,aggregate_param:r,out:n||e},HC,t)}function WS(e,t,n){return UC[e](n,t)}function GS(e,t){return e.idx-t.idx}function dle(e){let t={};e.forEach(e=>t[e.name]=e);let n=e=>{e.req&&e.req.forEach(e=>{t[e]||n(t[e]=UC[e]())})};return e.forEach(n),Object.values(t).sort(GS)}function fle(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function ple(e,t){if(e==null||e===``){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function mle(e,t){if(e==null||e===``){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function hle(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function KS(e,t){let n=t||vh,r=dle(e),i=e.slice().sort(GS);function a(e){this._ops=r,this._out=i,this.cell=e,this.init()}return a.prototype.init=fle,a.prototype.add=ple,a.prototype.rem=mle,a.prototype.set=hle,a.prototype.get=n,a.fields=e.map(e=>e.out),a}function qS(e){this._key=e?hh(e):nx,this.reset()}function JS(e){G.call(this,null,e),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}function YS(e){G.call(this,null,e)}function XS(e,t,n){let r=e,i=t||[],a=n||[],o={},s=0;return{add:e=>a.push(e),remove:e=>o[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&=(i=i.filter(e=>!o[r(e)]),o={},0),t&&e&&i.sort(e),a.length&&(i=e?cae(e,i,a.sort(e)):i.concat(a),a=[]),i)}}function ZS(e){G.call(this,[],e)}function QS(e){fx.call(this,null,gle,e)}function gle(e){return this.value&&!e.modified()?this.value:og(e.fields,e.orders)}function $S(e){G.call(this,null,e)}function _le(e,t,n){switch(t){case`upper`:e=e.toUpperCase();break;case`lower`:e=e.toLowerCase();break}return e.match(n)}function eC(e){G.call(this,null,e)}function vle(e,t,n,r){for(var i=[],a={},o=e.length,s=0,c,l;stC(e,t))):typeof r[n]===YC&&r[n](e[n]);return r}function nC(e){G.call(this,null,e)}function yle(e){return()=>e.materialize(e.SOURCE).source}function rC(e,t){return e?e.map((e,n)=>t[n]||ah(e)):null}function iC(e,t,n){let r=[],i=e=>e(c),a,o,s,c,l,u;if(t==null)r.push(e.map(n));else for(a={},o=0,s=e.length;ot(n,e),oh(t),ah(t))}function sC(e){G.call(this,[void 0,void 0],e)}function cC(e,t){fx.call(this,e),this.parent=t,this.count=0}function lC(e){G.call(this,{},e),this._keys=mg();let t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nhh(e)):hh(e.name,e.as)}function dC(e){G.call(this,mg(),e)}function fC(e){G.call(this,[],e)}function pC(e){G.call(this,[],e)}function mC(e){G.call(this,null,e)}function hC(e){G.call(this,[],e)}function gC(e){G.call(this,[],e)}function Sle(e){var t=e.method||tw.value,n;if(tw[t]==null)V(`Unrecognized imputation method: `+t);else if(t===tw.value)return n=e.value===void 0?0:e.value,()=>n;else return tw[t]}function Cle(e){let t=e.field;return e=>e?t(e):NaN}function wle(e,t,n,r){var i=e=>e(g),a=[],o=r?r.slice():[],s={},c={},l,u,d,f,p,m,h,g;for(o.forEach((e,t)=>s[e]=t+1),f=0,h=e.length;fi&&(i=o[1]);return[r,i]}function wC(e){fx.call(this,null,Ole,e)}function Ole(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function TC(e){G.call(this,null,e)}function EC(e){JS.call(this,e)}function kle(e,t){let n=e.field,r=e.value,i=(e.op===`count`?`__count__`:e.op)||`sum`,a=oh(n).concat(oh(r)),o=jle(n,e.limit||0,t);return t.changed()&&e.set(`__pivot__`,null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>i),fields:o.map(e=>Ale(e,n,r,a)),as:o.map(e=>e+``),modified:e.modified.bind(e)}}function Ale(e,t,n,r){return ih(r=>t(r)===e?n(r):NaN,r,e+``)}function jle(e,t,n){let r={},i=[];return n.visit(n.SOURCE,t=>{let n=e(t);r[n]||(r[n]=1,i.push(n))}),i.sort(sg),t?i.slice(0,t):i}function DC(e){lC.call(this,e)}function OC(e){G.call(this,null,e)}function Mle(e,t,n,r){for(let i=0,a=n.length;ic[e]=1)}p(e.sort),t.forEach((e,t)=>{let c=n[t],m=r[t],h=i[t]||null,g=ah(c),_=US(e,g,a[t]);if(p(c),o.push(_),fg(aw,e))s.push(Nle(e,c,m,_));else{if(c==null&&e!==`count`&&V(`Null aggregate field specified.`),e===`count`){u.push(_);return}f=!1;let t=l[g];t||(t=l[g]=[],t.field=c,d.push(t)),t.push(WS(e,h,_))}}),(u.length||d.length)&&(this.cell=Fle(d,u,f)),this.inputs=Object.keys(c)}function Fle(e,t,n){e=e.map(e=>KS(e,e.field));let r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,a=r.agg=Array(i),o=0;on?n:e}function Lle(e,t,n,r){e.p0=e.i0,e.p1=e.i1;let i=t[0]==null?0:n+t[0],a=t[1]==null?r:n+t[1]+1;e.i0=BC(i,0,r),e.i1=BC(a,0,r),e.index=n}function Rle(e,t){let n=e.i0,r=e.i1-1,i=e.compare,a=e.data,o=a.length-1;n>0&&!i(a[n],a[n-1])&&(e.i0=t.left(a,a[n])),r{Ag(),Xx(),VS(),r_(),Py(),VC=()=>{},HC={init:VC,add:VC,rem:VC,idx:0},UC={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:[`mean`],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?Math.max(0,e.dev)/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:[`mean`],idx:1},variancep:{value:e=>e.valid?Math.max(0,e.dev)/e.valid:void 0,req:[`variance`],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(Math.max(0,e.dev)/(e.valid-1)):void 0,req:[`variance`],idx:2},stdevp:{value:e=>e.valid?Math.sqrt(Math.max(0,e.dev)/e.valid):void 0,req:[`variance`],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(Math.max(0,e.dev)/(e.valid*(e.valid-1))):void 0,req:[`variance`],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:[`values`],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:[`values`],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:[`values`],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:[`values`],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:[`values`],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:[`values`],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:[`values`],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:[`values`],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:[`min`,`values`],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:[`max`,`values`],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:[`exponential`],idx:1}},WC=Object.keys(UC).filter(e=>e!==`__count__`),[...WC,`__count__`].forEach(e=>{UC[e]=ule(e,UC[e])}),GC=qS.prototype,GC.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},GC.add=function(e){this._add.push(e)},GC.rem=function(e){this._rem.push(e)},GC.values=function(){if(this._get=null,this._rem.length===0)return this._add;let e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,a=Array(r-i),o={},s,c,l;for(s=0;s=0;)a=e(t[r])+``,fg(n,a)||(n[a]=1,++i);return i},GC.extent=function(e){if(this._get!==e||!this._ext){let t=this.values(),n=Vie(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},GC.argmin=function(e){return this.extent(e)[0]||{}},GC.argmax=function(e){return this.extent(e)[1]||{}},GC.min=function(e){let t=this.extent(e)[0];return t==null?void 0:e(t)},GC.max=function(e){let t=this.extent(e)[1];return t==null?void 0:e(t)},GC.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=$x(this.values(),e),this._get=e),this._q},GC.q1=function(e){return this.quartile(e)[0]},GC.q2=function(e){return this.quartile(e)[1]},GC.q3=function(e){return this.quartile(e)[2]},GC.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=nS(this.values(),1e3,.05,e),this._get=e),this._ci},GC.ci0=function(e){return this.ci(e)[0]},GC.ci1=function(e){return this.ci(e)[1]},JS.Definition={type:`Aggregate`,metadata:{generates:!0,changes:!0},params:[{name:`groupby`,type:`field`,array:!0},{name:`ops`,type:`enum`,array:!0,values:WC},{name:`aggregate_params`,type:`number`,null:!0,array:!0},{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`}]},U(JS,G,{transform(e,t){let n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,e=>n.add(e))):(n.value=n.value||n.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){let e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function a(e){let t,a,o,s;for(t in e)for(o=e[t].tuple,a=0;a{let t=ah(e);return i(e),n.push(t),t}),this.cellkey=e.key?e.key:HS(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];let a=e.fields||[null],o=e.ops||[`count`],s=e.aggregate_params||[null],c=e.as||[],l=a.length,u={},d,f,p,m,h,g,_;for(l!==o.length&&V(`Unmatched number of fields and aggregate ops.`),_=0;_KS(e,e.field)),Object.create(null)},cellkey:HS(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{let t=r(e);e[s]=t,e[c]=t==null?null:i+a*(1+(t-i)/a)}:e=>e[s]=r(e)),t.modifies(n?o:s)},_bins(e){if(this.value&&!e.modified())return this.value;let t=e.field,n=tS(e),r=n.step,i=n.start,a=i+Math.ceil((n.stop-i)/r)*r,o,s;(o=e.anchor)!=null&&(s=o-(i+r*Math.floor((o-i)/r)),i+=s,a+=s);let c=function(e){let n=Nh(t(e));return n==null?null:na?1/0:(n=Math.max(i,Math.min(n,a-r)),i+r*Math.floor(KC+(n-i)/r))};return c.start=i,c.stop=a,c.step=r,this.value=ih(c,oh(t),e.name||`bin_`+ah(t))}}),ZS.Definition={type:`Collect`,metadata:{source:!0},params:[{name:`sort`,type:`compare`}]},U(ZS,G,{transform(e,t){let n=t.fork(t.ALL),r=XS(nx,this.value,n.materialize(n.ADD).add),i=e.sort,a=t.changed()||i&&(e.modified(`sort`)||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(a),this.value=n.source=r.data(cx(i),a),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),U(QS,fx),$S.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`]}]},U($S,G,{transform(e,t){let n=t=>n=>{for(var r=_le(s(n),e.case,a)||[],i,c=0,l=r.length;ci[e]=1+(i[e]||0)),u=n(e=>--i[e]);return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,u)),this._finish(t,c)},_parameterCheck(e,t){let n=!1;return(e.modified(`stopwords`)||!this._stop)&&(this._stop=RegExp(`^`+(e.stopwords||``)+`$`,`i`),n=!0),(e.modified(`pattern`)||!this._match)&&(this._match=new RegExp(e.pattern||`[\\w']+`,`g`),n=!0),(e.modified(`field`)||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){let n=this._counts,r=this._tuples||={},i=t[0],a=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS),s,c,l;for(s in n)c=r[s],l=n[s]||0,!c&&l?(r[s]=c=ix({}),c[i]=s,c[a]=l,o.add.push(c)):l===0?(c&&o.rem.push(c),n[s]=null,r[s]=null):c[a]!==l&&(c[a]=l,o.mod.push(c));return o.modifies(t)}}),eC.Definition={type:`Cross`,metadata:{generates:!0},params:[{name:`filter`,type:`expr`},{name:`as`,type:`string`,array:!0,length:2,default:[`a`,`b`]}]},U(eC,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.as||[`a`,`b`],i=r[0],a=r[1],o=!this.value||t.changed(t.ADD_REM)||e.modified(`as`)||e.modified(`filter`),s=this.value;return o?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=vle(s,i,a,e.filter||xh)):n.mod=s,n.source=this.value,n.modifies(r)}}),qC={kde:lS,mixture:hS,normal:cS,lognormal:mS,uniform:bS},JC=`distributions`,YC=`function`,XC=`field`,ZC=[{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}]}],QC={key:{function:`mixture`},params:[{name:`distributions`,type:`param`,array:!0,params:ZC},{name:`weights`,type:`number`,array:!0}]},nC.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:ZC.concat(QC)},{name:`as`,type:`string`,array:!0,default:[`value`,`density`]}]},U(nC,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=tC(e.distribution,yle(t)),i=e.steps||e.minsteps||25,a=e.steps||e.maxsteps||200,o=e.method||`pdf`;o!==`pdf`&&o!==`cdf`&&V(`Invalid density method: `+o),!e.extent&&!r.data&&V(`Missing density extent parameter.`),o=r[o];let s=e.as||[`value`,`density`],c=e.extent||dg(r.data()),l=NS(o,c,i,a).map(e=>{let t={};return t[s[0]]=e[0],t[s[1]]=e[1],ix(t)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}}),$C=`bin`,aC.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:$C}]},ew=(e,t)=>wg(dg(e,t))/30,U(aC,G,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;let n=t.materialize(t.SOURCE).source,r=iC(t.source,e.groupby,vh),i=e.smooth||!1,a=e.field,o=e.step||ew(n,a),s=cx((e,t)=>a(e)-a(t)),c=e.as||$C,l=r.length,u=1/0,d=-1/0,f=0,p;for(;fd&&(d=t),e[++p][c]=t}return this.value={start:u,stop:d,step:o},t.reflow(!0).modifies(c)}}),U(oC,fx),sC.Definition={type:`Extent`,metadata:{},params:[{name:`field`,type:`field`,required:!0}]},U(sC,G,{transform(e,t){let n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified(`field`),a=n[0],o=n[1];if((i||a==null)&&(a=1/0,o=-1/0),t.visit(i?t.SOURCE:t.ADD,e=>{let t=Nh(r(e));t!=null&&(to&&(o=t))}),!Number.isFinite(a)||!Number.isFinite(o)){let e=ah(r);e&&=` for field "${e}"`,t.dataflow.warn(`Infinite extent${e}: [${a}, ${o}]`),a=o=void 0}this.value=[a,o]}}),U(cC,fx,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){--this.count,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),U(lC,G,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){let i=this.value,a=fg(i,e)&&i[e],o,s;return a?a.value.stampe&&e.count>0);this.initTargets(e)}},initTargets(e){let t=this._targets,n=t.length,r=e?e.length:0,i=0;for(;ithis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,e=>{let t=nx(e),n=a.get(t);n!==void 0&&(a.delete(t),s(n).rem(e))}),t.visit(t.ADD,e=>{let t=r(e);a.set(nx(e),t),s(t).add(e)}),o||t.modified(r.fields)?t.visit(t.MOD,e=>{let t=nx(e),n=a.get(t),i=r(e);n===i?s(i).mod(e):(a.set(t,i),s(n).rem(e),s(i).add(e))}):t.changed(t.MOD)&&t.visit(t.MOD,e=>{s(a.get(nx(e))).mod(e)}),o&&t.visit(t.REFLOW,e=>{let t=nx(e),n=a.get(t),i=r(e);n!==i&&(a.set(t,i),s(n).rem(e),s(i).add(e))}),t.clean()?n.runAfter(()=>{this.clean(),a.clean()}):a.empty>n.cleanThreshold&&n.runAfter(a.clean),t}}),U(uC,fx),dC.Definition={type:`Filter`,metadata:{changes:!0},params:[{name:`expr`,type:`expr`,required:!0}]},U(dC,G,{transform(e,t){let n=t.dataflow,r=this.value,i=t.fork(),a=i.add,o=i.rem,s=i.mod,c=e.expr,l=!0;t.visit(t.REM,e=>{let t=nx(e);r.has(t)?r.delete(t):o.push(e)}),t.visit(t.ADD,t=>{c(t,e)?a.push(t):r.set(nx(t),1)});function u(t){let n=nx(t),i=c(t,e),u=r.get(n);i&&u?(r.delete(n),a.push(t)):!i&&!u?(r.set(n,1),o.push(t)):l&&i&&!u&&s.push(t)}return t.visit(t.MOD,u),e.modified()&&(l=!1,t.visit(t.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),fC.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}]},U(fC,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.fields,i=rC(r,e.as||[]),a=e.index||null,o=i.length;return n.rem=this.value,t.visit(t.SOURCE,e=>{let t=r.map(t=>t(e)),s=t.reduce((e,t)=>Math.max(e,t.length),0),c=0,l,u;for(;c{for(let t=0,a;tt[r]=n(t,e))}}),U(hC,G,{transform(e,t){let n=t.fork(t.ALL),r=e.generator,i=this.value,a=e.size-i.length,o,s,c;if(a>0){for(o=[];--a>=0;)o.push(c=ix(r(e))),i.push(c);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else s=i.slice(0,-a),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(s):s,i=i.slice(-a);return n.source=this.value=i,n}}),tw={value:`value`,median:Doe,mean:Toe,min:$g,max:Qg},nw=[],gC.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}]},U(gC,G,{transform(e,t){var n=t.fork(t.ALL),r=Sle(e),i=Cle(e),a=ah(e.field),o=ah(e.key),s=(e.groupby||[]).map(ah),c=wle(t.source,e.groupby,e.key,e.keyvals),l=[],u=this.value,d=c.domain.length,f,p,m,h,g,_,v,y,b,x;for(g=0,y=c.length;gn.add(e))):(i=n.value=n.value||this.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),n.changes(),t.visit(t.SOURCE,e=>{ug(e,i[n.cellkey(e)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){let e=this._adds,t=this._mods,n,r;for(n=0,r=this._alen;n{let n=lS(t,o)[s],r=e.counts?t.length:1;NS(n,u||dg(t),d,f).forEach(e=>{let n={};for(let e=0;e(this._pending=tg(e.data),e=>e.touch(this)))}:n.request(e.url,e.format).then(e=>xC(this,t,tg(e.data)))}}),SC.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}]},U(SC,G,{transform(e,t){let n=e.fields,r=e.index,i=e.values,a=e.default==null?null:e.default,o=e.modified(),s=n.length,c=o?t.SOURCE:t.ADD,l=t,u=e.as,d,f,p;return i?(f=i.length,s>1&&!u&&V(`Multi-field lookup requires explicit "as" parameter.`),u&&u.length!==s*f&&V(`The "as" parameter has too few output field names.`),u||=i.map(ah),d=function(e){for(var t=0,o=0,c,l;tt.modified(e.fields)),c|=p?t.MOD:0),t.visit(c,d),l.modifies(u)}}),U(CC,fx),U(wC,fx),U(TC,G,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),EC.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:WC,default:`sum`},{name:`limit`,type:`number`,default:0},{name:`key`,type:`field`}]},U(EC,JS,{_transform:JS.prototype.transform,transform(e,t){return this._transform(kle(e,t),t)}}),U(DC,lC,{transform(e,t){let n=e.subflow,r=e.field,i=e=>this.subflow(nx(e),n,t,e);return(e.modified(`field`)||r&&t.modified(oh(r)))&&V(`PreFacet does not support field modification.`),this.initTargets(),r?(t.visit(t.MOD,e=>{let t=i(e);r(e).forEach(e=>t.mod(e))}),t.visit(t.ADD,e=>{let t=i(e);r(e).forEach(e=>t.add(ix(e)))}),t.visit(t.REM,e=>{let t=i(e);r(e).forEach(e=>t.rem(e))})):(t.visit(t.MOD,e=>i(e).mod(e)),t.visit(t.ADD,e=>i(e).add(e)),t.visit(t.REM,e=>i(e).rem(e))),t.clean()&&t.runAfter(()=>this.clean()),t}}),OC.Definition={type:`Project`,metadata:{generates:!0,changes:!0},params:[{name:`fields`,type:`field`,array:!0},{name:`as`,type:`string`,null:!0,array:!0}]},U(OC,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.fields,i=rC(e.fields,e.as||[]),a=r?(e,t)=>Mle(e,t,r,i):ox,o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,e=>{let t=nx(e);n.rem.push(o[t]),o[t]=null}),t.visit(t.ADD,e=>{let t=a(e,ix({}));o[nx(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(a(e,o[nx(e)]))}),n}}),U(kC,G,{transform(e,t){return this.value=e.value,e.modified(`value`)?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),AC.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`]}]},rw=1e-14,U(AC,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||[`prob`,`value`];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;let i=t.materialize(t.SOURCE).source,a=iC(i,e.groupby,e.field),o=(e.groupby||[]).map(ah),s=[],c=e.step||.01,l=e.probs||n_(c/2,1-rw,c),u=l.length;return a.forEach(e=>{let t=Qx(e,l);for(let n=0;n{let t=nx(e);n.rem.push(r[t]),r[t]=null}),t.visit(t.ADD,e=>{let t=ax(e);r[nx(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{let t=r[nx(e)];for(let r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)})),n}}),MC.Definition={type:`Sample`,metadata:{},params:[{name:`size`,type:`number`,default:1e3}]},U(MC,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.modified(`size`),i=e.size,a=this.value.reduce((e,t)=>(e[nx(t)]=1,e),{}),o=this.value,s=this.count,c=0;function l(e){let t,r;o.length=c&&(t=o[r],a[nx(t)]&&n.rem.push(t),o[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,e=>{let t=nx(e);a[t]&&(a[t]=-1,n.rem.push(e)),--s}),o=o.filter(e=>a[nx(e)]!==-1)),(t.rem.length||r)&&o.length{a[nx(e)]||l(e)}),c=-1),r&&o.length>i){let e=o.length-i;for(let t=0;t{a[nx(e)]&&n.mod.push(e)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||c<0)&&(n.add=o.filter(e=>!a[nx(e)])),this.count=s,this.value=n.source=o,n}}),NC.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`}]},U(NC,G,{transform(e,t){if(this.value&&!e.modified())return;let n=t.materialize().fork(t.MOD),r=e.as||`data`;return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=n_(e.start,e.stop,e.step||1).map(e=>{let t={};return t[r]=e,ix(t)}),n.add=t.add.concat(this.value),n}}),U(PC,G,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),iw=[`unit0`,`unit1`],FC.Definition={type:`TimeUnit`,metadata:{modifies:!0},params:[{name:`field`,type:`field`,required:!0},{name:`interval`,type:`boolean`,default:!0},{name:`units`,type:`enum`,values:ay,array:!0},{name:`step`,type:`number`,default:1},{name:`maxbins`,type:`number`,default:40},{name:`extent`,type:`date`,array:!0},{name:`inferUnits`,type:`boolean`,default:!1},{name:`timezone`,type:`enum`,default:`local`,values:[`local`,`utc`]},{name:`as`,type:`string`,array:!0,length:2,default:iw}]},U(FC,G,{transform(e,t){let n=e.field,r=e.interval!==!1,i=e.timezone===`utc`,a=this._floor(e,t),o=(i?Bv:zv)(a.unit).offset,s=e.as||iw,c=s[0],l=s[1],u=a.step,d=a.start||1/0,f=a.stop||-1/0,p=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(oh(n)))&&(t=t.reflow(!0),p=t.SOURCE,d=1/0,f=-1/0),t.visit(p,e=>{let t=n(e),i,s;t==null?(e[c]=null,r&&(e[l]=null)):(e[c]=i=s=a(t),r&&(e[l]=s=o(i,u)),if&&(f=s))}),a.start=d,a.stop=f,t.modifies(r?s:c)},_floor(e,t){let n=e.timezone===`utc`;e.inferUnits&&(e.units||e.step!=null||e.maxbins!=null||e.extent)&&t.dataflow.warn(`TimeUnit inferUnits overrides units, step, maxbins and extent.`);let{units:r,step:i}=e.inferUnits?Jv(t.materialize(t.SOURCE).source,e.field,n):e.units?{units:e.units,step:e.step||1}:qv({extent:e.extent||dg(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),a=Sv(r),o=this.value||{},s=(n?Rv:Lv)(a,i);return s.unit=jh(a),s.units=a,s.step=i,s.start=o.start,s.stop=o.stop,this.value=s}}),U(IC,G,{transform(e,t){let n=t.dataflow,r=e.field,i=this.value,a=e=>i.set(r(e),e),o=!0;return e.modified(`field`)||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,a)):t.changed()?(t.visit(t.REM,e=>i.delete(r(e))),t.visit(t.ADD,a)):o=!1,this.modified(o),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),U(LC,G,{transform(e,t){(!this.value||e.modified(`field`)||e.modified(`sort`)||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(cx(e.sort)):t.source).map(e.field))}}),aw={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{let n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{let n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){let e=aw.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{let n=t.data,r=t.compare,i=t.index;if(e0||V(`ntile num must be greater than zero.`);let n=aw.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{let r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{let r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||V(`nth_value nth must be greater than zero.`),{next:n=>{let r=n.i0+(t-1);return rt=null,next:n=>{let r=e(n.data[n.index]);return r==null?t:t=r}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{let i=r.data;return r.index<=n?t:(n=Ple(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}},ow=Object.keys(aw),sw=RC.prototype,sw.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},sw.update=function(e,t){let n=this.cell,r=this.windows,i=e.data,a=r&&r.length,o;if(n){for(o=e.p0;othis.group(i(e)),o=this.state;(!o||n)&&(o=this.state=new RC(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,e=>a(e).add(e))):(t.visit(t.REM,e=>a(e).remove(e)),t.visit(t.ADD,e=>a(e).add(e)));for(let t=0,n=this._mlen;t{}));function Ble(e){return e>1?0:e<-1?vw:Math.acos(e)}function uw(e){return e>=1?yw:e<=-1?-yw:Math.asin(e)}var dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw=o((()=>{dw=Math.abs,fw=Math.atan2,pw=Math.cos,mw=Math.max,hw=Math.min,gw=Math.sin,_w=Math.sqrt,vw=Math.PI,yw=vw/2,bw=2*vw}));function Sw(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return Sw;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t{ww=Math.PI,Tw=2*ww,Ew=1e-6,Dw=Tw-Ew,Ow=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Sw:Vle(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Ew)if(!(Math.abs(u*s-c*l)>Ew)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((ww-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Ew&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Ew||Math.abs(this._y1-l)>Ew)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Tw+Tw),d>Dw?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Ew&&this._append`A${n},${n},0,${+(d>=ww)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}},Cw.prototype=Ow.prototype})),kw=o((()=>{Hle()}));function Aw(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Ow(t)}var jw=o((()=>{kw()}));function Ule(e){return e.innerRadius}function Wle(e){return e.outerRadius}function Gle(e){return e.startAngle}function Kle(e){return e.endAngle}function qle(e){return e&&e.padAngle}function Jle(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function Mw(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/_w(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*_w(mw(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function Yle(){var e=Ule,t=Wle,n=cw(0),r=null,i=Gle,a=Kle,o=qle,s=null,c=Aw(l);function l(){var l,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-yw,m=a.apply(this,arguments)-yw,h=dw(m-p),g=m>p;if(s||=l=c(),f1e-12))s.moveTo(0,0);else if(h>bw-1e-12)s.moveTo(f*pw(p),f*gw(p)),s.arc(0,0,f,p,m,!g),d>1e-12&&(s.moveTo(d*pw(m),d*gw(m)),s.arc(0,0,d,m,p,g));else{var _=p,v=m,y=p,b=m,x=h,S=h,C=o.apply(this,arguments)/2,w=C>1e-12&&(r?+r.apply(this,arguments):_w(d*d+f*f)),T=hw(dw(f-d)/2,+n.apply(this,arguments)),E=T,D=T,O,k;if(w>1e-12){var A=uw(w/d*gw(C)),j=uw(w/f*gw(C));(x-=A*2)>1e-12?(A*=g?1:-1,y+=A,b-=A):(x=0,y=b=(p+m)/2),(S-=j*2)>1e-12?(j*=g?1:-1,_+=j,v-=j):(S=0,_=v=(p+m)/2)}var M=f*pw(_),ee=f*gw(_),N=d*pw(b),te=d*gw(b);if(T>1e-12){var ne=f*pw(v),P=f*gw(v),re=d*pw(y),F=d*gw(y),ie;if(h1e-12?D>1e-12?(O=Mw(re,F,M,ee,f,D,g),k=Mw(ne,P,N,te,f,D,g),s.moveTo(O.cx+O.x01,O.cy+O.y01),D1e-12)||!(x>1e-12)?s.lineTo(N,te):E>1e-12?(O=Mw(N,te,ne,P,d,-E,g),k=Mw(M,ee,re,F,d,-E,g),s.lineTo(O.cx+O.x01,O.cy+O.y01),E{lw(),xw(),jw()}));function Nw(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}var Pw=o((()=>{Array.prototype.slice}));function Fw(e){this._context=e}function Iw(e){return new Fw(e)}var Lw=o((()=>{Fw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}}));function Rw(e){return e[0]}function zw(e){return e[1]}var Bw=o((()=>{}));function Vw(e,t){var n=cw(!0),r=null,i=Iw,a=null,o=Aw(s);e=typeof e==`function`?e:e===void 0?Rw:cw(e),t=typeof t==`function`?t:t===void 0?zw:cw(t);function s(s){var c,l=(s=Nw(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c{Pw(),lw(),Lw(),jw(),Bw()}));function Uw(e,t,n){var r=null,i=cw(!0),a=null,o=Iw,s=null,c=Aw(l);e=typeof e==`function`?e:e===void 0?Rw:cw(+e),t=typeof t==`function`?t:cw(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?zw:cw(+n);function l(l){var u,d,f,p=(l=Nw(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Vw().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:cw(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:cw(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:cw(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:cw(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:cw(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:cw(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:cw(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Zle=o((()=>{Pw(),lw(),Lw(),Hw(),jw(),Bw()})),Ww,Gw=o((()=>{xw(),Ww={draw(e,t){let n=_w(t/vw);e.moveTo(n,0),e.arc(0,0,n,0,bw)}}}));function Qle(e,t){let n=null,r=Aw(i);e=typeof e==`function`?e:cw(e||Ww),t=typeof t==`function`?t:cw(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:cw(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:cw(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}var $le=o((()=>{lw(),jw(),Gw()}));function Kw(){}var qw=o((()=>{}));function Jw(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Yw(e){this._context=e}function eue(e){return new Yw(e)}var Xw=o((()=>{Yw.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:Jw(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Jw(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function Zw(e){this._context=e}function tue(e){return new Zw(e)}var nue=o((()=>{qw(),Xw(),Zw.prototype={areaStart:Kw,areaEnd:Kw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Jw(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function Qw(e){this._context=e}function rue(e){return new Qw(e)}var iue=o((()=>{Xw(),Qw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Jw(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function $w(e,t){this._basis=new Yw(e),this._beta=t}var eT,aue=o((()=>{Xw(),$w.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},eT=(function e(t){function n(e){return t===1?new Yw(e):new $w(e,t)}return n.beta=function(t){return e(+t)},n})(.85)}));function tT(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function nT(e,t){this._context=e,this._k=(1-t)/6}var rT,iT=o((()=>{nT.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:tT(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:tT(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},rT=(function e(t){function n(e){return new nT(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function aT(e,t){this._context=e,this._k=(1-t)/6}var oT,sT=o((()=>{qw(),iT(),aT.prototype={areaStart:Kw,areaEnd:Kw,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:tT(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},oT=(function e(t){function n(e){return new aT(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function cT(e,t){this._context=e,this._k=(1-t)/6}var lT,uT=o((()=>{iT(),cT.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:tT(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},lT=(function e(t){function n(e){return new cT(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function dT(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function fT(e,t){this._context=e,this._alpha=t}var pT,mT=o((()=>{xw(),iT(),fT.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:dT(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},pT=(function e(t){function n(e){return t?new fT(e,t):new nT(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function hT(e,t){this._context=e,this._alpha=t}var gT,oue=o((()=>{sT(),qw(),mT(),hT.prototype={areaStart:Kw,areaEnd:Kw,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:dT(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},gT=(function e(t){function n(e){return t?new hT(e,t):new aT(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function _T(e,t){this._context=e,this._alpha=t}var vT,sue=o((()=>{uT(),mT(),_T.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+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:dT(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},vT=(function e(t){function n(e){return t?new _T(e,t):new cT(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function yT(e){this._context=e}function cue(e){return new yT(e)}var lue=o((()=>{qw(),yT.prototype={areaStart:Kw,areaEnd:Kw,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}}));function bT(e){return e<0?-1:1}function xT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(bT(a)+bT(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ST(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function CT(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function wT(e){this._context=e}function TT(e){this._context=new ET(e)}function ET(e){this._context=e}function uue(e){return new wT(e)}function due(e){return new TT(e)}var fue=o((()=>{wT.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:CT(this,this._t0,ST(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,CT(this,ST(this,n=xT(this,e,t)),n);break;default:CT(this,this._t0,n=xT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(TT.prototype=Object.create(wT.prototype)).point=function(e,t){wT.prototype.point.call(this,t,e)},ET.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}}}));function DT(e){this._context=e}function OT(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t{DT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=OT(e),i=OT(t),a=0,o=1;o{kT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}}})),yue=o((()=>{Xle(),Zle(),Hw(),Pw(),lw(),xw(),Lw(),jw(),$le(),Gw(),nue(),iue(),Xw(),aue(),sT(),uT(),iT(),oue(),sue(),mT(),lue(),fue(),mue(),vue()}));function AT(e,t){if(typeof document<`u`&&document.createElement){let n=document.createElement(`canvas`);if(n&&n.getContext)return n.width=e,n.height=t,n}return null}var jT,MT=o((()=>{jT=()=>typeof Image<`u`?Image:null}));function NT(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function PT(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}var FT=o((()=>{}));function IT(){var e=new Gg,t=[],n=[],r=LT;function i(i){let a=e.get(i);if(a===void 0){if(r!==LT)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Gg;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return IT(t,n).unknown(r)},NT.apply(i,arguments),i}var LT,bue=o((()=>{r_(),FT(),LT=Symbol(`implicit`)}));function RT(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zT(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}var BT=o((()=>{}));function VT(){}function HT(){return this.rgb().formatHex()}function xue(){return this.rgb().formatHex8()}function Sue(){return nE(this).formatHsl()}function UT(){return this.rgb().formatRgb()}function WT(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=pE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GT(t):n===3?new YT(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?KT(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?KT(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mE.exec(e))?new YT(t[1],t[2],t[3],1):(t=hE.exec(e))?new YT(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gE.exec(e))?KT(t[1],t[2],t[3],t[4]):(t=_E.exec(e))?KT(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vE.exec(e))?tE(t[1],t[2]/100,t[3]/100,1):(t=yE.exec(e))?tE(t[1],t[2]/100,t[3]/100,t[4]):bE.hasOwnProperty(e)?GT(bE[e]):e===`transparent`?new YT(NaN,NaN,NaN,0):null}function GT(e){return new YT(e>>16&255,e>>8&255,e&255,1)}function KT(e,t,n,r){return r<=0&&(e=t=n=NaN),new YT(e,t,n,r)}function qT(e){return e instanceof VT||(e=WT(e)),e?(e=e.rgb(),new YT(e.r,e.g,e.b,e.opacity)):new YT}function JT(e,t,n,r){return arguments.length===1?qT(e):new YT(e,t,n,r??1)}function YT(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function XT(){return`#${eE(this.r)}${eE(this.g)}${eE(this.b)}`}function Cue(){return`#${eE(this.r)}${eE(this.g)}${eE(this.b)}${eE((isNaN(this.opacity)?1:this.opacity)*255)}`}function ZT(){let e=QT(this.opacity);return`${e===1?`rgb(`:`rgba(`}${$T(this.r)}, ${$T(this.g)}, ${$T(this.b)}${e===1?`)`:`, ${e})`}`}function QT(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $T(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function eE(e){return e=$T(e),(e<16?`0`:``)+e.toString(16)}function tE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new iE(e,t,n,r)}function nE(e){if(e instanceof iE)return new iE(e.h,e.s,e.l,e.opacity);if(e instanceof VT||(e=WT(e)),!e)return new iE;if(e instanceof iE)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&c<1?0:o,new iE(o,s,c,e.opacity)}function rE(e,t,n,r){return arguments.length===1?nE(e):new iE(e,t,n,r??1)}function iE(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function aE(e){return e=(e||0)%360,e<0?e+360:e}function oE(e){return Math.max(0,Math.min(1,e||0))}function sE(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var cE,lE,uE,dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE=o((()=>{BT(),cE=.7,lE=1/cE,uE=`\\s*([+-]?\\d+)\\s*`,dE=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,fE=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,pE=/^#([0-9a-f]{3,8})$/,mE=RegExp(`^rgb\\(${uE},${uE},${uE}\\)$`),hE=RegExp(`^rgb\\(${fE},${fE},${fE}\\)$`),gE=RegExp(`^rgba\\(${uE},${uE},${uE},${dE}\\)$`),_E=RegExp(`^rgba\\(${fE},${fE},${fE},${dE}\\)$`),vE=RegExp(`^hsl\\(${dE},${fE},${fE}\\)$`),yE=RegExp(`^hsla\\(${dE},${fE},${fE},${dE}\\)$`),bE={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},RT(VT,WT,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:HT,formatHex:HT,formatHex8:xue,formatHsl:Sue,formatRgb:UT,toString:UT}),RT(YT,JT,zT(VT,{brighter(e){return e=e==null?lE:lE**+e,new YT(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cE:cE**+e,new YT(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new YT($T(this.r),$T(this.g),$T(this.b),QT(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:XT,formatHex:XT,formatHex8:Cue,formatRgb:ZT,toString:ZT})),RT(iE,rE,zT(VT,{brighter(e){return e=e==null?lE:lE**+e,new iE(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cE:cE**+e,new iE(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new YT(sE(e>=240?e-240:e+120,i,r),sE(e,i,r),sE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new iE(aE(this.h),oE(this.s),oE(this.l),QT(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(){let e=QT(this.opacity);return`${e===1?`hsl(`:`hsla(`}${aE(this.h)}, ${oE(this.s)*100}%, ${oE(this.l)*100}%${e===1?`)`:`, ${e})`}`}}))})),SE,CE,wE=o((()=>{SE=Math.PI/180,CE=180/Math.PI}));function TE(e){if(e instanceof DE)return new DE(e.l,e.a,e.b,e.opacity);if(e instanceof NE)return PE(e);e instanceof YT||(e=qT(e));var t=jE(e.r),n=jE(e.g),r=jE(e.b),i=OE((.2225045*t+.7168786*n+.0606169*r)/LE),a,o;return t===n&&n===r?a=o=i:(a=OE((.4360747*t+.3850649*n+.1430804*r)/IE),o=OE((.0139322*t+.0971045*n+.7141733*r)/RE)),new DE(116*i-16,500*(a-i),200*(i-o),e.opacity)}function EE(e,t,n,r){return arguments.length===1?TE(e):new DE(e,t,n,r??1)}function DE(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function OE(e){return e>HE?e**(1/3):e/VE+zE}function kE(e){return e>BE?e*e*e:VE*(e-zE)}function AE(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function jE(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function wue(e){if(e instanceof NE)return new NE(e.h,e.c,e.l,e.opacity);if(e instanceof DE||(e=TE(e)),e.a===0&&e.b===0)return new NE(NaN,0{BT(),xE(),wE(),FE=18,IE=.96422,LE=1,RE=.82521,zE=4/29,BE=6/29,VE=3*BE*BE,HE=BE*BE*BE,RT(DE,EE,zT(VT,{brighter(e){return new DE(this.l+FE*(e??1),this.a,this.b,this.opacity)},darker(e){return new DE(this.l-FE*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=IE*kE(t),e=LE*kE(e),n=RE*kE(n),new YT(AE(3.1338561*t-1.6168667*e-.4906146*n),AE(-.9787684*t+1.9161415*e+.033454*n),AE(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),RT(NE,ME,zT(VT,{brighter(e){return new NE(this.h,this.c,this.l+FE*(e??1),this.opacity)},darker(e){return new NE(this.h,this.c,this.l-FE*(e??1),this.opacity)},rgb(){return PE(this).rgb()}}))}));function Eue(e){if(e instanceof WE)return new WE(e.h,e.s,e.l,e.opacity);e instanceof YT||(e=qT(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(QE*r+XE*t-ZE*n)/(QE+XE-ZE),a=r-i,o=(YE*(n-i)-qE*a)/JE,s=Math.sqrt(o*o+a*a)/(YE*i*(1-i)),c=s?Math.atan2(o,a)*CE-120:NaN;return new WE(c<0?c+360:c,s,i,e.opacity)}function UE(e,t,n,r){return arguments.length===1?Eue(e):new WE(e,t,n,r??1)}function WE(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}var GE,KE,qE,JE,YE,XE,ZE,QE,Due=o((()=>{BT(),xE(),wE(),GE=-.14861,KE=1.78277,qE=-.29227,JE=-.90649,YE=1.97294,XE=YE*JE,ZE=YE*KE,QE=KE*qE-JE*GE,RT(WE,UE,zT(VT,{brighter(e){return e=e==null?lE:lE**+e,new WE(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cE:cE**+e,new WE(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*SE,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new YT(255*(t+n*(GE*r+KE*i)),255*(t+n*(qE*r+JE*i)),255*(t+YE*r*n),this.opacity)}}))})),$E=o((()=>{xE(),Tue(),Due()}));function eD(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function tD(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r{}));function Oue(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],a=e[r%t],o=e[(r+1)%t],s=e[(r+2)%t];return eD((n-r/t)*t,i,a,o,s)}}var kue=o((()=>{nD()})),rD,Aue=o((()=>{rD=e=>()=>e}));function jue(e,t){return function(n){return e+n*t}}function Mue(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function iD(e,t){var n=t-e;return n?jue(e,n>180||n<-180?n-360*Math.round(n/360):n):rD(isNaN(e)?t:e)}function Nue(e){return(e=+e)==1?aD:function(t,n){return n-t?Mue(t,n,e):rD(isNaN(t)?n:t)}}function aD(e,t){var n=t-e;return n?jue(e,n):rD(isNaN(e)?t:e)}var oD=o((()=>{Aue()}));function Pue(e){return function(t){var n=t.length,r=Array(n),i=Array(n),a=Array(n),o,s;for(o=0;o{$E(),nD(),kue(),oD(),sD=(function e(t){var n=Nue(t);function r(e,t){var r=n((e=JT(e)).r,(t=JT(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=aD(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1),Fue=Pue(tD),Iue=Pue(Oue)}));function cD(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i{}));function zue(e,t){return(Rue(t)?cD:Bue)(e,t)}function Bue(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o{hD(),lD()}));function Hue(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}var Uue=o((()=>{}));function uD(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var dD=o((()=>{}));function Wue(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=mD(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Gue=o((()=>{hD()}));function Kue(e){return function(){return e}}function que(e){return function(t){return e(t)+``}}function Jue(e,t){var n=fD.lastIndex=pD.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=fD.exec(e))&&(i=pD.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:uD(r,i)})),n=pD.lastIndex;return n{dD(),fD=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pD=new RegExp(fD.source,`g`)}));function mD(e,t){var n=typeof t,r;return t==null||n===`boolean`?rD(t):(n===`number`?uD:n===`string`?(r=WT(t))?(t=r,sD):Jue:t instanceof WT?sD:t instanceof Date?Hue:Rue(t)?cD:Array.isArray(t)?Bue:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Wue:uD)(e,t)}var hD=o((()=>{$E(),Lue(),Vue(),Uue(),dD(),Gue(),Yue(),Aue(),lD()}));function Xue(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Zue=o((()=>{}));function Que(e,t){var n=iD(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var $ue=o((()=>{oD()}));function gD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var ede=o((()=>{}));function tde(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r{_D=180/Math.PI,vD={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}));function rde(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?vD:tde(t.a,t.b,t.c,t.d,t.e,t.f)}function ide(e){return e==null||(yD||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),yD.setAttribute(`transform`,e),!(e=yD.transform.baseVal.consolidate()))?vD:(e=e.matrix,tde(e.a,e.b,e.c,e.d,e.e,e.f))}var yD,ade=o((()=>{nde()}));function ode(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:uD(e,i)},{i:c-2,x:uD(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:uD(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:uD(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:uD(e,n)},{i:s-2,x:uD(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t{dD(),ade(),sde=ode(rde,`px, `,`px)`,`deg)`),cde=ode(ide,`, `,`)`,`)`)}));function ude(e){return((e=Math.exp(e))+1/e)/2}function dde(e){return((e=Math.exp(e))-1/e)/2}function fde(e){return((e=Math.exp(2*e))-1)/(e+1)}var pde,mde,hde=o((()=>{pde=1e-12,mde=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p{$E(),oD(),_de=gde(iD),vde=gde(aD)}));function bde(e,t){var n=aD((e=EE(e)).l,(t=EE(t)).l),r=aD(e.a,t.a),i=aD(e.b,t.b),a=aD(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}var xde=o((()=>{$E(),oD()}));function Sde(e){return function(t,n){var r=e((t=ME(t)).h,(n=ME(n)).h),i=aD(t.c,n.c),a=aD(t.l,n.l),o=aD(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Cde,wde,Tde=o((()=>{$E(),oD(),Cde=Sde(iD),wde=Sde(aD)}));function Ede(e){return(function t(n){n=+n;function r(t,r){var i=e((t=UE(t)).h,(r=UE(r)).h),a=aD(t.s,r.s),o=aD(t.l,r.l),s=aD(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}var Dde,Ode,kde=o((()=>{$E(),oD(),Dde=Ede(iD),Ode=Ede(aD)}));function bD(e,t){t===void 0&&(t=e,e=mD);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n{hD()}));function jde(e,t){for(var n=Array(t),r=0;r{})),Nde=c({interpolate:()=>mD,interpolateArray:()=>zue,interpolateBasis:()=>tD,interpolateBasisClosed:()=>Oue,interpolateCubehelix:()=>Dde,interpolateCubehelixLong:()=>Ode,interpolateDate:()=>Hue,interpolateDiscrete:()=>Xue,interpolateHcl:()=>Cde,interpolateHclLong:()=>wde,interpolateHsl:()=>_de,interpolateHslLong:()=>vde,interpolateHue:()=>Que,interpolateLab:()=>bde,interpolateNumber:()=>uD,interpolateNumberArray:()=>cD,interpolateObject:()=>Wue,interpolateRgb:()=>sD,interpolateRgbBasis:()=>Fue,interpolateRgbBasisClosed:()=>Iue,interpolateRound:()=>gD,interpolateString:()=>Jue,interpolateTransformCss:()=>sde,interpolateTransformSvg:()=>cde,interpolateZoom:()=>mde,piecewise:()=>bD,quantize:()=>jde}),xD=o((()=>{hD(),Vue(),nD(),kue(),Uue(),Zue(),$ue(),dD(),lD(),Gue(),ede(),Yue(),lde(),hde(),Lue(),yde(),xde(),Tde(),kde(),Ade(),Mde()}));function Pde(e){return function(){return e}}var Fde=o((()=>{}));function SD(e){return+e}var CD=o((()=>{}));function wD(e){return e}function TD(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Pde(isNaN(t)?NaN:.5)}function Ide(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Lde(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?Rde:Lde,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),uD))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,SD),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=gD,u()},d.clamp=function(e){return arguments.length?(o=e?!0:wD,u()):o!==wD},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function zde(){return DD()(wD,wD)}var OD,kD=o((()=>{r_(),xD(),Fde(),CD(),OD=[0,1]}));function Bde(e,t,n,r){var i=Zg(e,t,n),a;switch(r=c_(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=v_(i,o))&&(r.precision=a),g_(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=y_(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=__(i))&&(r.precision=a-(r.type===`%`)*2);break}return h_(r)}var Vde=o((()=>{r_(),b_()}));function AD(e){var t=e.domain;return e.ticks=function(e){var n=t();return Yg(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Bde(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s0;){if(l=Xg(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Hde(){var e=zde();return e.copy=function(){return ED(e,Hde())},NT.apply(e,arguments),AD(e)}var jD=o((()=>{r_(),kD(),FT(),Vde()}));function Ude(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,SD),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Ude(e).unknown(t)},e=arguments.length?Array.from(e,SD):[0,1],AD(n)}var Wde=o((()=>{jD(),CD()}));function Gde(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a{}));function qde(e){return Math.log(e)}function Jde(e){return Math.exp(e)}function Yde(e){return-Math.log(-e)}function Xde(e){return-Math.exp(-e)}function Zde(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function Qde(e){return e===10?Zde:e===Math.E?Math.exp:t=>e**+t}function $de(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function efe(e){return(t,n)=>-e(-t,n)}function MD(e){let t=e(qde,Jde),n=t.domain,r=10,i,a;function o(){return i=$de(r),a=Qde(r),n()[0]<0?(i=efe(i),a=efe(a),e(Yde,Xde)):e(qde,Jde),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s0){for(;l<=u;++l)for(d=1;ds)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(fs)break;m.push(f)}m.length*2{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=c_(n)).precision==null&&(n.trim=!0),n=h_(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*rn(Gde(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function tfe(){let e=MD(DD()).domain([1,10]);return e.copy=()=>ED(e,tfe()).base(e.base()),NT.apply(e,arguments),e}var ND=o((()=>{r_(),b_(),Kde(),kD(),FT()}));function nfe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function rfe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function PD(e){var t=1,n=e(nfe(t),rfe(t));return n.constant=function(n){return arguments.length?e(nfe(t=+n),rfe(t)):t},AD(n)}function ife(){var e=PD(DD());return e.copy=function(){return ED(e,ife()).constant(e.constant())},NT.apply(e,arguments)}var FD=o((()=>{jD(),kD(),FT()}));function afe(e){return function(t){return t<0?-((-t)**+e):t**+e}}function ofe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function sfe(e){return e<0?-e*e:e*e}function ID(e){var t=e(wD,wD),n=1;function r(){return n===1?e(wD,wD):n===.5?e(ofe,sfe):e(afe(n),afe(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},AD(t)}function LD(){var e=ID(DD());return e.copy=function(){return ED(e,LD()).exponent(e.exponent())},NT.apply(e,arguments),e}function cfe(){return LD.apply(null,arguments).exponent(.5)}var RD=o((()=>{jD(),kD(),FT()}));function lfe(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r0?n[i-1]:e[0],i{r_(),FT()}));function dfe(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[Vg(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return dfe().domain([e,t]).range(i).unknown(a)},NT.apply(AD(o),arguments)}var ffe=o((()=>{r_(),jD(),FT()}));function pfe(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[Vg(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return pfe().domain(e).range(t).unknown(n)},NT.apply(i,arguments)}var mfe=o((()=>{r_(),FT()}));function hfe(e){return new Date(e)}function gfe(e){return e instanceof Date?+e:+new Date(+e)}function zD(e,t,n,r,i,a,o,s,c,l){var u=zde(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e){xv(),db(),kD(),FT(),Kde()}));function yfe(){return NT.apply(zD(_v,vv,mv,dv,nv,W_,V_,R_,F_,lb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var bfe=o((()=>{xv(),db(),vfe(),FT()}));function BD(){var e=0,t=1,n,r,i,a,o=wD,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(mD),l.rangeRound=u(gD),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function VD(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function HD(){var e=AD(BD()(wD));return e.copy=function(){return VD(e,HD())},PT.apply(e,arguments)}function xfe(){var e=MD(BD()).domain([1,10]);return e.copy=function(){return VD(e,xfe()).base(e.base())},PT.apply(e,arguments)}function Sfe(){var e=PD(BD());return e.copy=function(){return VD(e,Sfe()).constant(e.constant())},PT.apply(e,arguments)}function UD(){var e=ID(BD());return e.copy=function(){return VD(e,UD()).exponent(e.exponent())},PT.apply(e,arguments)}function Cfe(){return UD.apply(null,arguments).exponent(.5)}var wfe=o((()=>{xD(),kD(),FT(),jD(),ND(),FD(),RD()}));function WD(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=wD,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e{xD(),kD(),FT(),jD(),ND(),wfe(),FD(),RD()})),Afe=o((()=>{r_(),bue(),Wde(),jD(),ND(),FD(),RD(),kD(),CD(),ufe(),ffe(),mfe(),vfe(),bfe(),wfe(),kfe(),Vde()}));function KD(e){for(var t=e.length/6|0,n=Array(t),r=0;r{})),jfe,Mfe=o((()=>{qD(),jfe=KD(`1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf`)})),Nfe,Pfe=o((()=>{qD(),Nfe=KD(`7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666`)})),Ffe,Ife=o((()=>{qD(),Ffe=KD(`1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666`)})),Lfe,Rfe=o((()=>{qD(),Lfe=KD(`4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0`)})),zfe,Bfe=o((()=>{qD(),zfe=KD(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`)})),Vfe,Hfe=o((()=>{qD(),Vfe=KD(`fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2`)})),Ufe,Wfe=o((()=>{qD(),Ufe=KD(`b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc`)})),Gfe,Kfe=o((()=>{qD(),Gfe=KD(`e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999`)})),qfe,Jfe=o((()=>{qD(),qfe=KD(`66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3`)})),Yfe,Xfe=o((()=>{qD(),Yfe=KD(`8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f`)})),Zfe=o((()=>{Mfe(),Pfe(),Ife(),Rfe(),Bfe(),Hfe(),Wfe(),Kfe(),Jfe(),Xfe(),qD(),xD(),$E()}));function JD(e,t,n){let r=e-t+n*2;return e?r>0?r:1:0}function Qfe(e){return function(t){let n=t[0],r=t[1],i;return r=r&&n[c]<=i&&(a<0&&(a=c),o=c);if(!(a<0))return r=e.invertExtent(n[a]),i=e.invertExtent(n[o]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function YD(){let e=IT().unknown(void 0),t=e.domain,n=e.range,r=[0,1],i,a,o=!1,s=0,c=0,l=.5;delete e.unknown;function u(){let e=t().length,u=r[1]p+i*e);return n(u?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),u()):t()},e.range=function(e){return arguments.length?(r=[+e[0],+e[1]],u()):r.slice()},e.rangeRound=function(e){return r=[+e[0],+e[1]],o=!0,u()},e.bandwidth=function(){return a},e.step=function(){return i},e.round=function(e){return arguments.length?(o=!!e,u()):o},e.padding=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),s=c,u()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),u()):s},e.paddingOuter=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),u()):c},e.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},e.invertRange=function(e){if(e[0]==null||e[1]==null)return;let i=r[1]r[1-i])))return u=Math.max(0,Vg(o,c)-1),d=c===l?u:Vg(o,l)-1,c-o[u]>a+1e-10&&++u,i&&(f=u,u=s-d,d=s-f),u>d?void 0:t().slice(u,d+1)},e.invert=function(t){let n=e.invertRange([t,t]);return n&&n[0]},e.copy=function(){return YD().domain(t()).range(r).round(o).paddingInner(s).paddingOuter(c).align(l)},u()}function epe(e){let t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return epe(t())},e}function tpe(){return epe(YD().paddingInner(1))}function npe(e){return Ppe.call(e,Nh)}function rpe(){let e=[],t=[];function n(n){return n==null||n!==n?void 0:t[(Vg(e,n)-1)%t.length]}return n.domain=function(t){return arguments.length?(e=npe(t),n):e.slice()},n.range=function(e){return arguments.length?(t=Fpe.call(e),n):t.slice()},n.tickFormat=function(t,n){return Bde(e[0],jh(e),t??10,n)},n.copy=function(){return rpe().domain(n.domain()).range(n.range())},n}function ipe(e){return e[xO]=!0,e}function ape(e){return e&&e[xO]===!0}function ope(e,t,n){let r=function(){let n=t();return n.invertRange||=n.invert?Qfe(n):n.invertExtent?$fe(n):void 0,n.type=e,ipe(n)};return r.metadata=Og(tg(n)),r}function XD(e,t,n){return arguments.length>1?(bO.set(e,ope(e,t,n)),this):spe(e)?bO.get(e):void 0}function spe(e){return bO.has(e)}function ZD(e,t){let n=bO.get(e);return n&&n.metadata[t]}function QD(e){return ZD(e,hO)}function $D(e){return ZD(e,gO)}function eO(e){return ZD(e,_O)}function tO(e){return ZD(e,`log`)}function cpe(e){return ZD(e,yO)}function lpe(e){return ZD(e,vO)}function upe(e){return ZD(e,fO)}function dpe(e,t){let n=t[0],r=jh(t)-n;return function(t){return e(n+t*r)}}function nO(e,t,n){return bD(rO(t||`rgb`,n),e)}function fpe(e,t){let n=Array(t),r=t+1;for(let i=0;ie[t]?o[t](e[t]()):0),o)}function rO(e,t){let n=Nde[mpe(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function mpe(e){return`interpolate`+e.toLowerCase().split(`-`).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function hpe(e){if(H(e))return e;let t=e.length/6|0,n=Array(t);for(let r=0;r1?(SO[e]=t,this):SO[e]}function aO(e,t,n){let r;if(yg(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null)){let r=e.domain(),i=Math.min(r[0],jh(r)),a=Math.max(r[0],jh(r));if(t=Math.min(t,Math.floor((a-i)/n||1)+1),!e.bins&&!tO(e.type)&&!cpe(e.type)&&i1&&Zg(i,a,t)a&&(r=a,a=i,i=r,o=Vpe),i=Math.floor(i),a=Math.ceil(a),t=t.map(t=>[t,e(t)]).filter(e=>i<=e[1]&&e[1]<=a).sort(o).map(e=>e[0]),n>0&&t.length>1){let e=[t[0],jh(t)];for(;t.length>n&&t.length>=3;)t=t.filter((e,t)=>!(t%2));t.length<3&&(t=e)}return t}function oO(e,t){return e.bins?_pe(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function vpe(e,t,n,r,i,a){let o=t.type,s=zpe;if(o===`time`||i===`time`)s=e.timeFormat(r);else if(o===`utc`||i===`utc`)s=e.utcFormat(r);else if(tO(o)){let i=e.formatFloat(r);if(a||t.bins)s=i;else{let e=ype(t,n,!1);s=t=>e(t)?i(t):``}}else if(t.tickFormat){let i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function ype(e,t,n){let r=oO(e,t),i=e.base(),a=Math.log(i),o=Math.max(1,i*t/r.length),s=e=>{let t=e/i**+Math.round(Math.log(e)/a);return t*i1?r[1]-r[0]:r[0],o;for(o=1;o(e-r)/a}function Epe(e,t,n,r){let i=r||t.type;return xg(n)&&cpe(i)&&(n=n.replace(/%a/g,`%A`).replace(/%b/g,`%B`)),!n&&i===`time`?e.timeFormat(`%A, %d %B %Y, %X`):!n&&i===`utc`?e.utcFormat(`%A, %d %B %Y, %X UTC`):wpe(e,t,5,null,n,r,!0)}function Dpe(e,t,n){n||={};let r=Math.max(3,n.maxlen||7),i=Epe(e,t,n.format,n.formatType);if(eO(t.type)){let e=bpe(t).slice(1).map(i),n=e.length;return`${n} boundar${n===1?`y`:`ies`}: ${e.join(`, `)}`}else if($D(t.type)){let e=t.domain(),n=e.length,a=n>r?e.slice(0,r-2).map(i).join(`, `)+`, ending with `+e.slice(-1).map(i):e.map(i).join(`, `);return`${n} value${n===1?``:`s`}: ${a}`}else{let e=t.domain();return`values from ${i(e[0])} to ${i(jh(e))}`}}var Ope,sO,cO,lO,kpe,uO,dO,fO,pO,mO,Ape,jpe,Mpe,Npe,hO,gO,_O,vO,yO,Ppe,Fpe,bO,xO,Ipe,Lpe,Rpe,SO,zpe,Bpe,Vpe,CO,wO,Hpe,Upe,TO,Wpe,Gpe,EO,DO=o((()=>{Ag(),r_(),Afe(),xD(),Zfe(),Py(),Ope=`identity`,sO=`linear`,cO=`sqrt`,lO=`symlog`,kpe=`time`,uO=`sequential`,dO=`diverging`,fO=`quantile`,pO=`quantize`,mO=`threshold`,Ape=`ordinal`,jpe=`point`,Mpe=`band`,Npe=`bin-ordinal`,hO=`continuous`,gO=`discrete`,_O=`discretizing`,vO=`interpolating`,yO=`temporal`,Ppe=Array.prototype.map,Fpe=Array.prototype.slice,bO=new Map,xO=Symbol(`vega_scale`),XD(Ope,Ude),XD(sO,Hde,hO),XD(`log`,tfe,[hO,`log`]),XD(`pow`,LD,hO),XD(cO,cfe,hO),XD(lO,ife,hO),XD(kpe,_fe,[hO,yO]),XD(`utc`,yfe,[hO,yO]),XD(uO,HD,[hO,vO]),XD(`${uO}-${sO}`,HD,[hO,vO]),XD(`${uO}-log`,xfe,[hO,vO,`log`]),XD(`${uO}-pow`,UD,[hO,vO]),XD(`${uO}-${cO}`,Cfe,[hO,vO]),XD(`${uO}-${lO}`,Sfe,[hO,vO]),XD(`${dO}-${sO}`,Tfe,[hO,vO]),XD(`${dO}-log`,Efe,[hO,vO,`log`]),XD(`${dO}-pow`,GD,[hO,vO]),XD(`${dO}-${cO}`,Ofe,[hO,vO]),XD(`${dO}-${lO}`,Dfe,[hO,vO]),XD(fO,lfe,[_O,fO]),XD(pO,dfe,_O),XD(mO,pfe,_O),XD(Npe,rpe,[gO,_O]),XD(Ape,IT,gO),XD(Mpe,YD,gO),XD(jpe,tpe,gO),Ipe=[`clamp`,`base`,`constant`,`exponent`],Lpe={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`},Rpe={accent:Nfe,category10:jfe,category20:`1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5`,category20b:`393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6`,category20c:`3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9`,dark2:Ffe,observable10:Lfe,paired:zfe,pastel1:Vfe,pastel2:Ufe,set1:Gfe,set2:qfe,set3:Yfe,tableau10:`4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac`,tableau20:`4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5`},SO={},gpe(Rpe,hpe),gpe(Lpe,e=>nO(hpe(e))),zpe=e=>H(e)?e.map(e=>String(e)):String(e),Bpe=(e,t)=>e[1]-t[1],Vpe=(e,t)=>t[1]-e[1],CO={[fO]:`quantiles`,[pO]:`thresholds`,[mO]:`domain`},wO={[fO]:`quantiles`,[pO]:`domain`},Hpe=e=>CO[e.type]||e.bins,Upe=e=>(t,n,r)=>{let i=TO(r[n+1],TO(r.max,1/0)),a=EO(t,e),o=EO(i,e);return a&&o?a+` – `+o:o?`< `+o:`≥ `+a},TO=(e,t)=>e??t,Wpe=e=>(t,n)=>n?e(t):null,Gpe=e=>t=>e(t),EO=(e,t)=>Number.isFinite(e)?t(e):null}));function Kpe(){Hk=0}function OO(e){return e&&e.gradient}function qpe(e,t,n){let r=e.gradient,i=e.id,a=r===`radial`?Uk:``;return i||(i=e.id=`gradient_`+Hk++,r===`radial`?(e.x1=kO(e.x1,.5),e.y1=kO(e.y1,.5),e.r1=kO(e.r1,0),e.x2=kO(e.x2,.5),e.y2=kO(e.y2,.5),e.r2=kO(e.r2,.5),a=Uk):(e.x1=kO(e.x1,0),e.y1=kO(e.y1,0),e.x2=kO(e.x2,1),e.y2=kO(e.y2,0))),t[i]=e,`url(`+(n||``)+`#`+a+i+`)`}function kO(e,t){return e??t}function Jpe(e,t){var n=[],r;return r={gradient:`linear`,x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(e,t){return n.push({offset:e,color:t}),r}}}function AO(e,t,n){var r=fg(Wk,e)&&Wk[e],i=null;return r&&(i=r.curve||r[t||`vertical`],r.tension&&n!=null&&(i=i[r.tension](n))),i}function jO(e){let t=[];return(e.match(lge)||[]).forEach(e=>{let n=e[0],r=n.toLowerCase(),i=cge[r],a=Ype(r,i,e.slice(1).trim()),o=a.length;if(o1&&(h=Math.sqrt(h),n*=h,r*=h);let g=f/n,_=d/n,v=-d/r,y=f/r,b=g*s+_*c,x=v*s+y*c,S=g*e+_*t,C=v*e+y*t,w=1/((S-b)*(S-b)+(C-x)*(C-x))-.25;w<0&&(w=0);let T=Math.sqrt(w);a==i&&(T=-T);let E=.5*(b+S)-T*(C-x),D=.5*(x+C)+T*(S-b),O=Math.atan2(x-D,b-E),k=Math.atan2(C-D,S-E)-O;k<0&&a===1?k+=qk:k>0&&a===0&&(k-=qk);let A=Math.ceil(Math.abs(k/(Kk+.001))),j=[];for(let e=0;e+e}function PO(e,t,n){return Math.max(t,Math.min(e,n))}function ome(){var e=nme,t=rme,n=ime,r=ame,i=NO(0),a=i,o=i,s=i,c=null;function l(l,u,d){var f,p=u??+e.call(this,l),m=d??+t.call(this,l),h=+n.call(this,l),g=+r.call(this,l),_=Math.min(h,g)/2,v=PO(+i.call(this,l),0,_),y=PO(+a.call(this,l),0,_),b=PO(+o.call(this,l),0,_),x=PO(+s.call(this,l),0,_);if(c||=f=Cw(),v<=0&&y<=0&&b<=0&&x<=0)c.rect(p,m,h,g);else{var S=p+h,C=m+g;c.moveTo(p+v,m),c.lineTo(S-y,m),c.bezierCurveTo(S-nA*y,m,S,m+nA*y,S,m+y),c.lineTo(S,C-x),c.bezierCurveTo(S,C-nA*x,S-nA*x,C,S-x,C),c.lineTo(p+b,C),c.bezierCurveTo(p+nA*b,C,p,C-nA*b,p,C-b),c.lineTo(p,m+v),c.bezierCurveTo(p,m+nA*v,p+nA*v,m,p+v,m),c.closePath()}if(f)return c=null,f+``||null}return l.x=function(t){return arguments.length?(e=NO(t),l):e},l.y=function(e){return arguments.length?(t=NO(e),l):t},l.width=function(e){return arguments.length?(n=NO(e),l):n},l.height=function(e){return arguments.length?(r=NO(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=NO(e),a=t==null?i:NO(t),s=n==null?i:NO(n),o=r==null?a:NO(r),l):i},l.context=function(e){return arguments.length?(c=e??null,l):c},l}function sme(){var e,t,n,r,i=null,a,o,s,c;function l(e,t,n){let r=n/2;if(a){var l=s-t,u=e-o;if(l||u){var d=Math.hypot(l,u),f=(l/=d)*c,p=(u/=d)*c,m=Math.atan2(u,l);i.moveTo(o-f,s-p),i.lineTo(e-l*r,t-u*r),i.arc(e,t,r,m-Math.PI,m),i.lineTo(o+f,s+p),i.arc(o,s,c,m,m+Math.PI)}else i.arc(e,t,r,0,qk);i.closePath()}else a=1;o=e,s=t,c=r}function u(o){var s,c=o.length,u,d=!1,f;for(i??=f=Cw(),s=0;s<=c;++s)!(spge?(u=o*o+s*a,u>=0&&(u=Math.sqrt(u),c=(-o+u)/a,l=(-o-u)/a)):c=.5*s/o,0f)return!1;h>d&&(d=h)}else if(p>0){if(h0?(e.globalAlpha=n,e.fillStyle=Cme(e,t,t.fill),!0):!1}function ZO(e,t,n){var r=(r=t.strokeWidth)??1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=Cme(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||`butt`,e.lineJoin=t.strokeJoin||`miter`,e.miterLimit=t.strokeMiterLimit==null?4:t.strokeMiterLimit,e.setLineDash&&(e.setLineDash(t.strokeDash||Bge),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function wme(e,t){return e.zindex-t.zindex||e.index-t.index}function QO(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,a;for(i=0,a=t.length;i=0;)if(r=t(n[i]))return r;if(n===a){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function tk(e){return function(t,n,r){$O(n,n=>{(!r||r.intersects(n.bounds))&&Eme(e,t,n,n)})}}function Tme(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&Eme(e,t,n.items[0],n.items)}}function Eme(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(JO(t,n),n.fill&&XO(t,n,i)&&t.fill(),n.stroke&&ZO(t,n,i)&&t.stroke()))}function nk(e){return e||=xh,function(t,n,r,i,a,o){return r*=t.pixelRatio,i*=t.pixelRatio,ek(n,n=>{let s=n.bounds;if(!(s&&!s.contains(a,o)||!s)&&e(t,n,r,i,a,o))return n})}}function rk(e,t){return function(n,r,i,a){var o=Array.isArray(r)?r[0]:r,s=t??o.fill,c=o.stroke&&n.isPointInStroke,l,u;return c&&(l=o.strokeWidth,u=o.strokeCap,n.lineWidth=l??1,n.lineCap=u??`butt`),e(n,r)?!1:s&&n.isPointInPath(i,a)||c&&n.isPointInStroke(i,a)}}function ik(e){return nk(rk(e))}function ak(e,t){return`translate(`+e+`,`+t+`)`}function ok(e){return`rotate(`+e+`)`}function Dme(e,t){return`scale(`+e+`,`+t+`)`}function Ome(e){return ak(e.x||0,e.y||0)}function kme(e){return ak(e.x||0,e.y||0)+(e.angle?` `+ok(e.angle):``)}function Ame(e){return ak(e.x||0,e.y||0)+(e.angle?` `+ok(e.angle):``)+(e.scaleX||e.scaleY?` `+Dme(e.scaleX||1,e.scaleY||1):``)}function sk(e,t,n){function r(e,n){e(`transform`,kme(n)),e(`d`,t(null,n))}function i(e,n){return t(WO(e,n.angle),n),UO(e,n,!0).translate(n.x||0,n.y||0)}function a(e,n){var r=n.x||0,i=n.y||0,a=n.angle||0;e.translate(r,i),a&&e.rotate(a*=Gk),e.beginPath(),t(e,n),a&&e.rotate(-a),e.translate(-r,-i)}return{type:e,tag:`path`,nested:!1,attr:r,bound:i,draw:tk(a),pick:ik(a),isect:n||GO(a)}}function jme(e,t){for(var n=e[0].orient===`horizontal`?t[1]:t[0],r=e[0].orient===`horizontal`?`y`:`x`,i=e.length,a=1/0,o,s;--i>=0;)e[i].defined!==!1&&(s=Math.abs(e[i][r]-n),s=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],a=e[r].y-t[1],o=i*i+a*a,o=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],a=r*r+i*i,r=e[n].size||1,a.5&&t<1.5?.5-Math.abs(t-1):0:e.strokeOffset}function Lme(e,t){e(`transform`,Ome(t))}function Rme(e,t){let n=Ime(t);e(`d`,LO(null,t,n,n))}function zme(e,t){e(`class`,`background`),e(`aria-hidden`,!0),Rme(e,t)}function Bme(e,t){e(`class`,`foreground`),e(`aria-hidden`,!0),t.strokeForeground?Rme(e,t):e(`d`,``)}function Vme(e,t,n){e(`clip-path`,t.clip?RO(n,t,t):null)}function Hme(e,t){if(!t.clip&&t.items){let n=t.items,r=n.length;for(let t=0;t{let i=t.x||0,a=t.y||0,o=t.strokeForeground,s=t.opacity==null?1:t.opacity;(t.stroke||t.fill)&&s&&(lk(e,t,i,a),JO(e,t),t.fill&&XO(e,t,s)&&e.fill(),t.stroke&&!o&&ZO(e,t,s)&&e.stroke()),e.save(),e.translate(i,a),t.clip&&Fme(e,t),n&&n.translate(-i,-a),$O(t,t=>{(t.marktype===`group`||r==null||r.includes(t.marktype))&&this.draw(e,t,n,r)}),n&&n.translate(i,a),e.restore(),o&&t.stroke&&s&&(lk(e,t,i,a),JO(e,t),ZO(e,t,s)&&e.stroke())})}function Wme(e,t,n,r,i,a){if(t.bounds&&!t.bounds.contains(i,a)||!t.items)return null;let o=n*e.pixelRatio,s=r*e.pixelRatio;return ek(t,c=>{let l,u,d,f=c.bounds;if(f&&!f.contains(i,a))return;u=c.x||0,d=c.y||0;let p=u+(c.width||0),m=d+(c.height||0),h=c.clip;if(h&&(ip||am))return;if(e.save(),e.translate(u,d),u=i-u,d=a-d,h&&IO(c)&&!Gge(e,c,o,s))return e.restore(),null;let g=c.strokeForeground,_=t.interactive!==!1;return _&&g&&c.stroke&&Wge(e,c,o,s)?(e.restore(),c):(l=ek(c,e=>Gme(e,u,d)?this.pick(e,n,r,u,d):null),!l&&_&&(c.fill||!g&&c.stroke)&&Uge(e,c,o,s)&&(l=c),e.restore(),l||null)})}function Gme(e,t,n){return(e.interactive!==!1||e.marktype===`group`)&&e.bounds&&e.bounds.contains(t,n)}function uk(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(t=>{e.image=t,e.image.url=e.url})),n}function dk(e,t){return e.width==null?!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width:e.width}function fk(e,t){return e.height==null?!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height:e.height}function pk(e,t){return e===`center`?t/2:e===`right`?t:0}function mk(e,t){return e===`middle`?t/2:e===`bottom`?t:0}function Kme(e,t,n){let r=uk(t,n),i=dk(t,r),a=fk(t,r),o=(t.x||0)-pk(t.align,i),s=(t.y||0)-mk(t.baseline,a);e(`href`,!r.src&&r.toDataURL?r.toDataURL():r.src||``,EA[`xmlns:xlink`],`xlink:href`),e(`transform`,ak(o,s)),e(`width`,i),e(`height`,a),e(`preserveAspectRatio`,t.aspect===!1?`none`:`xMidYMid`)}function qme(e,t){let n=t.image,r=dk(t,n),i=fk(t,n),a=(t.x||0)-pk(t.align,r),o=(t.y||0)-mk(t.baseline,i);return e.set(a,o,a+r,o+i)}function Jme(e,t,n){$O(t,t=>{if(n&&!n.intersects(t.bounds))return;let r=uk(t,this),i=dk(t,r),a=fk(t,r);if(i===0||a===0)return;let o=(t.x||0)-pk(t.align,i),s=(t.y||0)-mk(t.baseline,a),c,l,u;t.aspect!==!1&&(c=r.width/r.height,l=t.width/t.height,c===c&&l===l&&c!==l&&(l{if(!(n&&!n.intersects(t.bounds))){var r=t.opacity==null?1:t.opacity;r&&nhe(e,t,r)&&(JO(e,t),e.stroke())}})}function ihe(e,t,n,r){return e.isPointInStroke?nhe(e,t,1)&&e.isPointInStroke(n,r):!1}function ahe(e){OA.width=e&&wA?_k:gk}function gk(e,t){return ohe(Sk(e,t),vk(e))}function ohe(e,t){return~~(.8*e.length*t)}function _k(e,t){return vk(e)<=0||!(t=Sk(e,t))?0:she(t,wk(e))}function she(e,t){let n=`(${t}) ${e}`,r=DA.get(n);return r===void 0&&(wA.font=t,r=wA.measureText(e).width,DA.set(n,r)),r}function vk(e){return e.fontSize==null?11:+e.fontSize||0}function yk(e){return e.lineHeight==null?vk(e)+2:e.lineHeight}function che(e){return H(e)?e.length>1?e:e[0]:e}function bk(e){return che(e.lineBreak&&e.text&&!H(e.text)?e.text.split(e.lineBreak):e.text)}function xk(e){let t=bk(e);return(H(t)?t.length-1:0)*yk(e)}function Sk(e,t){let n=t==null?``:(t+``).trim();return e.limit>0&&n.length?uhe(e,n):n}function lhe(e){if(OA.width===_k){let t=wk(e);return e=>she(e,t)}else if(OA.width===gk){let t=vk(e);return e=>ohe(e,t)}else return t=>OA.width(e,t)}function uhe(e,t){var n=+e.limit,r=lhe(e);if(r(t)>>1,r(t.slice(c))>n?o=c+1:s=c;return i+t.slice(o)}else{for(;o>>1),r(t.slice(0,c))Math.max(e,OA.width(t,n)),0)):d=OA.width(t,u),i===`center`?c-=d/2:i===`right`&&(c-=d),e.set(c+=o,l+=s,c+d,l+r),t.angle&&!n)e.rotate(t.angle*Gk,o,s);else if(n===2)return e.rotatedPoints(t.angle*Gk,o,s);return e}function fhe(e,t,n){$O(t,t=>{var r=t.opacity==null?1:t.opacity,i,a,o,s,c,l,u;if(!(n&&!n.intersects(t.bounds)||r===0||t.fontSize<=0||t.text==null||t.text.length===0)){if(e.font=wk(t),e.textAlign=t.align||`left`,i=Ek(t),a=i.x1,o=i.y1,t.angle&&(e.save(),e.translate(a,o),e.rotate(t.angle*Gk),a=o=0),a+=t.dx||0,o+=(t.dy||0)+Tk(t),l=bk(t),JO(e,t),H(l))for(c=yk(t),s=0;st;)e.removeChild(n[--r]);return e}function bhe(e){return`mark-`+e.marktype+(e.role?` role-`+e.role:``)+(e.name?` `+e.name:``)}function Nk(e,t){if(t.getScreenCTM){let n=xhe(e,t.getScreenCTM());if(n)return n}return She(e,t,t.getBoundingClientRect())}function xhe(e,t){if(!t)return null;let n=t.a*t.d-t.b*t.c;if(!n)return null;let r=e.clientX-t.e,i=e.clientY-t.f;return[(t.d*r-t.c*i)/n,(t.a*i-t.b*r)/n]}function She(e,t,n){let r=t.offsetWidth?n.width/t.offsetWidth:1,i=t.offsetHeight?n.height/t.offsetHeight:1;return[(e.clientX-n.left)/r-(t.clientLeft||0),(e.clientY-n.top)/i-(t.clientTop||0)]}function Che(e,t,n,r){var i=e&&e.mark,a,o;if(i&&(a=AA[i.marktype]).tip){for(o=Nk(t,n),o[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=a.tip(i.items,o)}return e}function whe(e,t,n,r){e.element().setAttribute(`title`,r||``)}function The(e,t){aj(t).forEach(t=>Ehe(e,t))}function Ehe(e,t){let n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}function Pk(e,t,n){t.forEach(t=>e.fire(t,n))}function Dhe(e,t,n){return function(r){let i=this._active,a=this.pickEvent(r);a===i?Pk(this,e,r):((!i||!i.exit)&&Pk(this,n,r),this._active=a,Pk(this,t,r),Pk(this,e,r))}}function Ohe(e){return function(t){Pk(this,e,t),this._active=null}}function khe(){return typeof window<`u`&&window.devicePixelRatio||1}function Ahe(e,t,n,r,i,a){let o=typeof HTMLElement<`u`&&e instanceof HTMLElement&&e.parentNode!=null,s=e.getContext(`2d`),c=o?khe():i;e.width=t*c,e.height=n*c;for(let e in a)s[e]=a[e];return o&&c!==1&&(e.style.width=t+`px`,e.style.height=n+`px`),s.pixelRatio=c,s.setTransform(c,0,0,c,c*r[0],c*r[1]),e}function jhe(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}function Mhe(e,t){let n=t.aria===!1;if(e(uj,n||void 0),n||t.description==null)for(let t in yj)e(yj[t],void 0);else{let n=t.mark.marktype;e(dj,t.description),e(fj,t.ariaRole||(n===`group`?mj:hj)),e(pj,t.ariaRoleDescription||`${n} mark`)}}function Nhe(e){return e.aria===!1?{[uj]:!0}:_j[e.role]?null:vj[e.role]?Fhe(e,vj[e.role]):Phe(e)}function Phe(e){let t=e.marktype,n=t===`group`||t===`text`||e.items.some(e=>e.description!=null&&e.aria!==!1);return gj(n?mj:hj,`${t} mark container`,e.description)}function Fhe(e,t){try{let n=e.items[0],r=t.caption||(()=>``);return gj(t.role||hj,t.desc,e.description||n.description||r(n))}catch{return null}}function Ihe(e){return tg(e.text).join(` `)}function Lhe(e){let t=e.datum,n=e.orient,r=t.title?zhe(e):null,i=e.context,a=i.scales[t.scale].value,o=i.dataflow.locale(),s=a.type;return`${n===`left`||n===`right`?`Y`:`X`}-axis`+(r?` titled '${r}'`:``)+` for a ${$D(s)?`discrete`:s} scale with ${Dpe(o,a,e)}`}function Rhe(e){let t=e.datum,n=t.title?zhe(e):null,r=`${t.type||``} legend`.trim(),i=t.scales,a=Object.keys(i),o=e.context,s=o.scales[i[a[0]]].value,c=o.dataflow.locale();return Vhe(r)+(n?` titled '${n}'`:``)+` for ${Bhe(a)} with ${Dpe(c,s,e)}`}function zhe(e){try{return tg(jh(e.items).items[0].text).join(` `)}catch{return null}}function Bhe(e){return e=e.map(e=>e+(e===`fill`||e===`stroke`?` color`:``)),e.length<2?e[0]:e.slice(0,-1).join(`, `)+` and `+jh(e)}function Vhe(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Fk(){let e=``,t=``,n=``,r=[],i=()=>t=n=``,a=a=>{t&&(e+=`${t}>${n}`,i()),r.push(a)},o=(e,n)=>(n!=null&&(t+=` ${e}="${xj(n)}"`),s),s={open(e,...n){a(e),t=`<`+e;for(let e of n)for(let t in e)o(t,e[t]);return s},close(){let a=r.pop();return t?e+=t+(n?`>${n}`:`/>`):e+=``,i(),s},attr:o,text:e=>(n+=bj(e),s),toString:()=>e};return s}function Hhe(e,t){if(e.open(t.tagName),t.hasAttributes()){let n=t.attributes,r=n.length;for(let t=0;t{i=e.mark(t,n,i,r),++a}),Mk(t,1+a)}function qhe(e,t,n,r,i){let a=e._svg,o;if(!a&&(o=t.ownerDocument,a=kk(o,r,Oj),e._svg=a,e.mark&&(a.__data__=e,a.__values__={fill:`default`},r===`g`))){let t=kk(o,`path`,Oj);a.appendChild(t),t.__data__=e;let n=kk(o,`g`,Oj);a.appendChild(n),n.__data__=e;let r=kk(o,`path`,Oj);a.appendChild(r),r.__data__=e,r.__values__={fill:`default`}}return(a.ownerSVGElement!==i||Jhe(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}function Jhe(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}function Ik(e,t,n){t!==jj[e]&&(n?Yhe(Aj,e,t,n):zk(Aj,e,t),jj[e]=t)}function Lk(e,t,n){n!==jj[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+``),jj[t]=n)}function Rk(e,t){for(let n in t)zk(e,n,t[n])}function zk(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Yhe(e,t,n,r){n==null?e.removeAttributeNS(r,t):e.setAttributeNS(r,t,n)}function Xhe(){let e;return typeof window>`u`?``:(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function Zhe(e,t,n,r,i){let a;if(t==null||(r===`bgrect`&&n.interactive===!1&&(e[`pointer-events`]=`none`),r===`bgfore`&&(n.interactive===!1&&(e[`pointer-events`]=`none`),e.display=`none`,t.fill!==null)))return e;r===`image`&&t.smooth===!1&&(a=[`image-rendering: optimizeSpeed;`,`image-rendering: pixelated;`]),r===`text`&&(e[`font-family`]=Ck(t),e[`font-size`]=vk(t)+`px`,e[`font-style`]=t.fontStyle,e[`font-variant`]=t.fontVariant,e[`font-weight`]=t.fontWeight);for(let n in Cj){let r=t[n],a=Cj[n];r===`transparent`&&(a===`fill`||a===`stroke`)||r!=null&&(OO(r)&&(r=qpe(r,i.gradient,``)),e[a]=r)}for(let e in wj){let n=t[e];n!=null&&(a||=[],a.push(`${wj[e]}: ${n};`))}return a&&(e.style=a.join(` `)),e}function Qhe(e){Pj.svgMarkTypes=e.svgMarkTypes??[`text`],Pj.svgOnTop=e.svgOnTop??!0,Pj.debug=e.debug??!1}function Bk(e,t){return e=String(e||``).toLowerCase(),arguments.length>1?(Uj[e]=t,this):Uj[e]}function $he(e,t,n){let r=[],i=new zO().union(t),a=e.marktype;return a?ege(e,i,n,r):a===`group`?nge(e,i,n,r):V(`Intersect scene must be mark node or group item.`)}function ege(e,t,n,r){if(tge(e,t,n)){let i=e.items,a=e.marktype,o=i.length,s=0;if(a===`group`)for(;s=0;a--)if(n[a]!=r[a])return!1;for(a=n.length-1;a>=0;a--)if(i=n[a],!Vk(e[i],t[i],i))return!1;return typeof e==typeof t}function sge(){mme(),Kpe()}var Hk,Uk,Wk,cge,lge,uge,dge,fge,Gk,pge,Kk,qk,Jk,Yk,Xk,Zk,Qk,$k,eA,tA,nA,rA,iA,mge,hge,gge,_ge,vge,yge,bge,xge,Sge,Cge,wge,Tge,Ege,Dge,Oge,kge,aA,Age,jge,Mge,Nge,Pge,Fge,Ige,Lge,oA,sA,Rge,cA,lA,uA,dA,fA,pA,mA,hA,gA,_A,vA,yA,bA,xA,SA,CA,zge,wA,TA,Bge,Vge,Hge,Uge,Wge,Gge,Kge,EA,qge,Jge,Yge,Xge,Zge,Qge,$ge,DA,OA,e_e,kA,AA,jA,t_e,MA,NA,PA,n_e,r_e,i_e,FA,IA,LA,RA,a_e,zA,BA,VA,HA,UA,WA,GA,KA,qA,JA,YA,XA,ZA,QA,$A,ej,tj,nj,rj,ij,aj,oj,sj,cj,lj,uj,dj,fj,pj,mj,hj,gj,_j,vj,yj,bj,xj,Sj,Cj,wj,Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj=o((()=>{Ag(),yue(),kw(),MT(),Qb(),DO(),Hk=0,Uk=`p_`,Wk={basis:{curve:eue},"basis-closed":{curve:tue},"basis-open":{curve:rue},bundle:{curve:eT,tension:`beta`,value:.85},cardinal:{curve:rT,tension:`tension`,value:0},"cardinal-open":{curve:lT,tension:`tension`,value:0},"cardinal-closed":{curve:oT,tension:`tension`,value:0},"catmull-rom":{curve:pT,tension:`alpha`,value:.5},"catmull-rom-closed":{curve:gT,tension:`alpha`,value:.5},"catmull-rom-open":{curve:vT,tension:`alpha`,value:.5},linear:{curve:Iw},"linear-closed":{curve:cue},monotone:{horizontal:due,vertical:uue},natural:{curve:pue},step:{curve:hue},"step-after":{curve:_ue},"step-before":{curve:gue}},cge={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},lge=/[mlhvzcsqta]([^mlhvzcsqta]*)/gi,uge=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,dge=/^((\s+,?\s*)|(,\s*))/,fge=/^[01]/,Gk=Math.PI/180,pge=1e-14,Kk=Math.PI/2,qk=Math.PI*2,Jk=Math.sqrt(3)/2,Yk={},Xk={},Zk=[].join,Qk=[`l`,0,0,0,0,0,0,0],$k=.5773502691896257,eA={circle:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,qk)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/2.5;e.moveTo(-n,-r),e.lineTo(-n,r),e.lineTo(-r,r),e.lineTo(-r,n),e.lineTo(r,n),e.lineTo(r,r),e.lineTo(n,r),e.lineTo(n,-r),e.lineTo(r,-r),e.lineTo(r,-n),e.lineTo(-r,-n),e.lineTo(-r,-r),e.closePath()}},diamond:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/7,i=n/2.5,a=n/8;e.moveTo(-r,n),e.lineTo(r,n),e.lineTo(r,-a),e.lineTo(i,-a),e.lineTo(0,-n),e.lineTo(-i,-a),e.lineTo(-r,-a),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,r=Jk*n,i=r-n*$k,a=n/4;e.moveTo(0,-r-i),e.lineTo(-a,r-i),e.lineTo(a,r-i),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,r=Jk*n,i=r-n*$k;e.moveTo(0,-r-i),e.lineTo(-n,r-i),e.lineTo(n,r-i),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Jk*n;e.moveTo(0,-r),e.lineTo(-n,r),e.lineTo(n,r),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Jk*n;e.moveTo(0,r),e.lineTo(-n,-r),e.lineTo(n,-r),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Jk*n;e.moveTo(r,0),e.lineTo(-r,-n),e.lineTo(-r,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Jk*n;e.moveTo(-r,0),e.lineTo(r,-n),e.lineTo(r,n),e.closePath()}},stroke:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}},tA={},nA=.448084975506,rA=e=>e.x||0,iA=e=>e.y||0,mge=e=>e.width||0,hge=e=>e.height||0,gge=e=>(e.x||0)+(e.width||0),_ge=e=>(e.y||0)+(e.height||0),vge=e=>e.startAngle||0,yge=e=>e.endAngle||0,bge=e=>e.padAngle||0,xge=e=>e.innerRadius||0,Sge=e=>e.outerRadius||0,Cge=e=>e.cornerRadius||0,wge=e=>FO(e.cornerRadiusTopLeft,e.cornerRadius)||0,Tge=e=>FO(e.cornerRadiusTopRight,e.cornerRadius)||0,Ege=e=>FO(e.cornerRadiusBottomRight,e.cornerRadius)||0,Dge=e=>FO(e.cornerRadiusBottomLeft,e.cornerRadius)||0,Oge=e=>FO(e.size,64),kge=e=>e.size||1,aA=e=>e.defined!==!1,Age=e=>eme(e.shape||`circle`),jge=Yle().startAngle(vge).endAngle(yge).padAngle(bge).innerRadius(xge).outerRadius(Sge).cornerRadius(Cge),Mge=Uw().x(rA).y1(iA).y0(_ge).defined(aA),Nge=Uw().y(iA).x1(rA).x0(gge).defined(aA),Pge=Vw().x(rA).y(iA).defined(aA),Fge=ome().x(rA).y(iA).width(mge).height(hge).cornerRadius(wge,Tge,Ege,Dge),Ige=Qle().type(Age).size(Oge),Lge=sme().x(rA).y(iA).defined(aA).size(kge),oA=1,zO.prototype={clone(){return new zO(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(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,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(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){let r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:a,y2:o}=this,s=Math.cos(e),c=Math.sin(e),l=t-t*s+n*c,u=n-t*c-n*s;return[s*r-c*i+l,c*r+s*i+u,s*r-c*o+l,c*r+s*o+u,s*a-c*i+l,c*a+s*i+u,s*a-c*o+l,c*a+s*o+u]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},U(VO,BO),sA=class{constructor(e){this._pending=0,this._loader=e||Zb()}pending(){return this._pending}sanitizeURL(e){let t=this;return hme(t),t._loader.sanitize(e,{context:`href`}).then(e=>(HO(t),e)).catch(()=>(HO(t),null))}loadImage(e){let t=this,n=jT();return hme(t),t._loader.sanitize(e,{context:`image`}).then(e=>{let r=e.href;if(!r||!n)throw{url:r};let i=new n,a=fg(e,`crossOrigin`)?e.crossOrigin:`anonymous`;return a!=null&&(i.crossOrigin=a),i.onload=()=>HO(t),i.onerror=()=>HO(t),i.src=r,i}).catch(e=>(HO(t),{complete:!1,width:0,height:0,src:e&&e.url||``}))}ready(){let e=this;return new Promise(t=>{function n(r){e.pending()?setTimeout(()=>{n(!0)},10):t(r)}n(!1)})}},Rge=qk-1e-8,gA=(e,t)=>cA.add(e,t),_A=(e,t)=>gA(lA=e,uA=t),vA=e=>gA(e,cA.y1),yA=e=>gA(cA.x1,e),bA=(e,t)=>fA*e+mA*t,xA=(e,t)=>pA*e+hA*t,SA=(e,t)=>gA(bA(e,t),xA(e,t)),CA=(e,t)=>_A(bA(e,t),xA(e,t)),zge={beginPath(){},closePath(){},moveTo:CA,lineTo:CA,rect(e,t,n,r){dA?(SA(e+n,t),SA(e+n,t+r),SA(e,t+r),CA(e,t)):(gA(e+n,t+r),_A(e,t))},quadraticCurveTo(e,t,n,r){let i=bA(e,t),a=xA(e,t),o=bA(n,r),s=xA(n,r);gme(lA,i,o,vA),gme(uA,a,s,yA),_A(o,s)},bezierCurveTo(e,t,n,r,i,a){let o=bA(e,t),s=xA(e,t),c=bA(n,r),l=xA(n,r),u=bA(i,a),d=xA(i,a);_me(lA,o,c,u,vA),_me(uA,s,l,d,yA),_A(u,d)},arc(e,t,n,r,i,a){if(r+=dA,i+=dA,lA=n*Math.cos(i)+e,uA=n*Math.sin(i)+t,Math.abs(i-r)>Rge)gA(e-n,t-n),gA(e+n,t+n);else{let o=r=>gA(n*Math.cos(r)+e,n*Math.sin(r)+t),s,c;if(o(r),o(i),i!==r)if(r%=qk,r<0&&(r+=qk),i%=qk,i<0&&(i+=qk),ii;++c,s-=Kk)o(s);else for(s=r-r%Kk+Kk,c=0;c<4&&s=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1}handlers(e){let t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(let e in t)n.push(...t[e]);return n}eventName(e){let t=e.indexOf(`.`);return t<0?e:e.slice(0,t)}handleHref(e,t,n){this._loader.sanitize(n,{context:`href`}).then(t=>{let n=new MouseEvent(e.type,e),r=kk(null,`a`);for(let e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)}).catch(()=>{})}handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=Che(t,e,this.canvas(),this._origin);let r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}}getItemBoundingClientRect(e){let t=this.canvas();if(!t)return;let n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,a=i.width(),o=i.height(),s=i.x1+r[0]+n.left,c=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,c+=e.y||0;return{x:s,y:c,width:a,height:o,left:s,top:c,right:s+a,bottom:c+o}}},PA=class{constructor(e){this._el=null,this._bgcolor=null,this._loader=new sA(e)}initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)}resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this}dirty(){}render(e,t){let n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n}_render(){}renderAsync(e,t){let n=this.render(e,t);return this._ready?this._ready.then(()=>n):Promise.resolve(n)}_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){let e=n._call;n._ready=n._loader.ready().then(t=>{t&&e(),n._ready=null})}return r}sanitizeURL(e){return this._load(`sanitizeURL`,e)}loadImage(e){return this._load(`loadImage`,e)}},n_e=`keydown`,r_e=`keypress`,i_e=`keyup`,FA=`dragenter`,IA=`dragleave`,LA=`dragover`,RA=`pointerdown`,a_e=`pointerup`,zA=`pointermove`,BA=`pointerout`,VA=`pointerover`,HA=`mousedown`,UA=`mouseup`,WA=`mousemove`,GA=`mouseout`,KA=`mouseover`,qA=`click`,JA=`dblclick`,YA=`wheel`,XA=`mousewheel`,ZA=`touchstart`,QA=`touchmove`,$A=`touchend`,ej=[n_e,r_e,i_e,FA,IA,LA,RA,a_e,zA,BA,VA,HA,UA,WA,GA,KA,qA,JA,YA,XA,ZA,QA,$A],tj=zA,nj=GA,rj=qA,ij=class extends NA{constructor(e,t){super(e,t),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=ej,this.pointermove=Dhe([zA,WA],[VA,KA],[BA,GA]),this.dragover=Dhe([LA],[FA],[IA]),this.pointerout=Ohe([BA,GA]),this.dragleave=Ohe([IA])}initialize(e,t,n){return this._canvas=e&&Ak(e,`canvas`),[qA,HA,RA,zA,BA,IA].forEach(e=>The(this,e)),super.initialize(e,t,n)}canvas(){return this._canvas}context(){return this._canvas.getContext(`2d`)}DOMMouseScroll(e){this.fire(XA,e)}pointerdown(e){this._down=this._active,this.fire(RA,e)}mousedown(e){this._down=this._active,this.fire(HA,e)}click(e){this._down===this._active&&(this.fire(qA,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&=(this._active=this._touch,!1),this.fire(ZA,e,!0)}touchmove(e){this.fire(QA,e,!0)}touchend(e){this.fire($A,e,!0),this._touch=null}fire(e,t,n){let r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===rj&&r&&r.href?this.handleHref(t,r,r.href):(e===tj||e===nj)&&this.handleTooltip(t,r,e!==nj),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this}pickEvent(e){let t=Nk(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])}pick(e,t,n,r,i){let a=this.context();return AA[e.marktype].pick.call(this,a,e,t,n,r,i)}},aj=e=>e===ZA||e===QA||e===$A?[ZA,QA,$A]:[e],oj=class extends PA{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new zO,this._tempb=new zO}initialize(e,t,n,r,i,a){return this._options=a||{},this._canvas=this._options.externalContext?null:AT(1,1,this._options.type),e&&this._canvas&&(Mk(e,0).appendChild(this._canvas),this._canvas.setAttribute(`class`,`marks`)),super.initialize(e,t,n,r,i)}resize(e,t,n,r){if(super.resize(e,t,n,r),this._canvas)Ahe(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{let e=this._options.externalContext;e||V(`CanvasRenderer is missing a valid canvas or context`),e.scale(this._scale,this._scale),e.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(e){let t=this._tempb.clear().union(e.bounds),n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)}_render(e,t){let n=this.context(),r=this._origin,i=this._width,a=this._height,o=this._dirty,s=sj(r,i,a);n.save();let c=this._redraw||o.empty()?(this._redraw=!1,s.expand(1)):jhe(n,s.intersect(o),r);return this.clear(-r[0],-r[1],i,a),this.draw(n,e,c,t),n.restore(),o.clear(),this}draw(e,t,n,r){if(t.marktype!==`group`&&r!=null&&!r.includes(t.marktype))return;let i=AA[t.marktype];t.clip&&Pme(e,t),i.draw.call(this,e,t,n,r),t.clip&&e.restore()}clear(e,t,n,r){let i=this._options,a=this.context();i.type!==`pdf`&&!i.externalContext&&a.clearRect(e,t,n,r),this._bgcolor!=null&&(a.fillStyle=this._bgcolor,a.fillRect(e,t,n,r))}},sj=(e,t,n)=>new zO().set(0,0,t,n).translate(-e[0],-e[1]),cj=class extends NA{constructor(e,t){super(e,t);let n=this;n._hrefHandler=lj(n,(e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=lj(n,(e,t)=>{n.handleTooltip(e,t,e.type!==nj)})}initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(rj,this._hrefHandler),r.removeEventListener(tj,this._tooltipHandler),r.removeEventListener(nj,this._tooltipHandler)),this._svg=r=e&&Ak(e,`svg`),r&&(r.addEventListener(rj,this._hrefHandler),r.addEventListener(tj,this._tooltipHandler),r.addEventListener(nj,this._tooltipHandler)),super.initialize(e,t,n)}canvas(){return this._svg}on(e,t){let n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){let i={type:e,handler:t,listener:lj(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this}off(e,t){let n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}},lj=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)},uj=`aria-hidden`,dj=`aria-label`,fj=`role`,pj=`aria-roledescription`,mj=`graphics-object`,hj=`graphics-symbol`,gj=(e,t,n)=>({[fj]:e,[pj]:t,[dj]:n||void 0}),_j=Og([`axis-domain`,`axis-grid`,`axis-label`,`axis-tick`,`axis-title`,`legend-band`,`legend-entry`,`legend-gradient`,`legend-label`,`legend-title`,`legend-symbol`,`title`]),vj={axis:{desc:`axis`,caption:Lhe},legend:{desc:`legend`,caption:Rhe},"title-text":{desc:`title`,caption:e=>`Title text '${Ihe(e)}'`},"title-subtitle":{desc:`subtitle`,caption:e=>`Subtitle text '${Ihe(e)}'`}},yj={ariaRole:fj,ariaRoleDescription:pj,description:dj},bj=e=>(e+``).replace(/&/g,`&`).replace(//g,`>`),xj=e=>bj(e).replace(/"/g,`"`).replace(/\t/g,` `).replace(/\n/g,` `).replace(/\r/g,` `),Sj=e=>Hhe(Fk(),e)+``,Cj={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`},wj={blend:`mix-blend-mode`},Tj={fill:`none`,"stroke-miterlimit":4},Ej=0,Dj=`http://www.w3.org/2000/xmlns/`,Oj=EA.xmlns,kj=class extends PA{constructor(e){super(e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=jk(e,0,`svg`,Oj),this._svg.setAttributeNS(Dj,`xmlns`,Oj),this._svg.setAttributeNS(Dj,`xmlns:xlink`,EA[`xmlns:xlink`]),this._svg.setAttribute(`version`,EA.version),this._svg.setAttribute(`class`,`marks`),Mk(e,1),this._root=jk(this._svg,Ej,`g`,Oj),Rk(this._root,Tj),Mk(this._svg,1)),this.background(this._bgcolor),super.initialize(e,t,n,r,i)}background(e){return arguments.length&&this._svg&&this._svg.style.setProperty(`background-color`,e),super.background(...arguments)}resize(e,t,n,r){return super.resize(e,t,n,r),this._svg&&(Rk(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(){let e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute(`style`),n=jk(e,Ej,`rect`,Oj),Rk(n,{width:this._width,height:this._height,fill:t}));let r=Sj(e);return t&&(e.removeChild(n),this._svg.style.setProperty(`background-color`,t)),r}_render(e,t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e,void 0,t),Mk(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))}isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;let e=this._dirty;if(!e.length||!this._dirtyID)return!0;let t=++this._dirtyID,n,r,i,a,o,s,c;for(o=0,s=e.length;o{e.dirty=t})),!r.zdirty){if(n.exit){a.nested&&r.items.length?(c=r.items[0],c._svg&&this._update(a,c._svg,c)):n._svg&&(c=n._svg.parentNode,c&&c.removeChild(n._svg)),n._svg=null;continue}n=a.nested?r.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,Uhe(n,t)):this._update(a,n._svg,n),n._update=t)}return!this._dirtyAll}mark(e,t,n,r){if(!this.isDirty(t))return t._svg;let i=this._svg,a=t.marktype,o=AA[a],s=t.interactive===!1?`none`:null,c=o.tag===`g`,l=qhe(t,e,n,`g`,i);if(a!==`group`&&r!=null&&!r.includes(a))return Mk(l,0),t._svg;l.setAttribute(`class`,bhe(t));let u=Nhe(t);for(let e in u)zk(l,e,u[e]);c||zk(l,`pointer-events`,s),zk(l,`clip-path`,t.clip?RO(this,t,t.group):null);let d=null,f=0,p=e=>{let t=this.isDirty(e),n=qhe(e,l,d,o.tag,i);t&&(this._update(o,n,e),c&&Khe(this,n,e,r)),d=n,++f};return o.nested?t.items.length&&p(t.items[0]):$O(t,p),Mk(l,f),l}_update(e,t,n){Aj=t,jj=t.__values__,Mhe(Ik,n),e.attr(Ik,n,this);let r=Mj[e.type];r&&r.call(this,e,t,n),Aj&&this.style(Aj,n)}style(e,t){if(t!=null){for(let n in Cj){let r=n===`font`?Ck(t):t[n];if(r===jj[n])continue;let i=Cj[n];r==null?e.removeAttribute(i):(OO(r)&&(r=qpe(r,this._defs.gradient,Xhe())),e.setAttribute(i,r+``)),jj[n]=r}for(let n in wj)Lk(e,wj[n],t[n])}}defs(){let e=this._svg,t=this._defs,n=t.el,r=0;for(let i in t.gradient)n||(t.el=n=jk(e,1,`defs`,Oj)),r=Whe(n,t.gradient[i],r);for(let i in t.clipping)n||(t.el=n=jk(e,1,`defs`,Oj)),r=Ghe(n,t.clipping[i],r);n&&(r===0?(e.removeChild(n),t.el=null):Mk(n,r))}_clearDefs(){let e=this._defs;e.gradient={},e.clipping={}}},Aj=null,jj=null,Mj={group(e,t,n){let r=Aj=t.childNodes[2];jj=r.__values__,e.foreground(Ik,n,this),jj=t.__values__,Aj=t.childNodes[1],e.content(Ik,n,this);let i=Aj=t.childNodes[0];e.background(Ik,n,this);let a=n.mark.interactive===!1?`none`:null;if(a!==jj.events&&(zk(r,`pointer-events`,a),zk(i,`pointer-events`,a),jj.events=a),n.strokeForeground&&n.stroke){let e=n.fill;zk(r,`display`,null),this.style(i,n),zk(i,`stroke`,null),e&&(n.fill=null),jj=r.__values__,this.style(r,n),e&&(n.fill=e),Aj=null}else zk(r,`display`,`none`)},image(e,t,n){n.smooth===!1?(Lk(t,`image-rendering`,`optimizeSpeed`),Lk(t,`image-rendering`,`pixelated`)):Lk(t,`image-rendering`,null)},text(e,t,n){let r=bk(n),i,a,o,s;H(r)?(a=r.map(e=>Sk(n,e)),i=a.join(` -`),i!==jj.text&&(Mk(t,0),o=t.ownerDocument,s=yk(n),a.forEach((e,r)=>{let i=kk(o,`tspan`,Oj);i.__data__=n,i.textContent=e,r&&(i.setAttribute(`x`,0),i.setAttribute(`dy`,s)),t.appendChild(i)}),jj.text=i)):(a=Sk(n,r),a!==jj.text&&(t.textContent=a,jj.text=a)),zk(t,`font-family`,Ck(n)),zk(t,`font-size`,vk(n)+`px`),zk(t,`font-style`,n.fontStyle),zk(t,`font-variant`,n.fontVariant),zk(t,`font-weight`,n.fontWeight)}},Nj=class extends PA{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){let t=Fk();t.open(`svg`,ug({},EA,{class:`marks`,width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));let n=this._bgcolor;return n&&n!==`transparent`&&n!==`none`&&t.open(`rect`,{width:this._width,height:this._height,fill:n}).close(),t.open(`g`,Tj,{transform:`translate(`+this._origin+`)`}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+``,this}mark(e,t){let n=AA[t.marktype],r=n.tag,i=[Mhe,n.attr];e.open(`g`,{class:bhe(t),"clip-path":t.clip?RO(this,t,t.group):null},Nhe(t),{"pointer-events":r!==`g`&&t.interactive===!1?`none`:null});let a=a=>{let o=this.href(a);if(o&&e.open(`a`,o),e.open(r,this.attr(t,a,i,r===`g`?null:r)),r===`text`){let t=bk(a);if(H(t)){let n={x:0,dy:yk(a)};for(let r=0;rthis.mark(e,t)),e.close(),r&&o?(i&&(a.fill=null),a.stroke=o,e.open(`path`,this.attr(t,a,n.foreground,`bgrect`)).close(),i&&(a.fill=i)):e.open(`path`,this.attr(t,a,n.foreground,`bgfore`)).close()}e.close(),o&&e.close()};return n.nested?t.items&&t.items.length&&a(t.items[0]):$O(t,a),e.close()}href(e){let t=e.href,n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(e=>{e[`xlink:href`]=e.href,e.href=null,(this._hrefs||={})[t]=e})}return null}attr(e,t,n,r){let i={},a=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach(e=>e(a,t,this)):n(a,t,this),r&&Zhe(i,t,e,r,this._defs),i}defs(e){let t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open(`defs`);for(let n in t){let r=t[n],i=r.stops;r.gradient===`radial`?(e.open(`pattern`,{id:Uk+n,viewBox:`0,0,1,1`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid slice`}),e.open(`rect`,{width:`1`,height:`1`,fill:`url(#`+n+`)`}).close(),e.close(),e.open(`radialGradient`,{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open(`linearGradient`,{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t!Pj.svgMarkTypes.includes(e));this._svgRenderer.render(e,Pj.svgMarkTypes),this._canvasRenderer.render(e,n)}resize(e,t,n,r){return super.resize(e,t,n,r),this._svgRenderer.resize(e,t,n,r),this._canvasRenderer.resize(e,t,n,r),this}background(e){return Pj.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}},Ij=class extends ij{constructor(e,t){super(e,t)}initialize(e,t,n){let r=jk(jk(e,0,`div`),+!Pj.svgOnTop,`div`);return super.initialize(r,t,n)}},Lj=`canvas`,Rj=`hybrid`,zj=`png`,Bj=`svg`,Vj=`none`,Hj={Canvas:Lj,PNG:zj,SVG:Bj,Hybrid:Rj,None:Vj},Uj={},Uj[Lj]=Uj[zj]={renderer:oj,headless:oj,handler:ij},Uj[Bj]={renderer:kj,headless:Nj,handler:cj},Uj[Rj]={renderer:Fj,headless:Fj,handler:Ij},Uj[Vj]={},Wj=new zO,Gj=1e-9})),o_e=c({bound:()=>qj,identifier:()=>Yj,mark:()=>Xj,overlap:()=>Zj,render:()=>Qj,viewlayout:()=>cM});function qj(e){G.call(this,null,e)}function Jj(e,t,n){return t(e.bounds.clear(),e,n)}function Yj(e){G.call(this,0,e)}function s_e(e){return e._signals[qM]||(e._signals[qM]=e.add(0))}function Xj(e){G.call(this,null,e)}function c_e(e){let t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function Zj(e){G.call(this,null,e)}function Qj(e){G.call(this,null,e)}function $j(e,t,n){return e[t]===n?0:(e[t]=n,1)}function l_e(e){var t=e.items[0].orient;return t===uM||t===dM}function u_e(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function d_e(e,t,n,r){var i=t.items[0],a=i.datum,o=i.translate==null?.5:i.translate,s=i.orient,c=u_e(a),l=i.range,u=i.offset,d=i.position,f=i.minExtent,p=i.maxExtent,m=a.title&&i.items[c[2]].items[0],h=i.titlePadding,g=i.bounds,_=m&&xk(m),v=0,y=0,b,x;switch(tN.clear().union(g),g.clear(),(b=c[0])>-1&&g.union(i.items[b].bounds),(b=c[1])>-1&&g.union(i.items[b].bounds),s){case lM:v=d||0,y=-u,x=Math.max(f,Math.min(p,-g.y1)),g.add(0,-x).add(l,0),m&&eM(e,m,x,h,_,0,-1,g);break;case uM:v=-u,y=d||0,x=Math.max(f,Math.min(p,-g.x1)),g.add(-x,0).add(0,l),m&&eM(e,m,x,h,_,1,-1,g);break;case dM:v=n+u,y=d||0,x=Math.max(f,Math.min(p,g.x2)),g.add(0,0).add(x,l),m&&eM(e,m,x,h,_,1,1,g);break;case fM:v=d||0,y=r+u,x=Math.max(f,Math.min(p,g.y2)),g.add(0,0).add(l,x),m&&eM(e,m,x,h,0,0,1,g);break;default:v=i.x,y=i.y}return UO(g.translate(v,y),i),$j(i,`x`,v+o)|$j(i,`y`,y+o)&&(i.bounds=tN,e.dirty(i),i.bounds=g,e.dirty(i)),i.mark.bounds.clear().union(g)}function eM(e,t,n,r,i,a,o,s){let c=t.bounds;if(t.auto){let s=o*(n+i+r),l=0,u=0;e.dirty(t),a?l=(t.x||0)-(t.x=s):u=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(c.translate(-l,-u)),e.dirty(t)}s.union(c)}function f_e(e){var t=e.items,n=t.length,r=0,i,a;let o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(C=0;C0&&(y[C]+=A/2);if(s&&tM(n.center,KM)&&u!==1)for(C=0;C0&&(b[C]+=j/2);for(C=0;Ci&&(e.warn(`Grid headers exceed limit: `+i),t=t.slice(0,i)),h+=a,v=0,b=t.length;v=0&&(C=n[y])==null;y-=f);s?(w=p==null?C.x:Math.round(C.bounds.x1+p*C.bounds.width()),T=h):(w=h,T=p==null?C.y:Math.round(C.bounds.y1+p*C.bounds.height())),x.union(S.bounds.translate(w-(S.x||0),T-(S.y||0))),S.x=w,S.y=T,e.dirty(S),g=o(g,x[l])}return g}function aM(e,t,n,r,i,a){if(t){e.dirty(t);var o=n,s=n;r?o=Math.round(i.x1+a*i.width()):s=Math.round(i.y1+a*i.height()),t.bounds.translate(o-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=s,e.dirty(t)}}function v_e(e,t){let n=e[t]||{};return(t,r)=>n[t]==null?e[t]==null?r:e[t]:n[t]}function y_e(e,t){let n=-1/0;return e.forEach(e=>{e.offset!=null&&(n=Math.max(n,e.offset))}),n>-1/0?n:t}function b_e(e,t,n,r,i,a,o){let s=v_e(n,t),c=y_e(e,s(`offset`,0)),l=s(`anchor`,_M),u=s(`frame`,SM),d=l===yM?1:l===vM?.5:0,f=u===CM?r.x1+d*r.width():d*(a||i.width()+2*i.x1),p=u===CM?i.y1+d*i.height():d*(o||r.height()+2*r.y1),m={align:UM,bounds:s(`bounds`,WM),columns:s(`direction`)===`vertical`?1:e.length,padding:s(`margin`,8),center:s(`center`),nodirty:!0};switch(t){case uM:m.anchor={x:Math.floor(r.x1)-c,column:yM,y:p,row:l};break;case dM:m.anchor={x:Math.ceil(r.x2)+c,y:p,row:l};break;case lM:m.anchor={y:Math.floor(i.y1)-c,row:yM,x:f,column:l};break;case fM:m.anchor={y:Math.ceil(i.y2)+c,x:f,column:l};break;case pM:m.anchor={x:c,y:c};break;case mM:m.anchor={x:a-c,y:c,column:yM};break;case hM:m.anchor={x:c,y:o-c,row:yM};break;case gM:m.anchor={x:a-c,y:o-c,column:yM,row:yM};break}return m}function x_e(e,t){var n=t.items[0],r=n.datum,i=n.orient,a=n.bounds,o=n.x,s=n.y,c,l;return n._bounds?n._bounds.clear().union(a):n._bounds=a.clone(),a.clear(),C_e(e,n,n.items[0].items[0]),a=S_e(n,a),c=2*n.padding,l=2*n.padding,a.empty()||(c=Math.ceil(a.width()+c),l=Math.ceil(a.height()+l)),r.type===IM&&w_e(n.items[0].items[0].items[0].items),i!==VM&&(n.x=o=0,n.y=s=0),n.width=c,n.height=l,UO(a.set(o,s,o+c,s+l),n),n.mark.bounds.clear().union(a),n}function S_e(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.empty()&&(t.x2=e.padding,t.y2=e.padding),t.x1=e.padding,t.y1=e.padding,t}function C_e(e,t,n){var r=t.padding,i=r-n.x,a=r-n.y;if(!t.datum.title)(i||a)&&sM(e,n,i,a);else{var o=t.items[1].items[0],s=o.anchor,c=t.titlePadding||0,l=r-o.x,u=r-o.y;switch(o.orient){case uM:i+=Math.ceil(o.bounds.width())+c;break;case dM:case fM:break;default:a+=o.bounds.height()+c}switch((i||a)&&sM(e,n,i,a),o.orient){case uM:u+=oM(t,n,o,s,1,1);break;case dM:l+=oM(t,n,o,yM,0,0)+c,u+=oM(t,n,o,s,1,1);break;case fM:l+=oM(t,n,o,s,0,0),u+=oM(t,n,o,yM,-1,0,1)+c;break;default:l+=oM(t,n,o,s,0,0)}(l||u)&&sM(e,o,l,u),(l=Math.round(o.bounds.x1-r))<0&&(sM(e,n,-l,0),sM(e,o,-l,0))}}function oM(e,t,n,r,i,a,o){let s=e.datum.type!==`symbol`,c=n.datum.vgrad,l=(s&&(a||!c)&&!o?t.items[0]:t).bounds[i?`y2`:`x2`]-e.padding,u=c&&a?l:0,d=c&&a?0:l,f=i<=0?0:xk(n);return Math.round(r===_M?u:r===yM?d-f:.5*(l-f))}function sM(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function w_e(e){let t=e.reduce((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e),{});e.forEach(e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y})}function T_e(e,t,n,r,i){var a=t.items[0],o=a.frame,s=a.orient,c=a.anchor,l=a.offset,u=a.padding,d=a.items[0].items[0],f=a.items[1]&&a.items[1].items[0],p=s===uM||s===dM?r:n,m=0,h=0,g=0,_=0,v=0,y;if(o===SM?s===uM&&(m=r,p=0):s===uM?(m=i.y2,p=i.y1):s===dM?(m=i.y1,p=i.y2):(m=i.x1,p=i.x2),y=c===_M?m:c===yM?p:(m+p)/2,f&&f.text){switch(s){case lM:case fM:v=d.bounds.height()+u;break;case uM:_=d.bounds.width()+u;break;case dM:_=-d.bounds.width()-u;break}tN.clear().union(f.bounds),tN.translate(_-(f.x||0),v-(f.y||0)),$j(f,`x`,_)|$j(f,`y`,v)&&(e.dirty(f),f.bounds.clear().union(tN),f.mark.bounds.clear().union(tN),e.dirty(f)),tN.clear().union(f.bounds)}else tN.clear();switch(tN.union(d.bounds),s){case lM:h=y,g=i.y1-tN.height()-l;break;case uM:h=i.x1-tN.width()-l,g=y;break;case dM:h=i.x2+tN.width()+l,g=y;break;case fM:h=y,g=i.y2+l;break;default:h=a.x,g=a.y}return $j(a,`x`,h)|$j(a,`y`,g)&&(tN.translate(h,g),e.dirty(a),a.bounds.clear().union(tN),t.bounds.clear().union(tN),e.dirty(a)),a.bounds}function cM(e){G.call(this,null,e)}function E_e(e){return e&&e.mark.role!==`legend-entry`}function D_e(e,t,n){var r=t.items,i=Math.max(0,t.width||0),a=Math.max(0,t.height||0),o=new zO().set(0,0,i,a),s=o.clone(),c=o.clone(),l=[],u,d,f,p,m,h;for(m=0,h=r.length;m{f=e.orient||dM,f!==VM&&(t[f]||(t[f]=[])).push(e)});for(let r in t){let o=t[r];rM(e,o,b_e(o,r,n.legends,s,c,i,a))}l.forEach(t=>{let r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),n.autosize&&(n.autosize.type===LM||n.autosize.type===RM||n.autosize.type===zM))switch(t.orient){case uM:case dM:o.add(r.x1,0).add(r.x2,0);break;case lM:case fM:o.add(0,r.y1).add(0,r.y2)}else o.union(r)})}o.union(s).union(c),u&&o.union(T_e(e,u,i,a,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),O_e(e,t,o,n)}function O_e(e,t,n,r){let i=r.autosize||{},a=i.type;if(e._autosize<1||!a)return;let o=e._width,s=e._height,c=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,t.height||0),d=Math.max(0,Math.ceil(-n.y1)),f=Math.max(0,Math.ceil(n.x2-c)),p=Math.max(0,Math.ceil(n.y2-u));if(i.contains===FM){let t=e.padding();o-=t.left+t.right,s-=t.top+t.bottom}a===VM?(l=0,d=0,c=o,u=s):a===LM?(c=Math.max(0,o-l-f),u=Math.max(0,s-d-p)):a===RM?(c=Math.max(0,o-l-f),s=u+d+p):a===zM?(o=c+l+f,u=Math.max(0,s-d-p)):a===BM&&(o=c+l+f,s=u+d+p),e._resizeView(o,s,c,u,[l,d],i.resize)}var lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM,qM,JM,YM,XM,ZM,QM,$M,eN,tN,nN,rN,k_e=o((()=>{Xx(),Kj(),Ag(),lM=`top`,uM=`left`,dM=`right`,fM=`bottom`,pM=`top-left`,mM=`top-right`,hM=`bottom-left`,gM=`bottom-right`,_M=`start`,vM=`middle`,yM=`end`,bM=`x`,xM=`y`,SM=`group`,CM=`bounds`,wM=`axis`,TM=`title`,EM=`frame`,DM=`scope`,OM=`legend`,kM=`row-header`,AM=`row-footer`,jM=`row-title`,MM=`column-header`,NM=`column-footer`,PM=`column-title`,FM=`padding`,IM=`symbol`,LM=`fit`,RM=`fit-x`,zM=`fit-y`,BM=`pad`,VM=`none`,HM=`all`,UM=`each`,WM=`flush`,GM=`column`,KM=`row`,U(qj,G,{transform(e,t){let n=t.dataflow,r=e.mark,i=r.marktype,a=AA[i],o=a.bound,s=r.bounds,c;if(a.nested)r.items.length&&n.dirty(r.items[0]),s=Jj(r,o),r.items.forEach(e=>{e.bounds.clear().union(s)});else if(i===SM||e.modified())switch(t.visit(t.MOD,e=>n.dirty(e)),s.clear(),r.items.forEach(e=>s.union(Jj(e,o))),r.role){case wM:case OM:case TM:t.reflow()}else c=t.changed(t.REM),t.visit(t.ADD,e=>{s.union(Jj(e,o))}),t.visit(t.MOD,e=>{c||=s.alignsWith(e.bounds),n.dirty(e),s.union(Jj(e,o))}),c&&(s.clear(),r.items.forEach(e=>s.union(e.bounds)));return ige(r),t.modifies(`bounds`)}}),qM=`:vega_identifier:`,Yj.Definition={type:`Identifier`,metadata:{modifies:!0},params:[{name:`as`,type:`string`,required:!0}]},U(Yj,G,{transform(e,t){let n=s_e(t.dataflow),r=e.as,i=n.value;return t.visit(t.ADD,e=>e[r]=e[r]||++i),n.set(this.value=i),t}}),U(Xj,G,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,c_e(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);let r=n.marktype===SM?VO:BO;return t.visit(t.ADD,e=>r.call(e,n)),(e.modified(`clip`)||e.modified(`interactive`))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}}),JM={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((e,r)=>!r||!YM(n.bounds,e.bounds,t)?(n=e,1):e.opacity=0)}},YM=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),XM=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,a;n{let t=e.bounds;return t.width()>1&&t.height()>1},QM=(e,t,n)=>{var r=e.range(),i=new zO;return t===lM||t===fM?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),e=>i.encloses(e.bounds)},$M=e=>(e.forEach(e=>e.opacity=1),e),eN=(e,t)=>e.reflow(t.modified()).modifies(`opacity`),U(Zj,G,{transform(e,t){let n=JM[e.method]||JM.parity,r=e.separation||0,i=t.materialize(t.SOURCE).source,a,o;if(!i||!i.length)return;if(!e.method)return e.modified(`method`)&&($M(i),t=eN(t,e)),t;if(i=i.filter(ZM),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),a=$M(i),t=eN(t,e),a.length>=3&&XM(a,r)){do a=n(a,r);while(a.length>=3&&XM(a,r));a.length<3&&!jh(i).opacity&&(a.length>1&&(jh(a).opacity=0),jh(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=QM(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(e=>{o(e)||(e.opacity=0)}));let s=a[0].mark.bounds.clear();return i.forEach(e=>{e.opacity&&s.union(e.bounds)}),t}}),U(Qj,G,{transform(e,t){let n=t.dataflow;if(t.visit(t.ALL,e=>n.dirty(e)),t.fields&&t.fields.zindex){let e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}}),tN=new zO,nN=(e,t)=>Math.floor(Math.min(e,t)),rN=(e,t)=>Math.ceil(Math.max(e,t)),U(cM,G,{transform(e,t){let n=t.dataflow;return e.mark.items.forEach(t=>{e.layout&&h_e(n,t,e.layout),D_e(n,t,e)}),E_e(e.mark.group)?t.reflow():t}})})),A_e=c({axisticks:()=>iN,datajoin:()=>aN,encode:()=>oN,legendentries:()=>sN,linkpath:()=>cN,pie:()=>lN,scale:()=>dN,sortitems:()=>hN,stack:()=>gN});function iN(e){G.call(this,null,e)}function aN(e){G.call(this,null,e)}function j_e(){return ix({})}function M_e(e){let t=mg().test(e=>e.exit);return t.lookup=n=>t.get(e(n)),t}function oN(e){G.call(this,null,e)}function sN(e){G.call(this,[],e)}function cN(e){G.call(this,{},e)}function lN(e){G.call(this,null,e)}function N_e(e){let t=e.type;return!e.bins&&(t===`linear`||t===`pow`||t===`sqrt`)}function uN(e){return QD(e)&&e!==`sequential`}function dN(e){G.call(this,null,e),this.modified(!0)}function P_e(e){var t=e.type,n=``,r;return t===`sequential`?uO+`-`+sO:(F_e(e)&&(r=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=r===2?uO+`-`:r===3?dO+`-`:``),(n+t||`linear`).toLowerCase())}function F_e(e){let t=e.type;return QD(t)&&t!==`time`&&t!==`utc`&&(e.scheme||e.range&&e.range.length&&e.range.every(xg))}function I_e(e,t,n){let r=L_e(e,t.domainRaw,n);if(r>-1)return r;var i=t.domain,a=e.type,o=t.zero||t.zero===void 0&&N_e(e),s,c;if(!i)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(s=(i=i.slice()).length-1||1,o&&(i[0]>0&&(i[0]=0),i[s]<0&&(i[s]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[s]=t.domainMax),t.domainMid!=null)){c=t.domainMid;let e=c>i[s]?s+1:ce+(t<0?-1:+(t>0)),0))!==t.length&&n.warn(`Log scale domain includes zero: `+W(t)),t}function z_e(e,t,n){let r=t.bins;if(r&&!H(r)){let t=e.domain(),n=t[0],i=jh(t),a=r.step,o=r.start==null?n:r.start,s=r.stop==null?i:r.stop;a||V(`Scale bins parameter missing step property.`),oi&&(s=a*Math.floor(i/a)),r=n_(o,s+a/2,a)}return r?e.bins=r:e.bins&&delete e.bins,e.type===`bin-ordinal`&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function B_e(e,t,n){var r=e.type,i=t.round||!1,a=t.range;if(t.rangeStep!=null)a=V_e(r,t,n);else if(t.scheme&&(a=H_e(r,t,n),ig(a))){if(e.interpolator)return e.interpolator(a);V(`Scale type ${r} does not support interpolating color schemes.`)}if(a&&lpe(r))return e.interpolator(nO(mN(a,t.reverse),t.interpolate,t.interpolateGamma));a&&t.interpolate&&e.interpolate?e.interpolate(rO(t.interpolate,t.interpolateGamma)):ig(e.round)?e.round(i):ig(e.rangeRound)&&e.interpolate(i?gD:mD),a&&e.range(mN(a,t.reverse))}function V_e(e,t,n){e!==`band`&&e!==`point`&&V(`Only band and point scales support rangeStep.`);var r=(t.paddingOuter==null?t.padding:t.paddingOuter)||0,i=e===`point`?1:(t.paddingInner==null?t.padding:t.paddingInner)||0;return[0,t.rangeStep*JD(n,i,r)]}function H_e(e,t,n){var r=t.schemeExtent,i,a;return H(t.scheme)?a=nO(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),a=iO(i),a||V(`Unrecognized scheme name: ${t.scheme}`)),n=e===`threshold`?n+1:e===`bin-ordinal`?n-1:e===`quantile`||e===`quantize`?+t.schemeCount||PN:n,lpe(e)?pN(a,r,t.reverse):ig(a)?fpe(pN(a,r),n):e===`ordinal`?a:a.slice(0,n)}function pN(e,t,n){return ig(e)&&(t||n)?dpe(e,mN(t||[0,1],n)):e}function mN(e,t){return t?e.slice().reverse():e}function hN(e){G.call(this,null,e)}function gN(e){G.call(this,null,e)}function U_e(e,t,n,r,i){for(var a=(t-e.sum)/2,o=e.length,s=0,c;se(u),o,s,c,l,u,d,f,p,m;if(t==null)i.push(e.slice());else for(o={},s=0,c=e.length;sm&&(m=p),n&&f.sort(n)}return i.max=m,i}var _N,vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN,PN,FN,IN,LN,RN,zN,q_e=o((()=>{Xx(),DO(),Ag(),r_(),xD(),U(iN,G,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,a=e.scale,o=aO(a,e.count==null?e.values?e.values.length:10:e.count,e.minstep),s=e.format||vpe(n,a,o,e.formatSpecifier,e.formatType,!!e.values),c=e.values?_pe(a,e.values,o):oO(a,o);return i&&(r.rem=i),i=c.map((e,t)=>ix({index:t/(c.length-1||1),tickIndex:t,value:e,label:s(e)})),e.extra&&i.length&&i.push(ix({index:-1,tickIndex:-1,extra:{value:i[0].value},label:``})),r.source=i,r.add=i,this.value=i,r}}),U(aN,G,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||j_e,a=e.key||nx,o=this.value;return H(r.encode)&&(r.encode=null),o&&(e.modified(`key`)||t.modified(a))&&V(`DataJoin does not support modified key function or fields.`),o||(t=t.addAll(),this.value=o=M_e(a)),t.visit(t.ADD,e=>{let t=a(e),n=o.get(t);n?n.exit?(o.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),o.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1}),t.visit(t.MOD,e=>{let t=a(e),n=o.get(t);n&&(n.datum=e,r.mod.push(n))}),t.visit(t.REM,e=>{let t=a(e),n=o.get(t);e===n.datum&&!n.exit&&(r.rem.push(n),n.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&r.modifies(`datum`),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),r}}),U(oN,G,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,a=t.encode;if(H(a))if(n.changed()||a.every(e=>i[e]))a=a[0],n.encode=null;else return t.StopPropagation;var o=a===`enter`,s=i.update||Sh,c=i.enter||Sh,l=i.exit||Sh,u=(a&&!o?i[a]:s)||Sh;if(t.changed(t.ADD)&&(t.visit(t.ADD,t=>{c(t,e),s(t,e)}),n.modifies(c.output),n.modifies(s.output),u!==Sh&&u!==s&&(t.visit(t.ADD,t=>{u(t,e)}),n.modifies(u.output))),t.changed(t.REM)&&l!==Sh&&(t.visit(t.REM,t=>{l(t,e)}),n.modifies(l.output)),o||u!==Sh){let i=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(i,t=>{let i=c(t,e)||r;(u(t,e)||i)&&n.mod.push(t)}),n.mod.length&&n.modifies(c.output)):t.visit(i,t=>{(u(t,e)||r)&&n.mod.push(t)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:t.StopPropagation}}),U(sN,G,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,a=e.type||`symbol`,o=e.scale,s=+e.limit,c=aO(o,e.count==null?5:e.count,e.minstep),l=!!e.values||a===`symbol`,u=e.format||wpe(n,o,c,a,e.formatSpecifier,e.formatType,l),d=e.values||bpe(o,c),f,p,m,h,g;return i&&(r.rem=i),a===`symbol`?(s&&d.length>s?(t.dataflow.warn(`Symbol legend count exceeds limit, filtering items.`),i=d.slice(0,s-1),g=!0):i=d,ig(m=e.size)?(!e.values&&o(i[0])===0&&(i=i.slice(1)),h=i.reduce((t,n)=>Math.max(t,m(n,e)),0)):m=cg(h=m||8),i=i.map((t,n)=>ix({index:n,label:u(t,n,i),value:t,offset:h,size:m(t,e)})),g&&(g=d[i.length],i.push(ix({index:i.length,label:`\u2026${d.length-i.length} entries`,value:g,offset:h,size:m(g,e)})))):a===`gradient`?(f=o.domain(),p=ppe(o,f[0],jh(f)),d.length<3&&!e.values&&f[0]!==jh(f)&&(d=[f[0],jh(f)]),i=d.map((e,t)=>ix({index:t,label:u(e,t,d),value:e,perc:p(e)}))):(m=d.length-1,p=Tpe(o),i=d.map((e,t)=>ix({index:t,label:u(e,t,d),value:e,perc:t?p(e):0,perc2:t===m?1:p(d[t+1])}))),r.source=i,r.add=i,this.value=i,r}}),_N=e=>e.source.x,vN=e=>e.source.y,yN=e=>e.target.x,bN=e=>e.target.y,cN.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`}]},U(cN,G,{transform(e,t){var n=e.sourceX||_N,r=e.sourceY||vN,i=e.targetX||yN,a=e.targetY||bN,o=e.as||`path`,s=e.orient||`vertical`,c=e.shape||`line`,l=NN.get(c+`-`+s)||NN.get(c);return l||V(`LinkPath unsupported type: `+e.shape+(e.orient?`-`+e.orient:``)),t.visit(t.SOURCE,e=>{e[o]=l(n(e),r(e),i(e),a(e))}),t.reflow(e.modified()).modifies(o)}}),xN=(e,t,n,r)=>`M`+e+`,`+t+`L`+n+`,`+r,SN=(e,t,n,r)=>xN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),CN=(e,t,n,r)=>{var i=n-e,a=r-t,o=Math.hypot(i,a)/2,s=180*Math.atan2(a,i)/Math.PI;return`M`+e+`,`+t+`A`+o+`,`+o+` `+s+` 0 1 `+n+`,`+r},wN=(e,t,n,r)=>CN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),TN=(e,t,n,r)=>{let i=n-e,a=r-t,o=.2*(i+a),s=.2*(a-i);return`M`+e+`,`+t+`C`+(e+o)+`,`+(t+s)+` `+(n+s)+`,`+(r-o)+` `+n+`,`+r},EN=(e,t,n,r)=>TN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),DN=(e,t,n,r)=>`M`+e+`,`+t+`V`+r+`H`+n,ON=(e,t,n,r)=>`M`+e+`,`+t+`H`+n+`V`+r,kN=(e,t,n,r)=>{let i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),c=Math.abs(n-e)>Math.PI?n<=e:n>e;return`M`+t*i+`,`+t*a+`A`+t+`,`+t+` 0 0,`+ +!!c+` `+t*o+`,`+t*s+`L`+r*o+`,`+r*s},AN=(e,t,n,r)=>{let i=(e+n)/2;return`M`+e+`,`+t+`C`+i+`,`+t+` `+i+`,`+r+` `+n+`,`+r},jN=(e,t,n,r)=>{let i=(t+r)/2;return`M`+e+`,`+t+`C`+e+`,`+i+` `+n+`,`+i+` `+n+`,`+r},MN=(e,t,n,r)=>{let i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),c=(t+r)/2;return`M`+t*i+`,`+t*a+`C`+c*i+`,`+c*a+` `+c*o+`,`+c*s+` `+r*o+`,`+r*s},NN=mg({line:xN,"line-radial":SN,arc:CN,"arc-radial":wN,curve:TN,"curve-radial":EN,"orthogonal-horizontal":DN,"orthogonal-vertical":ON,"orthogonal-radial":kN,"diagonal-horizontal":AN,"diagonal-vertical":jN,"diagonal-radial":MN}),lN.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`]}]},U(lN,G,{transform(e,t){var n=e.as||[`startAngle`,`endAngle`],r=n[0],i=n[1],a=e.field||bh,o=e.startAngle||0,s=e.endAngle==null?2*Math.PI:e.endAngle,c=t.source,l=c.map(a),u=l.length,d=o,f=(s-o)/Noe(l),p=n_(u),m,h,g;for(e.sort&&p.sort((e,t)=>l[e]-l[t]),m=0;m1?0:e<-1?UN:Math.acos(e)}function VN(e){return e>1?WN:e<-1?-WN:Math.asin(e)}var HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP,oP,sP,cP=o((()=>{HN=1e-6,UN=Math.PI,WN=UN/2,GN=UN/4,KN=UN*2,qN=180/UN,JN=UN/180,YN=Math.abs,XN=Math.atan,ZN=Math.atan2,QN=Math.cos,$N=Math.ceil,eP=Math.exp,tP=Math.hypot,nP=Math.log,rP=Math.pow,iP=Math.sin,aP=Math.sign||function(e){return e>0?1:e<0?-1:0},oP=Math.sqrt,sP=Math.tan}));function lP(){}var uP=o((()=>{}));function dP(e,t){e&&gP.hasOwnProperty(e.type)&&gP[e.type](e,t)}function fP(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r{hP={Feature:function(e,t){dP(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,a=QN(t),o=iP(t),s=TP*o,c=wP*a+s*QN(i),l=s*r*iP(i);yP.add(ZN(l,c)),CP=e,wP=a,TP=o}function Z_e(e){return bP=new Ug,mP(e,EP),bP*2}var yP,bP,xP,SP,CP,wP,TP,EP,DP=o((()=>{r_(),cP(),uP(),_P(),yP=new Ug,bP=new Ug,EP={point:lP,lineStart:lP,lineEnd:lP,polygonStart:function(){yP=new Ug,EP.lineStart=J_e,EP.lineEnd=Y_e},polygonEnd:function(){var e=+yP;bP.add(e<0?KN+e:e),this.lineStart=this.lineEnd=this.point=lP},sphere:function(){bP.add(KN)}}}));function OP(e){return[ZN(e[1],e[0]),VN(e[2])]}function kP(e){var t=e[0],n=e[1],r=QN(n);return[r*QN(t),r*iP(t),iP(n)]}function AP(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function jP(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function MP(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function NP(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function PP(e){var t=oP(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var FP=o((()=>{cP()}));function IP(e,t){QP.push($P=[UP=e,GP=e]),tKP&&(KP=t)}function LP(e,t){var n=kP([e*JN,t*JN]);if(XP){var r=jP(XP,n),i=jP([r[1],-r[0],0],r);PP(i),i=OP(i);var a=e-qP,o=a>0?1:-1,s=i[0]*qN*o,c,l=YN(a)>180;l^(o*qPKP&&(KP=c)):(s=(s+360)%360-180,l^(o*qPKP&&(KP=t))),l?eVP(UP,GP)&&(GP=e):VP(e,GP)>VP(UP,GP)&&(UP=e):GP>=UP?(eGP&&(GP=e)):e>qP?VP(UP,e)>VP(UP,GP)&&(GP=e):VP(e,GP)>VP(UP,GP)&&(UP=e)}else QP.push($P=[UP=e,GP=e]);tKP&&(KP=t),XP=n,qP=e}function RP(){eF.point=LP}function zP(){$P[0]=UP,$P[1]=GP,eF.point=IP,XP=null}function BP(e,t){if(XP){var n=e-qP;ZP.add(YN(n)>180?n+(n>0?360:-360):n)}else JP=e,YP=t;EP.point(e,t),LP(e,t)}function Q_e(){EP.lineStart()}function $_e(){BP(JP,YP),EP.lineEnd(),YN(ZP)>1e-6&&(UP=-(GP=180)),$P[0]=UP,$P[1]=GP,XP=null}function VP(e,t){return(t-=e)<0?t+360:t}function eve(e,t){return e[0]-t[0]}function HP(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tVP(r[0],r[1])&&(r[1]=i[1]),VP(i[0],r[1])>VP(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,n=a.length-1,t=0,r=a[n];t<=n;r=i,++t)i=a[t],(s=VP(r[1],i[0]))>o&&(o=s,UP=i[0],GP=r[1])}return QP=$P=null,UP===1/0||WP===1/0?[[NaN,NaN],[NaN,NaN]]:[[UP,WP],[GP,KP]]}var UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,nve=o((()=>{r_(),DP(),FP(),cP(),_P(),eF={point:IP,lineStart:RP,lineEnd:zP,polygonStart:function(){eF.point=BP,eF.lineStart=Q_e,eF.lineEnd=$_e,ZP=new Ug,EP.polygonStart()},polygonEnd:function(){EP.polygonEnd(),eF.point=IP,eF.lineStart=RP,eF.lineEnd=zP,yP<0?(UP=-(GP=180),WP=-(KP=90)):ZP>1e-6?KP=90:ZP<-1e-6&&(WP=-90),$P[0]=UP,$P[1]=GP},sphere:function(){UP=-(GP=180),WP=-(KP=90)}}}));function tF(e,t){e*=JN,t*=JN;var n=QN(t);nF(n*QN(e),n*iP(e),iP(t))}function nF(e,t,n){++oF,cF+=(e-cF)/oF,lF+=(t-lF)/oF,uF+=(n-uF)/oF}function rF(){SF.point=rve}function rve(e,t){e*=JN,t*=JN;var n=QN(t);yF=n*QN(e),bF=n*iP(e),xF=iP(t),SF.point=ive,nF(yF,bF,xF)}function ive(e,t){e*=JN,t*=JN;var n=QN(t),r=n*QN(e),i=n*iP(e),a=iP(t),o=ZN(oP((o=bF*a-xF*i)*o+(o=xF*r-yF*a)*o+(o=yF*i-bF*r)*o),yF*r+bF*i+xF*a);sF+=o,dF+=o*(yF+(yF=r)),fF+=o*(bF+(bF=i)),pF+=o*(xF+(xF=a)),nF(yF,bF,xF)}function iF(){SF.point=tF}function ave(){SF.point=sve}function ove(){aF(_F,vF),SF.point=tF}function sve(e,t){_F=e,vF=t,e*=JN,t*=JN,SF.point=aF;var n=QN(t);yF=n*QN(e),bF=n*iP(e),xF=iP(t),nF(yF,bF,xF)}function aF(e,t){e*=JN,t*=JN;var n=QN(t),r=n*QN(e),i=n*iP(e),a=iP(t),o=bF*a-xF*i,s=xF*r-yF*a,c=yF*i-bF*r,l=tP(o,s,c),u=VN(l),d=l&&-u/l;mF.add(d*o),hF.add(d*s),gF.add(d*c),sF+=u,dF+=u*(yF+(yF=r)),fF+=u*(bF+(bF=i)),pF+=u*(xF+(xF=a)),nF(yF,bF,xF)}function cve(e){oF=sF=cF=lF=uF=dF=fF=pF=0,mF=new Ug,hF=new Ug,gF=new Ug,mP(e,SF);var t=+mF,n=+hF,r=+gF,i=tP(t,n,r);return i<1e-12&&(t=dF,n=fF,r=pF,sF<1e-6&&(t=cF,n=lF,r=uF),i=tP(t,n,r),i<1e-12)?[NaN,NaN]:[ZN(n,t)*qN,VN(r/i)*qN]}var oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,lve=o((()=>{r_(),cP(),uP(),_P(),SF={sphere:lP,point:tF,lineStart:rF,lineEnd:iF,polygonStart:function(){SF.lineStart=ave,SF.lineEnd=ove},polygonEnd:function(){SF.lineStart=rF,SF.lineEnd=iF}}}));function CF(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}var wF=o((()=>{}));function TF(e,t){return YN(e)>UN&&(e-=Math.round(e/KN)*KN),[e,t]}function EF(e,t,n){return(e%=KN)?t||n?CF(OF(e),kF(t,n)):OF(e):t||n?kF(t,n):TF}function DF(e){return function(t,n){return t+=e,YN(t)>UN&&(t-=Math.round(t/KN)*KN),[t,n]}}function OF(e){var t=DF(e);return t.invert=DF(-e),t}function kF(e,t){var n=QN(e),r=iP(e),i=QN(t),a=iP(t);function o(e,t){var o=QN(t),s=QN(e)*o,c=iP(e)*o,l=iP(t),u=l*n+s*r;return[ZN(c*i-u*a,s*n-l*r),VN(u*i+c*a)]}return o.invert=function(e,t){var o=QN(t),s=QN(e)*o,c=iP(e)*o,l=iP(t),u=l*i-c*a;return[ZN(c*i+l*a,s*n+u*r),VN(u*n-s*r)]},o}function uve(e){e=EF(e[0]*JN,e[1]*JN,e.length>2?e[2]*JN:0);function t(t){return t=e(t[0]*JN,t[1]*JN),t[0]*=qN,t[1]*=qN,t}return t.invert=function(t){return t=e.invert(t[0]*JN,t[1]*JN),t[0]*=qN,t[1]*=qN,t},t}var AF=o((()=>{wF(),cP(),TF.invert=TF}));function dve(e,t,n,r,i,a){if(n){var o=QN(t),s=iP(t),c=r*n;i==null?(i=t+r*KN,a=t-c/2):(i=jF(o,i),a=jF(o,a),(r>0?ia)&&(i+=r*KN));for(var l,u=i;r>0?u>a:u{FP(),cP()}));function NF(){var e=[],t;return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:lP,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}var PF=o((()=>{uP()}));function FF(e,t){return YN(e[0]-t[0])<1e-6&&YN(e[1]-t[1])<1e-6}var IF=o((()=>{cP()}));function LF(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function RF(e,t,n,r,i){var a=[],o=[],s,c;if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t],c;if(FF(n,r)){if(!n[2]&&!r[2]){for(i.lineStart(),s=0;s=0;--s)i.point((d=u[s])[0],d[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,u=f.z,p=!p}while(!f.v);i.lineEnd()}}}function zF(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n{IF(),cP()}));function VF(e){return YN(e[0])<=UN?e[0]:aP(e[0])*((YN(e[0])+UN)%KN-UN)}function fve(e,t){var n=VF(t),r=t[1],i=iP(r),a=[iP(n),-QN(n),0],o=0,s=0,c=new Ug;i===1?r=WN+HN:i===-1&&(r=-WN-HN);for(var l=0,u=e.length;l=0?1:-1,E=T*w,D=E>UN,O=g*S;if(c.add(ZN(O*T*iP(E),_*C+O*QN(E))),o+=D?w+T*KN:w,D^m>=n^b>=n){var k=jP(kP(p),kP(y));PP(k);var A=jP(a,k);PP(A);var j=(D^w>=0?-1:1)*VN(A[2]);(r>j||r===j&&(k[0]||k[1]))&&(s+=D^w>=0?1:-1)}}return(o<-1e-6||o<1e-6&&c<-1e-12)^s&1}var HF=o((()=>{r_(),FP(),cP()}));function UF(e,t,n,r){return function(i){var a=t(i),o=NF(),s=t(o),c=!1,l,u,d,f={point:p,lineStart:h,lineEnd:g,polygonStart:function(){f.point=_,f.lineStart=v,f.lineEnd=y,u=[],l=[]},polygonEnd:function(){f.point=p,f.lineStart=h,f.lineEnd=g,u=Aoe(u);var e=fve(l,r);u.length?(c||=(i.polygonStart(),!0),RF(u,mve,e,n,i)):e&&(c||=(i.polygonStart(),!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&=(i.polygonEnd(),!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(t,n){e(t,n)&&i.point(t,n)}function m(e,t){a.point(e,t)}function h(){f.point=m,a.lineStart()}function g(){f.point=p,a.lineEnd()}function _(e,t){d.push([e,t]),s.point(e,t)}function v(){s.lineStart(),d=[]}function y(){_(d[0][0],d[0][1]),s.lineEnd();var e=s.clean(),t=o.result(),n,r=t.length,a,f,p;if(d.pop(),l.push(d),d=null,r){if(e&1){if(f=t[0],(a=f.length-1)>0){for(c||=(i.polygonStart(),!0),i.lineStart(),n=0;n1&&e&2&&t.push(t.pop().concat(t.shift())),u.push(t.filter(pve))}}return f}}function pve(e){return e.length>1}function mve(e,t){return((e=e.x)[0]<0?e[1]-WN-HN:WN-e[1])-((t=t.x)[0]<0?t[1]-WN-HN:WN-t[1])}var WF=o((()=>{PF(),BF(),cP(),HF(),r_()}));function hve(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,o){var s=a>0?UN:-UN,c=YN(a-t);YN(c-UN)<1e-6?(e.point(t,n=(n+o)/2>0?WN:-WN),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(a,n),i=0):r!==s&&c>=UN&&(YN(t-r)<1e-6&&(t-=r*HN),YN(a-s)<1e-6&&(a-=s*HN),n=gve(t,n,a,o),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),i=0),e.point(t=a,n=o),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function gve(e,t,n,r){var i,a,o=iP(e-n);return YN(o)>1e-6?XN((iP(t)*(a=QN(r))*iP(n)-iP(r)*(i=QN(t))*iP(e))/(i*a*o)):(t+r)/2}function _ve(e,t,n,r){var i;if(e==null)i=n*WN,r.point(-UN,i),r.point(0,i),r.point(UN,i),r.point(UN,0),r.point(UN,-i),r.point(0,-i),r.point(-UN,-i),r.point(-UN,0),r.point(-UN,i);else if(YN(e[0]-t[0])>1e-6){var a=e[0]{WF(),cP(),GF=UF(function(){return!0},hve,_ve,[-UN,-WN])}));function vve(e){var t=QN(e),n=2*JN,r=t>0,i=YN(t)>HN;function a(t,r,i,a){dve(a,e,n,i,t,r)}function o(e,n){return QN(e)*QN(n)>t}function s(e){var t,n,a,s,u;return{lineStart:function(){s=a=!1,u=1},point:function(d,f){var p=[d,f],m,h=o(d,f),g=r?h?0:l(d,f):h?l(d+(d<0?UN:-UN),f):0;if(!t&&(s=a=h)&&e.lineStart(),h!==a&&(m=c(t,p),(!m||FF(t,m)||FF(p,m))&&(p[2]=1)),h!==a)u=0,h?(e.lineStart(),m=c(p,t),e.point(m[0],m[1])):(m=c(t,p),e.point(m[0],m[1],2),e.lineEnd()),t=m;else if(i&&t&&r^h){var _;!(g&n)&&(_=c(p,t,!0))&&(u=0,r?(e.lineStart(),e.point(_[0][0],_[0][1]),e.point(_[1][0],_[1][1]),e.lineEnd()):(e.point(_[1][0],_[1][1]),e.lineEnd(),e.lineStart(),e.point(_[0][0],_[0][1],3)))}h&&(!t||!FF(t,p))&&e.point(p[0],p[1]),t=p,a=h,n=g},lineEnd:function(){a&&e.lineEnd(),t=null},clean:function(){return u|(s&&a)<<1}}}function c(e,n,r){var i=kP(e),a=kP(n),o=[1,0,0],s=jP(i,a),c=AP(s,s),l=s[0],u=c-l*l;if(!u)return!r&&e;var d=t*c/u,f=-t*l/u,p=jP(o,s),m=NP(o,d);MP(m,NP(s,f));var h=p,g=AP(m,h),_=AP(h,h),v=g*g-_*(AP(m,m)-1);if(!(v<0)){var y=oP(v),b=NP(h,(-g-y)/_);if(MP(b,m),b=OP(b),!r)return b;var x=e[0],S=n[0],C=e[1],w=n[1],T;S0^b[1]<(YN(b[0]-x)<1e-6?C:w):C<=b[1]&&b[1]<=w:E>UN^(x<=b[0]&&b[0]<=S)){var k=NP(h,(-g+y)/_);return MP(k,m),[b,OP(k)]}}}function l(t,n){var i=r?e:UN-e,a=0;return t<-i?a|=1:t>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return UF(o,s,a,r?[0,-e]:[-UN,e-UN])}var qF=o((()=>{FP(),MF(),cP(),IF(),WF()}));function yve(e,t,n,r,i,a){var o=e[0],s=e[1],c=t[0],l=t[1],u=0,d=1,f=c-o,p=l-s,m=n-o;if(!(!f&&m>0)){if(m/=f,f<0){if(m0){if(m>d)return;m>u&&(u=m)}if(m=i-o,!(!f&&m<0)){if(m/=f,f<0){if(m>d)return;m>u&&(u=m)}else if(f>0){if(m0)){if(m/=p,p<0){if(m0){if(m>d)return;m>u&&(u=m)}if(m=a-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m0&&(e[0]=o+u*f,e[1]=s+u*p),d<1&&(t[0]=o+d*f,t[1]=s+d*p),!0}}}}}var bve=o((()=>{}));function JF(e,t,n,r){function i(i,a){return e<=i&&i<=n&&t<=a&&a<=r}function a(i,a,s,l){var u=0,d=0;if(i==null||(u=o(i,s))!==(d=o(a,s))||c(i,a)<0^s>0)do l.point(u===0||u===3?e:n,u>1?r:t);while((u=(u+s+4)%4)!==d);else l.point(a[0],a[1])}function o(r,i){return YN(r[0]-e)<1e-6?i>0?0:3:YN(r[0]-n)<1e-6?i>0?2:1:YN(r[1]-t)<1e-6?+(i>0):i>0?3:2}function s(e,t){return c(e.x,t.x)}function c(e,t){var n=o(e,1),r=o(t,1);return n===r?n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]:n-r}return function(o){var c=o,l=NF(),u,d,f,p,m,h,g,_,v,y,b,x={point:S,lineStart:E,lineEnd:D,polygonStart:w,polygonEnd:T};function S(e,t){i(e,t)&&c.point(e,t)}function C(){for(var t=0,n=0,i=d.length;nr&&(f-l)*(r-u)>(p-u)*(e-l)&&++t:p<=r&&(f-l)*(r-u)<(p-u)*(e-l)&&--t;return t}function w(){c=l,u=[],d=[],b=!0}function T(){var e=C(),t=b&&e,n=(u=Aoe(u)).length;(t||n)&&(o.polygonStart(),t&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),n&&RF(u,s,e,a,o),o.polygonEnd()),c=o,u=d=f=null}function E(){x.point=O,d&&d.push(f=[]),y=!0,v=!1,g=_=NaN}function D(){u&&(O(p,m),h&&v&&l.rejoin(),u.push(l.result())),x.point=S,v&&c.lineEnd()}function O(a,o){var s=i(a,o);if(d&&f.push([a,o]),y)p=a,m=o,h=s,y=!1,s&&(c.lineStart(),c.point(a,o));else if(s&&v)c.point(a,o);else{var l=[g=Math.max(XF,Math.min(YF,g)),_=Math.max(XF,Math.min(YF,_))],u=[a=Math.max(XF,Math.min(YF,a)),o=Math.max(XF,Math.min(YF,o))];yve(l,u,e,t,n,r)?(v||(c.lineStart(),c.point(l[0],l[1])),c.point(u[0],u[1]),s||c.lineEnd(),b=!1):s&&(c.lineStart(),c.point(a,o),b=!1)}g=a,_=o,v=s}return x}}var YF,XF,ZF=o((()=>{cP(),PF(),bve(),BF(),r_(),YF=1e9,XF=-YF}));function QF(e,t,n){var r=n_(e,t-HN,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function $F(e,t,n){var r=n_(e,t-HN,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function xve(){var e,t,n,r,i,a,o,s,c=10,l=c,u=90,d=360,f,p,m,h,g=2.5;function _(){return{type:`MultiLineString`,coordinates:v()}}function v(){return n_($N(r/u)*u,n,u).map(m).concat(n_($N(s/d)*d,o,d).map(h)).concat(n_($N(t/c)*c,e,c).filter(function(e){return YN(e%u)>HN}).map(f)).concat(n_($N(a/l)*l,i,l).filter(function(e){return YN(e%d)>HN}).map(p))}return _.lines=function(){return v().map(function(e){return{type:`LineString`,coordinates:e}})},_.outline=function(){return{type:`Polygon`,coordinates:[m(r).concat(h(o).slice(1),m(n).reverse().slice(1),h(s).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],o=+e[1][1],r>n&&(e=r,r=n,n=e),s>o&&(e=s,s=o,o=e),_.precision(g)):[[r,s],[n,o]]},_.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],a=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),a>i&&(n=a,a=i,i=n),_.precision(g)):[[t,a],[e,i]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(u=+e[0],d=+e[1],_):[u,d]},_.stepMinor=function(e){return arguments.length?(c=+e[0],l=+e[1],_):[c,l]},_.precision=function(c){return arguments.length?(g=+c,f=QF(a,i,90),p=$F(t,e,g),m=QF(s,o,90),h=$F(r,n,g),_):g},_.extentMajor([[-180,-90+HN],[180,90-HN]]).extentMinor([[-180,-80-HN],[180,80+HN]])}var Sve=o((()=>{r_(),cP()})),eI,tI=o((()=>{eI=e=>e}));function Cve(){lI.point=wve}function wve(e,t){lI.point=nI,aI=sI=e,oI=cI=t}function nI(e,t){iI.add(cI*e-sI*t),sI=e,cI=t}function Tve(){nI(aI,oI)}var rI,iI,aI,oI,sI,cI,lI,Eve=o((()=>{r_(),cP(),uP(),rI=new Ug,iI=new Ug,lI={point:lP,lineStart:lP,lineEnd:lP,polygonStart:function(){lI.lineStart=Cve,lI.lineEnd=Tve},polygonEnd:function(){lI.lineStart=lI.lineEnd=lI.point=lP,rI.add(YN(iI)),iI=new Ug},result:function(){var e=rI/2;return rI=new Ug,e}}}));function Dve(e,t){efI&&(fI=e),tpI&&(pI=t)}var uI,dI,fI,pI,mI,hI=o((()=>{uP(),uI=1/0,dI=uI,fI=-uI,pI=fI,mI={point:Dve,lineStart:lP,lineEnd:lP,polygonStart:lP,polygonEnd:lP,result:function(){var e=[[uI,dI],[fI,pI]];return fI=pI=-(dI=uI=1/0),e}}}));function gI(e,t){bI+=e,xI+=t,++SI}function _I(){NI.point=Ove}function Ove(e,t){NI.point=kve,gI(jI=e,MI=t)}function kve(e,t){var n=e-jI,r=t-MI,i=oP(n*n+r*r);CI+=i*(jI+e)/2,wI+=i*(MI+t)/2,TI+=i,gI(jI=e,MI=t)}function vI(){NI.point=gI}function Ave(){NI.point=Mve}function jve(){yI(kI,AI)}function Mve(e,t){NI.point=yI,gI(kI=jI=e,AI=MI=t)}function yI(e,t){var n=e-jI,r=t-MI,i=oP(n*n+r*r);CI+=i*(jI+e)/2,wI+=i*(MI+t)/2,TI+=i,i=MI*e-jI*t,EI+=i*(jI+e),DI+=i*(MI+t),OI+=i*3,gI(jI=e,MI=t)}var bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,Nve=o((()=>{cP(),bI=0,xI=0,SI=0,CI=0,wI=0,TI=0,EI=0,DI=0,OI=0,NI={point:gI,lineStart:_I,lineEnd:vI,polygonStart:function(){NI.lineStart=Ave,NI.lineEnd=jve},polygonEnd:function(){NI.point=gI,NI.lineStart=_I,NI.lineEnd=vI},result:function(){var e=OI?[EI/OI,DI/OI]:TI?[CI/TI,wI/TI]:SI?[bI/SI,xI/SI]:[NaN,NaN];return bI=xI=SI=CI=wI=TI=EI=DI=OI=0,e}}}));function PI(e){this._context=e}var Pve=o((()=>{cP(),uP(),PI.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,KN);break}},result:lP}}));function Fve(e,t){HI.point=FI,RI=BI=e,zI=VI=t}function FI(e,t){BI-=e,VI-=t,II.add(oP(BI*BI+VI*VI)),BI=e,VI=t}var II,LI,RI,zI,BI,VI,HI,Ive=o((()=>{r_(),cP(),uP(),II=new Ug,HI={point:lP,lineStart:function(){HI.point=Fve},lineEnd:function(){LI&&FI(RI,zI),HI.point=lP},polygonStart:function(){LI=!0},polygonEnd:function(){LI=null},result:function(){var e=+II;return II=new Ug,e}}}));function UI(e){let t=1;this._+=e[0];for(let n=e.length;t=0))throw RangeError(`invalid digits: ${e}`);if(t>15)return UI;if(t!==WI){let e=10**t;WI=t,GI=function(t){let n=1;this._+=t[0];for(let r=t.length;n{JI=class{constructor(e){this._append=e==null?UI:Lve(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!==KI||this._append!==GI){let e=this._radius,t=this._;this._=``,this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,KI=e,GI=this._append,qI=this._,this._=t}this._+=qI;break}}result(){let e=this._;return this._=``,e.length?e:null}}}));function YI(e,t){let n=3,r=4.5,i,a;function o(e){return e&&(typeof r==`function`&&a.pointRadius(+r.apply(this,arguments)),mP(e,i(a))),a.result()}return o.area=function(e){return mP(e,i(lI)),lI.result()},o.measure=function(e){return mP(e,i(HI)),HI.result()},o.bounds=function(e){return mP(e,i(mI)),mI.result()},o.centroid=function(e){return mP(e,i(NI)),NI.result()},o.projection=function(t){return arguments.length?(i=t==null?(e=null,eI):(e=t).stream,o):e},o.context=function(e){return arguments.length?(a=e==null?(t=null,new JI(n)):new PI(t=e),typeof r!=`function`&&a.pointRadius(r),o):t},o.pointRadius=function(e){return arguments.length?(r=typeof e==`function`?e:(a.pointRadius(+e),+e),o):r},o.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);n=t}return t===null&&(a=new JI(n)),o},o.projection(e).digits(n).context(t)}var zve=o((()=>{tI(),_P(),Eve(),hI(),Nve(),Pve(),Ive(),Rve()}));function XI(e){return function(t){var n=new ZI;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ZI(){}var QI=o((()=>{ZI.prototype={constructor:ZI,point:function(e,t){this.stream.point(e,t)},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 $I(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),mP(n,e.stream(mI)),t(mI.result()),r!=null&&e.clipExtent(r),e}function eL(e,t,n){return $I(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+t[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-a*(n[1][1]+n[0][1]))/2;e.scale(150*a).translate([o,s])},n)}function tL(e,t,n){return eL(e,[[0,0],t],n)}function nL(e,t,n){return $I(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];e.scale(150*i).translate([a,o])},n)}function rL(e,t,n){return $I(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([a,o])},n)}var iL=o((()=>{_P(),hI()}));function aL(e,t){return+t?Vve(e,t):Bve(e)}function Bve(e){return XI({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Vve(e,t){function n(r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=l-r,v=u-i,y=_*_+v*v;if(y>4*t&&h--){var b=o+f,x=s+p,S=c+m,C=oP(b*b+x*x+S*S),w=VN(S/=C),T=YN(YN(S)-1)<1e-6||YN(a-d)<1e-6?(a+d)/2:ZN(x,b),E=e(T,w),D=E[0],O=E[1],k=D-r,A=O-i,j=v*k-_*A;(j*j/y>t||YN((_*k+v*A)/y-.5)>.3||o*f+s*p+c*m{FP(),cP(),QI(),oL=16,sL=QN(30*JN)}));function Uve(e){return XI({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Wve(e,t,n,r,i){function a(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return a.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},a}function cL(e,t,n,r,i,a){if(!a)return Wve(e,t,n,r,i);var o=QN(a),s=iP(a),c=o*e,l=s*e,u=o/e,d=s/e,f=(s*n-o*t)/e,p=(s*t+o*n)/e;function m(e,a){return e*=r,a*=i,[c*e-l*a+t,n-l*e-c*a]}return m.invert=function(e,t){return[r*(u*e-d*t+f),i*(p-d*e-u*t)]},m}function lL(e){return uL(function(){return e})()}function uL(e){var t,n=150,r=480,i=250,a=0,o=0,s=0,c=0,l=0,u,d=0,f=1,p=1,m=null,h=GF,g=null,_,v,y,b=eI,x=.5,S,C,w,T,E;function D(e){return w(e[0]*JN,e[1]*JN)}function O(e){return e=w.invert(e[0],e[1]),e&&[e[0]*qN,e[1]*qN]}D.stream=function(e){return T&&E===e?T:T=dL(Uve(u)(h(S(b(E=e)))))},D.preclip=function(e){return arguments.length?(h=e,m=void 0,A()):h},D.postclip=function(e){return arguments.length?(b=e,g=_=v=y=null,A()):b},D.clipAngle=function(e){return arguments.length?(h=+e?vve(m=e*JN):(m=null,GF),A()):m*qN},D.clipExtent=function(e){return arguments.length?(b=e==null?(g=_=v=y=null,eI):JF(g=+e[0][0],_=+e[0][1],v=+e[1][0],y=+e[1][1]),A()):g==null?null:[[g,_],[v,y]]},D.scale=function(e){return arguments.length?(n=+e,k()):n},D.translate=function(e){return arguments.length?(r=+e[0],i=+e[1],k()):[r,i]},D.center=function(e){return arguments.length?(a=e[0]%360*JN,o=e[1]%360*JN,k()):[a*qN,o*qN]},D.rotate=function(e){return arguments.length?(s=e[0]%360*JN,c=e[1]%360*JN,l=e.length>2?e[2]%360*JN:0,k()):[s*qN,c*qN,l*qN]},D.angle=function(e){return arguments.length?(d=e%360*JN,k()):d*qN},D.reflectX=function(e){return arguments.length?(f=e?-1:1,k()):f<0},D.reflectY=function(e){return arguments.length?(p=e?-1:1,k()):p<0},D.precision=function(e){return arguments.length?(S=aL(C,x=e*e),A()):oP(x)},D.fitExtent=function(e,t){return eL(D,e,t)},D.fitSize=function(e,t){return tL(D,e,t)},D.fitWidth=function(e,t){return nL(D,e,t)},D.fitHeight=function(e,t){return rL(D,e,t)};function k(){var e=cL(n,0,0,f,p,d).apply(null,t(a,o)),m=cL(n,r-e[0],i-e[1],f,p,d);return u=EF(s,c,l),C=CF(t,m),w=CF(u,C),S=aL(C,x),A()}function A(){return T=E=null,D}return function(){return t=e.apply(this,arguments),D.invert=t.invert&&O,k()}}var dL,fL=o((()=>{KF(),qF(),ZF(),wF(),tI(),cP(),AF(),QI(),iL(),Hve(),dL=XI({point:function(e,t){this.stream.point(e*JN,t*JN)}})}));function pL(e){var t=0,n=UN/3,r=uL(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*JN,n=e[1]*JN):[t*qN,n*qN]},i}var mL=o((()=>{cP(),fL()}));function Gve(e){var t=QN(e);function n(e,n){return[e*t,iP(n)/t]}return n.invert=function(e,n){return[e/t,VN(n*t)]},n}var Kve=o((()=>{cP()}));function qve(e,t){var n=iP(e),r=(n+iP(t))/2;if(YN(r)<1e-6)return Gve(e);var i=1+n*(2*r-n),a=oP(i)/r;function o(e,t){var n=oP(i-2*r*iP(t))/r;return[n*iP(e*=r),a-n*QN(e)]}return o.invert=function(e,t){var n=a-t,o=ZN(e,YN(n))*aP(n);return n*r<0&&(o-=UN*aP(e)*aP(n)),[o/r,VN((i-(e*e+n*n)*r*r)/(2*r))]},o}function hL(){return pL(qve).scale(155.424).center([0,33.6442])}var gL=o((()=>{cP(),mL(),Kve()}));function _L(){return hL().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}var vL=o((()=>{gL()}));function Jve(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i=.12&&s<.234&&a>=-.425&&a<-.214?i:s>=.166&&s<.234&&a>=-.214&&a<-.115?o:n).invert(e)},u.stream=function(r){return e&&t===r?e:e=Jve([n.stream(t=r),i.stream(r),o.stream(r)])},u.precision=function(e){return arguments.length?(n.precision(e),i.precision(e),o.precision(e),d()):n.precision()},u.scale=function(e){return arguments.length?(n.scale(e),i.scale(e*.35),o.scale(e),u.translate(n.translate())):n.scale()},u.translate=function(e){if(!arguments.length)return n.translate();var t=n.scale(),c=+e[0],u=+e[1];return r=n.translate(e).clipExtent([[c-.455*t,u-.238*t],[c+.455*t,u+.238*t]]).stream(l),a=i.translate([c-.307*t,u+.201*t]).clipExtent([[c-.425*t+HN,u+.12*t+HN],[c-.214*t-HN,u+.234*t-HN]]).stream(l),s=o.translate([c-.205*t,u+.212*t]).clipExtent([[c-.214*t+HN,u+.166*t+HN],[c-.115*t-HN,u+.234*t-HN]]).stream(l),d()},u.fitExtent=function(e,t){return eL(u,e,t)},u.fitSize=function(e,t){return tL(u,e,t)},u.fitWidth=function(e,t){return nL(u,e,t)},u.fitHeight=function(e,t){return rL(u,e,t)};function d(){return e=t=null,u}return u.scale(1070)}var Xve=o((()=>{cP(),vL(),gL(),iL()}));function yL(e){return function(t,n){var r=QN(t),i=QN(n),a=e(r*i);return a===1/0?[2,0]:[a*i*iP(t),a*iP(n)]}}function bL(e){return function(t,n){var r=oP(t*t+n*n),i=e(r),a=iP(i),o=QN(i);return[ZN(t*a,r*o),VN(r&&n*a/r)]}}var xL=o((()=>{cP()}));function Zve(){return lL(SL).scale(124.75).clipAngle(179.999)}var SL,Qve=o((()=>{cP(),xL(),fL(),SL=yL(function(e){return oP(2/(1+e))}),SL.invert=bL(function(e){return 2*VN(e/2)})}));function $ve(){return lL(CL).scale(79.4188).clipAngle(179.999)}var CL,eye=o((()=>{cP(),xL(),fL(),CL=yL(function(e){return(e=BN(e))&&e/iP(e)}),CL.invert=bL(function(e){return e})}));function wL(e,t){return[e,nP(sP((WN+t)/2))]}function tye(){return TL(wL).scale(961/KN)}function TL(e){var t=lL(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,o=null,s,c,l;t.scale=function(e){return arguments.length?(r(e),u()):r()},t.translate=function(e){return arguments.length?(i(e),u()):i()},t.center=function(e){return arguments.length?(n(e),u()):n()},t.clipExtent=function(e){return arguments.length?(e==null?o=s=c=l=null:(o=+e[0][0],s=+e[0][1],c=+e[1][0],l=+e[1][1]),u()):o==null?null:[[o,s],[c,l]]};function u(){var n=UN*r(),i=t(uve(t.rotate()).invert([0,0]));return a(o==null?[[i[0]-n,i[1]-n],[i[0]+n,i[1]+n]]:e===wL?[[Math.max(i[0]-n,o),s],[Math.min(i[0]+n,c),l]]:[[o,Math.max(i[1]-n,s)],[c,Math.min(i[1]+n,l)]])}return u()}var EL=o((()=>{cP(),AF(),fL(),wL.invert=function(e,t){return[e,2*XN(eP(t))-WN]}}));function DL(e){return sP((WN+e)/2)}function nye(e,t){var n=QN(e),r=e===t?iP(e):nP(n/QN(t))/nP(DL(t)/DL(e)),i=n*rP(DL(e),r)/r;if(!r)return wL;function a(e,t){i>0?t<-WN+1e-6&&(t=-WN+HN):t>WN-1e-6&&(t=WN-HN);var n=i/rP(DL(t),r);return[n*iP(r*e),i-n*QN(r*e)]}return a.invert=function(e,t){var n=i-t,a=aP(r)*oP(e*e+n*n),o=ZN(e,YN(n))*aP(n);return n*r<0&&(o-=UN*aP(e)*aP(n)),[o/r,2*XN(rP(i/a,1/r))-WN]},a}function rye(){return pL(nye).scale(109.5).parallels([30,30])}var iye=o((()=>{cP(),mL(),EL()}));function OL(e,t){return[e,t]}function aye(){return lL(OL).scale(152.63)}var kL=o((()=>{fL(),OL.invert=OL}));function oye(e,t){var n=QN(e),r=e===t?iP(e):(n-QN(t))/(t-e),i=n/r+e;if(YN(r)<1e-6)return OL;function a(e,t){var n=i-t,a=r*e;return[n*iP(a),i-n*QN(a)]}return a.invert=function(e,t){var n=i-t,a=ZN(e,YN(n))*aP(n);return n*r<0&&(a-=UN*aP(e)*aP(n)),[a/r,i-aP(r)*oP(e*e+n*n)]},a}function sye(){return pL(oye).scale(131.154).center([0,13.9389])}var cye=o((()=>{cP(),mL(),kL()}));function AL(e,t){var n=VN(FL*iP(t)),r=n*n,i=r*r*r;return[e*QN(n)/(FL*(jL+3*ML*r+i*(7*NL+9*PL*r))),n*(jL+ML*r+i*(NL+PL*r))]}function lye(){return lL(AL).scale(177.158)}var jL,ML,NL,PL,FL,IL,uye=o((()=>{fL(),cP(),jL=1.340264,ML=-.081106,NL=893e-6,PL=.003796,FL=oP(3)/2,IL=12,AL.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,o,s,c;a{cP(),xL(),fL(),LL.invert=bL(XN)}));function pye(){var e=1,t=0,n=0,r=1,i=1,a=0,o,s,c=null,l,u,d,f=1,p=1,m=XI({point:function(e,t){var n=y([e,t]);this.stream.point(n[0],n[1])}}),h=eI,g,_;function v(){return f=e*r,p=e*i,g=_=null,y}function y(e){var r=e[0]*f,i=e[1]*p;if(a){var c=i*o-r*s;r=r*o+i*s,i=c}return[r+t,i+n]}return y.invert=function(e){var r=e[0]-t,i=e[1]-n;if(a){var c=i*o+r*s;r=r*o-i*s,i=c}return[r/f,i/p]},y.stream=function(e){return g&&_===e?g:g=m(h(_=e))},y.postclip=function(e){return arguments.length?(h=e,c=l=u=d=null,v()):h},y.clipExtent=function(e){return arguments.length?(h=e==null?(c=l=u=d=null,eI):JF(c=+e[0][0],l=+e[0][1],u=+e[1][0],d=+e[1][1]),v()):c==null?null:[[c,l],[u,d]]},y.scale=function(t){return arguments.length?(e=+t,v()):e},y.translate=function(e){return arguments.length?(t=+e[0],n=+e[1],v()):[t,n]},y.angle=function(e){return arguments.length?(a=e%360*JN,s=iP(a),o=QN(a),v()):a*qN},y.reflectX=function(e){return arguments.length?(r=e?-1:1,v()):r<0},y.reflectY=function(e){return arguments.length?(i=e?-1:1,v()):i<0},y.fitExtent=function(e,t){return eL(y,e,t)},y.fitSize=function(e,t){return tL(y,e,t)},y.fitWidth=function(e,t){return nL(y,e,t)},y.fitHeight=function(e,t){return rL(y,e,t)},y}var mye=o((()=>{ZF(),tI(),QI(),iL(),cP()}));function RL(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}function hye(){return lL(RL).scale(175.295)}var gye=o((()=>{fL(),cP(),RL.invert=function(e,t){var n=t,r=25,i;do{var a=n*n,o=a*a;n-=i=(n*(1.007226+a*(.015085+o*(-.044475+.028874*a-.005916*o)))-t)/(1.007226+a*(.015085*3+o*(-.044475*7+.028874*9*a-.005916*11*o)))}while(YN(i)>1e-6&&--r>0);return[e/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]}}));function zL(e,t){return[QN(t)*iP(e),iP(t)]}function _ye(){return lL(zL).scale(249.5).clipAngle(90+HN)}var vye=o((()=>{cP(),xL(),fL(),zL.invert=bL(VN)}));function BL(e,t){var n=QN(t),r=1+QN(e)*n;return[n*iP(e)/r,iP(t)/r]}function yye(){return lL(BL).scale(250).clipAngle(142)}var bye=o((()=>{cP(),xL(),fL(),BL.invert=bL(function(e){return 2*XN(e)})}));function VL(e,t){return[nP(sP((WN+t)/2)),-e]}function xye(){var e=TL(VL),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90]).scale(159.155)}var Sye=o((()=>{cP(),EL(),VL.invert=function(e,t){return[-t,2*XN(eP(e))-WN]}})),HL=o((()=>{DP(),nve(),lve(),MF(),KF(),qF(),ZF(),HF(),r_(),cP(),uP(),_P(),Sve(),zve(),vL(),Xve(),Qve(),eye(),iye(),gL(),cye(),uye(),kL(),fye(),mye(),fL(),EL(),gye(),vye(),bye(),Sye(),AF(),QI()}));function UL(e){return e>1?JL:e<-1?-JL:Math.asin(e)}function Cye(e){return e>0?Math.sqrt(e):0}var WL,GL,KL,qL,JL,YL,XL=o((()=>{WL=Math.abs,GL=Math.cos,KL=Math.sin,qL=Math.PI,JL=qL/2,qL/4,YL=Cye(2),qL*2,180/qL,qL/180}));function wye(e,t){var n=e*KL(t),r=30,i;do t-=i=(t+KL(t)-n)/(1+GL(t));while(WL(i)>1e-6&&--r>0);return t/2}function Tye(e,t,n){function r(r,i){return[e*r*GL(i=wye(n,i)),t*KL(i)]}return r.invert=function(r,i){return i=UL(i/t),[r/(e*GL(i)),UL((2*i+KL(2*i))/n)]},r}function Eye(){return lL(ZL).scale(169.529)}var ZL,Dye=o((()=>{HL(),XL(),ZL=Tye(YL/JL,YL,qL)})),Oye=o((()=>{HL(),XL(),Dye(),r_()}));function kye(e,t){return function n(){let r=t();return r.type=e,r.path=YI().projection(r),r.copy=r.copy||function(){let e=n();return tR.forEach(t=>{r[t]&&e[t](r[t]())}),e.path.pointRadius(r.path.pointRadius()),e},ipe(r)}}function QL(e,t){if(!e||typeof e!=`string`)throw Error(`Projection type must be a name string.`);return e=e.toLowerCase(),arguments.length>1?(nR[e]=kye(e,t),this):nR[e]||null}function $L(e){return e&&e.path||eR}var eR,tR,nR,rR=o((()=>{HL(),Oye(),DO(),eR=YI(),tR=[`clipAngle`,`clipExtent`,`scale`,`translate`,`center`,`rotate`,`parallels`,`precision`,`reflectX`,`reflectY`,`coefficient`,`distance`,`fraction`,`lobes`,`parallel`,`radius`,`ratio`,`spacing`,`tilt`],nR={albers:_L,albersusa:Yve,azimuthalequalarea:Zve,azimuthalequidistant:$ve,conicconformal:rye,conicequalarea:hL,conicequidistant:sye,equalEarth:lye,equirectangular:aye,gnomonic:dye,identity:pye,mercator:tye,mollweide:Eye,naturalEarth1:hye,orthographic:_ye,stereographic:yye,transversemercator:xye};for(let e in nR)QL(e,nR[e])})),Aye=c({contour:()=>hR,geojson:()=>gR,geopath:()=>_R,geopoint:()=>vR,geoshape:()=>yR,graticule:()=>bR,heatmap:()=>xR,isocontour:()=>oR,kde2d:()=>pR,projection:()=>CR});function jye(){}function iR(){var e=1,t=1,n=s;function r(e,t){return t.map(t=>i(e,t))}function i(e,t){var r=[],i=[];return a(e,t,a=>{n(a,e,t),Mye(a)>0?r.push([a]):i.push(a)}),i.forEach(e=>{for(var t=0,n=r.length,i;t=r,f,p;for(TR[d<<1].forEach(m);++c=r,TR[u|d<<1].forEach(m);for(TR[d<<0].forEach(m);++l=r,f=n[l*e]>=r,TR[d<<1|f<<2].forEach(m);++c=r,p=f,f=n[l*e+c+1]>=r,TR[u|d<<1|f<<2|p<<3].forEach(m);TR[d|f<<3].forEach(m)}for(c=-1,f=n[l*e]>=r,TR[f<<2].forEach(m);++c=r,TR[f<<2|p<<3].forEach(m);TR[f<<3].forEach(m);function m(e){var t=[e[0][0]+c,e[0][1]+l],n=[e[1][0]+c,e[1][1]+l],r=o(t),u=o(n),d,f;(d=s[r])?(f=a[u])?(delete s[d.end],delete a[f.start],d===f?(d.ring.push(n),i(d.ring)):a[d.start]=s[f.end]={start:d.start,end:f.end,ring:d.ring.concat(f.ring)}):(delete s[d.end],d.ring.push(n),s[d.end=u]=d):(d=a[u])?(f=s[r])?(delete a[d.start],delete s[f.end],d===f?(d.ring.push(n),i(d.ring)):a[f.start]=s[d.end]={start:f.start,end:d.end,ring:f.ring.concat(d.ring)}):(delete a[d.start],d.ring.unshift(t),a[d.start=r]=d):a[r]=s[u]={start:r,end:u,ring:[t,n]}}}function o(t){return t[0]*2+t[1]*(e+1)*4}function s(n,r,i){n.forEach(n=>{var a=n[0],o=n[1],s=a|0,c=o|0,l,u=r[c*e+s];a>0&&a0&&o=0&&a>=0||V(`invalid size`),e=i,t=a,r},r.smooth=function(e){return arguments.length?(n=e?s:jye,r):n===s},r}function Mye(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++tr!=p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=-i)}return i}function Fye(e,t,n){var r;return Iye(e,t,n)&&Lye(e[r=+(e[0]===t[0])],n[r],t[r])}function Iye(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function Lye(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function aR(e,t,n){return function(r){var i=dg(r),a=n?Math.min(i[0],0):i[0],o=i[1],s=o-a,c=t?Zg(a,o,e):s/(e+1);return n_(a+c,o,c)}}function oR(e){G.call(this,null,e)}function Rye(e,t,n){let r=aR(n.levels||10,n.nice,n.zero!==!1);return n.resolve===`shared`?r(e.map(e=>Qg(t(e).values))):r}function zye(e,t,n,r){let i=r.scale||t.scale,a=r.translate||t.translate;if(ig(i)&&(i=i(n,r)),ig(a)&&(a=a(n,r)),(i===1||i==null)&&!a)return;let o=(yg(i)?i:i[0])||1,s=(yg(i)?i:i[1])||1,c=a&&a[0]||0,l=a&&a[1]||0;e.forEach(sR(t,o,s,c,l))}function sR(e,t,n,r,i){let a=e.x1||0,o=e.y1||0,s=t*n<0;function c(e){e.forEach(l)}function l(e){s&&e.reverse(),e.forEach(u)}function u(e){e[0]=(e[0]-a)*t+r,e[1]=(e[1]-o)*n+i}return function(e){return e.coordinates.forEach(c),e}}function cR(e,t,n){let r=e>=0?e:eS(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function lR(e){return ig(e)?e:cg(+e)}function uR(){var e=e=>e[0],t=e=>e[1],n=bh,r=[-1,-1],i=960,a=500,o=2;function s(s,c){let l=cR(r[0],s,e)>>o,u=cR(r[1],s,t)>>o,d=l?l+2:0,f=u?u+2:0,p=2*d+(i>>o),m=2*f+(a>>o),h=new Float32Array(p*m),g=new Float32Array(p*m),_=h;s.forEach(r=>{let i=d+(+e(r)>>o),a=f+(+t(r)>>o);i>=0&&i=0&&a0&&u>0?(dR(p,m,h,g,l),fR(p,m,g,h,u),dR(p,m,h,g,l),fR(p,m,g,h,u),dR(p,m,h,g,l),fR(p,m,g,h,u)):l>0?(dR(p,m,h,g,l),dR(p,m,g,h,l),dR(p,m,h,g,l),_=g):u>0&&(fR(p,m,h,g,u),fR(p,m,g,h,u),fR(p,m,h,g,u),_=g);let v=c?2**(-2*o):1/Noe(_);for(let e=0,t=p*m;e>o),y2:f+(a>>o)}}return s.x=function(t){return arguments.length?(e=lR(t),s):e},s.y=function(e){return arguments.length?(t=lR(e),s):t},s.weight=function(e){return arguments.length?(n=lR(e),s):n},s.size=function(e){if(!arguments.length)return[i,a];var t=+e[0],n=+e[1];return t>=0&&n>=0||V(`invalid size`),i=t,a=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||V(`invalid cell size`),o=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=a&&(s-=n[t-a+o*e]),r[t-i+o*e]=s/Math.min(t+1,e-1+a-t,a))}function fR(e,t,n,r,i){let a=(i<<1)+1;for(let o=0;o=i&&(s>=a&&(c-=n[o+(s-a)*e]),r[o+(s-i)*e]=c/Math.min(s+1,t-1+a-s,a))}function pR(e){G.call(this,null,e)}function mR(e,t){return ER.forEach(n=>t[n]==null?0:e[n](t[n])),e}function Bye(e,t){var n=[],r=e=>e(s),i,a,o,s,c,l;if(t==null)n.push(e);else for(i={},a=0,o=e.length;ae(t(n)):r=>{var i=e.pointRadius(),a=e.pointRadius(n)(t(r));return e.pointRadius(i),a};return r.context=t=>(e.context(t),r),r}function bR(e){G.call(this,[],e),this.generator=xve()}function xR(e){G.call(this,null,e)}function Uye(e,t){let n;return ig(e)?(n=n=>JT(e(n,t)),n.dep=SR(e)):n=cg(JT(e||`#888`)),n}function Wye(e,t){let n;return ig(e)?(n=n=>e(n,t),n.dep=SR(e)):e?n=cg(e):(n=e=>e.$value/e.$max||0,n.dep=!0),n}function SR(e){if(!ig(e))return!1;let t=Og(oh(e));return t.$x||t.$y||t.$value||t.$max}function Gye(e,t,n,r){let i=e.width,a=e.height,o=e.x1||0,s=e.y1||0,c=e.x2||i,l=e.y2||a,u=e.values,d=u?e=>u[e]:yh,f=AT(c-o,l-s),p=f.getContext(`2d`),m=p.getImageData(0,0,c-o,l-s),h=m.data;for(let e=s,a=0;ee.concat(Yye(t)),[])}}function Yye(e){return e.type===OR?e.features:tg(e).filter(e=>e!=null).map(e=>e.type===DR?e:{type:DR,geometry:e})}var TR,ER,DR,OR,kR,Xye=o((()=>{Xx(),Ag(),r_(),VS(),rR(),HL(),$E(),MT(),TR=[[],[[[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]]],[]],oR.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`}]},U(oR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||vh,a=iR().smooth(e.smooth!==!1),o=e.thresholds||Rye(r,i,e),s=e.as===null?null:e.as||`contour`,c=[];return r.forEach(t=>{let n=i(t),r=a.size([n.width,n.height])(n.values,H(o)?o:o(n.values));zye(r,n,t,e),r.forEach(e=>{c.push(ox(t,ix(s==null?e:{[s]:e})))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=c,n}}),pR.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`}]},ER=[`x`,`y`,`weight`,`size`,`cellSize`,`bandwidth`],U(pR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=Bye(r,e.groupby),a=(e.groupby||[]).map(ah),o=mR(uR(),e),s=e.as||`grid`,c=[];function l(e,t){for(let n=0;nix(l({[s]:o(t,e.counts)},t.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=c,n}}),hR.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}]},U(hR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=iR().smooth(e.smooth!==!1),i=e.values,a=e.thresholds||aR(e.count||10,e.nice,!!i),o=e.size,s,c;return i||=(i=t.materialize(t.SOURCE).source,s=mR(uR(),e)(i,!0),c=sR(s,s.scale||1,s.scale||1,0,0),o=[s.width,s.height],s.values),a=H(a)?a:a(i),i=r.size(o)(i,a),c&&i.forEach(c),this.value&&(n.rem=this.value),this.value=n.source=n.add=(i||[]).map(ix),n}}),DR=`Feature`,OR=`FeatureCollection`,kR=`MultiPoint`,gR.Definition={type:`GeoJSON`,metadata:{},params:[{name:`fields`,type:`field`,array:!0,length:2},{name:`geojson`,type:`field`}]},U(gR,G,{transform(e,t){var n=this._features,r=this._points,i=e.fields,a=i&&i[0],o=i&&i[1],s=e.geojson||!i&&vh,c=t.ADD,l=e.modified()||t.changed(t.REM)||t.modified(oh(s))||a&&t.modified(oh(a))||o&&t.modified(oh(o));(!this.value||l)&&(c=t.SOURCE,this._features=n=[],this._points=r=[]),s&&t.visit(c,e=>n.push(s(e))),a&&o&&(t.visit(c,e=>{var t=a(e),n=o(e);t!=null&&n!=null&&(t=+t)===t&&(n=+n)===n&&r.push([t,n])}),n=n.concat({type:DR,geometry:{type:kR,coordinates:r}})),this.value={type:OR,features:n}}}),_R.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`}]},U(_R,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||vh,a=e.as||`path`,o=n.SOURCE;!r||e.modified()?(this.value=r=$L(e.projection),n.materialize().reflow()):o=i===vh||t.modified(i.fields)?n.ADD_MOD:n.ADD;let s=Vye(r,e.pointRadius);return n.visit(o,e=>e[a]=r(i(e))),r.pointRadius(s),n.modifies(a)}}),vR.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`]}]},U(vR,G,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],a=e.as||[`x`,`y`],o=a[0],s=a[1],c;function l(e){let t=n([r(e),i(e)]);t?(e[o]=t[0],e[s]=t[1]):(e[o]=void 0,e[s]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(c=t.modified(r.fields)||t.modified(i.fields),t.visit(c?t.ADD_MOD:t.ADD,l)),t.modifies(a)}}),yR.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`}]},U(yR,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||`shape`,a=n.ADD;return(!r||e.modified())&&(this.value=r=Hye($L(e.projection),e.field||hh(`datum`),e.pointRadius),n.materialize().reflow(),a=n.SOURCE),n.visit(a,e=>e[i]=r),n.modifies(i)}}),bR.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}]},U(bR,G,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(let t in e)ig(r[t])&&r[t](e[t]);return i=r(),n.length?t.mod.push(sx(n[0],i)):t.add.push(ix(i)),n[0]=i,t}}),xR.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`}]},U(xR,G,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve===`shared`,i=e.field||vh,a=Wye(e.opacity,e),o=Uye(e.color,e),s=e.as||`image`,c={$x:0,$y:0,$value:0,$max:r?Qg(n.map(e=>Qg(i(e).values))):0};return n.forEach(e=>{let t=i(e),n=ug({},e,c);r||(n.$max=Qg(t.values||[])),e[s]=Gye(t,n,o.dep?o:cg(o(n)),a.dep?a:cg(a(n)))}),t.reflow(!0).modifies(s)}}),U(CR,G,{transform(e,t){let n=this.value;return!n||e.modified(`type`)?(this.value=n=qye(e.type),tR.forEach(t=>{e[t]!=null&&wR(n,t,e[t])})):tR.forEach(t=>{e.modified(t)&&wR(n,t,e[t])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&Kye(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}})}));function Zye(e,t){var n,r=1;e??=0,t??=0;function i(){var i,a=n.length,o,s=0,c=0;for(i=0;i{}));function $ye(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return AR(this.cover(t,n),t,n,e)}function AR(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function ebe(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;nu&&(u=i),ad&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n{}));function nbe(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t{}));function ibe(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}var abe=o((()=>{}));function obe(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}var sbe=o((()=>{}));function jR(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}var MR=o((()=>{}));function cbe(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new jR(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),b=v*v+y*y;if(b{MR()}));function ube(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function dbe(e){for(var t=0,n=e.length;t{}));function pbe(){return this._root}var mbe=o((()=>{}));function hbe(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}var gbe=o((()=>{}));function _be(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new jR(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new jR(i,l,u,s,c)),(i=r[2])&&t.push(new jR(i,a,u,l,c)),(i=r[1])&&t.push(new jR(i,l,o,s,u)),(i=r[0])&&t.push(new jR(i,a,o,l,u))}return this}var vbe=o((()=>{MR()}));function ybe(e){var t=[],n=[],r;for(this._root&&t.push(new jR(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new jR(a,o,s,u,d)),(a=i[1])&&t.push(new jR(a,u,s,c,d)),(a=i[2])&&t.push(new jR(a,o,d,u,l)),(a=i[3])&&t.push(new jR(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}var bbe=o((()=>{MR()}));function xbe(e){return e[0]}function Sbe(e){return arguments.length?(this._x=e,this):this._x}var Cbe=o((()=>{}));function wbe(e){return e[1]}function Tbe(e){return arguments.length?(this._y=e,this):this._y}var Ebe=o((()=>{}));function NR(e,t,n){var r=new PR(t??xbe,n??wbe,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function PR(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function FR(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var IR,Dbe=o((()=>{tbe(),rbe(),abe(),sbe(),lbe(),fbe(),mbe(),gbe(),vbe(),bbe(),Cbe(),Ebe(),IR=NR.prototype=PR.prototype,IR.copy=function(){var e=new PR(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=FR(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=FR(r));return e},IR.add=$ye,IR.addAll=ebe,IR.cover=nbe,IR.data=ibe,IR.extent=obe,IR.find=cbe,IR.remove=ube,IR.removeAll=dbe,IR.root=pbe,IR.size=hbe,IR.visit=_be,IR.visitAfter=ybe,IR.x=Sbe,IR.y=Tbe})),LR=o((()=>{Dbe()}));function RR(e){return function(){return e}}var zR=o((()=>{}));function BR(e){return(e()-.5)*1e-6}var VR=o((()=>{}));function Obe(e){return e.x+e.vx}function kbe(e){return e.y+e.vy}function Abe(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=RR(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;ml.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_u+m||ad+m||oe.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r{LR(),zR(),VR()}));function Mbe(e){return e.index}function HR(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function Nbe(e){var t=Mbe,n=d,r,i=RR(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n[t(e,n,o),e])),d;for(n=0,s=Array(i);n{zR(),VR()}));function UR(){for(var e=0,t=arguments.length,n={},r;e=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}function Ibe(e,t){for(var n=0,r=e.length,i;n{KR={value:()=>{}},WR.prototype=UR.prototype={constructor:WR,on:function(e,t){var n=this._,r=Fbe(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var n=Array(i),r=0,i,a;r{Lbe()}));function qR(){return az||=(cz(zbe),sz.now()+oz)}function zbe(){az=0}function JR(){this._call=this._time=this._next=null}function YR(e,t,n){var r=new JR;return r.restart(e,t,n),r}function Bbe(){qR(),++QR;for(var e=nz,t;e;)(t=az-e._time)>=0&&e._call.call(void 0,t),e=e._next;--QR}function XR(){az=(iz=sz.now())+oz,QR=$R=0;try{Bbe()}finally{QR=0,Hbe(),az=0}}function Vbe(){var e=sz.now(),t=e-iz;t>tz&&(oz-=t,iz=e)}function Hbe(){for(var e,t=nz,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:nz=n);rz=e,ZR(r)}function ZR(e){QR||($R&&=clearTimeout($R),e-az>24?(e<1/0&&($R=setTimeout(XR,e-sz.now()-oz)),ez&&=clearInterval(ez)):(ez||=(iz=sz.now(),setInterval(Vbe,tz)),QR=1,cz(XR)))}var QR,$R,ez,tz,nz,rz,iz,az,oz,sz,cz,lz=o((()=>{QR=0,$R=0,ez=0,tz=1e3,iz=0,az=0,oz=0,sz=typeof performance==`object`&&performance.now?performance:Date,cz=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)},JR.prototype=YR.prototype={constructor:JR,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?qR():+n)+(t==null?0:+t),!this._next&&rz!==this&&(rz?rz._next=this:nz=this,rz=this),this._call=e,this._time=n,ZR()},stop:function(){this._call&&(this._call=null,this._time=1/0,ZR())}}}));function Ube(e,t,n){var r=new JR,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=n==null?qR():+n,r._restart(function a(o){o+=i,r._restart(a,i+=t,n),e(o)},t,n)},r.restart(e,t,n),r)}var Wbe=o((()=>{lz()})),uz=o((()=>{lz(),Wbe()}));function Gbe(){let e=1;return()=>(e=(dz*e+fz)%pz)/pz}var dz,fz,pz,Kbe=o((()=>{dz=1664525,fz=1013904223,pz=4294967296}));function qbe(e){return e.x}function Jbe(e){return e.y}function Ybe(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=new Map,c=YR(d),l=UR(`tick`,`end`),u=Gbe();e??=[];function d(){f(),l.call(`tick`,t),n1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i1?(l.on(e,n),t):l.on(e)}}}var mz,hz,gz=o((()=>{Rbe(),uz(),Kbe(),mz=10,hz=Math.PI*(3-Math.sqrt(5))}));function Xbe(){var e,t,n,r,i=RR(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=NR(e,qbe,Jbe).visitAfter(d);for(r=n,i=0;i=s)){(e.data!==t||e.next)&&(d===0&&(d=BR(n),m+=d*d),f===0&&(f=BR(n),m+=f*f),m{LR(),zR(),VR(),gz()}));function Qbe(e){var t=RR(.1),n,r,i;typeof e!=`function`&&(e=RR(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t{zR()}));function exe(e){var t=RR(.1),n,r,i;typeof e!=`function`&&(e=RR(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t{zR()})),nxe=o((()=>{Qye(),jbe(),Pbe(),Zbe(),zR(),gz(),$be(),txe()})),rxe=c({force:()=>_z});function _z(e){G.call(this,null,e)}function ixe(e,t){return()=>e.touch(t).run()}function axe(e,t){let n=Ybe(e),r=n.stop,i=n.restart,a=!1;return n.stopped=()=>a,n.restart=()=>(a=!1,i()),n.stop=()=>(a=!0,r()),vz(n,t,!0).on(`end`,()=>a=!0)}function vz(e,t,n,r){var i=tg(t.forces),a,o,s,c;for(a=0,o=xz.length;at(e,n):t)}var yz,bz,xz,Sz,Cz,lxe=o((()=>{Xx(),Ag(),nxe(),yz={center:Zye,collide:Abe,nbody:Xbe,link:Nbe,x:Qbe,y:exe},bz=`forces`,xz=[`alpha`,`alphaMin`,`alphaTarget`,`velocityDecay`,`forces`],Sz=[`static`,`iterations`],Cz=[`x`,`y`,`vx`,`vy`],_z.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:Cz}]},U(_z,G,{transform(e,t){var n=this.value,r=t.changed(t.ADD_REM),i=e.modified(xz),a=e.iterations||300;if(n?(r&&(t.modifies(`index`),n.nodes(t.source)),(i||t.changed(t.MOD))&&vz(n,e,0,t)):(this.value=n=axe(t.source,e),n.on(`tick`,ixe(t.dataflow,this)),e.static||(r=!0,n.tick()),t.modifies(`index`)),i||r||e.modified(Sz)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-n.alphaMin()**(1/a)),e.static)for(n.stop();--a>=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){let n=t.dataflow;for(let e=this._argops,t=0,s=e.length,c;t{}));function yxe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function bxe(){return this.eachAfter(yxe)}var xxe=o((()=>{}));function Sxe(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}var Cxe=o((()=>{}));function wxe(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}var Txe=o((()=>{}));function Exe(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o{}));function Oxe(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}var kxe=o((()=>{}));function Axe(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}var jxe=o((()=>{}));function Mxe(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}var Nxe=o((()=>{}));function Pxe(e){for(var t=this,n=Fxe(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function Fxe(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}var Ixe=o((()=>{}));function Lxe(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}var Rxe=o((()=>{}));function zxe(){return Array.from(this)}var Bxe=o((()=>{}));function Vxe(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}var Hxe=o((()=>{}));function Uxe(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}var Wxe=o((()=>{}));function*Gxe(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i{}));function wz(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Yxe)):t===void 0&&(t=Jxe);for(var n=new Ez(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new Ez(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(Tz)}function qxe(){return wz(this).eachBefore(Xxe)}function Jxe(e){return e.children}function Yxe(e){return Array.isArray(e)?e[1]:null}function Xxe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Tz(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ez(e){this.data=e,this.depth=this.height=0,this.parent=null}var Dz=o((()=>{xxe(),Cxe(),Txe(),Dxe(),kxe(),jxe(),Nxe(),Ixe(),Rxe(),Bxe(),Hxe(),Wxe(),Kxe(),Ez.prototype=wz.prototype={constructor:Ez,count:bxe,each:Sxe,eachAfter:Exe,eachBefore:wxe,find:Oxe,sum:Axe,sort:Mxe,path:Pxe,ancestors:Lxe,descendants:zxe,leaves:Vxe,links:Uxe,copy:qxe,[Symbol.iterator]:Gxe}}));function Oz(e){return e==null?null:kz(e)}function kz(e){if(typeof e!=`function`)throw Error();return e}var Az=o((()=>{}));function jz(){return 0}function Mz(e){return function(){return e}}var Nz=o((()=>{}));function Zxe(){let e=1;return()=>(e=(Pz*e+Fz)%Iz)/Iz}var Pz,Fz,Iz,Qxe=o((()=>{Pz=1664525,Fz=1013904223,Iz=4294967296}));function $xe(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function eSe(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}var Lz=o((()=>{}));function tSe(e,t){for(var n=0,r=(e=eSe(Array.from(e),t)).length,i=[],a,o;n0&&n*n>r*r+i*i}function Bz(e,t){for(var n=0;n1e-6?(D+Math.sqrt(D*D-4*E*O))/(2*E):O/D);return{x:r+S+C*k,y:i+w+T*k,r:k}}var Uz=o((()=>{Lz()}));function Wz(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function Gz(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Kz(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function qz(e){this._=e,this.next=null,this.previous=null}function aSe(e,t){if(!(a=(e=$xe(e)).length))return 0;var n=e[0],r,i,a,o,s,c,l,u,d,f;if(n.x=0,n.y=0,!(a>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;Wz(r,n,i=e[2]),n=new qz(n),r=new qz(r),i=new qz(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;pack:for(c=3;c{Lz(),Uz()}));function oSe(e){return Math.sqrt(e.value)}function sSe(){var e=null,t=1,n=1,r=jz;function i(i){let a=Zxe();return i.x=t/2,i.y=n/2,e?i.eachBefore(Yz(e)).eachAfter(Xz(r,.5,a)).eachBefore(Zz(1)):i.eachBefore(Yz(oSe)).eachAfter(Xz(jz,1,a)).eachAfter(Xz(r,i.r/Math.min(t,n),a)).eachBefore(Zz(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=Oz(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r=typeof e==`function`?e:Mz(+e),i):r},i}function Yz(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Xz(e,t,n){return function(r){if(i=r.children){var i,a,o=i.length,s=e(r)*t||0,c;if(s)for(a=0;a{Az(),Nz(),Qxe(),Jz()}));function Qz(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}var $z=o((()=>{}));function eB(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s{}));function lSe(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(a(t,o)),r&&i.eachBefore(Qz),i}function a(e,t){return function(r){r.children&&eB(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,a=r.y0,o=r.x1-n,s=r.y1-n;o{$z(),tB()}));function dSe(e){return e.id}function fSe(e){return e.parentId}function nB(){var e=dSe,t=fSe,n;function r(r){var i=Array.from(r),a=e,o=t,s,c,l,u,d,f,p,m,h=new Map;if(n!=null){let e=i.map((e,t)=>pSe(n(e,t,r))),t=e.map(rB),s=new Set(e).add(``);for(let n of t)s.has(n)||(s.add(n),e.push(n),t.push(rB(n)),i.push(sB));a=(t,n)=>e[n],o=(e,n)=>t[n]}for(l=0,s=i.length;l=0&&(f=i[e],f.data===sB);--e)f.data=null}if(u.parent=aB,u.eachBefore(function(e){e.depth=e.parent.depth+1,--s}).eachBefore(Tz),u.parent=null,s>0)throw Error(`cycle`);return u}return r.id=function(t){return arguments.length?(e=Oz(t),r):e},r.parentId=function(e){return arguments.length?(t=Oz(e),r):t},r.path=function(e){return arguments.length?(n=Oz(e),r):n},r}function pSe(e){e=`${e}`;let t=e.length;return iB(e,t-1)&&!iB(e,t-2)&&(e=e.slice(0,-1)),e[0]===`/`?e:`/${e}`}function rB(e){let t=e.length;if(t<2)return``;for(;--t>1&&!iB(e,t););return e.slice(0,t)}function iB(e,t){if(e[t]===`/`){let n=0;for(;t>0&&e[--t]===`\\`;)++n;if(!(n&1))return!0}return!1}var aB,oB,sB,mSe=o((()=>{Az(),Dz(),aB={depth:-1},oB={},sB={}}));function hSe(e,t){return e.parent===t.parent?1:2}function cB(e){var t=e.children;return t?t[0]:e.t}function lB(e){var t=e.children;return t?t[t.length-1]:e.t}function gSe(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function _Se(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function vSe(e,t,n){return e.a.parent===t.parent?e.a:n}function uB(e,t){this._=e,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=t}function ySe(e){for(var t=new uB(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new uB(a[o],o)),i.parent=n;return(t.parent=new uB(null,0)).children=[t],t}function bSe(){var e=hSe,t=1,n=1,r=null;function i(i){var s=ySe(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.xu.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){_Se(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=lB(o),i=cB(i),o&&i;)s=cB(s),a=lB(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(gSe(vSe(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!lB(a)&&(a.t=o,a.m+=u-l),i&&!cB(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}var xSe=o((()=>{Dz(),uB.prototype=Object.create(Ez.prototype)}));function dB(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s{}));function pB(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;uv&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p{tB(),fB(),mB=(1+Math.sqrt(5))/2,hB=(function e(t){function n(e,n,r,i,a){pB(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(mB)}));function SSe(){var e=hB,t=!1,n=1,r=1,i=[0],a=jz,o=jz,s=jz,c=jz,l=jz;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(Qz),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d{$z(),gB(),Az(),Nz()}));function wSe(e,t,n,r,i){var a=e.children,o,s=a.length,c,l=Array(s+1);for(l[0]=c=o=0;o=t-1){var c=a[e];c.x0=r,c.y0=i,c.x1=o,c.y1=s;return}for(var d=l[e],f=n/2+d,p=e+1,m=t-1;p>>1;l[h]s-i){var v=n?(r*_+o*g)/n:o;u(e,p,g,r,i,v,s),u(p,t,_,v,i,o,s)}else{var y=n?(i*_+s*g)/n:s;u(e,p,g,r,i,o,y),u(p,t,_,r,y,o,s)}}}var TSe=o((()=>{}));function ESe(e,t,n,r,i){(e.depth&1?dB:eB)(e,t,n,r,i)}var DSe=o((()=>{tB(),fB()})),_B,OSe=o((()=>{tB(),fB(),gB(),_B=(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u1?t:1)},n})(mB)})),kSe=o((()=>{vxe(),Dz(),cSe(),Jz(),Uz(),uSe(),mSe(),xSe(),CSe(),TSe(),tB(),fB(),DSe(),gB(),OSe()})),ASe=c({nest:()=>yB,pack:()=>xB,partition:()=>SB,stratify:()=>CB,tree:()=>wB,treelinks:()=>TB,treemap:()=>EB});function vB(e,t,n){let r={};return e.each(e=>{let i=e.data;n(i)&&(r[t(i)]=e)}),e.lookup=r,e}function yB(e){G.call(this,null,e)}function jSe(){let e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;let i=t.length,a=e[r++],o={},s={},c=-1,l,u,d;for(;++ce.length)return t;let i=[];for(let e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function bB(e){G.call(this,null,e)}function MSe(e,t,n){for(let r,i=0,a=t.length;i{Xx(),Ag(),kSe(),yB.Definition={type:`Nest`,metadata:{treesource:!0,changes:!0},params:[{name:`keys`,type:`field`,array:!0},{name:`generate`,type:`boolean`}]},DB=e=>e.values,U(yB,G,{transform(e,t){t.source||V(`Nest transform requires an upstream data source.`);var n=e.generate,r=e.modified(),i=t.clone(),a=this.value;return(!a||r||t.changed())&&(a&&a.each(e=>{e.children&&tx(e.data)&&i.rem.push(e.data)}),this.value=a=wz({values:tg(e.keys).reduce((e,t)=>(e.key(t),e),jSe()).entries(i.source)},DB),n&&a.each(e=>{e.children&&(e=ix(e.data),i.add.push(e),i.source.push(e))}),vB(a,nx,nx)),i.source.root=a,i}}),OB=(e,t)=>e.parent===t.parent?1:2,U(bB,G,{transform(e,t){(!t.source||!t.source.root)&&V(this.constructor.name+` transform requires a backing tree data source.`);let n=this.layout(e.method),r=this.fields,i=t.source.root,a=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(cx(e.sort,e=>e.data)),MSe(n,this.params,e),n.separation&&n.separation(e.separation===!1?bh:OB);try{this.value=n(i)}catch(e){V(e)}return i.each(e=>NSe(e,r,a)),t.reflow(e.modified()).modifies(a).modifies(`leaf`)}}),kB=[`x`,`y`,`r`,`depth`,`children`],xB.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:kB.length,default:kB}]},U(xB,bB,{layout:sSe,params:[`radius`,`size`,`padding`],fields:kB}),AB=[`x0`,`y0`,`x1`,`y1`,`depth`,`children`],SB.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:AB.length,default:AB}]},U(SB,bB,{layout:lSe,params:[`size`,`round`,`padding`],fields:AB}),CB.Definition={type:`Stratify`,metadata:{treesource:!0},params:[{name:`key`,type:`field`,required:!0},{name:`parentKey`,type:`field`,required:!0}]},U(CB,G,{transform(e,t){t.source||V(`Stratify transform requires an upstream data source.`);let n=this.value,r=e.modified(),i=t.fork(t.ALL).materialize(t.SOURCE),a=!n||r||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return i.source=i.source.slice(),a&&(n=i.source.length?vB(nB().id(e.key).parentId(e.parentKey)(i.source),e.key,xh):vB(nB()([{}]),e.key,e.key)),i.source.root=this.value=n,i}}),jB={tidy:bSe,cluster:_xe},MB=[`x`,`y`,`depth`,`children`],wB.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:MB.length,default:MB}]},U(wB,bB,{layout(e){let t=e||`tidy`;if(fg(jB,t))return jB[t]();V(`Unrecognized Tree layout method: `+t)},params:[`size`,`nodeSize`],fields:MB}),TB.Definition={type:`TreeLinks`,metadata:{tree:!0,generates:!0,changes:!0},params:[]},U(TB,G,{transform(e,t){let n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),a={};return r||V(`TreeLinks transform requires a tree data source.`),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,e=>a[nx(e)]=1),r.each(e=>{let t=e.data,n=e.parent&&e.parent.data;n&&a[nx(t)]&&a[nx(n)]&&i.add.push(ix({source:n,target:t}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>a[nx(e)]=1),n.forEach(e=>{(a[nx(e.source)]||a[nx(e.target)])&&i.mod.push(e)})),i}}),NB={binary:wSe,dice:eB,slice:dB,slicedice:ESe,squarify:hB,resquarify:_B},PB=[`x0`,`y0`,`x1`,`y1`,`depth`,`children`],EB.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:PB.length,default:PB}]},U(EB,bB,{layout(){let e=SSe();return e.ratio=t=>{let n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{fg(NB,t)?e.tile(NB[t]):V(`Unrecognized Treemap layout method: `+t)},e},params:[`method`,`ratio`,`size`,`round`,`padding`,`paddingInner`,`paddingOuter`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`],fields:PB})})),FSe=c({label:()=>BB});function ISe(e,t){let n=e.bitmap();return(t||[]).forEach(t=>n.set(e(t.boundary[0]),e(t.boundary[3]))),[n,void 0]}function LSe(e,t,n,r,i){let a=e.width,o=e.height,s=r||i,c=AT(a,o).getContext(`2d`),l=AT(a,o).getContext(`2d`),u=s&&AT(a,o).getContext(`2d`);n.forEach(e=>IB(c,e,!1)),IB(l,t,!1),s&&IB(u,t,!0);let d=FB(c,a,o),f=FB(l,a,o),p=s&&FB(u,a,o),m=e.bitmap(),h=s&&e.bitmap(),g,_,v,y,b,x,S,C;for(_=0;_{t.items.forEach(t=>IB(e,t.items,n))}):AA[r].draw(e,{items:n?t.map(RSe):t})}function RSe(e){let t=ox(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:`#000`,fillOpacity:0}:t}function zSe(e,t){let n=new Uint32Array(~~((e*t+WB)/WB));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{let i=r*e+t;return n[i>>>HB]&1<<(i&UB)},set:(t,n)=>{let i=n*e+t;r(i>>>HB,1<<(i&UB))},clear:(t,n)=>{let r=n*e+t;i(r>>>HB,~(1<<(r&UB)))},getRange:(t,r,i,a)=>{let o=a,s,c,l,u;for(;o>=r;--o)if(s=o*e+t,c=o*e+i,l=s>>>HB,u=c>>>HB,l===u){if(n[l]&GB[s&UB]&KB[(c&UB)+1])return!0}else{if(n[l]&GB[s&UB]||n[u]&KB[(c&UB)+1])return!0;for(let e=l+1;e{let o,s,c,l,u;for(;n<=a;++n)if(o=n*e+t,s=n*e+i,c=o>>>HB,l=s>>>HB,c===l)r(c,GB[o&UB]&KB[(s&UB)+1]);else for(r(c,GB[o&UB]),r(l,KB[(s&UB)+1]),u=c+1;u{let o,s,c,l,u;for(;n<=a;++n)if(o=n*e+t,s=n*e+r,c=o>>>HB,l=s>>>HB,c===l)i(c,KB[o&UB]|GB[(s&UB)+1]);else for(i(c,KB[o&UB]),i(l,GB[(s&UB)+1]),u=c+1;un<0||r<0||a>=t||i>=e}}function BSe(e,t,n){let r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),a=~~((t+2*n+r)/r),o=e=>~~((e+n)/r);return o.invert=e=>e*r-n,o.bitmap=()=>zSe(i,a),o.ratio=r,o.padding=n,o.width=e,o.height=t,o}function VSe(e,t,n,r){let i=e.width,a=e.height;return function(e){let t=e.datum.datum.items[r].items,n=t.length,o=e.datum.fontSize,s=OA.width(e.datum,e.datum.text),c=0,l,u,d,f,p,m,h;for(let r=0;r=c&&(c=h,e.x=p,e.y=m);return p=s/2,m=o/2,l=e.x-p,u=e.x+p,d=e.y-m,f=e.y+m,e.align=`center`,l<0&&u<=i?e.align=`left`:0<=l&&ii||t-(o=r/2)<0||t+o>a}function RB(e,t,n,r,i,a,o,s){let c=i*a/(r*2),l=e(t-c),u=e(t+c),d=e(n-(a/=2)),f=e(n+a);return o.outOfBounds(l,d,u,f)||o.getRange(l,d,u,f)||s&&s.getRange(l,d,u,f)}function HSe(e,t,n,r){let i=e.width,a=e.height,o=t[0],s=t[1];function c(t,n,r,c,l){let u=e.invert(t),d=e.invert(n),f=r,p=a,m;if(!LB(u,d,c,l,i,a)&&!RB(e,u,d,l,c,f,o,s)&&!RB(e,u,d,l,c,l,o,null)){for(;p-f>=1;)m=(f+p)/2,RB(e,u,d,l,c,m,o,s)?p=m:f=m;if(f>r)return[u,d,f,!0]}}return function(t){let s=t.datum.datum.items[r].items,l=s.length,u=t.datum.fontSize,d=OA.width(t.datum,t.datum.text),f=n?u:0,p=!1,m=!1,h=0,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M;for(let r=0;r_&&(M=g,g=_,_=M),v>y&&(M=v,v=y,y=M),w=e(g),E=e(_),T=~~((w+E)/2),D=e(v),k=e(y),O=~~((D+k)/2),S=T;S>=w;--S)for(C=O;C>=D;--C)j=c(S,C,f,d,u),j&&([t.x,t.y,f,p]=j);for(S=T;S<=E;++S)for(C=O;C<=k;++C)j=c(S,C,f,d,u),j&&([t.x,t.y,f,p]=j);!p&&!n&&(A=Math.abs(_-g+y-v),b=(g+_)/2,x=(v+y)/2,A>=h&&!LB(b,x,d,u,i,a)&&!RB(e,b,x,u,d,u,o,null)&&(h=A,t.x=b,t.y=x,m=!0))}return p||m?(b=d/2,x=u/2,o.setRange(e(t.x-b),e(t.y-x),e(t.x+b),e(t.y+x)),t.align=`center`,t.baseline=`middle`,!0):!1}}function USe(e,t,n,r){let i=e.width,a=e.height,o=t[0],s=t[1],c=e.bitmap();return function(t){let l=t.datum.datum.items[r].items,u=l.length,d=t.datum.fontSize,f=OA.width(t.datum,t.datum.text),p=[],m=n?d:0,h=!1,g=!1,_=0,v,y,b,x,S,C,w,T,E,D,O,k;for(let r=0;r=1;)O=(E+D)/2,RB(e,S,C,d,f,O,o,s)?D=O:E=O;E>m&&(t.x=S,t.y=C,m=E,h=!0)}}!h&&!n&&(k=Math.abs(y-v+x-b),S=(v+y)/2,C=(b+x)/2,k>=_&&!LB(S,C,f,d,i,a)&&!RB(e,S,C,d,f,d,o,null)&&(_=k,t.x=S,t.y=C,g=!0))}return h||g?(S=f/2,C=d/2,o.setRange(e(t.x-S),e(t.y-C),e(t.x+S),e(t.y+C)),t.align=`center`,t.baseline=`middle`,!0):!1}}function WSe(e,t,n,r){let i=e.width,a=e.height,o=t[0],s=t[1],c=r.length;return function(t){let l=t.boundary,u=t.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>a)return!1;let d=t.textWidth??0,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E;for(let i=0;i>>2&3)-1,m=f===0&&p===0||r[i]<0,h=f&&p?Math.SQRT1_2:1,g=r[i]<0?-1:1,_=l[1+f]+r[i]*f*h,S=l[4+p]+g*u*p/2+r[i]*p*h,y=S-u/2,b=S+u/2,C=e(_),T=e(y),E=e(b),!d)if(zB(C,C,T,E,o,s,_,_,y,b,l,m))d=OA.width(t.datum,t.datum.text);else continue;if(x=_+g*d*f/2,_=x-d/2,v=x+d/2,C=e(_),w=e(v),zB(C,w,T,E,o,s,_,v,y,b,l,m))return t.x=f?f*g<0?v:_:x,t.y=p?p*g<0?b:y:S,t.align=YB[f*g+1],t.baseline=XB[p*g+1],o.setRange(C,T,w,E),!0}return!1}}function zB(e,t,n,r,i,a,o,s,c,l,u,d){return!(i.outOfBounds(e,n,t,r)||(d&&a||i).getRange(e,n,t,r))}function GSe(e,t,n,r,i,a,o,s,c,l,u){if(!e.length)return e;let d=Math.max(r.length,i.length),f=KSe(r,d),p=qSe(i,d),m=JSe(e[0].datum),h=m===`group`&&e[0].datum.items[c].marktype,g=h===`area`,_=YSe(m,h,s,c),v=l===null||l===1/0,y=g&&u===`naive`,b=-1,x=-1,S=e.map(e=>{let t=v?OA.width(e,e.text):void 0;return b=Math.max(b,t),x=Math.max(x,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:_(e),textWidth:t}});l=l===null||l===1/0?Math.max(b,x)+Math.max(...r):l;let C=BSe(t[0],t[1],l),w;if(!y){n&&S.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;ee.datum);w=a.length||r?LSe(C,r||[],a,t,g):ISe(C,o&&S)}let T=g?QB[u](C,w,o,c):WSe(C,w,p,f);return S.forEach(e=>e.opacity=+T(e)),S}function KSe(e,t){let n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?e===`line`||e===`area`?e=>i(e.datum):t===`line`?e=>{let t=e.datum.items[r].items;return i(t.length?t[n===`start`?0:t.length-1]:{x:NaN,y:NaN})}:e=>{let t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}function BB(e){G.call(this,null,e)}var VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,XSe=o((()=>{Kj(),MT(),Xx(),Ag(),VB=4278190080,HB=5,UB=31,WB=32,GB=new Uint32Array(33),KB=new Uint32Array(33),KB[0]=0,GB[0]=~KB[0];for(let e=1;e<=WB;++e)KB[e]=KB[e-1]<<1|1,GB[e]=~KB[e];qB=[-1,-1,1,1],JB=[-1,1,-1,1],YB=[`right`,`center`,`left`],XB=[`bottom`,`middle`,`top`],ZB={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},QB={naive:VSe,"reduced-search":HSe,floodfill:USe},$B=[`x`,`y`,`opacity`,`align`,`baseline`],eV=[`top-left`,`left`,`bottom-left`,`top`,`bottom`,`top-right`,`right`,`bottom-right`],BB.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:eV},{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:$B.length,default:$B}]},U(BB,G,{transform(e,t){function n(n){let r=e[n];return ig(r)&&t.modified(r.fields)}let r=e.modified();if(!(r||t.changed(t.ADD_REM)||n(`sort`)))return;(!e.size||e.size.length!==2)&&V(`Size parameter should be specified as a [width, height] array.`);let i=e.as||$B;return GSe(t.materialize(t.SOURCE).source||[],e.size,e.sort,tg(e.offset==null?1:e.offset),tg(e.anchor||eV),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||`end`,e.markIndex||0,e.padding===void 0?0:e.padding,e.method||`naive`).forEach(e=>{let t=e.datum;t[i[0]]=e.x,t[i[1]]=e.y,t[i[2]]=e.opacity,t[i[3]]=e.align,t[i[4]]=e.baseline}),t.reflow(r).modifies(i)}})})),ZSe=c({loess:()=>nV,regression:()=>rV});function tV(e,t){var n=[],r=function(e){return e(s)},i,a,o,s,c,l;if(t==null)n.push(e);else for(i={},a=0,o=e.length;a{VS(),Xx(),Ag(),nV.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}]},U(nV,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=t.materialize(t.SOURCE).source,i=tV(r,e.groupby),a=(e.groupby||[]).map(ah),o=a.length,s=e.as||[ah(e.x),ah(e.y)],c=[];i.forEach(t=>{MS(t,e.x,e.y,e.bandwidth||.3).forEach(e=>{let n={};for(let e=0;ee===`poly`?t:e===`quad`?2:1,rV.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(iV)},{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}]},U(rV,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=t.materialize(t.SOURCE).source,i=tV(r,e.groupby),a=(e.groupby||[]).map(ah),o=e.method||`linear`,s=e.order==null?3:e.order,c=aV(o,s),l=e.as||[ah(e.x),ah(e.y)],u=iV[o],d=[],f=e.extent;fg(iV,o)||V(`Invalid regression method: `+o),f!=null&&o===`log`&&f[0]<=0&&(t.dataflow.warn(`Ignoring extent with values <= 0 for log regression.`),f=null),i.forEach(n=>{if(n.length<=c){t.dataflow.warn(`Skipping regression with more parameters than data points.`);return}let r=u(n,e.x,e.y,s);if(e.params){d.push(ix({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));return}let i=f||dg(n,e.x),p=e=>{let t={};for(let e=0;ep([e,r.predict(e)])):NS(r.predict,i,25,200).forEach(p)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=d}return n}})}));function oV(e,t,n,r,i){let a,o,s,c,l=t[0],u=r[0],d=0,f=0;u>l==u>-l?(a=l,l=t[++d]):(a=u,u=r[++f]);let p=0;if(dl==u>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[p++]=s);dl==u>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f]),a=o,s!==0&&(i[p++]=s);for(;d{sV=11102230246251565e-32,cV=134217729,lV=3.000000000000001*sV}));function eCe(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e-i,E=n-i,D=t-a,O=r-a;b=T*O,f=cV*T,p=f-(f-T),m=T-p,f=cV*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=D*E,f=cV*D,p=f-(f-D),m=D-p,f=cV*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,hV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,hV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,hV[2]=v-(w-d)+(_-d),hV[3]=w;let k=$Se(4,hV),A=pV*o;if(k>=A||-k>=A||(d=e-T,s=e-(T+d)+(d-i),d=n-E,l=n-(E+d)+(d-i),d=t-D,c=t-(D+d)+(d-a),d=r-O,u=r-(O+d)+(d-a),s===0&&c===0&&l===0&&u===0)||(A=mV*o+lV*Math.abs(k),k+=T*u+O*s-(D*l+E*c),k>=A||-k>=A))return k;b=s*O,f=cV*s,p=f-(f-s),m=s-p,f=cV*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=c*E,f=cV*c,p=f-(f-c),m=c-p,f=cV*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,yV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,yV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,yV[2]=v-(w-d)+(_-d),yV[3]=w;let j=oV(4,hV,4,yV,gV);b=T*u,f=cV*T,p=f-(f-T),m=T-p,f=cV*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=D*l,f=cV*D,p=f-(f-D),m=D-p,f=cV*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,yV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,yV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,yV[2]=v-(w-d)+(_-d),yV[3]=w;let M=oV(j,gV,4,yV,_V);b=s*u,f=cV*s,p=f-(f-s),m=s-p,f=cV*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=c*l,f=cV*c,p=f-(f-c),m=c-p,f=cV*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,yV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,yV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,yV[2]=v-(w-d)+(_-d),yV[3]=w;let ee=oV(M,_V,4,yV,vV);return vV[ee-1]}function dV(e,t,n,r,i,a){let o=(t-a)*(n-i),s=(e-i)*(r-a),c=o-s,l=Math.abs(o+s);return Math.abs(c)>=fV*l?c:-eCe(e,t,n,r,i,a,l)}var fV,pV,mV,hV,gV,_V,vV,yV,tCe=o((()=>{uV(),fV=(3+16*sV)*sV,pV=(2+12*sV)*sV,mV=(9+64*sV)*sV*sV,hV=K(4),gV=K(8),_V=K(12),vV=K(16),yV=K(4)})),nCe=o((()=>{uV(),(7+56*sV)*sV,(3+28*sV)*sV,(26+288*sV)*sV*sV,K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(8),K(8),K(8),K(4),K(8),K(8),K(16),K(12),K(192),K(192)})),rCe=o((()=>{uV(),(10+96*sV)*sV,(4+48*sV)*sV,(44+576*sV)*sV*sV,K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(8),K(8),K(8),K(8),K(8),K(8),K(8),K(8),K(8),K(4),K(4),K(4),K(8),K(16),K(16),K(16),K(32),K(32),K(48),K(64),K(1152),K(1152)})),iCe=o((()=>{uV(),(16+224*sV)*sV,(5+72*sV)*sV,(71+1408*sV)*sV*sV,K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(1152),K(1152),K(1152),K(1152),K(1152),K(2304),K(2304),K(3456),K(5760),K(8),K(8),K(8),K(16),K(24),K(48),K(48),K(96),K(192),K(384),K(384),K(384),K(768),K(96),K(96),K(96),K(1152)})),aCe=o((()=>{tCe(),nCe(),rCe(),iCe()}));function oCe(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function bV(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}function sCe(e,t,n,r,i,a,o,s){let c=e-o,l=t-s,u=n-o,d=r-s,f=i-o,p=a-s,m=c*c+l*l,h=u*u+d*d,g=f*f+p*p;return c*(d*g-h*p)-l*(u*g-h*f)+m*(u*p-d*f)<0}function cCe(e,t,n,r,i,a){let o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c),p=(l*u-s*d)*f,m=(o*d-c*u)*f;return p*p+m*m}function lCe(e,t,n,r,i,a){let o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c);return{x:e+(l*u-s*d)*f,y:t+(o*d-c*u)*f}}function xV(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){let r=e[i],a=t[r],o=i-1;for(;o>=n&&t[e[o]]>a;)e[o+1]=e[o--];e[o+1]=r}else{let i=n+r>>1,a=n+1,o=r;SV(e,i,a),t[e[n]]>t[e[r]]&&SV(e,n,r),t[e[a]]>t[e[r]]&&SV(e,a,r),t[e[n]]>t[e[a]]&&SV(e,n,a);let s=e[a],c=t[s];for(;;){do a++;while(t[e[a]]c);if(o=o-n?(xV(e,t,a,r),xV(e,t,n,o-1)):(xV(e,t,n,o-1),xV(e,t,a,r))}}function SV(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function uCe(e){return e[0]}function dCe(e){return e[1]}var CV,wV,TV,fCe=o((()=>{aCe(),CV=2**-52,wV=new Uint32Array(512),TV=class e{static from(t,n=uCe,r=dCe){let i=t.length,a=new Float64Array(i*2);for(let e=0;e>1;if(t>0&&typeof e[0]!=`number`)throw Error(`Expected coords to contain numbers.`);this.coords=e;let n=Math.max(2*t-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*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),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.trianglesLen=0,this._cx=0,this._cy=0,this._hullStart=0,this.hull=this._triangles,this.triangles=this._triangles,this.halfedges=this._halfedges,this.update()}update(){let{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=e.length>>1,o=1/0,s=1/0,c=-1/0,l=-1/0;for(let t=0;tc&&(c=n),r>l&&(l=r),this._ids[t]=t}let u=(o+c)/2,d=(s+l)/2,f=0,p=0,m=0;for(let t=0,n=1/0;t0&&(p=t,n=r)}let _=e[2*p],v=e[2*p+1],y=1/0;for(let t=0;tr&&(t[n++]=i,r=a)}this.hull=t.subarray(0,n),this.triangles=new Uint32Array,this.halfedges=new Int32Array;return}if(dV(h,g,_,v,b,x)<0){let e=p,t=_,n=v;p=m,_=b,v=x,m=e,b=t,x=n}let S=lCe(h,g,_,v,b,x);this._cx=S.x,this._cy=S.y;for(let t=0;t0&&Math.abs(l-o)<=CV&&Math.abs(u-s)<=CV||(o=l,s=u,c===f||c===p||c===m))continue;let d=0;for(let e=0,t=this._hashKey(l,u);e=0;)if(h=g,h===d){h=-1;break}if(h===-1)continue;let _=this._addTriangle(h,c,n[h],-1,-1,r[h]);r[c]=this._legalize(_+2),r[h]=_,C++;let v=n[h];for(;g=n[v],dV(l,u,e[2*v],e[2*v+1],e[2*g],e[2*g+1])<0;)_=this._addTriangle(v,c,g,r[c],-1,r[v]),r[c]=this._legalize(_+2),n[v]=v,C--,v=g;if(h===d)for(;g=t[h],dV(l,u,e[2*g],e[2*g+1],e[2*h],e[2*h+1])<0;)_=this._addTriangle(g,c,h,-1,r[h],r[g]),this._legalize(_+2),r[g]=_,n[h]=h,C--,h=g;this._hullStart=t[c]=h,n[h]=t[v]=c,n[c]=v,i[this._hashKey(l,u)]=c,i[this._hashKey(e[2*h],e[2*h+1])]=h}this.hull=new Uint32Array(C);for(let e=0,t=this._hullStart;e{EV=1e-6,DV=class{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,n){e=+e,t=+t,n=+n;let r=e+n,i=t;if(n<0)throw Error(`negative radius`);this._x1===null?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>EV||Math.abs(this._y1-i)>EV)&&(this._+=`L`+r+`,`+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}})),kV,AV=o((()=>{kV=class{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}}})),jV,MV=o((()=>{OV(),AV(),jV=class{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t))||!((i=+i)>=(n=+n)))throw Error(`invalid bounds`);this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this,i,a,o=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r=0,s=0,c=n.length,l,u;r1;)i-=2;for(let e=2;e0){if(t>=this.ymax)return null;(a=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(a=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t1e-10)return!1}return!0}function gCe(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}function _Ce(e,t,n,r){let i=e.length,a=new Float64Array(i*2);for(let o=0;o{fCe(),OV(),AV(),MV(),NV=2*Math.PI,PV=Math.pow,FV=class e{static from(t,n=pCe,r=mCe,i){return new e(`length`in t?_Ce(t,n,r,i):Float64Array.from(vCe(t,n,r,i)))}constructor(e){this._delaunator=new TV(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(){let e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&hCe(e)){this.collinear=Int32Array.from({length:t.length/2},(e,t)=>t).sort((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]);let e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,r.length===2&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new jV(this,e)}*neighbors(e){let{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:o}=this;if(o){let t=o.indexOf(e);t>0&&(yield o[t-1]),t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){let{inedges:r,hull:i,_hullIndex:a,halfedges:o,triangles:s,points:c}=this;if(r[e]===-1||!c.length)return(e+1)%(c.length>>1);let l=e,u=PV(t-c[e*2],2)+PV(n-c[e*2+1],2),d=r[e],f=d;do{let r=s[f],d=PV(t-c[r*2],2)+PV(n-c[r*2+1],2);if(d{yCe(),MV()})),xCe=c({voronoi:()=>IV});function IV(e){G.call(this,null,e)}function SCe(e){let t=e[0][0],n=e[0][1],r=e.length-1;for(;e[r][0]===t&&e[r][1]===n;--r);return`M`+e.slice(0,r+1).join(`L`)+`Z`}function CCe(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}var LV,wCe=o((()=>{Xx(),Ag(),bCe(),IV.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`}]},LV=[-1e5,-1e5,1e5,1e5],U(IV,G,{transform(e,t){let n=e.as||`path`,r=t.source;if(!r||!r.length)return t;let i=e.size;i=i?[0,0,i[0],i[1]]:(i=e.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:LV;let a=this.value=FV.from(r,e.x,e.y).voronoi(i);for(let e=0,t=r.length;eBV});function ECe(){var e=[256,256],t,n,r,i,a,o,s,c=RV,l=[],u=Math.random,d={};d.layout=function(){for(var c=f(AT()),d=MCe((e[0]>>5)*e[1]),m=null,h=l.length,g=-1,_=[],v=l.map(e=>({text:t(e),font:n(e),style:i(e),weight:a(e),rotate:o(e),size:~~(r(e)+1e-14),padding:s(e),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:e})).sort((e,t)=>t.size-e.size);++g>1,y.y=e[1]*(u()+.5)>>1,DCe(c,y,v,g),y.hasText&&p(d,y,m)&&(_.push(y),m?kCe(m,y):m=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=e[0]>>1,y.y-=e[1]>>1)}return _};function f(e){e.width=e.height=1;var t=Math.sqrt(e.getContext(`2d`).getImageData(0,0,1,1).data.length>>2);e.width=(HV<<5)/t,e.height=UV/t;var n=e.getContext(`2d`);return n.fillStyle=n.strokeStyle=`red`,n.textAlign=`center`,{context:n,ratio:t}}function p(t,n,r){for(var i=n.x,a=n.y,o=Math.hypot(e[0],e[1]),s=c(e),l=u()<.5?1:-1,d=-l,f,p,m;(f=s(d+=l))&&(p=~~f[0],m=~~f[1],!(Math.min(Math.abs(p),Math.abs(m))>=o));)if(n.x=i+p,n.y=a+m,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>e[0]||n.y+n.y1>e[1])&&(!r||!OCe(n,t,e[0]))&&(!r||ACe(n,r))){for(var h=n.sprite,g=n.width>>5,_=e[0]>>5,v=n.x-(g<<4),y=v&127,b=32-y,x=n.y1-n.y0,S=(n.y+n.y0)*_+(v>>5),C,w=0;w>>y:0);S+=_}return n.sprite=null,!0}return!1}return d.words=function(e){return arguments.length?(l=e,d):l},d.size=function(t){return arguments.length?(e=[+t[0],+t[1]],d):e},d.font=function(e){return arguments.length?(n=zV(e),d):n},d.fontStyle=function(e){return arguments.length?(i=zV(e),d):i},d.fontWeight=function(e){return arguments.length?(a=zV(e),d):a},d.rotate=function(e){return arguments.length?(o=zV(e),d):o},d.text=function(e){return arguments.length?(t=zV(e),d):t},d.spiral=function(e){return arguments.length?(c=WV[e]||e,d):c},d.fontSize=function(e){return arguments.length?(r=zV(e),d):r},d.padding=function(e){return arguments.length?(s=zV(e),d):s},d.random=function(e){return arguments.length?(u=e,d):u},d}function DCe(e,t,n,r){if(!t.sprite){var i=e.context,a=e.ratio;i.clearRect(0,0,(HV<<5)/a,UV/a);var o=0,s=0,c=0,l=n.length,u,d,f,p,m;for(--r;++r>5<<5,f=~~Math.max(Math.abs(v+y),Math.abs(v-y))}else u=u+31>>5<<5;if(f>c&&(c=f),o+u>=HV<<5&&(o=0,s+=c,c=0),s+f>=UV)break;i.translate((o+(u>>1))/a,(s+(f>>1))/a),t.rotate&&i.rotate(t.rotate*VV),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=f,t.xoff=o,t.yoff=s,t.x1=u>>1,t.y1=f>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=u}for(var x=i.getImageData(0,0,(HV<<5)/a,UV/a).data,S=[];--r>=0;)if(t=n[r],t.hasText){for(u=t.width,d=u>>5,f=t.y1-t.y0,p=0;p>5),E=x[(s+m)*(HV<<5)+(o+p)<<2]?1<<31-p%32:0;S[T]|=E,C|=E}C?w=m:(t.y0++,f--,m--,s++)}t.y1=t.y0+w,t.sprite=S.slice(0,(t.y1-t.y0)*d)}}}function OCe(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,a=e.x-(i<<4),o=a&127,s=32-o,c=e.y1-e.y0,l=(e.y+e.y0)*n+(a>>5),u,d=0;d>>o:0))&t[l+f])return!0;l+=n}return!1}function kCe(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function ACe(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0{MT(),Xx(),Ag(),DO(),VS(),VV=Math.PI/180,HV=64,UV=2048,WV={archimedean:RV,rectangular:jCe},GV=[`x`,`y`,`font`,`fontSize`,`fontStyle`,`fontWeight`,`angle`],KV=[`text`,`font`,`rotate`,`fontSize`,`fontStyle`,`fontWeight`],BV.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:GV}]},U(BV,G,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&V(`Wordcloud size dimensions must be non-zero.`);function n(n){let r=e[n];return ig(r)&&t.modified(r.fields)}let r=e.modified();if(!(r||t.changed(t.ADD_REM)||KV.some(n)))return;let i=t.materialize(t.SOURCE).source,a=this.value,o=e.as||GV,s=e.fontSize||14,c;if(ig(s)?c=e.fontSizeRange:s=cg(s),c){let e=s,t=XD(`sqrt`)().domain(dg(i,e)).range(c);s=n=>t(e(n))}i.forEach(e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0});let l=a.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||`archimedean`).rotate(e.rotate||0).font(e.font||`sans-serif`).fontStyle(e.fontStyle||`normal`).fontWeight(e.fontWeight||`normal`).fontSize(s).random(PS).layout(),u=a.size(),d=u[0]>>1,f=u[1]>>1,p=l.length;for(let e=0,t,n;eXV,resolvefilter:()=>ZV});function FCe(){let e=8,t=[],n=eH(0),r=qV(0,e),i=qV(0,e);return{data:()=>t,seen:()=>n=ICe(n,t.length),add(e){for(let n=0,r=t.length,i=e.length,a;nt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=qV(t,e,r),i=qV(t,e))}}}function ICe(e,t,n){return e.length>=t?e:(n||=new e.constructor(t),n.set(e),n)}function qV(e,t,n){let r=(t<257?QV:t<65537?$V:eH)(e);return n&&r.set(n),r}function JV(e,t,n){let r=1<0)for(f=0;fe,size:()=>n}}function LCe(e,t){return e.sort.call(t,(t,n)=>{let r=e[t],i=e[n];return ri)}),uoe(e,t)}function RCe(e,t,n,r,i,a,o,s,c){let l=0,u=0,d;for(d=0;l{r_(),Xx(),Ag(),QV=e=>new Uint8Array(e),$V=e=>new Uint16Array(e),eH=e=>new Uint32Array(e),XV.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}}]},U(XV,G,{transform(e,t){return this._dims?e.modified(`fields`)||e.fields.some(e=>t.modified(e.fields))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){let n=e.fields,r=e.query,i=this._indices={},a=this._dims=[],o=r.length,s=0,c,l;for(;s{let e=i.remove(t,n);for(let t in r)r[t].reindex(e)})},update(e,t,n){let r=this._dims,i=e.query,a=t.stamp,o=r.length,s=0,c,l;for(n.filters=0,l=0;lp)for(g=p,_=Math.min(d,m);g<_;++g)v=c[g],a[v]!==n&&(s[v]=o[v],a[v]=n,r.push(v)),o[v]^=h;if(f>m)for(g=Math.max(d,m),_=f;g<_;++g)v=c[g],a[v]!==n&&(s[v]=o[v],a[v]=n,r.push(v)),o[v]^=h;else if(fu)for(p=u,m=Math.min(c,d);pd)for(p=Math.max(c,d),m=l;ps[e]&n?null:o[e];return a.filter(a.MOD,l),i&i-1?(a.filter(a.ADD,e=>{let t=s[e]&n;return!t&&t^c[e]&n?o[e]:null}),a.filter(a.REM,e=>{let t=s[e]&n;return t&&!(t^(t^c[e]&n))?o[e]:null})):(a.filter(a.ADD,l),a.filter(a.REM,e=>(s[e]&n)===i?o[e]:null)),a.filter(a.SOURCE,e=>l(e._index))}})}));function tH(e){this.type=e}function BCe(e){switch(e.type){case BH:return e.elements;case VH:case WH:return[e.left,e.right];case HH:return[e.callee].concat(e.arguments);case UH:return[e.test,e.consequent,e.alternate];case GH:return[e.object,e.property];case KH:return e.properties;case RH:return[e.key,e.value];case qH:return[e.argument];case zH:case LH:case IH:default:return[]}}function nH(e,t){if(!e)throw Error(`ASSERT: `+t)}function rH(e){return e>=48&&e<=57}function iH(e){return`0123456789abcdefABCDEF`.includes(e)}function aH(e){return`01234567`.includes(e)}function VCe(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function oH(e){return e===10||e===13||e===8232||e===8233}function sH(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&AU.test(String.fromCharCode(e))}function cH(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&jU.test(String.fromCharCode(e))}function lH(){for(;q1114111||e!==`}`)&&SH({},vU,OU),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function dH(){var e=YH.charCodeAt(q++),t=String.fromCharCode(e);for(e===92&&(YH.charCodeAt(q)!==117&&SH({},vU,OU),++q,e=uH(`u`),(!e||e===`\\`||!sH(e.charCodeAt(0)))&&SH({},vU,OU),t=e);q>>=`)return q+=4,{type:iU,value:o,start:e,end:q};if(a=o.substr(0,3),a===`>>>`||a===`<<=`||a===`>>=`)return q+=3,{type:iU,value:a,start:e,end:q};if(i=a.substr(0,2),r===i[1]&&`+-<>&|`.includes(r)||i===`=>`)return q+=2,{type:iU,value:i,start:e,end:q};if(i===`//`&&SH({},vU,OU),`<>=!+-*%&|^/`.includes(r))return++q,{type:iU,value:r,start:e,end:q};SH({},vU,OU)}function GCe(e){let t=``;for(;q{if(parseInt(t,16)<=1114111)return`x`;SH({},wU)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,`x`));try{new RegExp(n)}catch{SH({},wU)}try{return new RegExp(e,t)}catch{return null}}function YCe(){var e=YH[q],t,n,r,i;for(nH(e===`/`,`Regular expression literal must start with a slash`),t=YH[q++],n=!1,r=!1;q=0&&SH({},wU,n),{value:n,literal:t}}function ZCe(){var e,t,n,r;return ZH=null,lH(),e=q,t=YCe(),n=XCe(),r=JCe(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:q}}function QCe(e){return e.type===eU||e.type===tU||e.type===QH||e.type===nU}function mH(){if(lH(),q>=XH)return{type:$H,start:q,end:q};let e=YH.charCodeAt(q);return sH(e)?WCe():e===40||e===41||e===59?fH():e===39||e===34?qCe():e===46?rH(YH.charCodeAt(q+1))?pH():fH():rH(e)?pH():fH()}function hH(){let e=ZH;return q=e.end,ZH=mH(),q=e.end,e}function gH(){let e=q;ZH=mH(),q=e}function $Ce(e){let t=new tH(sU);return t.elements=e,t}function _H(e,t,n){let r=new tH(e===`||`||e===`&&`?pU:cU);return r.operator=e,r.left=t,r.right=n,r}function ewe(e,t){let n=new tH(lU);return n.callee=e,n.arguments=t,n}function twe(e,t,n){let r=new tH(uU);return r.test=e,r.consequent=t,r.alternate=n,r}function vH(e){let t=new tH(dU);return t.name=e,t}function yH(e){let t=new tH(fU);return t.value=e.value,t.raw=YH.slice(e.start,e.end),e.regex&&(t.raw===`//`&&(t.raw=`/(?:)/`),t.regex=e.regex),t}function bH(e,t,n){let r=new tH(mU);return r.computed=e===`[`,r.object=t,r.property=n,r.computed||(n.member=!0),r}function nwe(e){let t=new tH(hU);return t.properties=e,t}function xH(e,t,n){let r=new tH(gU);return r.key=t,r.value=n,r.kind=e,r}function rwe(e,t){let n=new tH(_U);return n.operator=e,n.argument=t,n.prefix=!0,n}function SH(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(e,t)=>(nH(t`:case`<=`:case`>=`:case`instanceof`:case`in`:t=7;break;case`<<`:case`>>`:case`>>>`:t=8;break;case`+`:case`-`:t=9;break;case`*`:case`/`:case`%`:t=11;break}return t}function mwe(){var e=ZH,t,n,r,i,a,o,s,c=kH(),l;if(r=ZH,i=AH(r),i===0)return c;for(r.prec=i,hH(),t=[e,ZH],o=kH(),a=[c,r,o];(i=AH(ZH))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,c=a.pop(),t.pop(),n=_H(s,c,o),a.push(n);r=hH(),r.prec=i,a.push(r),t.push(ZH),n=kH(),a.push(n)}for(l=a.length-1,n=a[l],t.pop();l>1;)t.pop(),n=_H(a[l-1].value,a[l-2],n),l-=2;return n}function jH(){var e=mwe(),t,n;return TH(`?`)&&(hH(),t=jH(),wH(`:`),n=jH(),e=twe(e,t,n)),e}function MH(){let e=jH();if(TH(`,`))throw Error(kU);return e}function NH(e){YH=e,q=0,XH=YH.length,ZH=null,gH();let t=MH();if(ZH.type!==$H)throw Error(`Unexpect token after expression.`);return t}function PH(e){function t(t,n,r,i){let a=e(n[0]);return r&&(a=r+`(`+a+`)`,r.lastIndexOf(`new `,0)===0&&(a=`(`+a+`)`)),a+`.`+t+(i<0?``:i===0?`()`:`(`+n.slice(1).map(e).join(`,`)+`)`)}function n(e,n,r){return i=>t(e,i,n,r)}let r=`new Date`,i=`String`,a=`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(t){t.length<3&&V(`Missing arguments to clamp function.`),t.length>3&&V(`Too many arguments to clamp function.`);let n=t.map(e);return`Math.max(`+n[1]+`, Math.min(`+n[2]+`,`+n[0]+`))`},now:`Date.now`,utc:`Date.UTC`,datetime:r,date:n(`getDate`,r,0),day:n(`getDay`,r,0),year:n(`getFullYear`,r,0),month:n(`getMonth`,r,0),hours:n(`getHours`,r,0),minutes:n(`getMinutes`,r,0),seconds:n(`getSeconds`,r,0),milliseconds:n(`getMilliseconds`,r,0),time:n(`getTime`,r,0),timezoneoffset:n(`getTimezoneOffset`,r,0),utcdate:n(`getUTCDate`,r,0),utcday:n(`getUTCDay`,r,0),utcyear:n(`getUTCFullYear`,r,0),utcmonth:n(`getUTCMonth`,r,0),utchours:n(`getUTCHours`,r,0),utcminutes:n(`getUTCMinutes`,r,0),utcseconds:n(`getUTCSeconds`,r,0),utcmilliseconds:n(`getUTCMilliseconds`,r,0),length:n(`length`,null,-1),parseFloat:`parseFloat`,parseInt:`parseInt`,upper:n(`toUpperCase`,i,0),lower:n(`toLowerCase`,i,0),substring:n(`substring`,i),split:n(`split`,i),trim:n(`trim`,i,0),btoa:`btoa`,atob:`atob`,encodeURIComponent:`encodeURIComponent`,regexp:a,test:n(`test`,a),if:function(t){t.length<3&&V(`Missing arguments to if function.`),t.length>3&&V(`Too many arguments to if function.`);let n=t.map(e);return`(`+n[0]+`?`+n[1]+`:`+n[2]+`)`}}}function hwe(e){let t=e&&e.length-1;return t&&(e[0]===`"`&&e[t]===`"`||e[0]===`'`&&e[t]===`'`)?e.slice(1,-1):e}function FH(e){e||={};let t=e.allowed?Og(e.allowed):{},n=e.forbidden?Og(e.forbidden):{},r=e.constants||PU,i=(e.functions||PH)(d),a=e.globalvar,o=e.fieldvar,s=ig(a)?a:e=>`${a}["${e}"]`,c={},l={},u=0;function d(e){if(xg(e))return e;let t=f[e.type];return t??V(`Unsupported type: `+e.type),t(e)}let f={Literal:e=>e.raw,Identifier:e=>{let i=e.name;return u>0?i:fg(n,i)?V(`Illegal identifier: `+i):fg(r,i)?r[i]:fg(t,i)?i:(c[i]=1,s(i))},MemberExpression:e=>{let t=!e.computed,n=d(e.object);t&&(u+=1);let r=d(e.property);return n===o&&(l[hwe(r)]=1),t&&--u,n+(t?`.`+r:`[`+r+`]`)},CallExpression:e=>{e.callee.type!==`Identifier`&&V(`Illegal callee type: `+e.callee.type);let t=e.callee.name,n=e.arguments,r=fg(i,t)&&i[t];return r||V(`Unrecognized function: `+t),ig(r)?r(n):r+`(`+n.map(d).join(`,`)+`)`},ArrayExpression:e=>`[`+e.elements.map(d).join(`,`)+`]`,BinaryExpression:e=>`(`+d(e.left)+` `+e.operator+` `+d(e.right)+`)`,UnaryExpression:e=>`(`+e.operator+d(e.argument)+`)`,ConditionalExpression:e=>`(`+d(e.test)+`?`+d(e.consequent)+`:`+d(e.alternate)+`)`,LogicalExpression:e=>`(`+d(e.left)+e.operator+d(e.right)+`)`,ObjectExpression:e=>{for(let t of e.properties){let e=t.key.name;Ch.has(e)&&V(`Illegal property: `+e)}return`{`+e.properties.map(d).join(`,`)+`}`},Property:e=>{u+=1;let t=d(e.key);return--u,t+`:`+d(e.value)}};function p(e){let t={code:d(e),globals:Object.keys(c),fields:Object.keys(l)};return c={},l={},t}return p.functions=i,p.constants=r,p}var IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,q,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU=o((()=>{Ag(),IH=`RawCode`,LH=`Literal`,RH=`Property`,zH=`Identifier`,BH=`ArrayExpression`,VH=`BinaryExpression`,HH=`CallExpression`,UH=`ConditionalExpression`,WH=`LogicalExpression`,GH=`MemberExpression`,KH=`ObjectExpression`,qH=`UnaryExpression`,tH.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=BCe(this),n=0,r=t.length;n`,JH[eU]=`Identifier`,JH[tU]=`Keyword`,JH[nU]=`Null`,JH[rU]=`Numeric`,JH[iU]=`Punctuator`,JH[aU]=`String`,JH[oU]=`RegularExpression`,sU=`ArrayExpression`,cU=`BinaryExpression`,lU=`CallExpression`,uU=`ConditionalExpression`,dU=`Identifier`,fU=`Literal`,pU=`LogicalExpression`,mU=`MemberExpression`,hU=`ObjectExpression`,gU=`Property`,_U=`UnaryExpression`,vU=`Unexpected token %0`,yU=`Unexpected number`,bU=`Unexpected string`,xU=`Unexpected identifier`,SU=`Unexpected reserved word`,CU=`Unexpected end of input`,wU=`Invalid regular expression`,TU=`Invalid regular expression: missing /`,EU=`Octal literals are not allowed in strict mode.`,DU=`Duplicate data property in object literal not allowed in strict mode`,OU=`ILLEGAL`,kU=`Disabled.`,AU=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]`),jU=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]`),MU={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},NU={if:1},PU={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 IU(e){return(!e.getter||!e.getter[zU])&&(e.getter=hh(e.field),e.getter[zU]=!0),e.getter}function LU(e,t){for(var n=t.fields,r=t.values,i=n.length,a=0,o,s;a=r[a])return!1}else if(s.type===eW){if(o>r[a])return!1}else if(s.type===tW){if(o<=r[a])return!1}else if(s.type===nW){if(oug(t.fields?{values:t.fields.map(t=>IU(t)(e.datum))}:{[KU]:qU(e.datum)},t))}function ywe(e,t,n,r){for(var i=this.context.data[e],a=i?i.values.value:[],o={},s={},c={},l,u,d,f,p,m,h,g,_,v,y=a.length,b=0,x,S;b(e[u[n].field]=t,e),{})))}else p=KU,m=qU(l),h=o[p]||(o[p]={}),g=h[f]||(h[f]=[]),g.push(m),n&&(g=s[f]||(s[f]=[]),g.push({[KU]:m}));if(t||=VU,o[KU]?o[KU]=lW[`${KU}_${t}`](...Object.values(o[KU])):Object.keys(o).forEach(e=>{o[e]=Object.keys(o[e]).map(t=>o[e][t]).reduce((n,r)=>n===void 0?r:lW[`${c[e]}_${t}`](n,r))}),a=Object.keys(s),n&&a.length){let e=r?UU:HU;o[e]=t===VU?{[WU]:a.reduce((e,t)=>(e.push(...s[t]),e),[])}:{[GU]:a.map(e=>({[WU]:s[e]}))}}return o}function RU(e,t,n,r){t[0].type!==`Literal`&&V(`First argument to selection functions must be a string literal.`);let i=t[0].value,a=t.length>=2&&jh(t).value,o=`@unit`,s=uW+i;a===BU&&!fg(r,o)&&(r[o]=n.getData(i).indataRef(n,`unit`)),fg(r,s)||(r[s]=n.getData(i).tuplesRef())}var zU,BU,VU,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,QU,$U,eW,tW,nW,rW,iW,aW,oW,sW,cW,lW,uW,bwe=o((()=>{r_(),Ag(),FU(),zU=Symbol(`vega_selection_getter`),BU=`intersect`,VU=`union`,HU=`vlMulti`,UU=`vlPoint`,WU=`or`,GU=`and`,KU=`_vgsid_`,qU=hh(KU),JU=`E`,YU=`R`,XU=`R-E`,ZU=`R-LE`,QU=`R-RE`,$U=`E-LT`,eW=`E-LTE`,tW=`E-GT`,nW=`E-GTE`,rW=`E-VALID`,iW=`E-ONE`,aW=`index:unit`,oW=zg(qU),sW=oW.left,cW=oW.right,lW={[`${KU}_union`]:Roe,[`${KU}_intersect`]:Foe,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;nt.includes(e)):t},R_union:function(e,t){var n=Nh(t[0]),r=Nh(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}},uW=`:`}));function dW(e){let t=this.context.data[e];return t?t.values.value:[]}function xwe(e,t,n){let r=this.context.data[e][`index:`+t],i=r?r.value.get(n):void 0;return i&&i.count}function Swe(e,t){let n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(xh).insert(t)),1}function Cwe(e,t,n){if(e){let n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return n===void 0?e:n}function fW(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?``:(IW.setYear(2e3),IW.setMonth(e),IW.setDate(t),MW.call(this,IW,n))}function wwe(e){return fW.call(this,e,1,`%B`)}function Twe(e){return fW.call(this,e,1,`%b`)}function Ewe(e){return fW.call(this,0,2+e,`%A`)}function Dwe(e){return fW.call(this,0,2+e,`%a`)}function pW(e,t,n,r){t[0].type!==`Literal`&&V(`First argument to data functions must be a string literal.`);let i=t[0].value,a=`:`+i;if(!fg(a,r))try{r[a]=n.getData(i).tuplesRef()}catch{}}function Owe(e,t,n,r){t[0].type!==`Literal`&&V(`First argument to indata must be a string literal.`),t[1].type!==`Literal`&&V(`Second argument to indata must be a string literal.`);let i=t[0].value,a=t[1].value,o=`@`+a;fg(o,r)||(r[o]=n.getData(i).indataRef(n,a))}function mW(e,t,n,r){if(t[0].type===`Literal`)hW(n,r,t[0].value);else for(e in n.scales)hW(n,r,e)}function hW(e,t,n){let r=`%`+n;if(!fg(t,r))try{t[r]=e.scaleRef(n)}catch{}}function gW(e,t){if(xg(e)){let n=t.scales[e];return n&&ape(n.value)?n.value:void 0}else if(ig(e))return ape(e)?e:void 0}function kwe(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=mW,n._range=mW,n._scale=mW;let r=t=>`_[`+(t.type===`Literal`?W(`%`+t.value):W(`%`)+`+`+e(t))+`]`;return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>`${r(e[0])}.range()`,_scale:t=>`${r(t[0])}(${e(t[1])})`}}function _W(e,t){return function(n,r,i){if(n){let t=gW(n,(i||this).context);return t&&t.path[e](r)}else return t(r)}}function Awe(e,t){let n=gW(e,(t||this).context);return n&&n.scale()}function jwe(e){let t=this.context.group,n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function vW(e,t,n){try{e[t].apply(e,[`EXPRESSION`].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function Mwe(){return vW(this.context.dataflow,`warn`,arguments)}function Nwe(){return vW(this.context.dataflow,`info`,arguments)}function Pwe(){return vW(this.context.dataflow,`debug`,arguments)}function yW(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function bW(e){let t=JT(e),n=yW(t.r),r=yW(t.g),i=yW(t.b);return .2126*n+.7152*r+.0722*i}function Fwe(e,t){let n=bW(e),r=bW(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)}function Iwe(){let e=[].slice.call(arguments);return e.unshift({}),ug(...e)}function xW(e,t){return e===t||e!==e&&t!==t?!0:H(e)?H(t)&&e.length===t.length?Lwe(e,t):!1:Eh(e)&&Eh(t)?SW(e,t):!1}function Lwe(e,t){for(let n=0,r=e.length;nSW(e,t)}function Rwe(e,t,n,r,i,a){let o=this.context.dataflow,s=this.context.data[e],c=s.input,l=o.stamp(),u=s.changes,d,f;if(o._trigger===!1||!(c.value.length||t||r))return 0;if((!u||u.stamp{s.modified=!0,o.pulse(c,u).run()},!0,1)),n&&(d=n===!0?xh:H(n)||tx(n)?n:CW(n),u.remove(d)),t&&u.insert(t),r&&(d=CW(r),c.value.some(d)?u.remove(d):u.insert(r)),i){if(ig(i))throw Error(`modify parameter must be a data tuple, not a function`);for(f in a)u.modify(i,f,a[f])}return 1}function zwe(e){let t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function Bwe(e){let t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}function Vwe(e,t){let n=BW[t]||(BW[t]=hh(t));return H(e)?e.map(n):n(e)}function wW(e){return H(e)||ArrayBuffer.isView(e)?e:null}function TW(e){return wW(e)||(xg(e)?e:null)}function Hwe(e,...t){return wW(e).join(...t)}function Uwe(e,...t){return TW(e).indexOf(...t)}function Wwe(e,...t){return TW(e).lastIndexOf(...t)}function Gwe(e,...t){return TW(e).slice(...t)}function Kwe(e,t,n){return ig(n)&&V(`Function argument passed to replace.`),!xg(t)&&!bg(t)&&V(`Please pass a string or RegExp argument to replace.`),String(e).replace(t,n)}function qwe(e){return wW(e).slice().reverse()}function Jwe(e){return wW(e).slice().sort(sg)}function Ywe(e,t,n){return JD(e||0,t||0,n||0)}function Xwe(e,t){let n=gW(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function Zwe(e,t){let n=gW(e,(t||this).context);return n?n.copy():void 0}function Qwe(e,t){let n=gW(e,(t||this).context);return n?n.domain():[]}function $we(e,t,n){let r=gW(e,(n||this).context);return r?H(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}function eTe(e,t){let n=gW(e,(t||this).context);return n&&n.range?n.range():[]}function tTe(e,t,n){let r=gW(e,(n||this).context);return r?r(t):void 0}function nTe(e,t,n,r,i){e=gW(e,(i||this).context);let a=Jpe(t,n),o=e.domain(),s=o[0],c=jh(o),l=vh;return c-s?l=ppe(e,s,c):e=(e.interpolator?XD(`sequential`)().interpolator(e.interpolator()):XD(`linear`)().interpolate(e.interpolate()).range(e.range())).domain([s=0,c=1]),e.ticks&&(o=e.ticks(+r||15),s!==o[0]&&o.unshift(s),c!==jh(o)&&o.push(c)),o.forEach(t=>a.stop(l(t),e(t))),a}function rTe(e,t,n){let r=gW(e,(n||this).context);return function(e){return r?r.path.context(e)(t):``}}function iTe(e){let t=null;return function(n){return n?MO(n,t||=jO(e)):e}}function EW(e,t){let n=dW.call(t,e);return n.root&&n.root.lookup||{}}function aTe(e,t,n){let r=EW(e,this),i=r[t],a=r[n];return i&&a?i.path(a).map(VW):void 0}function oTe(e,t){let n=EW(e,this)[t];return n?n.ancestors().map(VW):void 0}function sTe(){let e=HW();return e?e.screen:{}}function cTe(){let e=HW();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function lTe(){let e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function DW(e,t,n){if(!e)return[];let[r,i]=e,a=new zO().set(r[0],r[1],i[0],i[1]);return $he(n||this.context.dataflow.scenegraph().root,a,uTe(t))}function uTe(e){let t=null;if(e){let n=tg(e.marktype),r=tg(e.markname);t=e=>(!n.length||n.some(t=>e.marktype===t))&&(!r.length||r.some(t=>e.name===t))}return t}function dTe(e,t,n,r=5){e=tg(e);let i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function fTe(e){return tg(e).reduce((t,[n,r],i)=>t+=i==0?`M ${n},${r} `:i===e.length-1?` Z`:`L ${n},${r} `,``)}function pTe(e,t,n){let{x:r,y:i,mark:a}=n,o=new zO().set(2**53-1,2**53-1,-(2**53-1),-(2**53-1));for(let[e,n]of t)eo.x2&&(o.x2=e),no.y2&&(o.y2=n);return o.translate(r,i),DW([[o.x1,o.y1],[o.x2,o.y2]],e,a).filter(e=>mTe(e.x,e.y,t))}function mTe(e,t,n){let r=0;for(let i=0,a=n.length-1;it!=s>t&&e<(o-c)*(t-l)/(s-l)+c&&r++}return r&1}function hTe(e){let t=PH(e);WW.forEach(e=>t[e]=GW+e);for(let e in UW)t[e]=KW+e;return ug(t,kwe(e,UW,qW)),t}function OW(e,t,n){return arguments.length===1?UW[e]:(UW[e]=t,n&&(qW[e]=n),YW&&(YW.functions[e]=KW+e),this)}function kW(e,t){let n={},r;try{e=xg(e)?e:W(e)+``,r=NH(e)}catch{V(`Expression parse error: `+e)}r.visit(e=>{if(e.type!==`CallExpression`)return;let r=e.callee.name,i=JW.visitors[r];i&&i(r,e.arguments,t,n)});let i=YW(r);return i.globals.forEach(e=>{let r=`$`+e;!fg(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))}),{$expr:ug({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}var AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW,JW,YW,XW=o((()=>{Ag(),FU(),DO(),HL(),$E(),Xx(),Kj(),bwe(),VS(),Py(),r_(),AW=e=>function(t,n){let r=this.context.dataflow.locale();return t===null?`null`:r[e](n)(t)},jW=AW(`format`),MW=AW(`timeFormat`),NW=AW(`utcFormat`),PW=AW(`timeParse`),FW=AW(`utcParse`),IW=new Date(2e3,0,1),LW=_W(`area`,Z_e),RW=_W(`bounds`,tve),zW=_W(`centroid`,cve),BW={},VW=e=>e.data,HW=()=>typeof window<`u`&&window||null,UW={random(){return PS()},cumulativeNormal:oS,cumulativeLogNormal:fS,cumulativeUniform:vS,densityNormal:aS,densityLogNormal:dS,densityUniform:_S,quantileNormal:sS,quantileLogNormal:pS,quantileUniform:yS,sampleNormal:iS,sampleLogNormal:uS,sampleUniform:gS,isArray:H,isBoolean:_g,isDate:vg,isDefined(e){return e!==void 0},isNumber:yg,isObject:Eh,isRegExp:bg,isString:xg,isTuple:tx,isValid(e){return e!=null&&e===e},toBoolean:Tg,toDate(e){return Eg(e)},toNumber:Nh,toString:Dg,indexof:Uwe,join:Hwe,lastindexof:Wwe,replace:Kwe,reverse:qwe,sort:Jwe,slice:Gwe,flush:Wie,lerp:nae,merge:Iwe,pad:dae,peek:jh,pluck:Vwe,span:wg,inrange:gg,truncate:bae,rgb:JT,lab:EE,hcl:ME,hsl:rE,luminance:bW,contrast:Fwe,sequence:n_,format:jW,utcFormat:NW,utcParse:FW,utcOffset:Uv,utcSequence:Kv,timeFormat:MW,timeParse:PW,timeOffset:Hv,timeSequence:Gv,timeUnitSpecifier:Cv,monthFormat:wwe,monthAbbrevFormat:Twe,dayFormat:Ewe,dayAbbrevFormat:Dwe,quarter:$h,utcquarter:eg,week:Ev,utcweek:jv,dayofyear:Tv,utcdayofyear:Av,warn:Mwe,info:Nwe,debug:Pwe,extent(e){return dg(e)},inScope:jwe,intersect:DW,clampRange:rg,pinchDistance:zwe,pinchAngle:Bwe,screen:sTe,containerSize:lTe,windowSize:cTe,bandspace:Ywe,setdata:Swe,pathShape:iTe,panLinear:Lh,panLog:Rh,panPow:zh,panSymlog:Bh,zoomLinear:Hh,zoomLog:Uh,zoomPow:Wh,zoomSymlog:Gh,encode:Cwe,modify:Rwe,lassoAppend:dTe,lassoPath:fTe,intersectLasso:pTe},WW=[`view`,`item`,`group`,`xy`,`x`,`y`],GW=`event.vega.`,KW=`this.`,qW={},JW={forbidden:[`_`],allowed:[`datum`,`event`,`item`],fieldvar:`datum`,globalvar:e=>`_[${W(`$`+e)}]`,functions:hTe,constants:PU,visitors:qW},YW=FH(JW),OW(`bandwidth`,Xwe,mW),OW(`copy`,Zwe,mW),OW(`domain`,Qwe,mW),OW(`range`,eTe,mW),OW(`invert`,$we,mW),OW(`scale`,tTe,mW),OW(`gradient`,nTe,mW),OW(`geoArea`,LW,mW),OW(`geoBounds`,RW,mW),OW(`geoCentroid`,zW,mW),OW(`geoShape`,rTe,mW),OW(`geoScale`,Awe,mW),OW(`indata`,xwe,Owe),OW(`data`,dW,pW),OW(`treePath`,aTe,pW),OW(`treeAncestors`,oTe,pW),OW(`vlSelectionTest`,gwe,RU),OW(`vlSelectionIdTest`,_we,RU),OW(`vlSelectionResolve`,ywe,RU),OW(`vlSelectionTuples`,vwe)}));function gTe(e){let t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(e=>t.parseOperator(e)),n.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()}function _Te(e,t){let n=``;return rG[t]?n:(e.x2&&(e.x?(iG[t]&&(n+=`if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;`),n+=`o.width=o.x2-o.x;`):n+=`o.x=o.x2-(o.width||0);`),e.xc&&(n+=`o.x=o.xc-(o.width||0)/2;`),e.y2&&(e.y?(iG[t]&&(n+=`if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;`),n+=`o.height=o.y2-o.y;`):n+=`o.y=o.y2-(o.height||0);`),e.yc&&(n+=`o.y=o.yc-(o.height||0)/2;`),n)}function ZW(e){return(e+``).toLowerCase()}function vTe(e){return ZW(e)===`operator`}function yTe(e){return ZW(e)===`collect`}function QW(e,t,n){n.endsWith(`;`)||(n=`return(`+n+`);`);let r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function bTe(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} +`)}function l(t){return t.map(u).join(e)}function u(e){return e==null?``:e instanceof Date?Cae(e):t.test(e+=``)?`"`+e.replace(/"/g,`""`)+`"`:e}return{parse:r,parseRows:i,format:o,formatBody:s,formatRows:c,formatRow:l,formatValue:u}}var hg,gg,_g,vg,yg,Tae=o((()=>{hg={},gg={},_g=34,vg=10,yg=13})),Eae=o((()=>{Tae()}));function Dae(e){return e}var bg=o((()=>{}));function Oae(e){if(e==null)return Dae;var t,n,r=e.scale[0],i=e.scale[1],a=e.translate[0],o=e.translate[1];return function(e,s){s||(t=n=0);var c=2,l=e.length,u=Array(l);for(u[0]=(t+=e[0])*r+a,u[1]=(n+=e[1])*i+o;c{bg()}));function kae(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}var Aae=o((()=>{}));function jae(e,t){return typeof t==`string`&&(t=e.objects[t]),t.type===`GeometryCollection`?{type:`FeatureCollection`,features:t.geometries.map(function(t){return Sg(e,t)})}:Sg(e,t)}function Sg(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=Cg(e,t);return n==null&&r==null?{type:`Feature`,properties:i,geometry:a}:r==null?{type:`Feature`,id:n,properties:i,geometry:a}:{type:`Feature`,id:n,bbox:r,properties:i,geometry:a}}function Cg(e,t){var n=Oae(e.transform),r=e.arcs;function i(e,t){t.length&&t.pop();for(var i=r[e<0?~e:e],a=0,o=i.length;a{Aae(),xg()}));function Mae(e,t){var n={},r={},i={},a=[],o=-1;t.forEach(function(n,r){var i=e.arcs[n<0?~n:n],a;i.length<3&&!i[1][0]&&!i[1][1]&&(a=t[++o],t[o]=n,t[r]=a)}),t.forEach(function(e){var t=s(e),n=t[0],a=t[1],o,c;if(o=i[n])if(delete i[o.end],o.push(e),o.end=a,c=r[a]){delete r[c.start];var l=c===o?o:o.concat(c);r[l.start=o.start]=i[l.end=c.end]=l}else r[o.start]=i[o.end]=o;else if(o=r[a])if(delete r[o.start],o.unshift(e),o.start=n,c=i[n]){delete i[c.end];var u=c===o?o:c.concat(o);r[u.start=c.start]=i[u.end=o.end]=u}else r[o.start]=i[o.end]=o;else o=[e],r[o.start=n]=i[o.end=a]=o});function s(t){var n=e.arcs[t<0?~t:t],r=n[0],i;return e.transform?(i=[0,0],n.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=n[n.length-1],t<0?[i,r]:[r,i]}function c(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[e<0?~e:e]=1}),a.push(i)}}return c(i,r),c(r,i),t.forEach(function(e){n[e<0?~e:e]||a.push([e])}),a}var Tg=o((()=>{}));function Nae(e){return Cg(e,Pae.apply(this,arguments))}function Pae(e,t,n){var r,i,a;if(arguments.length>1)r=Fae(e,t,n);else for(i=0,r=Array(a=e.arcs.length);i{wg(),Tg()})),Lae=o((()=>{xg(),wg(),Iae(),Tg(),bg()}));function Eg(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var Dg=o((()=>{}));function Rae(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var Og=o((()=>{}));function kg(e){let t,n,r;e.length===2?(t=e===Eg||e===Rae?e:zae,n=e,r=e):(t=Eg,n=(t,n)=>Eg(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(in&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function zae(){return 0}var Ag=o((()=>{Dg(),Og()}));function jg(e){return e===null?NaN:+e}function*Bae(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var Mg=o((()=>{})),Ng,Pg,Fg,Vae=o((()=>{Dg(),Ag(),Mg(),Ng=kg(Eg),Pg=Ng.right,Fg=Ng.left,kg(jg).center}));function Hae(e,t){let n=0,r,i=0,a=0;if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(r=t-i,i+=r/++n,a+=r*(t-i));else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,a+=r*(s-i))}if(n>1)return a/(n-1)}var Ig=o((()=>{}));function Uae(e,t){let n=Hae(e,t);return n&&Math.sqrt(n)}var Wae=o((()=>{Ig()})),Lg,Gae=o((()=>{Lg=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let t=this._partials,n=0;for(let r=0;r0){for(a=e[--t];t>0&&(n=a,r=e[--t],a=n+r,i=r-(a-n),!i););t>0&&(i<0&&e[t-1]<0||i>0&&e[t-1]>0)&&(r=i*2,n=a+r,r==n-a&&(a=n))}return a}}}));function Rg({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function zg({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Bg({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Vg(e){return typeof e==`object`&&e?e.valueOf():e}var Hg,Ug,Wg=o((()=>{Hg=class extends Map{constructor(e,t=Vg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(Rg(this,e))}has(e){return super.has(Rg(this,e))}set(e,t){return super.set(zg(this,e),t)}delete(e){return super.delete(Bg(this,e))}},Ug=class extends Set{constructor(e,t=Vg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let t of e)this.add(t)}has(e){return super.has(Rg(this,e))}add(e){return super.add(zg(this,e))}delete(e){return super.delete(Bg(this,e))}}}));function Kae(e,t){return Array.from(t,t=>e[t])}var qae=o((()=>{}));function Jae(e=Eg){if(e===Eg)return Gg;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Gg(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et))}var Kg=o((()=>{Dg()}));function qg(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Zg?10:a>=Qg?5:a>=$g?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];let r=t=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e{Zg=Math.sqrt(50),Qg=Math.sqrt(10),$g=Math.sqrt(2)}));function e_(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}var t_=o((()=>{}));function n_(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}var r_=o((()=>{}));function i_(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Gg:Jae(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));i_(e,t,u,d,i)}let a=e[t],o=n,s=r;for(a_(e,n,t),i(e[r],a)>0&&a_(e,n,r);o0;)--s}i(e[n],a)===0?a_(e,n,s):(++s,a_(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function a_(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}var o_=o((()=>{Kg()}));function s_(e,t,n){if(e=Float64Array.from(Bae(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return n_(e);if(t>=1)return e_(e);var r,i=(r-1)*t,a=Math.floor(i),o=e_(i_(e,a).subarray(0,a+1));return o+(n_(e.subarray(a+1))-o)*(i-a)}}function c_(e,t,n=jg){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}var l_=o((()=>{t_(),r_(),o_(),Mg()}));function Xae(e,t){let n=0,r=0;if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}var Zae=o((()=>{}));function u_(e,t){return s_(e,.5,t)}var Qae=o((()=>{l_()}));function*$ae(e){for(let t of e)yield*t}function d_(e){return Array.from($ae(e))}var eoe=o((()=>{}));function f_(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r{}));function p_(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}var noe=o((()=>{}));function roe(e,...t){e=new Ug(e),t=t.map(ioe);out:for(let n of e)for(let r of t)if(!r.has(n)){e.delete(n);continue out}return e}function ioe(e){return e instanceof Ug?e:new Ug(e)}var aoe=o((()=>{Wg()}));function ooe(...e){let t=new Ug;for(let n of e)for(let e of n)t.add(e);return t}var soe=o((()=>{Wg()})),m_=o((()=>{Vae(),Dg(),Ag(),Og(),Wae(),Gae(),Wg(),Kg(),Yae(),l_(),t_(),Zae(),Qae(),eoe(),r_(),qae(),o_(),toe(),noe(),Ig(),aoe(),soe()}));function coe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function h_(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var g_=o((()=>{}));function __(e){return e=h_(Math.abs(e)),e?e[1]:NaN}var v_=o((()=>{g_()}));function loe(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}var uoe=o((()=>{}));function doe(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var foe=o((()=>{}));function y_(e){if(!(t=x_.exec(e)))throw Error(`invalid format: `+e);var t;return new b_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function b_(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}var x_,S_=o((()=>{x_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i,y_.prototype=b_.prototype,b_.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 poe(e){out:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var moe=o((()=>{}));function hoe(e,t){var n=h_(e,t);if(!n)return C_=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(C_=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+h_(e,Math.max(0,t+a-1))[0]}var C_,w_=o((()=>{g_()}));function T_(e,t){var n=h_(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var goe=o((()=>{g_()})),E_,_oe=o((()=>{g_(),w_(),goe(),E_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:coe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>T_(e*100,t),r:T_,s:hoe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}}));function D_(e){return e}var voe=o((()=>{}));function O_(e){var t=e.grouping===void 0||e.thousands===void 0?D_:loe(k_.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?D_:doe(k_.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=y_(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):E_[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=E_[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=poe(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&C_!==void 0?A_[8+C_/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++op||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(__(t)/3)))*3,r=10**-n,i=l((e=y_(e),e.type=`f`,e),{suffix:A_[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var k_,A_,j_=o((()=>{v_(),uoe(),foe(),S_(),moe(),_oe(),w_(),voe(),k_=Array.prototype.map,A_=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`]}));function yoe(e){return M_=O_(e),N_=M_.format,P_=M_.formatPrefix,M_}var M_,N_,P_,boe=o((()=>{j_(),yoe({thousands:`,`,grouping:[3],currency:[`$`,``]})}));function F_(e){return Math.max(0,-__(Math.abs(e)))}var xoe=o((()=>{v_()}));function I_(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(__(t)/3)))*3-__(Math.abs(e)))}var Soe=o((()=>{v_()}));function L_(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,__(t)-__(e))+1}var Coe=o((()=>{v_()})),R_=o((()=>{boe(),j_(),S_(),xoe(),Soe(),Coe()}));function z_(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(sz_(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(B_.setTime(+t),V_.setTime(+r),e(B_),e(V_),Math.floor(n(B_,V_))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var B_,V_,H_=o((()=>{B_=new Date,V_=new Date})),U_,W_=o((()=>{H_(),U_=z_(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e),U_.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?z_(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):U_),U_.range})),G_,K_,q_,J_,Y_,X_,Z_,Q_=o((()=>{G_=1e3,K_=G_*60,q_=K_*60,J_=q_*24,Y_=J_*7,X_=J_*30,Z_=J_*365})),$_,ev=o((()=>{H_(),Q_(),$_=z_(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*G_)},(e,t)=>(t-e)/G_,e=>e.getUTCSeconds()),$_.range})),tv,nv,rv=o((()=>{H_(),Q_(),tv=z_(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*G_)},(e,t)=>{e.setTime(+e+t*K_)},(e,t)=>(t-e)/K_,e=>e.getMinutes()),tv.range,nv=z_(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*K_)},(e,t)=>(t-e)/K_,e=>e.getUTCMinutes()),nv.range})),iv,av,ov=o((()=>{H_(),Q_(),iv=z_(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*G_-e.getMinutes()*K_)},(e,t)=>{e.setTime(+e+t*q_)},(e,t)=>(t-e)/q_,e=>e.getHours()),iv.range,av=z_(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*q_)},(e,t)=>(t-e)/q_,e=>e.getUTCHours()),av.range})),sv,cv,lv,uv=o((()=>{H_(),Q_(),sv=z_(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*K_)/J_,e=>e.getDate()-1),sv.range,cv=z_(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/J_,e=>e.getUTCDate()-1),cv.range,lv=z_(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/J_,e=>Math.floor(e/J_)),lv.range}));function dv(e){return z_(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*K_)/Y_)}function fv(e){return z_(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/Y_)}var pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv,Ev,Dv=o((()=>{H_(),Q_(),pv=dv(0),mv=dv(1),hv=dv(2),gv=dv(3),_v=dv(4),vv=dv(5),yv=dv(6),pv.range,mv.range,hv.range,gv.range,_v.range,vv.range,yv.range,bv=fv(0),xv=fv(1),Sv=fv(2),Cv=fv(3),wv=fv(4),Tv=fv(5),Ev=fv(6),bv.range,xv.range,Sv.range,Cv.range,wv.range,Tv.range,Ev.range})),Ov,kv,Av=o((()=>{H_(),Ov=z_(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),Ov.range,kv=z_(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),kv.range})),jv,Mv,Nv=o((()=>{H_(),jv=z_(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()),jv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:z_(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),jv.range,Mv=z_(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear()),Mv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:z_(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Mv.range}));function Pv(e,t,n,r,i,a){let o=[[$_,1,G_],[$_,5,5*G_],[$_,15,15*G_],[$_,30,30*G_],[a,1,K_],[a,5,5*K_],[a,15,15*K_],[a,30,30*K_],[i,1,q_],[i,3,3*q_],[i,6,6*q_],[i,12,12*q_],[r,1,J_],[r,2,2*J_],[n,1,Y_],[t,1,X_],[t,3,3*X_],[e,1,Z_]];function s(e,t,n){let r=te).right(o,i);if(a===o.length)return e.every(Xg(t/Z_,n/Z_,r));if(a===0)return U_.every(Math.max(Xg(t,n,r),1));let[s,c]=o[i/o[a-1][2]{m_(),Q_(),W_(),ev(),rv(),ov(),uv(),Dv(),Av(),Nv(),[Fv,Iv]=Pv(Mv,kv,bv,lv,av,nv),[Lv,Rv]=Pv(jv,Ov,pv,sv,iv,tv)})),zv=o((()=>{H_(),W_(),ev(),rv(),ov(),uv(),Dv(),Av(),Nv(),woe()}));function Bv(e){let t=_h(e).slice(),n={};return t.length||V(`Missing time unit.`),t.forEach(e=>{Ph(wy,e)?n[e]=1:V(`Invalid time unit: ${e}.`)}),(n.week||n.day?1:0)+(n.quarter||n.month||n.date?1:0)+ +!!n.dayofyear>1&&V(`Incompatible time units: ${e}`),t.sort((e,t)=>wy[e]-wy[t]),t}function Vv(e,t){let n=Ah({},Ty,t),r=Bv(e),i=r.length,a=``,o=0,s,c;for(o=0;oo;--s)if(c=r.slice(o,s).join(`-`),n[c]!=null){a+=n[c],o=s;break}return a.trim()}function Hv(e){return Ey.setFullYear(e),Ey.setMonth(0),Ey.setDate(1),Ey.setHours(0,0,0,0),Ey}function Uv(e){return Gv(new Date(e))}function Wv(e){return Kv(new Date(e))}function Gv(e){return sv.count(Hv(e.getFullYear())-1,e)}function Kv(e){return pv.count(Hv(e.getFullYear())-1,e)}function qv(e){return Hv(e).getDay()}function Toe(e,t,n,r,i,a,o){if(0<=e&&e<100){let s=new Date(-1,t,n,r,i,a,o);return s.setFullYear(e),s}return new Date(e,t,n,r,i,a,o)}function Jv(e){return Xv(new Date(e))}function Yv(e){return Zv(new Date(e))}function Xv(e){let t=Date.UTC(e.getUTCFullYear(),0,1);return cv.count(t-1,e)}function Zv(e){let t=Date.UTC(e.getUTCFullYear(),0,1);return bv.count(t-1,e)}function Qv(e){return Ey.setTime(Date.UTC(e,0,1)),Ey.getUTCDay()}function Eoe(e,t,n,r,i,a,o){if(0<=e&&e<100){let e=new Date(Date.UTC(-1,t,n,r,i,a,o));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,a,o))}function $v(e,t,n,r,i){let a=t||1,o=qm(e),s=(e,t,i)=>(i||=e,Doe(n[i],r[i],e===o&&a,t)),c=new Date,l=cg(e),u=l.year?s(py):Oh(2012),d=l.month?s(hy):l.quarter?s(my):Fm,f=l.week&&l.day?s(`day`,1,`weekday`):l.week?s(gy,1):l.day?s(`day`,1):l.date?s(_y,1):l.dayofyear?s(vy,1):Im,p=l.hours?s(yy):Fm,m=l.minutes?s(by):Fm,h=l.seconds?s(xy):Fm,g=l.milliseconds?s(Sy):Fm;return function(e){c.setTime(+e);let t=u(c);return i(t,d(c),f(c,t),p(c),m(c),h(c),g(c))}}function Doe(e,t,n,r){let i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}function ey(e,t,n){return t+e*7-(n+6)%7}function ty(e,t){return $v(e,t||1,Dy,Oy,Toe)}function ny(e,t){return $v(e,t||1,ky,Ay,Eoe)}function ry(e){return jy[e]}function iy(e){return My[e]}function ay(e,t,n){return e?e.offset(t,n):void 0}function oy(e,t,n){return ay(ry(e),t,n)}function sy(e,t,n){return ay(iy(e),t,n)}function cy(e,t,n,r){return e?e.range(t,n,r):void 0}function ly(e,t,n,r){return cy(ry(e),t,n,r)}function uy(e,t,n,r){return cy(iy(e),t,n,r)}function dy(e){let t=e.extent,n=e.maxbins||40,r=Math.abs(rg(t))/n,i=kg(e=>e[2]).right(Gy,r),a,o;return i===Gy.length?(a=Wy,o=Xg(t[0]/Ry,t[1]/Ry,n)):i?(i=Gy[r/Gy[i-1][2]{let n=t(e),r=new Date(n);return Number.isNaN(+r)&&V(`Invalid date: ${n}`),r}),a=Ky.findIndex(e=>!e.aligned(i,r)),o=Ky.findIndex(e=>!e.skippable&&!e.aligned(i,r)),s=o>a+1?o:a,{units:c,step:l}=Ky[s-1];return{units:c,step:l}}var py,my,hy,gy,_y,vy,yy,by,xy,Sy,Cy,wy,Ty,Ey,Dy,Oy,ky,Ay,jy,My,Ny,Py,Fy,Iy,Ooe,Ly,Ry,zy,By,Vy,Hy,koe,Aoe,Uy,Wy,Gy,joe,Moe,Ky,qy=o((()=>{dg(),zv(),m_(),py=`year`,my=`quarter`,hy=`month`,gy=`week`,_y=`date`,vy=`dayofyear`,yy=`hours`,by=`minutes`,xy=`seconds`,Sy=`milliseconds`,Cy=[py,my,hy,gy,_y,`day`,vy,yy,by,xy,Sy],wy=Cy.reduce((e,t,n)=>(e[t]=1+n,e),{}),Ty={[py]:`%Y `,[my]:`Q%q `,[hy]:`%b `,[_y]:`%d `,[gy]:`W%U `,day:`%a `,[vy]:`%j `,[yy]:`%H:00`,[by]:`00:%M`,[xy]:`:%S`,[Sy]:`.%L`,[`${py}-${hy}`]:`%Y-%m `,[`${py}-${hy}-${_y}`]:`%Y-%m-%d `,[`${yy}-${by}`]:`%H:%M`},Ey=new Date,Dy={[py]:e=>e.getFullYear(),[my]:e=>Math.floor(e.getMonth()/3),[hy]:e=>e.getMonth(),[_y]:e=>e.getDate(),[yy]:e=>e.getHours(),[by]:e=>e.getMinutes(),[xy]:e=>e.getSeconds(),[Sy]:e=>e.getMilliseconds(),[vy]:e=>Gv(e),[gy]:e=>Kv(e),weekday:(e,t)=>ey(Kv(e),e.getDay(),qv(t)),day:(e,t)=>ey(1,e.getDay(),qv(t))},Oy={[my]:e=>3*e,[gy]:(e,t)=>ey(e,0,qv(t))},ky={[py]:e=>e.getUTCFullYear(),[my]:e=>Math.floor(e.getUTCMonth()/3),[hy]:e=>e.getUTCMonth(),[_y]:e=>e.getUTCDate(),[yy]:e=>e.getUTCHours(),[by]:e=>e.getUTCMinutes(),[xy]:e=>e.getUTCSeconds(),[Sy]:e=>e.getUTCMilliseconds(),[vy]:e=>Xv(e),[gy]:e=>Zv(e),day:(e,t)=>ey(1,e.getUTCDay(),Qv(t)),weekday:(e,t)=>ey(Zv(e),e.getUTCDay(),Qv(t))},Ay={[my]:e=>3*e,[gy]:(e,t)=>ey(e,0,Qv(t))},jy={[py]:jv,[my]:Ov.every(3),[hy]:Ov,[gy]:pv,[_y]:sv,day:sv,[vy]:sv,[yy]:iv,[by]:tv,[xy]:$_,[Sy]:U_},My={[py]:Mv,[my]:kv.every(3),[hy]:kv,[gy]:bv,[_y]:cv,day:cv,[vy]:cv,[yy]:av,[by]:nv,[xy]:$_,[Sy]:U_},Ny=1e3,Py=Ny*60,Fy=Py*60,Iy=Fy*24,Ooe=Iy*7,Ly=Iy*30,Ry=Iy*365,zy=[py,hy,_y,yy,by,xy,Sy],By=zy.slice(0,-1),Vy=By.slice(0,-1),Hy=Vy.slice(0,-1),koe=Hy.slice(0,-1),Aoe=[py,gy],Uy=[py,hy],Wy=[py],Gy=[[By,1,Ny],[By,5,5*Ny],[By,15,15*Ny],[By,30,30*Ny],[Vy,1,Py],[Vy,5,5*Py],[Vy,15,15*Py],[Vy,30,30*Py],[Hy,1,Fy],[Hy,3,3*Fy],[Hy,6,6*Fy],[Hy,12,12*Fy],[koe,1,Iy],[Aoe,1,Ooe],[Uy,1,Ly],[Uy,3,3*Ly],[Wy,1,Ry]],joe={[py]:e=>e.getFullYear(),[hy]:e=>e.getMonth(),[_y]:e=>e.getDate(),day:e=>e.getDay(),[yy]:e=>e.getHours(),[by]:e=>e.getMinutes(),[xy]:e=>e.getSeconds(),[Sy]:e=>e.getMilliseconds()},Moe={[py]:e=>e.getUTCFullYear(),[hy]:e=>e.getUTCMonth(),[_y]:e=>e.getUTCDate(),day:e=>e.getUTCDay(),[yy]:e=>e.getUTCHours(),[by]:e=>e.getUTCMinutes(),[xy]:e=>e.getUTCSeconds(),[Sy]:e=>e.getUTCMilliseconds()},Ky=[{units:[py,hy,_y,yy,by,xy,Sy],step:1,aligned:()=>!0},{units:[py,hy,_y,yy,by,xy],step:1,aligned:(e,t)=>e.every(e=>t[Sy](e)===0)},{units:[py,hy,_y,yy,by],step:1,aligned:(e,t)=>e.every(e=>t[xy](e)===0)},{units:[py,hy,_y,yy,by],step:5,aligned:(e,t)=>e.every(e=>t[by](e)%5==0)},{units:[py,hy,_y,yy,by],step:10,aligned:(e,t)=>e.every(e=>t[by](e)%10==0)},{units:[py,hy,_y,yy],step:1,aligned:(e,t)=>e.every(e=>t[by](e)===0)},{units:[py,hy,_y],step:1,aligned:(e,t)=>e.every(e=>t[yy](e)===0)},{units:[py,gy],step:1,skippable:!0,aligned:(e,t)=>new Set(e.map(e=>t.day(e))).size===1},{units:[py,hy],step:1,aligned:(e,t)=>e.every(e=>t[_y](e)===1)},{units:[py,hy],step:3,aligned:(e,t)=>e.every(e=>t[hy](e)%3==0)},{units:[py],step:1,aligned:(e,t)=>e.every(e=>t[hy](e)===0)},{units:[py],step:10,aligned:(e,t)=>e.every(e=>t[py](e)%10==0)},{aligned:()=>!1}]}));function Jy(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Yy(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Xy(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Noe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Qy(i),u=$y(i),d=Qy(a),f=$y(a),p=Qy(o),m=$y(o),h=Qy(s),g=$y(s),_=Qy(c),v=$y(c),y={a:ee,A:N,b:te,B:ne,c:null,d:tse,e:tse,f:ose,g:_se,G:yse,H:nse,I:rse,j:ise,L:ase,m:sse,M:cse,p:P,q:re,Q:Hse,s:Use,S:lse,u:use,U:dse,V:pse,w:mse,W:hse,x:null,X:null,y:gse,Y:vse,Z:bse,"%":Vse},b={a:F,A:ie,b:ae,B:oe,c:null,d:xse,e:xse,f:Ese,g:Lse,G:zse,H:Sse,I:Cse,j:wse,L:Tse,m:Dse,M:Ose,p:se,q:ce,Q:Hse,s:Use,S:kse,u:Ase,U:jse,V:Nse,w:Pse,W:Fse,x:null,X:null,y:Ise,Y:Rse,Z:Bse,"%":Vse},x={a:E,A:D,b:O,B:k,c:A,d:Goe,e:Goe,f:Zoe,g:Voe,G:Boe,H:qoe,I:qoe,j:Koe,L:Xoe,m:Woe,M:Joe,p:T,q:Uoe,Q:$oe,s:ese,S:Yoe,u:Ioe,U:Loe,V:Roe,w:Foe,W:zoe,x:j,X:M,y:Voe,Y:Boe,Z:Hoe,"%":Qoe};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i53)return null;`w`in r||(r.w=1),`Z`in r?(a=Yy(Xy(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?xv.ceil(a):xv(a),a=cv.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Jy(Xy(r.y,0,1)),o=a.getDay(),a=o>4||o===0?mv.ceil(a):mv(a),a=sv.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Yy(Xy(r.y,0,1)).getUTCDay():Jy(Xy(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Yy(r)):Jy(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in eb?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function ee(e){return o[e.getDay()]}function N(e){return a[e.getDay()]}function te(e){return c[e.getMonth()]}function ne(e){return s[e.getMonth()]}function P(e){return i[+(e.getHours()>=12)]}function re(e){return 1+~~(e.getMonth()/3)}function F(e){return o[e.getUTCDay()]}function ie(e){return a[e.getUTCDay()]}function ae(e){return c[e.getUTCMonth()]}function oe(e){return s[e.getUTCMonth()]}function se(e){return i[+(e.getUTCHours()>=12)]}function ce(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}function Zy(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a[e.toLowerCase(),t]))}function Foe(e,t,n){var r=tb.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ioe(e,t,n){var r=tb.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Loe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Roe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function zoe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Boe(e,t,n){var r=tb.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Voe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Hoe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Uoe(e,t,n){var r=tb.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Woe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Goe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Koe(e,t,n){var r=tb.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function qoe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Joe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Yoe(e,t,n){var r=tb.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Xoe(e,t,n){var r=tb.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Zoe(e,t,n){var r=tb.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Qoe(e,t,n){var r=Wse.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function $oe(e,t,n){var r=tb.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ese(e,t,n){var r=tb.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tse(e,t){return Zy(e.getDate(),t,2)}function nse(e,t){return Zy(e.getHours(),t,2)}function rse(e,t){return Zy(e.getHours()%12||12,t,2)}function ise(e,t){return Zy(1+sv.count(jv(e),e),t,3)}function ase(e,t){return Zy(e.getMilliseconds(),t,3)}function ose(e,t){return ase(e,t)+`000`}function sse(e,t){return Zy(e.getMonth()+1,t,2)}function cse(e,t){return Zy(e.getMinutes(),t,2)}function lse(e,t){return Zy(e.getSeconds(),t,2)}function use(e){var t=e.getDay();return t===0?7:t}function dse(e,t){return Zy(pv.count(jv(e)-1,e),t,2)}function fse(e){var t=e.getDay();return t>=4||t===0?_v(e):_v.ceil(e)}function pse(e,t){return e=fse(e),Zy(_v.count(jv(e),e)+(jv(e).getDay()===4),t,2)}function mse(e){return e.getDay()}function hse(e,t){return Zy(mv.count(jv(e)-1,e),t,2)}function gse(e,t){return Zy(e.getFullYear()%100,t,2)}function _se(e,t){return e=fse(e),Zy(e.getFullYear()%100,t,2)}function vse(e,t){return Zy(e.getFullYear()%1e4,t,4)}function yse(e,t){var n=e.getDay();return e=n>=4||n===0?_v(e):_v.ceil(e),Zy(e.getFullYear()%1e4,t,4)}function bse(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Zy(t/60|0,`0`,2)+Zy(t%60,`0`,2)}function xse(e,t){return Zy(e.getUTCDate(),t,2)}function Sse(e,t){return Zy(e.getUTCHours(),t,2)}function Cse(e,t){return Zy(e.getUTCHours()%12||12,t,2)}function wse(e,t){return Zy(1+cv.count(Mv(e),e),t,3)}function Tse(e,t){return Zy(e.getUTCMilliseconds(),t,3)}function Ese(e,t){return Tse(e,t)+`000`}function Dse(e,t){return Zy(e.getUTCMonth()+1,t,2)}function Ose(e,t){return Zy(e.getUTCMinutes(),t,2)}function kse(e,t){return Zy(e.getUTCSeconds(),t,2)}function Ase(e){var t=e.getUTCDay();return t===0?7:t}function jse(e,t){return Zy(bv.count(Mv(e)-1,e),t,2)}function Mse(e){var t=e.getUTCDay();return t>=4||t===0?wv(e):wv.ceil(e)}function Nse(e,t){return e=Mse(e),Zy(wv.count(Mv(e),e)+(Mv(e).getUTCDay()===4),t,2)}function Pse(e){return e.getUTCDay()}function Fse(e,t){return Zy(xv.count(Mv(e)-1,e),t,2)}function Ise(e,t){return Zy(e.getUTCFullYear()%100,t,2)}function Lse(e,t){return e=Mse(e),Zy(e.getUTCFullYear()%100,t,2)}function Rse(e,t){return Zy(e.getUTCFullYear()%1e4,t,4)}function zse(e,t){var n=e.getUTCDay();return e=n>=4||n===0?wv(e):wv.ceil(e),Zy(e.getUTCFullYear()%1e4,t,4)}function Bse(){return`+0000`}function Vse(){return`%`}function Hse(e){return+e}function Use(e){return Math.floor(e/1e3)}var eb,tb,Wse,Gse,Kse=o((()=>{zv(),eb={"-":``,_:` `,0:`0`},tb=/^\s*\d+/,Wse=/^%/,Gse=/[\\^$*+?|[\]().{}]/g}));function qse(e){return nb=Noe(e),rb=nb.format,Jse=nb.parse,ib=nb.utcFormat,Yse=nb.utcParse,nb}var nb,rb,Jse,ib,Yse,Xse=o((()=>{Kse(),qse({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`]})})),ab=o((()=>{Xse(),Kse()}));function ob(e){let t={};return n=>t[n]||(t[n]=e(n))}function Zse(e,t){return n=>{let r=e(n),i=r.indexOf(t);if(i<0)return r;let a=Qse(r,i),o=ai;)if(r[a]!==`0`){++a;break}return r.slice(0,a)+o}}function Qse(e,t){let n=e.lastIndexOf(`e`),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function $se(e){let t=ob(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){let n=y_(e||`,`);if(n.precision==null){switch(n.precision=12,n.type){case`%`:n.precision-=2;break;case`e`:--n.precision;break}return Zse(t(n),t(`.1f`)(1)[1])}else return t(n)},formatSpan(e,r,i,a){a=y_(a??`,f`);let o=Xg(e,r,i),s=Math.max(Math.abs(e),Math.abs(r)),c;if(a.precision==null)switch(a.type){case`s`:return isNaN(c=I_(o,s))||(a.precision=c),n(a,s);case``:case`e`:case`g`:case`p`:case`r`:isNaN(c=L_(o,s))||(a.precision=c-(a.type===`e`));break;case`f`:case`%`:isNaN(c=F_(o))||(a.precision=c-(a.type===`%`)*2);break}return t(a)}}}function ece(){return ub=$se({format:N_,formatPrefix:P_})}function tce(e){return $se(O_(e))}function sb(e){return arguments.length?ub=tce(e):ub}function nce(e,t,n){n||={},Hm(n)||V(`Invalid time multi-format specifier: ${n}`);let r=t(xy),i=t(by),a=t(yy),o=t(_y),s=t(gy),c=t(hy),l=t(my),u=t(py),d=e(n.milliseconds||`.%L`),f=e(n.seconds||`:%S`),p=e(n.minutes||`%I:%M`),m=e(n.hours||`%I %p`),h=e(n.date||n.day||`%a %d`),g=e(n.week||`%b %d`),_=e(n.month||`%B`),v=e(n.quarter||`%B`),y=e(n.year||`%Y`);return e=>(r(e)qh(e)?t(e):nce(t,ry,e),utcFormat:e=>qh(e)?n(e):nce(n,iy,e),timeParse:ob(e.parse),utcParse:ob(e.utcParse)}}function ice(){return db=rce({format:rb,parse:Jse,utcFormat:ib,utcParse:Yse})}function ace(e){return rce(Noe(e))}function cb(e){return arguments.length?db=ace(e):db}function oce(e,t){let n=e?tce(e):sb(),r=t?ace(t):cb();return fb(n,r)}function lb(e,t){let n=arguments.length;return n&&n!==2&&V(`defaultLocale expects either zero or two arguments.`),n?fb(sb(e),cb(t)):fb(sb(),cb())}function sce(){return ece(),ice(),lb()}var ub,db,fb,pb=o((()=>{m_(),R_(),qy(),dg(),ab(),ece(),ice(),fb=(e,t)=>Ah({},e,t)}));function cce(e){return t=>({options:t||{},sanitize:uce,load:lce,fileAccess:!1,file:dce(e),http:pce})}async function lce(e,t){let n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t?.http)}async function uce(e,t){t=Ah({},this.options,t);let n=this.fileAccess,r={href:null},i,a,o,s=wce.test(e.replace(Tce,``));(e==null||typeof e!=`string`||!s)&&V(`Sanitize failure, invalid URI: `+W(e));let c=Cce.test(e);return(o=t.baseURL)&&!c&&(!e.startsWith(`/`)&&!o.endsWith(`/`)&&(e=`/`+e),e=o+e),a=(i=e.startsWith(Ece))||t.mode===`file`||t.mode!==`http`&&!c&&n,i?e=e.slice(7):e.startsWith(`//`)&&(t.defaultProtocol===`file`?(e=e.slice(2),a=!0):e=(t.defaultProtocol||`http`)+`:`+e),Object.defineProperty(r,"localFile",{value:!!a}),r.href=e,t.target&&(r.target=t.target+``),t.rel&&(r.rel=t.rel+``),t.context===`image`&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+``),r}function dce(e){return e?t=>new Promise((n,r)=>{e.readFile(t,(e,t)=>{e?r(e):n(t)})}):fce}async function fce(){V(`No file system access.`)}async function pce(e,t){let n=Ah({},this.options.http,t),r=t&&t.response,i=await fetch(e,n);return i.ok?bh(i[r])?i[r]():i.text():V(i.status+``+i.statusText)}function mce(e,t){if(!e||!e.length)return`unknown`;let n=e.length,r=yb.length,i=yb.map((e,t)=>t+1);for(let a=0,o=0,s,c;ae===0?t:e,0)-1]}function hce(e,t){return t.reduce((t,n)=>(t[n]=mce(e,n),t),{})}function gce(e){let t=function(t,n){let r={delimiter:e};return mb(t,n?Ah(n,r):r)};return t.responseType=`text`,t}function mb(e,t){return t.header&&(e=t.header.map(W).join(t.delimiter)+` +`+e),wae(t.delimiter).parse(e+``)}function _ce(e){return typeof Buffer==`function`&&bh(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function hb(e,t){let n=t&&t.property?jm(t.property):Pm;return Hm(e)&&!_ce(e)?vce(n(e),t):n(JSON.parse(e))}function vce(e,t){return!H(e)&&Uh(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}function yce(e,t){let n,r,i,a;return e=hb(e,t),t&&t.feature?(n=jae,i=t.feature):t&&t.mesh?(n=Nae,i=t.mesh,a=Mce[t.filter]):V(`Missing TopoJSON feature or mesh parameter.`),r=(r=e.objects[i])?n(e,r,a):V(`Invalid TopoJSON object: `+i),r&&r.features||[r]}function gb(e,t){return arguments.length>1?(bb[e]=t,this):Ph(bb,e)?bb[e]:null}function bce(e){let t=gb(e);return t&&t.responseType||`text`}function xce(e,t,n,r){t||={};let i=gb(t.type||`json`);return i||V(`Unknown data format type: `+t.type),e=i(e,t),t.parse&&Sce(e,t.parse,n,r),Ph(e,`columns`)&&delete e.columns,e}function Sce(e,t,n,r){if(!e.length)return;let i=cb();n||=i.timeParse,r||=i.utcParse;let a=e.columns||Object.keys(e[0]),o,s,c,l,u,d;t===`auto`&&(t=hce(e,a)),a=Object.keys(t);let f=a.map(e=>{let i=t[e],a,o;if(i&&(i.startsWith(`date:`)||i.startsWith(`utc:`)))return a=i.split(/:(.+)?/,2),o=a[1],(o[0]===`'`&&o[o.length-1]===`'`||o[0]===`"`&&o[o.length-1]===`"`)&&(o=o.slice(1,-1)),(a[0]===`utc`?r:n)(o);if(!vb[i])throw Error(`Illegal format pattern: `+e+`:`+i);return vb[i]});for(c=0,u=e.length,d=a.length;c{dg(),Eae(),Lae(),pb(),Cce=/^(data:|([A-Za-z]+:)?\/\/)/,wce=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Tce=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Ece=`file://`,Dce=e=>e!=null&&e===e,Oce=e=>e===`true`||e===`false`||e===!0||e===!1,kce=e=>!Number.isNaN(Date.parse(e)),_b=e=>!Number.isNaN(+e)&&!(e instanceof Date),Ace=e=>_b(e)&&Number.isInteger(+e),vb={boolean:ig,integer:Ym,number:Ym,date:ag,string:sg,unknown:Pm},yb=[Oce,Ace,_b,kce],jce=[`boolean`,`integer`,`number`,`date`],mb.responseType=`text`,hb.responseType=`json`,Mce={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t},yce.responseType=`json`,bb={dsv:mb,csv:gce(`,`),tsv:gce(` `),json:hb,topojson:yce},xb=cce(null)}));function Cb(e){let t=e||Pm,n=[],r={};return n.add=e=>{let i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{let i=t(e);if(r[i]){r[i]=0;let t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function wb(e,t){try{await t(e)}catch(t){e.error(t)}}function Tb(e){return!!(e&&Eb(e))}function Eb(e){return e[Hb]}function Nce(e,t){return e[Hb]=t,e}function Db(e){let t=e===Object(e)?e:{data:e};return Eb(t)?t:Nce(t,mle++)}function Ob(e){return kb(e,Db({}))}function kb(e,t){for(let n in e)t[n]=e[n];return t}function Pce(e,t){return Nce(t,Eb(e))}function Ab(e,t){return e?t?(n,r)=>e(n,r)||Eb(t(n))-Eb(t(r)):(t,n)=>e(t,n)||Eb(t)-Eb(n):null}function Fce(e){return e&&e.constructor===jb}function jb(){let e=[],t=[],n=[],r=[],i=[],a=null,o=!1;return{constructor:jb,insert(t){let n=_h(t),r=n.length;for(let t=0;t{m(e)&&(l[Eb(e)]=-1)});for(d=0,f=e.length;d0&&(_(h,m,p.value),s.modifies(m));for(d=0,f=i.length;d{m(e)&&l[Eb(e)]>0&&_(e,p.field,p.value)}),s.modifies(p.field);if(o)s.mod=t.length||r.length?c.filter(e=>l[Eb(e)]>0):c.slice();else for(g in u)s.mod.push(u[g]);return(a||a==null&&(t.length||r.length))&&s.clean(!0),s}}}function Mb(){Object.defineProperty(this,Ub,{writable:!0,value:{}})}function Nb(e,t,n,r){this.id=++hle,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,r)}function Ice(e){return function(t){let n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}function Lce(e,t,n,r){let i=1,a;return e instanceof Nb?a=e:e&&e.prototype instanceof Nb?a=new e:bh(e)?a=new Nb(null,e):(i=0,a=new Nb(e,t)),this.rank(a),i&&(r=n,n=t),n&&this.connect(a,a.parameters(n,r)),this.touch(a),a}function Rce(e,t){let n=e.rank,r=t.length;for(let i=0;it=e);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}function Gce(e,t,n,r,i){return(e instanceof Nb?qce:Kce)(this,e,t,n,r,i),this}function Kce(e,t,n,r,i,a){let o=Ah({},a,xle),s,c;bh(n)||(n=Oh(n)),r===void 0?s=t=>e.touch(n(t)):bh(r)?(c=new Nb(null,r,i,!1),s=t=>{c.evaluate(t);let r=n(t),i=c.value;Fce(i)?e.pulse(r,i,a):e.update(r,i,o)}):s=t=>e.update(n(t),r,o),t.apply(s)}function qce(e,t,n,r,i,a){if(r===void 0)t.targets().add(n);else{let o=a||{},s=new Nb(null,Jce(n,r),i,!1);s.modified(o.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}function Jce(e,t){return t=bh(t)?t:Oh(t),e?function(n,r){let i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function Yce(e){e.rank=++this._rank}function Xce(e){let t=[e],n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&V(`Cycle detected in dataflow graph.`)}function Ib(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Lb(e,t){let n=[];return ug(e,t,e=>n.push(e)),n}function Zce(e,t){let n={};return e.visit(t,e=>{n[Eb(e)]=1}),e=>n[Eb(e)]?null:e}function Rb(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function zb(e,t,n,r){let i=this,a=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(let e of n)if(e.stamp===t){if(e.fields){let t=i.fields||={};for(let n in e.fields)t[n]=1}e.changed(i.ADD)&&(a|=i.ADD),e.changed(i.REM)&&(a|=i.REM),e.changed(i.MOD)&&(a|=i.MOD)}this.changes=a}async function Qce(e,t,n){let r=this,i=[];if(r._pulse)return nle(r);if(r._pending&&await r._pending,t&&await wb(r,t),!r._touched.length)return r.debug(`Dataflow invoked, but nothing to do.`),r;let a=++r._clock;r._pulse=new Ib(r,a,e),r._touched.forEach(e=>r._enqueue(e,!0)),r._touched=Cb(Nm);let o=0,s,c,l;try{for(;r._heap.size()>0;){if(s=r._heap.pop(),s.rank!==s.qrank){r._enqueue(s,!0);continue}c=s.run(r._getPulse(s,e)),c.then?c=await c:c.async&&(i.push(c.async),c=Wb),c!==Wb&&s._targets&&s._targets.forEach(e=>r._enqueue(e)),++o}}catch(e){r._heap.clear(),l=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${a}: ${o} operators`),l&&(r._postrun=[],r.error(l)),r._postrun.length){let e=r._postrun.sort((e,t)=>t.priority-e.priority);r._postrun=[];for(let t=0;tr.runAsync(null,()=>{e.forEach(e=>{try{e(r)}catch(e){r.error(e)}})})),r}async function $ce(e,t,n){for(;this._running;)await this._running;let r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function ele(e,t,n){return this._pulse?nle(this):(this.evaluate(e,t,n),this)}function tle(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}}function nle(e){return e.error(`Dataflow already running. Use runAsync() to chain invocations.`),e}function rle(e,t){let n=e.stampe.pulse),t):this._input[e.id]||ale(this._pulse,n&&n.pulse)}function ale(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Wb&&(e.source=t.source),e)}function ole(e,t){let n=t||ex;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function sle(e,t,n){let r=n||ex;return(e.set(t)||r.force)&&this.touch(e,r),this}function cle(e,t,n){this.touch(e,n||ex);let r=new Ib(this,this._clock+ +!this._pulse),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function lle(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),ule(t,0,t.length-1,e)),pop:()=>{let n=t.pop(),r;return t.length?(r=t[0],t[0]=n,dle(t,0,e)):r=n,r}}}function ule(e,t,n,r){let i,a,o=e[n];for(;n>t;){if(a=n-1>>1,i=e[a],r(o,i)<0){e[n]=i,n=a;continue}break}return e[n]=o}function dle(e,t,n){let r=t,i=e.length,a=e[t],o=(t<<1)+1,s;for(;o=0&&(o=s),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=a,ule(e,r,t,n)}function Bb(){this.logger(Bm()),this.logLevel(1),this._clock=0,this._rank=0,this._locale=lb();try{this._loader=xb()}catch{}this._touched=Cb(Nm),this._input={},this._pulse=null,this._heap=lle((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Vb(e){return function(){return this._log[e].apply(this,arguments)}}function G(e,t){Nb.call(this,e,null,t)}function fle(e){let t=ple(e);return t&&t.Definition||null}function ple(e){return e&&=e.toLowerCase(),Ph(tx,e)?tx[e]:null}var Hb,mle,Ub,hle,gle,_le,vle,yle,ble,xle,Wb,Gb,Kb,qb,Sle,Jb,Yb,Xb,Zb,Qb,$b,ex,tx,nx=o((()=>{dg(),Sb(),pb(),Hb=Symbol(`vega_id`),mle=1,Ub=`_:mod:_`,Mb.prototype={set(e,t,n,r){let i=this,a=i[e],o=i[Ub];return t!=null&&t>=0?(a[t]!==n||r)&&(a[t]=n,o[t+`:`+e]=-1,o[e]=-1):(a!==n||r)&&(i[e]=n,o[e]=H(n)?1+n.length:-1),i},modified(e,t){let n=this[Ub];if(!arguments.length){for(let e in n)if(n[e])return!0;return!1}else if(H(e)){for(let t=0;t=0?t+1{o instanceof Nb?(o!==this&&(t&&o.targets().add(this),a.push(o)),i.push({op:o,name:e,index:n})):r.set(e,n,o)};for(o in e)if(s=e[o],o===gle)_h(s).forEach(e=>{e instanceof Nb?e!==this&&(e.targets().add(this),a.push(e)):V(`Pulse parameters must be operator instances.`)}),this.source=s;else if(H(s))for(r.set(o,-1,Array(c=s.length)),l=0;l{let n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){let t=Fb();return this.targets().add(Fb(null,null,kh(e,e=>{let n=e.dataflow;t.receive(e),n&&n.run&&n.run()}))),t},between(e,t){let n=!1;return e.targets().add(Fb(null,null,()=>n=!0)),t.targets().add(Fb(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Lm,this._targets=null}},xle={skip:!0},Wb={},Gb=1,Kb=2,qb=4,Sle=3,Jb=5,Yb=7,Xb=8,Zb=16,Qb=32,$b=64,Ib.prototype={StopPropagation:Wb,ADD:Gb,REM:Kb,MOD:qb,ADD_REM:Sle,ADD_MOD:Jb,ALL:Yb,REFLOW:Xb,SOURCE:Zb,NO_SOURCE:Qb,NO_FIELDS:$b,fork(e){return new Ib(this.dataflow).init(this,e)},clone(){let e=this.fork(Yb);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&=e.source.slice(),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length?e:(e=new Ib(this.dataflow).init(this),e.add=e.source,e.rem=[],e)},init(e,t){let n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&$b)&&(n.fields=e.fields),t&Gb?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Kb?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&qb?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&Qb?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){let t=e||Yb;return t&Gb&&this.add.length||t&Kb&&this.rem.length||t&qb&&this.mod.length},reflow(e){if(e)return this.fork(Yb).reflow();let t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(qb,Zce(this,Gb))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){let t=this.fields||={};return H(e)?e.forEach(e=>t[e]=!0):t[e]=!0,this},modified(e,t){let n=this.fields;return(t||this.mod.length)&&n?arguments.length?H(e)?e.some(e=>n[e]):n[e]:!!n:!1},filter(e,t){let n=this;return e&Gb&&(n.addF=Rb(n.addF,t)),e&Kb&&(n.remF=Rb(n.remF,t)),e&qb&&(n.modF=Rb(n.modF,t)),e&Zb&&(n.srcF=Rb(n.srcF,t)),n},materialize(e){e||=Yb;let t=this;return e&Gb&&t.addF&&(t.add=Lb(t.add,t.addF),t.addF=null),e&Kb&&t.remF&&(t.rem=Lb(t.rem,t.remF),t.remF=null),e&qb&&t.modF&&(t.mod=Lb(t.mod,t.modF),t.modF=null),e&Zb&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){let n=this,r=t;if(e&Zb)return ug(n.source,n.srcF,r),n;e&Gb&&ug(n.add,n.addF,r),e&Kb&&ug(n.rem,n.remF,r),e&qb&&ug(n.mod,n.modF,r);let i=n.source;if(e&Xb&&i){let e=n.add.length+n.mod.length;e===i.length||(e?ug(i,Zce(n,Jb),r):ug(i,n.srcF,r))}return n}},U(zb,Ib,{fork(e){let t=new Ib(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,e=>t.add.push(e)),e&t.REM&&this.visit(t.REM,e=>t.rem.push(e)),e&t.MOD&&this.visit(t.MOD,e=>t.mod.push(e))),t},changed(e){return this.changes&e},modified(e){let t=this,n=t.fields;return n&&t.changes&t.MOD?H(e)?e.some(e=>n[e]):n[e]:0},filter(){V(`MultiPulse does not support filtering.`)},materialize(){V(`MultiPulse does not support materialization.`)},visit(e,t){let n=this,r=n.pulses,i=r.length,a=0;if(e&n.SOURCE)for(;athis.pulse=e):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){let t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}}),tx={}}));function*Cle(e,t){if(t==null)for(let t of e)t!=null&&t!==``&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==``&&(r=+r)>=r&&(yield r)}}function rx(e,t,n){let r=Float64Array.from(Cle(e,n));return r.sort(Eg),t.map(e=>c_(r,e))}function ix(e,t){return rx(e,[.25,.5,.75],t)}function ax(e,t){let n=e.length,r=Uae(e,t),i=ix(e,t),a=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,a)||r||Math.abs(i[0])||1)*n**-.2}function wle(e){let t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2],a=e.extent[0],o=e.extent[1],s,c,l,u,d,f,p=e.span||o-a||Math.abs(a)||1;if(e.step)s=e.step;else if(e.steps){for(u=p/t,d=0,f=e.steps.length;dt;)s*=n;for(d=0,f=i.length;d=l&&p/u<=t&&(s=u)}u=Math.log(s);let m=n**(-(u>=0?0:~~(-u/r)+1)-1);return(e.nice||e.nice===void 0)&&(u=Math.floor(a/s+m)*s,a=ae);let i=e.length,a=new Float64Array(i),o=0,s=1,c=r(e[0]),l=c,u=c+t,d;for(;s=u){for(l=(c+l)/2;o>1);oi;)e[o--]=e[r]}r=i,i=a}return e}function kle(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function Ale(e,t){t??(t=e,e=0);let n,r,i,a={min(e){return arguments.length?(n=e||0,i=r-n,a):n},max(e){return arguments.length?(r=e||0,i=r-n,a):r},sample(){return n+Math.floor(i*Ox())},pdf(e){return e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf(e){return e>=0&&e<=1?n-1+Math.floor(e*i):NaN}};return a.min(e).max(t)}function ox(e,t){e||=0,t??=1;let n=0,r=0,i,a;if(Ax===Ax)n=Ax,Ax=NaN;else{do n=Ox()*2-1,r=Ox()*2-1,i=n*n+r*r;while(i===0||i>1);a=Math.sqrt(-2*Math.log(i)/i),n*=a,Ax=r*a}return e+n*t}function sx(e,t,n){n??=1;let r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*kx)}function cx(e,t,n){t||=0,n??=1;let r=(e-t)/n,i=Math.abs(r),a;if(i>37)a=0;else{let e=Math.exp(-i*i/2),t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,a=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,a/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,a=e/t/2.506628274631)}return r>0?1-a:a}function lx(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*qle*jle(2*e-1)}function jle(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=1.0512122733215323e-9+n*t,n=-4.112633980346984e-9+n*t,n=-2.9070369957882005e-8+n*t,n=4.2347877827932404e-7+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=2.2137376921775787e-9,n=9.075656193888539e-8+n*t,n=-2.7517406297064545e-7+n*t,n=1.8239629214389228e-8+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=1.5076572693500548e-9+n*t,n=-3.789465440126737e-9+n*t,n=7.61570120807834e-9+n*t,n=-1.496002662714924e-8+n*t,n=2.914795345090108e-8+n*t,n=-6.771199775845234e-8+n*t,n=2.2900482228026655e-7+n*t,n=-9.9298272942317e-7+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function ux(e,t){let n,r,i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=e??1,i):r},sample:()=>ox(n,r),pdf:e=>sx(e,n,r),cdf:e=>cx(e,n,r),icdf:e=>lx(e,n,r)};return i.mean(e).stdev(t)}function dx(e,t){let n=ux(),r=0,i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(t=n,!t&&e&&(t=ax(e)),i):t},sample(){return e[~~(Ox()*r)]+t*n.sample()},pdf(i){let a=0,o=0;for(;ofx(n,r),pdf:e=>px(e,n,r),cdf:e=>mx(e,n,r),icdf:e=>hx(e,n,r)};return i.mean(e).stdev(t)}function Nle(e,t){let n=0,r;function i(e){let t=[],r=0,i;for(i=0;i=t&&e<=n?1/(n-t):0}function vx(e,t,n){return n??(n=t??1,t=0),en?1:(e-t)/(n-t)}function yx(e,t,n){return n??(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Ple(e,t){let n,r,i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=e??1,i):r},sample:()=>gx(n,r),pdf:e=>_x(e,n,r),cdf:e=>vx(e,n,r),icdf:e=>yx(e,n,r)};return t??(t=e??1,e=0),i.min(e).max(t)}function bx(e,t,n){let r=0,i=0;for(let a of e){let e=n(a);t(a)==null||e==null||isNaN(e)||(r+=(e-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function xx(e,t,n,r){let i=r-e*e,a=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-a*e,a]}function Sx(e,t,n,r){e=e.filter(e=>{let r=t(e),i=n(e);return r!=null&&(r=+r)>=r&&i!=null&&(i=+i)>=i}),r&&e.sort((e,n)=>t(e)-t(n));let i=e.length,a=new Float64Array(i),o=new Float64Array(i),s=0,c=0,l=0,u,d,f;for(f of e)a[s]=u=+t(f),o[s]=d=+n(f),++s,c+=(u-c)/s,l+=(d-l)/s;for(s=0;s=a&&o!=null&&(o=+o)>=o&&r(a,o,++i)}function wx(e,t,n,r,i){let a=0,o=0;return Cx(e,t,n,(e,t)=>{let n=t-i(e),s=t-r;a+=n*n,o+=s*s}),1-a/o}function Tx(e,t,n){let r=0,i=0,a=0,o=0,s=0;Cx(e,t,n,(e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,a+=(e*t-a)/s,o+=(e*e-o)/s});let c=xx(r,i,a,o),l=e=>c[0]+c[1]*e;return{coef:c,predict:l,rSquared:wx(e,t,n,i,l)}}function Fle(e,t,n){let r=0,i=0,a=0,o=0,s=0;Cx(e,t,n,(e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,a+=(e*t-a)/s,o+=(e*e-o)/s});let c=xx(r,i,a,o),l=e=>c[0]+c[1]*Math.log(e);return{coef:c,predict:l,rSquared:wx(e,t,n,i,l)}}function Ile(e,t,n){let[r,i,a,o]=Sx(e,t,n),s=0,c=0,l=0,u=0,d=0,f,p,m;Cx(e,t,n,(e,t)=>{f=r[d++],p=Math.log(t),m=f*t,s+=(t*p-s)/d,c+=(m-c)/d,l+=(m*p-l)/d,u+=(f*m-u)/d});let[h,g]=xx(c/o,s/o,l/o,u/o),_=e=>Math.exp(h+g*(e-a));return{coef:[Math.exp(h-g*a),g],predict:_,rSquared:wx(e,t,n,o,_)}}function Lle(e,t,n){let r=0,i=0,a=0,o=0,s=0,c=0;Cx(e,t,n,(e,t)=>{let n=Math.log(e),l=Math.log(t);++c,r+=(n-r)/c,i+=(l-i)/c,a+=(n*l-a)/c,o+=(n*n-o)/c,s+=(t-s)/c});let l=xx(r,i,a,o),u=e=>l[0]*e**+l[1];return l[0]=Math.exp(l[0]),{coef:l,predict:u,rSquared:wx(e,t,n,s,u)}}function Ex(e,t,n){let[r,i,a,o]=Sx(e,t,n),s=r.length,c=0,l=0,u=0,d=0,f=0,p,m,h,g;for(p=0;p(e-=a,y*e*e+b*e+x+o);return{coef:[x-b*a+y*a*a+o,b-2*y*a,y],predict:S,rSquared:wx(e,t,n,o,S)}}function Rle(e,t,n,r){if(r===0)return bx(e,t,n);if(r===1)return Tx(e,t,n);if(r===2)return Ex(e,t,n);let[i,a,o,s]=Sx(e,t,n),c=i.length,l=[],u=[],d=r+1,f,p,m,h,g;for(f=0;f{e-=o;let t=s+_[0]+_[1]*e+_[2]*e*e;for(f=3;f=0;--a)for(s=t[a],c=1,i[a]+=s,o=1;o<=a;++o)c*=(a+1-o)/o,i[a-o]+=s*n**+o*c;return i[0]+=r,i}function Ble(e){let t=e.length-1,n=[],r,i,a,o,s;for(r=0;rMath.abs(e[r][o])&&(o=i);for(a=r;a=r;a--)e[a][i]-=e[a][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,a=i+1;ai[o]-n?r:o,c=0,l=0,p=0,m=0,h=0,g=1/Math.abs(i[s]-n||1);for(let e=r;e<=o;++e){let t=i[e],r=a[e],o=Hle(Math.abs(n-t)*g)*f[e],s=t*o;c+=o,l+=s,p+=r*o,m+=r*s,h+=t*s}let[_,v]=xx(l/c,p/c,m/c,h/c);u[e]=_+v*n,d[e]=Math.abs(a[e]-u[e]),Ule(i,e+1,t)}if(e===jx)break;let n=u_(d);if(Math.abs(n)=1?Mx:(r=1-t*t)*r}return Wle(i,u,o,s)}function Hle(e){return(e=1-e*e*e)*e*e}function Ule(e,t,n){let r=e[t],i=n[0],a=n[1]+1;if(!(a>=e.length))for(;t>i&&e[a]-r<=r-e[i];)n[0]=++i,n[1]=a,++a}function Wle(e,t,n,r){let i=e.length,a=[],o=0,s=0,c=[],l;for(;o[t,e(t)],a=t[0],o=t[1],s=o-a,c=s/r,l=[i(a)],u=[];if(n===r){for(let e=1;e0;)u.push(i(a+e/n*s))}let d=l[0],f=u[u.length-1],p=1/s,m=Gle(d[1],u);for(;f;){let e=i((d[0]+f[0])/2);e[0]-d[0]>=c&&Kle(d,e,f,p,m)>Jle?u.push(e):(d=f,l.push(f),u.pop()),f=u[u.length-1]}return l}function Gle(e,t){let n=e,r=e,i=t.length;for(let e=0;er&&(r=i)}return 1/(r-n)}function Kle(e,t,n,r,i){let a=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),o=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(a-o)}var Ox,kx,qle,Ax,jx,Mx,Jle,Nx=o((()=>{m_(),Ox=Math.random,kx=Math.sqrt(2*Math.PI),qle=Math.SQRT2,Ax=NaN,jx=2,Mx=1e-12,Jle=.5*Math.PI/180})),Yle=c({aggregate:()=>Ix,bin:()=>Lx,collect:()=>Rx,compare:()=>cue,countpattern:()=>zx,cross:()=>Bx,density:()=>Vx,dotbin:()=>Wx,expression:()=>mue,extent:()=>Gx,facet:()=>qx,field:()=>gue,filter:()=>Jx,flatten:()=>Yx,fold:()=>Xx,formula:()=>Zx,generate:()=>Qx,impute:()=>$x,joinaggregate:()=>eS,kde:()=>tS,key:()=>nS,load:()=>rS,lookup:()=>aS,multiextent:()=>oS,multivalues:()=>sS,params:()=>cS,pivot:()=>lS,prefacet:()=>uS,project:()=>dS,proxy:()=>kue,quantile:()=>fS,relay:()=>Aue,sample:()=>pS,sequence:()=>mS,sieve:()=>jue,subflow:()=>Kx,timeunit:()=>hS,tupleindex:()=>gS,values:()=>_S,window:()=>yS});function Xle(e){return t=>{let n=e.length,r=1,i=String(e[0](t));for(;rAh({name:e,aggregate_param:r,out:n||e},SS,t)}function $le(e,t,n){return CS[e](n,t)}function eue(e,t){return e.idx-t.idx}function tue(e){let t={};e.forEach(e=>t[e.name]=e);let n=e=>{e.req&&e.req.forEach(e=>{t[e]||n(t[e]=CS[e]())})};return e.forEach(n),Object.values(t).sort(eue)}function nue(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function rue(e,t){if(e==null||e===``){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function iue(e,t){if(e==null||e===``){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function aue(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function oue(e,t){let n=t||Pm,r=tue(e),i=e.slice().sort(eue);function a(e){this._ops=r,this._out=i,this.cell=e,this.init()}return a.prototype.init=nue,a.prototype.add=rue,a.prototype.rem=iue,a.prototype.set=aue,a.prototype.get=n,a.fields=e.map(e=>e.out),a}function Fx(e){this._key=e?jm(e):Eb,this.reset()}function Ix(e){G.call(this,null,e),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}function Lx(e){G.call(this,null,e)}function sue(e,t,n){let r=e,i=t||[],a=n||[],o={},s=0;return{add:e=>a.push(e),remove:e=>o[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&=(i=i.filter(e=>!o[r(e)]),o={},0),t&&e&&i.sort(e),a.length&&(i=e?$h(e,i,a.sort(e)):i.concat(a),a=[]),i)}}function Rx(e){G.call(this,[],e)}function cue(e){Nb.call(this,null,lue,e)}function lue(e){return this.value&&!e.modified()?this.value:Sh(e.fields,e.orders)}function zx(e){G.call(this,null,e)}function uue(e,t,n){switch(t){case`upper`:e=e.toUpperCase();break;case`lower`:e=e.toLowerCase();break}return e.match(n)}function Bx(e){G.call(this,null,e)}function due(e,t,n,r){for(var i=[],a={},o=e.length,s=0,c,l;sfue(e,t))):typeof r[n]===kS&&r[n](e[n]);return r}function Vx(e){G.call(this,null,e)}function pue(e){return()=>e.materialize(e.SOURCE).source}function Hx(e,t){return e?e.map((e,n)=>t[n]||xm(e)):null}function Ux(e,t,n){let r=[],i=e=>e(c),a,o,s,c,l,u;if(t==null)r.push(e.map(n));else for(a={},o=0,s=e.length;ot(n,e),Sm(t),xm(t))}function Gx(e){G.call(this,[void 0,void 0],e)}function Kx(e,t){Nb.call(this,e),this.parent=t,this.count=0}function qx(e){G.call(this,{},e),this._keys=Ih();let t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;njm(e)):jm(e.name,e.as)}function Jx(e){G.call(this,Ih(),e)}function Yx(e){G.call(this,[],e)}function Xx(e){G.call(this,[],e)}function Zx(e){G.call(this,null,e)}function Qx(e){G.call(this,[],e)}function $x(e){G.call(this,[],e)}function vue(e){var t=e.method||FS.value,n;if(FS[t]==null)V(`Unrecognized imputation method: `+t);else if(t===FS.value)return n=e.value===void 0?0:e.value,()=>n;else return FS[t]}function yue(e){let t=e.field;return e=>e?t(e):NaN}function bue(e,t,n,r){var i=e=>e(g),a=[],o=r?r.slice():[],s={},c={},l,u,d,f,p,m,h,g;for(o.forEach((e,t)=>s[e]=t+1),f=0,h=e.length;fi&&(i=o[1]);return[r,i]}function sS(e){Nb.call(this,null,wue,e)}function wue(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function cS(e){G.call(this,null,e)}function lS(e){Ix.call(this,e)}function Tue(e,t){let n=e.field,r=e.value,i=(e.op===`count`?`__count__`:e.op)||`sum`,a=Sm(n).concat(Sm(r)),o=Due(n,e.limit||0,t);return t.changed()&&e.set(`__pivot__`,null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>i),fields:o.map(e=>Eue(e,n,r,a)),as:o.map(e=>e+``),modified:e.modified.bind(e)}}function Eue(e,t,n,r){return bm(r=>t(r)===e?n(r):NaN,r,e+``)}function Due(e,t,n){let r={},i=[];return n.visit(n.SOURCE,t=>{let n=e(t);r[n]||(r[n]=1,i.push(n))}),i.sort(wh),t?i.slice(0,t):i}function uS(e){qx.call(this,e)}function dS(e){G.call(this,null,e)}function Oue(e,t,n,r){for(let i=0,a=n.length;ic[e]=1)}p(e.sort),t.forEach((e,t)=>{let c=n[t],m=r[t],h=i[t]||null,g=xm(c),_=Zle(e,g,a[t]);if(p(c),o.push(_),Ph(zS,e))s.push(Mue(e,c,m,_));else{if(c==null&&e!==`count`&&V(`Null aggregate field specified.`),e===`count`){u.push(_);return}f=!1;let t=l[g];t||(t=l[g]=[],t.field=c,d.push(t)),t.push($le(e,h,_))}}),(u.length||d.length)&&(this.cell=Pue(d,u,f)),this.inputs=Object.keys(c)}function Pue(e,t,n){e=e.map(e=>oue(e,e.field));let r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,a=r.agg=Array(i),o=0;on?n:e}function Iue(e,t,n,r){e.p0=e.i0,e.p1=e.i1;let i=t[0]==null?0:n+t[0],a=t[1]==null?r:n+t[1]+1;e.i0=bS(i,0,r),e.i1=bS(a,0,r),e.index=n}function Lue(e,t){let n=e.i0,r=e.i1-1,i=e.compare,a=e.data,o=a.length-1;n>0&&!i(a[n],a[n-1])&&(e.i0=t.left(a,a[n])),r{dg(),nx(),Nx(),m_(),qy(),xS=()=>{},SS={init:xS,add:xS,rem:xS,idx:0},CS={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:[`mean`],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?Math.max(0,e.dev)/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:[`mean`],idx:1},variancep:{value:e=>e.valid?Math.max(0,e.dev)/e.valid:void 0,req:[`variance`],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(Math.max(0,e.dev)/(e.valid-1)):void 0,req:[`variance`],idx:2},stdevp:{value:e=>e.valid?Math.sqrt(Math.max(0,e.dev)/e.valid):void 0,req:[`variance`],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(Math.max(0,e.dev)/(e.valid*(e.valid-1))):void 0,req:[`variance`],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:[`values`],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:[`values`],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:[`values`],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:[`values`],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:[`values`],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:[`values`],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:[`values`],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:[`values`],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:[`min`,`values`],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:[`max`,`values`],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:[`exponential`],idx:1}},wS=Object.keys(CS).filter(e=>e!==`__count__`),[...wS,`__count__`].forEach(e=>{CS[e]=Qle(e,CS[e])}),TS=Fx.prototype,TS.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},TS.add=function(e){this._add.push(e)},TS.rem=function(e){this._rem.push(e)},TS.values=function(){if(this._get=null,this._rem.length===0)return this._add;let e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,a=Array(r-i),o={},s,c,l;for(s=0;s=0;)a=e(t[r])+``,Ph(n,a)||(n[a]=1,++i);return i},TS.extent=function(e){if(this._get!==e||!this._ext){let t=this.values(),n=Nh(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},TS.argmin=function(e){return this.extent(e)[0]||{}},TS.argmax=function(e){return this.extent(e)[1]||{}},TS.min=function(e){let t=this.extent(e)[0];return t==null?void 0:e(t)},TS.max=function(e){let t=this.extent(e)[1];return t==null?void 0:e(t)},TS.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=ix(this.values(),e),this._get=e),this._q},TS.q1=function(e){return this.quartile(e)[0]},TS.q2=function(e){return this.quartile(e)[1]},TS.q3=function(e){return this.quartile(e)[2]},TS.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=Ele(this.values(),1e3,.05,e),this._get=e),this._ci},TS.ci0=function(e){return this.ci(e)[0]},TS.ci1=function(e){return this.ci(e)[1]},Ix.Definition={type:`Aggregate`,metadata:{generates:!0,changes:!0},params:[{name:`groupby`,type:`field`,array:!0},{name:`ops`,type:`enum`,array:!0,values:wS},{name:`aggregate_params`,type:`number`,null:!0,array:!0},{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`}]},U(Ix,G,{transform(e,t){let n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,e=>n.add(e))):(n.value=n.value||n.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){let e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function a(e){let t,a,o,s;for(t in e)for(o=e[t].tuple,a=0;a{let t=xm(e);return i(e),n.push(t),t}),this.cellkey=e.key?e.key:Px(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];let a=e.fields||[null],o=e.ops||[`count`],s=e.aggregate_params||[null],c=e.as||[],l=a.length,u={},d,f,p,m,h,g,_;for(l!==o.length&&V(`Unmatched number of fields and aggregate ops.`),_=0;_oue(e,e.field)),Object.create(null)},cellkey:Px(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{let t=r(e);e[s]=t,e[c]=t==null?null:i+a*(1+(t-i)/a)}:e=>e[s]=r(e)),t.modifies(n?o:s)},_bins(e){if(this.value&&!e.modified())return this.value;let t=e.field,n=wle(e),r=n.step,i=n.start,a=i+Math.ceil((n.stop-i)/r)*r,o,s;(o=e.anchor)!=null&&(s=o-(i+r*Math.floor((o-i)/r)),i+=s,a+=s);let c=function(e){let n=Ym(t(e));return n==null?null:na?1/0:(n=Math.max(i,Math.min(n,a-r)),i+r*Math.floor(ES+(n-i)/r))};return c.start=i,c.stop=a,c.step=r,this.value=bm(c,Sm(t),e.name||`bin_`+xm(t))}}),Rx.Definition={type:`Collect`,metadata:{source:!0},params:[{name:`sort`,type:`compare`}]},U(Rx,G,{transform(e,t){let n=t.fork(t.ALL),r=sue(Eb,this.value,n.materialize(n.ADD).add),i=e.sort,a=t.changed()||i&&(e.modified(`sort`)||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(a),this.value=n.source=r.data(Ab(i),a),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),U(cue,Nb),zx.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`]}]},U(zx,G,{transform(e,t){let n=t=>n=>{for(var r=uue(s(n),e.case,a)||[],i,c=0,l=r.length;ci[e]=1+(i[e]||0)),u=n(e=>--i[e]);return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,u)),this._finish(t,c)},_parameterCheck(e,t){let n=!1;return(e.modified(`stopwords`)||!this._stop)&&(this._stop=RegExp(`^`+(e.stopwords||``)+`$`,`i`),n=!0),(e.modified(`pattern`)||!this._match)&&(this._match=new RegExp(e.pattern||`[\\w']+`,`g`),n=!0),(e.modified(`field`)||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){let n=this._counts,r=this._tuples||={},i=t[0],a=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS),s,c,l;for(s in n)c=r[s],l=n[s]||0,!c&&l?(r[s]=c=Db({}),c[i]=s,c[a]=l,o.add.push(c)):l===0?(c&&o.rem.push(c),n[s]=null,r[s]=null):c[a]!==l&&(c[a]=l,o.mod.push(c));return o.modifies(t)}}),Bx.Definition={type:`Cross`,metadata:{generates:!0},params:[{name:`filter`,type:`expr`},{name:`as`,type:`string`,array:!0,length:2,default:[`a`,`b`]}]},U(Bx,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.as||[`a`,`b`],i=r[0],a=r[1],o=!this.value||t.changed(t.ADD_REM)||e.modified(`as`)||e.modified(`filter`),s=this.value;return o?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=due(s,i,a,e.filter||Lm)):n.mod=s,n.source=this.value,n.modifies(r)}}),DS={kde:dx,mixture:Nle,normal:ux,lognormal:Mle,uniform:Ple},OS=`distributions`,kS=`function`,AS=`field`,jS=[{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}]}],MS={key:{function:`mixture`},params:[{name:`distributions`,type:`param`,array:!0,params:jS},{name:`weights`,type:`number`,array:!0}]},Vx.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:jS.concat(MS)},{name:`as`,type:`string`,array:!0,default:[`value`,`density`]}]},U(Vx,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=fue(e.distribution,pue(t)),i=e.steps||e.minsteps||25,a=e.steps||e.maxsteps||200,o=e.method||`pdf`;o!==`pdf`&&o!==`cdf`&&V(`Invalid density method: `+o),!e.extent&&!r.data&&V(`Missing density extent parameter.`),o=r[o];let s=e.as||[`value`,`density`],c=e.extent||Mh(r.data()),l=Dx(o,c,i,a).map(e=>{let t={};return t[s[0]]=e[0],t[s[1]]=e[1],Db(t)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}}),NS=`bin`,Wx.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:NS}]},PS=(e,t)=>rg(Mh(e,t))/30,U(Wx,G,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;let n=t.materialize(t.SOURCE).source,r=Ux(t.source,e.groupby,Pm),i=e.smooth||!1,a=e.field,o=e.step||PS(n,a),s=Ab((e,t)=>a(e)-a(t)),c=e.as||NS,l=r.length,u=1/0,d=-1/0,f=0,p;for(;fd&&(d=t),e[++p][c]=t}return this.value={start:u,stop:d,step:o},t.reflow(!0).modifies(c)}}),U(mue,Nb),Gx.Definition={type:`Extent`,metadata:{},params:[{name:`field`,type:`field`,required:!0}]},U(Gx,G,{transform(e,t){let n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified(`field`),a=n[0],o=n[1];if((i||a==null)&&(a=1/0,o=-1/0),t.visit(i?t.SOURCE:t.ADD,e=>{let t=Ym(r(e));t!=null&&(to&&(o=t))}),!Number.isFinite(a)||!Number.isFinite(o)){let e=xm(r);e&&=` for field "${e}"`,t.dataflow.warn(`Infinite extent${e}: [${a}, ${o}]`),a=o=void 0}this.value=[a,o]}}),U(Kx,Nb,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){--this.count,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),U(qx,G,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){let i=this.value,a=Ph(i,e)&&i[e],o,s;return a?a.value.stampe&&e.count>0);this.initTargets(e)}},initTargets(e){let t=this._targets,n=t.length,r=e?e.length:0,i=0;for(;ithis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,e=>{let t=Eb(e),n=a.get(t);n!==void 0&&(a.delete(t),s(n).rem(e))}),t.visit(t.ADD,e=>{let t=r(e);a.set(Eb(e),t),s(t).add(e)}),o||t.modified(r.fields)?t.visit(t.MOD,e=>{let t=Eb(e),n=a.get(t),i=r(e);n===i?s(i).mod(e):(a.set(t,i),s(n).rem(e),s(i).add(e))}):t.changed(t.MOD)&&t.visit(t.MOD,e=>{s(a.get(Eb(e))).mod(e)}),o&&t.visit(t.REFLOW,e=>{let t=Eb(e),n=a.get(t),i=r(e);n!==i&&(a.set(t,i),s(n).rem(e),s(i).add(e))}),t.clean()?n.runAfter(()=>{this.clean(),a.clean()}):a.empty>n.cleanThreshold&&n.runAfter(a.clean),t}}),U(gue,Nb),Jx.Definition={type:`Filter`,metadata:{changes:!0},params:[{name:`expr`,type:`expr`,required:!0}]},U(Jx,G,{transform(e,t){let n=t.dataflow,r=this.value,i=t.fork(),a=i.add,o=i.rem,s=i.mod,c=e.expr,l=!0;t.visit(t.REM,e=>{let t=Eb(e);r.has(t)?r.delete(t):o.push(e)}),t.visit(t.ADD,t=>{c(t,e)?a.push(t):r.set(Eb(t),1)});function u(t){let n=Eb(t),i=c(t,e),u=r.get(n);i&&u?(r.delete(n),a.push(t)):!i&&!u?(r.set(n,1),o.push(t)):l&&i&&!u&&s.push(t)}return t.visit(t.MOD,u),e.modified()&&(l=!1,t.visit(t.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Yx.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}]},U(Yx,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.fields,i=Hx(r,e.as||[]),a=e.index||null,o=i.length;return n.rem=this.value,t.visit(t.SOURCE,e=>{let t=r.map(t=>t(e)),s=t.reduce((e,t)=>Math.max(e,t.length),0),c=0,l,u;for(;c{for(let t=0,a;tt[r]=n(t,e))}}),U(Qx,G,{transform(e,t){let n=t.fork(t.ALL),r=e.generator,i=this.value,a=e.size-i.length,o,s,c;if(a>0){for(o=[];--a>=0;)o.push(c=Db(r(e))),i.push(c);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else s=i.slice(0,-a),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(s):s,i=i.slice(-a);return n.source=this.value=i,n}}),FS={value:`value`,median:u_,mean:Xae,min:n_,max:e_},IS=[],$x.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}]},U($x,G,{transform(e,t){var n=t.fork(t.ALL),r=vue(e),i=yue(e),a=xm(e.field),o=xm(e.key),s=(e.groupby||[]).map(xm),c=bue(t.source,e.groupby,e.key,e.keyvals),l=[],u=this.value,d=c.domain.length,f,p,m,h,g,_,v,y,b,x;for(g=0,y=c.length;gn.add(e))):(i=n.value=n.value||this.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),n.changes(),t.visit(t.SOURCE,e=>{Ah(e,i[n.cellkey(e)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){let e=this._adds,t=this._mods,n,r;for(n=0,r=this._alen;n{let n=dx(t,o)[s],r=e.counts?t.length:1;Dx(n,u||Mh(t),d,f).forEach(e=>{let n={};for(let e=0;e(this._pending=_h(e.data),e=>e.touch(this)))}:n.request(e.url,e.format).then(e=>iS(this,t,_h(e.data)))}}),aS.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}]},U(aS,G,{transform(e,t){let n=e.fields,r=e.index,i=e.values,a=e.default==null?null:e.default,o=e.modified(),s=n.length,c=o?t.SOURCE:t.ADD,l=t,u=e.as,d,f,p;return i?(f=i.length,s>1&&!u&&V(`Multi-field lookup requires explicit "as" parameter.`),u&&u.length!==s*f&&V(`The "as" parameter has too few output field names.`),u||=i.map(xm),d=function(e){for(var t=0,o=0,c,l;tt.modified(e.fields)),c|=p?t.MOD:0),t.visit(c,d),l.modifies(u)}}),U(oS,Nb),U(sS,Nb),U(cS,G,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),lS.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:wS,default:`sum`},{name:`limit`,type:`number`,default:0},{name:`key`,type:`field`}]},U(lS,Ix,{_transform:Ix.prototype.transform,transform(e,t){return this._transform(Tue(e,t),t)}}),U(uS,qx,{transform(e,t){let n=e.subflow,r=e.field,i=e=>this.subflow(Eb(e),n,t,e);return(e.modified(`field`)||r&&t.modified(Sm(r)))&&V(`PreFacet does not support field modification.`),this.initTargets(),r?(t.visit(t.MOD,e=>{let t=i(e);r(e).forEach(e=>t.mod(e))}),t.visit(t.ADD,e=>{let t=i(e);r(e).forEach(e=>t.add(Db(e)))}),t.visit(t.REM,e=>{let t=i(e);r(e).forEach(e=>t.rem(e))})):(t.visit(t.MOD,e=>i(e).mod(e)),t.visit(t.ADD,e=>i(e).add(e)),t.visit(t.REM,e=>i(e).rem(e))),t.clean()&&t.runAfter(()=>this.clean()),t}}),dS.Definition={type:`Project`,metadata:{generates:!0,changes:!0},params:[{name:`fields`,type:`field`,array:!0},{name:`as`,type:`string`,null:!0,array:!0}]},U(dS,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.fields,i=Hx(e.fields,e.as||[]),a=r?(e,t)=>Oue(e,t,r,i):kb,o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,e=>{let t=Eb(e);n.rem.push(o[t]),o[t]=null}),t.visit(t.ADD,e=>{let t=a(e,Db({}));o[Eb(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(a(e,o[Eb(e)]))}),n}}),U(kue,G,{transform(e,t){return this.value=e.value,e.modified(`value`)?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),fS.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`]}]},LS=1e-14,U(fS,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||[`prob`,`value`];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;let i=t.materialize(t.SOURCE).source,a=Ux(i,e.groupby,e.field),o=(e.groupby||[]).map(xm),s=[],c=e.step||.01,l=e.probs||f_(c/2,1-LS,c),u=l.length;return a.forEach(e=>{let t=rx(e,l);for(let n=0;n{let t=Eb(e);n.rem.push(r[t]),r[t]=null}),t.visit(t.ADD,e=>{let t=Ob(e);r[Eb(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{let t=r[Eb(e)];for(let r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)})),n}}),pS.Definition={type:`Sample`,metadata:{},params:[{name:`size`,type:`number`,default:1e3}]},U(pS,G,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.modified(`size`),i=e.size,a=this.value.reduce((e,t)=>(e[Eb(t)]=1,e),{}),o=this.value,s=this.count,c=0;function l(e){let t,r;o.length=c&&(t=o[r],a[Eb(t)]&&n.rem.push(t),o[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,e=>{let t=Eb(e);a[t]&&(a[t]=-1,n.rem.push(e)),--s}),o=o.filter(e=>a[Eb(e)]!==-1)),(t.rem.length||r)&&o.length{a[Eb(e)]||l(e)}),c=-1),r&&o.length>i){let e=o.length-i;for(let t=0;t{a[Eb(e)]&&n.mod.push(e)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||c<0)&&(n.add=o.filter(e=>!a[Eb(e)])),this.count=s,this.value=n.source=o,n}}),mS.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`}]},U(mS,G,{transform(e,t){if(this.value&&!e.modified())return;let n=t.materialize().fork(t.MOD),r=e.as||`data`;return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=f_(e.start,e.stop,e.step||1).map(e=>{let t={};return t[r]=e,Db(t)}),n.add=t.add.concat(this.value),n}}),U(jue,G,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),RS=[`unit0`,`unit1`],hS.Definition={type:`TimeUnit`,metadata:{modifies:!0},params:[{name:`field`,type:`field`,required:!0},{name:`interval`,type:`boolean`,default:!0},{name:`units`,type:`enum`,values:Cy,array:!0},{name:`step`,type:`number`,default:1},{name:`maxbins`,type:`number`,default:40},{name:`extent`,type:`date`,array:!0},{name:`inferUnits`,type:`boolean`,default:!1},{name:`timezone`,type:`enum`,default:`local`,values:[`local`,`utc`]},{name:`as`,type:`string`,array:!0,length:2,default:RS}]},U(hS,G,{transform(e,t){let n=e.field,r=e.interval!==!1,i=e.timezone===`utc`,a=this._floor(e,t),o=(i?iy:ry)(a.unit).offset,s=e.as||RS,c=s[0],l=s[1],u=a.step,d=a.start||1/0,f=a.stop||-1/0,p=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Sm(n)))&&(t=t.reflow(!0),p=t.SOURCE,d=1/0,f=-1/0),t.visit(p,e=>{let t=n(e),i,s;t==null?(e[c]=null,r&&(e[l]=null)):(e[c]=i=s=a(t),r&&(e[l]=s=o(i,u)),if&&(f=s))}),a.start=d,a.stop=f,t.modifies(r?s:c)},_floor(e,t){let n=e.timezone===`utc`;e.inferUnits&&(e.units||e.step!=null||e.maxbins!=null||e.extent)&&t.dataflow.warn(`TimeUnit inferUnits overrides units, step, maxbins and extent.`);let{units:r,step:i}=e.inferUnits?fy(t.materialize(t.SOURCE).source,e.field,n):e.units?{units:e.units,step:e.step||1}:dy({extent:e.extent||Mh(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),a=Bv(r),o=this.value||{},s=(n?ny:ty)(a,i);return s.unit=qm(a),s.units=a,s.step=i,s.start=o.start,s.stop=o.stop,this.value=s}}),U(gS,G,{transform(e,t){let n=t.dataflow,r=e.field,i=this.value,a=e=>i.set(r(e),e),o=!0;return e.modified(`field`)||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,a)):t.changed()?(t.visit(t.REM,e=>i.delete(r(e))),t.visit(t.ADD,a)):o=!1,this.modified(o),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),U(_S,G,{transform(e,t){(!this.value||e.modified(`field`)||e.modified(`sort`)||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Ab(e.sort)):t.source).map(e.field))}}),zS={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{let n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{let n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){let e=zS.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{let n=t.data,r=t.compare,i=t.index;if(e0||V(`ntile num must be greater than zero.`);let n=zS.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{let r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{let r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||V(`nth_value nth must be greater than zero.`),{next:n=>{let r=n.i0+(t-1);return rt=null,next:n=>{let r=e(n.data[n.index]);return r==null?t:t=r}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{let i=r.data;return r.index<=n?t:(n=Nue(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}},BS=Object.keys(zS),VS=vS.prototype,VS.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},VS.update=function(e,t){let n=this.cell,r=this.windows,i=e.data,a=r&&r.length,o;if(n){for(o=e.p0;othis.group(i(e)),o=this.state;(!o||n)&&(o=this.state=new vS(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,e=>a(e).add(e))):(t.visit(t.REM,e=>a(e).remove(e)),t.visit(t.ADD,e=>a(e).add(e)));for(let t=0,n=this._mlen;t{}));function zue(e){return e>1?0:e<-1?QS:Math.acos(e)}function WS(e){return e>=1?$S:e<=-1?-$S:Math.asin(e)}var GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC=o((()=>{GS=Math.abs,KS=Math.atan2,qS=Math.cos,JS=Math.max,YS=Math.min,XS=Math.sin,ZS=Math.sqrt,QS=Math.PI,$S=QS/2,eC=2*QS}));function nC(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return nC;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t{iC=Math.PI,aC=2*iC,oC=1e-6,sC=aC-oC,cC=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?nC:Bue(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>oC)if(!(Math.abs(u*s-c*l)>oC)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((iC-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>oC&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>oC||Math.abs(this._y1-l)>oC)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%aC+aC),d>sC?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>oC&&this._append`A${n},${n},0,${+(d>=iC)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}},rC.prototype=cC.prototype})),lC=o((()=>{Vue()}));function uC(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new cC(t)}var dC=o((()=>{lC()}));function Hue(e){return e.innerRadius}function Uue(e){return e.outerRadius}function Wue(e){return e.startAngle}function Gue(e){return e.endAngle}function Kue(e){return e&&e.padAngle}function que(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function fC(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/ZS(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*ZS(JS(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function Jue(){var e=Hue,t=Uue,n=HS(0),r=null,i=Wue,a=Gue,o=Kue,s=null,c=uC(l);function l(){var l,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-$S,m=a.apply(this,arguments)-$S,h=GS(m-p),g=m>p;if(s||=l=c(),f1e-12))s.moveTo(0,0);else if(h>eC-1e-12)s.moveTo(f*qS(p),f*XS(p)),s.arc(0,0,f,p,m,!g),d>1e-12&&(s.moveTo(d*qS(m),d*XS(m)),s.arc(0,0,d,m,p,g));else{var _=p,v=m,y=p,b=m,x=h,S=h,C=o.apply(this,arguments)/2,w=C>1e-12&&(r?+r.apply(this,arguments):ZS(d*d+f*f)),T=YS(GS(f-d)/2,+n.apply(this,arguments)),E=T,D=T,O,k;if(w>1e-12){var A=WS(w/d*XS(C)),j=WS(w/f*XS(C));(x-=A*2)>1e-12?(A*=g?1:-1,y+=A,b-=A):(x=0,y=b=(p+m)/2),(S-=j*2)>1e-12?(j*=g?1:-1,_+=j,v-=j):(S=0,_=v=(p+m)/2)}var M=f*qS(_),ee=f*XS(_),N=d*qS(b),te=d*XS(b);if(T>1e-12){var ne=f*qS(v),P=f*XS(v),re=d*qS(y),F=d*XS(y),ie;if(h1e-12?D>1e-12?(O=fC(re,F,M,ee,f,D,g),k=fC(ne,P,N,te,f,D,g),s.moveTo(O.cx+O.x01,O.cy+O.y01),D1e-12)||!(x>1e-12)?s.lineTo(N,te):E>1e-12?(O=fC(N,te,ne,P,d,-E,g),k=fC(M,ee,re,F,d,-E,g),s.lineTo(O.cx+O.x01,O.cy+O.y01),E{US(),tC(),dC()}));function pC(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}var mC=o((()=>{Array.prototype.slice}));function hC(e){this._context=e}function gC(e){return new hC(e)}var _C=o((()=>{hC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}}));function vC(e){return e[0]}function yC(e){return e[1]}var bC=o((()=>{}));function Xue(e,t){var n=HS(!0),r=null,i=gC,a=null,o=uC(s);e=typeof e==`function`?e:e===void 0?vC:HS(e),t=typeof t==`function`?t:t===void 0?yC:HS(t);function s(s){var c,l=(s=pC(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c{mC(),US(),_C(),dC(),bC()}));function Que(e,t,n){var r=null,i=HS(!0),a=null,o=gC,s=null,c=uC(l);e=typeof e==`function`?e:e===void 0?vC:HS(+e),t=typeof t==`function`?t:HS(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?yC:HS(+n);function l(l){var u,d,f,p=(l=pC(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Xue().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:HS(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:HS(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:HS(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:HS(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:HS(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:HS(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:HS(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var $ue=o((()=>{mC(),US(),_C(),Zue(),dC(),bC()})),ede,tde=o((()=>{tC(),ede={draw(e,t){let n=ZS(t/QS);e.moveTo(n,0),e.arc(0,0,n,0,eC)}}}));function nde(e,t){let n=null,r=uC(i);e=typeof e==`function`?e:HS(e||ede),t=typeof t==`function`?t:HS(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:HS(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:HS(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}var rde=o((()=>{US(),dC(),tde()}));function xC(){}var SC=o((()=>{}));function CC(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function wC(e){this._context=e}function ide(e){return new wC(e)}var TC=o((()=>{wC.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:CC(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:CC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function ade(e){this._context=e}function ode(e){return new ade(e)}var sde=o((()=>{SC(),TC(),ade.prototype={areaStart:xC,areaEnd:xC,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:CC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function cde(e){this._context=e}function lde(e){return new cde(e)}var ude=o((()=>{TC(),cde.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:CC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function dde(e,t){this._basis=new wC(e),this._beta=t}var fde,pde=o((()=>{TC(),dde.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},fde=(function e(t){function n(e){return t===1?new wC(e):new dde(e,t)}return n.beta=function(t){return e(+t)},n})(.85)}));function EC(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function DC(e,t){this._context=e,this._k=(1-t)/6}var mde,OC=o((()=>{DC.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:EC(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:EC(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},mde=(function e(t){function n(e){return new DC(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function kC(e,t){this._context=e,this._k=(1-t)/6}var hde,gde=o((()=>{SC(),OC(),kC.prototype={areaStart:xC,areaEnd:xC,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:EC(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},hde=(function e(t){function n(e){return new kC(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function AC(e,t){this._context=e,this._k=(1-t)/6}var _de,vde=o((()=>{OC(),AC.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:EC(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},_de=(function e(t){function n(e){return new AC(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function jC(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function yde(e,t){this._context=e,this._alpha=t}var bde,MC=o((()=>{tC(),OC(),yde.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:jC(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},bde=(function e(t){function n(e){return t?new yde(e,t):new DC(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function xde(e,t){this._context=e,this._alpha=t}var Sde,Cde=o((()=>{gde(),SC(),MC(),xde.prototype={areaStart:xC,areaEnd:xC,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:jC(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},Sde=(function e(t){function n(e){return t?new xde(e,t):new kC(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function wde(e,t){this._context=e,this._alpha=t}var Tde,Ede=o((()=>{vde(),MC(),wde.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+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:jC(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},Tde=(function e(t){function n(e){return t?new wde(e,t):new AC(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function Dde(e){this._context=e}function Ode(e){return new Dde(e)}var kde=o((()=>{SC(),Dde.prototype={areaStart:xC,areaEnd:xC,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}}));function Ade(e){return e<0?-1:1}function jde(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Ade(a)+Ade(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Mde(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function NC(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function PC(e){this._context=e}function Nde(e){this._context=new Pde(e)}function Pde(e){this._context=e}function Fde(e){return new PC(e)}function Ide(e){return new Nde(e)}var Lde=o((()=>{PC.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:NC(this,this._t0,Mde(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,NC(this,Mde(this,n=jde(this,e,t)),n);break;default:NC(this,this._t0,n=jde(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(Nde.prototype=Object.create(PC.prototype)).point=function(e,t){PC.prototype.point.call(this,t,e)},Pde.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}}}));function Rde(e){this._context=e}function zde(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t{Rde.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=zde(e),i=zde(t),a=0,o=1;o{FC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}}})),Kde=o((()=>{Yue(),$ue(),Zue(),mC(),US(),tC(),_C(),dC(),rde(),tde(),sde(),ude(),TC(),pde(),gde(),vde(),OC(),Cde(),Ede(),MC(),kde(),Lde(),Vde(),Gde()}));function IC(e,t){if(typeof document<`u`&&document.createElement){let n=document.createElement(`canvas`);if(n&&n.getContext)return n.width=e,n.height=t,n}return null}var LC,RC=o((()=>{LC=()=>typeof Image<`u`?Image:null}));function zC(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function BC(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}var VC=o((()=>{}));function HC(){var e=new Hg,t=[],n=[],r=UC;function i(i){let a=e.get(i);if(a===void 0){if(r!==UC)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Hg;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return HC(t,n).unknown(r)},zC.apply(i,arguments),i}var UC,qde=o((()=>{m_(),VC(),UC=Symbol(`implicit`)}));function WC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function GC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}var KC=o((()=>{}));function qC(){}function JC(){return this.rgb().formatHex()}function Jde(){return this.rgb().formatHex8()}function Yde(){return cw(this).formatHsl()}function YC(){return this.rgb().formatRgb()}function XC(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=yw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ZC(t):n===3?new tw(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?QC(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?QC(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bw.exec(e))?new tw(t[1],t[2],t[3],1):(t=xw.exec(e))?new tw(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Sw.exec(e))?QC(t[1],t[2],t[3],t[4]):(t=Cw.exec(e))?QC(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ww.exec(e))?sw(t[1],t[2]/100,t[3]/100,1):(t=Tw.exec(e))?sw(t[1],t[2]/100,t[3]/100,t[4]):Ew.hasOwnProperty(e)?ZC(Ew[e]):e===`transparent`?new tw(NaN,NaN,NaN,0):null}function ZC(e){return new tw(e>>16&255,e>>8&255,e&255,1)}function QC(e,t,n,r){return r<=0&&(e=t=n=NaN),new tw(e,t,n,r)}function $C(e){return e instanceof qC||(e=XC(e)),e?(e=e.rgb(),new tw(e.r,e.g,e.b,e.opacity)):new tw}function ew(e,t,n,r){return arguments.length===1?$C(e):new tw(e,t,n,r??1)}function tw(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function nw(){return`#${ow(this.r)}${ow(this.g)}${ow(this.b)}`}function Xde(){return`#${ow(this.r)}${ow(this.g)}${ow(this.b)}${ow((isNaN(this.opacity)?1:this.opacity)*255)}`}function rw(){let e=iw(this.opacity);return`${e===1?`rgb(`:`rgba(`}${aw(this.r)}, ${aw(this.g)}, ${aw(this.b)}${e===1?`)`:`, ${e})`}`}function iw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function aw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ow(e){return e=aw(e),(e<16?`0`:``)+e.toString(16)}function sw(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new uw(e,t,n,r)}function cw(e){if(e instanceof uw)return new uw(e.h,e.s,e.l,e.opacity);if(e instanceof qC||(e=XC(e)),!e)return new uw;if(e instanceof uw)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&c<1?0:o,new uw(o,s,c,e.opacity)}function lw(e,t,n,r){return arguments.length===1?cw(e):new uw(e,t,n,r??1)}function uw(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function dw(e){return e=(e||0)%360,e<0?e+360:e}function fw(e){return Math.max(0,Math.min(1,e||0))}function pw(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw=o((()=>{KC(),mw=.7,hw=1/mw,gw=`\\s*([+-]?\\d+)\\s*`,_w=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,vw=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,yw=/^#([0-9a-f]{3,8})$/,bw=RegExp(`^rgb\\(${gw},${gw},${gw}\\)$`),xw=RegExp(`^rgb\\(${vw},${vw},${vw}\\)$`),Sw=RegExp(`^rgba\\(${gw},${gw},${gw},${_w}\\)$`),Cw=RegExp(`^rgba\\(${vw},${vw},${vw},${_w}\\)$`),ww=RegExp(`^hsl\\(${_w},${vw},${vw}\\)$`),Tw=RegExp(`^hsla\\(${_w},${vw},${vw},${_w}\\)$`),Ew={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},WC(qC,XC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:JC,formatHex:JC,formatHex8:Jde,formatHsl:Yde,formatRgb:YC,toString:YC}),WC(tw,ew,GC(qC,{brighter(e){return e=e==null?hw:hw**+e,new tw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?mw:mw**+e,new tw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tw(aw(this.r),aw(this.g),aw(this.b),iw(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:nw,formatHex:nw,formatHex8:Xde,formatRgb:rw,toString:rw})),WC(uw,lw,GC(qC,{brighter(e){return e=e==null?hw:hw**+e,new uw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?mw:mw**+e,new uw(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new tw(pw(e>=240?e-240:e+120,i,r),pw(e,i,r),pw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new uw(dw(this.h),fw(this.s),fw(this.l),iw(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(){let e=iw(this.opacity);return`${e===1?`hsl(`:`hsla(`}${dw(this.h)}, ${fw(this.s)*100}%, ${fw(this.l)*100}%${e===1?`)`:`, ${e})`}`}}))})),Ow,kw,Aw=o((()=>{Ow=Math.PI/180,kw=180/Math.PI}));function jw(e){if(e instanceof Nw)return new Nw(e.l,e.a,e.b,e.opacity);if(e instanceof zw)return Bw(e);e instanceof tw||(e=$C(e));var t=Lw(e.r),n=Lw(e.g),r=Lw(e.b),i=Pw((.2225045*t+.7168786*n+.0606169*r)/Uw),a,o;return t===n&&n===r?a=o=i:(a=Pw((.4360747*t+.3850649*n+.1430804*r)/Hw),o=Pw((.0139322*t+.0971045*n+.7141733*r)/Ww)),new Nw(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Mw(e,t,n,r){return arguments.length===1?jw(e):new Nw(e,t,n,r??1)}function Nw(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Pw(e){return e>Jw?e**(1/3):e/qw+Gw}function Fw(e){return e>Kw?e*e*e:qw*(e-Gw)}function Iw(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function Lw(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Zde(e){if(e instanceof zw)return new zw(e.h,e.c,e.l,e.opacity);if(e instanceof Nw||(e=jw(e)),e.a===0&&e.b===0)return new zw(NaN,0{KC(),Dw(),Aw(),Vw=18,Hw=.96422,Uw=1,Ww=.82521,Gw=4/29,Kw=6/29,qw=3*Kw*Kw,Jw=Kw*Kw*Kw,WC(Nw,Mw,GC(qC,{brighter(e){return new Nw(this.l+Vw*(e??1),this.a,this.b,this.opacity)},darker(e){return new Nw(this.l-Vw*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Hw*Fw(t),e=Uw*Fw(e),n=Ww*Fw(n),new tw(Iw(3.1338561*t-1.6168667*e-.4906146*n),Iw(-.9787684*t+1.9161415*e+.033454*n),Iw(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),WC(zw,Rw,GC(qC,{brighter(e){return new zw(this.h,this.c,this.l+Vw*(e??1),this.opacity)},darker(e){return new zw(this.h,this.c,this.l-Vw*(e??1),this.opacity)},rgb(){return Bw(this).rgb()}}))}));function $de(e){if(e instanceof Xw)return new Xw(e.h,e.s,e.l,e.opacity);e instanceof tw||(e=$C(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(iT*r+nT*t-rT*n)/(iT+nT-rT),a=r-i,o=(tT*(n-i)-$w*a)/eT,s=Math.sqrt(o*o+a*a)/(tT*i*(1-i)),c=s?Math.atan2(o,a)*kw-120:NaN;return new Xw(c<0?c+360:c,s,i,e.opacity)}function Yw(e,t,n,r){return arguments.length===1?$de(e):new Xw(e,t,n,r??1)}function Xw(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}var Zw,Qw,$w,eT,tT,nT,rT,iT,efe=o((()=>{KC(),Dw(),Aw(),Zw=-.14861,Qw=1.78277,$w=-.29227,eT=-.90649,tT=1.97294,nT=tT*eT,rT=tT*Qw,iT=Qw*$w-eT*Zw,WC(Xw,Yw,GC(qC,{brighter(e){return e=e==null?hw:hw**+e,new Xw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?mw:mw**+e,new Xw(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Ow,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new tw(255*(t+n*(Zw*r+Qw*i)),255*(t+n*($w*r+eT*i)),255*(t+tT*r*n),this.opacity)}}))})),aT=o((()=>{Dw(),Qde(),efe()}));function oT(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function sT(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r{}));function lT(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],a=e[r%t],o=e[(r+1)%t],s=e[(r+2)%t];return oT((n-r/t)*t,i,a,o,s)}}var uT=o((()=>{cT()})),dT,fT=o((()=>{dT=e=>()=>e}));function pT(e,t){return function(n){return e+n*t}}function tfe(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function mT(e,t){var n=t-e;return n?pT(e,n>180||n<-180?n-360*Math.round(n/360):n):dT(isNaN(e)?t:e)}function nfe(e){return(e=+e)==1?hT:function(t,n){return n-t?tfe(t,n,e):dT(isNaN(t)?n:t)}}function hT(e,t){var n=t-e;return n?pT(e,n):dT(isNaN(e)?t:e)}var gT=o((()=>{fT()}));function _T(e){return function(t){var n=t.length,r=Array(n),i=Array(n),a=Array(n),o,s;for(o=0;o{aT(),cT(),uT(),gT(),vT=(function e(t){var n=nfe(t);function r(e,t){var r=n((e=ew(e)).r,(t=ew(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=hT(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1),yT=_T(sT),bT=_T(lT)}));function ST(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i{}));function rfe(e,t){return(CT(t)?ST:TT)(e,t)}function TT(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o{RT(),wT()}));function DT(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}var OT=o((()=>{}));function kT(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var AT=o((()=>{}));function jT(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=LT(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var MT=o((()=>{RT()}));function ife(e){return function(){return e}}function afe(e){return function(t){return e(t)+``}}function NT(e,t){var n=PT.lastIndex=FT.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=PT.exec(e))&&(i=FT.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:kT(r,i)})),n=FT.lastIndex;return n{AT(),PT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,FT=new RegExp(PT.source,`g`)}));function LT(e,t){var n=typeof t,r;return t==null||n===`boolean`?dT(t):(n===`number`?kT:n===`string`?(r=XC(t))?(t=r,vT):NT:t instanceof XC?vT:t instanceof Date?DT:CT(t)?ST:Array.isArray(t)?TT:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?jT:kT)(e,t)}var RT=o((()=>{aT(),xT(),ET(),OT(),AT(),MT(),IT(),fT(),wT()}));function ofe(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var sfe=o((()=>{}));function cfe(e,t){var n=mT(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var lfe=o((()=>{gT()}));function zT(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var ufe=o((()=>{}));function BT(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r{VT=180/Math.PI,HT={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}));function ffe(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?HT:BT(t.a,t.b,t.c,t.d,t.e,t.f)}function pfe(e){return e==null||(UT||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),UT.setAttribute(`transform`,e),!(e=UT.transform.baseVal.consolidate()))?HT:(e=e.matrix,BT(e.a,e.b,e.c,e.d,e.e,e.f))}var UT,mfe=o((()=>{dfe()}));function WT(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:kT(e,i)},{i:c-2,x:kT(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:kT(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:kT(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:kT(e,n)},{i:s-2,x:kT(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t{AT(),mfe(),GT=WT(ffe,`px, `,`px)`,`deg)`),KT=WT(pfe,`, `,`)`,`)`)}));function qT(e){return((e=Math.exp(e))+1/e)/2}function gfe(e){return((e=Math.exp(e))-1/e)/2}function _fe(e){return((e=Math.exp(2*e))-1)/(e+1)}var JT,YT,vfe=o((()=>{JT=1e-12,YT=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p{aT(),gT(),ZT=XT(mT),QT=XT(hT)}));function bfe(e,t){var n=hT((e=Mw(e)).l,(t=Mw(t)).l),r=hT(e.a,t.a),i=hT(e.b,t.b),a=hT(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}var xfe=o((()=>{aT(),gT()}));function $T(e){return function(t,n){var r=e((t=Rw(t)).h,(n=Rw(n)).h),i=hT(t.c,n.c),a=hT(t.l,n.l),o=hT(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var eE,tE,Sfe=o((()=>{aT(),gT(),eE=$T(mT),tE=$T(hT)}));function nE(e){return(function t(n){n=+n;function r(t,r){var i=e((t=Yw(t)).h,(r=Yw(r)).h),a=hT(t.s,r.s),o=hT(t.l,r.l),s=hT(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}var rE,iE,Cfe=o((()=>{aT(),gT(),rE=nE(mT),iE=nE(hT)}));function aE(e,t){t===void 0&&(t=e,e=LT);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n{RT()}));function Tfe(e,t){for(var n=Array(t),r=0;r{})),Dfe=c({interpolate:()=>LT,interpolateArray:()=>rfe,interpolateBasis:()=>sT,interpolateBasisClosed:()=>lT,interpolateCubehelix:()=>rE,interpolateCubehelixLong:()=>iE,interpolateDate:()=>DT,interpolateDiscrete:()=>ofe,interpolateHcl:()=>eE,interpolateHclLong:()=>tE,interpolateHsl:()=>ZT,interpolateHslLong:()=>QT,interpolateHue:()=>cfe,interpolateLab:()=>bfe,interpolateNumber:()=>kT,interpolateNumberArray:()=>ST,interpolateObject:()=>jT,interpolateRgb:()=>vT,interpolateRgbBasis:()=>yT,interpolateRgbBasisClosed:()=>bT,interpolateRound:()=>zT,interpolateString:()=>NT,interpolateTransformCss:()=>GT,interpolateTransformSvg:()=>KT,interpolateZoom:()=>YT,piecewise:()=>aE,quantize:()=>Tfe}),oE=o((()=>{RT(),ET(),cT(),uT(),OT(),sfe(),lfe(),AT(),wT(),MT(),ufe(),IT(),hfe(),vfe(),xT(),yfe(),xfe(),Sfe(),Cfe(),wfe(),Efe()}));function Ofe(e){return function(){return e}}var kfe=o((()=>{}));function sE(e){return+e}var cE=o((()=>{}));function lE(e){return e}function uE(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Ofe(isNaN(t)?NaN:.5)}function Afe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function jfe(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?Mfe:jfe,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),kT))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,sE),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=zT,u()},d.clamp=function(e){return arguments.length?(o=e?!0:lE,u()):o!==lE},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function pE(){return fE()(lE,lE)}var mE,hE=o((()=>{m_(),oE(),kfe(),cE(),mE=[0,1]}));function gE(e,t,n,r){var i=Xg(e,t,n),a;switch(r=y_(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=I_(i,o))&&(r.precision=a),P_(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=L_(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=F_(i))&&(r.precision=a-(r.type===`%`)*2);break}return N_(r)}var _E=o((()=>{m_(),R_()}));function vE(e){var t=e.domain;return e.ticks=function(e){var n=t();return Jg(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return gE(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s0;){if(l=Yg(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function yE(){var e=pE();return e.copy=function(){return dE(e,yE())},zC.apply(e,arguments),vE(e)}var bE=o((()=>{m_(),hE(),VC(),_E()}));function xE(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,sE),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return xE(e).unknown(t)},e=arguments.length?Array.from(e,sE):[0,1],vE(n)}var Nfe=o((()=>{bE(),cE()}));function SE(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a{}));function wE(e){return Math.log(e)}function TE(e){return Math.exp(e)}function Pfe(e){return-Math.log(-e)}function Ffe(e){return-Math.exp(-e)}function Ife(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function Lfe(e){return e===10?Ife:e===Math.E?Math.exp:t=>e**+t}function Rfe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function EE(e){return(t,n)=>-e(-t,n)}function DE(e){let t=e(wE,TE),n=t.domain,r=10,i,a;function o(){return i=Rfe(r),a=Lfe(r),n()[0]<0?(i=EE(i),a=EE(a),e(Pfe,Ffe)):e(wE,TE),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s0){for(;l<=u;++l)for(d=1;ds)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(fs)break;m.push(f)}m.length*2{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=y_(n)).precision==null&&(n.trim=!0),n=N_(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*rn(SE(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function OE(){let e=DE(fE()).domain([1,10]);return e.copy=()=>dE(e,OE()).base(e.base()),zC.apply(e,arguments),e}var kE=o((()=>{m_(),R_(),CE(),hE(),VC()}));function AE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function jE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ME(e){var t=1,n=e(AE(t),jE(t));return n.constant=function(n){return arguments.length?e(AE(t=+n),jE(t)):t},vE(n)}function NE(){var e=ME(fE());return e.copy=function(){return dE(e,NE()).constant(e.constant())},zC.apply(e,arguments)}var PE=o((()=>{bE(),hE(),VC()}));function FE(e){return function(t){return t<0?-((-t)**+e):t**+e}}function zfe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Bfe(e){return e<0?-e*e:e*e}function IE(e){var t=e(lE,lE),n=1;function r(){return n===1?e(lE,lE):n===.5?e(zfe,Bfe):e(FE(n),FE(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},vE(t)}function LE(){var e=IE(fE());return e.copy=function(){return dE(e,LE()).exponent(e.exponent())},zC.apply(e,arguments),e}function Vfe(){return LE.apply(null,arguments).exponent(.5)}var RE=o((()=>{bE(),hE(),VC()}));function zE(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r0?n[i-1]:e[0],i{m_(),VC()}));function BE(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[Pg(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return BE().domain([e,t]).range(i).unknown(a)},zC.apply(vE(o),arguments)}var Ufe=o((()=>{m_(),bE(),VC()}));function VE(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[Pg(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return VE().domain(e).range(t).unknown(n)},zC.apply(i,arguments)}var Wfe=o((()=>{m_(),VC()}));function Gfe(e){return new Date(e)}function Kfe(e){return e instanceof Date?+e:+new Date(+e)}function HE(e,t,n,r,i,a,o,s,c,l){var u=pE(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e){zv(),ab(),hE(),VC(),CE()}));function Jfe(){return zC.apply(HE(Fv,Iv,Mv,kv,bv,cv,av,nv,$_,ib).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var Yfe=o((()=>{zv(),ab(),UE(),VC()}));function WE(){var e=0,t=1,n,r,i,a,o=lE,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(LT),l.rangeRound=u(zT),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function GE(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function KE(){var e=vE(WE()(lE));return e.copy=function(){return GE(e,KE())},BC.apply(e,arguments)}function qE(){var e=DE(WE()).domain([1,10]);return e.copy=function(){return GE(e,qE()).base(e.base())},BC.apply(e,arguments)}function JE(){var e=ME(WE());return e.copy=function(){return GE(e,JE()).constant(e.constant())},BC.apply(e,arguments)}function YE(){var e=IE(WE());return e.copy=function(){return GE(e,YE()).exponent(e.exponent())},BC.apply(e,arguments)}function Xfe(){return YE.apply(null,arguments).exponent(.5)}var XE=o((()=>{oE(),hE(),VC(),bE(),kE(),PE(),RE()}));function ZE(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=lE,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e{oE(),hE(),VC(),bE(),kE(),XE(),PE(),RE()})),$fe=o((()=>{m_(),qde(),Nfe(),bE(),kE(),PE(),RE(),hE(),cE(),Hfe(),Ufe(),Wfe(),UE(),Yfe(),XE(),Qfe(),_E()}));function nD(e){for(var t=e.length/6|0,n=Array(t),r=0;r{})),iD,epe=o((()=>{rD(),iD=nD(`1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf`)})),aD,tpe=o((()=>{rD(),aD=nD(`7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666`)})),oD,npe=o((()=>{rD(),oD=nD(`1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666`)})),sD,rpe=o((()=>{rD(),sD=nD(`4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0`)})),cD,ipe=o((()=>{rD(),cD=nD(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`)})),lD,ape=o((()=>{rD(),lD=nD(`fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2`)})),uD,ope=o((()=>{rD(),uD=nD(`b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc`)})),dD,spe=o((()=>{rD(),dD=nD(`e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999`)})),fD,cpe=o((()=>{rD(),fD=nD(`66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3`)})),pD,lpe=o((()=>{rD(),pD=nD(`8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f`)})),upe=o((()=>{epe(),tpe(),npe(),rpe(),ipe(),ape(),ope(),spe(),cpe(),lpe(),rD(),oE(),aT()}));function mD(e,t,n){let r=e-t+n*2;return e?r>0?r:1:0}function dpe(e){return function(t){let n=t[0],r=t[1],i;return r=r&&n[c]<=i&&(a<0&&(a=c),o=c);if(!(a<0))return r=e.invertExtent(n[a]),i=e.invertExtent(n[o]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function hD(){let e=HC().unknown(void 0),t=e.domain,n=e.range,r=[0,1],i,a,o=!1,s=0,c=0,l=.5;delete e.unknown;function u(){let e=t().length,u=r[1]p+i*e);return n(u?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),u()):t()},e.range=function(e){return arguments.length?(r=[+e[0],+e[1]],u()):r.slice()},e.rangeRound=function(e){return r=[+e[0],+e[1]],o=!0,u()},e.bandwidth=function(){return a},e.step=function(){return i},e.round=function(e){return arguments.length?(o=!!e,u()):o},e.padding=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),s=c,u()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),u()):s},e.paddingOuter=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),u()):c},e.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},e.invertRange=function(e){if(e[0]==null||e[1]==null)return;let i=r[1]r[1-i])))return u=Math.max(0,Pg(o,c)-1),d=c===l?u:Pg(o,l)-1,c-o[u]>a+1e-10&&++u,i&&(f=u,u=s-d,d=s-f),u>d?void 0:t().slice(u,d+1)},e.invert=function(t){let n=e.invertRange([t,t]);return n&&n[0]},e.copy=function(){return hD().domain(t()).range(r).round(o).paddingInner(s).paddingOuter(c).align(l)},u()}function gD(e){let t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return gD(t())},e}function ppe(){return gD(hD().paddingInner(1))}function mpe(e){return dO.call(e,Ym)}function _D(){let e=[],t=[];function n(n){return n==null||n!==n?void 0:t[(Pg(e,n)-1)%t.length]}return n.domain=function(t){return arguments.length?(e=mpe(t),n):e.slice()},n.range=function(e){return arguments.length?(t=fO.call(e),n):t.slice()},n.tickFormat=function(t,n){return gE(e[0],qm(e),t??10,n)},n.copy=function(){return _D().domain(n.domain()).range(n.range())},n}function vD(e){return e[mO]=!0,e}function yD(e){return e&&e[mO]===!0}function hpe(e,t,n){let r=function(){let n=t();return n.invertRange||=n.invert?dpe(n):n.invertExtent?fpe(n):void 0,n.type=e,vD(n)};return r.metadata=cg(_h(n)),r}function bD(e,t,n){return arguments.length>1?(pO.set(e,hpe(e,t,n)),this):xD(e)?pO.get(e):void 0}function xD(e){return pO.has(e)}function SD(e,t){let n=pO.get(e);return n&&n.metadata[t]}function CD(e){return SD(e,oO)}function wD(e){return SD(e,sO)}function TD(e){return SD(e,cO)}function ED(e){return SD(e,`log`)}function DD(e){return SD(e,uO)}function OD(e){return SD(e,lO)}function kD(e){return SD(e,$D)}function AD(e,t){let n=t[0],r=qm(t)-n;return function(t){return e(n+t*r)}}function jD(e,t,n){return aE(PD(t||`rgb`,n),e)}function MD(e,t){let n=Array(t),r=t+1;for(let i=0;ie[t]?o[t](e[t]()):0),o)}function PD(e,t){let n=Dfe[gpe(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function gpe(e){return`interpolate`+e.toLowerCase().split(`-`).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function FD(e){if(H(e))return e;let t=e.length/6|0,n=Array(t);for(let r=0;r1?(vO[e]=t,this):vO[e]}function RD(e,t,n){let r;if(Wh(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null)){let r=e.domain(),i=Math.min(r[0],qm(r)),a=Math.max(r[0],qm(r));if(t=Math.min(t,Math.floor((a-i)/n||1)+1),!e.bins&&!ED(e.type)&&!DD(e.type)&&i1&&Xg(i,a,t)a&&(r=a,a=i,i=r,o=xO),i=Math.floor(i),a=Math.ceil(a),t=t.map(t=>[t,e(t)]).filter(e=>i<=e[1]&&e[1]<=a).sort(o).map(e=>e[0]),n>0&&t.length>1){let e=[t[0],qm(t)];for(;t.length>n&&t.length>=3;)t=t.filter((e,t)=>!(t%2));t.length<3&&(t=e)}return t}function BD(e,t){return e.bins?zD(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function VD(e,t,n,r,i,a){let o=t.type,s=yO;if(o===`time`||i===`time`)s=e.timeFormat(r);else if(o===`utc`||i===`utc`)s=e.utcFormat(r);else if(ED(o)){let i=e.formatFloat(r);if(a||t.bins)s=i;else{let e=HD(t,n,!1);s=t=>e(t)?i(t):``}}else if(t.tickFormat){let i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function HD(e,t,n){let r=BD(e,t),i=e.base(),a=Math.log(i),o=Math.max(1,i*t/r.length),s=e=>{let t=e/i**+Math.round(Math.log(e)/a);return t*i1?r[1]-r[0]:r[0],o;for(o=1;o(e-r)/a}function xpe(e,t,n,r){let i=r||t.type;return qh(n)&&DD(i)&&(n=n.replace(/%a/g,`%A`).replace(/%b/g,`%B`)),!n&&i===`time`?e.timeFormat(`%A, %d %B %Y, %X`):!n&&i===`utc`?e.utcFormat(`%A, %d %B %Y, %X UTC`):WD(e,t,5,null,n,r,!0)}function GD(e,t,n){n||={};let r=Math.max(3,n.maxlen||7),i=xpe(e,t,n.format,n.formatType);if(TD(t.type)){let e=UD(t).slice(1).map(i),n=e.length;return`${n} boundar${n===1?`y`:`ies`}: ${e.join(`, `)}`}else if(wD(t.type)){let e=t.domain(),n=e.length,a=n>r?e.slice(0,r-2).map(i).join(`, `)+`, ending with `+e.slice(-1).map(i):e.map(i).join(`, `);return`${n} value${n===1?``:`s`}: ${a}`}else{let e=t.domain();return`values from ${i(e[0])} to ${i(qm(e))}`}}var KD,qD,JD,YD,XD,ZD,QD,$D,eO,tO,nO,rO,iO,aO,oO,sO,cO,lO,uO,dO,fO,pO,mO,hO,gO,_O,vO,yO,bO,xO,SO,CO,wO,TO,EO,DO,OO,kO,AO=o((()=>{dg(),m_(),$fe(),oE(),upe(),qy(),KD=`identity`,qD=`linear`,JD=`sqrt`,YD=`symlog`,XD=`time`,ZD=`sequential`,QD=`diverging`,$D=`quantile`,eO=`quantize`,tO=`threshold`,nO=`ordinal`,rO=`point`,iO=`band`,aO=`bin-ordinal`,oO=`continuous`,sO=`discrete`,cO=`discretizing`,lO=`interpolating`,uO=`temporal`,dO=Array.prototype.map,fO=Array.prototype.slice,pO=new Map,mO=Symbol(`vega_scale`),bD(KD,xE),bD(qD,yE,oO),bD(`log`,OE,[oO,`log`]),bD(`pow`,LE,oO),bD(JD,Vfe,oO),bD(YD,NE,oO),bD(XD,qfe,[oO,uO]),bD(`utc`,Jfe,[oO,uO]),bD(ZD,KE,[oO,lO]),bD(`${ZD}-${qD}`,KE,[oO,lO]),bD(`${ZD}-log`,qE,[oO,lO,`log`]),bD(`${ZD}-pow`,YE,[oO,lO]),bD(`${ZD}-${JD}`,Xfe,[oO,lO]),bD(`${ZD}-${YD}`,JE,[oO,lO]),bD(`${QD}-${qD}`,QE,[oO,lO]),bD(`${QD}-log`,$E,[oO,lO,`log`]),bD(`${QD}-pow`,tD,[oO,lO]),bD(`${QD}-${JD}`,Zfe,[oO,lO]),bD(`${QD}-${YD}`,eD,[oO,lO]),bD($D,zE,[cO,$D]),bD(eO,BE,cO),bD(tO,VE,cO),bD(aO,_D,[sO,cO]),bD(nO,HC,sO),bD(iO,hD,sO),bD(rO,ppe,sO),hO=[`clamp`,`base`,`constant`,`exponent`],gO={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`},_O={accent:aD,category10:iD,category20:`1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5`,category20b:`393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6`,category20c:`3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9`,dark2:oD,observable10:sD,paired:cD,pastel1:lD,pastel2:uD,set1:dD,set2:fD,set3:pD,tableau10:`4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac`,tableau20:`4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5`},vO={},ID(_O,FD),ID(gO,e=>jD(FD(e))),yO=e=>H(e)?e.map(e=>String(e)):String(e),bO=(e,t)=>e[1]-t[1],xO=(e,t)=>t[1]-e[1],SO={[$D]:`quantiles`,[eO]:`thresholds`,[tO]:`domain`},CO={[$D]:`quantiles`,[eO]:`domain`},wO=e=>SO[e.type]||e.bins,TO=e=>(t,n,r)=>{let i=EO(r[n+1],EO(r.max,1/0)),a=kO(t,e),o=kO(i,e);return a&&o?a+` – `+o:o?`< `+o:`≥ `+a},EO=(e,t)=>e??t,DO=e=>(t,n)=>n?e(t):null,OO=e=>t=>e(t),kO=(e,t)=>Number.isFinite(e)?t(e):null}));function Spe(){Gk=0}function jO(e){return e&&e.gradient}function Cpe(e,t,n){let r=e.gradient,i=e.id,a=r===`radial`?Kk:``;return i||(i=e.id=`gradient_`+Gk++,r===`radial`?(e.x1=MO(e.x1,.5),e.y1=MO(e.y1,.5),e.r1=MO(e.r1,0),e.x2=MO(e.x2,.5),e.y2=MO(e.y2,.5),e.r2=MO(e.r2,.5),a=Kk):(e.x1=MO(e.x1,0),e.y1=MO(e.y1,0),e.x2=MO(e.x2,1),e.y2=MO(e.y2,0))),t[i]=e,`url(`+(n||``)+`#`+a+i+`)`}function MO(e,t){return e??t}function wpe(e,t){var n=[],r;return r={gradient:`linear`,x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(e,t){return n.push({offset:e,color:t}),r}}}function NO(e,t,n){var r=Ph(qk,e)&&qk[e],i=null;return r&&(i=r.curve||r[t||`vertical`],r.tension&&n!=null&&(i=i[r.tension](n))),i}function PO(e){let t=[];return(e.match(zhe)||[]).forEach(e=>{let n=e[0],r=n.toLowerCase(),i=Rhe[r],a=Tpe(r,i,e.slice(1).trim()),o=a.length;if(o1&&(h=Math.sqrt(h),n*=h,r*=h);let g=f/n,_=d/n,v=-d/r,y=f/r,b=g*s+_*c,x=v*s+y*c,S=g*e+_*t,C=v*e+y*t,w=1/((S-b)*(S-b)+(C-x)*(C-x))-.25;w<0&&(w=0);let T=Math.sqrt(w);a==i&&(T=-T);let E=.5*(b+S)-T*(C-x),D=.5*(x+C)+T*(S-b),O=Math.atan2(x-D,b-E),k=Math.atan2(C-D,S-E)-O;k<0&&a===1?k+=Xk:k>0&&a===0&&(k-=Xk);let A=Math.ceil(Math.abs(k/(Yk+.001))),j=[];for(let e=0;e+e}function LO(e,t,n){return Math.max(t,Math.min(e,n))}function Ipe(){var e=Mpe,t=Npe,n=Ppe,r=Fpe,i=IO(0),a=i,o=i,s=i,c=null;function l(l,u,d){var f,p=u??+e.call(this,l),m=d??+t.call(this,l),h=+n.call(this,l),g=+r.call(this,l),_=Math.min(h,g)/2,v=LO(+i.call(this,l),0,_),y=LO(+a.call(this,l),0,_),b=LO(+o.call(this,l),0,_),x=LO(+s.call(this,l),0,_);if(c||=f=rC(),v<=0&&y<=0&&b<=0&&x<=0)c.rect(p,m,h,g);else{var S=p+h,C=m+g;c.moveTo(p+v,m),c.lineTo(S-y,m),c.bezierCurveTo(S-aA*y,m,S,m+aA*y,S,m+y),c.lineTo(S,C-x),c.bezierCurveTo(S,C-aA*x,S-aA*x,C,S-x,C),c.lineTo(p+b,C),c.bezierCurveTo(p+aA*b,C,p,C-aA*b,p,C-b),c.lineTo(p,m+v),c.bezierCurveTo(p,m+aA*v,p+aA*v,m,p+v,m),c.closePath()}if(f)return c=null,f+``||null}return l.x=function(t){return arguments.length?(e=IO(t),l):e},l.y=function(e){return arguments.length?(t=IO(e),l):t},l.width=function(e){return arguments.length?(n=IO(e),l):n},l.height=function(e){return arguments.length?(r=IO(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=IO(e),a=t==null?i:IO(t),s=n==null?i:IO(n),o=r==null?a:IO(r),l):i},l.context=function(e){return arguments.length?(c=e??null,l):c},l}function Lpe(){var e,t,n,r,i=null,a,o,s,c;function l(e,t,n){let r=n/2;if(a){var l=s-t,u=e-o;if(l||u){var d=Math.hypot(l,u),f=(l/=d)*c,p=(u/=d)*c,m=Math.atan2(u,l);i.moveTo(o-f,s-p),i.lineTo(e-l*r,t-u*r),i.arc(e,t,r,m-Math.PI,m),i.lineTo(o+f,s+p),i.arc(o,s,c,m,m+Math.PI)}else i.arc(e,t,r,0,Xk);i.closePath()}else a=1;o=e,s=t,c=r}function u(o){var s,c=o.length,u,d=!1,f;for(i??=f=rC(),s=0;s<=c;++s)!(sUhe?(u=o*o+s*a,u>=0&&(u=Math.sqrt(u),c=(-o+u)/a,l=(-o-u)/a)):c=.5*s/o,0f)return!1;h>d&&(d=h)}else if(p>0){if(h0?(e.globalAlpha=n,e.fillStyle=$pe(e,t,t.fill),!0):!1}function ek(e,t,n){var r=(r=t.strokeWidth)??1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=$pe(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||`butt`,e.lineJoin=t.strokeJoin||`miter`,e.miterLimit=t.strokeMiterLimit==null?4:t.strokeMiterLimit,e.setLineDash&&(e.setLineDash(t.strokeDash||gge),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function eme(e,t){return e.zindex-t.zindex||e.index-t.index}function tk(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,a;for(i=0,a=t.length;i=0;)if(r=t(n[i]))return r;if(n===a){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function ik(e){return function(t,n,r){nk(n,n=>{(!r||r.intersects(n.bounds))&&nme(e,t,n,n)})}}function tme(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&nme(e,t,n.items[0],n.items)}}function nme(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(ZO(t,n),n.fill&&$O(t,n,i)&&t.fill(),n.stroke&&ek(t,n,i)&&t.stroke()))}function ak(e){return e||=Lm,function(t,n,r,i,a,o){return r*=t.pixelRatio,i*=t.pixelRatio,rk(n,n=>{let s=n.bounds;if(!(s&&!s.contains(a,o)||!s)&&e(t,n,r,i,a,o))return n})}}function ok(e,t){return function(n,r,i,a){var o=Array.isArray(r)?r[0]:r,s=t??o.fill,c=o.stroke&&n.isPointInStroke,l,u;return c&&(l=o.strokeWidth,u=o.strokeCap,n.lineWidth=l??1,n.lineCap=u??`butt`),e(n,r)?!1:s&&n.isPointInPath(i,a)||c&&n.isPointInStroke(i,a)}}function sk(e){return ak(ok(e))}function ck(e,t){return`translate(`+e+`,`+t+`)`}function lk(e){return`rotate(`+e+`)`}function rme(e,t){return`scale(`+e+`,`+t+`)`}function ime(e){return ck(e.x||0,e.y||0)}function ame(e){return ck(e.x||0,e.y||0)+(e.angle?` `+lk(e.angle):``)}function ome(e){return ck(e.x||0,e.y||0)+(e.angle?` `+lk(e.angle):``)+(e.scaleX||e.scaleY?` `+rme(e.scaleX||1,e.scaleY||1):``)}function uk(e,t,n){function r(e,n){e(`transform`,ame(n)),e(`d`,t(null,n))}function i(e,n){return t(qO(e,n.angle),n),KO(e,n,!0).translate(n.x||0,n.y||0)}function a(e,n){var r=n.x||0,i=n.y||0,a=n.angle||0;e.translate(r,i),a&&e.rotate(a*=Jk),e.beginPath(),t(e,n),a&&e.rotate(-a),e.translate(-r,-i)}return{type:e,tag:`path`,nested:!1,attr:r,bound:i,draw:ik(a),pick:sk(a),isect:n||JO(a)}}function sme(e,t){for(var n=e[0].orient===`horizontal`?t[1]:t[0],r=e[0].orient===`horizontal`?`y`:`x`,i=e.length,a=1/0,o,s;--i>=0;)e[i].defined!==!1&&(s=Math.abs(e[i][r]-n),s=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],a=e[r].y-t[1],o=i*i+a*a,o=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],a=r*r+i*i,r=e[n].size||1,a.5&&t<1.5?.5-Math.abs(t-1):0:e.strokeOffset}function pme(e,t){e(`transform`,ime(t))}function mme(e,t){let n=fme(t);e(`d`,BO(null,t,n,n))}function hme(e,t){e(`class`,`background`),e(`aria-hidden`,!0),mme(e,t)}function gme(e,t){e(`class`,`foreground`),e(`aria-hidden`,!0),t.strokeForeground?mme(e,t):e(`d`,``)}function _me(e,t,n){e(`clip-path`,t.clip?VO(n,t,t):null)}function vme(e,t){if(!t.clip&&t.items){let n=t.items,r=n.length;for(let t=0;t{let i=t.x||0,a=t.y||0,o=t.strokeForeground,s=t.opacity==null?1:t.opacity;(t.stroke||t.fill)&&s&&(fk(e,t,i,a),ZO(e,t),t.fill&&$O(e,t,s)&&e.fill(),t.stroke&&!o&&ek(e,t,s)&&e.stroke()),e.save(),e.translate(i,a),t.clip&&dme(e,t),n&&n.translate(-i,-a),nk(t,t=>{(t.marktype===`group`||r==null||r.includes(t.marktype))&&this.draw(e,t,n,r)}),n&&n.translate(i,a),e.restore(),o&&t.stroke&&s&&(fk(e,t,i,a),ZO(e,t),ek(e,t,s)&&e.stroke())})}function bme(e,t,n,r,i,a){if(t.bounds&&!t.bounds.contains(i,a)||!t.items)return null;let o=n*e.pixelRatio,s=r*e.pixelRatio;return rk(t,c=>{let l,u,d,f=c.bounds;if(f&&!f.contains(i,a))return;u=c.x||0,d=c.y||0;let p=u+(c.width||0),m=d+(c.height||0),h=c.clip;if(h&&(ip||am))return;if(e.save(),e.translate(u,d),u=i-u,d=a-d,h&&zO(c)&&!xge(e,c,o,s))return e.restore(),null;let g=c.strokeForeground,_=t.interactive!==!1;return _&&g&&c.stroke&&bge(e,c,o,s)?(e.restore(),c):(l=rk(c,e=>xme(e,u,d)?this.pick(e,n,r,u,d):null),!l&&_&&(c.fill||!g&&c.stroke)&&yge(e,c,o,s)&&(l=c),e.restore(),l||null)})}function xme(e,t,n){return(e.interactive!==!1||e.marktype===`group`)&&e.bounds&&e.bounds.contains(t,n)}function pk(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(t=>{e.image=t,e.image.url=e.url})),n}function mk(e,t){return e.width==null?!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width:e.width}function hk(e,t){return e.height==null?!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height:e.height}function gk(e,t){return e===`center`?t/2:e===`right`?t:0}function _k(e,t){return e===`middle`?t/2:e===`bottom`?t:0}function Sme(e,t,n){let r=pk(t,n),i=mk(t,r),a=hk(t,r),o=(t.x||0)-gk(t.align,i),s=(t.y||0)-_k(t.baseline,a);e(`href`,!r.src&&r.toDataURL?r.toDataURL():r.src||``,kA[`xmlns:xlink`],`xlink:href`),e(`transform`,ck(o,s)),e(`width`,i),e(`height`,a),e(`preserveAspectRatio`,t.aspect===!1?`none`:`xMidYMid`)}function Cme(e,t){let n=t.image,r=mk(t,n),i=hk(t,n),a=(t.x||0)-gk(t.align,r),o=(t.y||0)-_k(t.baseline,i);return e.set(a,o,a+r,o+i)}function wme(e,t,n){nk(t,t=>{if(n&&!n.intersects(t.bounds))return;let r=pk(t,this),i=mk(t,r),a=hk(t,r);if(i===0||a===0)return;let o=(t.x||0)-gk(t.align,i),s=(t.y||0)-_k(t.baseline,a),c,l,u;t.aspect!==!1&&(c=r.width/r.height,l=t.width/t.height,c===c&&l===l&&c!==l&&(l{if(!(n&&!n.intersects(t.bounds))){var r=t.opacity==null?1:t.opacity;r&&Mme(e,t,r)&&(ZO(e,t),e.stroke())}})}function Pme(e,t,n,r){return e.isPointInStroke?Mme(e,t,1)&&e.isPointInStroke(n,r):!1}function Fme(e){jA.width=e&&DA?bk:yk}function yk(e,t){return Ime(Tk(e,t),xk(e))}function Ime(e,t){return~~(.8*e.length*t)}function bk(e,t){return xk(e)<=0||!(t=Tk(e,t))?0:Lme(t,Dk(e))}function Lme(e,t){let n=`(${t}) ${e}`,r=AA.get(n);return r===void 0&&(DA.font=t,r=DA.measureText(e).width,AA.set(n,r)),r}function xk(e){return e.fontSize==null?11:+e.fontSize||0}function Sk(e){return e.lineHeight==null?xk(e)+2:e.lineHeight}function Rme(e){return H(e)?e.length>1?e:e[0]:e}function Ck(e){return Rme(e.lineBreak&&e.text&&!H(e.text)?e.text.split(e.lineBreak):e.text)}function wk(e){let t=Ck(e);return(H(t)?t.length-1:0)*Sk(e)}function Tk(e,t){let n=t==null?``:(t+``).trim();return e.limit>0&&n.length?Bme(e,n):n}function zme(e){if(jA.width===bk){let t=Dk(e);return e=>Lme(e,t)}else if(jA.width===yk){let t=xk(e);return e=>Ime(e,t)}else return t=>jA.width(e,t)}function Bme(e,t){var n=+e.limit,r=zme(e);if(r(t)>>1,r(t.slice(c))>n?o=c+1:s=c;return i+t.slice(o)}else{for(;o>>1),r(t.slice(0,c))Math.max(e,jA.width(t,n)),0)):d=jA.width(t,u),i===`center`?c-=d/2:i===`right`&&(c-=d),e.set(c+=o,l+=s,c+d,l+r),t.angle&&!n)e.rotate(t.angle*Jk,o,s);else if(n===2)return e.rotatedPoints(t.angle*Jk,o,s);return e}function Hme(e,t,n){nk(t,t=>{var r=t.opacity==null?1:t.opacity,i,a,o,s,c,l,u;if(!(n&&!n.intersects(t.bounds)||r===0||t.fontSize<=0||t.text==null||t.text.length===0)){if(e.font=Dk(t),e.textAlign=t.align||`left`,i=kk(t),a=i.x1,o=i.y1,t.angle&&(e.save(),e.translate(a,o),e.rotate(t.angle*Jk),a=o=0),a+=t.dx||0,o+=(t.dy||0)+Ok(t),l=Ck(t),ZO(e,t),H(l))for(c=Sk(t),s=0;st;)e.removeChild(n[--r]);return e}function Xme(e){return`mark-`+e.marktype+(e.role?` role-`+e.role:``)+(e.name?` `+e.name:``)}function Ik(e,t){if(t.getScreenCTM){let n=Zme(e,t.getScreenCTM());if(n)return n}return Qme(e,t,t.getBoundingClientRect())}function Zme(e,t){if(!t)return null;let n=t.a*t.d-t.b*t.c;if(!n)return null;let r=e.clientX-t.e,i=e.clientY-t.f;return[(t.d*r-t.c*i)/n,(t.a*i-t.b*r)/n]}function Qme(e,t,n){let r=t.offsetWidth?n.width/t.offsetWidth:1,i=t.offsetHeight?n.height/t.offsetHeight:1;return[(e.clientX-n.left)/r-(t.clientLeft||0),(e.clientY-n.top)/i-(t.clientTop||0)]}function $me(e,t,n,r){var i=e&&e.mark,a,o;if(i&&(a=NA[i.marktype]).tip){for(o=Ik(t,n),o[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=a.tip(i.items,o)}return e}function ehe(e,t,n,r){e.element().setAttribute(`title`,r||``)}function the(e,t){Bge(t).forEach(t=>nhe(e,t))}function nhe(e,t){let n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}function Lk(e,t,n){t.forEach(t=>e.fire(t,n))}function rhe(e,t,n){return function(r){let i=this._active,a=this.pickEvent(r);a===i?Lk(this,e,r):((!i||!i.exit)&&Lk(this,n,r),this._active=a,Lk(this,t,r),Lk(this,e,r))}}function ihe(e){return function(t){Lk(this,e,t),this._active=null}}function ahe(){return typeof window<`u`&&window.devicePixelRatio||1}function ohe(e,t,n,r,i,a){let o=typeof HTMLElement<`u`&&e instanceof HTMLElement&&e.parentNode!=null,s=e.getContext(`2d`),c=o?ahe():i;e.width=t*c,e.height=n*c;for(let e in a)s[e]=a[e];return o&&c!==1&&(e.style.width=t+`px`,e.style.height=n+`px`),s.pixelRatio=c,s.setTransform(c,0,0,c,c*r[0],c*r[1]),e}function she(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}function che(e,t){let n=t.aria===!1;if(e(sj,n||void 0),n||t.description==null)for(let t in gj)e(gj[t],void 0);else{let n=t.mark.marktype;e(cj,t.description),e(lj,t.ariaRole||(n===`group`?dj:fj)),e(uj,t.ariaRoleDescription||`${n} mark`)}}function lhe(e){return e.aria===!1?{[sj]:!0}:mj[e.role]?null:hj[e.role]?dhe(e,hj[e.role]):uhe(e)}function uhe(e){let t=e.marktype,n=t===`group`||t===`text`||e.items.some(e=>e.description!=null&&e.aria!==!1);return pj(n?dj:fj,`${t} mark container`,e.description)}function dhe(e,t){try{let n=e.items[0],r=t.caption||(()=>``);return pj(t.role||fj,t.desc,e.description||n.description||r(n))}catch{return null}}function fhe(e){return _h(e.text).join(` `)}function phe(e){let t=e.datum,n=e.orient,r=t.title?hhe(e):null,i=e.context,a=i.scales[t.scale].value,o=i.dataflow.locale(),s=a.type;return`${n===`left`||n===`right`?`Y`:`X`}-axis`+(r?` titled '${r}'`:``)+` for a ${wD(s)?`discrete`:s} scale with ${GD(o,a,e)}`}function mhe(e){let t=e.datum,n=t.title?hhe(e):null,r=`${t.type||``} legend`.trim(),i=t.scales,a=Object.keys(i),o=e.context,s=o.scales[i[a[0]]].value,c=o.dataflow.locale();return _he(r)+(n?` titled '${n}'`:``)+` for ${ghe(a)} with ${GD(c,s,e)}`}function hhe(e){try{return _h(qm(e.items).items[0].text).join(` `)}catch{return null}}function ghe(e){return e=e.map(e=>e+(e===`fill`||e===`stroke`?` color`:``)),e.length<2?e[0]:e.slice(0,-1).join(`, `)+` and `+qm(e)}function _he(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Rk(){let e=``,t=``,n=``,r=[],i=()=>t=n=``,a=a=>{t&&(e+=`${t}>${n}`,i()),r.push(a)},o=(e,n)=>(n!=null&&(t+=` ${e}="${vj(n)}"`),s),s={open(e,...n){a(e),t=`<`+e;for(let e of n)for(let t in e)o(t,e[t]);return s},close(){let a=r.pop();return t?e+=t+(n?`>${n}`:`/>`):e+=``,i(),s},attr:o,text:e=>(n+=_j(e),s),toString:()=>e};return s}function vhe(e,t){if(e.open(t.tagName),t.hasAttributes()){let n=t.attributes,r=n.length;for(let t=0;t{i=e.mark(t,n,i,r),++a}),Fk(t,1+a)}function Che(e,t,n,r,i){let a=e._svg,o;if(!a&&(o=t.ownerDocument,a=Mk(o,r,Tj),e._svg=a,e.mark&&(a.__data__=e,a.__values__={fill:`default`},r===`g`))){let t=Mk(o,`path`,Tj);a.appendChild(t),t.__data__=e;let n=Mk(o,`g`,Tj);a.appendChild(n),n.__data__=e;let r=Mk(o,`path`,Tj);a.appendChild(r),r.__data__=e,r.__values__={fill:`default`}}return(a.ownerSVGElement!==i||whe(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}function whe(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}function zk(e,t,n){t!==Oj[e]&&(n?The(Dj,e,t,n):Hk(Dj,e,t),Oj[e]=t)}function Bk(e,t,n){n!==Oj[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+``),Oj[t]=n)}function Vk(e,t){for(let n in t)Hk(e,n,t[n])}function Hk(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function The(e,t,n,r){n==null?e.removeAttributeNS(r,t):e.setAttributeNS(r,t,n)}function Ehe(){let e;return typeof window>`u`?``:(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function Dhe(e,t,n,r,i){let a;if(t==null||(r===`bgrect`&&n.interactive===!1&&(e[`pointer-events`]=`none`),r===`bgfore`&&(n.interactive===!1&&(e[`pointer-events`]=`none`),e.display=`none`,t.fill!==null)))return e;r===`image`&&t.smooth===!1&&(a=[`image-rendering: optimizeSpeed;`,`image-rendering: pixelated;`]),r===`text`&&(e[`font-family`]=Ek(t),e[`font-size`]=xk(t)+`px`,e[`font-style`]=t.fontStyle,e[`font-variant`]=t.fontVariant,e[`font-weight`]=t.fontWeight);for(let n in bj){let r=t[n],a=bj[n];r===`transparent`&&(a===`fill`||a===`stroke`)||r!=null&&(jO(r)&&(r=Cpe(r,i.gradient,``)),e[a]=r)}for(let e in xj){let n=t[e];n!=null&&(a||=[],a.push(`${xj[e]}: ${n};`))}return a&&(e.style=a.join(` `)),e}function Ohe(e){jj.svgMarkTypes=e.svgMarkTypes??[`text`],jj.svgOnTop=e.svgOnTop??!0,jj.debug=e.debug??!1}function Uk(e,t){return e=String(e||``).toLowerCase(),arguments.length>1?(Bj[e]=t,this):Bj[e]}function khe(e,t,n){let r=[],i=new HO().union(t),a=e.marktype;return a?Ahe(e,i,n,r):a===`group`?Mhe(e,i,n,r):V(`Intersect scene must be mark node or group item.`)}function Ahe(e,t,n,r){if(jhe(e,t,n)){let i=e.items,a=e.marktype,o=i.length,s=0;if(a===`group`)for(;s=0;a--)if(n[a]!=r[a])return!1;for(a=n.length-1;a>=0;a--)if(i=n[a],!Wk(e[i],t[i],i))return!1;return typeof e==typeof t}function Lhe(){Wpe(),Spe()}var Gk,Kk,qk,Rhe,zhe,Bhe,Vhe,Hhe,Jk,Uhe,Yk,Xk,Zk,Qk,$k,eA,tA,nA,rA,iA,aA,oA,sA,Whe,Ghe,Khe,qhe,Jhe,Yhe,Xhe,Zhe,Qhe,$he,ege,tge,nge,rge,ige,age,cA,oge,sge,cge,lge,uge,dge,fge,pge,lA,uA,mge,dA,fA,pA,mA,hA,gA,_A,vA,yA,bA,xA,SA,CA,wA,TA,EA,hge,DA,OA,gge,_ge,vge,yge,bge,xge,Sge,kA,Cge,wge,Tge,Ege,Dge,Oge,kge,AA,jA,Age,MA,NA,PA,jge,FA,IA,LA,Mge,Nge,Pge,RA,zA,BA,VA,Fge,HA,UA,WA,GA,Ige,KA,qA,JA,YA,Lge,Rge,XA,ZA,QA,$A,zge,ej,tj,nj,rj,Bge,ij,Vge,aj,oj,sj,cj,lj,uj,dj,fj,pj,mj,hj,gj,_j,vj,yj,bj,xj,Sj,Cj,wj,Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj=o((()=>{dg(),Kde(),lC(),RC(),Sb(),AO(),Gk=0,Kk=`p_`,qk={basis:{curve:ide},"basis-closed":{curve:ode},"basis-open":{curve:lde},bundle:{curve:fde,tension:`beta`,value:.85},cardinal:{curve:mde,tension:`tension`,value:0},"cardinal-open":{curve:_de,tension:`tension`,value:0},"cardinal-closed":{curve:hde,tension:`tension`,value:0},"catmull-rom":{curve:bde,tension:`alpha`,value:.5},"catmull-rom-closed":{curve:Sde,tension:`alpha`,value:.5},"catmull-rom-open":{curve:Tde,tension:`alpha`,value:.5},linear:{curve:gC},"linear-closed":{curve:Ode},monotone:{horizontal:Ide,vertical:Fde},natural:{curve:Bde},step:{curve:Hde},"step-after":{curve:Wde},"step-before":{curve:Ude}},Rhe={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},zhe=/[mlhvzcsqta]([^mlhvzcsqta]*)/gi,Bhe=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Vhe=/^((\s+,?\s*)|(,\s*))/,Hhe=/^[01]/,Jk=Math.PI/180,Uhe=1e-14,Yk=Math.PI/2,Xk=Math.PI*2,Zk=Math.sqrt(3)/2,Qk={},$k={},eA=[].join,tA=[`l`,0,0,0,0,0,0,0],nA=.5773502691896257,rA={circle:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Xk)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/2.5;e.moveTo(-n,-r),e.lineTo(-n,r),e.lineTo(-r,r),e.lineTo(-r,n),e.lineTo(r,n),e.lineTo(r,r),e.lineTo(n,r),e.lineTo(n,-r),e.lineTo(r,-r),e.lineTo(r,-n),e.lineTo(-r,-n),e.lineTo(-r,-r),e.closePath()}},diamond:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/7,i=n/2.5,a=n/8;e.moveTo(-r,n),e.lineTo(r,n),e.lineTo(r,-a),e.lineTo(i,-a),e.lineTo(0,-n),e.lineTo(-i,-a),e.lineTo(-r,-a),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,r=Zk*n,i=r-n*nA,a=n/4;e.moveTo(0,-r-i),e.lineTo(-a,r-i),e.lineTo(a,r-i),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,r=Zk*n,i=r-n*nA;e.moveTo(0,-r-i),e.lineTo(-n,r-i),e.lineTo(n,r-i),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Zk*n;e.moveTo(0,-r),e.lineTo(-n,r),e.lineTo(n,r),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Zk*n;e.moveTo(0,r),e.lineTo(-n,-r),e.lineTo(n,-r),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Zk*n;e.moveTo(r,0),e.lineTo(-r,-n),e.lineTo(-r,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Zk*n;e.moveTo(-r,0),e.lineTo(r,-n),e.lineTo(r,n),e.closePath()}},stroke:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}},iA={},aA=.448084975506,oA=e=>e.x||0,sA=e=>e.y||0,Whe=e=>e.width||0,Ghe=e=>e.height||0,Khe=e=>(e.x||0)+(e.width||0),qhe=e=>(e.y||0)+(e.height||0),Jhe=e=>e.startAngle||0,Yhe=e=>e.endAngle||0,Xhe=e=>e.padAngle||0,Zhe=e=>e.innerRadius||0,Qhe=e=>e.outerRadius||0,$he=e=>e.cornerRadius||0,ege=e=>RO(e.cornerRadiusTopLeft,e.cornerRadius)||0,tge=e=>RO(e.cornerRadiusTopRight,e.cornerRadius)||0,nge=e=>RO(e.cornerRadiusBottomRight,e.cornerRadius)||0,rge=e=>RO(e.cornerRadiusBottomLeft,e.cornerRadius)||0,ige=e=>RO(e.size,64),age=e=>e.size||1,cA=e=>e.defined!==!1,oge=e=>Ape(e.shape||`circle`),sge=Jue().startAngle(Jhe).endAngle(Yhe).padAngle(Xhe).innerRadius(Zhe).outerRadius(Qhe).cornerRadius($he),cge=Que().x(oA).y1(sA).y0(qhe).defined(cA),lge=Que().y(sA).x1(oA).x0(Khe).defined(cA),uge=Xue().x(oA).y(sA).defined(cA),dge=Ipe().x(oA).y(sA).width(Whe).height(Ghe).cornerRadius(ege,tge,nge,rge),fge=nde().type(oge).size(ige),pge=Lpe().x(oA).y(sA).defined(cA).size(age),lA=1,HO.prototype={clone(){return new HO(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(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,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(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){let r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:a,y2:o}=this,s=Math.cos(e),c=Math.sin(e),l=t-t*s+n*c,u=n-t*c-n*s;return[s*r-c*i+l,c*r+s*i+u,s*r-c*o+l,c*r+s*o+u,s*a-c*i+l,c*a+s*i+u,s*a-c*o+l,c*a+s*o+u]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},U(WO,UO),uA=class{constructor(e){this._pending=0,this._loader=e||xb()}pending(){return this._pending}sanitizeURL(e){let t=this;return Gpe(t),t._loader.sanitize(e,{context:`href`}).then(e=>(GO(t),e)).catch(()=>(GO(t),null))}loadImage(e){let t=this,n=LC();return Gpe(t),t._loader.sanitize(e,{context:`image`}).then(e=>{let r=e.href;if(!r||!n)throw{url:r};let i=new n,a=Ph(e,`crossOrigin`)?e.crossOrigin:`anonymous`;return a!=null&&(i.crossOrigin=a),i.onload=()=>GO(t),i.onerror=()=>GO(t),i.src=r,i}).catch(e=>(GO(t),{complete:!1,width:0,height:0,src:e&&e.url||``}))}ready(){let e=this;return new Promise(t=>{function n(r){e.pending()?setTimeout(()=>{n(!0)},10):t(r)}n(!1)})}},mge=Xk-1e-8,yA=(e,t)=>dA.add(e,t),bA=(e,t)=>yA(fA=e,pA=t),xA=e=>yA(e,dA.y1),SA=e=>yA(dA.x1,e),CA=(e,t)=>hA*e+_A*t,wA=(e,t)=>gA*e+vA*t,TA=(e,t)=>yA(CA(e,t),wA(e,t)),EA=(e,t)=>bA(CA(e,t),wA(e,t)),hge={beginPath(){},closePath(){},moveTo:EA,lineTo:EA,rect(e,t,n,r){mA?(TA(e+n,t),TA(e+n,t+r),TA(e,t+r),EA(e,t)):(yA(e+n,t+r),bA(e,t))},quadraticCurveTo(e,t,n,r){let i=CA(e,t),a=wA(e,t),o=CA(n,r),s=wA(n,r);Kpe(fA,i,o,xA),Kpe(pA,a,s,SA),bA(o,s)},bezierCurveTo(e,t,n,r,i,a){let o=CA(e,t),s=wA(e,t),c=CA(n,r),l=wA(n,r),u=CA(i,a),d=wA(i,a);qpe(fA,o,c,u,xA),qpe(pA,s,l,d,SA),bA(u,d)},arc(e,t,n,r,i,a){if(r+=mA,i+=mA,fA=n*Math.cos(i)+e,pA=n*Math.sin(i)+t,Math.abs(i-r)>mge)yA(e-n,t-n),yA(e+n,t+n);else{let o=r=>yA(n*Math.cos(r)+e,n*Math.sin(r)+t),s,c;if(o(r),o(i),i!==r)if(r%=Xk,r<0&&(r+=Xk),i%=Xk,i<0&&(i+=Xk),ii;++c,s-=Yk)o(s);else for(s=r-r%Yk+Yk,c=0;c<4&&s=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1}handlers(e){let t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(let e in t)n.push(...t[e]);return n}eventName(e){let t=e.indexOf(`.`);return t<0?e:e.slice(0,t)}handleHref(e,t,n){this._loader.sanitize(n,{context:`href`}).then(t=>{let n=new MouseEvent(e.type,e),r=Mk(null,`a`);for(let e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)}).catch(()=>{})}handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=$me(t,e,this.canvas(),this._origin);let r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}}getItemBoundingClientRect(e){let t=this.canvas();if(!t)return;let n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,a=i.width(),o=i.height(),s=i.x1+r[0]+n.left,c=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,c+=e.y||0;return{x:s,y:c,width:a,height:o,left:s,top:c,right:s+a,bottom:c+o}}},LA=class{constructor(e){this._el=null,this._bgcolor=null,this._loader=new uA(e)}initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)}resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this}dirty(){}render(e,t){let n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n}_render(){}renderAsync(e,t){let n=this.render(e,t);return this._ready?this._ready.then(()=>n):Promise.resolve(n)}_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){let e=n._call;n._ready=n._loader.ready().then(t=>{t&&e(),n._ready=null})}return r}sanitizeURL(e){return this._load(`sanitizeURL`,e)}loadImage(e){return this._load(`loadImage`,e)}},Mge=`keydown`,Nge=`keypress`,Pge=`keyup`,RA=`dragenter`,zA=`dragleave`,BA=`dragover`,VA=`pointerdown`,Fge=`pointerup`,HA=`pointermove`,UA=`pointerout`,WA=`pointerover`,GA=`mousedown`,Ige=`mouseup`,KA=`mousemove`,qA=`mouseout`,JA=`mouseover`,YA=`click`,Lge=`dblclick`,Rge=`wheel`,XA=`mousewheel`,ZA=`touchstart`,QA=`touchmove`,$A=`touchend`,zge=[Mge,Nge,Pge,RA,zA,BA,VA,Fge,HA,UA,WA,GA,Ige,KA,qA,JA,YA,Lge,Rge,XA,ZA,QA,$A],ej=HA,tj=qA,nj=YA,rj=class extends IA{constructor(e,t){super(e,t),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=zge,this.pointermove=rhe([HA,KA],[WA,JA],[UA,qA]),this.dragover=rhe([BA],[RA],[zA]),this.pointerout=ihe([UA,qA]),this.dragleave=ihe([zA])}initialize(e,t,n){return this._canvas=e&&Nk(e,`canvas`),[YA,GA,VA,HA,UA,zA].forEach(e=>the(this,e)),super.initialize(e,t,n)}canvas(){return this._canvas}context(){return this._canvas.getContext(`2d`)}DOMMouseScroll(e){this.fire(XA,e)}pointerdown(e){this._down=this._active,this.fire(VA,e)}mousedown(e){this._down=this._active,this.fire(GA,e)}click(e){this._down===this._active&&(this.fire(YA,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&=(this._active=this._touch,!1),this.fire(ZA,e,!0)}touchmove(e){this.fire(QA,e,!0)}touchend(e){this.fire($A,e,!0),this._touch=null}fire(e,t,n){let r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===nj&&r&&r.href?this.handleHref(t,r,r.href):(e===ej||e===tj)&&this.handleTooltip(t,r,e!==tj),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this}pickEvent(e){let t=Ik(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])}pick(e,t,n,r,i){let a=this.context();return NA[e.marktype].pick.call(this,a,e,t,n,r,i)}},Bge=e=>e===ZA||e===QA||e===$A?[ZA,QA,$A]:[e],ij=class extends LA{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new HO,this._tempb=new HO}initialize(e,t,n,r,i,a){return this._options=a||{},this._canvas=this._options.externalContext?null:IC(1,1,this._options.type),e&&this._canvas&&(Fk(e,0).appendChild(this._canvas),this._canvas.setAttribute(`class`,`marks`)),super.initialize(e,t,n,r,i)}resize(e,t,n,r){if(super.resize(e,t,n,r),this._canvas)ohe(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{let e=this._options.externalContext;e||V(`CanvasRenderer is missing a valid canvas or context`),e.scale(this._scale,this._scale),e.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(e){let t=this._tempb.clear().union(e.bounds),n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)}_render(e,t){let n=this.context(),r=this._origin,i=this._width,a=this._height,o=this._dirty,s=Vge(r,i,a);n.save();let c=this._redraw||o.empty()?(this._redraw=!1,s.expand(1)):she(n,s.intersect(o),r);return this.clear(-r[0],-r[1],i,a),this.draw(n,e,c,t),n.restore(),o.clear(),this}draw(e,t,n,r){if(t.marktype!==`group`&&r!=null&&!r.includes(t.marktype))return;let i=NA[t.marktype];t.clip&&ume(e,t),i.draw.call(this,e,t,n,r),t.clip&&e.restore()}clear(e,t,n,r){let i=this._options,a=this.context();i.type!==`pdf`&&!i.externalContext&&a.clearRect(e,t,n,r),this._bgcolor!=null&&(a.fillStyle=this._bgcolor,a.fillRect(e,t,n,r))}},Vge=(e,t,n)=>new HO().set(0,0,t,n).translate(-e[0],-e[1]),aj=class extends IA{constructor(e,t){super(e,t);let n=this;n._hrefHandler=oj(n,(e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=oj(n,(e,t)=>{n.handleTooltip(e,t,e.type!==tj)})}initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(nj,this._hrefHandler),r.removeEventListener(ej,this._tooltipHandler),r.removeEventListener(tj,this._tooltipHandler)),this._svg=r=e&&Nk(e,`svg`),r&&(r.addEventListener(nj,this._hrefHandler),r.addEventListener(ej,this._tooltipHandler),r.addEventListener(tj,this._tooltipHandler)),super.initialize(e,t,n)}canvas(){return this._svg}on(e,t){let n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){let i={type:e,handler:t,listener:oj(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this}off(e,t){let n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}},oj=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)},sj=`aria-hidden`,cj=`aria-label`,lj=`role`,uj=`aria-roledescription`,dj=`graphics-object`,fj=`graphics-symbol`,pj=(e,t,n)=>({[lj]:e,[uj]:t,[cj]:n||void 0}),mj=cg([`axis-domain`,`axis-grid`,`axis-label`,`axis-tick`,`axis-title`,`legend-band`,`legend-entry`,`legend-gradient`,`legend-label`,`legend-title`,`legend-symbol`,`title`]),hj={axis:{desc:`axis`,caption:phe},legend:{desc:`legend`,caption:mhe},"title-text":{desc:`title`,caption:e=>`Title text '${fhe(e)}'`},"title-subtitle":{desc:`subtitle`,caption:e=>`Subtitle text '${fhe(e)}'`}},gj={ariaRole:lj,ariaRoleDescription:uj,description:cj},_j=e=>(e+``).replace(/&/g,`&`).replace(//g,`>`),vj=e=>_j(e).replace(/"/g,`"`).replace(/\t/g,` `).replace(/\n/g,` `).replace(/\r/g,` `),yj=e=>vhe(Rk(),e)+``,bj={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`},xj={blend:`mix-blend-mode`},Sj={fill:`none`,"stroke-miterlimit":4},Cj=0,wj=`http://www.w3.org/2000/xmlns/`,Tj=kA.xmlns,Ej=class extends LA{constructor(e){super(e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=Pk(e,0,`svg`,Tj),this._svg.setAttributeNS(wj,`xmlns`,Tj),this._svg.setAttributeNS(wj,`xmlns:xlink`,kA[`xmlns:xlink`]),this._svg.setAttribute(`version`,kA.version),this._svg.setAttribute(`class`,`marks`),Fk(e,1),this._root=Pk(this._svg,Cj,`g`,Tj),Vk(this._root,Sj),Fk(this._svg,1)),this.background(this._bgcolor),super.initialize(e,t,n,r,i)}background(e){return arguments.length&&this._svg&&this._svg.style.setProperty(`background-color`,e),super.background(...arguments)}resize(e,t,n,r){return super.resize(e,t,n,r),this._svg&&(Vk(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(){let e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute(`style`),n=Pk(e,Cj,`rect`,Tj),Vk(n,{width:this._width,height:this._height,fill:t}));let r=yj(e);return t&&(e.removeChild(n),this._svg.style.setProperty(`background-color`,t)),r}_render(e,t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e,void 0,t),Fk(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))}isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;let e=this._dirty;if(!e.length||!this._dirtyID)return!0;let t=++this._dirtyID,n,r,i,a,o,s,c;for(o=0,s=e.length;o{e.dirty=t})),!r.zdirty){if(n.exit){a.nested&&r.items.length?(c=r.items[0],c._svg&&this._update(a,c._svg,c)):n._svg&&(c=n._svg.parentNode,c&&c.removeChild(n._svg)),n._svg=null;continue}n=a.nested?r.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,yhe(n,t)):this._update(a,n._svg,n),n._update=t)}return!this._dirtyAll}mark(e,t,n,r){if(!this.isDirty(t))return t._svg;let i=this._svg,a=t.marktype,o=NA[a],s=t.interactive===!1?`none`:null,c=o.tag===`g`,l=Che(t,e,n,`g`,i);if(a!==`group`&&r!=null&&!r.includes(a))return Fk(l,0),t._svg;l.setAttribute(`class`,Xme(t));let u=lhe(t);for(let e in u)Hk(l,e,u[e]);c||Hk(l,`pointer-events`,s),Hk(l,`clip-path`,t.clip?VO(this,t,t.group):null);let d=null,f=0,p=e=>{let t=this.isDirty(e),n=Che(e,l,d,o.tag,i);t&&(this._update(o,n,e),c&&She(this,n,e,r)),d=n,++f};return o.nested?t.items.length&&p(t.items[0]):nk(t,p),Fk(l,f),l}_update(e,t,n){Dj=t,Oj=t.__values__,che(zk,n),e.attr(zk,n,this);let r=kj[e.type];r&&r.call(this,e,t,n),Dj&&this.style(Dj,n)}style(e,t){if(t!=null){for(let n in bj){let r=n===`font`?Ek(t):t[n];if(r===Oj[n])continue;let i=bj[n];r==null?e.removeAttribute(i):(jO(r)&&(r=Cpe(r,this._defs.gradient,Ehe())),e.setAttribute(i,r+``)),Oj[n]=r}for(let n in xj)Bk(e,xj[n],t[n])}}defs(){let e=this._svg,t=this._defs,n=t.el,r=0;for(let i in t.gradient)n||(t.el=n=Pk(e,1,`defs`,Tj)),r=bhe(n,t.gradient[i],r);for(let i in t.clipping)n||(t.el=n=Pk(e,1,`defs`,Tj)),r=xhe(n,t.clipping[i],r);n&&(r===0?(e.removeChild(n),t.el=null):Fk(n,r))}_clearDefs(){let e=this._defs;e.gradient={},e.clipping={}}},Dj=null,Oj=null,kj={group(e,t,n){let r=Dj=t.childNodes[2];Oj=r.__values__,e.foreground(zk,n,this),Oj=t.__values__,Dj=t.childNodes[1],e.content(zk,n,this);let i=Dj=t.childNodes[0];e.background(zk,n,this);let a=n.mark.interactive===!1?`none`:null;if(a!==Oj.events&&(Hk(r,`pointer-events`,a),Hk(i,`pointer-events`,a),Oj.events=a),n.strokeForeground&&n.stroke){let e=n.fill;Hk(r,`display`,null),this.style(i,n),Hk(i,`stroke`,null),e&&(n.fill=null),Oj=r.__values__,this.style(r,n),e&&(n.fill=e),Dj=null}else Hk(r,`display`,`none`)},image(e,t,n){n.smooth===!1?(Bk(t,`image-rendering`,`optimizeSpeed`),Bk(t,`image-rendering`,`pixelated`)):Bk(t,`image-rendering`,null)},text(e,t,n){let r=Ck(n),i,a,o,s;H(r)?(a=r.map(e=>Tk(n,e)),i=a.join(` +`),i!==Oj.text&&(Fk(t,0),o=t.ownerDocument,s=Sk(n),a.forEach((e,r)=>{let i=Mk(o,`tspan`,Tj);i.__data__=n,i.textContent=e,r&&(i.setAttribute(`x`,0),i.setAttribute(`dy`,s)),t.appendChild(i)}),Oj.text=i)):(a=Tk(n,r),a!==Oj.text&&(t.textContent=a,Oj.text=a)),Hk(t,`font-family`,Ek(n)),Hk(t,`font-size`,xk(n)+`px`),Hk(t,`font-style`,n.fontStyle),Hk(t,`font-variant`,n.fontVariant),Hk(t,`font-weight`,n.fontWeight)}},Aj=class extends LA{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){let t=Rk();t.open(`svg`,Ah({},kA,{class:`marks`,width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));let n=this._bgcolor;return n&&n!==`transparent`&&n!==`none`&&t.open(`rect`,{width:this._width,height:this._height,fill:n}).close(),t.open(`g`,Sj,{transform:`translate(`+this._origin+`)`}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+``,this}mark(e,t){let n=NA[t.marktype],r=n.tag,i=[che,n.attr];e.open(`g`,{class:Xme(t),"clip-path":t.clip?VO(this,t,t.group):null},lhe(t),{"pointer-events":r!==`g`&&t.interactive===!1?`none`:null});let a=a=>{let o=this.href(a);if(o&&e.open(`a`,o),e.open(r,this.attr(t,a,i,r===`g`?null:r)),r===`text`){let t=Ck(a);if(H(t)){let n={x:0,dy:Sk(a)};for(let r=0;rthis.mark(e,t)),e.close(),r&&o?(i&&(a.fill=null),a.stroke=o,e.open(`path`,this.attr(t,a,n.foreground,`bgrect`)).close(),i&&(a.fill=i)):e.open(`path`,this.attr(t,a,n.foreground,`bgfore`)).close()}e.close(),o&&e.close()};return n.nested?t.items&&t.items.length&&a(t.items[0]):nk(t,a),e.close()}href(e){let t=e.href,n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(e=>{e[`xlink:href`]=e.href,e.href=null,(this._hrefs||={})[t]=e})}return null}attr(e,t,n,r){let i={},a=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach(e=>e(a,t,this)):n(a,t,this),r&&Dhe(i,t,e,r,this._defs),i}defs(e){let t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open(`defs`);for(let n in t){let r=t[n],i=r.stops;r.gradient===`radial`?(e.open(`pattern`,{id:Kk+n,viewBox:`0,0,1,1`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid slice`}),e.open(`rect`,{width:`1`,height:`1`,fill:`url(#`+n+`)`}).close(),e.close(),e.open(`radialGradient`,{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open(`linearGradient`,{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t!jj.svgMarkTypes.includes(e));this._svgRenderer.render(e,jj.svgMarkTypes),this._canvasRenderer.render(e,n)}resize(e,t,n,r){return super.resize(e,t,n,r),this._svgRenderer.resize(e,t,n,r),this._canvasRenderer.resize(e,t,n,r),this}background(e){return jj.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}},Nj=class extends rj{constructor(e,t){super(e,t)}initialize(e,t,n){let r=Pk(Pk(e,0,`div`),+!jj.svgOnTop,`div`);return super.initialize(r,t,n)}},Pj=`canvas`,Fj=`hybrid`,Ij=`png`,Lj=`svg`,Rj=`none`,zj={Canvas:Pj,PNG:Ij,SVG:Lj,Hybrid:Fj,None:Rj},Bj={},Bj[Pj]=Bj[Ij]={renderer:ij,headless:ij,handler:rj},Bj[Lj]={renderer:Ej,headless:Aj,handler:aj},Bj[Fj]={renderer:Mj,headless:Mj,handler:Nj},Bj[Rj]={},Vj=new HO,Hj=1e-9})),Hge=c({bound:()=>Wj,identifier:()=>Kj,mark:()=>qj,overlap:()=>Jj,render:()=>Yj,viewlayout:()=>aM});function Wj(e){G.call(this,null,e)}function Gj(e,t,n){return t(e.bounds.clear(),e,n)}function Kj(e){G.call(this,0,e)}function Uge(e){return e._signals[WM]||(e._signals[WM]=e.add(0))}function qj(e){G.call(this,null,e)}function Wge(e){let t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function Jj(e){G.call(this,null,e)}function Yj(e){G.call(this,null,e)}function Xj(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Gge(e){var t=e.items[0].orient;return t===sM||t===cM}function Kge(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function qge(e,t,n,r){var i=t.items[0],a=i.datum,o=i.translate==null?.5:i.translate,s=i.orient,c=Kge(a),l=i.range,u=i.offset,d=i.position,f=i.minExtent,p=i.maxExtent,m=a.title&&i.items[c[2]].items[0],h=i.titlePadding,g=i.bounds,_=m&&wk(m),v=0,y=0,b,x;switch(QM.clear().union(g),g.clear(),(b=c[0])>-1&&g.union(i.items[b].bounds),(b=c[1])>-1&&g.union(i.items[b].bounds),s){case oM:v=d||0,y=-u,x=Math.max(f,Math.min(p,-g.y1)),g.add(0,-x).add(l,0),m&&Zj(e,m,x,h,_,0,-1,g);break;case sM:v=-u,y=d||0,x=Math.max(f,Math.min(p,-g.x1)),g.add(-x,0).add(0,l),m&&Zj(e,m,x,h,_,1,-1,g);break;case cM:v=n+u,y=d||0,x=Math.max(f,Math.min(p,g.x2)),g.add(0,0).add(x,l),m&&Zj(e,m,x,h,_,1,1,g);break;case lM:v=d||0,y=r+u,x=Math.max(f,Math.min(p,g.y2)),g.add(0,0).add(l,x),m&&Zj(e,m,x,h,0,0,1,g);break;default:v=i.x,y=i.y}return KO(g.translate(v,y),i),Xj(i,`x`,v+o)|Xj(i,`y`,y+o)&&(i.bounds=QM,e.dirty(i),i.bounds=g,e.dirty(i)),i.mark.bounds.clear().union(g)}function Zj(e,t,n,r,i,a,o,s){let c=t.bounds;if(t.auto){let s=o*(n+i+r),l=0,u=0;e.dirty(t),a?l=(t.x||0)-(t.x=s):u=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(c.translate(-l,-u)),e.dirty(t)}s.union(c)}function Jge(e){var t=e.items,n=t.length,r=0,i,a;let o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(C=0;C0&&(y[C]+=A/2);if(s&&Qj(n.center,UM)&&u!==1)for(C=0;C0&&(b[C]+=j/2);for(C=0;Ci&&(e.warn(`Grid headers exceed limit: `+i),t=t.slice(0,i)),h+=a,v=0,b=t.length;v=0&&(C=n[y])==null;y-=f);s?(w=p==null?C.x:Math.round(C.bounds.x1+p*C.bounds.width()),T=h):(w=h,T=p==null?C.y:Math.round(C.bounds.y1+p*C.bounds.height())),x.union(S.bounds.translate(w-(S.x||0),T-(S.y||0))),S.x=w,S.y=T,e.dirty(S),g=o(g,x[l])}return g}function nM(e,t,n,r,i,a){if(t){e.dirty(t);var o=n,s=n;r?o=Math.round(i.x1+a*i.width()):s=Math.round(i.y1+a*i.height()),t.bounds.translate(o-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=s,e.dirty(t)}}function e_e(e,t){let n=e[t]||{};return(t,r)=>n[t]==null?e[t]==null?r:e[t]:n[t]}function t_e(e,t){let n=-1/0;return e.forEach(e=>{e.offset!=null&&(n=Math.max(n,e.offset))}),n>-1/0?n:t}function n_e(e,t,n,r,i,a,o){let s=e_e(n,t),c=t_e(e,s(`offset`,0)),l=s(`anchor`,mM),u=s(`frame`,yM),d=l===gM?1:l===hM?.5:0,f=u===bM?r.x1+d*r.width():d*(a||i.width()+2*i.x1),p=u===bM?i.y1+d*i.height():d*(o||r.height()+2*r.y1),m={align:BM,bounds:s(`bounds`,VM),columns:s(`direction`)===`vertical`?1:e.length,padding:s(`margin`,8),center:s(`center`),nodirty:!0};switch(t){case sM:m.anchor={x:Math.floor(r.x1)-c,column:gM,y:p,row:l};break;case cM:m.anchor={x:Math.ceil(r.x2)+c,y:p,row:l};break;case oM:m.anchor={y:Math.floor(i.y1)-c,row:gM,x:f,column:l};break;case lM:m.anchor={y:Math.ceil(i.y2)+c,x:f,column:l};break;case uM:m.anchor={x:c,y:c};break;case dM:m.anchor={x:a-c,y:c,column:gM};break;case fM:m.anchor={x:c,y:o-c,row:gM};break;case pM:m.anchor={x:a-c,y:o-c,column:gM,row:gM};break}return m}function r_e(e,t){var n=t.items[0],r=n.datum,i=n.orient,a=n.bounds,o=n.x,s=n.y,c,l;return n._bounds?n._bounds.clear().union(a):n._bounds=a.clone(),a.clear(),a_e(e,n,n.items[0].items[0]),a=i_e(n,a),c=2*n.padding,l=2*n.padding,a.empty()||(c=Math.ceil(a.width()+c),l=Math.ceil(a.height()+l)),r.type===NM&&o_e(n.items[0].items[0].items[0].items),i!==RM&&(n.x=o=0,n.y=s=0),n.width=c,n.height=l,KO(a.set(o,s,o+c,s+l),n),n.mark.bounds.clear().union(a),n}function i_e(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.empty()&&(t.x2=e.padding,t.y2=e.padding),t.x1=e.padding,t.y1=e.padding,t}function a_e(e,t,n){var r=t.padding,i=r-n.x,a=r-n.y;if(!t.datum.title)(i||a)&&iM(e,n,i,a);else{var o=t.items[1].items[0],s=o.anchor,c=t.titlePadding||0,l=r-o.x,u=r-o.y;switch(o.orient){case sM:i+=Math.ceil(o.bounds.width())+c;break;case cM:case lM:break;default:a+=o.bounds.height()+c}switch((i||a)&&iM(e,n,i,a),o.orient){case sM:u+=rM(t,n,o,s,1,1);break;case cM:l+=rM(t,n,o,gM,0,0)+c,u+=rM(t,n,o,s,1,1);break;case lM:l+=rM(t,n,o,s,0,0),u+=rM(t,n,o,gM,-1,0,1)+c;break;default:l+=rM(t,n,o,s,0,0)}(l||u)&&iM(e,o,l,u),(l=Math.round(o.bounds.x1-r))<0&&(iM(e,n,-l,0),iM(e,o,-l,0))}}function rM(e,t,n,r,i,a,o){let s=e.datum.type!==`symbol`,c=n.datum.vgrad,l=(s&&(a||!c)&&!o?t.items[0]:t).bounds[i?`y2`:`x2`]-e.padding,u=c&&a?l:0,d=c&&a?0:l,f=i<=0?0:wk(n);return Math.round(r===mM?u:r===gM?d-f:.5*(l-f))}function iM(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function o_e(e){let t=e.reduce((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e),{});e.forEach(e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y})}function s_e(e,t,n,r,i){var a=t.items[0],o=a.frame,s=a.orient,c=a.anchor,l=a.offset,u=a.padding,d=a.items[0].items[0],f=a.items[1]&&a.items[1].items[0],p=s===sM||s===cM?r:n,m=0,h=0,g=0,_=0,v=0,y;if(o===yM?s===sM&&(m=r,p=0):s===sM?(m=i.y2,p=i.y1):s===cM?(m=i.y1,p=i.y2):(m=i.x1,p=i.x2),y=c===mM?m:c===gM?p:(m+p)/2,f&&f.text){switch(s){case oM:case lM:v=d.bounds.height()+u;break;case sM:_=d.bounds.width()+u;break;case cM:_=-d.bounds.width()-u;break}QM.clear().union(f.bounds),QM.translate(_-(f.x||0),v-(f.y||0)),Xj(f,`x`,_)|Xj(f,`y`,v)&&(e.dirty(f),f.bounds.clear().union(QM),f.mark.bounds.clear().union(QM),e.dirty(f)),QM.clear().union(f.bounds)}else QM.clear();switch(QM.union(d.bounds),s){case oM:h=y,g=i.y1-QM.height()-l;break;case sM:h=i.x1-QM.width()-l,g=y;break;case cM:h=i.x2+QM.width()+l,g=y;break;case lM:h=y,g=i.y2+l;break;default:h=a.x,g=a.y}return Xj(a,`x`,h)|Xj(a,`y`,g)&&(QM.translate(h,g),e.dirty(a),a.bounds.clear().union(QM),t.bounds.clear().union(QM),e.dirty(a)),a.bounds}function aM(e){G.call(this,null,e)}function c_e(e){return e&&e.mark.role!==`legend-entry`}function l_e(e,t,n){var r=t.items,i=Math.max(0,t.width||0),a=Math.max(0,t.height||0),o=new HO().set(0,0,i,a),s=o.clone(),c=o.clone(),l=[],u,d,f,p,m,h;for(m=0,h=r.length;m{f=e.orient||cM,f!==RM&&(t[f]||(t[f]=[])).push(e)});for(let r in t){let o=t[r];eM(e,o,n_e(o,r,n.legends,s,c,i,a))}l.forEach(t=>{let r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),n.autosize&&(n.autosize.type===PM||n.autosize.type===FM||n.autosize.type===IM))switch(t.orient){case sM:case cM:o.add(r.x1,0).add(r.x2,0);break;case oM:case lM:o.add(0,r.y1).add(0,r.y2)}else o.union(r)})}o.union(s).union(c),u&&o.union(s_e(e,u,i,a,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),u_e(e,t,o,n)}function u_e(e,t,n,r){let i=r.autosize||{},a=i.type;if(e._autosize<1||!a)return;let o=e._width,s=e._height,c=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,t.height||0),d=Math.max(0,Math.ceil(-n.y1)),f=Math.max(0,Math.ceil(n.x2-c)),p=Math.max(0,Math.ceil(n.y2-u));if(i.contains===MM){let t=e.padding();o-=t.left+t.right,s-=t.top+t.bottom}a===RM?(l=0,d=0,c=o,u=s):a===PM?(c=Math.max(0,o-l-f),u=Math.max(0,s-d-p)):a===FM?(c=Math.max(0,o-l-f),s=u+d+p):a===IM?(o=c+l+f,u=Math.max(0,s-d-p)):a===LM&&(o=c+l+f,s=u+d+p),e._resizeView(o,s,c,u,[l,d],i.resize)}var oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM,qM,JM,YM,XM,ZM,QM,$M,eN,d_e=o((()=>{nx(),Uj(),dg(),oM=`top`,sM=`left`,cM=`right`,lM=`bottom`,uM=`top-left`,dM=`top-right`,fM=`bottom-left`,pM=`bottom-right`,mM=`start`,hM=`middle`,gM=`end`,_M=`x`,vM=`y`,yM=`group`,bM=`bounds`,xM=`axis`,SM=`title`,CM=`frame`,wM=`scope`,TM=`legend`,EM=`row-header`,DM=`row-footer`,OM=`row-title`,kM=`column-header`,AM=`column-footer`,jM=`column-title`,MM=`padding`,NM=`symbol`,PM=`fit`,FM=`fit-x`,IM=`fit-y`,LM=`pad`,RM=`none`,zM=`all`,BM=`each`,VM=`flush`,HM=`column`,UM=`row`,U(Wj,G,{transform(e,t){let n=t.dataflow,r=e.mark,i=r.marktype,a=NA[i],o=a.bound,s=r.bounds,c;if(a.nested)r.items.length&&n.dirty(r.items[0]),s=Gj(r,o),r.items.forEach(e=>{e.bounds.clear().union(s)});else if(i===yM||e.modified())switch(t.visit(t.MOD,e=>n.dirty(e)),s.clear(),r.items.forEach(e=>s.union(Gj(e,o))),r.role){case xM:case TM:case SM:t.reflow()}else c=t.changed(t.REM),t.visit(t.ADD,e=>{s.union(Gj(e,o))}),t.visit(t.MOD,e=>{c||=s.alignsWith(e.bounds),n.dirty(e),s.union(Gj(e,o))}),c&&(s.clear(),r.items.forEach(e=>s.union(e.bounds)));return Phe(r),t.modifies(`bounds`)}}),WM=`:vega_identifier:`,Kj.Definition={type:`Identifier`,metadata:{modifies:!0},params:[{name:`as`,type:`string`,required:!0}]},U(Kj,G,{transform(e,t){let n=Uge(t.dataflow),r=e.as,i=n.value;return t.visit(t.ADD,e=>e[r]=e[r]||++i),n.set(this.value=i),t}}),U(qj,G,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,Wge(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);let r=n.marktype===yM?WO:UO;return t.visit(t.ADD,e=>r.call(e,n)),(e.modified(`clip`)||e.modified(`interactive`))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}}),GM={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((e,r)=>!r||!KM(n.bounds,e.bounds,t)?(n=e,1):e.opacity=0)}},KM=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),qM=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,a;n{let t=e.bounds;return t.width()>1&&t.height()>1},YM=(e,t,n)=>{var r=e.range(),i=new HO;return t===oM||t===lM?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),e=>i.encloses(e.bounds)},XM=e=>(e.forEach(e=>e.opacity=1),e),ZM=(e,t)=>e.reflow(t.modified()).modifies(`opacity`),U(Jj,G,{transform(e,t){let n=GM[e.method]||GM.parity,r=e.separation||0,i=t.materialize(t.SOURCE).source,a,o;if(!i||!i.length)return;if(!e.method)return e.modified(`method`)&&(XM(i),t=ZM(t,e)),t;if(i=i.filter(JM),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),a=XM(i),t=ZM(t,e),a.length>=3&&qM(a,r)){do a=n(a,r);while(a.length>=3&&qM(a,r));a.length<3&&!qm(i).opacity&&(a.length>1&&(qm(a).opacity=0),qm(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=YM(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(e=>{o(e)||(e.opacity=0)}));let s=a[0].mark.bounds.clear();return i.forEach(e=>{e.opacity&&s.union(e.bounds)}),t}}),U(Yj,G,{transform(e,t){let n=t.dataflow;if(t.visit(t.ALL,e=>n.dirty(e)),t.fields&&t.fields.zindex){let e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}}),QM=new HO,$M=(e,t)=>Math.floor(Math.min(e,t)),eN=(e,t)=>Math.ceil(Math.max(e,t)),U(aM,G,{transform(e,t){let n=t.dataflow;return e.mark.items.forEach(t=>{e.layout&&Zge(n,t,e.layout),l_e(n,t,e)}),c_e(e.mark.group)?t.reflow():t}})})),f_e=c({axisticks:()=>tN,datajoin:()=>nN,encode:()=>rN,legendentries:()=>iN,linkpath:()=>aN,pie:()=>oN,scale:()=>cN,sortitems:()=>fN,stack:()=>pN});function tN(e){G.call(this,null,e)}function nN(e){G.call(this,null,e)}function p_e(){return Db({})}function m_e(e){let t=Ih().test(e=>e.exit);return t.lookup=n=>t.get(e(n)),t}function rN(e){G.call(this,null,e)}function iN(e){G.call(this,[],e)}function aN(e){G.call(this,{},e)}function oN(e){G.call(this,null,e)}function h_e(e){let t=e.type;return!e.bins&&(t===`linear`||t===`pow`||t===`sqrt`)}function sN(e){return CD(e)&&e!==`sequential`}function cN(e){G.call(this,null,e),this.modified(!0)}function g_e(e){var t=e.type,n=``,r;return t===`sequential`?ZD+`-`+qD:(__e(e)&&(r=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=r===2?ZD+`-`:r===3?QD+`-`:``),(n+t||`linear`).toLowerCase())}function __e(e){let t=e.type;return CD(t)&&t!==`time`&&t!==`utc`&&(e.scheme||e.range&&e.range.length&&e.range.every(qh))}function v_e(e,t,n){let r=y_e(e,t.domainRaw,n);if(r>-1)return r;var i=t.domain,a=e.type,o=t.zero||t.zero===void 0&&h_e(e),s,c;if(!i)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(s=(i=i.slice()).length-1||1,o&&(i[0]>0&&(i[0]=0),i[s]<0&&(i[s]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[s]=t.domainMax),t.domainMid!=null)){c=t.domainMid;let e=c>i[s]?s+1:ce+(t<0?-1:+(t>0)),0))!==t.length&&n.warn(`Log scale domain includes zero: `+W(t)),t}function x_e(e,t,n){let r=t.bins;if(r&&!H(r)){let t=e.domain(),n=t[0],i=qm(t),a=r.step,o=r.start==null?n:r.start,s=r.stop==null?i:r.stop;a||V(`Scale bins parameter missing step property.`),oi&&(s=a*Math.floor(i/a)),r=f_(o,s+a/2,a)}return r?e.bins=r:e.bins&&delete e.bins,e.type===`bin-ordinal`&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function S_e(e,t,n){var r=e.type,i=t.round||!1,a=t.range;if(t.rangeStep!=null)a=C_e(r,t,n);else if(t.scheme&&(a=w_e(r,t,n),bh(a))){if(e.interpolator)return e.interpolator(a);V(`Scale type ${r} does not support interpolating color schemes.`)}if(a&&OD(r))return e.interpolator(jD(dN(a,t.reverse),t.interpolate,t.interpolateGamma));a&&t.interpolate&&e.interpolate?e.interpolate(PD(t.interpolate,t.interpolateGamma)):bh(e.round)?e.round(i):bh(e.rangeRound)&&e.interpolate(i?zT:LT),a&&e.range(dN(a,t.reverse))}function C_e(e,t,n){e!==`band`&&e!==`point`&&V(`Only band and point scales support rangeStep.`);var r=(t.paddingOuter==null?t.padding:t.paddingOuter)||0,i=e===`point`?1:(t.paddingInner==null?t.padding:t.paddingInner)||0;return[0,t.rangeStep*mD(n,i,r)]}function w_e(e,t,n){var r=t.schemeExtent,i,a;return H(t.scheme)?a=jD(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),a=LD(i),a||V(`Unrecognized scheme name: ${t.scheme}`)),n=e===`threshold`?n+1:e===`bin-ordinal`?n-1:e===`quantile`||e===`quantize`?+t.schemeCount||jN:n,OD(e)?uN(a,r,t.reverse):bh(a)?MD(uN(a,r),n):e===`ordinal`?a:a.slice(0,n)}function uN(e,t,n){return bh(e)&&(t||n)?AD(e,dN(t||[0,1],n)):e}function dN(e,t){return t?e.slice().reverse():e}function fN(e){G.call(this,null,e)}function pN(e){G.call(this,null,e)}function T_e(e,t,n,r,i){for(var a=(t-e.sum)/2,o=e.length,s=0,c;se(u),o,s,c,l,u,d,f,p,m;if(t==null)i.push(e.slice());else for(o={},s=0,c=e.length;sm&&(m=p),n&&f.sort(n)}return i.max=m,i}var mN,hN,gN,_N,vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN,PN,FN,IN,k_e=o((()=>{nx(),AO(),dg(),m_(),oE(),U(tN,G,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,a=e.scale,o=RD(a,e.count==null?e.values?e.values.length:10:e.count,e.minstep),s=e.format||VD(n,a,o,e.formatSpecifier,e.formatType,!!e.values),c=e.values?zD(a,e.values,o):BD(a,o);return i&&(r.rem=i),i=c.map((e,t)=>Db({index:t/(c.length-1||1),tickIndex:t,value:e,label:s(e)})),e.extra&&i.length&&i.push(Db({index:-1,tickIndex:-1,extra:{value:i[0].value},label:``})),r.source=i,r.add=i,this.value=i,r}}),U(nN,G,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||p_e,a=e.key||Eb,o=this.value;return H(r.encode)&&(r.encode=null),o&&(e.modified(`key`)||t.modified(a))&&V(`DataJoin does not support modified key function or fields.`),o||(t=t.addAll(),this.value=o=m_e(a)),t.visit(t.ADD,e=>{let t=a(e),n=o.get(t);n?n.exit?(o.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),o.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1}),t.visit(t.MOD,e=>{let t=a(e),n=o.get(t);n&&(n.datum=e,r.mod.push(n))}),t.visit(t.REM,e=>{let t=a(e),n=o.get(t);e===n.datum&&!n.exit&&(r.rem.push(n),n.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&r.modifies(`datum`),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),r}}),U(rN,G,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,a=t.encode;if(H(a))if(n.changed()||a.every(e=>i[e]))a=a[0],n.encode=null;else return t.StopPropagation;var o=a===`enter`,s=i.update||Rm,c=i.enter||Rm,l=i.exit||Rm,u=(a&&!o?i[a]:s)||Rm;if(t.changed(t.ADD)&&(t.visit(t.ADD,t=>{c(t,e),s(t,e)}),n.modifies(c.output),n.modifies(s.output),u!==Rm&&u!==s&&(t.visit(t.ADD,t=>{u(t,e)}),n.modifies(u.output))),t.changed(t.REM)&&l!==Rm&&(t.visit(t.REM,t=>{l(t,e)}),n.modifies(l.output)),o||u!==Rm){let i=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(i,t=>{let i=c(t,e)||r;(u(t,e)||i)&&n.mod.push(t)}),n.mod.length&&n.modifies(c.output)):t.visit(i,t=>{(u(t,e)||r)&&n.mod.push(t)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:t.StopPropagation}}),U(iN,G,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,a=e.type||`symbol`,o=e.scale,s=+e.limit,c=RD(o,e.count==null?5:e.count,e.minstep),l=!!e.values||a===`symbol`,u=e.format||WD(n,o,c,a,e.formatSpecifier,e.formatType,l),d=e.values||UD(o,c),f,p,m,h,g;return i&&(r.rem=i),a===`symbol`?(s&&d.length>s?(t.dataflow.warn(`Symbol legend count exceeds limit, filtering items.`),i=d.slice(0,s-1),g=!0):i=d,bh(m=e.size)?(!e.values&&o(i[0])===0&&(i=i.slice(1)),h=i.reduce((t,n)=>Math.max(t,m(n,e)),0)):m=Oh(h=m||8),i=i.map((t,n)=>Db({index:n,label:u(t,n,i),value:t,offset:h,size:m(t,e)})),g&&(g=d[i.length],i.push(Db({index:i.length,label:`\u2026${d.length-i.length} entries`,value:g,offset:h,size:m(g,e)})))):a===`gradient`?(f=o.domain(),p=ND(o,f[0],qm(f)),d.length<3&&!e.values&&f[0]!==qm(f)&&(d=[f[0],qm(f)]),i=d.map((e,t)=>Db({index:t,label:u(e,t,d),value:e,perc:p(e)}))):(m=d.length-1,p=bpe(o),i=d.map((e,t)=>Db({index:t,label:u(e,t,d),value:e,perc:t?p(e):0,perc2:t===m?1:p(d[t+1])}))),r.source=i,r.add=i,this.value=i,r}}),mN=e=>e.source.x,hN=e=>e.source.y,gN=e=>e.target.x,_N=e=>e.target.y,aN.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`}]},U(aN,G,{transform(e,t){var n=e.sourceX||mN,r=e.sourceY||hN,i=e.targetX||gN,a=e.targetY||_N,o=e.as||`path`,s=e.orient||`vertical`,c=e.shape||`line`,l=AN.get(c+`-`+s)||AN.get(c);return l||V(`LinkPath unsupported type: `+e.shape+(e.orient?`-`+e.orient:``)),t.visit(t.SOURCE,e=>{e[o]=l(n(e),r(e),i(e),a(e))}),t.reflow(e.modified()).modifies(o)}}),vN=(e,t,n,r)=>`M`+e+`,`+t+`L`+n+`,`+r,yN=(e,t,n,r)=>vN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),bN=(e,t,n,r)=>{var i=n-e,a=r-t,o=Math.hypot(i,a)/2,s=180*Math.atan2(a,i)/Math.PI;return`M`+e+`,`+t+`A`+o+`,`+o+` `+s+` 0 1 `+n+`,`+r},xN=(e,t,n,r)=>bN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),SN=(e,t,n,r)=>{let i=n-e,a=r-t,o=.2*(i+a),s=.2*(a-i);return`M`+e+`,`+t+`C`+(e+o)+`,`+(t+s)+` `+(n+s)+`,`+(r-o)+` `+n+`,`+r},CN=(e,t,n,r)=>SN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),wN=(e,t,n,r)=>`M`+e+`,`+t+`V`+r+`H`+n,TN=(e,t,n,r)=>`M`+e+`,`+t+`H`+n+`V`+r,EN=(e,t,n,r)=>{let i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),c=Math.abs(n-e)>Math.PI?n<=e:n>e;return`M`+t*i+`,`+t*a+`A`+t+`,`+t+` 0 0,`+ +!!c+` `+t*o+`,`+t*s+`L`+r*o+`,`+r*s},DN=(e,t,n,r)=>{let i=(e+n)/2;return`M`+e+`,`+t+`C`+i+`,`+t+` `+i+`,`+r+` `+n+`,`+r},ON=(e,t,n,r)=>{let i=(t+r)/2;return`M`+e+`,`+t+`C`+e+`,`+i+` `+n+`,`+i+` `+n+`,`+r},kN=(e,t,n,r)=>{let i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),c=(t+r)/2;return`M`+t*i+`,`+t*a+`C`+c*i+`,`+c*a+` `+c*o+`,`+c*s+` `+r*o+`,`+r*s},AN=Ih({line:vN,"line-radial":yN,arc:bN,"arc-radial":xN,curve:SN,"curve-radial":CN,"orthogonal-horizontal":wN,"orthogonal-vertical":TN,"orthogonal-radial":EN,"diagonal-horizontal":DN,"diagonal-vertical":ON,"diagonal-radial":kN}),oN.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`]}]},U(oN,G,{transform(e,t){var n=e.as||[`startAngle`,`endAngle`],r=n[0],i=n[1],a=e.field||Im,o=e.startAngle||0,s=e.endAngle==null?2*Math.PI:e.endAngle,c=t.source,l=c.map(a),u=l.length,d=o,f=(s-o)/p_(l),p=f_(u),m,h,g;for(e.sort&&p.sort((e,t)=>l[e]-l[t]),m=0;m1?0:e<-1?BN:Math.acos(e)}function RN(e){return e>1?VN:e<-1?-VN:Math.asin(e)}var zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP=o((()=>{zN=1e-6,BN=Math.PI,VN=BN/2,HN=BN/4,UN=BN*2,WN=180/BN,GN=BN/180,KN=Math.abs,qN=Math.atan,JN=Math.atan2,YN=Math.cos,XN=Math.ceil,ZN=Math.exp,QN=Math.hypot,$N=Math.log,eP=Math.pow,tP=Math.sin,nP=Math.sign||function(e){return e>0?1:e<0?-1:0},rP=Math.sqrt,iP=Math.tan}));function oP(){}var sP=o((()=>{}));function cP(e,t){e&&pP.hasOwnProperty(e.type)&&pP[e.type](e,t)}function lP(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r{fP={Feature:function(e,t){cP(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,a=YN(t),o=tP(t),s=SP*o,c=xP*a+s*YN(i),l=s*r*tP(i);gP.add(JN(l,c)),bP=e,xP=a,SP=o}function N_e(e){return _P=new Lg,dP(e,CP),_P*2}var gP,_P,vP,yP,bP,xP,SP,CP,wP=o((()=>{m_(),aP(),sP(),mP(),gP=new Lg,_P=new Lg,CP={point:oP,lineStart:oP,lineEnd:oP,polygonStart:function(){gP=new Lg,CP.lineStart=A_e,CP.lineEnd=j_e},polygonEnd:function(){var e=+gP;_P.add(e<0?UN+e:e),this.lineStart=this.lineEnd=this.point=oP},sphere:function(){_P.add(UN)}}}));function TP(e){return[JN(e[1],e[0]),RN(e[2])]}function EP(e){var t=e[0],n=e[1],r=YN(n);return[r*YN(t),r*tP(t),tP(n)]}function DP(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function OP(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function kP(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function AP(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function jP(e){var t=rP(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var MP=o((()=>{aP()}));function NP(e,t){YP.push(XP=[BP=e,HP=e]),tUP&&(UP=t)}function PP(e,t){var n=EP([e*GN,t*GN]);if(qP){var r=OP(qP,n),i=OP([r[1],-r[0],0],r);jP(i),i=TP(i);var a=e-WP,o=a>0?1:-1,s=i[0]*WN*o,c,l=KN(a)>180;l^(o*WPUP&&(UP=c)):(s=(s+360)%360-180,l^(o*WPUP&&(UP=t))),l?eRP(BP,HP)&&(HP=e):RP(e,HP)>RP(BP,HP)&&(BP=e):HP>=BP?(eHP&&(HP=e)):e>WP?RP(BP,e)>RP(BP,HP)&&(HP=e):RP(e,HP)>RP(BP,HP)&&(BP=e)}else YP.push(XP=[BP=e,HP=e]);tUP&&(UP=t),qP=n,WP=e}function FP(){ZP.point=PP}function IP(){XP[0]=BP,XP[1]=HP,ZP.point=NP,qP=null}function LP(e,t){if(qP){var n=e-WP;JP.add(KN(n)>180?n+(n>0?360:-360):n)}else GP=e,KP=t;CP.point(e,t),PP(e,t)}function P_e(){CP.lineStart()}function F_e(){LP(GP,KP),CP.lineEnd(),KN(JP)>1e-6&&(BP=-(HP=180)),XP[0]=BP,XP[1]=HP,qP=null}function RP(e,t){return(t-=e)<0?t+360:t}function I_e(e,t){return e[0]-t[0]}function zP(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tRP(r[0],r[1])&&(r[1]=i[1]),RP(i[0],r[1])>RP(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,n=a.length-1,t=0,r=a[n];t<=n;r=i,++t)i=a[t],(s=RP(r[1],i[0]))>o&&(o=s,BP=i[0],HP=r[1])}return YP=XP=null,BP===1/0||VP===1/0?[[NaN,NaN],[NaN,NaN]]:[[BP,VP],[HP,UP]]}var BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,R_e=o((()=>{m_(),wP(),MP(),aP(),mP(),ZP={point:NP,lineStart:FP,lineEnd:IP,polygonStart:function(){ZP.point=LP,ZP.lineStart=P_e,ZP.lineEnd=F_e,JP=new Lg,CP.polygonStart()},polygonEnd:function(){CP.polygonEnd(),ZP.point=NP,ZP.lineStart=FP,ZP.lineEnd=IP,gP<0?(BP=-(HP=180),VP=-(UP=90)):JP>1e-6?UP=90:JP<-1e-6&&(VP=-90),XP[0]=BP,XP[1]=HP},sphere:function(){BP=-(HP=180),VP=-(UP=90)}}}));function QP(e,t){e*=GN,t*=GN;var n=YN(t);$P(n*YN(e),n*tP(e),tP(t))}function $P(e,t,n){++rF,aF+=(e-aF)/rF,oF+=(t-oF)/rF,sF+=(n-sF)/rF}function eF(){yF.point=z_e}function z_e(e,t){e*=GN,t*=GN;var n=YN(t);gF=n*YN(e),_F=n*tP(e),vF=tP(t),yF.point=B_e,$P(gF,_F,vF)}function B_e(e,t){e*=GN,t*=GN;var n=YN(t),r=n*YN(e),i=n*tP(e),a=tP(t),o=JN(rP((o=_F*a-vF*i)*o+(o=vF*r-gF*a)*o+(o=gF*i-_F*r)*o),gF*r+_F*i+vF*a);iF+=o,cF+=o*(gF+(gF=r)),lF+=o*(_F+(_F=i)),uF+=o*(vF+(vF=a)),$P(gF,_F,vF)}function tF(){yF.point=QP}function V_e(){yF.point=U_e}function H_e(){nF(mF,hF),yF.point=QP}function U_e(e,t){mF=e,hF=t,e*=GN,t*=GN,yF.point=nF;var n=YN(t);gF=n*YN(e),_F=n*tP(e),vF=tP(t),$P(gF,_F,vF)}function nF(e,t){e*=GN,t*=GN;var n=YN(t),r=n*YN(e),i=n*tP(e),a=tP(t),o=_F*a-vF*i,s=vF*r-gF*a,c=gF*i-_F*r,l=QN(o,s,c),u=RN(l),d=l&&-u/l;dF.add(d*o),fF.add(d*s),pF.add(d*c),iF+=u,cF+=u*(gF+(gF=r)),lF+=u*(_F+(_F=i)),uF+=u*(vF+(vF=a)),$P(gF,_F,vF)}function W_e(e){rF=iF=aF=oF=sF=cF=lF=uF=0,dF=new Lg,fF=new Lg,pF=new Lg,dP(e,yF);var t=+dF,n=+fF,r=+pF,i=QN(t,n,r);return i<1e-12&&(t=cF,n=lF,r=uF,iF<1e-6&&(t=aF,n=oF,r=sF),i=QN(t,n,r),i<1e-12)?[NaN,NaN]:[JN(n,t)*WN,RN(r/i)*WN]}var rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,G_e=o((()=>{m_(),aP(),sP(),mP(),yF={sphere:oP,point:QP,lineStart:eF,lineEnd:tF,polygonStart:function(){yF.lineStart=V_e,yF.lineEnd=H_e},polygonEnd:function(){yF.lineStart=eF,yF.lineEnd=tF}}}));function bF(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}var xF=o((()=>{}));function SF(e,t){return KN(e)>BN&&(e-=Math.round(e/UN)*UN),[e,t]}function CF(e,t,n){return(e%=UN)?t||n?bF(TF(e),EF(t,n)):TF(e):t||n?EF(t,n):SF}function wF(e){return function(t,n){return t+=e,KN(t)>BN&&(t-=Math.round(t/UN)*UN),[t,n]}}function TF(e){var t=wF(e);return t.invert=wF(-e),t}function EF(e,t){var n=YN(e),r=tP(e),i=YN(t),a=tP(t);function o(e,t){var o=YN(t),s=YN(e)*o,c=tP(e)*o,l=tP(t),u=l*n+s*r;return[JN(c*i-u*a,s*n-l*r),RN(u*i+c*a)]}return o.invert=function(e,t){var o=YN(t),s=YN(e)*o,c=tP(e)*o,l=tP(t),u=l*i-c*a;return[JN(c*i+l*a,s*n+u*r),RN(u*n-s*r)]},o}function K_e(e){e=CF(e[0]*GN,e[1]*GN,e.length>2?e[2]*GN:0);function t(t){return t=e(t[0]*GN,t[1]*GN),t[0]*=WN,t[1]*=WN,t}return t.invert=function(t){return t=e.invert(t[0]*GN,t[1]*GN),t[0]*=WN,t[1]*=WN,t},t}var DF=o((()=>{xF(),aP(),SF.invert=SF}));function q_e(e,t,n,r,i,a){if(n){var o=YN(t),s=tP(t),c=r*n;i==null?(i=t+r*UN,a=t-c/2):(i=OF(o,i),a=OF(o,a),(r>0?ia)&&(i+=r*UN));for(var l,u=i;r>0?u>a:u{MP(),aP()}));function AF(){var e=[],t;return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:oP,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}var jF=o((()=>{sP()}));function MF(e,t){return KN(e[0]-t[0])<1e-6&&KN(e[1]-t[1])<1e-6}var NF=o((()=>{aP()}));function PF(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function FF(e,t,n,r,i){var a=[],o=[],s,c;if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t],c;if(MF(n,r)){if(!n[2]&&!r[2]){for(i.lineStart(),s=0;s=0;--s)i.point((d=u[s])[0],d[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,u=f.z,p=!p}while(!f.v);i.lineEnd()}}}function IF(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n{NF(),aP()}));function RF(e){return KN(e[0])<=BN?e[0]:nP(e[0])*((KN(e[0])+BN)%UN-BN)}function J_e(e,t){var n=RF(t),r=t[1],i=tP(r),a=[tP(n),-YN(n),0],o=0,s=0,c=new Lg;i===1?r=VN+zN:i===-1&&(r=-VN-zN);for(var l=0,u=e.length;l=0?1:-1,E=T*w,D=E>BN,O=g*S;if(c.add(JN(O*T*tP(E),_*C+O*YN(E))),o+=D?w+T*UN:w,D^m>=n^b>=n){var k=OP(EP(p),EP(y));jP(k);var A=OP(a,k);jP(A);var j=(D^w>=0?-1:1)*RN(A[2]);(r>j||r===j&&(k[0]||k[1]))&&(s+=D^w>=0?1:-1)}}return(o<-1e-6||o<1e-6&&c<-1e-12)^s&1}var zF=o((()=>{m_(),MP(),aP()}));function BF(e,t,n,r){return function(i){var a=t(i),o=AF(),s=t(o),c=!1,l,u,d,f={point:p,lineStart:h,lineEnd:g,polygonStart:function(){f.point=_,f.lineStart=v,f.lineEnd=y,u=[],l=[]},polygonEnd:function(){f.point=p,f.lineStart=h,f.lineEnd=g,u=d_(u);var e=J_e(l,r);u.length?(c||=(i.polygonStart(),!0),FF(u,X_e,e,n,i)):e&&(c||=(i.polygonStart(),!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&=(i.polygonEnd(),!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(t,n){e(t,n)&&i.point(t,n)}function m(e,t){a.point(e,t)}function h(){f.point=m,a.lineStart()}function g(){f.point=p,a.lineEnd()}function _(e,t){d.push([e,t]),s.point(e,t)}function v(){s.lineStart(),d=[]}function y(){_(d[0][0],d[0][1]),s.lineEnd();var e=s.clean(),t=o.result(),n,r=t.length,a,f,p;if(d.pop(),l.push(d),d=null,r){if(e&1){if(f=t[0],(a=f.length-1)>0){for(c||=(i.polygonStart(),!0),i.lineStart(),n=0;n1&&e&2&&t.push(t.pop().concat(t.shift())),u.push(t.filter(Y_e))}}return f}}function Y_e(e){return e.length>1}function X_e(e,t){return((e=e.x)[0]<0?e[1]-VN-zN:VN-e[1])-((t=t.x)[0]<0?t[1]-VN-zN:VN-t[1])}var VF=o((()=>{jF(),LF(),aP(),zF(),m_()}));function Z_e(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,o){var s=a>0?BN:-BN,c=KN(a-t);KN(c-BN)<1e-6?(e.point(t,n=(n+o)/2>0?VN:-VN),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(a,n),i=0):r!==s&&c>=BN&&(KN(t-r)<1e-6&&(t-=r*zN),KN(a-s)<1e-6&&(a-=s*zN),n=Q_e(t,n,a,o),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),i=0),e.point(t=a,n=o),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function Q_e(e,t,n,r){var i,a,o=tP(e-n);return KN(o)>1e-6?qN((tP(t)*(a=YN(r))*tP(n)-tP(r)*(i=YN(t))*tP(e))/(i*a*o)):(t+r)/2}function $_e(e,t,n,r){var i;if(e==null)i=n*VN,r.point(-BN,i),r.point(0,i),r.point(BN,i),r.point(BN,0),r.point(BN,-i),r.point(0,-i),r.point(-BN,-i),r.point(-BN,0),r.point(-BN,i);else if(KN(e[0]-t[0])>1e-6){var a=e[0]{VF(),aP(),HF=BF(function(){return!0},Z_e,$_e,[-BN,-VN])}));function eve(e){var t=YN(e),n=2*GN,r=t>0,i=KN(t)>zN;function a(t,r,i,a){q_e(a,e,n,i,t,r)}function o(e,n){return YN(e)*YN(n)>t}function s(e){var t,n,a,s,u;return{lineStart:function(){s=a=!1,u=1},point:function(d,f){var p=[d,f],m,h=o(d,f),g=r?h?0:l(d,f):h?l(d+(d<0?BN:-BN),f):0;if(!t&&(s=a=h)&&e.lineStart(),h!==a&&(m=c(t,p),(!m||MF(t,m)||MF(p,m))&&(p[2]=1)),h!==a)u=0,h?(e.lineStart(),m=c(p,t),e.point(m[0],m[1])):(m=c(t,p),e.point(m[0],m[1],2),e.lineEnd()),t=m;else if(i&&t&&r^h){var _;!(g&n)&&(_=c(p,t,!0))&&(u=0,r?(e.lineStart(),e.point(_[0][0],_[0][1]),e.point(_[1][0],_[1][1]),e.lineEnd()):(e.point(_[1][0],_[1][1]),e.lineEnd(),e.lineStart(),e.point(_[0][0],_[0][1],3)))}h&&(!t||!MF(t,p))&&e.point(p[0],p[1]),t=p,a=h,n=g},lineEnd:function(){a&&e.lineEnd(),t=null},clean:function(){return u|(s&&a)<<1}}}function c(e,n,r){var i=EP(e),a=EP(n),o=[1,0,0],s=OP(i,a),c=DP(s,s),l=s[0],u=c-l*l;if(!u)return!r&&e;var d=t*c/u,f=-t*l/u,p=OP(o,s),m=AP(o,d);kP(m,AP(s,f));var h=p,g=DP(m,h),_=DP(h,h),v=g*g-_*(DP(m,m)-1);if(!(v<0)){var y=rP(v),b=AP(h,(-g-y)/_);if(kP(b,m),b=TP(b),!r)return b;var x=e[0],S=n[0],C=e[1],w=n[1],T;S0^b[1]<(KN(b[0]-x)<1e-6?C:w):C<=b[1]&&b[1]<=w:E>BN^(x<=b[0]&&b[0]<=S)){var k=AP(h,(-g+y)/_);return kP(k,m),[b,TP(k)]}}}function l(t,n){var i=r?e:BN-e,a=0;return t<-i?a|=1:t>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return BF(o,s,a,r?[0,-e]:[-BN,e-BN])}var WF=o((()=>{MP(),kF(),aP(),NF(),VF()}));function tve(e,t,n,r,i,a){var o=e[0],s=e[1],c=t[0],l=t[1],u=0,d=1,f=c-o,p=l-s,m=n-o;if(!(!f&&m>0)){if(m/=f,f<0){if(m0){if(m>d)return;m>u&&(u=m)}if(m=i-o,!(!f&&m<0)){if(m/=f,f<0){if(m>d)return;m>u&&(u=m)}else if(f>0){if(m0)){if(m/=p,p<0){if(m0){if(m>d)return;m>u&&(u=m)}if(m=a-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m0&&(e[0]=o+u*f,e[1]=s+u*p),d<1&&(t[0]=o+d*f,t[1]=s+d*p),!0}}}}}var nve=o((()=>{}));function GF(e,t,n,r){function i(i,a){return e<=i&&i<=n&&t<=a&&a<=r}function a(i,a,s,l){var u=0,d=0;if(i==null||(u=o(i,s))!==(d=o(a,s))||c(i,a)<0^s>0)do l.point(u===0||u===3?e:n,u>1?r:t);while((u=(u+s+4)%4)!==d);else l.point(a[0],a[1])}function o(r,i){return KN(r[0]-e)<1e-6?i>0?0:3:KN(r[0]-n)<1e-6?i>0?2:1:KN(r[1]-t)<1e-6?+(i>0):i>0?3:2}function s(e,t){return c(e.x,t.x)}function c(e,t){var n=o(e,1),r=o(t,1);return n===r?n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]:n-r}return function(o){var c=o,l=AF(),u,d,f,p,m,h,g,_,v,y,b,x={point:S,lineStart:E,lineEnd:D,polygonStart:w,polygonEnd:T};function S(e,t){i(e,t)&&c.point(e,t)}function C(){for(var t=0,n=0,i=d.length;nr&&(f-l)*(r-u)>(p-u)*(e-l)&&++t:p<=r&&(f-l)*(r-u)<(p-u)*(e-l)&&--t;return t}function w(){c=l,u=[],d=[],b=!0}function T(){var e=C(),t=b&&e,n=(u=d_(u)).length;(t||n)&&(o.polygonStart(),t&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),n&&FF(u,s,e,a,o),o.polygonEnd()),c=o,u=d=f=null}function E(){x.point=O,d&&d.push(f=[]),y=!0,v=!1,g=_=NaN}function D(){u&&(O(p,m),h&&v&&l.rejoin(),u.push(l.result())),x.point=S,v&&c.lineEnd()}function O(a,o){var s=i(a,o);if(d&&f.push([a,o]),y)p=a,m=o,h=s,y=!1,s&&(c.lineStart(),c.point(a,o));else if(s&&v)c.point(a,o);else{var l=[g=Math.max(qF,Math.min(KF,g)),_=Math.max(qF,Math.min(KF,_))],u=[a=Math.max(qF,Math.min(KF,a)),o=Math.max(qF,Math.min(KF,o))];tve(l,u,e,t,n,r)?(v||(c.lineStart(),c.point(l[0],l[1])),c.point(u[0],u[1]),s||c.lineEnd(),b=!1):s&&(c.lineStart(),c.point(a,o),b=!1)}g=a,_=o,v=s}return x}}var KF,qF,JF=o((()=>{aP(),jF(),nve(),LF(),m_(),KF=1e9,qF=-KF}));function YF(e,t,n){var r=f_(e,t-zN,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function XF(e,t,n){var r=f_(e,t-zN,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function rve(){var e,t,n,r,i,a,o,s,c=10,l=c,u=90,d=360,f,p,m,h,g=2.5;function _(){return{type:`MultiLineString`,coordinates:v()}}function v(){return f_(XN(r/u)*u,n,u).map(m).concat(f_(XN(s/d)*d,o,d).map(h)).concat(f_(XN(t/c)*c,e,c).filter(function(e){return KN(e%u)>zN}).map(f)).concat(f_(XN(a/l)*l,i,l).filter(function(e){return KN(e%d)>zN}).map(p))}return _.lines=function(){return v().map(function(e){return{type:`LineString`,coordinates:e}})},_.outline=function(){return{type:`Polygon`,coordinates:[m(r).concat(h(o).slice(1),m(n).reverse().slice(1),h(s).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],o=+e[1][1],r>n&&(e=r,r=n,n=e),s>o&&(e=s,s=o,o=e),_.precision(g)):[[r,s],[n,o]]},_.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],a=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),a>i&&(n=a,a=i,i=n),_.precision(g)):[[t,a],[e,i]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(u=+e[0],d=+e[1],_):[u,d]},_.stepMinor=function(e){return arguments.length?(c=+e[0],l=+e[1],_):[c,l]},_.precision=function(c){return arguments.length?(g=+c,f=YF(a,i,90),p=XF(t,e,g),m=YF(s,o,90),h=XF(r,n,g),_):g},_.extentMajor([[-180,-90+zN],[180,90-zN]]).extentMinor([[-180,-80-zN],[180,80+zN]])}var ive=o((()=>{m_(),aP()})),ZF,QF=o((()=>{ZF=e=>e}));function ave(){oI.point=ove}function ove(e,t){oI.point=$F,nI=iI=e,rI=aI=t}function $F(e,t){tI.add(aI*e-iI*t),iI=e,aI=t}function sve(){$F(nI,rI)}var eI,tI,nI,rI,iI,aI,oI,cve=o((()=>{m_(),aP(),sP(),eI=new Lg,tI=new Lg,oI={point:oP,lineStart:oP,lineEnd:oP,polygonStart:function(){oI.lineStart=ave,oI.lineEnd=sve},polygonEnd:function(){oI.lineStart=oI.lineEnd=oI.point=oP,eI.add(KN(tI)),tI=new Lg},result:function(){var e=eI/2;return eI=new Lg,e}}}));function lve(e,t){elI&&(lI=e),tuI&&(uI=t)}var sI,cI,lI,uI,dI,fI=o((()=>{sP(),sI=1/0,cI=sI,lI=-sI,uI=lI,dI={point:lve,lineStart:oP,lineEnd:oP,polygonStart:oP,polygonEnd:oP,result:function(){var e=[[sI,cI],[lI,uI]];return lI=uI=-(cI=sI=1/0),e}}}));function pI(e,t){_I+=e,vI+=t,++yI}function mI(){AI.point=uve}function uve(e,t){AI.point=dve,pI(OI=e,kI=t)}function dve(e,t){var n=e-OI,r=t-kI,i=rP(n*n+r*r);bI+=i*(OI+e)/2,xI+=i*(kI+t)/2,SI+=i,pI(OI=e,kI=t)}function hI(){AI.point=pI}function fve(){AI.point=mve}function pve(){gI(EI,DI)}function mve(e,t){AI.point=gI,pI(EI=OI=e,DI=kI=t)}function gI(e,t){var n=e-OI,r=t-kI,i=rP(n*n+r*r);bI+=i*(OI+e)/2,xI+=i*(kI+t)/2,SI+=i,i=kI*e-OI*t,CI+=i*(OI+e),wI+=i*(kI+t),TI+=i*3,pI(OI=e,kI=t)}var _I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,hve=o((()=>{aP(),_I=0,vI=0,yI=0,bI=0,xI=0,SI=0,CI=0,wI=0,TI=0,AI={point:pI,lineStart:mI,lineEnd:hI,polygonStart:function(){AI.lineStart=fve,AI.lineEnd=pve},polygonEnd:function(){AI.point=pI,AI.lineStart=mI,AI.lineEnd=hI},result:function(){var e=TI?[CI/TI,wI/TI]:SI?[bI/SI,xI/SI]:yI?[_I/yI,vI/yI]:[NaN,NaN];return _I=vI=yI=bI=xI=SI=CI=wI=TI=0,e}}}));function jI(e){this._context=e}var gve=o((()=>{aP(),sP(),jI.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,UN);break}},result:oP}}));function _ve(e,t){zI.point=MI,FI=LI=e,II=RI=t}function MI(e,t){LI-=e,RI-=t,NI.add(rP(LI*LI+RI*RI)),LI=e,RI=t}var NI,PI,FI,II,LI,RI,zI,vve=o((()=>{m_(),aP(),sP(),NI=new Lg,zI={point:oP,lineStart:function(){zI.point=_ve},lineEnd:function(){PI&&MI(FI,II),zI.point=oP},polygonStart:function(){PI=!0},polygonEnd:function(){PI=null},result:function(){var e=+NI;return NI=new Lg,e}}}));function BI(e){let t=1;this._+=e[0];for(let n=e.length;t=0))throw RangeError(`invalid digits: ${e}`);if(t>15)return BI;if(t!==VI){let e=10**t;VI=t,HI=function(t){let n=1;this._+=t[0];for(let r=t.length;n{GI=class{constructor(e){this._append=e==null?BI:yve(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!==UI||this._append!==HI){let e=this._radius,t=this._;this._=``,this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,UI=e,HI=this._append,WI=this._,this._=t}this._+=WI;break}}result(){let e=this._;return this._=``,e.length?e:null}}}));function KI(e,t){let n=3,r=4.5,i,a;function o(e){return e&&(typeof r==`function`&&a.pointRadius(+r.apply(this,arguments)),dP(e,i(a))),a.result()}return o.area=function(e){return dP(e,i(oI)),oI.result()},o.measure=function(e){return dP(e,i(zI)),zI.result()},o.bounds=function(e){return dP(e,i(dI)),dI.result()},o.centroid=function(e){return dP(e,i(AI)),AI.result()},o.projection=function(t){return arguments.length?(i=t==null?(e=null,ZF):(e=t).stream,o):e},o.context=function(e){return arguments.length?(a=e==null?(t=null,new GI(n)):new jI(t=e),typeof r!=`function`&&a.pointRadius(r),o):t},o.pointRadius=function(e){return arguments.length?(r=typeof e==`function`?e:(a.pointRadius(+e),+e),o):r},o.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);n=t}return t===null&&(a=new GI(n)),o},o.projection(e).digits(n).context(t)}var xve=o((()=>{QF(),mP(),cve(),fI(),hve(),gve(),vve(),bve()}));function qI(e){return function(t){var n=new JI;for(var r in e)n[r]=e[r];return n.stream=t,n}}function JI(){}var YI=o((()=>{JI.prototype={constructor:JI,point:function(e,t){this.stream.point(e,t)},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 XI(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),dP(n,e.stream(dI)),t(dI.result()),r!=null&&e.clipExtent(r),e}function ZI(e,t,n){return XI(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+t[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-a*(n[1][1]+n[0][1]))/2;e.scale(150*a).translate([o,s])},n)}function QI(e,t,n){return ZI(e,[[0,0],t],n)}function $I(e,t,n){return XI(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];e.scale(150*i).translate([a,o])},n)}function eL(e,t,n){return XI(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([a,o])},n)}var tL=o((()=>{mP(),fI()}));function nL(e,t){return+t?Cve(e,t):Sve(e)}function Sve(e){return qI({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Cve(e,t){function n(r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=l-r,v=u-i,y=_*_+v*v;if(y>4*t&&h--){var b=o+f,x=s+p,S=c+m,C=rP(b*b+x*x+S*S),w=RN(S/=C),T=KN(KN(S)-1)<1e-6||KN(a-d)<1e-6?(a+d)/2:JN(x,b),E=e(T,w),D=E[0],O=E[1],k=D-r,A=O-i,j=v*k-_*A;(j*j/y>t||KN((_*k+v*A)/y-.5)>.3||o*f+s*p+c*m{MP(),aP(),YI(),rL=16,iL=YN(30*GN)}));function Tve(e){return qI({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Eve(e,t,n,r,i){function a(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return a.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},a}function aL(e,t,n,r,i,a){if(!a)return Eve(e,t,n,r,i);var o=YN(a),s=tP(a),c=o*e,l=s*e,u=o/e,d=s/e,f=(s*n-o*t)/e,p=(s*t+o*n)/e;function m(e,a){return e*=r,a*=i,[c*e-l*a+t,n-l*e-c*a]}return m.invert=function(e,t){return[r*(u*e-d*t+f),i*(p-d*e-u*t)]},m}function oL(e){return sL(function(){return e})()}function sL(e){var t,n=150,r=480,i=250,a=0,o=0,s=0,c=0,l=0,u,d=0,f=1,p=1,m=null,h=HF,g=null,_,v,y,b=ZF,x=.5,S,C,w,T,E;function D(e){return w(e[0]*GN,e[1]*GN)}function O(e){return e=w.invert(e[0],e[1]),e&&[e[0]*WN,e[1]*WN]}D.stream=function(e){return T&&E===e?T:T=cL(Tve(u)(h(S(b(E=e)))))},D.preclip=function(e){return arguments.length?(h=e,m=void 0,A()):h},D.postclip=function(e){return arguments.length?(b=e,g=_=v=y=null,A()):b},D.clipAngle=function(e){return arguments.length?(h=+e?eve(m=e*GN):(m=null,HF),A()):m*WN},D.clipExtent=function(e){return arguments.length?(b=e==null?(g=_=v=y=null,ZF):GF(g=+e[0][0],_=+e[0][1],v=+e[1][0],y=+e[1][1]),A()):g==null?null:[[g,_],[v,y]]},D.scale=function(e){return arguments.length?(n=+e,k()):n},D.translate=function(e){return arguments.length?(r=+e[0],i=+e[1],k()):[r,i]},D.center=function(e){return arguments.length?(a=e[0]%360*GN,o=e[1]%360*GN,k()):[a*WN,o*WN]},D.rotate=function(e){return arguments.length?(s=e[0]%360*GN,c=e[1]%360*GN,l=e.length>2?e[2]%360*GN:0,k()):[s*WN,c*WN,l*WN]},D.angle=function(e){return arguments.length?(d=e%360*GN,k()):d*WN},D.reflectX=function(e){return arguments.length?(f=e?-1:1,k()):f<0},D.reflectY=function(e){return arguments.length?(p=e?-1:1,k()):p<0},D.precision=function(e){return arguments.length?(S=nL(C,x=e*e),A()):rP(x)},D.fitExtent=function(e,t){return ZI(D,e,t)},D.fitSize=function(e,t){return QI(D,e,t)},D.fitWidth=function(e,t){return $I(D,e,t)},D.fitHeight=function(e,t){return eL(D,e,t)};function k(){var e=aL(n,0,0,f,p,d).apply(null,t(a,o)),m=aL(n,r-e[0],i-e[1],f,p,d);return u=CF(s,c,l),C=bF(t,m),w=bF(u,C),S=nL(C,x),A()}function A(){return T=E=null,D}return function(){return t=e.apply(this,arguments),D.invert=t.invert&&O,k()}}var cL,lL=o((()=>{UF(),WF(),JF(),xF(),QF(),aP(),DF(),YI(),tL(),wve(),cL=qI({point:function(e,t){this.stream.point(e*GN,t*GN)}})}));function uL(e){var t=0,n=BN/3,r=sL(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*GN,n=e[1]*GN):[t*WN,n*WN]},i}var dL=o((()=>{aP(),lL()}));function Dve(e){var t=YN(e);function n(e,n){return[e*t,tP(n)/t]}return n.invert=function(e,n){return[e/t,RN(n*t)]},n}var Ove=o((()=>{aP()}));function kve(e,t){var n=tP(e),r=(n+tP(t))/2;if(KN(r)<1e-6)return Dve(e);var i=1+n*(2*r-n),a=rP(i)/r;function o(e,t){var n=rP(i-2*r*tP(t))/r;return[n*tP(e*=r),a-n*YN(e)]}return o.invert=function(e,t){var n=a-t,o=JN(e,KN(n))*nP(n);return n*r<0&&(o-=BN*nP(e)*nP(n)),[o/r,RN((i-(e*e+n*n)*r*r)/(2*r))]},o}function fL(){return uL(kve).scale(155.424).center([0,33.6442])}var pL=o((()=>{aP(),dL(),Ove()}));function mL(){return fL().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}var hL=o((()=>{pL()}));function Ave(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i=.12&&s<.234&&a>=-.425&&a<-.214?i:s>=.166&&s<.234&&a>=-.214&&a<-.115?o:n).invert(e)},u.stream=function(r){return e&&t===r?e:e=Ave([n.stream(t=r),i.stream(r),o.stream(r)])},u.precision=function(e){return arguments.length?(n.precision(e),i.precision(e),o.precision(e),d()):n.precision()},u.scale=function(e){return arguments.length?(n.scale(e),i.scale(e*.35),o.scale(e),u.translate(n.translate())):n.scale()},u.translate=function(e){if(!arguments.length)return n.translate();var t=n.scale(),c=+e[0],u=+e[1];return r=n.translate(e).clipExtent([[c-.455*t,u-.238*t],[c+.455*t,u+.238*t]]).stream(l),a=i.translate([c-.307*t,u+.201*t]).clipExtent([[c-.425*t+zN,u+.12*t+zN],[c-.214*t-zN,u+.234*t-zN]]).stream(l),s=o.translate([c-.205*t,u+.212*t]).clipExtent([[c-.214*t+zN,u+.166*t+zN],[c-.115*t-zN,u+.234*t-zN]]).stream(l),d()},u.fitExtent=function(e,t){return ZI(u,e,t)},u.fitSize=function(e,t){return QI(u,e,t)},u.fitWidth=function(e,t){return $I(u,e,t)},u.fitHeight=function(e,t){return eL(u,e,t)};function d(){return e=t=null,u}return u.scale(1070)}var Mve=o((()=>{aP(),hL(),pL(),tL()}));function gL(e){return function(t,n){var r=YN(t),i=YN(n),a=e(r*i);return a===1/0?[2,0]:[a*i*tP(t),a*tP(n)]}}function _L(e){return function(t,n){var r=rP(t*t+n*n),i=e(r),a=tP(i),o=YN(i);return[JN(t*a,r*o),RN(r&&n*a/r)]}}var vL=o((()=>{aP()}));function Nve(){return oL(yL).scale(124.75).clipAngle(179.999)}var yL,Pve=o((()=>{aP(),vL(),lL(),yL=gL(function(e){return rP(2/(1+e))}),yL.invert=_L(function(e){return 2*RN(e/2)})}));function Fve(){return oL(bL).scale(79.4188).clipAngle(179.999)}var bL,Ive=o((()=>{aP(),vL(),lL(),bL=gL(function(e){return(e=LN(e))&&e/tP(e)}),bL.invert=_L(function(e){return e})}));function xL(e,t){return[e,$N(iP((VN+t)/2))]}function Lve(){return SL(xL).scale(961/UN)}function SL(e){var t=oL(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,o=null,s,c,l;t.scale=function(e){return arguments.length?(r(e),u()):r()},t.translate=function(e){return arguments.length?(i(e),u()):i()},t.center=function(e){return arguments.length?(n(e),u()):n()},t.clipExtent=function(e){return arguments.length?(e==null?o=s=c=l=null:(o=+e[0][0],s=+e[0][1],c=+e[1][0],l=+e[1][1]),u()):o==null?null:[[o,s],[c,l]]};function u(){var n=BN*r(),i=t(K_e(t.rotate()).invert([0,0]));return a(o==null?[[i[0]-n,i[1]-n],[i[0]+n,i[1]+n]]:e===xL?[[Math.max(i[0]-n,o),s],[Math.min(i[0]+n,c),l]]:[[o,Math.max(i[1]-n,s)],[c,Math.min(i[1]+n,l)]])}return u()}var CL=o((()=>{aP(),DF(),lL(),xL.invert=function(e,t){return[e,2*qN(ZN(t))-VN]}}));function wL(e){return iP((VN+e)/2)}function Rve(e,t){var n=YN(e),r=e===t?tP(e):$N(n/YN(t))/$N(wL(t)/wL(e)),i=n*eP(wL(e),r)/r;if(!r)return xL;function a(e,t){i>0?t<-VN+1e-6&&(t=-VN+zN):t>VN-1e-6&&(t=VN-zN);var n=i/eP(wL(t),r);return[n*tP(r*e),i-n*YN(r*e)]}return a.invert=function(e,t){var n=i-t,a=nP(r)*rP(e*e+n*n),o=JN(e,KN(n))*nP(n);return n*r<0&&(o-=BN*nP(e)*nP(n)),[o/r,2*qN(eP(i/a,1/r))-VN]},a}function zve(){return uL(Rve).scale(109.5).parallels([30,30])}var Bve=o((()=>{aP(),dL(),CL()}));function TL(e,t){return[e,t]}function Vve(){return oL(TL).scale(152.63)}var EL=o((()=>{lL(),TL.invert=TL}));function Hve(e,t){var n=YN(e),r=e===t?tP(e):(n-YN(t))/(t-e),i=n/r+e;if(KN(r)<1e-6)return TL;function a(e,t){var n=i-t,a=r*e;return[n*tP(a),i-n*YN(a)]}return a.invert=function(e,t){var n=i-t,a=JN(e,KN(n))*nP(n);return n*r<0&&(a-=BN*nP(e)*nP(n)),[a/r,i-nP(r)*rP(e*e+n*n)]},a}function Uve(){return uL(Hve).scale(131.154).center([0,13.9389])}var Wve=o((()=>{aP(),dL(),EL()}));function DL(e,t){var n=RN(ML*tP(t)),r=n*n,i=r*r*r;return[e*YN(n)/(ML*(OL+3*kL*r+i*(7*AL+9*jL*r))),n*(OL+kL*r+i*(AL+jL*r))]}function Gve(){return oL(DL).scale(177.158)}var OL,kL,AL,jL,ML,NL,Kve=o((()=>{lL(),aP(),OL=1.340264,kL=-.081106,AL=893e-6,jL=.003796,ML=rP(3)/2,NL=12,DL.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,o,s,c;a{aP(),vL(),lL(),PL.invert=_L(qN)}));function Yve(){var e=1,t=0,n=0,r=1,i=1,a=0,o,s,c=null,l,u,d,f=1,p=1,m=qI({point:function(e,t){var n=y([e,t]);this.stream.point(n[0],n[1])}}),h=ZF,g,_;function v(){return f=e*r,p=e*i,g=_=null,y}function y(e){var r=e[0]*f,i=e[1]*p;if(a){var c=i*o-r*s;r=r*o+i*s,i=c}return[r+t,i+n]}return y.invert=function(e){var r=e[0]-t,i=e[1]-n;if(a){var c=i*o+r*s;r=r*o-i*s,i=c}return[r/f,i/p]},y.stream=function(e){return g&&_===e?g:g=m(h(_=e))},y.postclip=function(e){return arguments.length?(h=e,c=l=u=d=null,v()):h},y.clipExtent=function(e){return arguments.length?(h=e==null?(c=l=u=d=null,ZF):GF(c=+e[0][0],l=+e[0][1],u=+e[1][0],d=+e[1][1]),v()):c==null?null:[[c,l],[u,d]]},y.scale=function(t){return arguments.length?(e=+t,v()):e},y.translate=function(e){return arguments.length?(t=+e[0],n=+e[1],v()):[t,n]},y.angle=function(e){return arguments.length?(a=e%360*GN,s=tP(a),o=YN(a),v()):a*WN},y.reflectX=function(e){return arguments.length?(r=e?-1:1,v()):r<0},y.reflectY=function(e){return arguments.length?(i=e?-1:1,v()):i<0},y.fitExtent=function(e,t){return ZI(y,e,t)},y.fitSize=function(e,t){return QI(y,e,t)},y.fitWidth=function(e,t){return $I(y,e,t)},y.fitHeight=function(e,t){return eL(y,e,t)},y}var Xve=o((()=>{JF(),QF(),YI(),tL(),aP()}));function FL(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}function Zve(){return oL(FL).scale(175.295)}var Qve=o((()=>{lL(),aP(),FL.invert=function(e,t){var n=t,r=25,i;do{var a=n*n,o=a*a;n-=i=(n*(1.007226+a*(.015085+o*(-.044475+.028874*a-.005916*o)))-t)/(1.007226+a*(.015085*3+o*(-.044475*7+.028874*9*a-.005916*11*o)))}while(KN(i)>1e-6&&--r>0);return[e/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]}}));function IL(e,t){return[YN(t)*tP(e),tP(t)]}function $ve(){return oL(IL).scale(249.5).clipAngle(90+zN)}var eye=o((()=>{aP(),vL(),lL(),IL.invert=_L(RN)}));function LL(e,t){var n=YN(t),r=1+YN(e)*n;return[n*tP(e)/r,tP(t)/r]}function tye(){return oL(LL).scale(250).clipAngle(142)}var nye=o((()=>{aP(),vL(),lL(),LL.invert=_L(function(e){return 2*qN(e)})}));function RL(e,t){return[$N(iP((VN+t)/2)),-e]}function rye(){var e=SL(RL),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90]).scale(159.155)}var iye=o((()=>{aP(),CL(),RL.invert=function(e,t){return[-t,2*qN(ZN(e))-VN]}})),zL=o((()=>{wP(),R_e(),G_e(),kF(),UF(),WF(),JF(),zF(),m_(),aP(),sP(),mP(),ive(),xve(),hL(),Mve(),Pve(),Ive(),Bve(),pL(),Wve(),Kve(),EL(),Jve(),Xve(),lL(),CL(),Qve(),eye(),nye(),iye(),DF(),YI()}));function BL(e){return e>1?GL:e<-1?-GL:Math.asin(e)}function aye(e){return e>0?Math.sqrt(e):0}var VL,HL,UL,WL,GL,KL,qL=o((()=>{VL=Math.abs,HL=Math.cos,UL=Math.sin,WL=Math.PI,GL=WL/2,WL/4,KL=aye(2),WL*2,180/WL,WL/180}));function oye(e,t){var n=e*UL(t),r=30,i;do t-=i=(t+UL(t)-n)/(1+HL(t));while(VL(i)>1e-6&&--r>0);return t/2}function sye(e,t,n){function r(r,i){return[e*r*HL(i=oye(n,i)),t*UL(i)]}return r.invert=function(r,i){return i=BL(i/t),[r/(e*HL(i)),BL((2*i+UL(2*i))/n)]},r}function cye(){return oL(JL).scale(169.529)}var JL,lye=o((()=>{zL(),qL(),JL=sye(KL/GL,KL,WL)})),uye=o((()=>{zL(),qL(),lye(),m_()}));function dye(e,t){return function n(){let r=t();return r.type=e,r.path=KI().projection(r),r.copy=r.copy||function(){let e=n();return QL.forEach(t=>{r[t]&&e[t](r[t]())}),e.path.pointRadius(r.path.pointRadius()),e},vD(r)}}function YL(e,t){if(!e||typeof e!=`string`)throw Error(`Projection type must be a name string.`);return e=e.toLowerCase(),arguments.length>1?($L[e]=dye(e,t),this):$L[e]||null}function XL(e){return e&&e.path||ZL}var ZL,QL,$L,eR=o((()=>{zL(),uye(),AO(),ZL=KI(),QL=[`clipAngle`,`clipExtent`,`scale`,`translate`,`center`,`rotate`,`parallels`,`precision`,`reflectX`,`reflectY`,`coefficient`,`distance`,`fraction`,`lobes`,`parallel`,`radius`,`ratio`,`spacing`,`tilt`],$L={albers:mL,albersusa:jve,azimuthalequalarea:Nve,azimuthalequidistant:Fve,conicconformal:zve,conicequalarea:fL,conicequidistant:Uve,equalEarth:Gve,equirectangular:Vve,gnomonic:qve,identity:Yve,mercator:Lve,mollweide:cye,naturalEarth1:Zve,orthographic:$ve,stereographic:tye,transversemercator:rye};for(let e in $L)YL(e,$L[e])})),fye=c({contour:()=>fR,geojson:()=>pR,geopath:()=>mR,geopoint:()=>hR,geoshape:()=>gR,graticule:()=>_R,heatmap:()=>vR,isocontour:()=>rR,kde2d:()=>uR,projection:()=>bR});function pye(){}function tR(){var e=1,t=1,n=s;function r(e,t){return t.map(t=>i(e,t))}function i(e,t){var r=[],i=[];return a(e,t,a=>{n(a,e,t),mye(a)>0?r.push([a]):i.push(a)}),i.forEach(e=>{for(var t=0,n=r.length,i;t=r,f,p;for(SR[d<<1].forEach(m);++c=r,SR[u|d<<1].forEach(m);for(SR[d<<0].forEach(m);++l=r,f=n[l*e]>=r,SR[d<<1|f<<2].forEach(m);++c=r,p=f,f=n[l*e+c+1]>=r,SR[u|d<<1|f<<2|p<<3].forEach(m);SR[d|f<<3].forEach(m)}for(c=-1,f=n[l*e]>=r,SR[f<<2].forEach(m);++c=r,SR[f<<2|p<<3].forEach(m);SR[f<<3].forEach(m);function m(e){var t=[e[0][0]+c,e[0][1]+l],n=[e[1][0]+c,e[1][1]+l],r=o(t),u=o(n),d,f;(d=s[r])?(f=a[u])?(delete s[d.end],delete a[f.start],d===f?(d.ring.push(n),i(d.ring)):a[d.start]=s[f.end]={start:d.start,end:f.end,ring:d.ring.concat(f.ring)}):(delete s[d.end],d.ring.push(n),s[d.end=u]=d):(d=a[u])?(f=s[r])?(delete a[d.start],delete s[f.end],d===f?(d.ring.push(n),i(d.ring)):a[f.start]=s[d.end]={start:f.start,end:d.end,ring:f.ring.concat(d.ring)}):(delete a[d.start],d.ring.unshift(t),a[d.start=r]=d):a[r]=s[u]={start:r,end:u,ring:[t,n]}}}function o(t){return t[0]*2+t[1]*(e+1)*4}function s(n,r,i){n.forEach(n=>{var a=n[0],o=n[1],s=a|0,c=o|0,l,u=r[c*e+s];a>0&&a0&&o=0&&a>=0||V(`invalid size`),e=i,t=a,r},r.smooth=function(e){return arguments.length?(n=e?s:pye,r):n===s},r}function mye(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++tr!=p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=-i)}return i}function _ye(e,t,n){var r;return vye(e,t,n)&&yye(e[r=+(e[0]===t[0])],n[r],t[r])}function vye(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function yye(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function nR(e,t,n){return function(r){var i=Mh(r),a=n?Math.min(i[0],0):i[0],o=i[1],s=o-a,c=t?Xg(a,o,e):s/(e+1);return f_(a+c,o,c)}}function rR(e){G.call(this,null,e)}function bye(e,t,n){let r=nR(n.levels||10,n.nice,n.zero!==!1);return n.resolve===`shared`?r(e.map(e=>e_(t(e).values))):r}function xye(e,t,n,r){let i=r.scale||t.scale,a=r.translate||t.translate;if(bh(i)&&(i=i(n,r)),bh(a)&&(a=a(n,r)),(i===1||i==null)&&!a)return;let o=(Wh(i)?i:i[0])||1,s=(Wh(i)?i:i[1])||1,c=a&&a[0]||0,l=a&&a[1]||0;e.forEach(iR(t,o,s,c,l))}function iR(e,t,n,r,i){let a=e.x1||0,o=e.y1||0,s=t*n<0;function c(e){e.forEach(l)}function l(e){s&&e.reverse(),e.forEach(u)}function u(e){e[0]=(e[0]-a)*t+r,e[1]=(e[1]-o)*n+i}return function(e){return e.coordinates.forEach(c),e}}function aR(e,t,n){let r=e>=0?e:ax(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function oR(e){return bh(e)?e:Oh(+e)}function sR(){var e=e=>e[0],t=e=>e[1],n=Im,r=[-1,-1],i=960,a=500,o=2;function s(s,c){let l=aR(r[0],s,e)>>o,u=aR(r[1],s,t)>>o,d=l?l+2:0,f=u?u+2:0,p=2*d+(i>>o),m=2*f+(a>>o),h=new Float32Array(p*m),g=new Float32Array(p*m),_=h;s.forEach(r=>{let i=d+(+e(r)>>o),a=f+(+t(r)>>o);i>=0&&i=0&&a0&&u>0?(cR(p,m,h,g,l),lR(p,m,g,h,u),cR(p,m,h,g,l),lR(p,m,g,h,u),cR(p,m,h,g,l),lR(p,m,g,h,u)):l>0?(cR(p,m,h,g,l),cR(p,m,g,h,l),cR(p,m,h,g,l),_=g):u>0&&(lR(p,m,h,g,u),lR(p,m,g,h,u),lR(p,m,h,g,u),_=g);let v=c?2**(-2*o):1/p_(_);for(let e=0,t=p*m;e>o),y2:f+(a>>o)}}return s.x=function(t){return arguments.length?(e=oR(t),s):e},s.y=function(e){return arguments.length?(t=oR(e),s):t},s.weight=function(e){return arguments.length?(n=oR(e),s):n},s.size=function(e){if(!arguments.length)return[i,a];var t=+e[0],n=+e[1];return t>=0&&n>=0||V(`invalid size`),i=t,a=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||V(`invalid cell size`),o=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=a&&(s-=n[t-a+o*e]),r[t-i+o*e]=s/Math.min(t+1,e-1+a-t,a))}function lR(e,t,n,r,i){let a=(i<<1)+1;for(let o=0;o=i&&(s>=a&&(c-=n[o+(s-a)*e]),r[o+(s-i)*e]=c/Math.min(s+1,t-1+a-s,a))}function uR(e){G.call(this,null,e)}function dR(e,t){return CR.forEach(n=>t[n]==null?0:e[n](t[n])),e}function Sye(e,t){var n=[],r=e=>e(s),i,a,o,s,c,l;if(t==null)n.push(e);else for(i={},a=0,o=e.length;ae(t(n)):r=>{var i=e.pointRadius(),a=e.pointRadius(n)(t(r));return e.pointRadius(i),a};return r.context=t=>(e.context(t),r),r}function _R(e){G.call(this,[],e),this.generator=rve()}function vR(e){G.call(this,null,e)}function Tye(e,t){let n;return bh(e)?(n=n=>ew(e(n,t)),n.dep=yR(e)):n=Oh(ew(e||`#888`)),n}function Eye(e,t){let n;return bh(e)?(n=n=>e(n,t),n.dep=yR(e)):e?n=Oh(e):(n=e=>e.$value/e.$max||0,n.dep=!0),n}function yR(e){if(!bh(e))return!1;let t=cg(Sm(e));return t.$x||t.$y||t.$value||t.$max}function Dye(e,t,n,r){let i=e.width,a=e.height,o=e.x1||0,s=e.y1||0,c=e.x2||i,l=e.y2||a,u=e.values,d=u?e=>u[e]:Fm,f=IC(c-o,l-s),p=f.getContext(`2d`),m=p.getImageData(0,0,c-o,l-s),h=m.data;for(let e=s,a=0;ee.concat(jye(t)),[])}}function jye(e){return e.type===TR?e.features:_h(e).filter(e=>e!=null).map(e=>e.type===wR?e:{type:wR,geometry:e})}var SR,CR,wR,TR,ER,Mye=o((()=>{nx(),dg(),m_(),Nx(),eR(),zL(),aT(),RC(),SR=[[],[[[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]]],[]],rR.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`}]},U(rR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||Pm,a=tR().smooth(e.smooth!==!1),o=e.thresholds||bye(r,i,e),s=e.as===null?null:e.as||`contour`,c=[];return r.forEach(t=>{let n=i(t),r=a.size([n.width,n.height])(n.values,H(o)?o:o(n.values));xye(r,n,t,e),r.forEach(e=>{c.push(kb(t,Db(s==null?e:{[s]:e})))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=c,n}}),uR.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`}]},CR=[`x`,`y`,`weight`,`size`,`cellSize`,`bandwidth`],U(uR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=Sye(r,e.groupby),a=(e.groupby||[]).map(xm),o=dR(sR(),e),s=e.as||`grid`,c=[];function l(e,t){for(let n=0;nDb(l({[s]:o(t,e.counts)},t.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=c,n}}),fR.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}]},U(fR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=tR().smooth(e.smooth!==!1),i=e.values,a=e.thresholds||nR(e.count||10,e.nice,!!i),o=e.size,s,c;return i||=(i=t.materialize(t.SOURCE).source,s=dR(sR(),e)(i,!0),c=iR(s,s.scale||1,s.scale||1,0,0),o=[s.width,s.height],s.values),a=H(a)?a:a(i),i=r.size(o)(i,a),c&&i.forEach(c),this.value&&(n.rem=this.value),this.value=n.source=n.add=(i||[]).map(Db),n}}),wR=`Feature`,TR=`FeatureCollection`,ER=`MultiPoint`,pR.Definition={type:`GeoJSON`,metadata:{},params:[{name:`fields`,type:`field`,array:!0,length:2},{name:`geojson`,type:`field`}]},U(pR,G,{transform(e,t){var n=this._features,r=this._points,i=e.fields,a=i&&i[0],o=i&&i[1],s=e.geojson||!i&&Pm,c=t.ADD,l=e.modified()||t.changed(t.REM)||t.modified(Sm(s))||a&&t.modified(Sm(a))||o&&t.modified(Sm(o));(!this.value||l)&&(c=t.SOURCE,this._features=n=[],this._points=r=[]),s&&t.visit(c,e=>n.push(s(e))),a&&o&&(t.visit(c,e=>{var t=a(e),n=o(e);t!=null&&n!=null&&(t=+t)===t&&(n=+n)===n&&r.push([t,n])}),n=n.concat({type:wR,geometry:{type:ER,coordinates:r}})),this.value={type:TR,features:n}}}),mR.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`}]},U(mR,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||Pm,a=e.as||`path`,o=n.SOURCE;!r||e.modified()?(this.value=r=XL(e.projection),n.materialize().reflow()):o=i===Pm||t.modified(i.fields)?n.ADD_MOD:n.ADD;let s=Cye(r,e.pointRadius);return n.visit(o,e=>e[a]=r(i(e))),r.pointRadius(s),n.modifies(a)}}),hR.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`]}]},U(hR,G,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],a=e.as||[`x`,`y`],o=a[0],s=a[1],c;function l(e){let t=n([r(e),i(e)]);t?(e[o]=t[0],e[s]=t[1]):(e[o]=void 0,e[s]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(c=t.modified(r.fields)||t.modified(i.fields),t.visit(c?t.ADD_MOD:t.ADD,l)),t.modifies(a)}}),gR.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`}]},U(gR,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||`shape`,a=n.ADD;return(!r||e.modified())&&(this.value=r=wye(XL(e.projection),e.field||jm(`datum`),e.pointRadius),n.materialize().reflow(),a=n.SOURCE),n.visit(a,e=>e[i]=r),n.modifies(i)}}),_R.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}]},U(_R,G,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(let t in e)bh(r[t])&&r[t](e[t]);return i=r(),n.length?t.mod.push(Pce(n[0],i)):t.add.push(Db(i)),n[0]=i,t}}),vR.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`}]},U(vR,G,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve===`shared`,i=e.field||Pm,a=Eye(e.opacity,e),o=Tye(e.color,e),s=e.as||`image`,c={$x:0,$y:0,$value:0,$max:r?e_(n.map(e=>e_(i(e).values))):0};return n.forEach(e=>{let t=i(e),n=Ah({},e,c);r||(n.$max=e_(t.values||[])),e[s]=Dye(t,n,o.dep?o:Oh(o(n)),a.dep?a:Oh(a(n)))}),t.reflow(!0).modifies(s)}}),U(bR,G,{transform(e,t){let n=this.value;return!n||e.modified(`type`)?(this.value=n=kye(e.type),QL.forEach(t=>{e[t]!=null&&xR(n,t,e[t])})):QL.forEach(t=>{e.modified(t)&&xR(n,t,e[t])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&Oye(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}})}));function Nye(e,t){var n,r=1;e??=0,t??=0;function i(){var i,a=n.length,o,s=0,c=0;for(i=0;i{}));function Fye(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return DR(this.cover(t,n),t,n,e)}function DR(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function Iye(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;nu&&(u=i),ad&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n{}));function Rye(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t{}));function Bye(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}var Vye=o((()=>{}));function Hye(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}var Uye=o((()=>{}));function OR(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}var kR=o((()=>{}));function Wye(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new OR(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),b=v*v+y*y;if(b{kR()}));function Kye(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function qye(e){for(var t=0,n=e.length;t{}));function Yye(){return this._root}var Xye=o((()=>{}));function Zye(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}var Qye=o((()=>{}));function $ye(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new OR(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new OR(i,l,u,s,c)),(i=r[2])&&t.push(new OR(i,a,u,l,c)),(i=r[1])&&t.push(new OR(i,l,o,s,u)),(i=r[0])&&t.push(new OR(i,a,o,l,u))}return this}var ebe=o((()=>{kR()}));function tbe(e){var t=[],n=[],r;for(this._root&&t.push(new OR(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new OR(a,o,s,u,d)),(a=i[1])&&t.push(new OR(a,u,s,c,d)),(a=i[2])&&t.push(new OR(a,o,d,u,l)),(a=i[3])&&t.push(new OR(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}var nbe=o((()=>{kR()}));function rbe(e){return e[0]}function ibe(e){return arguments.length?(this._x=e,this):this._x}var abe=o((()=>{}));function obe(e){return e[1]}function sbe(e){return arguments.length?(this._y=e,this):this._y}var cbe=o((()=>{}));function AR(e,t,n){var r=new jR(t??rbe,n??obe,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function jR(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function MR(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var NR,lbe=o((()=>{Lye(),zye(),Vye(),Uye(),Gye(),Jye(),Xye(),Qye(),ebe(),nbe(),abe(),cbe(),NR=AR.prototype=jR.prototype,NR.copy=function(){var e=new jR(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=MR(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=MR(r));return e},NR.add=Fye,NR.addAll=Iye,NR.cover=Rye,NR.data=Bye,NR.extent=Hye,NR.find=Wye,NR.remove=Kye,NR.removeAll=qye,NR.root=Yye,NR.size=Zye,NR.visit=$ye,NR.visitAfter=tbe,NR.x=ibe,NR.y=sbe})),PR=o((()=>{lbe()}));function FR(e){return function(){return e}}var IR=o((()=>{}));function LR(e){return(e()-.5)*1e-6}var RR=o((()=>{}));function ube(e){return e.x+e.vx}function dbe(e){return e.y+e.vy}function fbe(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=FR(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;ml.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_u+m||ad+m||oe.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r{PR(),IR(),RR()}));function mbe(e){return e.index}function zR(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function hbe(e){var t=mbe,n=d,r,i=FR(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n[t(e,n,o),e])),d;for(n=0,s=Array(i);n{IR(),RR()}));function BR(){for(var e=0,t=arguments.length,n={},r;e=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}function vbe(e,t){for(var n=0,r=e.length,i;n{UR={value:()=>{}},VR.prototype=BR.prototype={constructor:VR,on:function(e,t){var n=this._,r=_be(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var n=Array(i),r=0,i,a;r{ybe()}));function WR(){return nz||=(az(xbe),iz.now()+rz)}function xbe(){nz=0}function GR(){this._call=this._time=this._next=null}function KR(e,t,n){var r=new GR;return r.restart(e,t,n),r}function Sbe(){WR(),++YR;for(var e=$R,t;e;)(t=nz-e._time)>=0&&e._call.call(void 0,t),e=e._next;--YR}function qR(){nz=(tz=iz.now())+rz,YR=XR=0;try{Sbe()}finally{YR=0,wbe(),nz=0}}function Cbe(){var e=iz.now(),t=e-tz;t>QR&&(rz-=t,tz=e)}function wbe(){for(var e,t=$R,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$R=n);ez=e,JR(r)}function JR(e){YR||(XR&&=clearTimeout(XR),e-nz>24?(e<1/0&&(XR=setTimeout(qR,e-iz.now()-rz)),ZR&&=clearInterval(ZR)):(ZR||=(tz=iz.now(),setInterval(Cbe,QR)),YR=1,az(qR)))}var YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,oz=o((()=>{YR=0,XR=0,ZR=0,QR=1e3,tz=0,nz=0,rz=0,iz=typeof performance==`object`&&performance.now?performance:Date,az=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)},GR.prototype=KR.prototype={constructor:GR,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?WR():+n)+(t==null?0:+t),!this._next&&ez!==this&&(ez?ez._next=this:$R=this,ez=this),this._call=e,this._time=n,JR()},stop:function(){this._call&&(this._call=null,this._time=1/0,JR())}}}));function Tbe(e,t,n){var r=new GR,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=n==null?WR():+n,r._restart(function a(o){o+=i,r._restart(a,i+=t,n),e(o)},t,n)},r.restart(e,t,n),r)}var Ebe=o((()=>{oz()})),sz=o((()=>{oz(),Ebe()}));function Dbe(){let e=1;return()=>(e=(cz*e+lz)%uz)/uz}var cz,lz,uz,Obe=o((()=>{cz=1664525,lz=1013904223,uz=4294967296}));function kbe(e){return e.x}function Abe(e){return e.y}function jbe(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=new Map,c=KR(d),l=BR(`tick`,`end`),u=Dbe();e??=[];function d(){f(),l.call(`tick`,t),n1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i1?(l.on(e,n),t):l.on(e)}}}var dz,fz,pz=o((()=>{bbe(),sz(),Obe(),dz=10,fz=Math.PI*(3-Math.sqrt(5))}));function Mbe(){var e,t,n,r,i=FR(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=AR(e,kbe,Abe).visitAfter(d);for(r=n,i=0;i=s)){(e.data!==t||e.next)&&(d===0&&(d=LR(n),m+=d*d),f===0&&(f=LR(n),m+=f*f),m{PR(),IR(),RR(),pz()}));function Pbe(e){var t=FR(.1),n,r,i;typeof e!=`function`&&(e=FR(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t{IR()}));function Ibe(e){var t=FR(.1),n,r,i;typeof e!=`function`&&(e=FR(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t{IR()})),Rbe=o((()=>{Pye(),pbe(),gbe(),Nbe(),IR(),pz(),Fbe(),Lbe()})),zbe=c({force:()=>mz});function mz(e){G.call(this,null,e)}function Bbe(e,t){return()=>e.touch(t).run()}function Vbe(e,t){let n=jbe(e),r=n.stop,i=n.restart,a=!1;return n.stopped=()=>a,n.restart=()=>(a=!1,i()),n.stop=()=>(a=!0,r()),hz(n,t,!0).on(`end`,()=>a=!0)}function hz(e,t,n,r){var i=_h(t.forces),a,o,s,c;for(a=0,o=vz.length;at(e,n):t)}var gz,_z,vz,yz,bz,Gbe=o((()=>{nx(),dg(),Rbe(),gz={center:Nye,collide:fbe,nbody:Mbe,link:hbe,x:Pbe,y:Ibe},_z=`forces`,vz=[`alpha`,`alphaMin`,`alphaTarget`,`velocityDecay`,`forces`],yz=[`static`,`iterations`],bz=[`x`,`y`,`vx`,`vy`],mz.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:bz}]},U(mz,G,{transform(e,t){var n=this.value,r=t.changed(t.ADD_REM),i=e.modified(vz),a=e.iterations||300;if(n?(r&&(t.modifies(`index`),n.nodes(t.source)),(i||t.changed(t.MOD))&&hz(n,e,0,t)):(this.value=n=Vbe(t.source,e),n.on(`tick`,Bbe(t.dataflow,this)),e.static||(r=!0,n.tick()),t.modifies(`index`)),i||r||e.modified(yz)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-n.alphaMin()**(1/a)),e.static)for(n.stop();--a>=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){let n=t.dataflow;for(let e=this._argops,t=0,s=e.length,c;t{}));function txe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function nxe(){return this.eachAfter(txe)}var rxe=o((()=>{}));function ixe(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}var axe=o((()=>{}));function oxe(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}var sxe=o((()=>{}));function cxe(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o{}));function uxe(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}var dxe=o((()=>{}));function fxe(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}var pxe=o((()=>{}));function mxe(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}var hxe=o((()=>{}));function gxe(e){for(var t=this,n=_xe(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function _xe(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}var vxe=o((()=>{}));function yxe(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}var bxe=o((()=>{}));function xxe(){return Array.from(this)}var Sxe=o((()=>{}));function Cxe(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}var wxe=o((()=>{}));function Txe(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}var Exe=o((()=>{}));function*Dxe(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i{}));function xz(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=jxe)):t===void 0&&(t=Axe);for(var n=new Cz(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new Cz(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(Sz)}function kxe(){return xz(this).eachBefore(Mxe)}function Axe(e){return e.children}function jxe(e){return Array.isArray(e)?e[1]:null}function Mxe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Sz(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Cz(e){this.data=e,this.depth=this.height=0,this.parent=null}var wz=o((()=>{rxe(),axe(),sxe(),lxe(),dxe(),pxe(),hxe(),vxe(),bxe(),Sxe(),wxe(),Exe(),Oxe(),Cz.prototype=xz.prototype={constructor:Cz,count:nxe,each:ixe,eachAfter:cxe,eachBefore:oxe,find:uxe,sum:fxe,sort:mxe,path:gxe,ancestors:yxe,descendants:xxe,leaves:Cxe,links:Txe,copy:kxe,[Symbol.iterator]:Dxe}}));function Tz(e){return e==null?null:Ez(e)}function Ez(e){if(typeof e!=`function`)throw Error();return e}var Dz=o((()=>{}));function Oz(){return 0}function kz(e){return function(){return e}}var Az=o((()=>{}));function Nxe(){let e=1;return()=>(e=(jz*e+Mz)%Nz)/Nz}var jz,Mz,Nz,Pxe=o((()=>{jz=1664525,Mz=1013904223,Nz=4294967296}));function Fxe(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ixe(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}var Pz=o((()=>{}));function Lxe(e,t){for(var n=0,r=(e=Ixe(Array.from(e),t)).length,i=[],a,o;n0&&n*n>r*r+i*i}function Lz(e,t){for(var n=0;n1e-6?(D+Math.sqrt(D*D-4*E*O))/(2*E):O/D);return{x:r+S+C*k,y:i+w+T*k,r:k}}var Bz=o((()=>{Pz()}));function Vz(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function Hz(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Uz(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Wz(e){this._=e,this.next=null,this.previous=null}function Vxe(e,t){if(!(a=(e=Fxe(e)).length))return 0;var n=e[0],r,i,a,o,s,c,l,u,d,f;if(n.x=0,n.y=0,!(a>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;Vz(r,n,i=e[2]),n=new Wz(n),r=new Wz(r),i=new Wz(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;pack:for(c=3;c{Pz(),Bz()}));function Hxe(e){return Math.sqrt(e.value)}function Uxe(){var e=null,t=1,n=1,r=Oz;function i(i){let a=Nxe();return i.x=t/2,i.y=n/2,e?i.eachBefore(Kz(e)).eachAfter(qz(r,.5,a)).eachBefore(Jz(1)):i.eachBefore(Kz(Hxe)).eachAfter(qz(Oz,1,a)).eachAfter(qz(r,i.r/Math.min(t,n),a)).eachBefore(Jz(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=Tz(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r=typeof e==`function`?e:kz(+e),i):r},i}function Kz(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function qz(e,t,n){return function(r){if(i=r.children){var i,a,o=i.length,s=e(r)*t||0,c;if(s)for(a=0;a{Dz(),Az(),Pxe(),Gz()}));function Yz(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}var Xz=o((()=>{}));function Zz(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s{}));function Gxe(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(a(t,o)),r&&i.eachBefore(Yz),i}function a(e,t){return function(r){r.children&&Zz(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,a=r.y0,o=r.x1-n,s=r.y1-n;o{Xz(),Qz()}));function qxe(e){return e.id}function Jxe(e){return e.parentId}function $z(){var e=qxe,t=Jxe,n;function r(r){var i=Array.from(r),a=e,o=t,s,c,l,u,d,f,p,m,h=new Map;if(n!=null){let e=i.map((e,t)=>Yxe(n(e,t,r))),t=e.map(eB),s=new Set(e).add(``);for(let n of t)s.has(n)||(s.add(n),e.push(n),t.push(eB(n)),i.push(iB));a=(t,n)=>e[n],o=(e,n)=>t[n]}for(l=0,s=i.length;l=0&&(f=i[e],f.data===iB);--e)f.data=null}if(u.parent=nB,u.eachBefore(function(e){e.depth=e.parent.depth+1,--s}).eachBefore(Sz),u.parent=null,s>0)throw Error(`cycle`);return u}return r.id=function(t){return arguments.length?(e=Tz(t),r):e},r.parentId=function(e){return arguments.length?(t=Tz(e),r):t},r.path=function(e){return arguments.length?(n=Tz(e),r):n},r}function Yxe(e){e=`${e}`;let t=e.length;return tB(e,t-1)&&!tB(e,t-2)&&(e=e.slice(0,-1)),e[0]===`/`?e:`/${e}`}function eB(e){let t=e.length;if(t<2)return``;for(;--t>1&&!tB(e,t););return e.slice(0,t)}function tB(e,t){if(e[t]===`/`){let n=0;for(;t>0&&e[--t]===`\\`;)++n;if(!(n&1))return!0}return!1}var nB,rB,iB,Xxe=o((()=>{Dz(),wz(),nB={depth:-1},rB={},iB={}}));function Zxe(e,t){return e.parent===t.parent?1:2}function aB(e){var t=e.children;return t?t[0]:e.t}function oB(e){var t=e.children;return t?t[t.length-1]:e.t}function Qxe(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function $xe(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function eSe(e,t,n){return e.a.parent===t.parent?e.a:n}function sB(e,t){this._=e,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=t}function tSe(e){for(var t=new sB(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new sB(a[o],o)),i.parent=n;return(t.parent=new sB(null,0)).children=[t],t}function nSe(){var e=Zxe,t=1,n=1,r=null;function i(i){var s=tSe(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.xu.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){$xe(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=oB(o),i=aB(i),o&&i;)s=aB(s),a=oB(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(Qxe(eSe(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!oB(a)&&(a.t=o,a.m+=u-l),i&&!aB(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}var rSe=o((()=>{wz(),sB.prototype=Object.create(Cz.prototype)}));function cB(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s{}));function uB(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;uv&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p{Qz(),lB(),dB=(1+Math.sqrt(5))/2,fB=(function e(t){function n(e,n,r,i,a){uB(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(dB)}));function iSe(){var e=fB,t=!1,n=1,r=1,i=[0],a=Oz,o=Oz,s=Oz,c=Oz,l=Oz;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(Yz),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d{Xz(),pB(),Dz(),Az()}));function oSe(e,t,n,r,i){var a=e.children,o,s=a.length,c,l=Array(s+1);for(l[0]=c=o=0;o=t-1){var c=a[e];c.x0=r,c.y0=i,c.x1=o,c.y1=s;return}for(var d=l[e],f=n/2+d,p=e+1,m=t-1;p>>1;l[h]s-i){var v=n?(r*_+o*g)/n:o;u(e,p,g,r,i,v,s),u(p,t,_,v,i,o,s)}else{var y=n?(i*_+s*g)/n:s;u(e,p,g,r,i,o,y),u(p,t,_,r,y,o,s)}}}var sSe=o((()=>{}));function cSe(e,t,n,r,i){(e.depth&1?cB:Zz)(e,t,n,r,i)}var lSe=o((()=>{Qz(),lB()})),mB,uSe=o((()=>{Qz(),lB(),pB(),mB=(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u1?t:1)},n})(dB)})),dSe=o((()=>{exe(),wz(),Wxe(),Gz(),Bz(),Kxe(),Xxe(),rSe(),aSe(),sSe(),Qz(),lB(),lSe(),pB(),uSe()})),fSe=c({nest:()=>gB,pack:()=>vB,partition:()=>yB,stratify:()=>bB,tree:()=>xB,treelinks:()=>SB,treemap:()=>CB});function hB(e,t,n){let r={};return e.each(e=>{let i=e.data;n(i)&&(r[t(i)]=e)}),e.lookup=r,e}function gB(e){G.call(this,null,e)}function pSe(){let e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;let i=t.length,a=e[r++],o={},s={},c=-1,l,u,d;for(;++ce.length)return t;let i=[];for(let e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function _B(e){G.call(this,null,e)}function mSe(e,t,n){for(let r,i=0,a=t.length;i{nx(),dg(),dSe(),gB.Definition={type:`Nest`,metadata:{treesource:!0,changes:!0},params:[{name:`keys`,type:`field`,array:!0},{name:`generate`,type:`boolean`}]},wB=e=>e.values,U(gB,G,{transform(e,t){t.source||V(`Nest transform requires an upstream data source.`);var n=e.generate,r=e.modified(),i=t.clone(),a=this.value;return(!a||r||t.changed())&&(a&&a.each(e=>{e.children&&Tb(e.data)&&i.rem.push(e.data)}),this.value=a=xz({values:_h(e.keys).reduce((e,t)=>(e.key(t),e),pSe()).entries(i.source)},wB),n&&a.each(e=>{e.children&&(e=Db(e.data),i.add.push(e),i.source.push(e))}),hB(a,Eb,Eb)),i.source.root=a,i}}),TB=(e,t)=>e.parent===t.parent?1:2,U(_B,G,{transform(e,t){(!t.source||!t.source.root)&&V(this.constructor.name+` transform requires a backing tree data source.`);let n=this.layout(e.method),r=this.fields,i=t.source.root,a=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(Ab(e.sort,e=>e.data)),mSe(n,this.params,e),n.separation&&n.separation(e.separation===!1?Im:TB);try{this.value=n(i)}catch(e){V(e)}return i.each(e=>hSe(e,r,a)),t.reflow(e.modified()).modifies(a).modifies(`leaf`)}}),EB=[`x`,`y`,`r`,`depth`,`children`],vB.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:EB.length,default:EB}]},U(vB,_B,{layout:Uxe,params:[`radius`,`size`,`padding`],fields:EB}),DB=[`x0`,`y0`,`x1`,`y1`,`depth`,`children`],yB.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:DB.length,default:DB}]},U(yB,_B,{layout:Gxe,params:[`size`,`round`,`padding`],fields:DB}),bB.Definition={type:`Stratify`,metadata:{treesource:!0},params:[{name:`key`,type:`field`,required:!0},{name:`parentKey`,type:`field`,required:!0}]},U(bB,G,{transform(e,t){t.source||V(`Stratify transform requires an upstream data source.`);let n=this.value,r=e.modified(),i=t.fork(t.ALL).materialize(t.SOURCE),a=!n||r||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return i.source=i.source.slice(),a&&(n=i.source.length?hB($z().id(e.key).parentId(e.parentKey)(i.source),e.key,Lm):hB($z()([{}]),e.key,e.key)),i.source.root=this.value=n,i}}),OB={tidy:nSe,cluster:$be},kB=[`x`,`y`,`depth`,`children`],xB.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:kB.length,default:kB}]},U(xB,_B,{layout(e){let t=e||`tidy`;if(Ph(OB,t))return OB[t]();V(`Unrecognized Tree layout method: `+t)},params:[`size`,`nodeSize`],fields:kB}),SB.Definition={type:`TreeLinks`,metadata:{tree:!0,generates:!0,changes:!0},params:[]},U(SB,G,{transform(e,t){let n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),a={};return r||V(`TreeLinks transform requires a tree data source.`),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,e=>a[Eb(e)]=1),r.each(e=>{let t=e.data,n=e.parent&&e.parent.data;n&&a[Eb(t)]&&a[Eb(n)]&&i.add.push(Db({source:n,target:t}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>a[Eb(e)]=1),n.forEach(e=>{(a[Eb(e.source)]||a[Eb(e.target)])&&i.mod.push(e)})),i}}),AB={binary:oSe,dice:Zz,slice:cB,slicedice:cSe,squarify:fB,resquarify:mB},jB=[`x0`,`y0`,`x1`,`y1`,`depth`,`children`],CB.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:jB.length,default:jB}]},U(CB,_B,{layout(){let e=iSe();return e.ratio=t=>{let n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Ph(AB,t)?e.tile(AB[t]):V(`Unrecognized Treemap layout method: `+t)},e},params:[`method`,`ratio`,`size`,`round`,`padding`,`paddingInner`,`paddingOuter`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`],fields:jB})})),_Se=c({label:()=>LB});function vSe(e,t){let n=e.bitmap();return(t||[]).forEach(t=>n.set(e(t.boundary[0]),e(t.boundary[3]))),[n,void 0]}function ySe(e,t,n,r,i){let a=e.width,o=e.height,s=r||i,c=IC(a,o).getContext(`2d`),l=IC(a,o).getContext(`2d`),u=s&&IC(a,o).getContext(`2d`);n.forEach(e=>NB(c,e,!1)),NB(l,t,!1),s&&NB(u,t,!0);let d=MB(c,a,o),f=MB(l,a,o),p=s&&MB(u,a,o),m=e.bitmap(),h=s&&e.bitmap(),g,_,v,y,b,x,S,C;for(_=0;_{t.items.forEach(t=>NB(e,t.items,n))}):NA[r].draw(e,{items:n?t.map(bSe):t})}function bSe(e){let t=kb(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:`#000`,fillOpacity:0}:t}function xSe(e,t){let n=new Uint32Array(~~((e*t+VB)/VB));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{let i=r*e+t;return n[i>>>zB]&1<<(i&BB)},set:(t,n)=>{let i=n*e+t;r(i>>>zB,1<<(i&BB))},clear:(t,n)=>{let r=n*e+t;i(r>>>zB,~(1<<(r&BB)))},getRange:(t,r,i,a)=>{let o=a,s,c,l,u;for(;o>=r;--o)if(s=o*e+t,c=o*e+i,l=s>>>zB,u=c>>>zB,l===u){if(n[l]&HB[s&BB]&UB[(c&BB)+1])return!0}else{if(n[l]&HB[s&BB]||n[u]&UB[(c&BB)+1])return!0;for(let e=l+1;e{let o,s,c,l,u;for(;n<=a;++n)if(o=n*e+t,s=n*e+i,c=o>>>zB,l=s>>>zB,c===l)r(c,HB[o&BB]&UB[(s&BB)+1]);else for(r(c,HB[o&BB]),r(l,UB[(s&BB)+1]),u=c+1;u{let o,s,c,l,u;for(;n<=a;++n)if(o=n*e+t,s=n*e+r,c=o>>>zB,l=s>>>zB,c===l)i(c,UB[o&BB]|HB[(s&BB)+1]);else for(i(c,UB[o&BB]),i(l,HB[(s&BB)+1]),u=c+1;un<0||r<0||a>=t||i>=e}}function SSe(e,t,n){let r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),a=~~((t+2*n+r)/r),o=e=>~~((e+n)/r);return o.invert=e=>e*r-n,o.bitmap=()=>xSe(i,a),o.ratio=r,o.padding=n,o.width=e,o.height=t,o}function CSe(e,t,n,r){let i=e.width,a=e.height;return function(e){let t=e.datum.datum.items[r].items,n=t.length,o=e.datum.fontSize,s=jA.width(e.datum,e.datum.text),c=0,l,u,d,f,p,m,h;for(let r=0;r=c&&(c=h,e.x=p,e.y=m);return p=s/2,m=o/2,l=e.x-p,u=e.x+p,d=e.y-m,f=e.y+m,e.align=`center`,l<0&&u<=i?e.align=`left`:0<=l&&ii||t-(o=r/2)<0||t+o>a}function FB(e,t,n,r,i,a,o,s){let c=i*a/(r*2),l=e(t-c),u=e(t+c),d=e(n-(a/=2)),f=e(n+a);return o.outOfBounds(l,d,u,f)||o.getRange(l,d,u,f)||s&&s.getRange(l,d,u,f)}function wSe(e,t,n,r){let i=e.width,a=e.height,o=t[0],s=t[1];function c(t,n,r,c,l){let u=e.invert(t),d=e.invert(n),f=r,p=a,m;if(!PB(u,d,c,l,i,a)&&!FB(e,u,d,l,c,f,o,s)&&!FB(e,u,d,l,c,l,o,null)){for(;p-f>=1;)m=(f+p)/2,FB(e,u,d,l,c,m,o,s)?p=m:f=m;if(f>r)return[u,d,f,!0]}}return function(t){let s=t.datum.datum.items[r].items,l=s.length,u=t.datum.fontSize,d=jA.width(t.datum,t.datum.text),f=n?u:0,p=!1,m=!1,h=0,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M;for(let r=0;r_&&(M=g,g=_,_=M),v>y&&(M=v,v=y,y=M),w=e(g),E=e(_),T=~~((w+E)/2),D=e(v),k=e(y),O=~~((D+k)/2),S=T;S>=w;--S)for(C=O;C>=D;--C)j=c(S,C,f,d,u),j&&([t.x,t.y,f,p]=j);for(S=T;S<=E;++S)for(C=O;C<=k;++C)j=c(S,C,f,d,u),j&&([t.x,t.y,f,p]=j);!p&&!n&&(A=Math.abs(_-g+y-v),b=(g+_)/2,x=(v+y)/2,A>=h&&!PB(b,x,d,u,i,a)&&!FB(e,b,x,u,d,u,o,null)&&(h=A,t.x=b,t.y=x,m=!0))}return p||m?(b=d/2,x=u/2,o.setRange(e(t.x-b),e(t.y-x),e(t.x+b),e(t.y+x)),t.align=`center`,t.baseline=`middle`,!0):!1}}function TSe(e,t,n,r){let i=e.width,a=e.height,o=t[0],s=t[1],c=e.bitmap();return function(t){let l=t.datum.datum.items[r].items,u=l.length,d=t.datum.fontSize,f=jA.width(t.datum,t.datum.text),p=[],m=n?d:0,h=!1,g=!1,_=0,v,y,b,x,S,C,w,T,E,D,O,k;for(let r=0;r=1;)O=(E+D)/2,FB(e,S,C,d,f,O,o,s)?D=O:E=O;E>m&&(t.x=S,t.y=C,m=E,h=!0)}}!h&&!n&&(k=Math.abs(y-v+x-b),S=(v+y)/2,C=(b+x)/2,k>=_&&!PB(S,C,f,d,i,a)&&!FB(e,S,C,d,f,d,o,null)&&(_=k,t.x=S,t.y=C,g=!0))}return h||g?(S=f/2,C=d/2,o.setRange(e(t.x-S),e(t.y-C),e(t.x+S),e(t.y+C)),t.align=`center`,t.baseline=`middle`,!0):!1}}function ESe(e,t,n,r){let i=e.width,a=e.height,o=t[0],s=t[1],c=r.length;return function(t){let l=t.boundary,u=t.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>a)return!1;let d=t.textWidth??0,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E;for(let i=0;i>>2&3)-1,m=f===0&&p===0||r[i]<0,h=f&&p?Math.SQRT1_2:1,g=r[i]<0?-1:1,_=l[1+f]+r[i]*f*h,S=l[4+p]+g*u*p/2+r[i]*p*h,y=S-u/2,b=S+u/2,C=e(_),T=e(y),E=e(b),!d)if(IB(C,C,T,E,o,s,_,_,y,b,l,m))d=jA.width(t.datum,t.datum.text);else continue;if(x=_+g*d*f/2,_=x-d/2,v=x+d/2,C=e(_),w=e(v),IB(C,w,T,E,o,s,_,v,y,b,l,m))return t.x=f?f*g<0?v:_:x,t.y=p?p*g<0?b:y:S,t.align=KB[f*g+1],t.baseline=qB[p*g+1],o.setRange(C,T,w,E),!0}return!1}}function IB(e,t,n,r,i,a,o,s,c,l,u,d){return!(i.outOfBounds(e,n,t,r)||(d&&a||i).getRange(e,n,t,r))}function DSe(e,t,n,r,i,a,o,s,c,l,u){if(!e.length)return e;let d=Math.max(r.length,i.length),f=OSe(r,d),p=kSe(i,d),m=ASe(e[0].datum),h=m===`group`&&e[0].datum.items[c].marktype,g=h===`area`,_=jSe(m,h,s,c),v=l===null||l===1/0,y=g&&u===`naive`,b=-1,x=-1,S=e.map(e=>{let t=v?jA.width(e,e.text):void 0;return b=Math.max(b,t),x=Math.max(x,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:_(e),textWidth:t}});l=l===null||l===1/0?Math.max(b,x)+Math.max(...r):l;let C=SSe(t[0],t[1],l),w;if(!y){n&&S.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;ee.datum);w=a.length||r?ySe(C,r||[],a,t,g):vSe(C,o&&S)}let T=g?YB[u](C,w,o,c):ESe(C,w,p,f);return S.forEach(e=>e.opacity=+T(e)),S}function OSe(e,t){let n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?e===`line`||e===`area`?e=>i(e.datum):t===`line`?e=>{let t=e.datum.items[r].items;return i(t.length?t[n===`start`?0:t.length-1]:{x:NaN,y:NaN})}:e=>{let t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}function LB(e){G.call(this,null,e)}var RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,MSe=o((()=>{Uj(),RC(),nx(),dg(),RB=4278190080,zB=5,BB=31,VB=32,HB=new Uint32Array(33),UB=new Uint32Array(33),UB[0]=0,HB[0]=~UB[0];for(let e=1;e<=VB;++e)UB[e]=UB[e-1]<<1|1,HB[e]=~UB[e];WB=[-1,-1,1,1],GB=[-1,1,-1,1],KB=[`right`,`center`,`left`],qB=[`bottom`,`middle`,`top`],JB={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},YB={naive:CSe,"reduced-search":wSe,floodfill:TSe},XB=[`x`,`y`,`opacity`,`align`,`baseline`],ZB=[`top-left`,`left`,`bottom-left`,`top`,`bottom`,`top-right`,`right`,`bottom-right`],LB.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:ZB},{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:XB.length,default:XB}]},U(LB,G,{transform(e,t){function n(n){let r=e[n];return bh(r)&&t.modified(r.fields)}let r=e.modified();if(!(r||t.changed(t.ADD_REM)||n(`sort`)))return;(!e.size||e.size.length!==2)&&V(`Size parameter should be specified as a [width, height] array.`);let i=e.as||XB;return DSe(t.materialize(t.SOURCE).source||[],e.size,e.sort,_h(e.offset==null?1:e.offset),_h(e.anchor||ZB),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||`end`,e.markIndex||0,e.padding===void 0?0:e.padding,e.method||`naive`).forEach(e=>{let t=e.datum;t[i[0]]=e.x,t[i[1]]=e.y,t[i[2]]=e.opacity,t[i[3]]=e.align,t[i[4]]=e.baseline}),t.reflow(r).modifies(i)}})})),NSe=c({loess:()=>$B,regression:()=>eV});function QB(e,t){var n=[],r=function(e){return e(s)},i,a,o,s,c,l;if(t==null)n.push(e);else for(i={},a=0,o=e.length;a{Nx(),nx(),dg(),$B.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}]},U($B,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=t.materialize(t.SOURCE).source,i=QB(r,e.groupby),a=(e.groupby||[]).map(xm),o=a.length,s=e.as||[xm(e.x),xm(e.y)],c=[];i.forEach(t=>{Vle(t,e.x,e.y,e.bandwidth||.3).forEach(e=>{let n={};for(let e=0;ee===`poly`?t:e===`quad`?2:1,eV.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(tV)},{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}]},U(eV,G,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=t.materialize(t.SOURCE).source,i=QB(r,e.groupby),a=(e.groupby||[]).map(xm),o=e.method||`linear`,s=e.order==null?3:e.order,c=nV(o,s),l=e.as||[xm(e.x),xm(e.y)],u=tV[o],d=[],f=e.extent;Ph(tV,o)||V(`Invalid regression method: `+o),f!=null&&o===`log`&&f[0]<=0&&(t.dataflow.warn(`Ignoring extent with values <= 0 for log regression.`),f=null),i.forEach(n=>{if(n.length<=c){t.dataflow.warn(`Skipping regression with more parameters than data points.`);return}let r=u(n,e.x,e.y,s);if(e.params){d.push(Db({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));return}let i=f||Mh(n,e.x),p=e=>{let t={};for(let e=0;ep([e,r.predict(e)])):Dx(r.predict,i,25,200).forEach(p)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=d}return n}})}));function rV(e,t,n,r,i){let a,o,s,c,l=t[0],u=r[0],d=0,f=0;u>l==u>-l?(a=l,l=t[++d]):(a=u,u=r[++f]);let p=0;if(dl==u>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[p++]=s);dl==u>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f]),a=o,s!==0&&(i[p++]=s);for(;d{iV=11102230246251565e-32,aV=134217729,oV=3.000000000000001*iV}));function ISe(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e-i,E=n-i,D=t-a,O=r-a;b=T*O,f=aV*T,p=f-(f-T),m=T-p,f=aV*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=D*E,f=aV*D,p=f-(f-D),m=D-p,f=aV*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,fV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,fV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,fV[2]=v-(w-d)+(_-d),fV[3]=w;let k=FSe(4,fV),A=uV*o;if(k>=A||-k>=A||(d=e-T,s=e-(T+d)+(d-i),d=n-E,l=n-(E+d)+(d-i),d=t-D,c=t-(D+d)+(d-a),d=r-O,u=r-(O+d)+(d-a),s===0&&c===0&&l===0&&u===0)||(A=dV*o+oV*Math.abs(k),k+=T*u+O*s-(D*l+E*c),k>=A||-k>=A))return k;b=s*O,f=aV*s,p=f-(f-s),m=s-p,f=aV*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=c*E,f=aV*c,p=f-(f-c),m=c-p,f=aV*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,gV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,gV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,gV[2]=v-(w-d)+(_-d),gV[3]=w;let j=rV(4,fV,4,gV,pV);b=T*u,f=aV*T,p=f-(f-T),m=T-p,f=aV*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=D*l,f=aV*D,p=f-(f-D),m=D-p,f=aV*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,gV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,gV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,gV[2]=v-(w-d)+(_-d),gV[3]=w;let M=rV(j,pV,4,gV,mV);b=s*u,f=aV*s,p=f-(f-s),m=s-p,f=aV*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=c*l,f=aV*c,p=f-(f-c),m=c-p,f=aV*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,gV[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,gV[1]=y-(_+d)+(d-S),w=v+_,d=w-v,gV[2]=v-(w-d)+(_-d),gV[3]=w;let ee=rV(M,mV,4,gV,hV);return hV[ee-1]}function cV(e,t,n,r,i,a){let o=(t-a)*(n-i),s=(e-i)*(r-a),c=o-s,l=Math.abs(o+s);return Math.abs(c)>=lV*l?c:-ISe(e,t,n,r,i,a,l)}var lV,uV,dV,fV,pV,mV,hV,gV,LSe=o((()=>{sV(),lV=(3+16*iV)*iV,uV=(2+12*iV)*iV,dV=(9+64*iV)*iV*iV,fV=K(4),pV=K(8),mV=K(12),hV=K(16),gV=K(4)})),RSe=o((()=>{sV(),(7+56*iV)*iV,(3+28*iV)*iV,(26+288*iV)*iV*iV,K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(8),K(8),K(8),K(4),K(8),K(8),K(16),K(12),K(192),K(192)})),zSe=o((()=>{sV(),(10+96*iV)*iV,(4+48*iV)*iV,(44+576*iV)*iV*iV,K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(8),K(8),K(8),K(8),K(8),K(8),K(8),K(8),K(8),K(4),K(4),K(4),K(8),K(16),K(16),K(16),K(32),K(32),K(48),K(64),K(1152),K(1152)})),BSe=o((()=>{sV(),(16+224*iV)*iV,(5+72*iV)*iV,(71+1408*iV)*iV*iV,K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(4),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(24),K(1152),K(1152),K(1152),K(1152),K(1152),K(2304),K(2304),K(3456),K(5760),K(8),K(8),K(8),K(16),K(24),K(48),K(48),K(96),K(192),K(384),K(384),K(384),K(768),K(96),K(96),K(96),K(1152)})),VSe=o((()=>{LSe(),RSe(),zSe(),BSe()}));function HSe(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function _V(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}function USe(e,t,n,r,i,a,o,s){let c=e-o,l=t-s,u=n-o,d=r-s,f=i-o,p=a-s,m=c*c+l*l,h=u*u+d*d,g=f*f+p*p;return c*(d*g-h*p)-l*(u*g-h*f)+m*(u*p-d*f)<0}function WSe(e,t,n,r,i,a){let o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c),p=(l*u-s*d)*f,m=(o*d-c*u)*f;return p*p+m*m}function GSe(e,t,n,r,i,a){let o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c);return{x:e+(l*u-s*d)*f,y:t+(o*d-c*u)*f}}function vV(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){let r=e[i],a=t[r],o=i-1;for(;o>=n&&t[e[o]]>a;)e[o+1]=e[o--];e[o+1]=r}else{let i=n+r>>1,a=n+1,o=r;yV(e,i,a),t[e[n]]>t[e[r]]&&yV(e,n,r),t[e[a]]>t[e[r]]&&yV(e,a,r),t[e[n]]>t[e[a]]&&yV(e,n,a);let s=e[a],c=t[s];for(;;){do a++;while(t[e[a]]c);if(o=o-n?(vV(e,t,a,r),vV(e,t,n,o-1)):(vV(e,t,n,o-1),vV(e,t,a,r))}}function yV(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function KSe(e){return e[0]}function qSe(e){return e[1]}var bV,xV,SV,JSe=o((()=>{VSe(),bV=2**-52,xV=new Uint32Array(512),SV=class e{static from(t,n=KSe,r=qSe){let i=t.length,a=new Float64Array(i*2);for(let e=0;e>1;if(t>0&&typeof e[0]!=`number`)throw Error(`Expected coords to contain numbers.`);this.coords=e;let n=Math.max(2*t-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*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),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.trianglesLen=0,this._cx=0,this._cy=0,this._hullStart=0,this.hull=this._triangles,this.triangles=this._triangles,this.halfedges=this._halfedges,this.update()}update(){let{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=e.length>>1,o=1/0,s=1/0,c=-1/0,l=-1/0;for(let t=0;tc&&(c=n),r>l&&(l=r),this._ids[t]=t}let u=(o+c)/2,d=(s+l)/2,f=0,p=0,m=0;for(let t=0,n=1/0;t0&&(p=t,n=r)}let _=e[2*p],v=e[2*p+1],y=1/0;for(let t=0;tr&&(t[n++]=i,r=a)}this.hull=t.subarray(0,n),this.triangles=new Uint32Array,this.halfedges=new Int32Array;return}if(cV(h,g,_,v,b,x)<0){let e=p,t=_,n=v;p=m,_=b,v=x,m=e,b=t,x=n}let S=GSe(h,g,_,v,b,x);this._cx=S.x,this._cy=S.y;for(let t=0;t0&&Math.abs(l-o)<=bV&&Math.abs(u-s)<=bV||(o=l,s=u,c===f||c===p||c===m))continue;let d=0;for(let e=0,t=this._hashKey(l,u);e=0;)if(h=g,h===d){h=-1;break}if(h===-1)continue;let _=this._addTriangle(h,c,n[h],-1,-1,r[h]);r[c]=this._legalize(_+2),r[h]=_,C++;let v=n[h];for(;g=n[v],cV(l,u,e[2*v],e[2*v+1],e[2*g],e[2*g+1])<0;)_=this._addTriangle(v,c,g,r[c],-1,r[v]),r[c]=this._legalize(_+2),n[v]=v,C--,v=g;if(h===d)for(;g=t[h],cV(l,u,e[2*g],e[2*g+1],e[2*h],e[2*h+1])<0;)_=this._addTriangle(g,c,h,-1,r[h],r[g]),this._legalize(_+2),r[g]=_,n[h]=h,C--,h=g;this._hullStart=t[c]=h,n[h]=t[v]=c,n[c]=v,i[this._hashKey(l,u)]=c,i[this._hashKey(e[2*h],e[2*h+1])]=h}this.hull=new Uint32Array(C);for(let e=0,t=this._hullStart;e{CV=1e-6,wV=class{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,n){e=+e,t=+t,n=+n;let r=e+n,i=t;if(n<0)throw Error(`negative radius`);this._x1===null?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>CV||Math.abs(this._y1-i)>CV)&&(this._+=`L`+r+`,`+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}})),EV,DV=o((()=>{EV=class{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}}})),OV,kV=o((()=>{TV(),DV(),OV=class{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t))||!((i=+i)>=(n=+n)))throw Error(`invalid bounds`);this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this,i,a,o=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r=0,s=0,c=n.length,l,u;r1;)i-=2;for(let e=2;e0){if(t>=this.ymax)return null;(a=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(a=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t1e-10)return!1}return!0}function QSe(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}function $Se(e,t,n,r){let i=e.length,a=new Float64Array(i*2);for(let o=0;o{JSe(),TV(),DV(),kV(),AV=2*Math.PI,jV=Math.pow,MV=class e{static from(t,n=YSe,r=XSe,i){return new e(`length`in t?$Se(t,n,r,i):Float64Array.from(eCe(t,n,r,i)))}constructor(e){this._delaunator=new SV(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(){let e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&ZSe(e)){this.collinear=Int32Array.from({length:t.length/2},(e,t)=>t).sort((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]);let e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,r.length===2&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new OV(this,e)}*neighbors(e){let{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:o}=this;if(o){let t=o.indexOf(e);t>0&&(yield o[t-1]),t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){let{inedges:r,hull:i,_hullIndex:a,halfedges:o,triangles:s,points:c}=this;if(r[e]===-1||!c.length)return(e+1)%(c.length>>1);let l=e,u=jV(t-c[e*2],2)+jV(n-c[e*2+1],2),d=r[e],f=d;do{let r=s[f],d=jV(t-c[r*2],2)+jV(n-c[r*2+1],2);if(d{tCe(),kV()})),rCe=c({voronoi:()=>NV});function NV(e){G.call(this,null,e)}function iCe(e){let t=e[0][0],n=e[0][1],r=e.length-1;for(;e[r][0]===t&&e[r][1]===n;--r);return`M`+e.slice(0,r+1).join(`L`)+`Z`}function aCe(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}var PV,oCe=o((()=>{nx(),dg(),nCe(),NV.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`}]},PV=[-1e5,-1e5,1e5,1e5],U(NV,G,{transform(e,t){let n=e.as||`path`,r=t.source;if(!r||!r.length)return t;let i=e.size;i=i?[0,0,i[0],i[1]]:(i=e.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:PV;let a=this.value=MV.from(r,e.x,e.y).voronoi(i);for(let e=0,t=r.length;eLV});function cCe(){var e=[256,256],t,n,r,i,a,o,s,c=FV,l=[],u=Math.random,d={};d.layout=function(){for(var c=f(IC()),d=mCe((e[0]>>5)*e[1]),m=null,h=l.length,g=-1,_=[],v=l.map(e=>({text:t(e),font:n(e),style:i(e),weight:a(e),rotate:o(e),size:~~(r(e)+1e-14),padding:s(e),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:e})).sort((e,t)=>t.size-e.size);++g>1,y.y=e[1]*(u()+.5)>>1,lCe(c,y,v,g),y.hasText&&p(d,y,m)&&(_.push(y),m?dCe(m,y):m=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=e[0]>>1,y.y-=e[1]>>1)}return _};function f(e){e.width=e.height=1;var t=Math.sqrt(e.getContext(`2d`).getImageData(0,0,1,1).data.length>>2);e.width=(zV<<5)/t,e.height=BV/t;var n=e.getContext(`2d`);return n.fillStyle=n.strokeStyle=`red`,n.textAlign=`center`,{context:n,ratio:t}}function p(t,n,r){for(var i=n.x,a=n.y,o=Math.hypot(e[0],e[1]),s=c(e),l=u()<.5?1:-1,d=-l,f,p,m;(f=s(d+=l))&&(p=~~f[0],m=~~f[1],!(Math.min(Math.abs(p),Math.abs(m))>=o));)if(n.x=i+p,n.y=a+m,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>e[0]||n.y+n.y1>e[1])&&(!r||!uCe(n,t,e[0]))&&(!r||fCe(n,r))){for(var h=n.sprite,g=n.width>>5,_=e[0]>>5,v=n.x-(g<<4),y=v&127,b=32-y,x=n.y1-n.y0,S=(n.y+n.y0)*_+(v>>5),C,w=0;w>>y:0);S+=_}return n.sprite=null,!0}return!1}return d.words=function(e){return arguments.length?(l=e,d):l},d.size=function(t){return arguments.length?(e=[+t[0],+t[1]],d):e},d.font=function(e){return arguments.length?(n=IV(e),d):n},d.fontStyle=function(e){return arguments.length?(i=IV(e),d):i},d.fontWeight=function(e){return arguments.length?(a=IV(e),d):a},d.rotate=function(e){return arguments.length?(o=IV(e),d):o},d.text=function(e){return arguments.length?(t=IV(e),d):t},d.spiral=function(e){return arguments.length?(c=VV[e]||e,d):c},d.fontSize=function(e){return arguments.length?(r=IV(e),d):r},d.padding=function(e){return arguments.length?(s=IV(e),d):s},d.random=function(e){return arguments.length?(u=e,d):u},d}function lCe(e,t,n,r){if(!t.sprite){var i=e.context,a=e.ratio;i.clearRect(0,0,(zV<<5)/a,BV/a);var o=0,s=0,c=0,l=n.length,u,d,f,p,m;for(--r;++r>5<<5,f=~~Math.max(Math.abs(v+y),Math.abs(v-y))}else u=u+31>>5<<5;if(f>c&&(c=f),o+u>=zV<<5&&(o=0,s+=c,c=0),s+f>=BV)break;i.translate((o+(u>>1))/a,(s+(f>>1))/a),t.rotate&&i.rotate(t.rotate*RV),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=f,t.xoff=o,t.yoff=s,t.x1=u>>1,t.y1=f>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=u}for(var x=i.getImageData(0,0,(zV<<5)/a,BV/a).data,S=[];--r>=0;)if(t=n[r],t.hasText){for(u=t.width,d=u>>5,f=t.y1-t.y0,p=0;p>5),E=x[(s+m)*(zV<<5)+(o+p)<<2]?1<<31-p%32:0;S[T]|=E,C|=E}C?w=m:(t.y0++,f--,m--,s++)}t.y1=t.y0+w,t.sprite=S.slice(0,(t.y1-t.y0)*d)}}}function uCe(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,a=e.x-(i<<4),o=a&127,s=32-o,c=e.y1-e.y0,l=(e.y+e.y0)*n+(a>>5),u,d=0;d>>o:0))&t[l+f])return!0;l+=n}return!1}function dCe(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function fCe(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0{RC(),nx(),dg(),AO(),Nx(),RV=Math.PI/180,zV=64,BV=2048,VV={archimedean:FV,rectangular:pCe},HV=[`x`,`y`,`font`,`fontSize`,`fontStyle`,`fontWeight`,`angle`],UV=[`text`,`font`,`rotate`,`fontSize`,`fontStyle`,`fontWeight`],LV.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:HV}]},U(LV,G,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&V(`Wordcloud size dimensions must be non-zero.`);function n(n){let r=e[n];return bh(r)&&t.modified(r.fields)}let r=e.modified();if(!(r||t.changed(t.ADD_REM)||UV.some(n)))return;let i=t.materialize(t.SOURCE).source,a=this.value,o=e.as||HV,s=e.fontSize||14,c;if(bh(s)?c=e.fontSizeRange:s=Oh(s),c){let e=s,t=bD(`sqrt`)().domain(Mh(i,e)).range(c);s=n=>t(e(n))}i.forEach(e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0});let l=a.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||`archimedean`).rotate(e.rotate||0).font(e.font||`sans-serif`).fontStyle(e.fontStyle||`normal`).fontWeight(e.fontWeight||`normal`).fontSize(s).random(Ox).layout(),u=a.size(),d=u[0]>>1,f=u[1]>>1,p=l.length;for(let e=0,t,n;eqV,resolvefilter:()=>JV});function _Ce(){let e=8,t=[],n=ZV(0),r=WV(0,e),i=WV(0,e);return{data:()=>t,seen:()=>n=vCe(n,t.length),add(e){for(let n=0,r=t.length,i=e.length,a;nt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=WV(t,e,r),i=WV(t,e))}}}function vCe(e,t,n){return e.length>=t?e:(n||=new e.constructor(t),n.set(e),n)}function WV(e,t,n){let r=(t<257?YV:t<65537?XV:ZV)(e);return n&&r.set(n),r}function GV(e,t,n){let r=1<0)for(f=0;fe,size:()=>n}}function yCe(e,t){return e.sort.call(t,(t,n)=>{let r=e[t],i=e[n];return ri)}),Kae(e,t)}function bCe(e,t,n,r,i,a,o,s,c){let l=0,u=0,d;for(d=0;l{m_(),nx(),dg(),YV=e=>new Uint8Array(e),XV=e=>new Uint16Array(e),ZV=e=>new Uint32Array(e),qV.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}}]},U(qV,G,{transform(e,t){return this._dims?e.modified(`fields`)||e.fields.some(e=>t.modified(e.fields))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){let n=e.fields,r=e.query,i=this._indices={},a=this._dims=[],o=r.length,s=0,c,l;for(;s{let e=i.remove(t,n);for(let t in r)r[t].reindex(e)})},update(e,t,n){let r=this._dims,i=e.query,a=t.stamp,o=r.length,s=0,c,l;for(n.filters=0,l=0;lp)for(g=p,_=Math.min(d,m);g<_;++g)v=c[g],a[v]!==n&&(s[v]=o[v],a[v]=n,r.push(v)),o[v]^=h;if(f>m)for(g=Math.max(d,m),_=f;g<_;++g)v=c[g],a[v]!==n&&(s[v]=o[v],a[v]=n,r.push(v)),o[v]^=h;else if(fu)for(p=u,m=Math.min(c,d);pd)for(p=Math.max(c,d),m=l;ps[e]&n?null:o[e];return a.filter(a.MOD,l),i&i-1?(a.filter(a.ADD,e=>{let t=s[e]&n;return!t&&t^c[e]&n?o[e]:null}),a.filter(a.REM,e=>{let t=s[e]&n;return t&&!(t^(t^c[e]&n))?o[e]:null})):(a.filter(a.ADD,l),a.filter(a.REM,e=>(s[e]&n)===i?o[e]:null)),a.filter(a.SOURCE,e=>l(e._index))}})}));function QV(e){this.type=e}function SCe(e){switch(e.type){case LH:return e.elements;case RH:case VH:return[e.left,e.right];case zH:return[e.callee].concat(e.arguments);case BH:return[e.test,e.consequent,e.alternate];case HH:return[e.object,e.property];case UH:return e.properties;case FH:return[e.key,e.value];case WH:return[e.argument];case IH:case PH:case NH:default:return[]}}function $V(e,t){if(!e)throw Error(`ASSERT: `+t)}function eH(e){return e>=48&&e<=57}function tH(e){return`0123456789abcdefABCDEF`.includes(e)}function nH(e){return`01234567`.includes(e)}function CCe(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function rH(e){return e===10||e===13||e===8232||e===8233}function iH(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&DU.test(String.fromCharCode(e))}function aH(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&OU.test(String.fromCharCode(e))}function oH(){for(;q1114111||e!==`}`)&&yH({},hU,TU),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function cH(){var e=KH.charCodeAt(q++),t=String.fromCharCode(e);for(e===92&&(KH.charCodeAt(q)!==117&&yH({},hU,TU),++q,e=sH(`u`),(!e||e===`\\`||!iH(e.charCodeAt(0)))&&yH({},hU,TU),t=e);q>>=`)return q+=4,{type:tU,value:o,start:e,end:q};if(a=o.substr(0,3),a===`>>>`||a===`<<=`||a===`>>=`)return q+=3,{type:tU,value:a,start:e,end:q};if(i=a.substr(0,2),r===i[1]&&`+-<>&|`.includes(r)||i===`=>`)return q+=2,{type:tU,value:i,start:e,end:q};if(i===`//`&&yH({},hU,TU),`<>=!+-*%&|^/`.includes(r))return++q,{type:tU,value:r,start:e,end:q};yH({},hU,TU)}function DCe(e){let t=``;for(;q{if(parseInt(t,16)<=1114111)return`x`;yH({},xU)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,`x`));try{new RegExp(n)}catch{yH({},xU)}try{return new RegExp(e,t)}catch{return null}}function jCe(){var e=KH[q],t,n,r,i;for($V(e===`/`,`Regular expression literal must start with a slash`),t=KH[q++],n=!1,r=!1;q=0&&yH({},xU,n),{value:n,literal:t}}function NCe(){var e,t,n,r;return JH=null,oH(),e=q,t=jCe(),n=MCe(),r=ACe(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:q}}function PCe(e){return e.type===ZH||e.type===QH||e.type===YH||e.type===$H}function dH(){if(oH(),q>=qH)return{type:XH,start:q,end:q};let e=KH.charCodeAt(q);return iH(e)?ECe():e===40||e===41||e===59?lH():e===39||e===34?kCe():e===46?eH(KH.charCodeAt(q+1))?uH():lH():eH(e)?uH():lH()}function fH(){let e=JH;return q=e.end,JH=dH(),q=e.end,e}function pH(){let e=q;JH=dH(),q=e}function FCe(e){let t=new QV(iU);return t.elements=e,t}function mH(e,t,n){let r=new QV(e===`||`||e===`&&`?uU:aU);return r.operator=e,r.left=t,r.right=n,r}function ICe(e,t){let n=new QV(oU);return n.callee=e,n.arguments=t,n}function LCe(e,t,n){let r=new QV(sU);return r.test=e,r.consequent=t,r.alternate=n,r}function hH(e){let t=new QV(cU);return t.name=e,t}function gH(e){let t=new QV(lU);return t.value=e.value,t.raw=KH.slice(e.start,e.end),e.regex&&(t.raw===`//`&&(t.raw=`/(?:)/`),t.regex=e.regex),t}function _H(e,t,n){let r=new QV(dU);return r.computed=e===`[`,r.object=t,r.property=n,r.computed||(n.member=!0),r}function RCe(e){let t=new QV(fU);return t.properties=e,t}function vH(e,t,n){let r=new QV(pU);return r.key=t,r.value=n,r.kind=e,r}function zCe(e,t){let n=new QV(mU);return n.operator=e,n.argument=t,n.prefix=!0,n}function yH(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(e,t)=>($V(t`:case`<=`:case`>=`:case`instanceof`:case`in`:t=7;break;case`<<`:case`>>`:case`>>>`:t=8;break;case`+`:case`-`:t=9;break;case`*`:case`/`:case`%`:t=11;break}return t}function XCe(){var e=JH,t,n,r,i,a,o,s,c=EH(),l;if(r=JH,i=DH(r),i===0)return c;for(r.prec=i,fH(),t=[e,JH],o=EH(),a=[c,r,o];(i=DH(JH))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,c=a.pop(),t.pop(),n=mH(s,c,o),a.push(n);r=fH(),r.prec=i,a.push(r),t.push(JH),n=EH(),a.push(n)}for(l=a.length-1,n=a[l],t.pop();l>1;)t.pop(),n=mH(a[l-1].value,a[l-2],n),l-=2;return n}function OH(){var e=XCe(),t,n;return SH(`?`)&&(fH(),t=OH(),xH(`:`),n=OH(),e=LCe(e,t,n)),e}function kH(){let e=OH();if(SH(`,`))throw Error(EU);return e}function AH(e){KH=e,q=0,qH=KH.length,JH=null,pH();let t=kH();if(JH.type!==XH)throw Error(`Unexpect token after expression.`);return t}function jH(e){function t(t,n,r,i){let a=e(n[0]);return r&&(a=r+`(`+a+`)`,r.lastIndexOf(`new `,0)===0&&(a=`(`+a+`)`)),a+`.`+t+(i<0?``:i===0?`()`:`(`+n.slice(1).map(e).join(`,`)+`)`)}function n(e,n,r){return i=>t(e,i,n,r)}let r=`new Date`,i=`String`,a=`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(t){t.length<3&&V(`Missing arguments to clamp function.`),t.length>3&&V(`Too many arguments to clamp function.`);let n=t.map(e);return`Math.max(`+n[1]+`, Math.min(`+n[2]+`,`+n[0]+`))`},now:`Date.now`,utc:`Date.UTC`,datetime:r,date:n(`getDate`,r,0),day:n(`getDay`,r,0),year:n(`getFullYear`,r,0),month:n(`getMonth`,r,0),hours:n(`getHours`,r,0),minutes:n(`getMinutes`,r,0),seconds:n(`getSeconds`,r,0),milliseconds:n(`getMilliseconds`,r,0),time:n(`getTime`,r,0),timezoneoffset:n(`getTimezoneOffset`,r,0),utcdate:n(`getUTCDate`,r,0),utcday:n(`getUTCDay`,r,0),utcyear:n(`getUTCFullYear`,r,0),utcmonth:n(`getUTCMonth`,r,0),utchours:n(`getUTCHours`,r,0),utcminutes:n(`getUTCMinutes`,r,0),utcseconds:n(`getUTCSeconds`,r,0),utcmilliseconds:n(`getUTCMilliseconds`,r,0),length:n(`length`,null,-1),parseFloat:`parseFloat`,parseInt:`parseInt`,upper:n(`toUpperCase`,i,0),lower:n(`toLowerCase`,i,0),substring:n(`substring`,i),split:n(`split`,i),trim:n(`trim`,i,0),btoa:`btoa`,atob:`atob`,encodeURIComponent:`encodeURIComponent`,regexp:a,test:n(`test`,a),if:function(t){t.length<3&&V(`Missing arguments to if function.`),t.length>3&&V(`Too many arguments to if function.`);let n=t.map(e);return`(`+n[0]+`?`+n[1]+`:`+n[2]+`)`}}}function ZCe(e){let t=e&&e.length-1;return t&&(e[0]===`"`&&e[t]===`"`||e[0]===`'`&&e[t]===`'`)?e.slice(1,-1):e}function MH(e){e||={};let t=e.allowed?cg(e.allowed):{},n=e.forbidden?cg(e.forbidden):{},r=e.constants||jU,i=(e.functions||jH)(d),a=e.globalvar,o=e.fieldvar,s=bh(a)?a:e=>`${a}["${e}"]`,c={},l={},u=0;function d(e){if(qh(e))return e;let t=f[e.type];return t??V(`Unsupported type: `+e.type),t(e)}let f={Literal:e=>e.raw,Identifier:e=>{let i=e.name;return u>0?i:Ph(n,i)?V(`Illegal identifier: `+i):Ph(r,i)?r[i]:Ph(t,i)?i:(c[i]=1,s(i))},MemberExpression:e=>{let t=!e.computed,n=d(e.object);t&&(u+=1);let r=d(e.property);return n===o&&(l[ZCe(r)]=1),t&&--u,n+(t?`.`+r:`[`+r+`]`)},CallExpression:e=>{e.callee.type!==`Identifier`&&V(`Illegal callee type: `+e.callee.type);let t=e.callee.name,n=e.arguments,r=Ph(i,t)&&i[t];return r||V(`Unrecognized function: `+t),bh(r)?r(n):r+`(`+n.map(d).join(`,`)+`)`},ArrayExpression:e=>`[`+e.elements.map(d).join(`,`)+`]`,BinaryExpression:e=>`(`+d(e.left)+` `+e.operator+` `+d(e.right)+`)`,UnaryExpression:e=>`(`+e.operator+d(e.argument)+`)`,ConditionalExpression:e=>`(`+d(e.test)+`?`+d(e.consequent)+`:`+d(e.alternate)+`)`,LogicalExpression:e=>`(`+d(e.left)+e.operator+d(e.right)+`)`,ObjectExpression:e=>{for(let t of e.properties){let e=t.key.name;zm.has(e)&&V(`Illegal property: `+e)}return`{`+e.properties.map(d).join(`,`)+`}`},Property:e=>{u+=1;let t=d(e.key);return--u,t+`:`+d(e.value)}};function p(e){let t={code:d(e),globals:Object.keys(c),fields:Object.keys(l)};return c={},l={},t}return p.functions=i,p.constants=r,p}var NH,PH,FH,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,q,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU=o((()=>{dg(),NH=`RawCode`,PH=`Literal`,FH=`Property`,IH=`Identifier`,LH=`ArrayExpression`,RH=`BinaryExpression`,zH=`CallExpression`,BH=`ConditionalExpression`,VH=`LogicalExpression`,HH=`MemberExpression`,UH=`ObjectExpression`,WH=`UnaryExpression`,QV.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=SCe(this),n=0,r=t.length;n`,GH[ZH]=`Identifier`,GH[QH]=`Keyword`,GH[$H]=`Null`,GH[eU]=`Numeric`,GH[tU]=`Punctuator`,GH[nU]=`String`,GH[rU]=`RegularExpression`,iU=`ArrayExpression`,aU=`BinaryExpression`,oU=`CallExpression`,sU=`ConditionalExpression`,cU=`Identifier`,lU=`Literal`,uU=`LogicalExpression`,dU=`MemberExpression`,fU=`ObjectExpression`,pU=`Property`,mU=`UnaryExpression`,hU=`Unexpected token %0`,gU=`Unexpected number`,_U=`Unexpected string`,vU=`Unexpected identifier`,yU=`Unexpected reserved word`,bU=`Unexpected end of input`,xU=`Invalid regular expression`,SU=`Invalid regular expression: missing /`,CU=`Octal literals are not allowed in strict mode.`,wU=`Duplicate data property in object literal not allowed in strict mode`,TU=`ILLEGAL`,EU=`Disabled.`,DU=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]`),OU=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]`),kU={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},AU={if:1},jU={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 NU(e){return(!e.getter||!e.getter[IU])&&(e.getter=jm(e.field),e.getter[IU]=!0),e.getter}function PU(e,t){for(var n=t.fields,r=t.values,i=n.length,a=0,o,s;a=r[a])return!1}else if(s.type===ZU){if(o>r[a])return!1}else if(s.type===QU){if(o<=r[a])return!1}else if(s.type===$U){if(oAh(t.fields?{values:t.fields.map(t=>NU(t)(e.datum))}:{[UU]:WU(e.datum)},t))}function twe(e,t,n,r){for(var i=this.context.data[e],a=i?i.values.value:[],o={},s={},c={},l,u,d,f,p,m,h,g,_,v,y=a.length,b=0,x,S;b(e[u[n].field]=t,e),{})))}else p=UU,m=WU(l),h=o[p]||(o[p]={}),g=h[f]||(h[f]=[]),g.push(m),n&&(g=s[f]||(s[f]=[]),g.push({[UU]:m}));if(t||=RU,o[UU]?o[UU]=oW[`${UU}_${t}`](...Object.values(o[UU])):Object.keys(o).forEach(e=>{o[e]=Object.keys(o[e]).map(t=>o[e][t]).reduce((n,r)=>n===void 0?r:oW[`${c[e]}_${t}`](n,r))}),a=Object.keys(s),n&&a.length){let e=r?BU:zU;o[e]=t===RU?{[VU]:a.reduce((e,t)=>(e.push(...s[t]),e),[])}:{[HU]:a.map(e=>({[VU]:s[e]}))}}return o}function FU(e,t,n,r){t[0].type!==`Literal`&&V(`First argument to selection functions must be a string literal.`);let i=t[0].value,a=t.length>=2&&qm(t).value,o=`@unit`,s=sW+i;a===LU&&!Ph(r,o)&&(r[o]=n.getData(i).indataRef(n,`unit`)),Ph(r,s)||(r[s]=n.getData(i).tuplesRef())}var IU,LU,RU,zU,BU,VU,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,QU,$U,eW,tW,nW,rW,iW,aW,oW,sW,nwe=o((()=>{m_(),dg(),MU(),IU=Symbol(`vega_selection_getter`),LU=`intersect`,RU=`union`,zU=`vlMulti`,BU=`vlPoint`,VU=`or`,HU=`and`,UU=`_vgsid_`,WU=jm(UU),GU=`E`,KU=`R`,qU=`R-E`,JU=`R-LE`,YU=`R-RE`,XU=`E-LT`,ZU=`E-LTE`,QU=`E-GT`,$U=`E-GTE`,eW=`E-VALID`,tW=`E-ONE`,nW=`index:unit`,rW=kg(WU),iW=rW.left,aW=rW.right,oW={[`${UU}_union`]:ooe,[`${UU}_intersect`]:roe,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;nt.includes(e)):t},R_union:function(e,t){var n=Ym(t[0]),r=Ym(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}},sW=`:`}));function cW(e){let t=this.context.data[e];return t?t.values.value:[]}function rwe(e,t,n){let r=this.context.data[e][`index:`+t],i=r?r.value.get(n):void 0;return i&&i.count}function iwe(e,t){let n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(Lm).insert(t)),1}function awe(e,t,n){if(e){let n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return n===void 0?e:n}function lW(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?``:(NW.setYear(2e3),NW.setMonth(e),NW.setDate(t),kW.call(this,NW,n))}function owe(e){return lW.call(this,e,1,`%B`)}function swe(e){return lW.call(this,e,1,`%b`)}function cwe(e){return lW.call(this,0,2+e,`%A`)}function lwe(e){return lW.call(this,0,2+e,`%a`)}function uW(e,t,n,r){t[0].type!==`Literal`&&V(`First argument to data functions must be a string literal.`);let i=t[0].value,a=`:`+i;if(!Ph(a,r))try{r[a]=n.getData(i).tuplesRef()}catch{}}function uwe(e,t,n,r){t[0].type!==`Literal`&&V(`First argument to indata must be a string literal.`),t[1].type!==`Literal`&&V(`Second argument to indata must be a string literal.`);let i=t[0].value,a=t[1].value,o=`@`+a;Ph(o,r)||(r[o]=n.getData(i).indataRef(n,a))}function dW(e,t,n,r){if(t[0].type===`Literal`)fW(n,r,t[0].value);else for(e in n.scales)fW(n,r,e)}function fW(e,t,n){let r=`%`+n;if(!Ph(t,r))try{t[r]=e.scaleRef(n)}catch{}}function pW(e,t){if(qh(e)){let n=t.scales[e];return n&&yD(n.value)?n.value:void 0}else if(bh(e))return yD(e)?e:void 0}function dwe(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=dW,n._range=dW,n._scale=dW;let r=t=>`_[`+(t.type===`Literal`?W(`%`+t.value):W(`%`)+`+`+e(t))+`]`;return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>`${r(e[0])}.range()`,_scale:t=>`${r(t[0])}(${e(t[1])})`}}function mW(e,t){return function(n,r,i){if(n){let t=pW(n,(i||this).context);return t&&t.path[e](r)}else return t(r)}}function fwe(e,t){let n=pW(e,(t||this).context);return n&&n.scale()}function pwe(e){let t=this.context.group,n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function hW(e,t,n){try{e[t].apply(e,[`EXPRESSION`].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function mwe(){return hW(this.context.dataflow,`warn`,arguments)}function hwe(){return hW(this.context.dataflow,`info`,arguments)}function gwe(){return hW(this.context.dataflow,`debug`,arguments)}function gW(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function _W(e){let t=ew(e),n=gW(t.r),r=gW(t.g),i=gW(t.b);return .2126*n+.7152*r+.0722*i}function _we(e,t){let n=_W(e),r=_W(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)}function vwe(){let e=[].slice.call(arguments);return e.unshift({}),Ah(...e)}function vW(e,t){return e===t||e!==e&&t!==t?!0:H(e)?H(t)&&e.length===t.length?ywe(e,t):!1:Hm(e)&&Hm(t)?yW(e,t):!1}function ywe(e,t){for(let n=0,r=e.length;nyW(e,t)}function bwe(e,t,n,r,i,a){let o=this.context.dataflow,s=this.context.data[e],c=s.input,l=o.stamp(),u=s.changes,d,f;if(o._trigger===!1||!(c.value.length||t||r))return 0;if((!u||u.stamp{s.modified=!0,o.pulse(c,u).run()},!0,1)),n&&(d=n===!0?Lm:H(n)||Tb(n)?n:bW(n),u.remove(d)),t&&u.insert(t),r&&(d=bW(r),c.value.some(d)?u.remove(d):u.insert(r)),i){if(bh(i))throw Error(`modify parameter must be a data tuple, not a function`);for(f in a)u.modify(i,f,a[f])}return 1}function xwe(e){let t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function Swe(e){let t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}function Cwe(e,t){let n=LW[t]||(LW[t]=jm(t));return H(e)?e.map(n):n(e)}function xW(e){return H(e)||ArrayBuffer.isView(e)?e:null}function SW(e){return xW(e)||(qh(e)?e:null)}function wwe(e,...t){return xW(e).join(...t)}function Twe(e,...t){return SW(e).indexOf(...t)}function Ewe(e,...t){return SW(e).lastIndexOf(...t)}function Dwe(e,...t){return SW(e).slice(...t)}function Owe(e,t,n){return bh(n)&&V(`Function argument passed to replace.`),!qh(t)&&!Kh(t)&&V(`Please pass a string or RegExp argument to replace.`),String(e).replace(t,n)}function kwe(e){return xW(e).slice().reverse()}function Awe(e){return xW(e).slice().sort(wh)}function jwe(e,t,n){return mD(e||0,t||0,n||0)}function Mwe(e,t){let n=pW(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function Nwe(e,t){let n=pW(e,(t||this).context);return n?n.copy():void 0}function Pwe(e,t){let n=pW(e,(t||this).context);return n?n.domain():[]}function Fwe(e,t,n){let r=pW(e,(n||this).context);return r?H(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}function Iwe(e,t){let n=pW(e,(t||this).context);return n&&n.range?n.range():[]}function Lwe(e,t,n){let r=pW(e,(n||this).context);return r?r(t):void 0}function Rwe(e,t,n,r,i){e=pW(e,(i||this).context);let a=wpe(t,n),o=e.domain(),s=o[0],c=qm(o),l=Pm;return c-s?l=ND(e,s,c):e=(e.interpolator?bD(`sequential`)().interpolator(e.interpolator()):bD(`linear`)().interpolate(e.interpolate()).range(e.range())).domain([s=0,c=1]),e.ticks&&(o=e.ticks(+r||15),s!==o[0]&&o.unshift(s),c!==qm(o)&&o.push(c)),o.forEach(t=>a.stop(l(t),e(t))),a}function zwe(e,t,n){let r=pW(e,(n||this).context);return function(e){return r?r.path.context(e)(t):``}}function Bwe(e){let t=null;return function(n){return n?FO(n,t||=PO(e)):e}}function CW(e,t){let n=cW.call(t,e);return n.root&&n.root.lookup||{}}function Vwe(e,t,n){let r=CW(e,this),i=r[t],a=r[n];return i&&a?i.path(a).map(RW):void 0}function Hwe(e,t){let n=CW(e,this)[t];return n?n.ancestors().map(RW):void 0}function Uwe(){let e=zW();return e?e.screen:{}}function Wwe(){let e=zW();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Gwe(){let e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function wW(e,t,n){if(!e)return[];let[r,i]=e,a=new HO().set(r[0],r[1],i[0],i[1]);return khe(n||this.context.dataflow.scenegraph().root,a,Kwe(t))}function Kwe(e){let t=null;if(e){let n=_h(e.marktype),r=_h(e.markname);t=e=>(!n.length||n.some(t=>e.marktype===t))&&(!r.length||r.some(t=>e.name===t))}return t}function qwe(e,t,n,r=5){e=_h(e);let i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function Jwe(e){return _h(e).reduce((t,[n,r],i)=>t+=i==0?`M ${n},${r} `:i===e.length-1?` Z`:`L ${n},${r} `,``)}function Ywe(e,t,n){let{x:r,y:i,mark:a}=n,o=new HO().set(2**53-1,2**53-1,-(2**53-1),-(2**53-1));for(let[e,n]of t)eo.x2&&(o.x2=e),no.y2&&(o.y2=n);return o.translate(r,i),wW([[o.x1,o.y1],[o.x2,o.y2]],e,a).filter(e=>Xwe(e.x,e.y,t))}function Xwe(e,t,n){let r=0;for(let i=0,a=n.length-1;it!=s>t&&e<(o-c)*(t-l)/(s-l)+c&&r++}return r&1}function Zwe(e){let t=jH(e);VW.forEach(e=>t[e]=HW+e);for(let e in BW)t[e]=UW+e;return Ah(t,dwe(e,BW,WW)),t}function TW(e,t,n){return arguments.length===1?BW[e]:(BW[e]=t,n&&(WW[e]=n),KW&&(KW.functions[e]=UW+e),this)}function EW(e,t){let n={},r;try{e=qh(e)?e:W(e)+``,r=AH(e)}catch{V(`Expression parse error: `+e)}r.visit(e=>{if(e.type!==`CallExpression`)return;let r=e.callee.name,i=GW.visitors[r];i&&i(r,e.arguments,t,n)});let i=KW(r);return i.globals.forEach(e=>{let r=`$`+e;!Ph(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))}),{$expr:Ah({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}var DW,OW,kW,AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW=o((()=>{dg(),MU(),AO(),zL(),aT(),nx(),Uj(),nwe(),Nx(),qy(),m_(),DW=e=>function(t,n){let r=this.context.dataflow.locale();return t===null?`null`:r[e](n)(t)},OW=DW(`format`),kW=DW(`timeFormat`),AW=DW(`utcFormat`),jW=DW(`timeParse`),MW=DW(`utcParse`),NW=new Date(2e3,0,1),PW=mW(`area`,N_e),FW=mW(`bounds`,L_e),IW=mW(`centroid`,W_e),LW={},RW=e=>e.data,zW=()=>typeof window<`u`&&window||null,BW={random(){return Ox()},cumulativeNormal:cx,cumulativeLogNormal:mx,cumulativeUniform:vx,densityNormal:sx,densityLogNormal:px,densityUniform:_x,quantileNormal:lx,quantileLogNormal:hx,quantileUniform:yx,sampleNormal:ox,sampleLogNormal:fx,sampleUniform:gx,isArray:H,isBoolean:Bh,isDate:Vh,isDefined(e){return e!==void 0},isNumber:Wh,isObject:Hm,isRegExp:Kh,isString:qh,isTuple:Tb,isValid(e){return e!=null&&e===e},toBoolean:ig,toDate(e){return ag(e)},toNumber:Ym,toString:sg,indexof:Twe,join:wwe,lastindexof:Ewe,replace:Owe,reverse:kwe,sort:Awe,slice:Dwe,flush:Rh,lerp:Xh,merge:vwe,pad:ng,peek:qm,pluck:Cwe,span:rg,inrange:zh,truncate:lg,rgb:ew,lab:Mw,hcl:Rw,hsl:lw,luminance:_W,contrast:_we,sequence:f_,format:OW,utcFormat:AW,utcParse:MW,utcOffset:sy,utcSequence:uy,timeFormat:kW,timeParse:jW,timeOffset:oy,timeSequence:ly,timeUnitSpecifier:Vv,monthFormat:owe,monthAbbrevFormat:swe,dayFormat:cwe,dayAbbrevFormat:lwe,quarter:hh,utcquarter:gh,week:Wv,utcweek:Yv,dayofyear:Uv,utcdayofyear:Jv,warn:mwe,info:hwe,debug:gwe,extent(e){return Mh(e)},inScope:pwe,intersect:wW,clampRange:yh,pinchDistance:xwe,pinchAngle:Swe,screen:Uwe,containerSize:Gwe,windowSize:Wwe,bandspace:jwe,setdata:iwe,pathShape:Bwe,panLinear:$m,panLog:eh,panPow:th,panSymlog:nh,zoomLinear:ih,zoomLog:ah,zoomPow:oh,zoomSymlog:sh,encode:awe,modify:bwe,lassoAppend:qwe,lassoPath:Jwe,intersectLasso:Ywe},VW=[`view`,`item`,`group`,`xy`,`x`,`y`],HW=`event.vega.`,UW=`this.`,WW={},GW={forbidden:[`_`],allowed:[`datum`,`event`,`item`],fieldvar:`datum`,globalvar:e=>`_[${W(`$`+e)}]`,functions:Zwe,constants:jU,visitors:WW},KW=MH(GW),TW(`bandwidth`,Mwe,dW),TW(`copy`,Nwe,dW),TW(`domain`,Pwe,dW),TW(`range`,Iwe,dW),TW(`invert`,Fwe,dW),TW(`scale`,Lwe,dW),TW(`gradient`,Rwe,dW),TW(`geoArea`,PW,dW),TW(`geoBounds`,FW,dW),TW(`geoCentroid`,IW,dW),TW(`geoShape`,zwe,dW),TW(`geoScale`,fwe,dW),TW(`indata`,rwe,uwe),TW(`data`,cW,uW),TW(`treePath`,Vwe,uW),TW(`treeAncestors`,Hwe,uW),TW(`vlSelectionTest`,QCe,FU),TW(`vlSelectionIdTest`,$Ce,FU),TW(`vlSelectionResolve`,twe,FU),TW(`vlSelectionTuples`,ewe)}));function Qwe(e){let t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(e=>t.parseOperator(e)),n.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()}function $we(e,t){let n=``;return eG[t]?n:(e.x2&&(e.x?(tG[t]&&(n+=`if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;`),n+=`o.width=o.x2-o.x;`):n+=`o.x=o.x2-(o.width||0);`),e.xc&&(n+=`o.x=o.xc-(o.width||0)/2;`),e.y2&&(e.y?(tG[t]&&(n+=`if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;`),n+=`o.height=o.y2-o.y;`):n+=`o.y=o.y2-(o.height||0);`),e.yc&&(n+=`o.y=o.yc-(o.height||0)/2;`),n)}function JW(e){return(e+``).toLowerCase()}function eTe(e){return JW(e)===`operator`}function tTe(e){return JW(e)===`collect`}function YW(e,t,n){n.endsWith(`;`)||(n=`return(`+n+`);`);let r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function nTe(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${r} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${r} : `}function xTe(e){let t=this;vTe(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function STe(e){let t=this;if(e.params){let n=t.get(e.id);n||V(`Invalid operator id: `+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function CTe(e,t){t||={};let n=this;for(let r in e){let i=e[r];t[r]=H(i)?i.map(e=>$W(e,n,t)):$W(i,n,t)}return t}function $W(e,t,n){if(!e||!Eh(e))return e;for(let r=0,i=oG.length,a;re&&e.$tupleid?nx:e);return t.fn[n]||(t.fn[n]=og(r,e.$order,t.expr.codegen))}function kTe(e,t){let n=e.$encode,r={};for(let e in n){let i=n[e];r[e]=ih(t.encodeExpression(i.$expr),i.$fields),r[e].output=i.$output}return r}function ATe(e,t){return t}function jTe(e,t){let n=e.$subflow;return function(e,r,i){let a=t.fork().parse(n),o=a.get(n.operators[0].id),s=a.signals.parent;return s&&s.set(i),o.detachSubflow=()=>t.detach(a),o}}function MTe(){return nx}function NTe(e){var t=this,n=e.filter==null?void 0:t.eventExpression(e.filter),r=e.stream==null?void 0:t.get(e.stream),i;e.source?r=t.events(e.source,e.type,n):e.merge&&(i=e.merge.map(e=>t.get(e)),r=i[0].merge.apply(i[0],i.slice(1))),e.between&&(i=e.between.map(e=>t.get(e)),r=r.between(i[0],i[1])),e.filter&&(r=r.filter(n)),e.throttle!=null&&(r=r.throttle(+e.throttle)),e.debounce!=null&&(r=r.debounce(+e.debounce)),r??V(`Invalid stream definition: `+JSON.stringify(e)),e.consume&&r.consume(!0),t.stream(e,r)}function PTe(e){var t=this,n=Eh(n=e.source)?n.$ref:n,r=t.get(n),i=null,a=e.update,o=void 0;r||V(`Source not defined: `+e.source),i=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),a&&a.$expr&&(a.$params&&(o=t.parseParameters(a.$params)),a=t.handlerExpression(a.$expr)),t.update(e,r,i,a,o)}function FTe(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(n=>{let i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(n=>{let r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(t=>t.getState(e))),n}function ITe(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(e=>{n.update(t.signals[e],i[e],sG)}),Object.keys(r||{}).forEach(e=>{n.pulse(t.data[e].input,n.changeset().remove(xh).insert(r[e]))}),(e.subcontext||[]).forEach((e,n)=>{let r=t.subcontext[n];r&&r.setState(e)})}function eG(e,t,n,r){return new tG(e,t,n,r)}function tG(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||aG,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function nG(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}var rG,iG,aG,oG,sG,cG=o((()=>{Ag(),Xx(),rG=Og([`rule`]),iG=Og([`group`,`image`,`rect`]),aG={operator:(e,t)=>QW(e,[`_`],t.code),parameter:(e,t)=>QW(e,[`datum`,`_`],t.code),event:(e,t)=>QW(e,[`event`],t.code),handler:(e,t)=>QW(e,[`_`,`event`],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{let{marktype:n,channels:r}=t,i=`var o=item,datum=o.datum,m=0,$;`;for(let e in r){let t=`o[`+W(e)+`]`;i+=`$=${r[e].code};if(${t}!==$)${t}=$,m=1;`}return i+=_Te(r,n),i+=`return m;`,QW(e,[`item`,`_`],i)},codegen:{get(e){let t=`[${e.map(W).join(`][`)}]`,n=Function(`_`,`return _${t};`);return n.path=t,n},comparator(e,t){let n,r=Function(`a`,`b`,`var u, v; return `+e.map((e,r)=>{let i=t[r],a,o;return e.path?(a=`a${e.path}`,o=`b${e.path}`):((n||={})[`f`+r]=e,a=`this.f${r}(a)`,o=`this.f${r}(b)`),bTe(a,o,-i,i)}).join(``)+`0;`);return n?r.bind(n):r}}},oG=[{key:`$ref`,parse:wTe},{key:`$key`,parse:ETe},{key:`$expr`,parse:TTe},{key:`$field`,parse:DTe},{key:`$encode`,parse:kTe},{key:`$compare`,parse:OTe},{key:`$context`,parse:ATe},{key:`$subflow`,parse:jTe},{key:`$tupleid`,parse:MTe}],sG={skip:!0},tG.prototype=nG.prototype={fork(){let e=new nG(this);return(this.subcontext||=[]).push(e),e},detach(e){this.subcontext=this.subcontext.filter(t=>t!==e);let t=Object.keys(e.nodes);for(let n of t)e.nodes[n]._targets=null;for(let n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){let n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),yTe(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push(()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(let r in e.data){let i=n.data[r]||(n.data[r]={});e.data[r].forEach(e=>i[e]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[ZW(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:gTe,parseOperator:xTe,parseOperatorParameters:STe,parseParameters:CTe,parseStream:NTe,parseUpdate:PTe,getState:FTe,setState:ITe}}));function LTe(e){let t=e.container();t&&(t.setAttribute(`role`,`graphics-document`),t.setAttribute(`aria-roleDescription`,`visualization`),lG(t,e.description()))}function lG(e,t){e&&(t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t))}function RTe(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}function zTe(e){let t=e._signals.cursor||(e._signals.cursor=e.add({user:LG,item:null}));e.on(e.events(`view`,`pointermove`),t,(e,n)=>{let r=t.value,i=r?xg(r)?r:r.user:LG,a=n.item&&n.item.cursor||null;return r&&i===r.user&&a==r.item?r:{user:i,item:a}}),e.add(null,function(t){let n=t.cursor,r=this.value;return xg(n)||(r=n.item,n=n.user),uG(e,n&&n!==LG?n:r||n),r},{cursor:t})}function uG(e,t){let n=e.globalCursor()?typeof document<`u`&&document.body:e.container();if(n)return t==null?n.style.removeProperty(`cursor`):n.style.cursor=t}function dG(e,t){var n=e._runtime.data;return fg(n,t)||V(`Unrecognized data set: `+t),n[t]}function BTe(e,t){return arguments.length<2?dG(this,e).values.value:fG.call(this,e,ux().remove(xh).insert(t))}function fG(e,t){lx(t)||V(`Second argument to changes must be a changeset.`);let n=dG(this,e);return n.modified=!0,this.pulse(n.input,t)}function VTe(e,t){return fG.call(this,e,ux().insert(t))}function HTe(e,t){return fG.call(this,e,ux().remove(t))}function pG(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function mG(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function hG(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function UTe(e){var t=hG(e),n=pG(e),r=mG(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach(t=>{try{t(n,r)}catch(t){e.error(t)}})}function WTe(e,t,n){var r=e._renderer,i=r&&r.canvas(),a,o,s;return i&&(s=hG(e),o=t.changedTouches?t.changedTouches[0]:t,a=Nk(o,i),a[0]-=s[0],a[1]-=s[1]),t.dataflow=e,t.item=n,t.vega=GTe(e,n,a),t}function GTe(e,t,n){let r=t?t.mark.marktype===`group`?t:t.mark.group:null;function i(e){var n=r,i;if(e){for(i=t;i;i=i.mark.group)if(i.mark.name===e){n=i;break}}return n&&n.mark&&n.mark.interactive?n:{}}function a(e){if(!e)return n;xg(e)&&(e=i(e));let t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:cg(e),item:cg(t||{}),group:i,xy:a,x:e=>a(e)[0],y:e=>a(e)[1]}}function KTe(e){let t=ug({defaults:{}},e),n=(e,t)=>{t.forEach(t=>{H(e[t])&&(e[t]=Og(e[t]))})};return n(t.defaults,[`prevent`,`allow`]),n(t,[`view`,`window`,`selector`]),t}function gG(e,t,n,r){e._eventListeners.push({type:n,sources:tg(t),handler:r})}function qTe(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[t]:i?!i[t]:e.preventDefault()}function _G(e,t,n){let r=e._eventConfig&&e._eventConfig[t];return r===!1||Eh(r)&&!r[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function JTe(e,t,n){var r=this,i=new mx(n),a=function(n,a){r.runAsync(null,()=>{e===RG&&qTe(r,t)&&n.preventDefault(),i.receive(WTe(r,n,a))})},o;if(e===zG)_G(r,`timer`,t)&&r.timer(a,t);else if(e===RG)_G(r,`view`,t)&&r.addEventListener(t,a,VG);else if(e===BG?_G(r,`window`,t)&&typeof window<`u`&&(o=[window]):typeof document<`u`&&_G(r,`selector`,t)&&(o=Array.from(document.querySelectorAll(e))),!o)r.warn(`Can not resolve event source: `+e);else{for(var s=0,c=o.length;s=0;)t[i].stop();for(i=r.length;--i>=0;)for(o=r[i],a=o.sources.length;--a>=0;)o.sources[a].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),i=n.length;--i>=0;)c=n[i].type,s=n[i].handler,this._handler.off(c,s);return this}function xG(e,t,n){let r=document.createElement(e);for(let e in t)r.setAttribute(e,t[e]);return n!=null&&(r.textContent=n),r}function ZTe(e,t,n){if(!t)return;let r=n.param,i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,t)})}},r.debounce&&(i.update=lg(r.debounce,i.update))),(r.input==null&&r.element?QTe:eEe)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function QTe(e,t,n,r){let i=n.event||`input`,a=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,a),gG(r,t,i,a),e.set=e=>{t.value=e,t.dispatchEvent($Te(i))}}function $Te(e){return typeof Event<`u`?new Event(e):{type:e}}function eEe(e,t,n,r){let i=r.signal(n.signal),a=xG(`div`,{class:HG}),o=n.input===`radio`?a:a.appendChild(xG(`label`));o.appendChild(xG(`span`,{class:UG},n.name||n.signal)),t.appendChild(a);let s=tEe;switch(n.input){case`checkbox`:s=nEe;break;case`select`:s=rEe;break;case`radio`:s=iEe;break;case`range`:s=aEe;break}s(e,o,n,i)}function tEe(e,t,n,r){let i=xG(`input`);for(let e in n)e!==`signal`&&e!==`element`&&i.setAttribute(e===`input`?`type`:e,n[e]);i.setAttribute(`name`,n.signal),i.value=r,t.appendChild(i),i.addEventListener(`input`,()=>e.update(i.value)),e.elements=[i],e.set=e=>i.value=e}function nEe(e,t,n,r){let i={type:`checkbox`,name:n.signal};r&&(i.checked=!0);let a=xG(`input`,i);t.appendChild(a),a.addEventListener(`change`,()=>e.update(a.checked)),e.elements=[a],e.set=e=>a.checked=!!e||null}function rEe(e,t,n,r){let i=xG(`select`,{name:n.signal}),a=n.labels||[];n.options.forEach((e,t)=>{let n={value:e};SG(e,r)&&(n.selected=!0),i.appendChild(xG(`option`,n,(a[t]||e)+``))}),t.appendChild(i),i.addEventListener(`change`,()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{let s={type:`radio`,name:n.signal,value:t};SG(t,r)&&(s.checked=!0);let c=xG(`input`,s);c.addEventListener(`change`,()=>e.update(t));let l=xG(`label`,{},(a[o]||t)+``);return l.prepend(c),i.appendChild(l),c}),e.set=t=>{let n=e.elements,r=n.length;for(let e=0;e{c.textContent=s.value,e.update(+s.value)};s.addEventListener(`input`,l),s.addEventListener(`change`,l),e.elements=[s],e.set=e=>{s.value=e,c.textContent=e}}function SG(e,t){return e===t||e+``==t+``}function CG(e,t,n,r,i,a){return t||=new r(e.loader()),t.initialize(n,pG(e),mG(e),hG(e),i,a).background(e.background())}function wG(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function oEe(e,t,n,r){let i=new r(e.loader(),wG(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,hG(e),e);return t&&t.handlers().forEach(e=>{i.on(e.type,e.handler)}),i}function sEe(e,t){let n=this,r=n._renderType,i=n._eventConfig.bind,a=Bk(r);e=n._el=e?TG(n,e,!0):null,LTe(n),a||n.error(`Unrecognized renderer type: `+r);let o=a.handler||ij,s=e?a.renderer:a.headless;return n._renderer=s?CG(n,n._renderer,e,s):null,n._handler=oEe(n,n._handler,e,o),n._redraw=!0,e&&i!==`none`&&(t=t?n._elBind=TG(n,t,!0):e.appendChild(xG(`form`,{class:`vega-bindings`})),n._bind.forEach(e=>{e.param.element&&i!==`container`&&(e.element=TG(n,e.param.element,!!e.param.input))}),n._bind.forEach(e=>{ZTe(n,e.element||t,e)})),n}function TG(e,t,n){if(typeof t==`string`)if(typeof document<`u`){if(t=document.querySelector(t),!t)return e.error(`Signal bind element not found: `+t),null}else return e.error(`DOM document instance not found.`),null;if(t&&n)try{t.textContent=``}catch(n){t=null,e.error(n)}return t}function EG(e){return Eh(e)?{top:GG(e.top),bottom:GG(e.bottom),left:GG(e.left),right:GG(e.right)}:KG(GG(e))}async function DG(e,t,n,r){let i=Bk(t),a=i&&i.headless;return a||V(`Unrecognized renderer type: `+t),await e.runAsync(),CG(e,null,null,a,n,r).renderAsync(e._scenegraph.root)}async function cEe(e,t){e!==Hj.Canvas&&e!==Hj.SVG&&e!==Hj.PNG&&V(`Unrecognized image type: `+e);let n=await DG(this,e,t);return e===Hj.SVG?lEe(n.svg(),`image/svg+xml`):n.canvas().toDataURL(`image/png`)}function lEe(e,t){let n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function uEe(e,t){return(await DG(this,Hj.Canvas,e,t)).canvas()}async function dEe(e){return(await DG(this,Hj.SVG,e)).svg()}function fEe(e,t,n){return eG(e,Yx,UW,n).parse(t)}function pEe(e){var t=this._runtime.scales;return fg(t,e)||V(`Unrecognized scale or projection: `+e),t[e].value}function OG(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===YG?r.left+r.right:0)}function kG(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===YG?r.top+r.bottom:0)}function mEe(e){var t=e._signals,n=t[qG],r=t[JG],i=t[YG];function a(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,t=>{e._width=t.size,e._viewWidth=OG(e,t.size),a()},{size:n}),e._resizeHeight=e.add(null,t=>{e._height=t.size,e._viewHeight=kG(e,t.size),a()},{size:r});let o=e.add(null,a,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,o.rank=i.rank+1}function hEe(e,t,n,r,i,a){this.runAfter(o=>{let s=0;o._autosize=0,o.width()!==n&&(s=1,o.signal(qG,n,XG),o._resizeWidth.skip(!0)),o.height()!==r&&(s=1,o.signal(JG,r,XG),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==i[0]||o._origin[1]!==i[1])&&(o._resize=1,o._origin=i),s&&o.run(`enter`),a&&o.runAfter(e=>e.resize())},!1,1)}function gEe(e){return this._runtime.getState(e||{data:_Ee,signals:vEe,recurse:!0})}function _Ee(e,t){return t.modified&&H(t.input.value)&&!e.startsWith(`_:vega:_`)}function vEe(e,t){return!(e===`parent`||t instanceof Yx.proxy)}function yEe(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},e=>{e._trigger=!0}),this}function bEe(e,t){function n(t){e({timestamp:Date.now(),elapsed:t})}this._timers.push(Ube(n,t))}function xEe(e,t,n,r){let i=e.element();i&&i.setAttribute(`title`,SEe(r))}function SEe(e){return e==null?``:H(e)?AG(e):Eh(e)&&!vg(e)?CEe(e):e+``}function CEe(e){return Object.keys(e).map(t=>{let n=e[t];return t+`: `+(H(n)?AG(n):jG(n))}).join(` -`)}function AG(e){return`[`+e.map(jG).join(`, `)+`]`}function jG(e){return H(e)?`[…]`:Eh(e)&&!vg(e)?`{…}`:e}function wEe(){if(this.renderer()===`canvas`&&this._renderer._canvas){let e=null,t=()=>{e?.();let n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener(`change`,t),e=()=>{n.removeEventListener(`change`,t)},this._renderer._canvas.getContext(`2d`).pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function MG(e,t){let n=this;if(t||={},Cx.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){let r=ug({},e.locale,t.locale);n.locale(Sb(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Hj.Canvas,n._scenegraph=new MA;let r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||xEe,n._redraw=!0,n._handler=new ij().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=KTe(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);let i=fEe(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(e=>({state:null,param:ug({},e)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=OG(n,n._width),n._viewHeight=kG(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,mEe(n),RTe(n),zTe(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function NG(e,t){return fg(e._signals,t)?e._signals[t]:V(`Unrecognized signal name: `+W(t))}function PG(e,t){let n=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return n.length?n[0]:null}function FG(e,t,n,r){let i=PG(n,r);return i||(i=wG(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function IG(e,t,n){let r=PG(t,n);return r&&t._targets.remove(r),e}var LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,qG,JG,YG,XG,TEe=o((()=>{Ag(),Xx(),Kj(),r_(),XW(),cG(),uz(),Db(),LG=`default`,RG=`view`,zG=`timer`,BG=`window`,VG={trap:!1},HG=`vega-bind`,UG=`vega-bind-name`,WG=`vega-bind-radio`,GG=e=>+e||0,KG=e=>({top:e,bottom:e,left:e,right:e}),qG=`width`,JG=`height`,YG=`padding`,XG={skip:!0},U(MG,Cx,{async evaluate(e,t,n){if(await Cx.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,UTe(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}return n&&ex(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){let t=e==null?null:e+``;return t!==this._desc&&lG(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){let r=NG(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal(`width`,e):this.signal(`width`)},height(e){return arguments.length?this.signal(`height`,e):this.signal(`height`)},padding(e){return arguments.length?this.signal(`padding`,EG(e)):EG(this.signal(`padding`))},autosize(e){return arguments.length?this.signal(`autosize`,e):this.signal(`autosize`)},background(e){return arguments.length?this.signal(`background`,e):this.signal(`background`)},renderer(e){return arguments.length?(Bk(e)||V(`Unrecognized renderer type: `+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Cx.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(NG(this,`autosize`))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:hEe,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=wG(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,a;--r>=0;)if(a=n[r].type,i=n[r].handler,e===a&&(t===i||t===i.raw)){this._handler.off(a,i);break}return this},addResizeListener(e){let t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return FG(this,e,NG(this,e),t)},removeSignalListener(e,t){return IG(this,NG(this,e),t)},addDataListener(e,t){return FG(this,e,dG(this,e).values,t)},removeDataListener(e,t){return IG(this,dG(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){let t=uG(this,null);this._globalCursor=!!e,t&&uG(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:bEe,events:JTe,finalize:XTe,hover:YTe,data:BTe,change:fG,insert:VTe,remove:HTe,scale:pEe,initialize:sEe,toImageURL:cEe,toCanvas:uEe,toSVG:dEe,getState:gEe,setState:yEe,_watchPixelRatio:wEe})}));function ZG(e,t,n){return fK=t||tK,pK=n||dK,$G(e.trim()).map(eK)}function EEe(e){return pK[e]}function QG(e,t,n,r,i){let a=e.length,o=0,s;for(;t' after between selector: `+e;r=r.map(eK);let i=eK(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function OEe(e){let t={source:fK},n=[],r=[0,0],i=0,a=0,o=e.length,s=0,c,l;if(e[o-1]===aK){if(s=e.lastIndexOf(iK),s>=0){try{r=kEe(e.substring(s+1,o-1))}catch{throw`Invalid throttle specification: `+e}e=e.slice(0,s).trim(),o=e.length}else throw`Unmatched right brace: `+e;s=0}if(!o)throw e;if(e[0]===cK&&(i=++s),c=QG(e,s,oK),c1?(t.type=n[1],i?t.markname=n[0].slice(1):EEe(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)===`!`&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function kEe(e){let t=e.split(sK);if(!e.length||t.length>2)throw e;return t.map(t=>{let n=+t;if(n!==n)throw e;return n})}var tK,nK,rK,iK,aK,oK,sK,cK,lK,uK,dK,fK,pK,mK=o((()=>{tK=`view`,nK=`[`,rK=`]`,iK=`{`,aK=`}`,oK=`:`,sK=`,`,cK=`@`,lK=`>`,uK=/[[\]{}]/,dK={"*":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}}));function AEe(e){return Eh(e)?e:{type:e||`pad`}}function jEe(e){return Eh(e)?e.signal?e:{top:Tq(e.top),bottom:Tq(e.bottom),left:Tq(e.left),right:Tq(e.right)}:Eq(Tq(e))}function hK(e,t,n,r){return n==null?0:(Eh(n)&&!H(n)||H(n)&&n.length&&Eh(n[0])?e.update[t]=n:e[r||`enter`][t]={value:n},1)}function gK(e,t,n){for(let n in t)hK(e,n,t[n]);for(let t in n)hK(e,t,n[t],`update`)}function _K(e,t,n){for(let r in t)n&&fg(n,r)||(e[r]=ug(e[r]||{},t[r]));return e}function vK(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function MEe(e,t,n,r,i){let a={},o={},s,c,l,u;for(c in c=`lineBreak`,t===`text`&&i[c]!=null&&!vK(c,e)&&yK(a,c,i[c]),(n==`legend`||String(n).startsWith(`axis`))&&(n=null),u=n===`frame`?i.group:n===`mark`?ug({},i.mark,i[t]):null,u)l=vK(c,e)||(c===`fill`||c===`stroke`)&&(vK(`fill`,e)||vK(`stroke`,e)),l||yK(a,c,u[c]);for(c in tg(r).forEach(t=>{let n=i.style&&i.style[t];for(let t in n)vK(t,e)||yK(a,t,n[t])}),e=ug({},e),a)u=a[c],u.signal?(s||={})[c]=u:o[c]=u;return e.enter=ug(o,e.enter),s&&(e.update=ug(s,e.update)),e}function yK(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}function bK(e){if(e.gradient!=null)return PEe(e);let t=e.signal?`(${e.signal})`:e.color?NEe(e.color):e.field==null?e.value===void 0?void 0:W(e.value):SK(e.field);return e.scale!=null&&(t=FEe(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${xK(e.exponent)})`),e.mult!=null&&(t+=`*${xK(e.mult)}`),e.offset!=null&&(t+=`+${xK(e.offset)}`),e.round&&(t=`round(${t})`),t}function NEe(e){return e.c?qq(`hcl`,e.h,e.c,e.l):e.h||e.s?qq(`hsl`,e.h,e.s,e.l):e.l||e.a?qq(`lab`,e.l,e.a,e.b):e.r||e.g||e.b?qq(`rgb`,e.r,e.g,e.b):null}function PEe(e){let t=[e.start,e.stop,e.count].map(e=>e==null?null:W(e));for(;t.length&&jh(t)==null;)t.pop();return t.unshift(Kq(e.gradient)),`gradient(${t.join(`,`)})`}function xK(e){return Eh(e)?`(`+bK(e)+`)`:e}function SK(e){return CK(Eh(e)?e:{datum:e})}function CK(e){let t,n,r;if(e.signal)t=`datum`,r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t=`item`;n-->0;)t+=`.mark.group`;e.parent?(r=e.parent,t+=`.datum`):r=e.group}else e.datum?(t=`datum`,r=e.datum):V(`Invalid field reference: `+W(e));return e.signal||(r=xg(r)?ph(r).map(W).join(`][`):CK(r)),t+`[`+r+`]`}function FEe(e,t){let n=Kq(e.scale);return e.range==null?(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+`+`:``)+`_bandwidth(${n})`+(+e.band==1?``:`*`+xK(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t??=`0`):t=`lerp(_range(${n}), ${+e.range})`,t}function IEe(e){let t=``;return e.forEach(e=>{let n=bK(e);t+=e.test?`(${e.test})?${n}:`:n}),jh(t)===`:`&&(t+=`null`),t}function wK(e,t,n,r,i,a){let o={};a||={},a.encoders={$encode:o},e=MEe(e,t,n,r,i.config);for(let n in e)o[n]=LEe(e[n],t,a,i);return a}function LEe(e,t,n,r){let i={},a={};for(let t in e)e[t]!=null&&(i[t]=zEe(REe(e[t]),r,n,a));return{$expr:{marktype:t,channels:i},$fields:Object.keys(a),$output:Object.keys(e)}}function REe(e){return H(e)?IEe(e):bK(e)}function zEe(e,t,n,r){let i=kW(e,t);return i.$fields.forEach(e=>r[e]=1),ug(n,i.$params),i.$expr}function TK(e,t){V(e+` for "outer" push: `+W(t))}function EK(e,t){let n=e.name;if(e.push===Jq)t.signals[n]||TK(`No prior signal definition`,n),Yq.forEach(t=>{e[t]!==void 0&&TK(`Invalid property `,t)});else{let r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function DK(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function OK(e,t,n,r){return new DK(e,t,n,r)}function kK(e,t){return OK(`operator`,e,t)}function AK(e){let t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function jK(e,t){return t?{$field:e,$name:t}:{$field:e}}function MK(e,t){return{$compare:e,$order:t}}function BEe(e,t){let n={$key:e};return t&&(n.$flat=!0),n}function VEe(e){return Eh(e)?(e.order===Qq?`-`:`+`)+NK(e.op,e.field):``}function NK(e,t){return(e&&e.signal?`$`+e.signal:e||``)+(e&&t?`_`:``)+(t&&t.signal?`$`+t.signal:t?.replace(/\W+/g,`_`).replace(/^_+|_+$/g,``)||``)}function PK(e){return e&&e.signal}function HEe(e){return e&&e.expr}function FK(e){if(PK(e))return!0;if(Eh(e)){for(let t in e)if(FK(e[t]))return!0}return!1}function IK(e,t){return e??t}function LK(e){return e&&e.signal||e}function RK(e,t){return(e.merge?WEe:e.stream?GEe:e.type?KEe:V(`Invalid stream specification: `+W(e)))(e,t)}function UEe(e){return e===$q?eJ:e||eJ}function WEe(e,t){let n=zK({merge:e.merge.map(e=>RK(e,t))},e,t);return t.addStream(n).id}function GEe(e,t){let n=zK({stream:RK(e.stream,t)},e,t);return t.addStream(n).id}function KEe(e,t){let n;e.type===tJ?(n=t.event(tJ,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(UEe(e.source),e.type);let r=zK({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function zK(e,t,n){let r=t.between;return r&&(r.length!==2&&V(`Stream "between" parameter must have 2 entries: `+W(t)),e.between=[RK(r[0],n),RK(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(qEe(t.marktype,t.markname,t.markrole)),t.source===$q&&r.push(`inScope(event.item)`),r.length&&(e.filter=kW(`(`+r.join(`)&&(`)+`)`,n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function qEe(e,t,n){return`event.item`+(e&&e!==`*`?`&&event.item.mark.marktype==='`+e+`'`:``)+(n?`&&event.item.mark.role==='`+n+`'`:``)+(t?`&&event.item.mark.name==='`+t+`'`:``)}function JEe(e,t,n){let r=e.encode,i={target:n},a=e.events,o=e.update,s=[];a||V(`Signal update missing events specification.`),xg(a)&&(a=ZG(a,t.isSubscope()?$q:eJ)),a=tg(a).filter(e=>e.signal||e.scale?(s.push(e),0):1),s.length>1&&(s=[XEe(s)]),a.length&&s.push(a.length>1?{merge:a}:a[0]),r!=null&&(o&&V(`Signal encode and update are mutually exclusive.`),o=`encode(item(),`+W(r)+`)`),i.update=xg(o)?kW(o,t):o.expr==null?o.value==null?o.signal==null?V(`Invalid signal update specification.`):{$expr:nJ,$params:{$value:t.signalRef(o.signal)}}:o.value:kW(o.expr,t),e.force&&(i.options={force:!0}),s.forEach(e=>t.addUpdate(ug(YEe(e,t),i)))}function YEe(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):RK(e,t)}}function XEe(e){return{signal:`[`+e.map(e=>e.scale?`scale("`+e.scale+`")`:e.signal)+`]`}}function ZEe(e,t){let n=t.getSignal(e.name),r=e.update;e.init&&(r?V(`Signals can not include both init and update expressions.`):(r=e.init,n.initonly=!0)),r&&(r=kW(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(e=>JEe(e,t,n.id))}function QEe(e,t){let n=e.type||`linear`;spe(n)||V(`Unrecognized scale type: `+W(n)),t.addScale(e.name,{type:n,domain:void 0})}function $Ee(e,t){let n=t.getScale(e.name).params,r;for(r in n.domain=UK(e.domain,e,t),e.range!=null&&(n.range=GK(e,t,n)),e.interpolate!=null&&lDe(e.interpolate,n),e.nice!=null&&(n.nice=cDe(e.nice,t)),e.bins!=null&&(n.bins=sDe(e.bins,t)),e)fg(n,r)||r===`name`||(n[r]=BK(e[r],t))}function BK(e,t){return Eh(e)?e.signal?t.signalRef(e.signal):V(`Unsupported object: `+W(e)):e}function VK(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>BK(e,t))}function HK(e){V(`Can not find data set: `+W(e))}function UK(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&V(`No scale domain defined for domainMin/domainMax to override.`);return}return e.signal?n.signalRef(e.signal):(H(e)?eDe:e.fields?nDe:tDe)(e,t,n)}function eDe(e,t,n){return e.map(e=>BK(e,n))}function tDe(e,t,n){let r=n.getData(e.data);return r||HK(e.data),$D(t.type)?r.valuesRef(n,e.field,WK(e.sort,!1)):upe(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function nDe(e,t,n){let r=e.data,i=e.fields.reduce((e,t)=>(t=xg(t)?{data:r,field:t}:H(t)||t.signal?rDe(t,n):t,e.push(t),e),[]);return($D(t.type)?iDe:upe(t.type)?aDe:oDe)(e,n,i)}function rDe(e,t){let n=`_:vega:_`+MJ++,r=sJ({});if(H(e))r.value={$ingest:e};else if(e.signal){let i=`setdata(`+W(n)+`,`+e.signal+`)`;r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,OJ({})]),{data:n,field:`data`}}function iDe(e,t,n){let r=WK(e.sort,!0),i,a,o=n.map(e=>{let n=t.getData(e.data);return n||HK(e.data),n.countsRef(t,e.field,r)}),s={groupby:Xq,pulse:o};r&&(i=r.op||`count`,a=r.field?NK(i,r.field):`count`,s.ops=[NJ[i]],s.fields=[t.fieldRef(a)],s.as=[a]),i=t.add(iJ(s));let c=t.add(sJ({pulse:AK(i)}));return a=t.add(jJ({field:Xq,sort:t.sortRef(r),pulse:AK(c)})),AK(a)}function WK(e,t){return e&&(!e.field&&!e.op?Eh(e)?e.field=`key`:e={field:`key`}:!e.field&&e.op!==`count`?V(`No field provided for sort aggregate op: `+e.op):t&&e.field&&e.op&&!NJ[e.op]&&V(`Multiple domain scales can not be sorted using `+e.op)),e}function aDe(e,t,n){let r=n.map(e=>{let n=t.getData(e.data);return n||HK(e.data),n.domainRef(t,e.field)});return AK(t.add(yJ({values:r})))}function oDe(e,t,n){let r=n.map(e=>{let n=t.getData(e.data);return n||HK(e.data),n.extentRef(t,e.field)});return AK(t.add(vJ({extents:r})))}function sDe(e,t){return e.signal||H(e)?VK(e,t):t.objectProperty(e)}function cDe(e,t){return e.signal?t.signalRef(e.signal):Eh(e)?{interval:BK(e.interval),step:BK(e.step)}:BK(e)}function lDe(e,t){t.interpolate=BK(e.type||e),e.gamma!=null&&(t.interpolateGamma=BK(e.gamma))}function GK(e,t,n){let r=t.config.range,i=e.range;if(i.signal)return t.signalRef(i.signal);if(xg(i)){if(r&&fg(r,i))return e=ug({},e,{range:r[i]}),GK(e,t,n);i===`width`?i=[0,{signal:`width`}]:i===`height`?i=$D(e.type)?[0,{signal:`height`}]:[{signal:`height`},0]:V(`Unrecognized scale range value: `+W(i))}else if(i.scheme){n.scheme=H(i.scheme)?VK(i.scheme,t):BK(i.scheme,t),i.extent&&(n.schemeExtent=VK(i.extent,t)),i.count&&(n.schemeCount=BK(i.count,t));return}else if(i.step){n.rangeStep=BK(i.step,t);return}else if($D(e.type)&&!H(i))return UK(i,e,t);else H(i)||V(`Unsupported range type: `+W(i));return i.map(e=>(H(e)?VK:BK)(e,t))}function uDe(e,t){let n=t.config.projection||{},r={};for(let n in e)n!==`name`&&(r[n]=KK(e[n],n,t));for(let e in n)r[e]??(r[e]=KK(n[e],e,t));t.addProjection(e.name,r)}function KK(e,t,n){return H(e)?e.map(e=>KK(e,t,n)):Eh(e)?e.signal?n.signalRef(e.signal):t===`fit`?e:V(`Unsupported parameter object: `+W(e)):e}function qK(e){return e.type=oY,e.interactive=e.interactive||!1,e}function JK(e,t){let n=(n,r)=>IK(e[n],IK(t[n],r));return n.isVertical=n=>zJ===IK(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>IK(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>IK(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>IK(e.columns,IK(t.columns,+n.isVertical(!0))),n}function YK(e,t){let n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function dDe(e,t,n){let r=t.config.style[n];return r&&r[e]}function XK(e,t,n){return`item.anchor === '${BJ}' ? ${e} : item.anchor === '${HJ}' ? ${t} : ${n}`}function fDe(e){let t=e(`tickBand`),n=e(`tickOffset`),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},Eh(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t===`extent`?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e(`bandPosition`),i=e(`tickExtra`)),{extra:i,band:r,offset:n}}function ZK(e,t){return t?e?Eh(e)?Object.assign({},e,{offset:ZK(e.offset,t)}):{value:e,offset:t}:t:e}function QK(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=_K(e.encode,t,rY)):e.interactive=!1,e}function pDe(e,t,n,r){let i=JK(e,n),a=i.isVertical(),o=i.gradientThickness(),s=i.gradientLength(),c,l,u,d,f;a?(l=[0,1],u=[0,0],d=o,f=s):(l=[0,0],u=[1,0],d=s,f=o);let p={enter:c={opacity:iY,x:iY,y:iY,width:Dq(d),height:Dq(f)},update:ug({},c,{opacity:aY,fill:{gradient:t,start:l,stop:u}}),exit:{opacity:iY}};return gK(p,{stroke:i(`gradientStrokeColor`),strokeWidth:i(`gradientStrokeWidth`)},{opacity:i(`gradientOpacity`)}),QK({type:sY,role:zq,encode:p},r)}function mDe(e,t,n,r,i){let a=JK(e,n),o=a.isVertical(),s=a.gradientThickness(),c=a.gradientLength(),l,u,d,f,p=``;o?(l=`y`,d=`y2`,u=`x`,f=`width`,p=`1-`):(l=`x`,d=`x2`,u=`y`,f=`height`);let m={opacity:iY,fill:{scale:t,field:qJ}};m[l]={signal:p+`datum.perc`,mult:c},m[u]=iY,m[d]={signal:p+`datum.perc2`,mult:c},m[f]=Dq(s);let h={enter:m,update:ug({},m,{opacity:aY}),exit:{opacity:iY}};return gK(h,{stroke:a(`gradientStrokeColor`),strokeWidth:a(`gradientStrokeWidth`)},{opacity:a(`gradientOpacity`)}),QK({type:sY,role:Lq,key:qJ,from:i,encode:h},r)}function $K(e,t,n,r){let i=JK(e,t),a=i.isVertical(),o=Dq(i.gradientThickness()),s=i.gradientLength(),c=i(`labelOverlap`),l,u,d,f,p=``,m={enter:l={opacity:iY},update:u={opacity:aY,text:{field:WJ}},exit:{opacity:iY}};return gK(m,{fill:i(`labelColor`),fillOpacity:i(`labelOpacity`),font:i(`labelFont`),fontSize:i(`labelFontSize`),fontStyle:i(`labelFontStyle`),fontWeight:i(`labelFontWeight`),limit:IK(e.labelLimit,t.gradientLabelLimit)}),a?(l.align={value:`left`},l.baseline=u.baseline={signal:pY},d=`y`,f=`x`,p=`1-`):(l.align=u.align={signal:fY},l.baseline={value:`top`},d=`x`,f=`y`),l[d]=u[d]={signal:p+`datum.perc`,mult:s},l[f]=u[f]=o,o.offset=IK(e.labelOffset,t.gradientLabelOffset)||0,c=c?{separation:i(`labelSeparation`),method:c,order:`datum.index`}:void 0,QK({type:uY,role:Bq,style:JJ,key:qJ,from:r,encode:m,overlap:c},n)}function hDe(e,t,n,r,i){let a=JK(e,t),o=n.entries,s=!!(o&&o.interactive),c=o?o.name:void 0,l=a(`clipHeight`),u=a(`symbolOffset`),d={data:`value`},f=`(${i}) ? datum.${GJ} : datum.${tY}`,p=l?Dq(l):{field:tY},m=`datum.${UJ}`,h=`max(1, ${i})`,g,_,v,y,b;p.mult=.5,g={enter:_={opacity:iY,x:{signal:f,mult:.5,offset:u},y:p},update:v={opacity:aY,x:_.x,y:_.y},exit:{opacity:iY}};let x=null,S=null;e.fill||(x=t.symbolBaseFillColor,S=t.symbolBaseStrokeColor),gK(g,{fill:a(`symbolFillColor`,x),shape:a(`symbolType`),size:a(`symbolSize`),stroke:a(`symbolStrokeColor`,S),strokeDash:a(`symbolDash`),strokeDashOffset:a(`symbolDashOffset`),strokeWidth:a(`symbolStrokeWidth`)},{opacity:a(`symbolOpacity`)}),nY.forEach(t=>{e[t]&&(v[t]=_[t]={scale:e[t],field:qJ})});let C=QK({type:lY,role:Vq,key:qJ,from:d,clip:l?!0:void 0,encode:g},n.symbols),w=Dq(u);w.offset=a(`labelOffset`),g={enter:_={opacity:iY,x:{signal:f,offset:w},y:p},update:v={opacity:aY,text:{field:WJ},x:_.x,y:_.y},exit:{opacity:iY}},gK(g,{align:a(`labelAlign`),baseline:a(`labelBaseline`),fill:a(`labelColor`),fillOpacity:a(`labelOpacity`),font:a(`labelFont`),fontSize:a(`labelFontSize`),fontStyle:a(`labelFontStyle`),fontWeight:a(`labelFontWeight`),limit:a(`labelLimit`)});let T=QK({type:uY,role:Bq,style:JJ,key:qJ,from:d,encode:g},n.labels);return g={enter:{noBound:{value:!l},width:iY,height:l?Dq(l):iY,opacity:iY},exit:{opacity:iY},update:v={opacity:aY,row:{signal:null},column:{signal:null}}},a.isVertical(!0)?(y=`ceil(item.mark.items.length / ${h})`,v.row.signal=`${m}%${y}`,v.column.signal=`floor(${m} / ${y})`,b={field:[`row`,m]}):(v.row.signal=`floor(${m} / ${h})`,v.column.signal=`${m} % ${h}`,b={field:m}),v.column.signal=`(${i})?${v.column.signal}:${m}`,r={facet:{data:r,name:`value`,groupby:UJ}},qK({role:kq,from:r,encode:_K(g,o,rY),marks:[C,T],name:c,interactive:s,sort:b})}function gDe(e,t){let n=JK(e,t);return{align:n(`gridAlign`),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n(`rowPadding`),column:n(`columnPadding`)}}}function _De(e,t,n,r){let i=JK(e,t),a={enter:{opacity:iY},update:{opacity:aY,x:{field:{group:`padding`}},y:{field:{group:`padding`}}},exit:{opacity:iY}};return gK(a,{orient:i(`titleOrient`),_anchor:i(`titleAnchor`),anchor:{signal:bY},angle:{signal:xY},align:{signal:yY},baseline:{signal:SY},text:e.title,fill:i(`titleColor`),fillOpacity:i(`titleOpacity`),font:i(`titleFont`),fontSize:i(`titleFontSize`),fontStyle:i(`titleFontStyle`),fontWeight:i(`titleFontWeight`),limit:i(`titleLimit`),lineHeight:i(`titleLineHeight`)},{align:i(`titleAlign`),baseline:i(`titleBaseline`)}),QK({type:uY,role:Hq,style:YJ,from:r,encode:a},n)}function vDe(e,t){let n;return Eh(e)&&(e.signal?n=e.signal:e.path?n=`pathShape(`+eq(e.path)+`)`:e.sphere&&(n=`geoShape(`+eq(e.sphere)+`, {type: "Sphere"})`)),n?t.signalRef(n):!!e}function eq(e){return Eh(e)&&e.signal?e.signal:W(e)}function tq(e){let t=e.role||``;return t.startsWith(`axis`)||t.startsWith(`legend`)||t.startsWith(`title`)?t:e.type===oY?kq:t||`mark`}function yDe(e){return{marktype:e.type,name:e.name||void 0,role:e.role||tq(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function bDe(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function nq(e,t){let n=Tx(e.type);n||V(`Unrecognized transform type: `+W(e.type));let r=OK(n.type.toLowerCase(),null,rq(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function rq(e,t,n){let r={},i=e.params.length;for(let a=0;aiq(e,t,n)):iq(e,i,n)}function iq(e,t,n){let r=e.type;if(PK(t))return EY(r)?V(`Expression references can not be signals.`):DY(r)?n.fieldRef(t):OY(r)?n.compareRef(t):n.signalRef(t.signal);{let i=e.expr||DY(r);return i&&CY(t)?n.exprRef(t.expr,t.as):i&&wY(t)?jK(t.field,t.as):EY(r)?kW(t,n):TY(r)?AK(n.getData(t).values):DY(r)?jK(t):OY(r)?n.compareRef(t):t}}function SDe(e,t,n){return xg(t.from)||V(`Lookup "from" parameter must be a string literal.`),n.getData(t.from).lookupRef(n,t.key)}function CDe(e,t,n){let r=t[e.name];return e.array?(H(r)||V(`Expected an array of sub-parameters. Instead: `+W(r)),r.map(t=>aq(e,t,n))):aq(e,r,n)}function aq(e,t,n){let r=e.params.length,i;for(let n=0;ne??`null`).join(`,`)+`),0)`,t);c.update=l.$expr,c.params=l.$params}function fq(e,t){let n=tq(e),r=e.type===oY,i=e.from&&e.from.facet,a=e.overlap,o=e.layout||n===`scope`||n===`frame`,s,c,l,u,d,f,p,m=n===`mark`||o||i,h=wDe(e.from,r,t);c=t.add(lJ({key:h.key||(e.key?jK(e.key):void 0),pulse:h.pulse,clean:!r}));let g=AK(c);c=l=t.add(sJ({pulse:g})),c=t.add(_J({markdef:yDe(e),interactive:bDe(e.interactive,t),clip:vDe(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef(`parent`):null,index:t.markpath(),pulse:AK(c)}));let _=AK(c);c=u=t.add(uJ(wK(e.encode,e.type,n,e.style,t,{mod:!1,pulse:_}))),c.params.parent=t.encode(),e.transform&&e.transform.forEach(e=>{let n=nq(e,t),r=n.metadata;(r.generates||r.changes)&&V(`Mark transforms should not generate new data.`),r.nomod||(u.params.mod=!0),n.params.pulse=AK(c),t.add(c=n)}),e.sort&&(c=t.add(kJ({sort:t.compareRef(e.sort),pulse:AK(c)})));let v=AK(c);(i||o)&&(o=t.add(AJ({layout:t.objectProperty(e.layout),legends:t.legends,mark:_,pulse:v})),f=AK(o));let y=t.add(oJ({mark:_,pulse:f||v}));p=AK(y),r&&(m&&(s=t.operators,s.pop(),o&&s.pop()),t.pushState(v,f||p,g),i?TDe(e,t,h):m?EDe(e,t,h):t.parse(e),t.popState(),m&&(o&&s.push(o),s.push(y))),a&&(p=DDe(a,p,t));let b=t.add(EJ({pulse:p})),x=t.add(OJ({pulse:AK(b)},void 0,t.parent()));e.name!=null&&(d=e.name,t.addData(d,new sq(t,l,b,x)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&V(`Marks only support modify triggers.`),dq(e,t,d)}))}function DDe(e,t,n){let r=e.method,i=e.bound,a=e.separation,o={separation:PK(a)?n.signalRef(a.signal):a,method:PK(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),i){let e=i.tolerance;o.boundTolerance=PK(e)?n.signalRef(e.signal):+e,o.boundScale=n.scaleRef(i.scale),o.boundOrient=i.orient}return AK(n.add(bJ(o)))}function ODe(e,t){let n=t.config.legend,r=e.encode||{},i=JK(e,n),a=r.legend||{},o=a.name||void 0,s=a.interactive,c=a.style,l={},u=0,d,f,p;nY.forEach(t=>e[t]?(l[t]=e[t],u||=e[t]):0),u||V(`Missing valid scale for legend.`);let m=kDe(e,t.scaleType(u)),h={title:e.title!=null,scales:l,type:m,vgrad:m!==`symbol`&&i.isVertical()},g=AK(t.add(sJ(null,[h]))),_={enter:{x:{value:0},y:{value:0}}},v=AK(t.add(hJ(f={type:m,scale:t.scaleRef(u),count:t.objectProperty(i(`tickCount`)),limit:t.property(i(`symbolLimit`)),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return m===$J?(p=[pDe(e,u,n,r.gradient),$K(e,n,r.labels,v)],f.count=f.count||t.signalRef(`max(2,2*floor((${LK(i.gradientLength())})/100))`)):m===eY?p=[mDe(e,u,n,r.gradient,v),$K(e,n,r.labels,v)]:(d=gDe(e,n),p=[hDe(e,n,r,v,LK(d.columns))],f.size=MDe(e,t,p[0].marks)),p=[qK({role:Rq,from:g,encode:_,marks:p,layout:d,interactive:s})],h.title&&p.push(_De(e,n,r.title,g)),fq(qK({role:Iq,from:g,encode:_K(jDe(i,e,n),a,rY),marks:p,aria:i(`aria`),description:i(`description`),zindex:i(`zindex`),name:o,interactive:s,style:c}),t)}function kDe(e,t){let n=e.type||QJ;return!e.type&&ADe(e)===1&&(e.fill||e.stroke)&&(n=QD(t)?$J:eO(t)?eY:QJ),n===$J?eO(t)?eY:$J:n}function ADe(e){return nY.reduce((t,n)=>t+ +!!e[n],0)}function jDe(e,t,n){let r={enter:{},update:{}};return gK(r,{orient:e(`orient`),offset:e(`offset`),padding:e(`padding`),titlePadding:e(`titlePadding`),cornerRadius:e(`cornerRadius`),fill:e(`fillColor`),stroke:e(`strokeColor`),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e(`legendX`),y:e(`legendY`),format:t.format,formatType:t.formatType}),r}function MDe(e,t,n){return kW(`max(ceil(sqrt(${LK(pq(`size`,e,n))})+${LK(pq(`strokeWidth`,e,n))}),${LK(NDe(n[1].encode,t,JJ))})`,t)}function pq(e,t,n){return t[e]?`scale("${t[e]}",datum)`:YK(e,n[0].encode)}function NDe(e,t,n){return YK(`fontSize`,e)||dDe(`fontSize`,t,n)}function PDe(e,t){e=xg(e)?{text:e}:e;let n=JK(e,t.config.title),r=e.encode||{},i=r.group||{},a=i.name||void 0,o=i.interactive,s=i.style,c=[],l=AK(t.add(sJ(null,[{}])));return c.push(LDe(e,n,FDe(e),l)),e.subtitle&&c.push(RDe(e,n,r.subtitle,l)),fq(qK({role:Uq,from:l,encode:IDe(n,i),marks:c,aria:n(`aria`),description:n(`description`),zindex:n(`zindex`),name:a,interactive:o,style:s}),t)}function FDe(e){let t=e.encode;return t&&t.title||ug({name:e.name,interactive:e.interactive,style:e.style},t)}function IDe(e,t){let n={enter:{},update:{}};return gK(n,{orient:e(`orient`),anchor:e(`anchor`),align:{signal:dY},angle:{signal:kY},limit:e(`limit`),frame:e(`frame`),offset:e(`offset`)||0,padding:e(`subtitlePadding`)}),_K(n,t,rY)}function LDe(e,t,n,r){let i={value:0},a=e.text,o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return gK(o,{text:a,align:{signal:`item.mark.group.align`},angle:{signal:`item.mark.group.angle`},limit:{signal:`item.mark.group.limit`},baseline:`top`,dx:t(`dx`),dy:t(`dy`),fill:t(`color`),font:t(`font`),fontSize:t(`fontSize`),fontStyle:t(`fontStyle`),fontWeight:t(`fontWeight`),lineHeight:t(`lineHeight`)},{align:t(`align`),angle:t(`angle`),baseline:t(`baseline`)}),QK({type:uY,role:Wq,style:XJ,from:r,encode:o},n)}function RDe(e,t,n,r){let i={value:0},a=e.subtitle,o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return gK(o,{text:a,align:{signal:`item.mark.group.align`},angle:{signal:`item.mark.group.angle`},limit:{signal:`item.mark.group.limit`},baseline:`top`,dx:t(`dx`),dy:t(`dy`),fill:t(`subtitleColor`),font:t(`subtitleFont`),fontSize:t(`subtitleFontSize`),fontStyle:t(`subtitleFontStyle`),fontWeight:t(`subtitleFontWeight`),lineHeight:t(`subtitleLineHeight`)},{align:t(`align`),angle:t(`angle`),baseline:t(`baseline`)}),QK({type:uY,role:Gq,style:ZJ,from:r,encode:o},n)}function zDe(e,t){let n=[];e.transform&&e.transform.forEach(e=>{n.push(nq(e,t))}),e.on&&e.on.forEach(n=>{dq(n,t,e.name)}),t.addDataPipeline(e.name,BDe(e,t,n))}function BDe(e,t,n){let r=[],i=null,a=!1,o=!1,s,c,l,u,d;for(e.values?PK(e.values)||FK(e.format)?(r.push(hq(t,e)),r.push(i=mq())):r.push(i=mq({$ingest:e.values,$format:e.format})):e.url?FK(e.url)||FK(e.format)?(r.push(hq(t,e)),r.push(i=mq())):r.push(i=mq({$request:e.url,$format:e.format})):e.source&&(i=s=tg(e.source).map(e=>AK(t.getData(e).output)),r.push(null)),c=0,l=n.length;ce==null?!vK(t,r):(n.update[t]=qY(Dq(e),n.update[t]),!1),a=i(e(`titleX`),`x`),o=i(e(`titleY`),`y`);n.enter.auto=o===a?Dq(o):MY(t,Dq(o),Dq(a))}function YDe(e,t){let n=VDe(e,t),r=e.encode||{},i=r.axis||{},a=i.name||void 0,o=i.interactive,s=i.style,c=JK(e,n),l=fDe(c),u={scale:e.scale,ticks:!!c(`ticks`),labels:!!c(`labels`),grid:!!c(`grid`),domain:!!c(`domain`),title:e.title!=null},d=AK(t.add(sJ({},[u]))),f=AK(t.add(aJ({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),p=[],m;return u.grid&&p.push(UDe(e,n,r.grid,f,l)),u.ticks&&(m=c(`tickSize`),p.push(GDe(e,n,r.ticks,f,m,l))),u.labels&&(m=u.ticks?m:0,p.push(KDe(e,n,r.labels,f,m,l))),u.domain&&p.push(HDe(e,n,r.domain,d)),u.title&&p.push(qDe(e,n,r.title,d)),fq(qK({role:Aq,from:d,encode:_K(XDe(c,e),i,rY),marks:p,aria:c(`aria`),description:c(`description`),zindex:c(`zindex`),name:a,interactive:o,style:s}),t)}function XDe(e,t){let n={enter:{},update:{}};return gK(n,{orient:e(`orient`),offset:e(`offset`)||0,position:IK(t.position,0),titlePadding:e(`titlePadding`),minExtent:e(`minExtent`),maxExtent:e(`maxExtent`),range:{signal:`abs(span(range("${t.scale}")))`},translate:e(`translate`),format:t.format,formatType:t.formatType}),n}function bq(e,t,n){let r=tg(e.signals),i=tg(e.scales);return n||r.forEach(e=>EK(e,t)),tg(e.projections).forEach(e=>uDe(e,t)),i.forEach(e=>QEe(e,t)),tg(e.data).forEach(e=>zDe(e,t)),i.forEach(e=>$Ee(e,t)),(n||r).forEach(e=>ZEe(e,t)),tg(e.axes).forEach(e=>YDe(e,t)),tg(e.marks).forEach(e=>fq(e,t)),tg(e.legends).forEach(e=>ODe(e,t)),e.title&&PDe(e.title,t),t.parseLambdas(),t}function ZDe(e,t){let n=t.config,r=AK(t.root=t.add(kK())),i=QDe(e,n);i.forEach(e=>EK(e,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;let a=t.add(sJ()),o=t.add(uJ(wK(JY(e.encode),oY,Oq,e.style,t,{pulse:AK(a)}))),s=t.add(AJ({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef(`autosize`),mark:r,pulse:AK(o)}));t.operators.pop(),t.pushState(AK(o),AK(s),null),bq(e,t,i),t.operators.push(s);let c=t.add(oJ({mark:r,pulse:AK(s)}));return c=t.add(EJ({pulse:AK(c)})),c=t.add(OJ({pulse:AK(c)})),t.addData(`root`,new sq(t,a,a,c)),t}function xq(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function QDe(e,t){let n=n=>IK(e[n],t[n]),r=[xq(`background`,n(`background`)),xq(`autosize`,AEe(n(`autosize`))),xq(`padding`,jEe(n(`padding`))),xq(`width`,n(`width`)||0),xq(`height`,n(`height`)||0)],i=r.reduce((e,t)=>(e[t.name]=t,e),{}),a={};return tg(e.signals).forEach(e=>{fg(i,e.name)?e=ug(i[e.name],e):r.push(e),a[e.name]=e}),tg(t.signals).forEach(e=>{!fg(a,e.name)&&!fg(i,e.name)&&r.push(e)}),r}function Sq(e,t){this.config=e||{},this.options=t||{},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 Cq(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function wq(e){return(H(e)?$De:eOe)(e)}function $De(e){let t=e.length,n=`[`;for(let r=0;r0?`,`:``)+(Eh(t)?t.signal||wq(t):W(t))}return n+`]`}function eOe(e){let t=`{`,n=0,r,i;for(r in e)i=e[r],t+=(++n>1?`,`:``)+W(r)+`:`+(Eh(i)?i.signal||wq(i):W(i));return t+`}`}function tOe(){let e=`sans-serif`,t=`#4c78a8`,n=`#000`,r=`#888`,i=`#ddd`;return{description:`Vega visualization`,padding:0,autosize:`pad`,background:null,events:{defaults:{allow:[`wheel`]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:`bold`},"group-title":{fill:n,font:e,fontSize:13,fontWeight:`bold`},"group-subtitle":{fill:n,font:e,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:i},view:{fill:`transparent`}},title:{orient:`top`,anchor:`middle`,offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,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:i,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:r,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 nOe(e,t,n){return Eh(e)||V(`Input Vega specification must be an object.`),t=Oh(tOe(),t,e.config),ZDe(e,new Sq(t,n)).toRuntime()}var Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,KY,qY,JY,rOe=o((()=>{Ag(),XW(),mK(),DO(),Xx(),Tq=e=>+e||0,Eq=e=>({top:e,bottom:e,left:e,right:e}),Dq=e=>Eh(e)&&!H(e)?ug({},e):{value:e},Oq=`frame`,kq=`scope`,Aq=`axis`,jq=`axis-domain`,Mq=`axis-grid`,Nq=`axis-label`,Pq=`axis-tick`,Fq=`axis-title`,Iq=`legend`,Lq=`legend-band`,Rq=`legend-entry`,zq=`legend-gradient`,Bq=`legend-label`,Vq=`legend-symbol`,Hq=`legend-title`,Uq=`title`,Wq=`title-text`,Gq=`title-subtitle`,Kq=e=>xg(e)?W(e):e.signal?`(${e.signal})`:SK(e),qq=(e,t,n,r)=>`(${e}(${[t,n,r].map(bK).join(`,`)})+'')`,Jq=`outer`,Yq=[`value`,`update`,`init`,`react`,`bind`],Xq=jK(`key`),Zq=`ascending`,Qq=`descending`,$q=`scope`,eJ=`view`,tJ=`timer`,nJ={code:`_.$value`,ast:{type:`Identifier`,value:`value`}},rJ=e=>(t,n,r)=>OK(e,n,t||void 0,r),iJ=rJ(`aggregate`),aJ=rJ(`axisticks`),oJ=rJ(`bound`),sJ=rJ(`collect`),cJ=rJ(`compare`),lJ=rJ(`datajoin`),uJ=rJ(`encode`),dJ=rJ(`expression`),fJ=rJ(`facet`),pJ=rJ(`field`),mJ=rJ(`key`),hJ=rJ(`legendentries`),gJ=rJ(`load`),_J=rJ(`mark`),vJ=rJ(`multiextent`),yJ=rJ(`multivalues`),bJ=rJ(`overlap`),xJ=rJ(`params`),SJ=rJ(`prefacet`),CJ=rJ(`projection`),wJ=rJ(`proxy`),TJ=rJ(`relay`),EJ=rJ(`render`),DJ=rJ(`scale`),OJ=rJ(`sieve`),kJ=rJ(`sortitems`),AJ=rJ(`viewlayout`),jJ=rJ(`values`),MJ=0,NJ={min:`min`,max:`max`,count:`sum`},PJ=`top`,FJ=`left`,IJ=`right`,LJ=`bottom`,RJ=`center`,zJ=`vertical`,BJ=`start`,VJ=`middle`,HJ=`end`,UJ=`index`,WJ=`label`,GJ=`offset`,KJ=`perc`,qJ=`value`,JJ=`guide-label`,YJ=`guide-title`,XJ=`group-title`,ZJ=`group-subtitle`,QJ=`symbol`,$J=`gradient`,eY=`discrete`,tY=`size`,nY=[tY,`shape`,`fill`,`stroke`,`strokeWidth`,`strokeDash`,`opacity`],rY={name:1,style:1,interactive:1},iY={value:0},aY={value:1},oY=`group`,sY=`rect`,cY=`rule`,lY=`symbol`,uY=`text`,dY=XK(W(FJ),W(IJ),W(RJ)),fY=`datum.${KJ}<=0?"${FJ}":datum.${KJ}>=1?"${IJ}":"${RJ}"`,pY=`datum.${KJ}<=0?"${LJ}":datum.${KJ}>=1?"${PJ}":"${VJ}"`,mY=`item.orient === "left"`,hY=`item.orient === "right"`,gY=`(${mY} || ${hY})`,_Y=`datum.vgrad && ${gY}`,vY=XK(`"top"`,`"bottom"`,`"middle"`),yY=`datum.vgrad && ${hY} ? (${XK(`"right"`,`"left"`,`"center"`)}) : (${gY} && !(datum.vgrad && ${mY})) ? "left" : ${dY}`,bY=`item._anchor || (${gY} ? "middle" : "start")`,xY=`${_Y} ? (${mY} ? -90 : 90) : 0`,SY=`${gY} ? (datum.vgrad ? (${hY} ? "bottom" : "top") : ${vY}) : "top"`,CY=e=>e&&e.expr,wY=e=>e&&e.field,TY=e=>e===`data`,EY=e=>e===`expr`,DY=e=>e===`field`,OY=e=>e===`compare`,sq.fromEntries=function(e,t){let n=t.length,r=t[n-1],i=t[n-2],a=t[0],o=null,s=1;for(a&&a.type===`load`&&(a=t[1]),e.add(t[0]);se===LJ||e===PJ,jY=(e,t,n)=>PK(e)?RY(e.signal,t,n):e===FJ||e===PJ?t:n,MY=(e,t,n)=>PK(e)?IY(e.signal,t,n):AY(e)?t:n,NY=(e,t,n)=>PK(e)?LY(e.signal,t,n):AY(e)?n:t,PY=(e,t,n)=>PK(e)?zY(e.signal,t,n):e===PJ?{value:t}:{value:n},FY=(e,t,n)=>PK(e)?BY(e.signal,t,n):e===IJ?{value:t}:{value:n},IY=(e,t,n)=>VY(`${e} === '${PJ}' || ${e} === '${LJ}'`,t,n),LY=(e,t,n)=>VY(`${e} !== '${PJ}' && ${e} !== '${LJ}'`,t,n),RY=(e,t,n)=>UY(`${e} === '${FJ}' || ${e} === '${PJ}'`,t,n),zY=(e,t,n)=>UY(`${e} === '${PJ}'`,t,n),BY=(e,t,n)=>UY(`${e} === '${IJ}'`,t,n),VY=(e,t,n)=>(t=t==null?t:Dq(t),n=n==null?n:Dq(n),HY(t)&&HY(n)?(t=t?t.signal||W(t.value):null,n=n?n.signal||W(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[ug({test:e},t)].concat(n||[])),HY=e=>e==null||Object.keys(e).length===1,UY=(e,t,n)=>({signal:`${e} ? (${GY(t)}) : (${GY(n)})`}),WY=(e,t,n,r,i)=>({signal:(r==null?``:`${e} === '${FJ}' ? (${GY(r)}) : `)+(n==null?``:`${e} === '${LJ}' ? (${GY(n)}) : `)+(i==null?``:`${e} === '${IJ}' ? (${GY(i)}) : `)+(t==null?``:`${e} === '${PJ}' ? (${GY(t)}) : `)+`(null)`}),GY=e=>PK(e)?e.signal:e==null?null:W(e),KY=(e,t)=>t===0?0:PK(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},qY=(e,t)=>{let n=e.signal;return n&&n.endsWith(`(null)`)?{signal:n.slice(0,-6)+t.signal}:e},JY=e=>_K({enter:{x:{value:0},y:{value:0}},update:{width:{signal:`width`},height:{signal:`height`}}},e),Sq.prototype=Cq.prototype={parse(e){return bq(e,this)},fork(){return new Cq(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(e){return this.operators.push(e),e.id=this.id(),e.refs&&=(e.refs.forEach(t=>{t.$ref=e.id}),null),e},proxy(e){let t=e instanceof DK?AK(e):e;return this.add(wJ({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||={},i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,`input`),n(t.output,e,`output`),n(t.values,e,`values`);for(let r in t.index)n(t.index[r],e,`index:`+r)}return this},pushState(e,t,n){this._encode.push(AK(this.add(OJ({pulse:e})))),this._parent.push(t),this._lookup.push(n?AK(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return jh(this._parent)},encode(){return jh(this._encode)},lookup(){return jh(this._lookup)},markpath(){let e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(xg(e))return jK(e,t);e.signal||V(`Unsupported field reference: `+W(e));let n=e.signal,r=this.field[n];if(!r){let e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=AK(this.add(pJ(e)))}return r},compareRef(e){let t=!1,n=e=>PK(e)?(t=!0,this.signalRef(e.signal)):HEe(e)?(t=!0,this.exprRef(e.expr)):e,r=tg(e.field).map(n),i=tg(e.order).map(n);return t?AK(this.add(cJ({fields:r,orders:i}))):MK(r,i)},keyRef(e,t){let n=!1,r=e=>PK(e)?(n=!0,AK(i[e.signal])):e,i=this.signals;return e=tg(e).map(r),n?AK(this.add(mJ({fields:e,flat:t}))):BEe(e,t)},sortRef(e){if(!e)return e;let t=NK(e.op,e.field),n=e.order||Zq;return n.signal?AK(this.add(cJ({fields:t,orders:this.signalRef(n.signal)}))):MK(t,n)},event(e,t){let n=e+`:`+t;if(!this.events[n]){let r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return fg(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&V(`Duplicate signal name: `+W(e));let n=t instanceof DK?t:this.add(kK(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||V(`Unrecognized signal name: `+W(e)),this.signals[e]},signalRef(e){return this.signals[e]?AK(this.signals[e]):(fg(this.lambdas,e)||(this.lambdas[e]=this.add(kK(null))),AK(this.lambdas[e]))},parseLambdas(){let e=Object.keys(this.lambdas);for(let t=0,n=e.length;tzO,CanvasHandler:()=>ij,CanvasRenderer:()=>oj,DATE:()=>$v,DAY:()=>`day`,DAYOFYEAR:()=>ey,Dataflow:()=>Cx,Debug:()=>4,DisallowedObjectProperties:()=>Ch,Error:()=>1,EventStream:()=>mx,Gradient:()=>Jpe,GroupItem:()=>VO,HOURS:()=>ty,Handler:()=>NA,HybridHandler:()=>Ij,HybridRenderer:()=>Fj,Info:()=>3,Item:()=>BO,MILLISECONDS:()=>iy,MINUTES:()=>ny,MONTH:()=>Zv,Marks:()=>AA,MultiPulse:()=>bx,None:()=>0,Operator:()=>fx,Parameters:()=>dx,Pulse:()=>gx,QUARTER:()=>Xv,RenderType:()=>Hj,Renderer:()=>PA,ResourceLoader:()=>sA,SECONDS:()=>ry,SVGHandler:()=>cj,SVGRenderer:()=>kj,SVGStringRenderer:()=>Nj,Scenegraph:()=>MA,TIME_UNITS:()=>ay,Transform:()=>G,View:()=>MG,WEEK:()=>Qv,Warn:()=>2,YEAR:()=>Yv,accessor:()=>ih,accessorFields:()=>oh,accessorName:()=>ah,array:()=>tg,ascending:()=>sg,bandwidthNRD:()=>eS,bin:()=>tS,bootstrapCI:()=>nS,boundClip:()=>ige,boundContext:()=>WO,boundItem:()=>Ok,boundMark:()=>hhe,boundStroke:()=>UO,changeset:()=>ux,clampRange:()=>rg,codegenExpression:()=>FH,compare:()=>og,constant:()=>cg,cumulativeLogNormal:()=>fS,cumulativeNormal:()=>oS,cumulativeUniform:()=>vS,dayofyear:()=>Tv,debounce:()=>lg,defaultLocale:()=>Cb,definition:()=>Tx,densityLogNormal:()=>dS,densityNormal:()=>aS,densityUniform:()=>_S,detectTimeUnits:()=>Jv,domChild:()=>jk,domClear:()=>Mk,domCreate:()=>kk,domFind:()=>Ak,dotbin:()=>rS,error:()=>V,expressionFunction:()=>OW,extend:()=>ug,extent:()=>dg,extentIndex:()=>Vie,falsy:()=>Sh,fastmap:()=>mg,field:()=>hh,flush:()=>Wie,font:()=>wk,fontFamily:()=>Ck,fontSize:()=>vk,format:()=>Xb,formatLocale:()=>gb,formats:()=>Pb,hasOwnProperty:()=>fg,id:()=>_h,identity:()=>vh,inferType:()=>Ob,inferTypes:()=>kb,ingest:()=>ix,inherits:()=>U,inrange:()=>gg,interpolate:()=>rO,interpolateColors:()=>nO,interpolateRange:()=>dpe,intersect:()=>$he,intersectBoxLine:()=>qO,intersectPath:()=>GO,intersectPoint:()=>KO,intersectRule:()=>bme,isArray:()=>H,isBoolean:()=>_g,isDate:()=>vg,isFunction:()=>ig,isIterable:()=>Xie,isNumber:()=>yg,isObject:()=>Eh,isRegExp:()=>bg,isString:()=>xg,isTuple:()=>tx,key:()=>Sg,lerp:()=>nae,lineHeight:()=>yk,loader:()=>Zb,locale:()=>Sb,logger:()=>wh,lruCache:()=>iae,markup:()=>Fk,merge:()=>cae,mergeConfig:()=>Oh,multiLineOffset:()=>xk,one:()=>bh,pad:()=>dae,panLinear:()=>Lh,panLog:()=>Rh,panPow:()=>zh,panSymlog:()=>Bh,parse:()=>nOe,parseExpression:()=>NH,parseSelector:()=>ZG,path:()=>Cw,pathCurves:()=>AO,pathEqual:()=>age,pathParse:()=>jO,pathRectangle:()=>ome,pathRender:()=>MO,pathSymbols:()=>eme,pathTrail:()=>sme,peek:()=>jh,point:()=>Nk,projection:()=>QL,quantileLogNormal:()=>pS,quantileNormal:()=>sS,quantileUniform:()=>yS,quantiles:()=>Qx,quantizeInterpolator:()=>fpe,quarter:()=>$h,quartiles:()=>$x,random:()=>PS,randomInteger:()=>$ce,randomKDE:()=>lS,randomLCG:()=>Qce,randomLogNormal:()=>mS,randomMixture:()=>hS,randomNormal:()=>cS,randomUniform:()=>bS,read:()=>Ib,regressionConstant:()=>xS,regressionExp:()=>OS,regressionLinear:()=>ES,regressionLoess:()=>MS,regressionLog:()=>DS,regressionPoly:()=>jS,regressionPow:()=>kS,regressionQuad:()=>AS,renderModule:()=>Bk,repeat:()=>Cg,resetDefaultLocale:()=>mce,resetSVGDefIds:()=>sge,responseType:()=>Fb,runtimeContext:()=>eG,sampleCurve:()=>NS,sampleLogNormal:()=>uS,sampleNormal:()=>iS,sampleUniform:()=>gS,scale:()=>XD,sceneEqual:()=>Vk,sceneFromJSON:()=>_he,scenePickVisit:()=>ek,sceneToJSON:()=>ghe,sceneVisit:()=>$O,sceneZOrder:()=>QO,scheme:()=>iO,serializeXML:()=>Sj,setHybridRendererOptions:()=>Qhe,setRandom:()=>Xce,span:()=>wg,splitAccessPath:()=>ph,stringValue:()=>W,textMetrics:()=>OA,timeBin:()=>qv,timeFloor:()=>Lv,timeFormatLocale:()=>xb,timeInterval:()=>zv,timeOffset:()=>Hv,timeSequence:()=>Gv,timeUnitSpecifier:()=>Cv,timeUnits:()=>Sv,toBoolean:()=>Tg,toDate:()=>Eg,toNumber:()=>Nh,toSet:()=>Og,toString:()=>Dg,transform:()=>Ex,transforms:()=>Yx,truncate:()=>bae,truthy:()=>xh,tupleid:()=>nx,typeParsers:()=>Kb,utcFloor:()=>Rv,utcInterval:()=>Bv,utcOffset:()=>Uv,utcSequence:()=>Kv,utcdayofyear:()=>Av,utcquarter:()=>eg,utcweek:()=>jv,version:()=>XY,visitArray:()=>kg,week:()=>Ev,writeConfig:()=>kh,zero:()=>yh,zoomLinear:()=>Hh,zoomLog:()=>Uh,zoomPow:()=>Wh,zoomSymlog:()=>Gh}),YY,XY,ZY=o((()=>{Ag(),Ag(),Xx(),zle(),k_e(),q_e(),Xye(),lxe(),PSe(),XSe(),QSe(),wCe(),NCe(),zCe(),VS(),Py(),Qb(),Kj(),DO(),rR(),TEe(),Db(),XW(),rOe(),cG(),FU(),mK(),YY=`6.3.1`,ug(Yx,cle,o_e,A_e,Aye,rxe,FSe,ASe,ZSe,xCe,TCe,PCe),XY=YY}));function aOe(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}function QY(e,t,n,r,i,a){let o=e=>cX[e.type](o,e);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=r,o.event=i,o.item=a,oX.forEach(e=>o.fn[e]=(...t)=>i.vega[e](...t)),o(e)}var $Y,eX,tX,nX,rX,iX,aX,oX,sX,cX,lX,oOe=o((()=>{Ag(),$Y={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},eX={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},tX={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e},nX=Array.prototype.slice,rX=(e,t,n)=>{let r=n?n(t[0]):t[0];return r[e].apply(r,nX.call(t,1))},iX=(e,t=0,n=1,r=0,i=0,a=0,o=0)=>xg(e)?new Date(e):new Date(e,t,n,r,i,a,o),aX={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:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:iX,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return rX(`join`,arguments)},indexof:function(){return rX(`indexOf`,arguments)},lastindexof:function(){return rX(`lastIndexOf`,arguments)},slice:function(){return rX(`slice`,arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(sg),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return rX(`substring`,arguments,String)},split:function(){return rX(`split`,arguments,String)},replace:function(){return rX(`replace`,arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),encodeURIComponent:e=>encodeURIComponent(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)},oX=[`view`,`item`,`group`,`xy`,`x`,`y`],sX=new Set([Function,eval,setTimeout,setInterval]),typeof setImmediate==`function`&&sX.add(setImmediate),cX={Literal:(e,t)=>t.value,Identifier:(e,t)=>{let n=t.name;return e.memberDepth>0?n:n===`datum`?e.datum:n===`event`?e.event:n===`item`?e.item:$Y[n]||e.params[`$`+n]},MemberExpression:(e,t)=>{let n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);let i=e(t.property);if(n&&--e.memberDepth,sX.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{let n=t.arguments,r=t.callee.name;return r.startsWith(`_`)&&(r=r.slice(1)),r===`if`?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||aX[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>eX[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>tX[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator===`&&`?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((t,n)=>{e.memberDepth+=1;let r=e(n.key);--e.memberDepth;let i=e(n.value);return Ch.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):sX.has(i)?console.error(`Prevented interpretation of method "${r}" which could lead to insecure code execution`):t[r]=i,t},{})},lX={operator(e,t){let n=t.ast,r=e.functions;return e=>QY(n,r,e)},parameter(e,t){let n=t.ast,r=e.functions;return(e,t)=>QY(n,r,t,e)},event(e,t){let n=t.ast,r=e.functions;return e=>QY(n,r,void 0,void 0,e)},handler(e,t){let n=t.ast,r=e.functions;return(e,t)=>{let i=t.item&&t.item.datum;return QY(n,r,e,i,t)}},encode(e,t){let{marktype:n,channels:r}=t,i=e.functions,a=n===`group`||n===`image`||n===`rect`;return(e,t)=>{let o=e.datum,s=0,c;for(let n in r)c=QY(r[n].ast,i,t,o,void 0,e),e[n]!==c&&(e[n]=c,s=1);return n!==`rule`&&aOe(e,r,a),s}}}}));function uX(e){this.type=e}function sOe(e){switch(e.type){case KX:return e.elements;case qX:case XX:return[e.left,e.right];case JX:return[e.callee].concat(e.arguments);case YX:return[e.test,e.consequent,e.alternate];case ZX:return[e.object,e.property];case QX:return e.properties;case WX:return[e.key,e.value];case $X:return[e.argument];case GX:case UX:case HX:default:return[]}}function dX(e,t){if(!e)throw Error(`ASSERT: `+t)}function fX(e){return e>=48&&e<=57}function pX(e){return`0123456789abcdefABCDEF`.includes(e)}function mX(e){return`01234567`.includes(e)}function cOe(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function hX(e){return e===10||e===13||e===8232||e===8233}function gX(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&IZ.test(String.fromCharCode(e))}function _X(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&LZ.test(String.fromCharCode(e))}function vX(){for(;J1114111||e!==`}`)&&jX({},wZ,PZ),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function bX(){var e=tZ.charCodeAt(J++),t=String.fromCharCode(e);for(e===92&&(tZ.charCodeAt(J)!==117&&jX({},wZ,PZ),++J,e=yX(`u`),(!e||e===`\\`||!gX(e.charCodeAt(0)))&&jX({},wZ,PZ),t=e);J>>=`)return J+=4,{type:uZ,value:o,start:e,end:J};if(a=o.substr(0,3),a===`>>>`||a===`<<=`||a===`>>=`)return J+=3,{type:uZ,value:a,start:e,end:J};if(i=a.substr(0,2),r===i[1]&&`+-<>&|`.includes(r)||i===`=>`)return J+=2,{type:uZ,value:i,start:e,end:J};if(i===`//`&&jX({},wZ,PZ),`<>=!+-*%&|^/`.includes(r))return++J,{type:uZ,value:r,start:e,end:J};jX({},wZ,PZ)}function fOe(e){let t=``;for(;J{if(parseInt(t,16)<=1114111)return`x`;jX({},AZ)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,`x`));try{new RegExp(n)}catch{jX({},AZ)}try{return new RegExp(e,t)}catch{return null}}function gOe(){var e=tZ[J],t,n,r,i;for(dX(e===`/`,`Regular expression literal must start with a slash`),t=tZ[J++],n=!1,r=!1;J=0&&jX({},AZ,n),{value:n,literal:t}}function vOe(){var e,t,n,r;return rZ=null,vX(),e=J,t=gOe(),n=_Oe(),r=hOe(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:J}}function yOe(e){return e.type===oZ||e.type===sZ||e.type===iZ||e.type===cZ}function CX(){if(vX(),J>=nZ)return{type:aZ,start:J,end:J};let e=tZ.charCodeAt(J);return gX(e)?dOe():e===40||e===41||e===59?xX():e===39||e===34?mOe():e===46?fX(tZ.charCodeAt(J+1))?SX():xX():fX(e)?SX():xX()}function wX(){let e=rZ;return J=e.end,rZ=CX(),J=e.end,e}function TX(){let e=J;rZ=CX(),J=e}function bOe(e){let t=new uX(pZ);return t.elements=e,t}function EX(e,t,n){let r=new uX(e===`||`||e===`&&`?yZ:mZ);return r.operator=e,r.left=t,r.right=n,r}function xOe(e,t){let n=new uX(hZ);return n.callee=e,n.arguments=t,n}function SOe(e,t,n){let r=new uX(gZ);return r.test=e,r.consequent=t,r.alternate=n,r}function DX(e){let t=new uX(_Z);return t.name=e,t}function OX(e){let t=new uX(vZ);return t.value=e.value,t.raw=tZ.slice(e.start,e.end),e.regex&&(t.raw===`//`&&(t.raw=`/(?:)/`),t.regex=e.regex),t}function kX(e,t,n){let r=new uX(bZ);return r.computed=e===`[`,r.object=t,r.property=n,r.computed||(n.member=!0),r}function COe(e){let t=new uX(xZ);return t.properties=e,t}function AX(e,t,n){let r=new uX(SZ);return r.key=t,r.value=n,r.kind=e,r}function wOe(e,t){let n=new uX(CZ);return n.operator=e,n.argument=t,n.prefix=!0,n}function jX(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(e,t)=>(dX(t`:case`<=`:case`>=`:case`instanceof`:case`in`:t=7;break;case`<<`:case`>>`:case`>>>`:t=8;break;case`+`:case`-`:t=9;break;case`*`:case`/`:case`%`:t=11;break}return t}function FOe(){var e=rZ,t,n,r,i,a,o,s,c=RX(),l;if(r=rZ,i=zX(r),i===0)return c;for(r.prec=i,wX(),t=[e,rZ],o=RX(),a=[c,r,o];(i=zX(rZ))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,c=a.pop(),t.pop(),n=EX(s,c,o),a.push(n);r=wX(),r.prec=i,a.push(r),t.push(rZ),n=RX(),a.push(n)}for(l=a.length-1,n=a[l],t.pop();l>1;)t.pop(),n=EX(a[l-1].value,a[l-2],n),l-=2;return n}function BX(){var e=FOe(),t,n;return PX(`?`)&&(wX(),t=BX(),NX(`:`),n=BX(),e=SOe(e,t,n)),e}function VX(){let e=BX();if(PX(`,`))throw Error(FZ);return e}function IOe(e){tZ=e,J=0,nZ=tZ.length,rZ=null,TX();let t=VX();if(rZ.type!==aZ)throw Error(`Unexpect token after expression.`);return t}var HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,J,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ,zZ,LOe=o((()=>{Ag(),HX=`RawCode`,UX=`Literal`,WX=`Property`,GX=`Identifier`,KX=`ArrayExpression`,qX=`BinaryExpression`,JX=`CallExpression`,YX=`ConditionalExpression`,XX=`LogicalExpression`,ZX=`MemberExpression`,QX=`ObjectExpression`,$X=`UnaryExpression`,uX.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=sOe(this),n=0,r=t.length;n`,eZ[oZ]=`Identifier`,eZ[sZ]=`Keyword`,eZ[cZ]=`Null`,eZ[lZ]=`Numeric`,eZ[uZ]=`Punctuator`,eZ[dZ]=`String`,eZ[fZ]=`RegularExpression`,pZ=`ArrayExpression`,mZ=`BinaryExpression`,hZ=`CallExpression`,gZ=`ConditionalExpression`,_Z=`Identifier`,vZ=`Literal`,yZ=`LogicalExpression`,bZ=`MemberExpression`,xZ=`ObjectExpression`,SZ=`Property`,CZ=`UnaryExpression`,wZ=`Unexpected token %0`,TZ=`Unexpected number`,EZ=`Unexpected string`,DZ=`Unexpected identifier`,OZ=`Unexpected reserved word`,kZ=`Unexpected end of input`,AZ=`Invalid regular expression`,jZ=`Invalid regular expression: missing /`,MZ=`Octal literals are not allowed in strict mode.`,NZ=`Duplicate data property in object literal not allowed in strict mode`,PZ=`ILLEGAL`,FZ=`Disabled.`,IZ=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]`),LZ=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]`),RZ={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},zZ={if:1}})),ROe=c({accessPathDepth:()=>yQ,accessPathWithDatum:()=>fQ,accessWithDatumToUnescapedPath:()=>mQ,compile:()=>yLe,contains:()=>XZ,deepEqual:()=>EQ,deleteNestedProperty:()=>uQ,duplicate:()=>G2,entries:()=>q2,every:()=>QZ,fieldIntersection:()=>iQ,flatAccessWithDatum:()=>pQ,getFirstDefined:()=>bQ,hasIntersection:()=>nQ,hasProperty:()=>Y,hash:()=>JZ,internalField:()=>SQ,isBoolean:()=>oQ,isEmpty:()=>aQ,isEqual:()=>BOe,isInternalField:()=>CQ,isNullOrFalse:()=>YZ,isNumeric:()=>TQ,isPrimitive:()=>sQ,keys:()=>$,logicalExpr:()=>lQ,mergeDeep:()=>$Z,never:()=>GZ,normalize:()=>tNe,normalizeAngle:()=>wQ,omit:()=>qZ,pick:()=>KZ,prefixGenerator:()=>rQ,removePathFromField:()=>vQ,replaceAll:()=>_Q,replacePathInField:()=>gQ,resetIdCounter:()=>HOe,setEqual:()=>tQ,some:()=>ZZ,stringify:()=>DQ,titleCase:()=>dQ,unescapeSingleQuoteAndPathDot:()=>hQ,unique:()=>eQ,uniqueId:()=>xQ,vals:()=>K2,varName:()=>cQ,version:()=>FBe});function BZ(e){return Y(e,`or`)}function VZ(e){return Y(e,`and`)}function HZ(e){return Y(e,`not`)}function UZ(e,t){if(HZ(e))UZ(e.not,t);else if(VZ(e))for(let n of e.and)UZ(n,t);else if(BZ(e))for(let n of e.or)UZ(n,t);else t(e)}function WZ(e,t){return HZ(e)?{not:WZ(e.not,t)}:VZ(e)?{and:e.and.map(e=>WZ(e,t))}:BZ(e)?{or:e.or.map(e=>WZ(e,t))}:t(e)}function GZ(e){throw Error(e)}function KZ(e,t){let n={};for(let r of t)fg(e,r)&&(n[r]=e[r]);return n}function qZ(e,t){let n={...e};for(let e of t)delete n[e];return n}function JZ(e){if(yg(e))return e;let t=xg(e)?e:DQ(e);if(t.length<250)return t;let n=0;for(let e=0;et===0?e:`[${e}]`),r=e.map((t,n)=>e.slice(0,n+1).join(``));for(let e of r)t.add(e)}return t}function iQ(e,t){return e===void 0||t===void 0||nQ(rQ(e),rQ(t))}function aQ(e){return $(e).length===0}function oQ(e){return e===!0||e===!1}function sQ(e){return xg(e)||yg(e)||oQ(e)}function cQ(e){let t=e.replace(/\W/g,`_`);return(e.match(/^\d+/)?`_`:``)+t}function lQ(e,t){return HZ(e)?`!(${lQ(e.not,t)})`:VZ(e)?`(${e.and.map(e=>lQ(e,t)).join(`) && (`)})`:BZ(e)?`(${e.or.map(e=>lQ(e,t)).join(`) || (`)})`:t(e)}function uQ(e,t){if(t.length===0)return!0;let n=t.shift();return n in e&&uQ(e[n],t)&&delete e[n],aQ(e)}function dQ(e){return e.charAt(0).toUpperCase()+e.substr(1)}function fQ(e,t=`datum`){let n=ph(e),r=[];for(let e=1;e<=n.length;e++){let i=`[${n.slice(0,e).map(W).join(`][`)}]`;r.push(`${t}${i}`)}return r.join(` && `)}function pQ(e,t=`datum`){return`${t}[${W(ph(e).join(`.`))}]`}function mQ(e){return`datum['${e.replaceAll(`'`,`\\'`)}']`}function hQ(e){return e.replaceAll(`\\'`,`'`).replaceAll(`\\.`,`.`)}function VOe(e){return e.replace(/(\[|\]|\.|'|")/g,`\\$1`)}function gQ(e){return`${ph(e).map(VOe).join(`\\.`)}`}function _Q(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`),`g`),n)}function vQ(e){return`${ph(e).join(`.`)}`}function yQ(e){return e?ph(e).length:0}function bQ(...e){return e.find(e=>e!==void 0)}function xQ(e){let t=++J2;return e?String(e)+t:t}function HOe(){J2=42}function SQ(e){return CQ(e)?e:`__${e}`}function CQ(e){return e.startsWith(`__`)}function wQ(e){if(e!==void 0)return(e%360+360)%360}function TQ(e){return yg(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}function EQ(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!EQ(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let n of e.entries())if(!t.has(n[0]))return!1;for(let n of e.entries())if(!EQ(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e.entries())if(!t.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==Y2.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==Y2.toString)return e.toString()===t.toString();let i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!EQ(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function DQ(e){let t=[];return(function e(n){if(n?.toJSON&&typeof n.toJSON==`function`&&(n=n.toJSON()),n===void 0)return;if(typeof n==`number`)return isFinite(n)?`${n}`:`null`;if(typeof n!=`object`)return JSON.stringify(n);let r,i;if(Array.isArray(n)){for(i=`[`,r=0;re$(e[t])?cQ(`_${t}_${q2(e[t])}`):cQ(`_${t}_${e[t]}`)).join(``)}`}function ZQ(e){return e===!0||$Q(e)&&!e.binned}function QQ(e){return e===`binned`||$Q(e)&&e.binned===!0}function $Q(e){return Eh(e)}function e$(e){return Y(e,`param`)}function t$(e){switch(e){case X2:case Z2:case v4:case m4:case h4:case g4:case C4:case b4:case x4:case S4:case _4:return 6;case w4:return 4;default:return 10}}function n$(e){return Y(e,`expr`)}function r$(e,{level:t}={level:0}){let n=$(e||{}),r={};for(let i of n)r[i]=t===0?d$(e[i]):r$(e[i],{level:t-1});return r}function i$(e){let{anchor:t,frame:n,offset:r,orient:i,angle:a,limit:o,color:s,subtitleColor:c,subtitleFont:l,subtitleFontSize:u,subtitleFontStyle:d,subtitleFontWeight:f,subtitleLineHeight:p,subtitlePadding:m,...h}=e,g={...h,...s?{fill:s}:{}},_={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...a===void 0?{}:{angle:a},...o===void 0?{}:{limit:o}},v={...c?{subtitleColor:c}:{},...l?{subtitleFont:l}:{},...u?{subtitleFontSize:u}:{},...d?{subtitleFontStyle:d}:{},...f?{subtitleFontWeight:f}:{},...p?{subtitleLineHeight:p}:{},...m?{subtitlePadding:m}:{}};return{titleMarkConfig:g,subtitleMarkConfig:KZ(e,[`align`,`baseline`,`dx`,`dy`,`limit`]),nonMarkTitleProperties:_,subtitle:v}}function a$(e){return xg(e)||H(e)&&xg(e[0])}function o$(e){return Y(e,`signal`)}function s$(e){return Y(e,`step`)}function c$(e){return!H(e)&&Y(e,`fields`)&&!Y(e,`data`)}function XOe(e){return!H(e)&&Y(e,`fields`)&&Y(e,`data`)}function l$(e){return!H(e)&&Y(e,`field`)&&Y(e,`data`)}function u$(e){let t=H(e.condition)?e.condition.map(f$):f$(e.condition);return{...d$(e),condition:t}}function d$(e){if(n$(e)){let{expr:t,...n}=e;return{signal:t,...n}}return e}function f$(e){if(n$(e)){let{expr:t,...n}=e;return{signal:t,...n}}return e}function p$(e){if(n$(e)){let{expr:t,...n}=e;return{signal:t,...n}}return o$(e)?e:e===void 0?void 0:{value:e}}function ZOe(e){return o$(e)?e.signal:W(e)}function m$(e){return o$(e)?e.signal:W(e.value)}function h$(e){return o$(e)?e.signal:e==null?null:W(e)}function QOe(e,t,n){for(let r of n){let n=v$(r,t.markDef,t.config);n!==void 0&&(e[r]=p$(n))}return e}function g$(e){return[].concat(e.type,e.style??[])}function _$(e,t,n,r={}){let{vgChannel:i,ignoreVgConfig:a}=r;return i&&Y(t,i)?t[i]:t[e]===void 0?a&&(!i||i===e)?void 0:v$(e,t,n,r):t[e]}function v$(e,t,n,{vgChannel:r}={}){let i=y$(e,t,n.style);return bQ(r?i:void 0,i,r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function y$(e,t,n){return b$(e,g$(t),n)}function b$(e,t,n){t=tg(t);let r;for(let i of t){let t=n[i];Y(t,e)&&(r=t[e])}return r}function x$(e,t){return tg(e).reduce((e,n)=>(e.field.push(Q(n,t)),e.order.push(n.sort??`ascending`),e),{field:[],order:[]})}function S$(e,t){let n=[...e];return t.forEach(e=>{for(let t of n)if(EQ(t,e))return;n.push(e)}),n}function C$(e,t){return EQ(e,t)||!t?e:e?[...tg(e),...tg(t)].join(`, `):t}function w$(e,t){let n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((a$(n)||o$(n))&&(a$(r)||o$(r)))return{explicit:e.explicit,value:C$(n,r)};if(a$(n)||o$(n))return{explicit:e.explicit,value:n};if(a$(r)||o$(r))return{explicit:e.explicit,value:r};if(!a$(n)&&!o$(n)&&!a$(r)&&!o$(r))return{explicit:e.explicit,value:S$(n,r)};throw Error(`It should never reach here`)}function T$(e){return`Invalid specification ${DQ(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}function E$(e){return`${e==`width`?`Width`:`Height`} "container" only works for single views and layered views.`}function D$(e){return`${e==`width`?`Width`:`Height`} "container" only works well with autosize "fit" or "fit-${e==`width`?`x`:`y`}".`}function O$(e){return e?`Dropping "fit-${e}" because spec has discrete ${LQ(e)}.`:`Dropping "fit" because spec has discrete size.`}function k$(e){return`Unknown field for ${e}. Cannot calculate view size.`}function A$(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function $Oe(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function eke(e){return`The "nearest" transform is not supported for ${e} marks.`}function j$(e){return`Selection not supported for ${e} yet.`}function tke(e){return`Cannot find a selection named "${e}".`}function nke(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function rke(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}function ike(e){return`Unknown repeated value "${e}".`}function M$(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function ake(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${W(e)}.`}function oke(e,t,n,r){return`${e.length?`Multiple `:`No `}matching ${W(t)} encoding found for selection ${W(n.param)}. Using "field": ${W(r)}.`}function ske(e){return`Unrecognized parse "${e}".`}function N$(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function cke(e){return`Ignoring an invalid transform: ${DQ(e)}.`}function P$(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function lke(e){let{parentProjection:t,projection:n}=e;return`Layer's shared projection ${DQ(t)} is overridden by a child projection ${DQ(n)}.`}function uke(e){return`${e}Offset dropped because ${e} is continuous`}function dke(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${DQ(n)}}.`}function F$(e){return`Invalid field type "${e}".`}function fke(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function pke(e){return`Invalid aggregation operator "${e}".`}function I$(e,t){let{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?`fill and stroke`:n?`fill`:`stroke`}.`}function mke(e){return`Position range does not support relative band size for ${e}.`}function L$(e,t){return`Dropping ${DQ(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function R$(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function hke(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function gke(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function _ke(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function vke(e){return`Facet encoding dropped as ${e.join(` and `)} ${e.length>1?`are`:`is`} also specified.`}function z$(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t===`ordinal`?`order`:`magnitude`}.`}function yke(e){return`The ${e} for range marks cannot be an expression`}function bke(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?`x2 and y2`:e?`x2`:`y2`}. We will use the rule mark (line segments) instead.`}function xke(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Ske(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Cke(e){return`Cannot use the relative band size with ${e} scale.`}function wke(e){return`Using unaggregated domain with raw field has no effect (${DQ(e)}).`}function Tke(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Eke(e){return`Unaggregated domain is currently unsupported for log scale (${DQ(e)}).`}function Dke(e){return`Cannot apply size to non-oriented mark "${e}".`}function Oke(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function kke(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function B$(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function V$(e){return`The step for "${e}" is dropped because the ${e===`width`?`x`:`y`} is continuous.`}function Ake(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${DQ(n)} and ${DQ(r)}). Using ${DQ(n)}.`}function jke(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${DQ(n)} and ${DQ(r)}). Using the union of the two domains.`}function Mke(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Nke(e){return`Dropping sort property ${DQ(e)} as unioned domains only support boolean or op "count", "min", and "max".`}function Pke(e,t){return`Unioning discrete legend values from ${e} and ${t}.`}function Fke(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Ike(e){return`Stack is applied to a non-linear scale (${e}).`}function Lke(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function H$(e,t){return`Invalid ${e}: ${DQ(t)}.`}function Rke(e){return`Dropping day from datetime ${DQ(e)} as day cannot be combined with other units.`}function zke(e,t){return`${t?`extent `:``}${t&&e?`and `:``}${e?`center `:``}${t&&e?`are `:`is `}not needed when data are aggregated.`}function Bke(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Vke(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function Hke(e){return`1D error band does not support ${e}.`}function Uke(e){return`Channel ${e} is required for "binned" bin.`}function Wke(e){return`Channel ${e} should not be used with "binned" bin.`}function Gke(e){return`Domain for ${e} is required for threshold scale.`}function Kke(e){return Q4=e,Q4}function qke(){return Q4=Z4,Q4}function U$(...e){Q4.error(...e)}function X(...e){Q4.warn(...e)}function Jke(...e){Q4.debug(...e)}function W$(e){if(e&&Eh(e)){for(let t of n3)if(Y(e,t))return!0}return!1}function Yke(e){if(TQ(e)&&(e=+e),yg(e))return e>4&&X(H$(`quarter`,e)),e-1;throw Error(H$(`quarter`,e))}function Xke(e){if(TQ(e)&&(e=+e),yg(e))return e-1;{let t=e.toLowerCase(),n=$4.indexOf(t);if(n!==-1)return n;let r=t.substr(0,3),i=NRe.indexOf(r);if(i!==-1)return i;throw Error(H$(`month`,e))}}function Zke(e){if(TQ(e)&&(e=+e),yg(e))return e%7;{let t=e.toLowerCase(),n=e3.indexOf(t);if(n!==-1)return n;let r=t.substr(0,3),i=PRe.indexOf(r);if(i!==-1)return i;throw Error(H$(`day`,e))}}function G$(e,t){let n=[];if(t&&e.day!==void 0&&$(e).length>1&&(X(Rke(e)),e=G2(e),delete e.day),e.year===void 0?n.push(2012):n.push(e.year),e.month!==void 0){let r=t?Xke(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){let r=t?Yke(e.quarter):e.quarter;n.push(yg(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){let r=t?Zke(e.day):e.day;n.push(yg(r)?r+1:`${r}+1`)}else n.push(1);for(let t of[`hours`,`minutes`,`seconds`,`milliseconds`]){let r=e[t];n.push(r===void 0?0:r)}return n}function K$(e){let t=G$(e,!0).join(`, `);return e.utc?`utc(${t})`:`datetime(${t})`}function Qke(e){let t=G$(e,!1).join(`, `);return e.utc?`utc(${t})`:`datetime(${t})`}function $ke(e){let t=G$(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}function eAe(e){return fg(t3,e)}function q$(e){return Eh(e)?e.binned:tAe(e)}function tAe(e){return e?.startsWith(`binned`)}function J$(e){return e.startsWith(`utc`)}function nAe(e){return e.substring(3)}function Y$(e){return n3.filter(t=>iAe(e,t))}function rAe(e){let t=Y$(e);return t[t.length-1]}function iAe(e,t){let n=e.indexOf(t);return!(n<0||n>0&&t===`seconds`&&e.charAt(n-1)===`i`||e.length>n+3&&t===`day`&&e.charAt(n+3)===`o`||n>0&&t===`year`&&e.charAt(n-1)===`f`)}function aAe(e,t,{end:n}={end:!1}){let r=fQ(t),i=J$(e)?`utc`:``;function a(e){return e===`quarter`?`(${i}quarter(${r})-1)`:`${i}${e}(${r})`}let o,s={};for(let t of n3)iAe(e,t)&&(s[t]=a(t),o=t);return n&&(s[o]+=`+1`),Qke(s)}function oAe(e){if(e)return`timeUnitSpecifier(${DQ(Y$(e))}, ${DQ(FRe)})`}function sAe(e,t,n){if(!e)return;let r=oAe(e);return`${n||J$(e)?`utc`:`time`}Format(${t}, ${r})`}function X$(e){if(!e)return;let t;return xg(e)?t=tAe(e)?{unit:e.substring(6),binned:!0}:{unit:e}:Eh(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),J$(t.unit)&&(t.utc=!0,t.unit=nAe(t.unit)),t}function cAe(e){let{utc:t,...n}=X$(e);return n.unit?(t?`utc`:``)+$(n).map(e=>cQ(`${e===`unit`?``:`_${e}_`}${n[e]}`)).join(``):`${t?`utc`:``}timeunit${$(n).map(e=>cQ(`_${e}_${n[e]}`)).join(``)}`}function lAe(e,t=e=>e){let n=X$(e),r=rAe(n.unit);if(r&&r!==`day`){let e={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:i,part:a}=dAe(r,n.step);return`${t(K$({...e,[a]:+e[a]+i}))} - ${t(K$(e))}`}}function uAe(e){return fg(IRe,e)}function dAe(e,t=1){if(uAe(e))return{part:e,step:t};switch(e){case`day`:case`dayofyear`:return{part:`date`,step:t};case`quarter`:return{part:`month`,step:t*3};case`week`:return{part:`date`,step:t*7}}}function fAe(e){return Y(e,`param`)}function Z$(e){return!!e?.field&&e.equal!==void 0}function Q$(e){return!!e?.field&&e.lt!==void 0}function $$(e){return!!e?.field&&e.lte!==void 0}function e1(e){return!!e?.field&&e.gt!==void 0}function t1(e){return!!e?.field&&e.gte!==void 0}function n1(e){return!!(e?.field&&(H(e.range)&&e.range.length===2||o$(e.range)))}function r1(e){return!!e?.field&&(H(e.oneOf)||H(e.in))}function pAe(e){return!!e?.field&&e.valid!==void 0}function mAe(e){return r1(e)||Z$(e)||n1(e)||Q$(e)||e1(e)||$$(e)||t1(e)}function i1(e,t){return n0(e,{timeUnit:t,wrapTime:!0})}function hAe(e,t){return e.map(e=>i1(e,t))}function gAe(e,t=!0){let{field:n}=e,{unit:r,binned:i}=X$(e.timeUnit)||{},a=Q(e,{expr:`datum`}),o=r?`time(${i?a:aAe(r,n)})`:a;if(Z$(e))return`${o}===${i1(e.equal,r)}`;if(Q$(e)){let t=e.lt;return`${o}<${i1(t,r)}`}else if(e1(e)){let t=e.gt;return`${o}>${i1(t,r)}`}else if($$(e)){let t=e.lte;return`${o}<=${i1(t,r)}`}else if(t1(e)){let t=e.gte;return`${o}>=${i1(t,r)}`}else if(r1(e))return`indexof([${hAe(e.oneOf,r).join(`,`)}], ${o}) !== -1`;else if(pAe(e))return a1(o,e.valid);else if(n1(e)){let{range:n}=r$(e),i=o$(n)?{signal:`${n.signal}[0]`}:n[0],a=o$(n)?{signal:`${n.signal}[1]`}:n[1];if(i!==null&&a!==null&&t)return`inrange(${o}, [${i1(i,r)}, ${i1(a,r)}])`;let s=[];return i!==null&&s.push(`${o} >= ${i1(i,r)}`),a!==null&&s.push(`${o} <= ${i1(a,r)}`),s.length>0?s.join(` && `):`true`}throw Error(`Invalid field predicate: ${DQ(e)}`)}function a1(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function _Ae(e){return mAe(e)&&e.timeUnit?{...e,timeUnit:X$(e.timeUnit)}:e}function vAe(e){return e===`quantitative`||e===`temporal`}function o1(e){return e===`ordinal`||e===`nominal`}function yAe(e){if(e)switch(e=e.toLowerCase(),e){case`q`:case i3:return`quantitative`;case`t`:case o3:return`temporal`;case`o`:case a3:return`ordinal`;case`n`:case s3:return`nominal`;case c3:return`geojson`}}function bAe(e,t){let n=u3[e],r=u3[t];return n===r||n===`ordinal-position`&&r===`time`||r===`ordinal-position`&&n===`time`}function xAe(e){return LRe[e]}function SAe(e){return d3.has(e)}function s1(e){return zRe.has(e)}function c1(e){return RRe.has(e)}function l1(e){return f3.has(e)}function u1(e){return p3.has(e)}function CAe(e){return!xg(e)&&Y(e,`name`)}function wAe(e){return Y(e,`param`)}function TAe(e){return Y(e,`unionWith`)}function EAe(e){return Eh(e)&&`field`in e}function d1(e,t){switch(t){case`type`:case`domain`:case`reverse`:case`range`:return!0;case`scheme`:case`interpolate`:return![`point`,`band`,`identity`].includes(e);case`bins`:return![`point`,`band`,`identity`,`ordinal`].includes(e);case`round`:return l1(e)||e===`band`||e===`point`;case`padding`:case`rangeMin`:case`rangeMax`:return l1(e)||[`point`,`band`].includes(e);case`paddingOuter`:case`align`:return[`point`,`band`].includes(e);case`paddingInner`:return e===`band`;case`domainMax`:case`domainMid`:case`domainMin`:case`domainRaw`:case`clamp`:return l1(e);case`nice`:return l1(e)||e===`quantize`||e===`threshold`;case`exponent`:return e===`pow`;case`base`:return e===`log`;case`constant`:return e===`symlog`;case`zero`:return c1(e)&&!XZ([`log`,`time`,`utc`,`threshold`,`quantile`],e)}}function DAe(e,t){switch(t){case`interpolate`:case`scheme`:case`domainMid`:return jQ(e)?void 0:Ske(t);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 OAe(e,t){return XZ([a3,s3],t)?e===void 0||s1(e):t===o3?XZ([l3.TIME,l3.UTC,void 0],e):t!==i3||SAe(e)||u1(e)||e===void 0}function kAe(e,t,n=!1){if(!WQ(e))return!1;switch(e){case $2:case e4:case r4:case i4:case s4:case a4:return l1(t)?!0:t===`band`||t===`point`&&!n;case p4:return XZ([`linear`,`band`],t);case v4:case C4:case b4:case x4:case S4:case y4:return l1(t)||u1(t)||XZ([`band`,`point`,`ordinal`],t);case m4:case h4:case g4:return t!==`band`;case w4:case _4:return t===`ordinal`||u1(t)}}function AAe(e){return Eh(e)&&`value`in e}function f1(e){return[`line`,`area`,`trail`].includes(e)}function p1(e){return[`rect`,`bar`,`image`,`arc`,`tick`].includes(e)}function m1(e){return Y(e,`type`)}function h1(e){return Y(e,`band`)}function jAe(e){return m1(e)?e.type:e}function MAe(e,{isPath:t}){return e===void 0||e===`break-paths-show-path-domains`?t?`break-paths-show-domains`:`filter`:e===null?`show`:e}function g1({markDef:e,config:t,scaleChannel:n,scaleType:r,isCountAggregate:i}){if(!r||!c1(r)||i)return`always-valid`;let a=MAe(_$(`invalid`,e,t),{isPath:f1(e.type)});return t.scale?.invalid?.[n]===void 0?a:`show`}function NAe(e){return e===`break-paths-filter-domains`||e===`break-paths-show-domains`}function PAe({scaleName:e,scale:t,mode:n}){let r=`domain('${e}')`;if(!t||!e)return;let i=`${r}[0]`,a=`peek(${r})`,o=t.domainHasZero();return o===`definitely`?{scale:e,value:0}:o===`maybe`?{signal:`scale('${e}', inrange(0, ${r}) ? 0 : ${n===`zeroOrMin`?i:a})`}:{signal:`scale('${e}', ${n===`zeroOrMin`?i:a})`}}function FAe({scaleChannel:e,channelDef:t,scale:n,scaleName:r,markDef:i,config:a}){let o=n?.get(`type`),s=X1(t),c=g1({scaleChannel:e,markDef:i,config:a,scaleType:o,isCountAggregate:YQ(s?.aggregate)});if(s&&c===`show`){let t=a.scale.invalid?.[e]??`zero-or-min`;return{test:a1(Q(s,{expr:`datum`}),!1),...IAe(t,n,r)}}}function IAe(e,t,n){if(AAe(e)){let{value:t}=e;return o$(t)?{signal:t.signal}:{value:t}}return PAe({scale:t,scaleName:n,mode:`zeroOrMin`})}function _1(e){let{channel:t,channelDef:n,markDef:r,scale:i,scaleName:a,config:o}=e,s=PQ(t),c=b1(e),l=FAe({scaleChannel:s,channelDef:n,scale:i,scaleName:a,markDef:r,config:o});return l===void 0?c:[l,c]}function LAe(e){let{datum:t}=e;return W$(t)?K$(t):`${DQ(t)}`}function v1(e,t,n,r){let i={};if(t&&(i.scale=t),L1(e)){let{datum:t}=e;W$(t)?i.signal=K$(t):o$(t)?i.signal=t.signal:n$(t)?i.signal=t.expr:i.value=t}else i.field=Q(e,n);if(r){let{offset:e,band:t}=r;e&&(i.offset=e),t&&(i.band=t)}return i}function y1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:a=`end`,bandPosition:o=.5}){let s=!o$(o)&&0{let r=n0(t,{timeUnit:Z(e)&&!q$(e.timeUnit)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return r===void 0?t:{signal:r}})}function r0(e,t){return ZQ(e.bin)?WQ(t)&&[`ordinal`,`nominal`].includes(e.type):(console.warn(`Only call this method for binned field defs.`),!1)}function i0(e){return e?.condition}function bje(e){return fg(lze,e)}function a0(e){return Y(e,`mark`)}function o0(e,t){let n=e?.[t];return n?H(n)?ZZ(n,e=>!!e.field):Z(n)||P1(n):!1}function xje(e,t){let n=e?.[t];return n?H(n)?ZZ(n,e=>!!e.field):Z(n)||L1(n)||F1(n):!1}function Sje(e,t){if(BQ(t)){let n=e[t];if((Z(n)||L1(n))&&(o1(n.type)||Z(n)&&n.timeUnit))return xje(e,zQ(t))}return!1}function Cje(e){return ZZ(TLe,t=>{if(o0(e,t)){let n=e[t];if(H(n))return ZZ(n,e=>!!e.aggregate);{let e=X1(n);return e&&!!e.aggregate}}return!1})}function wje(e,t){let n=[],r=[],i=[],a=[],o={};return c0(e,(s,c)=>{if(Z(s)){let{field:l,aggregate:u,bin:d,timeUnit:f,...p}=s;if(u||f||d){let e=q1(s)?.title,m=Q(s,{forAs:!0}),h={...e?[]:{title:K1(s,t,{allowDisabling:!0})},...p,field:m};if(u){let e;if(qQ(u)?(e=`argmax`,m=Q({op:`argmax`,field:u.argmax},{forAs:!0}),h.field=`${m}.${l}`):KQ(u)?(e=`argmin`,m=Q({op:`argmin`,field:u.argmin},{forAs:!0}),h.field=`${m}.${l}`):u!==`boxplot`&&u!==`errorbar`&&u!==`errorband`&&(e=u),e){let t={op:e,as:m};l&&(t.field=l),a.push(t)}}else if(n.push(m),V1(s)&&ZQ(d)){if(r.push({bin:d,field:l,as:m}),n.push(Q(s,{binSuffix:`end`})),r0(s,c)&&n.push(Q(s,{binSuffix:`range`})),BQ(c)){let e={field:`${m}_end`};o[`${c}2`]=e}h.bin=`binned`,NQ(c)||(h.type=i3)}else if(f&&!q$(f)){i.push({timeUnit:f,field:l,as:m});let e=V1(s)&&s.type!==o3&&`time`;e&&(c===T4||c===k4?h.formatType=e:GOe(c)?h.legend={formatType:e,...h.legend}:BQ(c)&&(h.axis={formatType:e,...h.axis}))}o[c]=h}else n.push(l),o[c]=e[c]}else o[c]=e[c]}),{bins:r,timeUnits:i,aggregate:a,groupby:n,encoding:o}}function Tje(e,t,n){let r=qOe(t,n);if(!r)return!1;if(r===`binned`){let n=e[t===t4?$2:e4];return!!(Z(n)&&Z(e[t])&&QQ(n.bin))}return!0}function Eje(e,t,n,r){let i={};for(let t of $(e))MQ(t)||X(hke(t));for(let a of FLe){if(!e[a])continue;let o=e[a];if(HQ(a)){let e=WOe(a),t=i[e];if(Z(t)&&vAe(t.type)&&Z(o)&&!t.timeUnit){X(uke(e));continue}}if(a===`angle`&&t===`arc`&&!e.theta&&(X(ORe),a=s4),!Tje(e,a,t)){X(R$(a,t));continue}if(a===v4&&t===`line`&&X1(e[a])?.aggregate){X(kRe);continue}if(a===m4&&(n?`fill`in e:`stroke`in e)){X(I$(`encoding`,{fill:`fill`in e,stroke:`stroke`in e}));continue}if(a===D4||a===E4&&!H(o)&&!H1(o)||a===k4&&H(o)){if(o){if(a===E4){let t=e[a];if(tje(t)){i[a]=t;continue}}i[a]=tg(o).reduce((e,t)=>(Z(t)?e.push($1(t,a)):X(L$(t,a)),e),[])}}else{if(a===k4&&o===null)i[a]=null;else if(!Z(o)&&!L1(o)&&!H1(o)&&!N1(o)&&!o$(o)){X(L$(o,a));continue}i[a]=hje(o,a,r)}}return i}function s0(e,t){let n={};for(let r of $(e))n[r]=hje(e[r],r,t,{compositeMark:!0});return n}function Dje(e){let t=[];for(let n of $(e))if(o0(e,n)){let r=e[n],i=tg(r);for(let e of i)Z(e)?t.push(e):P1(e)&&t.push(e.condition)}return t}function c0(e,t,n){if(e)for(let r of $(e)){let i=e[r];if(H(i))for(let e of i)t.call(n,e,r);else t.call(n,i,r)}}function Oje(e,t,n,r){return e?$(e).reduce((n,i)=>{let a=e[i];return H(a)?a.reduce((e,n)=>t.call(r,e,n,i),n):t.call(r,n,a,i)},n):n}function kje(e,t){return $(t).reduce((n,r)=>{switch(r){case $2:case e4:case A4:case M4:case j4:case t4:case n4:return n;case r4:case i4:if(e===`line`||e===`area`||e===`trail`){let e=t[r];if(Z(e)){let i=t[r===r4?$2:e4];if(Z(i)&&!i.aggregate&&!e.aggregate){let t=Q(i,{}),r=Q(e,{});t&&r&&t!==r&&n.push(t)}}}return n;case s4:case c4:case a4:case o4:case p4:case l4:case u4:case d4:case f4:case T4:case _4:case y4:case k4:return n;case E4:if(e===`line`||e===`trail`)return n;case D4:case O4:{let e=t[r];if(H(e)||Z(e))for(let t of tg(e))t.aggregate||n.push(Q(t,{}));return n}case v4:if(e===`trail`)return n;case m4:case h4:case g4:case b4:case x4:case S4:case w4:case C4:{let e=X1(t[r]);return e&&!e.aggregate&&n.push(Q(e,{})),n}}},[])}function Aje(e){let{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(H(t)){for(let e of t)e.aggregate?(r||=[],r.push(e)):(i||=[],i.push(e));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return H(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function l0(e,t,n,r=!0){if(`tooltip`in n)return{tooltip:n.tooltip};let i=e.map(({fieldPrefix:e,titlePrefix:n})=>{let i=r?` of ${u0(t)}`:``;return{field:e+t.field,type:t.type,title:o$(n)?{signal:`${n}"${escape(i)}"`}:n+i}}),a=Dje(n).map(oje);return{tooltip:[...i,...eQ(a,JZ)]}}function u0(e){let{title:t,field:n}=e;return bQ(t,n)}function d0(e,t,n,r,i){let{scale:a,axis:o}=n;return({partName:s,mark:c,positionPrefix:l,endPositionPrefix:u=void 0,extraEncoding:d={}})=>{let f=u0(n);return jje(e,s,i,{mark:c,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...f===void 0?{}:{title:f},...a===void 0?{}:{scale:a},...o===void 0?{}:{axis:o}},...xg(u)?{[`${t}2`]:{field:`${u}_${n.field}`}}:{},...r,...d}})}}function jje(e,t,n,r){let{clip:i,color:a,opacity:o}=e,s=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...a?{color:a}:{},...o?{opacity:o}:{},...m1(r.mark)?r.mark:{type:r.mark},style:`${s}-${String(t)}`,..._g(e[t])?{}:e[t]}}]:[]}function Mje(e,t,n){let{encoding:r}=e,i=t===`vertical`?`y`:`x`,a=r[i],o=r[`${i}2`],s=r[`${i}Error`],c=r[`${i}Error2`];return{continuousAxisChannelDef:f0(a,n),continuousAxisChannelDef2:f0(o,n),continuousAxisChannelDefError:f0(s,n),continuousAxisChannelDefError2:f0(c,n),continuousAxis:i}}function f0(e,t){if(e?.aggregate){let{aggregate:n,...r}=e;return n!==t&&X(Vke(n,t)),r}else return e}function Nje(e,t){let{mark:n,encoding:r}=e,{x:i,y:a}=r;if(m1(n)&&n.orient)return n.orient;if(R1(i)){if(R1(a)){let e=Z(i)&&i.aggregate,n=Z(a)&&a.aggregate;if(!e&&n===t)return`vertical`;if(!n&&e===t)return`horizontal`;if(e===t&&n===t)throw Error(`Both x and y cannot have aggregate`);return t0(a)&&!t0(i)?`horizontal`:`vertical`}return`horizontal`}else if(R1(a))return`vertical`;else throw Error(`Need a valid continuous axis for ${t}s`)}function Pje(e){return yg(e)?`tukey`:e}function Fje(e,{config:t}){e={...e,encoding:s0(e.encoding,t)};let{mark:n,encoding:r,params:i,projection:a,...o}=e,s=m1(n)?n:{type:n};i&&X(j$(`boxplot`));let c=s.extent??t.boxplot.extent,l=_$(`size`,s,t),u=s.invalid,d=Pje(c),{bins:f,timeUnits:p,transform:m,continuousAxisChannelDef:h,continuousAxis:g,groupby:_,aggregate:v,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:S}=Lje(e,c,t),C=vQ(h.field),{color:w,size:T,...E}=y,D=e=>d0(s,g,h,e,t.boxplot),O=D(E),k=D(y),A=(Eh(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||`#4c78a8`,j=D({...E,...T?{size:T}:{},color:{condition:{test:`${mQ(`lower_box_${h.field}`)} >= ${mQ(`upper_box_${h.field}`)}`,...w||{value:A}}}}),M=l0([{fieldPrefix:d===`min-max`?`upper_whisker_`:`max_`,titlePrefix:`Max`},{fieldPrefix:`upper_box_`,titlePrefix:`Q3`},{fieldPrefix:`mid_box_`,titlePrefix:`Median`},{fieldPrefix:`lower_box_`,titlePrefix:`Q1`},{fieldPrefix:d===`min-max`?`lower_whisker_`:`min_`,titlePrefix:`Min`}],h,y),ee={type:`tick`,color:`black`,opacity:1,orient:b,invalid:u,aria:!1},N=d===`min-max`?M:l0([{fieldPrefix:`upper_whisker_`,titlePrefix:`Upper Whisker`},{fieldPrefix:`lower_whisker_`,titlePrefix:`Lower Whisker`}],h,y),te=[...O({partName:`rule`,mark:{type:`rule`,invalid:u,aria:!1},positionPrefix:`lower_whisker`,endPositionPrefix:`lower_box`,extraEncoding:N}),...O({partName:`rule`,mark:{type:`rule`,invalid:u,aria:!1},positionPrefix:`upper_box`,endPositionPrefix:`upper_whisker`,extraEncoding:N}),...O({partName:`ticks`,mark:ee,positionPrefix:`lower_whisker`,extraEncoding:N}),...O({partName:`ticks`,mark:ee,positionPrefix:`upper_whisker`,extraEncoding:N})],ne=[...d===`tukey`?[]:te,...k({partName:`box`,mark:{type:`bar`,...l?{size:l}:{},orient:x,invalid:u,ariaRoleDescription:`box`},positionPrefix:`lower_box`,endPositionPrefix:`upper_box`,extraEncoding:M}),...j({partName:`median`,mark:{type:`tick`,invalid:u,...Eh(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:b,aria:!1},positionPrefix:`mid_box`,extraEncoding:M})];if(d===`min-max`)return{...o,transform:(o.transform??[]).concat(m),layer:ne};let P=mQ(`lower_box_${h.field}`),re=mQ(`upper_box_${h.field}`),F=`(${re} - ${P})`,ie=`${P} - ${c} * ${F}`,ae=`${re} + ${c} * ${F}`,oe=mQ(h.field),se={joinaggregate:Ije(h.field),groupby:_},ce={transform:[{filter:`(${ie} <= ${oe}) && (${oe} <= ${ae})`},{aggregate:[{op:`min`,field:h.field,as:`lower_whisker_${C}`},{op:`max`,field:h.field,as:`upper_whisker_${C}`},{op:`min`,field:`lower_box_${h.field}`,as:`lower_box_${C}`},{op:`max`,field:`upper_box_${h.field}`,as:`upper_box_${C}`},...v],groupby:_}],layer:te},{tooltip:le,...ue}=E,{scale:de,axis:fe}=h,pe=u0(h),me=jje(s,`outliers`,t.boxplot,{transform:[{filter:`(${oe} < ${ie}) || (${oe} > ${ae})`}],mark:`point`,encoding:{[g]:{field:h.field,type:h.type,...pe===void 0?{}:{title:pe},...de===void 0?{}:{scale:de},...fe===void 0?{}:{axis:fe}},...ue,...w?{color:w}:{},...S?{tooltip:S}:{}}})[0],he,ge=[...f,...p,se];return me?he={transform:ge,layer:[me,ce]}:(he=ce,he.transform.unshift(...ge)),{...o,layer:[he,{transform:m,layer:ne}]}}function Ije(e){let t=vQ(e);return[{op:`q1`,field:e,as:`lower_box_${t}`},{op:`q3`,field:e,as:`upper_box_${t}`}]}function Lje(e,t,n){let r=Nje(e,z3),{continuousAxisChannelDef:i,continuousAxis:a}=Mje(e,r,z3),o=i.field,s=vQ(o),c=Pje(t),l=[...Ije(o),{op:`median`,field:o,as:`mid_box_${s}`},{op:`min`,field:o,as:(c===`min-max`?`lower_whisker_`:`min_`)+s},{op:`max`,field:o,as:(c===`min-max`?`upper_whisker_`:`max_`)+s}],u=c===`min-max`||c===`tukey`?[]:[{calculate:`${mQ(`upper_box_${s}`)} - ${mQ(`lower_box_${s}`)}`,as:`iqr_${s}`},{calculate:`min(${mQ(`upper_box_${s}`)} + ${mQ(`iqr_${s}`)} * ${t}, ${mQ(`max_${s}`)})`,as:`upper_whisker_${s}`},{calculate:`max(${mQ(`lower_box_${s}`)} - ${mQ(`iqr_${s}`)} * ${t}, ${mQ(`min_${s}`)})`,as:`lower_whisker_${s}`}],{[a]:d,...f}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:m}=Aje(f),{bins:h,timeUnits:g,aggregate:_,groupby:v,encoding:y}=wje(m,n),b=r===`vertical`?`horizontal`:`vertical`,x=r;return{bins:h,timeUnits:g,transform:[...h,...g,{aggregate:[..._,...l],groupby:v},...u],groupby:v,aggregate:_,continuousAxisChannelDef:i,continuousAxis:a,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:p}}function Rje(e,{config:t}){e={...e,encoding:s0(e.encoding,t)};let{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:a,ticksOrient:o,markDef:s,outerSpec:c,tooltipEncoding:l}=Uje(e,B3,t);delete a.size;let u=d0(s,i,r,a,t.errorbar),d=s.thickness,f=s.size,p={type:`tick`,orient:o,aria:!1,...d===void 0?{}:{thickness:d},...f===void 0?{}:{size:f}},m=[...u({partName:`ticks`,mark:p,positionPrefix:`lower`,extraEncoding:l}),...u({partName:`ticks`,mark:p,positionPrefix:`upper`,extraEncoding:l}),...u({partName:`rule`,mark:{type:`rule`,ariaRoleDescription:`errorbar`,...d===void 0?{}:{size:d}},positionPrefix:`lower`,endPositionPrefix:`upper`,extraEncoding:l})];return{...c,transform:n,...m.length>1?{layer:m}:{...m[0]}}}function zje(e,t){let{encoding:n}=e;if(Bje(n))return{orient:Nje(e,t),inputType:`raw`};let r=Vje(n),i=Hje(n),a=n.x,o=n.y;if(r){if(i)throw Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);let e=n.x2,r=n.y2;if(B1(e)&&B1(r))throw Error(`${t} cannot have both x2 and y2`);if(B1(e)){if(R1(a))return{orient:`horizontal`,inputType:`aggregated-upper-lower`};throw Error(`Both x and x2 have to be quantitative in ${t}`)}else if(B1(r)){if(R1(o))return{orient:`vertical`,inputType:`aggregated-upper-lower`};throw Error(`Both y and y2 have to be quantitative in ${t}`)}throw Error(`No ranged axis`)}else{let e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(B1(r)&&!B1(e))throw Error(`${t} cannot have xError2 without xError`);if(B1(s)&&!B1(i))throw Error(`${t} cannot have yError2 without yError`);if(B1(e)&&B1(i))throw Error(`${t} cannot have both xError and yError with both are quantiative`);if(B1(e)){if(R1(a))return{orient:`horizontal`,inputType:`aggregated-error`};throw Error(`All x, xError, and xError2 (if exist) have to be quantitative`)}else if(B1(i)){if(R1(o))return{orient:`vertical`,inputType:`aggregated-error`};throw Error(`All y, yError, and yError2 (if exist) have to be quantitative`)}throw Error(`No ranged axis`)}}function Bje(e){return(B1(e.x)||B1(e.y))&&!B1(e.x2)&&!B1(e.y2)&&!B1(e.xError)&&!B1(e.xError2)&&!B1(e.yError)&&!B1(e.yError2)}function Vje(e){return B1(e.x2)||B1(e.y2)}function Hje(e){return B1(e.xError)||B1(e.xError2)||B1(e.yError)||B1(e.yError2)}function Uje(e,t,n){let{mark:r,encoding:i,params:a,projection:o,...s}=e,c=m1(r)?r:{type:r};a&&X(j$(t));let{orient:l,inputType:u}=zje(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:f,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:m,continuousAxis:h}=Mje(e,l,t),{errorBarSpecificAggregate:g,postAggregateCalculates:_,tooltipSummary:v,tooltipTitleWithFieldName:y}=Wje(c,d,f,p,m,u,t,n),{[h]:b,[h===`x`?`x2`:`y2`]:x,[h===`x`?`xError`:`yError`]:S,[h===`x`?`xError2`:`yError2`]:C,...w}=i,{bins:T,timeUnits:E,aggregate:D,groupby:O,encoding:k}=wje(w,n),A=[...D,...g],j=u===`raw`?O:[],M=l0(v,d,k,y);return{transform:[...s.transform??[],...T,...E,...A.length===0?[]:[{aggregate:A,groupby:j}],..._],groupby:j,continuousAxisChannelDef:d,continuousAxis:h,encodingWithoutContinuousAxis:k,ticksOrient:l===`vertical`?`horizontal`:`vertical`,markDef:c,outerSpec:s,tooltipEncoding:M}}function Wje(e,t,n,r,i,a,o,s){let c=[],l=[],u=t.field,d,f=!1;if(a===`raw`){let t=e.center?e.center:e.extent?e.extent===`iqr`?`median`:`mean`:s.errorbar.center,n=e.extent?e.extent:t===`mean`?`stderr`:`iqr`;if(t===`median`!=(n===`iqr`)&&X(Bke(t,n,o)),n===`stderr`||n===`stdev`)c=[{op:n,field:u,as:`extent_${u}`},{op:t,field:u,as:`center_${u}`}],l=[{calculate:`${mQ(`center_${u}`)} + ${mQ(`extent_${u}`)}`,as:`upper_${u}`},{calculate:`${mQ(`center_${u}`)} - ${mQ(`extent_${u}`)}`,as:`lower_${u}`}],d=[{fieldPrefix:`center_`,titlePrefix:dQ(t)},{fieldPrefix:`upper_`,titlePrefix:Gje(t,n,`+`)},{fieldPrefix:`lower_`,titlePrefix:Gje(t,n,`-`)}],f=!0;else{let e,t,r;n===`ci`?(e=`mean`,t=`ci0`,r=`ci1`):(e=`median`,t=`q1`,r=`q3`),c=[{op:t,field:u,as:`lower_${u}`},{op:r,field:u,as:`upper_${u}`},{op:e,field:u,as:`center_${u}`}],d=[{fieldPrefix:`upper_`,titlePrefix:K1({field:u,aggregate:r,type:`quantitative`},s,{allowDisabling:!1})},{fieldPrefix:`lower_`,titlePrefix:K1({field:u,aggregate:t,type:`quantitative`},s,{allowDisabling:!1})},{fieldPrefix:`center_`,titlePrefix:K1({field:u,aggregate:e,type:`quantitative`},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&X(zke(e.center,e.extent)),a===`aggregated-upper-lower`?(d=[],l=[{calculate:mQ(n.field),as:`upper_${u}`},{calculate:mQ(u),as:`lower_${u}`}]):a===`aggregated-error`&&(d=[{fieldPrefix:``,titlePrefix:u}],l=[{calculate:`${mQ(u)} + ${mQ(r.field)}`,as:`upper_${u}`}],i?l.push({calculate:`${mQ(u)} + ${mQ(i.field)}`,as:`lower_${u}`}):l.push({calculate:`${mQ(u)} - ${mQ(r.field)}`,as:`lower_${u}`}));for(let e of l)d.push({fieldPrefix:e.as.substring(0,6),titlePrefix:_Q(_Q(e.calculate,`datum['`,``),`']`,``)})}return{postAggregateCalculates:l,errorBarSpecificAggregate:c,tooltipSummary:d,tooltipTitleWithFieldName:f}}function Gje(e,t,n){return`${dQ(e)} ${n} ${t}`}function Kje(e,{config:t}){e={...e,encoding:s0(e.encoding,t)};let{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:a,markDef:o,outerSpec:s,tooltipEncoding:c}=Uje(e,V3,t),l=o,u=d0(l,i,r,a,t.errorband),d=e.encoding.x!==void 0&&e.encoding.y!==void 0,f={type:d?`area`:`rect`},p={type:d?`line`:`rule`},m={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return d?(f={...f,...m,ariaRoleDescription:`errorband`},p={...p,...m,aria:!1}):l.interpolate?X(Hke(`interpolate`)):l.tension&&X(Hke(`tension`)),{...s,transform:n,layer:[...u({partName:`band`,mark:f,positionPrefix:`lower`,endPositionPrefix:`upper`,extraEncoding:c}),...u({partName:`borders`,mark:p,positionPrefix:`lower`,extraEncoding:c}),...u({partName:`borders`,mark:p,positionPrefix:`upper`,extraEncoding:c})]}}function p0(e,t,n){let r=new R3(e,t);H3[e]={normalizer:r,parts:n}}function qje(){return $(H3)}function m0(e){return e===`legend`||!!e?.legend}function h0(e){return m0(e)&&Eh(e)}function g0(e){return!!e?.select}function Jje(e){let t=[];for(let n of e||[]){if(g0(n))continue;let{expr:e,bind:r,...i}=n;if(r&&e){let n={...i,bind:r,init:e};t.push(n)}else{let n={...i,...e?{update:e}:{},...r?{bind:r}:{}};t.push(n)}}return t}function Yje(e){return v0(e)||y0(e)||_0(e)}function _0(e){return Y(e,`concat`)}function v0(e){return Y(e,`vconcat`)}function y0(e){return Y(e,`hconcat`)}function Xje({step:e,offsetIsDiscrete:t}){return t?e.for??`offset`:`position`}function b0(e){return Y(e,`step`)}function Zje(e){return Y(e,`view`)||Y(e,`width`)||Y(e,`height`)}function Qje(e,t,n){let r=n[t],i={},{spacing:a,columns:o}=r;a!==void 0&&(i.spacing=a),o!==void 0&&(A1(e)&&!O1(e.facet)||_0(e))&&(i.columns=o),v0(e)&&(i.columns=1);for(let t of Sze)if(e[t]!==void 0)if(t===`spacing`){let n=e[t];i[t]=yg(n)?n:{row:n.row??a,column:n.column??a}}else i[t]=e[t];return i}function x0(e,t){return e[t]??e[t===`width`?`continuousWidth`:`continuousHeight`]}function S0(e,t){let n=C0(e,t);return b0(n)?n.step:Y3}function C0(e,t){return bQ(e[t]??e[t===`width`?`discreteWidth`:`discreteHeight`],{step:e.step})}function $je(e={}){return{signals:[{name:`color`,value:Eh(e)?{...Q3,...e}:Q3}],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 eMe(e){return{signals:[{name:`fontSize`,value:Eh(e)?{...Z3,...e}:Z3}],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 tMe(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function nMe(e){let t=$(e||{}),n={};for(let r of t){let t=e[r];n[r]=i0(t)?u$(t):d$(t)}return n}function rMe(e){let t=$(e),n={};for(let r of t)n[r]=nMe(e[r]);return n}function iMe(e={}){let{color:t,font:n,fontSize:r,selection:i,...a}=e,o=Oh({},G2(Cze),n?tMe(n):{},t?$je(t):{},r?eMe(r):{},a||{});i&&kh(o,`selection`,i,!0);let s=qZ(o,wze);for(let e of[`background`,`lineBreak`,`padding`])o[e]&&(s[e]=d$(o[e]));for(let e of O3)o[e]&&(s[e]=r$(o[e]));for(let e of L3)o[e]&&(s[e]=nMe(o[e]));for(let e of G3)o[e]&&(s[e]=r$(o[e]));if(o.legend&&(s.legend=r$(o.legend)),o.scale){let{invalid:e,...t}=o.scale,n=r$(e,{level:1});s.scale={...r$(t),...$(n).length>0?{invalid:n}:{}}}return o.style&&(s.style=rMe(o.style)),o.title&&(s.title=r$(o.title)),o.view&&(s.view=r$(o.view)),s}function aMe(e){e=G2(e);for(let t of Eze)delete e[t];if(e.axis)for(let t in e.axis)i0(e.axis[t])&&delete e.axis[t];if(e.legend)for(let t of gze)delete e.legend[t];if(e.mark){for(let t of E3)delete e.mark[t];e.mark.tooltip&&Eh(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(Jje(e.params)),delete e.params);for(let t of Tze){for(let n of E3)delete e[t][n];let n=Dze[t];if(n)for(let r of n)delete e[t][r];sMe(e,t)}for(let t of qje())delete e[t];oMe(e);for(let t in e)Eh(e[t])&&aQ(e[t])&&delete e[t];return aQ(e)?void 0:e}function oMe(e){let{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=i$(e.title);aQ(t)||(e.style[`group-title`]={...e.style[`group-title`],...t}),aQ(n)||(e.style[`group-subtitle`]={...e.style[`group-subtitle`],...n}),aQ(r)?delete e.title:e.title=r}function sMe(e,t,n,r){let i=e[t];t===`view`&&(n=`cell`);let a={...i,...e.style[n??t]};aQ(a)||(e.style[n??t]=a),delete e[t]}function w0(e){return Y(e,`layer`)}function cMe(e){return Y(e,`repeat`)}function lMe(e){return!H(e.repeat)&&Y(e.repeat,`layer`)}function uMe(e){return fg(Oze,e)}function T0(e){return Z(e)&&I1(e)===`quantitative`&&!e.bin}function dMe(e,t,{orient:n,type:r}){let i=t===`x`?`y`:`radius`,a=t===`x`&&[`bar`,`area`].includes(r),o=e[t],s=e[i];if(Z(o)&&Z(s)){if(T0(o)&&T0(s)){if(o.stack)return t;if(s.stack)return i;let e=Z(o)&&!!o.aggregate;if(e!==(Z(s)&&!!s.aggregate))return e?t:i;if(a){if(n===`vertical`)return i;if(n===`horizontal`)return t}}else if(T0(o))return t;else if(T0(s))return i}else if(T0(o))return a&&n===`vertical`?void 0:t;else if(T0(s))return a&&n===`horizontal`?void 0:i}function fMe(e){switch(e){case`x`:return`y`;case`y`:return`x`;case`theta`:return`radius`;case`radius`:return`theta`}}function pMe(e,t){let n=m1(e)?e:{type:e},r=n.type;if(!kze.has(r))return null;let i=dMe(t,`x`,n)||dMe(t,`theta`,n);if(!i)return null;let a=t[i],o=Z(a)?Q(a,{}):void 0,s=fMe(i),c=[],l=new Set;if(t[s]){let e=t[s],n=Z(e)?Q(e,{}):void 0;n&&n!==o&&(c.push(s),l.add(n))}let u=s===`x`?`xOffset`:`yOffset`,d=t[u],f=Z(d)?Q(d,{}):void 0;f&&f!==o&&(c.push(u),l.add(f));let p=XLe.reduce((e,n)=>{if(n!==`tooltip`&&o0(t,n)){let r=t[n];for(let t of tg(r)){let r=X1(t);if(r.aggregate)continue;let i=Q(r,{});(!i||!l.has(i))&&e.push({channel:n,fieldDef:r})}}return e},[]),m;return a.stack===void 0?Aze.has(r)&&(m=`zero`):m=_g(a.stack)?a.stack?`zero`:null:a.stack,!m||!uMe(m)||Cje(t)&&p.length===0?null:(a?.scale?.type&&a?.scale?.type!==l3.LINEAR&&a?.stack&&X(Ike(a.scale.type)),B1(t[IQ(i)])?(a.stack!==void 0&&X(Fke(i)),null):(Z(a)&&a.aggregate&&!pRe.has(a.aggregate)&&X(Lke(a.aggregate)),{groupbyChannels:c,groupbyFields:l,fieldChannel:i,impute:a.impute!==null&&f1(r),stackBy:p,offset:m}))}function mMe(e,t,n){let r=r$(e),i=_$(`orient`,r,n);if(r.orient=vMe(r.type,t,i),i!==void 0&&i!==r.orient&&X(xke(r.orient,i)),r.type===`bar`&&r.orient){let e=_$(`cornerRadiusEnd`,r,n);if(e!==void 0){let n=r.orient===`horizontal`&&t.x2||r.orient===`vertical`&&t.y2?[`cornerRadius`]:ize[r.orient];for(let t of n)r[t]=e;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}let a=_$(`opacity`,r,n),o=_$(`fillOpacity`,r,n);return a===void 0&&o===void 0&&(r.opacity=gMe(r.type,t)),_$(`cursor`,r,n)===void 0&&(r.cursor=hMe(r,t,n)),r}function hMe(e,t,n){return t.href||e.href||_$(`href`,e,n)?`pointer`:e.cursor}function gMe(e,t){if(XZ([y3,S3,C3,w3],e)&&!Cje(t))return e6}function _Me(e,t,{graticule:n}){if(n)return!1;let r=v$(`filled`,e,t),i=e.type;return bQ(r,i!==y3&&i!==v3&&i!==b3)}function vMe(e,t,n){switch(e){case y3:case C3:case w3:case XRe:case YRe:return}let{x:r,y:i,x2:a,y2:o}=t;switch(e){case x3:case _3:if(Z(r)&&(QQ(r.bin)||Z(i)&&i.aggregate&&!r.aggregate))return`vertical`;if(Z(i)&&(QQ(i.bin)||Z(r)&&r.aggregate&&!i.aggregate))return`horizontal`;if(o||a){if(n)return n;if(!a)return(Z(r)&&r.type===i3&&!ZQ(r.bin)||z1(r))&&Z(i)&&QQ(i.bin)?`horizontal`:`vertical`;if(!o)return(Z(i)&&i.type===i3&&!ZQ(i.bin)||z1(i))&&Z(r)&&QQ(r.bin)?`vertical`:`horizontal`}case b3:if(a&&!(Z(r)&&QQ(r.bin))&&o&&!(Z(i)&&QQ(i.bin)))return;case g3:if(o)return Z(i)&&QQ(i.bin)?`horizontal`:`vertical`;if(a)return Z(r)&&QQ(r.bin)?`vertical`:`horizontal`;if(e===b3){if(r&&!i)return`vertical`;if(i&&!r)return`horizontal`}case v3:case S3:{let t=rje(r),a=rje(i);if(n)return n;if(t&&!a)return e===`tick`?`vertical`:`horizontal`;if(!t&&a)return e===`tick`?`horizontal`:`vertical`;if(t&&a)return`vertical`;{let e=V1(r)&&r.type===o3,t=V1(i)&&i.type===o3;if(e&&!t)return`vertical`;if(!e&&t)return`horizontal`}return}}return`vertical`}function yMe(e){let{point:t,line:n,...r}=e;return $(r).length>1?r:r.type}function bMe(e){for(let t of[`line`,`area`,`rule`,`trail`])e[t]&&(e={...e,[t]:qZ(e[t],[`point`,`line`])});return e}function E0(e,t={},n){return e.point===`transparent`?{opacity:0}:e.point?Eh(e.point)?e.point:{}:e.point===void 0?t.point||n.shape?Eh(t.point)?t.point:{}:void 0:null}function xMe(e,t={}){return e.line?e.line===!0?{}:e.line:e.line===void 0?t.line?t.line===!0?{}:t.line:void 0:null}function SMe(e,t){return t?O1(e)?EMe(e,t):CMe(e,t):e}function D0(e,t){return t?EMe(e,t):e}function O0(e,t,n){let r=t[e];if(ZAe(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};X(ike(r.repeat));return}return t}function CMe(e,t){if(e=O0(`field`,e,t),e!==void 0){if(e===null)return null;if(j1(e)&&D1(e.sort)){let n=O0(`field`,e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function wMe(e,t){if(Z(e))return CMe(e,t);{let n=O0(`datum`,e,t);return n!==e&&!n.type&&(n.type=`nominal`),n}}function TMe(e,t){if(B1(e)){let n=wMe(e,t);if(n)return n;if(N1(e))return{condition:e.condition}}else{if(F1(e)){let n=wMe(e.condition,t);if(n)return{...e,condition:n};{let{condition:t,...n}=e;return n}}return e}}function EMe(e,t){let n={};for(let r in e)if(Y(e,r)){let i=e[r];if(H(i))n[r]=i.map(e=>TMe(e,t)).filter(e=>e);else{let e=TMe(i,t);e!==void 0&&(n[r]=e)}}return n}function DMe({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){let i=new Set([...$(e),...$(t)]);for(let a of i){let i=t[a],o=e[a];if(B1(i)){let e={...o,...i};r[a]=e}else F1(i)?r[a]={...i,condition:{...o,...i.condition}}:i||i===null?r[a]=i:(n||H1(o)||o$(o)||B1(o)||H(o))&&(r[a]=o)}}else r=t;return!r||aQ(r)?void 0:r}function OMe(e){let{parentProjection:t,projection:n}=e;return t&&n&&X(lke({parentProjection:t,projection:n})),n??t}function k0(e){return Y(e,`filter`)}function kMe(e){return Y(e,`stop`)}function AMe(e){return Y(e,`lookup`)}function jMe(e){return Y(e,`data`)}function MMe(e){return Y(e,`param`)}function NMe(e){return Y(e,`pivot`)}function PMe(e){return Y(e,`density`)}function FMe(e){return Y(e,`quantile`)}function IMe(e){return Y(e,`regression`)}function LMe(e){return Y(e,`loess`)}function RMe(e){return Y(e,`sample`)}function zMe(e){return Y(e,`window`)}function BMe(e){return Y(e,`joinaggregate`)}function VMe(e){return Y(e,`flatten`)}function HMe(e){return Y(e,`calculate`)}function UMe(e){return Y(e,`bin`)}function WMe(e){return Y(e,`impute`)}function GMe(e){return Y(e,`timeUnit`)}function KMe(e){return Y(e,`aggregate`)}function qMe(e){return Y(e,`stack`)}function JMe(e){return Y(e,`fold`)}function YMe(e){return Y(e,`extent`)&&!Y(e,`density`)&&!Y(e,`regression`)}function XMe(e){return e.map(e=>k0(e)?{filter:WZ(e.filter,_Ae)}:e)}function ZMe(e,t){let{transform:n,...r}=e;if(n){let e=n.map(e=>{if(k0(e))return{filter:A0(e,t)};if(UMe(e)&&$Q(e.bin))return{...e,bin:$Me(e.bin)};if(AMe(e)){let{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e});return{...r,transform:e}}return e}function QMe(e,t){let n=G2(e);if(Z(n)&&$Q(n.bin)&&(n.bin=$Me(n.bin)),U1(n)&&n.scale?.domain?.selection){let{selection:e,...t}=n.scale.domain;n.scale.domain={...t,...e?{param:e}:{}}}if(N1(n))if(H(n.condition))n.condition=n.condition.map(e=>{let{selection:n,param:r,test:i,...a}=e;return r?e:{...a,test:A0(e,t)}});else{let{selection:e,param:r,test:i,...a}=QMe(n.condition,t);n.condition=r?n.condition:{...a,test:A0(n.condition,t)}}return n}function $Me(e){let t=e.extent;if(t?.selection){let{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function A0(e,t){let n=e=>WZ(e,e=>{let n={param:e,empty:t.emptySelections[e]??!0};return t.selectionPredicates[e]??=[],t.selectionPredicates[e].push(n),n});return e.selection?n(e.selection):WZ(e.test||e.filter,e=>e.selection?n(e.selection):e)}function eNe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function tNe(e,t){t===void 0&&(t=iMe(e.config));let n=nNe(e,t),{width:r,height:i}=e,a=iNe(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...a?{autosize:a}:{}}}function nNe(e,t={}){let n={config:t};return Lze.map(Fze.map(Ize.map(e,n),n),n)}function rNe(e){return xg(e)?{type:e}:e??{}}function iNe(e,t,n){let{width:r,height:i}=t,a=a0(e)||w0(e),o={};a?r==`container`&&i==`container`?(o.type=`fit`,o.contains=`padding`):r==`container`?(o.type=`fit-x`,o.contains=`padding`):i==`container`&&(o.type=`fit-y`,o.contains=`padding`):(r==`container`&&(X(E$(`width`)),r=void 0),i==`container`&&(X(E$(`height`)),i=void 0));let s={type:`pad`,...o,...n?rNe(n.autosize):{},...rNe(e.autosize)};if(s.type===`fit`&&!a&&(X(vRe),s.type=`pad`),r==`container`&&!(s.type==`fit`||s.type==`fit-x`)&&X(D$(`width`)),i==`container`&&!(s.type==`fit`||s.type==`fit-y`)&&X(D$(`height`)),!EQ(s,{type:`pad`}))return s}function aNe(e){return[`fit`,`fit-x`,`fit-y`].includes(e)}function oNe(e){return e?`fit-${VQ(e)}`:`fit`}function sNe(e,t){let n={};for(let t of Rze)e&&e[t]!==void 0&&(n[t]=d$(e[t]));return t&&(n.params=e.params),n}function j0(e){return{explicit:!0,value:e}}function M0(e){return{explicit:!1,value:e}}function cNe(e){return(t,n,r,i)=>{let a=e(t.value,n.value);return a>0?t:a<0?n:N0(t,n,r,i)}}function N0(e,t,n,r){return e.explicit&&t.explicit&&X(Ake(n,r,e.value,t.value)),e}function P0(e,t,n,r,i=N0){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:EQ(e.value,t.value)?e:i(e,t,n,r)}function F0(e){return Y(e,`url`)}function I0(e){return Y(e,`values`)}function lNe(e){return Y(e,`name`)&&!F0(e)&&!I0(e)&&!L0(e)}function L0(e){return e&&(uNe(e)||dNe(e)||R0(e))}function uNe(e){return Y(e,`sequence`)}function dNe(e){return Y(e,`sphere`)}function R0(e){return Y(e,`graticule`)}function fNe({invalid:e,isPath:t}){switch(MAe(e,{isPath:t})){case`filter`:return{marks:`exclude-invalid-values`,scales:`exclude-invalid-values`};case`break-paths-show-domains`:return{marks:t?`include-invalid-values`:`exclude-invalid-values`,scales:`include-invalid-values`};case`break-paths-filter-domains`:return{marks:t?`include-invalid-values`:`exclude-invalid-values`,scales:`exclude-invalid-values`};case`show`:return{marks:`include-invalid-values`,scales:`include-invalid-values`}}}function pNe(e){let{marks:t,scales:n}=fNe(e);return t===n?r6.Main:n===`include-invalid-values`?r6.PreFilterInvalid:r6.PostFilterInvalid}function z0(e){return e.as!==void 0}function mNe(e){return`${e}_end`}function hNe({timeUnit:e,field:t,reverse:n}){let{unit:r,utc:i}=e,{part:a,step:o}=dAe(rAe(r),e.step);return`${i?`utcOffset`:`timeOffset`}('${a}', ${mQ(t)}, ${n?-o:o})`}function gNe([e,t],n,r){if(n!==void 0&&n!==.5){let i=mQ(e),a=mQ(t);return[{type:`formula`,expr:_Ne([hNe({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${s6}`},{type:`formula`,expr:_Ne([i,a],n+.5),as:`${e}_${c6}`}]}return[]}function _Ne([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}function vNe(e){let{signals:t,hasLegend:n,index:r,...i}=e;return i.field=gQ(i.field),i}function B0(e,t=!0,n=vh){if(H(e)){let r=e.map(e=>B0(e,t,n));return t?`[${r.join(`, `)}]`:r}else if(W$(e))return n(t?K$(e):$ke(e));return t?n(DQ(e)):e}function yNe(e,t){for(let n of K2(e.component.selection??{})){let r=n.name,i=`${r}${P6}, ${n.resolve===`global`?`true`:`{unit: ${n2(e)}}`}`;for(let r of I6)r.defined(n)&&(r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(i=r.modifyExpr(e,n,i)));t.push({name:r+$ze,on:[{events:{signal:n.name+P6},update:`modify(${W(n.name+N6)}, ${i})`}]})}return V0(t)}function bNe(e,t){if(e.component.selection&&$(e.component.selection).length){let n=W(e.getName(`cell`));t.unshift({name:`facet`,value:{},on:[{events:ZG(`pointermove`,`scope`),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return V0(t)}function xNe(e,t){let n=!1;for(let r of K2(e.component.selection??{})){let i=r.name,a=W(i+N6);if(t.filter(e=>e.name===i).length===0){let e=r.resolve===`global`?`union`:r.resolve,n=r.type===`point`?`, true, true)`:`)`;t.push({name:r.name,update:`${F6}(${a}, ${W(e)}${n}`})}n=!0;for(let n of I6)n.defined(r)&&n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}return n&&t.filter(e=>e.name===`unit`).length===0&&t.unshift({name:`unit`,value:{},on:[{events:`pointermove`,update:`isTuple(group()) ? group() : unit`}]}),V0(t)}function SNe(e,t){let n=[],r=[],i=n2(e,{escape:!1});for(let a of K2(e.component.selection??{})){let o={name:a.name+N6};if(a.project.hasSelectionId&&(o.transform=[{type:`collect`,sort:{field:q3}}]),a.init){let e=a.project.items.map(vNe);o.values=a.project.hasSelectionId?a.init.map(e=>({unit:i,[q3]:B0(e,!1)[0]})):a.init.map(t=>({unit:i,fields:e,values:B0(t,!1)}))}if([...n,...t].filter(e=>e.name===a.name+N6).length||n.push(o),i2(a)&&t.length){let n=e.lookupDataSource(e.getDataName(r6.Main)),i=t.find(e=>e.name===n),a=i.transform.find(e=>e.type===`filter`&&e.expr.includes(`vlSelectionTest`));if(a){i.transform=i.transform.filter(e=>e!==a);let e={name:i.name+u6,source:i.name,transform:[a]};r.push(e)}}}return n.concat(t,r)}function CNe(e,t){for(let n of K2(e.component.selection??{}))for(let r of I6)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function wNe(e,t){for(let n of e.children)N2(n)&&(t=CNe(n,t));return t}function TNe(e,t,n,r){let i=aPe(e,t.param,t);return{signal:c1(n.get(`type`))&&H(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function V0(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}function H0(e,t){return`domain(${W(e.scaleName(t))})`}function U0(e){return e.parent&&I2(e.parent)&&(!e.parent.parent||U0(e.parent.parent))}function ENe(e,t,n,r){let i=!e.hasProjection,a=n.channel,o=n.signals.visual,s=W(i?e.scaleName(a):e.projectionName()),c=e=>`scale(${s}, ${e})`,l=e.getSizeSignalRef(a===$2?`width`:`height`).signal,u=`${a}(unit)`,d=t.events.reduce((e,t)=>[...e,{events:t.between[0],update:`[${u}, ${u}]`},{events:t,update:`[${o}[0], clamp(${u}, 0, ${l})]`}],[]);if(i){let i=n.signals.data,l=v6.defined(t),u=e.getScaleComponent(a),f=u?u.get(`type`):void 0,p=r?{init:B0(r,!0,c)}:{value:[]};return d.push({events:{signal:t.name+b6},update:c1(f)?`[${c(`${i}[0]`)}, ${c(`${i}[1]`)}]`:`[0, 0]`}),l?[{name:i,on:[]}]:[{name:o,...p,on:d},{name:i,...r?{init:B0(r)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${s}, ${o})`}]}]}else{let e=a===$2?0:1,n=t.name+S6;return[{name:o,...r?{init:`[${n}[0][${e}], ${n}[1][${e}]]`}:{value:[]},on:d}]}}function W0({model:e,channelDef:t,vgChannel:n,invalidValueRef:r,mainRefFn:i}){let a=N1(t)&&t.condition,o=[];a&&(o=tg(a).map(t=>{let n=i(t);if(XAe(t)){let{param:r,empty:i}=t;return{test:iPe(e,{param:r,empty:i}),...n}}else return{test:o2(e,t.test),...n}})),r!==void 0&&o.push(r);let s=i(t);return s!==void 0&&o.push(s),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function G0(e,t=`text`){let n=e.encoding[t];return W0({model:e,channelDef:n,vgChannel:t,mainRefFn:t=>K0(t,e.config),invalidValueRef:void 0})}function K0(e,t,n=`datum`){if(e){if(H1(e))return p$(e.value);if(B1(e)){let{format:r,formatType:i}=Y1(e);return C1({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function DNe(e,t={}){let{encoding:n,markDef:r,config:i,stack:a}=e,o=n.tooltip;if(H(o))return{tooltip:kNe({tooltip:o},a,i,t)};{let s=t.reactiveGeom?`datum.datum`:`datum`;return W0({model:e,channelDef:o,vgChannel:`tooltip`,mainRefFn:e=>{let o=ANe(e,i,s);if(o)return o;if(e===null)return;let c=_$(`tooltip`,r,i);if(c===!0&&(c={content:`encoding`}),xg(c))return{value:c};if(Eh(c))return o$(c)?c:c.content===`encoding`?kNe(n,a,i,t):{signal:s}},invalidValueRef:void 0})}}function ONe(e,t,n,{reactiveGeom:r}={}){let i={...n,...n.tooltipFormat},a=new Set,o=r?`datum.datum`:`datum`,s=[];function c(n,r){let c=PQ(r),l=V1(n)?n:{...n,type:e[c].type},u=tg(l.title||J1(l,i)).join(`, `).replaceAll(/"/g,`\\"`),d;if(BQ(r)){let t=r===`x`?`x2`:`y2`,n=X1(e[t]);if(QQ(l.bin)&&n){let e=Q(l,{expr:o}),r=Q(n,{expr:o}),{format:s,formatType:c}=Y1(l);d=E1(e,r,s,c,i),a.add(t)}}if((BQ(r)||r===s4||r===a4)&&t&&t.fieldChannel===r&&t.offset===`normalize`){let{format:e,formatType:t}=Y1(l);d=C1({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:i,normalizeStack:!0}).signal}d??=ANe(l,i,o).signal,s.push({channel:r,key:u,value:d})}c0(e,(e,t)=>{Z(e)?c(e,t):P1(e)&&c(e.condition,t)});let l={};for(let{channel:e,key:t,value:n}of s)!a.has(e)&&!l[t]&&(l[t]=n);return l}function kNe(e,t,n,{reactiveGeom:r}={}){let i=ONe(e,t,n,{reactiveGeom:r}),a=q2(i).map(([e,t])=>`"${e}": ${t}`);return a.length>0?{signal:`{${a.join(`, `)}}`}:void 0}function ANe(e,t,n=`datum`){if(Z(e)&&o1(e.type)&&!e.timeUnit&&!Y1(e).format&&!Y1(e).formatType){let t=`${n}["${e.field}"]`;return{signal:`isValid(${t}) ? isArray(${t}) ? join(${t}, '\\n') : ${t} : ""+${t}`}}return K0(e,t,n)}function jNe(e){let{markDef:t,config:n}=e,r=_$(`aria`,t,n);return r===!1?{}:{...r?{aria:r}:{},...MNe(e),...NNe(e)}}function MNe(e){let{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};let i=_$(`ariaRoleDescription`,n,r);return i==null?fg(gRe,t)?{}:{ariaRoleDescription:{value:t}}:{ariaRoleDescription:{value:i}}}function NNe(e){let{encoding:t,markDef:n,config:r,stack:i}=e,a=t.description;if(a)return W0({model:e,channelDef:a,vgChannel:`description`,mainRefFn:t=>K0(t,e.config),invalidValueRef:void 0});let o=_$(`description`,n,r);if(o!=null)return{description:p$(o)};if(r.aria===!1)return{};let s=ONe(t,i,r);if(!aQ(s))return{description:{signal:q2(s).filter(([e])=>!e.startsWith(`_`)).map(([e,t])=>[e,t.replaceAll(`\\n`,` `)]).map(([e,t],n)=>`"${n>0?`; `:``}${e}: " + (${t})`).join(` + `)}}}function q0(e,t,n={}){let{markDef:r,encoding:i,config:a}=t,{vgChannel:o}=n,{defaultRef:s,defaultValue:c}=n,l=i[e];s===void 0&&(c??=_$(e,r,a,{vgChannel:o,ignoreVgConfig:!N1(l)}),c!==void 0&&(s=p$(c)));let u={markDef:r,config:a,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},d=FAe({...u,scaleChannel:e,channelDef:l});return W0({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:d,mainRefFn:t=>b1({...u,channel:e,channelDef:t,stack:null,defaultRef:s})})}function PNe(e,t={filled:void 0}){let{markDef:n,encoding:r,config:i}=e,{type:a}=n,o=t.filled??_$(`filled`,n,i),s=XZ([`bar`,`point`,`circle`,`square`,`geoshape`],a)?`transparent`:void 0,c=_$(o===!0?`color`:void 0,n,i,{vgChannel:`fill`})??i.mark[o===!0&&`color`]??s,l=_$(o===!1?`color`:void 0,n,i,{vgChannel:`stroke`})??i.mark[o===!1&&`color`],u=o?`fill`:`stroke`,d={...c?{fill:p$(c)}:{},...l?{stroke:p$(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&X(I$(`property`,{fill:`fill`in n,stroke:`stroke`in n})),{...d,...q0(`color`,e,{vgChannel:u,defaultValue:o?c:l}),...q0(`fill`,e,{defaultValue:r.fill?c:void 0}),...q0(`stroke`,e,{defaultValue:r.stroke?l:void 0})}}function FNe(e){let{encoding:t,mark:n}=e,r=t.order;return!f1(n)&&H1(r)?W0({model:e,channelDef:r,vgChannel:`zindex`,mainRefFn:e=>p$(e.value),invalidValueRef:void 0}):{}}function J0({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){let a=`${e}Offset`,o=t[a],s=n[a];if((a===`xOffset`||a===`yOffset`)&&s)return{offsetType:`encoding`,offset:b1({channel:a,channelDef:s,markDef:t,config:r?.config,scaleName:r.scaleName(a),scale:r.getScaleComponent(a),stack:null,defaultRef:p$(o),bandPosition:i})};let c=t[a];return c?{offsetType:`visual`,offset:c}:{}}function Y0(e,t,{defaultPos:n,vgChannel:r}){let{encoding:i,markDef:a,config:o,stack:s}=t,c=i[e],l=i[IQ(e)],u=t.scaleName(e),d=t.getScaleComponent(e),{offset:f,offsetType:p}=J0({channel:e,markDef:a,encoding:i,model:t,bandPosition:.5}),m=X0({model:t,defaultPos:n,channel:e,scaleName:u,scale:d}),h=!c&&BQ(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:INe({channel:e,channelDef:c,channel2Def:l,markDef:a,config:o,scaleName:u,scale:d,stack:s,offset:f,defaultRef:m,bandPosition:p===`encoding`?0:void 0});return h?{[r||e]:h}:void 0}function INe(e){let{channel:t,channelDef:n,scaleName:r,stack:i,offset:a,markDef:o}=e;if(B1(n)&&i&&t===i.fieldChannel){if(Z(n)){let e=n.bandPosition;if(e===void 0&&o.type===`text`&&(t===`radius`||t===`theta`)&&(e=.5),e!==void 0)return y1({scaleName:r,fieldOrDatumDef:n,startSuffix:`start`,bandPosition:e,offset:a})}return v1(n,r,{suffix:`end`},{offset:a})}return _1(e)}function X0({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){let{markDef:a,config:o}=e;return()=>{let s=PQ(n),c=FQ(n),l=_$(n,a,o,{vgChannel:c});if(l!==void 0)return x1(n,l);switch(t){case`zeroOrMin`:return LNe({scaleName:r,scale:i,mode:`zeroOrMin`,mainChannel:s,config:o});case`zeroOrMax`:return LNe({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:s,config:o});case`mid`:return{...e[LQ(n)],mult:.5}}}}function LNe({mainChannel:e,config:t,...n}){let r=PAe(n),{mode:i}=n;if(r)return r;switch(e){case`radius`:{if(i===`zeroOrMin`)return{value:0};let{widthSignal:e,heightSignal:t}=i.zeroOrMax;return{signal:`min(${e},${t})/2`}}case`theta`:return i===`zeroOrMin`?{value:0}:{signal:`2*PI`};case`x`:return i===`zeroOrMin`?{value:0}:{field:{group:`width`}};case`y`:return i===`zeroOrMin`?{field:{group:`height`}}:{value:0}}}function RNe(e,t,n,r=`middle`){if(e===`radius`||e===`theta`)return FQ(e);let i=e===`x`?`align`:`baseline`,a=_$(i,t,n),o;return o$(a)?(X(yke(i)),o=void 0):o=a,e===`x`?qze[o||(r===`top`?`left`:`center`)]:Jze[o||r]}function Z0(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?zNe(e,t,{defaultPos:n,defaultPos2:r}):Y0(e,t,{defaultPos:n})}function zNe(e,t,{defaultPos:n,defaultPos2:r}){let{markDef:i,config:a}=t,o=IQ(e),s=LQ(e),c=BNe(t,r,o);return{...Y0(e,t,{defaultPos:n,vgChannel:c[s]?RNe(e,i,a):FQ(e)}),...c}}function BNe(e,t,n){let{encoding:r,mark:i,markDef:a,stack:o,config:s}=e,c=PQ(n),l=LQ(n),u=FQ(n),d=r[c],f=e.scaleName(c),p=e.getScaleComponent(c),{offset:m}=n in r||n in a?J0({channel:n,markDef:a,encoding:r,model:e}):J0({channel:c,markDef:a,encoding:r,model:e});if(!d&&(n===`x2`||n===`y2`)&&(r.latitude||r.longitude)){let t=LQ(n),r=e.markDef[t];return r==null?{[u]:{field:e.getName(n)}}:{[t]:{value:r}}}let h=VNe({channel:n,channelDef:d,channel2Def:r[n],markDef:a,config:s,scaleName:f,scale:p,stack:o,offset:m,defaultRef:void 0});return h===void 0?Q0(n,a)||Q0(n,{[n]:y$(n,a,s.style),[l]:y$(l,a,s.style)})||Q0(n,s[i])||Q0(n,s.mark)||{[u]:X0({model:e,defaultPos:t,channel:n,scaleName:f,scale:p})()}:{[u]:h}}function VNe({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:a,scale:o,stack:s,offset:c,defaultRef:l}){return B1(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0)?v1(t,a,{suffix:`start`},{offset:c}):_1({channel:e,channelDef:n,scaleName:a,scale:o,stack:s,markDef:r,config:i,offset:c,defaultRef:l})}function Q0(e,t){let n=LQ(e),r=FQ(e);if(t[r]!==void 0)return{[r]:x1(e,t[r])};if(t[e]!==void 0)return{[r]:x1(e,t[e])};if(t[n]){let r=t[n];if(h1(r))X(mke(n));else return{[n]:x1(e,r)}}}function $0(e,t){let{config:n,encoding:r,markDef:i}=e,a=i.type,o=IQ(t),s=LQ(t),c=r[t],l=r[o],u=e.getScaleComponent(t),d=u?u.get(`type`):void 0,f=i.orient,p=r[s]??r.size??_$(`size`,i,n,{vgChannel:s}),m=RQ(t),h=a===`bar`&&(t===`x`?f===`vertical`:f===`horizontal`)||a===`tick`&&(t===`y`?f===`vertical`:f===`horizontal`);return Z(c)&&(ZQ(c.bin)||QQ(c.bin)||c.timeUnit&&!l)&&!(p&&!h1(p))&&!r[m]&&!s1(d)?GNe({fieldDef:c,fieldDef2:l,channel:t,model:e}):(B1(c)&&s1(d)||h)&&!l?UNe(c,t,e):zNe(t,e,{defaultPos:`zeroOrMax`,defaultPos2:`zeroOrMin`})}function HNe(e,t,n,r,i,a,o){if(h1(i))if(n){let e=n.get(`type`);if(e===`band`){let e=`bandwidth('${t}')`;i.band!==1&&(e=`${i.band} * ${e}`);let n=v$(`minBandSize`,{type:o},r);return{signal:n?`max(${h$(n)}, ${e})`:e}}else i.band!==1&&X(Cke(e))}else return{mult:i.band,field:{group:e}};else if(o$(i))return i;else if(i)return{value:i};if(n){let e=n.get(`range`);if(s$(e)&&yg(e.step))return{value:e.step-2}}if(!a){let{bandPaddingInner:t,barBandPaddingInner:n,rectBandPaddingInner:i,tickBandPaddingInner:a}=r.scale,s=bQ(t,o===`tick`?a:o===`bar`?n:i);if(o$(s))return{signal:`(1 - (${s.signal})) * ${e}`};if(yg(s))return{signal:`${1-s} * ${e}`}}return{value:S0(r.view,e)-2}}function UNe(e,t,n){let{markDef:r,encoding:i,config:a,stack:o}=n,s=r.orient,c=n.scaleName(t),l=n.getScaleComponent(t),u=LQ(t),d=IQ(t),f=RQ(t),p=n.scaleName(f),m=n.getScaleComponent(zQ(t)),h=r.type===`tick`||s===`horizontal`&&t===`y`||s===`vertical`&&t===`x`,g;(i.size||r.size)&&(h?g=q0(`size`,n,{vgChannel:u,defaultRef:p$(r.size)}):X(Dke(r.type)));let _=!!g,v=$Ae({channel:t,fieldDef:e,markDef:r,config:a,scaleType:(l||m)?.get(`type`),useVlSizeChannel:h});g||={[u]:HNe(u,p||c,m||l,a,v,!!e,r.type)};let y=RNe(t,r,a,(l||m)?.get(`type`)===`band`&&h1(v)&&!_?`top`:`middle`),b=y===`xc`||y===`yc`,{offset:x,offsetType:S}=J0({channel:t,markDef:r,encoding:i,model:n,bandPosition:b?.5:0}),C=(b&&S!==`encoding`&&Z(e)&&e.timeUnit&&!i[d]?M1({fieldDef:e,markDef:r,config:a}):void 0)??(b?S===`encoding`?0:.5:o$(v)?{signal:`(1-${v})/2`}:h1(v)?(1-v.band)/2:0),w=_1({channel:t,channelDef:e,markDef:r,config:a,scaleName:c,scale:l,stack:o,offset:x,defaultRef:X0({model:n,defaultPos:`mid`,channel:t,scaleName:c,scale:l}),bandPosition:C});if(u)return{[y]:w,...g};{let e=FQ(d),t=g[u],n=x?{...t,offset:x}:t;return{[y]:w,[e]:H(w)?[w[0],{...w[1],offset:n}]:{...w,offset:n}}}}function WNe(e,t,n,r,i,a,o){if(OQ(e))return 0;let s=e===`x`||e===`y2`,c=s?-t/2:t/2;if(o$(n)||o$(i)||o$(r)||a){let e=h$(n),t=h$(i),l=h$(r),u=h$(a),d=a?`(${o} < ${u} ? ${s?``:`-`}0.5 * (${u} - (${o})) : ${c})`:c,f=l?`${l} + `:``,p=e?`(${e} ? -1 : 1) * `:``,m=t?`(${t} + ${d})`:d;return{signal:f+p+m}}else return i||=0,r+(n?-i-c:+i+c)}function GNe({fieldDef:e,fieldDef2:t,channel:n,model:r}){let{config:i,markDef:a,encoding:o}=r,s=r.getScaleComponent(n),c=r.scaleName(n),l=s?s.get(`type`):void 0,u=s.get(`reverse`),d=$Ae({channel:n,fieldDef:e,markDef:a,config:i,scaleType:l}),f=(r.component.axes[n]?.[0])?.get(`translate`)??.5,p=BQ(n)?_$(`binSpacing`,a,i)??0:0,m=IQ(n),h=FQ(n),g=FQ(m),_=v$(`minBandSize`,a,i),{offset:v}=J0({channel:n,markDef:a,encoding:o,model:r,bandPosition:0}),{offset:y}=J0({channel:m,markDef:a,encoding:o,model:r,bandPosition:0}),b=RAe({fieldDef:e,scaleName:c}),x=WNe(n,p,u,f,v,_,b),S=WNe(m,p,u,f,y??v,_,b),C=o$(d)?{signal:`(1-${d.signal})/2`}:h1(d)?(1-d.band)/2:.5,w=M1({fieldDef:e,fieldDef2:t,markDef:a,config:i});if(ZQ(e.bin)||e.timeUnit){let t=e.timeUnit&&w!==.5;return{[g]:KNe({fieldDef:e,scaleName:c,bandPosition:C,offset:S,useRectOffsetField:t}),[h]:KNe({fieldDef:e,scaleName:c,bandPosition:o$(C)?{signal:`1-${C.signal}`}:1-C,offset:x,useRectOffsetField:t})}}else if(QQ(e.bin)){let n=v1(e,c,{},{offset:S});if(Z(t))return{[g]:n,[h]:v1(t,c,{},{offset:x})};if($Q(e.bin)&&e.bin.step)return{[g]:n,[h]:{signal:`scale("${c}", ${Q(e,{expr:`datum`})} + ${e.bin.step})`,offset:x}}}X(Uke(m))}function KNe({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return y1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:s6,endSuffix:c6}:{}})}function e2(e,t){let{fill:n=void 0,stroke:r=void 0}=t.color===`include`?PNe(e):{};return{...JNe(e.markDef,t),...qNe(`fill`,n),...qNe(`stroke`,r),...q0(`opacity`,e),...q0(`fillOpacity`,e),...q0(`strokeOpacity`,e),...q0(`strokeWidth`,e),...q0(`strokeDash`,e),...FNe(e),...DNe(e),...G0(e,`href`),...jNe(e)}}function qNe(e,t){return t?{[e]:t}:{}}function JNe(e,t){return hRe.reduce((n,r)=>(!Yze.has(r)&&Y(e,r)&&t[r]!==`ignore`&&(n[r]=p$(e[r])),n),{})}function t2(e){let{config:t,markDef:n}=e,r=new Set;if(e.forEachFieldDef((i,a)=>{let o;if(!WQ(a)||!(o=e.getScaleType(a)))return;let s=YQ(i.aggregate);if(NAe(g1({scaleChannel:a,markDef:n,config:t,scaleType:o,isCountAggregate:s}))){let t=e.vgField(a,{expr:`datum`,binSuffix:e.stack?.impute?`mid`:void 0});t&&r.add(t)}}),r.size>0)return{defined:{signal:[...r].map(e=>a1(e,!0)).join(` && `)}}}function YNe(e,t){if(t!==void 0)return{[e]:p$(t)}}function XNe(e,t,n){let r=e.fieldDef(t)?.field;for(let i of K2(e.component.selection??{})){let e=i.project.hasField[r]??i.project.hasChannel[t];if(e&&O6.defined(i)){let t=n.get(`selections`)??[];t.push(i.name),n.set(`selections`,t,!1),e.hasLegend=!0}}}function ZNe(e,t,n,r,i){let a=t.name,o=a+k6,s=a+A6,c=n.channel,l=v6.defined(t),u=i.find(e=>e.name===n.signals[l?`data`:`visual`]),d=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(c),p=f?.get(`type`),m=f?.get(`reverse`),h=l?c===$2?m?``:`-`:m?`-`:``:``,g=`${o}.extent_${c}`,_=`${h}${s}.${c} / ${l?`${d}`:`span(${g})`}`,v=`${!l||!f?`panLinear`:p===`log`?`panLog`:p===`symlog`?`panSymlog`:p===`pow`?`panPow`:`panLinear`}(${g}, ${_}${l?p===`pow`?`, ${f.get(`exponent`)??1}`:p===`symlog`?`, ${f.get(`constant`)??1}`:``:``})`;u.on.push({events:{signal:s},update:l?v:`clampRange(${v}, 0, ${d})`})}function QNe(e,t,n,r,i){let a=t.name,o=n.channel,s=v6.defined(t),c=i.find(e=>e.name===n.signals[s?`data`:`visual`]),l=e.getSizeSignalRef(r).signal,u=e.getScaleComponent(o),d=u?.get(`type`),f=s?H0(e,o):c.name,p=a+M6,m=`${a}${j6}.${o}`,h=`${!s||!u?`zoomLinear`:d===`log`?`zoomLog`:d===`symlog`?`zoomSymlog`:d===`pow`?`zoomPow`:`zoomLinear`}(${f}, ${m}, ${p}${s?d===`pow`?`, ${u.get(`exponent`)??1}`:d===`symlog`?`, ${u.get(`constant`)??1}`:``:``})`;c.on.push({events:{signal:p},update:s?h:`clampRange(${h}, 0, ${l})`})}function $Ne(e){let t=e.parent;for(;t&&!P2(t);)t=t.parent;return t}function n2(e,{escape:t}={escape:!0}){let n=t?W(e.name):e.name,r=$Ne(e);if(r){let{facet:e}=r;for(let t of L4)e[t]&&(n+=` + '__facet_${t}_' + (facet[${W(r.vgField(t))}])`)}return n}function r2(e){return K2(e.component.selection??{}).reduce((e,t)=>e||t.project.hasSelectionId,!1)}function ePe(e,t){(xg(t.select)||!t.select.on)&&delete e.events,(xg(t.select)||!t.select.clear)&&delete e.clear,(xg(t.select)||!t.select.toggle)&&delete e.toggle}function i2(e){return e.events?.find(e=>`type`in e&&e.type===`timer`)}function a2(e){let t=[];return e.type===`Identifier`?[e.name]:e.type===`Literal`?[e.value]:(e.type===`MemberExpression`&&(t.push(...a2(e.object)),t.push(...a2(e.property))),t)}function tPe(e){return e.object.type===`MemberExpression`?tPe(e.object):e.object.name===`datum`}function nPe(e){let t=IOe(e),n=new Set;return t.visit(e=>{e.type===`MemberExpression`&&tPe(e)&&n.add(a2(e).slice(1).join(`.`))}),n}function rPe(e,t){let n={},r=e.config.selection;if(!t||!t.length)return n;let i=0;for(let a of t){let t=cQ(a.name),o=a.select,s=xg(o)?o:o.type,c=Eh(o)?G2(o):{type:s},l=r[s];for(let e in l)e===`fields`||e===`encodings`||(e===`mark`&&(c.mark={...l.mark,...c.mark}),(c[e]===void 0||c[e]===!0)&&(c[e]=G2(l[e]??c[e])));let u=n[t]={...c,name:t,type:s,init:a.value,bind:a.bind,events:xg(c.on)?ZG(c.on,`scope`):tg(G2(c.on))};if(i2(u)&&(i++,i>1)){delete n[t];continue}let d=G2(a);for(let t of I6)t.defined(u)&&t.parse&&t.parse(e,u,d)}return i>1&&X(wRe),n}function iPe(e,t,n,r=`datum`){let i=xg(t)?t:t.param,a=cQ(i),o=W(a+N6),s;try{s=e.getSelectionComponent(a,i)}catch{return`!!${a}`}if(s.project.timeUnit){let t=n??e.component.data.raw,r=s.project.timeUnit.clone();t.parent?r.insertAsParentOf(t):t.parent=r}let c=`${s.project.hasSelectionId?`vlSelectionIdTest(`:`vlSelectionTest(`}${o}, ${r}${s.resolve===`global`?`)`:`, ${W(s.resolve)})`}`,l=`length(data(${o}))`;return t.empty===!1?`${l} && ${c}`:`!${l} || ${c}`}function aPe(e,t,n){let r=cQ(t),i=n.encoding,a=n.field,o;try{o=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!a)a=o.project.items[0].field,o.project.items.length>1&&X(ake(a));else if(i&&!a){let e=o.project.items.filter(e=>e.channel===i);!e.length||e.length>1?(a=o.project.items[0].field,X(oke(e,i,n,a))):a=e[0].field}return`${o.name}[${W(gQ(a))}]`}function oPe(e,t){for(let[n,r]of q2(e.component.selection??{})){let i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new a6(new L6(t,e,{param:n}),i,r6.Lookup,e.component.data.outputNodeRefCounts)}}function o2(e,t,n){return lQ(t,t=>xg(t)?t:fAe(t)?iPe(e,t,n):gAe(t))}function sPe(e,t){if(e)return H(e)&&!a$(e)?e.map(e=>J1(e,t)).join(`, `):e}function s2(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function c2(e,t,n,r={header:!1}){let{disable:i,orient:a,scale:o,labelExpr:s,title:c,zindex:l,...u}=e.combine();if(!i){for(let e in u){let n=e,r=cze[n],i=u[n];if(r&&r!==t&&r!==`both`)delete u[n];else if(i0(i)){let{condition:e,...t}=i,r=tg(e),a=P3[n];if(a){let{vgProp:e,part:i}=a;s2(u,i,e,[...r.map(e=>{let{test:t,...n}=e;return{test:o2(null,t),...n}}),t]),delete u[n]}else a===null&&(u[n]={signal:r.map(e=>{let{test:t,...n}=e;return`${o2(null,t)} ? ${m$(n)} : `}).join(``)+m$(t)})}else if(o$(i)){let e=P3[n];if(e){let{vgProp:t,part:r}=e;s2(u,r,t,i),delete u[n]}}XZ([`labelAlign`,`labelBaseline`],n)&&u[n]===null&&delete u[n]}if(t===`grid`){if(!u.grid)return;if(u.encode){let{grid:e}=u.encode;u.encode={...e?{grid:e}:{}},aQ(u.encode)&&delete u.encode}return{scale:o,orient:a,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:bQ(l,0)}}else{if(!r.header&&e.mainExtracted)return;if(s!==void 0){let e=s;u.encode?.labels?.update&&o$(u.encode.labels.update.text)&&(e=_Q(s,`datum.label`,u.encode.labels.update.text.signal)),s2(u,`labels`,`text`,{signal:e})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(let t of F3)e.hasAxisPart(t)||delete u.encode[t];aQ(u.encode)&&delete u.encode}let t=sPe(c,n);return{scale:o,orient:a,grid:!1,...t?{title:t}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:bQ(l,0)}}}}function cPe(e){let{axes:t}=e.component,n=[];for(let r of V4)if(t[r]){for(let i of t[r])if(!i.get(`disable`)&&!i.get(`gridScale`)){let t=r===`x`?`height`:`width`,i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}}return n}function lPe(e,t){let{x:n=[],y:r=[]}=e;return[...n.map(e=>c2(e,`grid`,t)),...r.map(e=>c2(e,`grid`,t)),...n.map(e=>c2(e,`main`,t)),...r.map(e=>c2(e,`main`,t))].filter(e=>e)}function uPe(e,t,n,r){return Object.assign.apply(null,[{},...e.map(e=>{if(e===`axisOrient`){let e=n===`x`?`bottom`:`left`,i=t[n===`x`?`axisBottom`:`axisLeft`]||{},a=t[n===`x`?`axisTop`:`axisRight`]||{},o=new Set([...$(i),...$(a)]),s={};for(let t of o.values())s[t]={signal:`${r.signal} === "${e}" ? ${h$(i[t])} : ${h$(a[t])}`};return s}return t[e]})])}function dPe(e,t,n,r){let i=t===`band`?[`axisDiscrete`,`axisBand`]:t===`point`?[`axisDiscrete`,`axisPoint`]:SAe(t)?[`axisQuantitative`]:t===`time`||t===`utc`?[`axisTemporal`]:[],a=e===`x`?`axisX`:`axisY`,o=o$(n)?`axisOrient`:`axis${dQ(n)}`,s=[...i,...i.map(e=>a+e.substr(4))],c=[`axis`,o,a];return{vlOnlyAxisConfig:uPe(s,r,e,n),vgAxisConfig:uPe(c,r,e,n),axisConfigStyle:fPe([...c,...s],r)}}function fPe(e,t){let n=[{}];for(let r of e){let e=t[r]?.style;if(e){e=tg(e);for(let r of e)n.push(t.style[r])}}return Object.assign.apply(null,n)}function l2(e,t,n,r={}){let i=b$(e,n,t);if(i!==void 0)return{configFrom:`style`,configValue:i};for(let t of[`vlOnlyAxisConfig`,`vgAxisConfig`,`axisConfigStyle`])if(r[t]?.[e]!==void 0)return{configFrom:t,configValue:r[t][e]};return{}}function pPe(e,t){return!s1(e)&&Z(t)&&!ZQ(t?.bin)&&!QQ(t?.bin)}function mPe(e,t){let n=t===`x`?`y`:`x`;if(e.getScaleComponent(n))return e.scaleName(n)}function hPe(e,t,n,r,i){let a=t?.labelAngle;if(a!==void 0)return o$(a)?a:wQ(a);{let{configValue:a}=l2(`labelAngle`,r,t?.style,i);return a===void 0?n===$2&&XZ([s3,a3],e.type)&&!(Z(e)&&e.timeUnit)?270:void 0:wQ(a)}}function u2(e){return`(((${e.signal} % 360) + 360) % 360)`}function gPe(e,t,n,r){if(e!==void 0)if(n===`x`){if(o$(e)){let n=u2(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${o$(t)?`(${t.signal} === "top")`:t===`top`} ? "bottom" : "top"`}}if(450;if(a||u){let s=t===`row`?`height`:`width`;return{name:e.getName(`${t}_${n}`),type:`group`,role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:APe(o,t)}:{},...u&&c?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...a?{title:a}:{},...i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{},...u?{axes:l}:{}}}}return null}function MPe(e,t){return eBe[t][e]}function NPe(e,t){let n={};for(let r of L4){let i=e[r];if(i?.facetFieldDef){let{titleAnchor:e,titleOrient:a}=m2([`titleAnchor`,`titleOrient`],i.facetFieldDef.header,t,r),o=f2(r,a),s=MPe(e,o);s!==void 0&&(n[o]=s)}}return aQ(n)?void 0:n}function PPe(e,t,n,r,i){let a={};for(let o of r){if(!i[o])continue;let r=p2(o,t?.header,e,n);r!==void 0&&(a[i[o]]=r)}return a}function g2(e){return[..._2(e,`width`),..._2(e,`height`),..._2(e,`childWidth`),..._2(e,`childHeight`)]}function _2(e,t){let n=t===`width`?`x`:`y`,r=e.component.layoutSize.get(t);if(r==null||r===`merged`)return[];let i=e.getSizeSignalRef(t).signal;if(r===`step`){let t=e.getScaleComponent(n);if(t){let r=t.get(`type`),a=t.get(`range`);if(s1(r)&&s$(a)){let r=e.scaleName(n);return P2(e.parent)&&e.parent.component.resolve.scale[n]===`independent`?[FPe(r,a)]:[FPe(r,a),{name:i,update:IPe(r,t,`domain('${r}').length`)}]}}throw Error(`layout size is step although width/height is not step.`)}else if(r==`container`){let t=i.endsWith(`width`),n=t?`containerSize()[0]`:`containerSize()[1]`,r=`isFinite(${n}) ? ${n} : ${x0(e.config.view,t?`width`:`height`)}`;return[{name:i,init:r,on:[{update:r,events:`window:resize`}]}]}else return[{name:i,value:r}]}function FPe(e,t){let n=`${e}_step`;return o$(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function IPe(e,t,n){let r=t.get(`type`),i=t.get(`padding`),a=bQ(t.get(`paddingOuter`),i),o=t.get(`paddingInner`);return o=r===`band`?o===void 0?i:o:1,`bandspace(${n}, ${h$(o)}, ${h$(a)}) * ${e}_step`}function LPe(e){return e===`childWidth`?`width`:e===`childHeight`?`height`:e}function RPe(e,t){return $(e).reduce((n,r)=>({...n,...W0({model:t,channelDef:e[r],vgChannel:r,mainRefFn:e=>p$(e.value),invalidValueRef:void 0})}),{})}function zPe(e,t){if(P2(t))return e===`theta`?`independent`:`shared`;if(I2(t))return`shared`;if(F2(t))return BQ(e)||e===`theta`||e===`radius`?`independent`:`shared`;throw Error(`invalid model type for resolve`)}function v2(e,t){let n=e.scale[t],r=BQ(t)?`axis`:`legend`;return n===`independent`?(e[r][t]===`shared`&&X(Mke(t)),`independent`):e[r][t]||`shared`}function BPe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:a}){if(a!==`symbol`)return;let{markDef:o,encoding:s,config:c,mark:l}=n,u=o.filled&&l!==`trail`,d={...QOe({},n,tze),...PNe(n,{filled:u})},f=i.get(`symbolOpacity`)??c.legend.symbolOpacity,p=i.get(`symbolFillColor`)??c.legend.symbolFillColor,m=i.get(`symbolStrokeColor`)??c.legend.symbolStrokeColor,h=f===void 0?WPe(s.opacity)??o.opacity:void 0;if(d.fill){if(r===`fill`||u&&r===m4)delete d.fill;else if(Y(d.fill,`field`))p?delete d.fill:(d.fill=p$(c.legend.symbolBaseFillColor??`black`),d.fillOpacity=p$(h??1));else if(H(d.fill)){let e=y2(s.fill??s.color)??o.fill??(u&&o.color);e&&(d.fill=p$(e))}}if(d.stroke){if(r===`stroke`||!u&&r===m4)delete d.stroke;else if(Y(d.stroke,`field`)||m)delete d.stroke;else if(H(d.stroke)){let e=bQ(y2(s.stroke||s.color),o.stroke,u?o.color:void 0);e&&(d.stroke={value:e})}}if(r!==b4){let e=Z(t)&&KPe(n,i,t);e?d.opacity=[{test:e,...p$(h??1)},p$(c.legend.unselectedOpacity)]:h&&(d.opacity=p$(h))}return d={...d,...e},aQ(d)?void 0:d}function VPe(e,{model:t,legendType:n,legendCmpt:r}){if(n!==`gradient`)return;let{config:i,markDef:a,encoding:o}=t,s={},c=(r.get(`gradientOpacity`)??i.legend.gradientOpacity)===void 0?WPe(o.opacity)||a.opacity:void 0;return c&&(s.opacity=p$(c)),s={...s,...e},aQ(s)?void 0:s}function HPe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){let a=n.legend(r)||{},o=n.config,s=Z(t)?KPe(n,i,t):void 0,c=s?[{test:s,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:u}=a,d;S1(u)?d=w1({fieldOrDatumDef:t,field:`datum.value`,format:l,formatType:u,config:o}):l===void 0&&u===void 0&&o.customFormatTypes&&(t.type===`quantitative`&&o.numberFormatType?d=w1({fieldOrDatumDef:t,field:`datum.value`,format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type===`temporal`&&o.timeFormatType&&Z(t)&&t.timeUnit===void 0&&(d=w1({fieldOrDatumDef:t,field:`datum.value`,format:o.timeFormat,formatType:o.timeFormatType,config:o})));let f={...c?{opacity:c}:{},...d?{text:d}:{},...e};return aQ(f)?void 0:f}function UPe(e,{legendCmpt:t}){return t.get(`selections`)?.length?{...e,fill:{value:`transparent`}}:e}function WPe(e){return GPe(e,(e,t)=>Math.max(e,t.value))}function y2(e){return GPe(e,(e,t)=>bQ(e,t.value))}function GPe(e,t){if(nje(e))return tg(e.condition).reduce(t,e.value);if(H1(e))return e.value}function KPe(e,t,n){let r=t.get(`selections`);if(!r?.length)return;let i=W(n.field);return r.map(e=>`(!length(data(${W(cQ(e)+N6)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`).join(` || `)}function qPe(e,t){let n=e.values;if(H(n))return yje(t,n);if(o$(n))return n}function JPe(e,t,n,r){if(t!==`shape`){let e=y2(n)??r;if(e)return e}switch(e){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 YPe(e){let{legend:t}=e;return bQ(t.type,XPe(e))}function XPe({channel:e,timeUnit:t,scaleType:n}){if(jQ(e)){if(XZ([`quarter`,`month`,`day`],t))return`symbol`;if(l1(n))return`gradient`}return`symbol`}function ZPe({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?`gradientDirection`:`symbolDirection`]??QPe(n,t)}function QPe(e,t){switch(e){case`top`:case`bottom`:return`horizontal`;case`left`:case`right`:case`none`:case void 0:return;default:return t===`gradient`?`horizontal`:void 0}}function $Pe({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){let{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:o,gradientVerticalMaxLength:s,gradientVerticalMinLength:c}=e;if(l1(i))return n===`horizontal`?r===`top`||r===`bottom`?eFe(t,`width`,o,a):o:eFe(t,`height`,c,s)}function eFe(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function tFe(e){if(XZ([`quantile`,`threshold`,`log`,`symlog`],e))return`greedy`}function nFe(e){let t=N2(e)?rFe(e):sFe(e);return e.component.legends=t,t}function rFe(e){let{encoding:t}=e,n={};for(let r of[m4,...K3]){let i=Z1(t[r]);!i||!e.getScaleComponent(r)||r===_4&&Z(i)&&i.type===c3||(n[r]=oFe(e,r))}return n}function iFe(e,t){let n=e.scaleName(t);if(e.mark===`trail`){if(t===`color`)return{stroke:n};if(t===`size`)return{strokeWidth:n}}return t===`color`?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function aFe(e,t,n,r){switch(t){case`disable`:return n!==void 0;case`values`:return!!n?.values;case`title`:if(t===`title`&&e===r?.title)return!0}return e===(n||{})[t]}function oFe(e,t){let n=e.legend(t),{markDef:r,encoding:i,config:a}=e,o=a.legend,s=new tBe({},iFe(e,t));XNe(e,t,s);let c=n===void 0?o.disable:!n;if(s.set(`disable`,c,n!==void 0),c)return s;n||={};let l=e.getScaleComponent(t).get(`type`),u=Z1(i[t]),d=Z(u)?X$(u.timeUnit)?.unit:void 0,f=n.orient||a.legend.orient||`right`,p=YPe({legend:n,channel:t,timeUnit:d,scaleType:l}),m=ZPe({legend:n,legendType:p,orient:f,legendConfig:o}),h={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:o,config:a,scaleType:l,orient:f,legendType:p,direction:m};for(let r of H6){if(p===`gradient`&&r.startsWith(`symbol`)||p===`symbol`&&r.startsWith(`gradient`))continue;let i=r in W6?W6[r](h):n[r];if(i!==void 0){let o=aFe(i,r,n,e.fieldDef(t));(o||a.legend[r]===void 0)&&s.set(r,i,o)}}let g=n?.encoding??{},_=s.get(`selections`),v={},y={fieldOrDatumDef:u,model:e,channel:t,legendCmpt:s,legendType:p};for(let t of[`labels`,`legend`,`title`,`symbols`,`gradient`,`entries`]){let n=RPe(g[t]??{},e),r=t in U6?U6[t](n,y):n;r!==void 0&&!aQ(r)&&(v[t]={..._?.length&&Z(u)?{name:`${cQ(u.field)}_legend_${t}`}:{},..._?.length?{interactive:!0}:{},update:_?.length?{...r,cursor:{value:`pointer`}}:r})}return aQ(v)||s.set(`encode`,v,!!n?.encoding),s}function sFe(e){let{legends:t,resolve:n}=e.component;for(let r of e.children){nFe(r);for(let i of $(r.component.legends))n.legend[i]=v2(e.component.resolve,i),n.legend[i]===`shared`&&(t[i]=cFe(t[i],r.component.legends[i]),t[i]||(n.legend[i]=`independent`,delete t[i]))}for(let r of $(t))for(let t of e.children)t.component.legends[r]&&n.legend[r]===`shared`&&delete t.component.legends[r];return t}function cFe(e,t){if(!e)return t.clone();let n=e.getWithExplicit(`orient`),r=t.getWithExplicit(`orient`);if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(let n of H6){let r=P0(e.getWithExplicit(n),t.getWithExplicit(n),n,`legend`,(e,t)=>{switch(n){case`symbolType`:return lFe(e,t);case`title`:return w$(e,t);case`type`:return i=!0,M0(`symbol`)}return N0(e,t,n,`legend`)});e.setWithExplicit(n,r)}return i&&(e.implicit?.encode?.gradient&&uQ(e.implicit,[`encode`,`gradient`]),e.explicit?.encode?.gradient&&uQ(e.explicit,[`encode`,`gradient`])),e}function lFe(e,t){return t.value===`circle`?t:e}function uFe(e,t,n,r){if(r0(t,n)){let i=N2(e)?e.axis(n)??e.legend(n)??{}:{},a=Q(t,{expr:`datum`}),o=Q(t,{expr:`datum`,binSuffix:`end`});return{formulaAs:Q(t,{binSuffix:`range`,forAs:!0}),formula:E1(a,o,i.format,i.formatType,r)}}return{}}function dFe(e,t){return`${XQ(e)}_${t}`}function fFe(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function b2(e,t,n){let r=dFe(e0(n,void 0)??{},t);return e.getName(`${r}_bins`)}function pFe(e){return`as`in e}function mFe(e,t,n){let r,i;r=pFe(e)?xg(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Q(e,{forAs:!0}),Q(e,{binSuffix:`end`,forAs:!0})];let a={...e0(t,void 0)},o=dFe(a,e.field),{signal:s,extentSignal:c}=fFe(n,o);if(e$(a.extent)){let e=a.extent;i=aPe(n,e.param,e),delete a.extent}return{key:o,binComponent:{bin:a,field:e.field,as:[r],...s?{signal:s}:{},...c?{extentSignal:c}:{},...i?{span:i}:{}}}}function hFe(e,t,n,r){let i=N2(r)?r.encoding[IQ(t)]:void 0;if(V1(n)&&N2(r)&&eje(n,i,r.markDef,r.config)){e.add(Q(n,{})),e.add(Q(n,{suffix:`end`}));let{mark:i,markDef:a,config:o}=r,s=M1({fieldDef:n,markDef:a,config:o});p1(i)&&s!==.5&&BQ(t)&&(e.add(Q(n,{suffix:s6})),e.add(Q(n,{suffix:c6}))),n.bin&&r0(n,t)&&e.add(Q(n,{binSuffix:`range`}))}else if(AQ(t)){let n=kQ(t);e.add(r.getName(n))}else e.add(Q(n));return U1(n)&&EAe(n.scale?.range)&&e.add(n.scale.range.field),e}function gFe(e,t){for(let n of $(t)){let r=t[n];for(let t of $(r))n in e?e[n][t]=new Set([...e[n][t]??[],...r[t]]):e[n]={[t]:r[t]}}}function _Fe(e){return e.startsWith(`'`)&&e.endsWith(`'`)||e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e}function vFe(e,t){let n=fQ(e);return t===`number`?`toNumber(${n})`:t===`boolean`?`toBoolean(${n})`:t===`string`?`toString(${n})`:t===`date`?`toDate(${n})`:t===`flatten`?n:t.startsWith(`date:`)?`timeParse(${n},'${_Fe(t.slice(5,t.length))}')`:t.startsWith(`utc:`)?`utcParse(${n},'${_Fe(t.slice(4,t.length))}')`:(X(ske(t)),null)}function yFe(e){let t={};return UZ(e.filter,e=>{if(mAe(e)){let n=null;Z$(e)?n=d$(e.equal):$$(e)?n=d$(e.lte):Q$(e)?n=d$(e.lt):e1(e)?n=d$(e.gt):t1(e)?n=d$(e.gte):n1(e)?n=e.range[0]:r1(e)&&(n=(e.oneOf??e.in)[0]),n&&(W$(n)?t[e.field]=`date`:yg(n)?t[e.field]=`number`:xg(n)&&(t[e.field]=`string`)),e.timeUnit&&(t[e.field]=`date`)}}),t}function bFe(e){let t={};function n(e){t0(e)?t[e.field]=`date`:e.type===`quantitative`&&YOe(e.aggregate)?t[e.field]=`number`:yQ(e.field)>1?e.field in t||(t[e.field]=`flatten`):U1(e)&&D1(e.sort)&&yQ(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]=`flatten`))}if((N2(e)||P2(e))&&e.forEachFieldDef((t,r)=>{if(V1(t))n(t);else{let i=PQ(r),a=e.fieldDef(i);n({...t,type:a.type})}}),N2(e)){let{mark:n,markDef:r,encoding:i}=e;if(f1(n)&&!e.encoding.order){let e=i[r.orient===`horizontal`?`y`:`x`];Z(e)&&e.type===`quantitative`&&!(e.field in t)&&(t[e.field]=`number`)}}return t}function xFe(e){let t={};if(N2(e)&&e.component.selection)for(let n of $(e.component.selection)){let r=e.component.selection[n];for(let e of r.project.items)!e.channel&&yQ(e.field)>1&&(t[e.field]=`flatten`)}return t}function x2(e){return e instanceof Q6||e instanceof X6||e instanceof Z6}function S2(e){return`isValid(${e}) && isFinite(+${e})`}function SFe(e){return e.stack.stackBy.reduce((e,t)=>{let n=t.fieldDef,r=Q(n);return r&&e.push(r),e},[])}function CFe(e){return H(e)&&e.every(e=>xg(e))&&e.length>1}function wFe(e){function t(n){if(!(n instanceof q6)){let r=n.clone();if(r instanceof a6){let t=o8+r.getSource();r.setSource(t),e.model.component.data.outputNodes[t]=r}else(r instanceof K6||r instanceof i8||r instanceof a8||r instanceof n8)&&r.addDimensions(e.fields);for(let e of n.children.flatMap(t))e.parent=r;return[r]}return n.children.flatMap(t)}return t}function C2(e){if(e instanceof q6)if(e.numChildren()===1&&!(e.children[0]instanceof a6)){let t=e.children[0];(t instanceof K6||t instanceof i8||t instanceof a8||t instanceof n8)&&t.addDimensions(e.fields),t.swapWithParent(),C2(e)}else{let t=e.model.component.data.main;TFe(t);let n=wFe(e),r=e.children.map(n).flat();for(let e of r)e.parent=t}else e.children.map(C2)}function TFe(e){if(e instanceof a6&&e.type===r6.Main&&e.numChildren()===1){let t=e.children[0];t instanceof q6||(t.swapWithParent(),TFe(e))}}function w2(e){for(let t of e){for(let e of t.children)if(e.parent!==t)return!1;if(!w2(t.children))return!1}return!0}function T2(e,t){let n=!1;for(let r of t)n=e.optimize(r)||n;return n}function EFe(e,t,n){let r=e.sources,i=!1;return i=T2(new aBe,r)||i,i=T2(new rBe(t),r)||i,r=r.filter(e=>e.numChildren()>0),i=T2(new cBe,r)||i,r=r.filter(e=>e.numChildren()>0),n||(i=T2(new oBe,r)||i,i=T2(new dBe(t),r)||i,i=T2(new iBe,r)||i,i=T2(new sBe,r)||i,i=T2(new uBe,r)||i,i=T2(new lBe,r)||i,i=T2(new nBe,r)||i,i=T2(new fBe,r)||i),e.sources=r,i}function DFe(e,t){w2(e.sources);let n=0,r=0;for(let r=0;r({signal:`{data: ${n0(e,{timeUnit:n,type:t})}}`}))}function E2(e,t,n){let r=X$(n)?.unit;return t===`temporal`||r?NFe(e,t,r):[e]}function D2(e,t,n,r){let{encoding:i,markDef:a,mark:o,config:s,stack:c}=n,l=Z1(i[r]),{type:u}=l,d=l.timeUnit,f=pNe({invalid:v$(`invalid`,a,s),isPath:f1(o)});if(TAe(t)){let i=D2(e,void 0,n,r);return j0([...E2(t.unionWith,u,d),...i.value])}else if(o$(t))return j0([t]);else if(t&&t!==`unaggregated`&&!wAe(t))return j0(E2(t,u,d));if(c&&r===c.fieldChannel){if(c.offset===`normalize`)return M0([[0,1]]);let e=n.requestDataName(f);return M0([{data:e,field:n.vgField(r,{suffix:`start`})},{data:e,field:n.vgField(r,{suffix:`end`})}])}let p=WQ(r)&&Z(l)?FFe(n,r,e):void 0;if(L1(l))return M0(E2([l.datum],u,d));let m=l;if(t===`unaggregated`){let{field:e}=l;return M0([{data:n.requestDataName(f),field:Q({field:e,aggregate:`min`})},{data:n.requestDataName(f),field:Q({field:e,aggregate:`max`})}])}else if(ZQ(m.bin)){if(s1(e))return M0(e===`bin-ordinal`?[]:[{data:oQ(p)?n.requestDataName(f):n.requestDataName(r6.Raw),field:n.vgField(r,r0(m,r)?{binSuffix:`range`}:{}),sort:p===!0||!Eh(p)?{field:n.vgField(r,{}),op:`min`}:p}]);{let{bin:e}=m;if(ZQ(e)){let t=b2(n,m.field,e);return M0([new c8(()=>{let e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}else return M0([{data:n.requestDataName(f),field:n.vgField(r,{})}])}}else if(m.timeUnit&&XZ([`time`,`utc`],e)){let e=i[IQ(r)];if(eje(m,e,a,s)){let t=n.requestDataName(f),i=M1({fieldDef:m,fieldDef2:e,markDef:a,config:s}),c=p1(o)&&i!==.5&&BQ(r);return M0([{data:t,field:n.vgField(r,c?{suffix:s6}:{})},{data:t,field:n.vgField(r,{suffix:c?c6:`end`})}])}}return M0(p?[{data:oQ(p)?n.requestDataName(f):n.requestDataName(r6.Raw),field:n.vgField(r),sort:p}]:[{data:n.requestDataName(f),field:n.vgField(r)}])}function O2(e,t){let{op:n,field:r,order:i}=e;return{op:n??(t?`sum`:A3),...r?{field:gQ(r)}:{},...i?{order:i}:{}}}function PFe(e,t){let n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t)?.bin,a=wAe(r)?r:void 0,o=$Q(i)&&e$(i.extent)?i.extent:void 0;(a||o)&&n.set(`selectionExtent`,a??o,!0)}function FFe(e,t,n){if(!s1(n))return;let r=e.fieldDef(t),i=r.sort;if(YAe(i))return{op:`min`,field:d2(r,t),order:`ascending`};let{stack:a}=e,o=a?new Set([...a.groupbyFields,...a.stackBy.map(e=>e.fieldDef.field)]):void 0;if(D1(i))return O2(i,a&&!o.has(i.field));if(JAe(i)){let{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:c}=r,l=a&&!o.has(c);if(KQ(s)||qQ(s))return O2({field:Q(r),order:n},l);if(JQ(s)||!s)return O2({op:s,field:c,order:n},l)}else if(i===`descending`)return{op:`min`,field:e.vgField(t),order:`descending`};else if(XZ([`ascending`,void 0],i))return!0}function IFe(e,t){let{aggregate:n,type:r}=e;return n?xg(n)&&!mRe.has(n)?{valid:!1,reason:Tke(n)}:r===`quantitative`&&t===`log`?{valid:!1,reason:Eke(e)}:{valid:!0}:{valid:!1,reason:wke(e)}}function k2(e,t,n,r){return e.explicit&&t.explicit&&X(jke(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function LFe(e){let t=eQ(e.map(e=>{if(l$(e)){let{sort:t,...n}=e;return n}return e}),JZ),n=eQ(e.map(e=>{if(l$(e)){let t=e.sort;return t!==void 0&&!oQ(t)&&(`op`in t&&t.op===`count`&&delete t.field,t.order===`ascending`&&delete t.order),t}}).filter(e=>e!==void 0),JZ);if(t.length===0)return;if(t.length===1){let t=e[0];if(l$(t)&&n.length>0){let e=n[0];if(n.length>1){X(X4);let t=n.filter(e=>Eh(e)&&`op`in e&&e.op!==`min`);e=n.every(e=>Eh(e)&&`op`in e)&&t.length===1?t[0]:!0}else if(Eh(e)&&`field`in e){let n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return{...t,sort:e}}return t}let r=eQ(n.map(e=>oQ(e)||!(`op`in e)||xg(e.op)&&fg(dRe,e.op)?e:(X(Nke(e)),!0)),JZ),i;r.length===1?i=r[0]:r.length>1&&(X(X4),i=!0);let a=eQ(e.map(e=>l$(e)?e.data:null),e=>e);return a.length===1&&a[0]!==null?{data:a[0],fields:t.map(e=>e.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function A2(e){if(l$(e)&&xg(e.field))return e.field;if(c$(e)){let t;for(let n of e.fields)if(l$(n)&&xg(n.field)){if(!t)t=n.field;else if(t!==n.field)return X(ARe),t}return X(jRe),t}else if(XOe(e)){X(MRe);let t=e.fields[0];return xg(t)?t:void 0}}function j2(e,t){return LFe(e.component.scales[t].get(`domains`).map(t=>(l$(t)&&(t.data=e.lookupDataSource(t.data)),t)))}function RFe(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function zFe(e,t){if(N2(e)){let n=e.fieldDef(t);if(n?.field)return n.field}let n=(e.children??[]).map(e=>zFe(e,t)).filter(e=>!!e);if(n.length>0){let e=eQ(n,JZ);return e.length===1?e[0]:void 0}}function BFe(e,t,n){if(t===n)return!0;let r=e.getScaleType(t),i=e.getScaleType(n);return!r||!i?!1:s1(r)===s1(i)}function VFe(e,t){return e?`field:${e}`:`channel:${String(t)}`}function HFe(e){if(H(e)){let t=e.filter(sQ);return t.length>0?t:null}if(c$(e)){let t=[];if(t.push(...e.fields.flatMap(e=>H(e)?e.filter(sQ):[])),t.length>0)return eQ(t,JZ)}return null}function M2(e,t){try{return HFe(j2(e,t))}catch{return null}}function UFe(e,t,n){let r=M2(e,t),i=M2(e,n);return r&&i?eQ([...r,...i],JZ):null}function WFe(e,t,n){t&&t.length>0&&(e.getWithExplicit(`values`)?.explicit||(n&&X(n),e.set(`values`,t,!1)))}function GFe(e,t,n){let r=e.getScaleComponent(t),i=e.getScaleComponent(n);if(!r||!i)return!1;let a=r.getWithExplicit(`domains`),o=i.getWithExplicit(`domains`);if(!(a?.explicit&&o?.explicit))return!1;let s=j2(e,t),c=j2(e,n);return JZ(s)===JZ(c)}function KFe(e){let t=e.component.legends,n={};for(let r of $(t)){let i=VFe(zFe(e,r),r);if(!n[i]){n[i]=[{channel:r,cmpt:t[r].clone()}];continue}let a=!1;for(let o of n[i])if(BFe(e,o.channel,r)&&cFe(o.cmpt,t[r])){let t=e.getScaleType(o.channel),n=e.getScaleType(r);t&&n&&s1(t)&&s1(n)&&(GFe(e,o.channel,r)?WFe(o.cmpt,M2(e,o.channel)):WFe(o.cmpt,UFe(e,o.channel,r),Pke(o.channel,r))),a=!0;break}a||n[i].push({channel:r,cmpt:t[r].clone()})}return K2(n).flat().map(t=>qFe(t.cmpt,e.config)).filter(e=>e!==void 0)}function qFe(e,t){let{disable:n,labelExpr:r,selections:i,...a}=e.combine();if(!n){if(t.aria===!1&&a.aria==null&&(a.aria=!1),a.encode?.symbols){let e=a.encode.symbols.update;e.fill&&e.fill.value!==`transparent`&&!e.stroke&&!a.stroke&&(e.stroke={value:`transparent`});for(let t of K3)a[t]&&delete e[t]}if(a.title||delete a.title,r!==void 0){let e=r;a.encode?.labels?.update&&o$(a.encode.labels.update.text)&&(e=_Q(r,`datum.label`,a.encode.labels.update.text.signal)),RFe(a,`labels`,`text`,{signal:e})}return a}}function JFe(e){return I2(e)||F2(e)?YFe(e):XFe(e)}function YFe(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),XFe(e))}function XFe(e){let t=e.component.projection;if(!t||t.merged)return[];let n=t.combine(),{name:r}=n;if(t.data){let i={signal:`[${t.size.map(e=>e.signal).join(`, `)}]`},a=t.data.reduce((t,n)=>{let r=o$(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return XZ(t,r)||t.push(r),t},[]);if(a.length<=0)throw Error(`Projection's fit didn't find any data sources`);return[{name:r,size:i,fit:{signal:a.length>1?`[${a.join(`, `)}]`:a[0]},...n}]}else return[{name:r,translate:{signal:`[width / 2, height / 2]`},...n}]}function ZFe(e){e.component.projection=N2(e)?QFe(e):tIe(e)}function QFe(e){if(e.hasProjection){let t=r$(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef(`width`),e.getSizeSignalRef(`height`)]:void 0,i=n?$Fe(e):void 0,a=new l8(e.projectionName(!0),{...r$(e.config.projection),...t},r,i);return a.get(`type`)||a.set(`type`,`equalEarth`,!1),a}}function $Fe(e){let t=[],{encoding:n}=e;for(let r of[[u4,l4],[f4,d4]])(Z1(n[r[0]])||Z1(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(_4)&&e.typedFieldDef(_4).type===c3&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(r6.Main)),t}function eIe(e,t){let n=QZ(pBe,n=>!!(!fg(e.explicit,n)&&!fg(t.explicit,n)||fg(e.explicit,n)&&fg(t.explicit,n)&&EQ(e.get(n),t.get(n))));if(EQ(e.size,t.size)){if(n)return e;if(EQ(e.explicit,{}))return t;if(EQ(t.explicit,{}))return e}return null}function tIe(e){if(e.children.length===0)return;let t;for(let t of e.children)ZFe(t);let n=QZ(e.children,e=>{let n=e.component.projection;if(!n)return!0;if(t){let e=eIe(t,n);return e&&(t=e),!!e}else return t=n,!0});if(t&&n){let n=e.projectionName(!0),r=new l8(n,t.specifiedProjection,t.size,G2(t.data));for(let t of e.children){let e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get(`name`),n),e.merged=!0)}return r}}function nIe(e){return I2(e)||F2(e)?e.children.reduce((e,t)=>e.concat(nIe(t)),rIe(e)):rIe(e)}function rIe(e){return $(e.component.scales).reduce((t,n)=>{let r=e.component.scales[n];if(r.merged)return t;let i=r.combine(),{name:a,type:o,selectionExtent:s,domains:c,range:l,reverse:u,...d}=i,f=iIe(i.range,a,n,e),p=j2(e,n),m=s?TNe(e,s,r,p):null;return t.push({name:a,type:o,...p?{domain:p}:{},...m?{domainRaw:m}:{},range:f,...u===void 0?{}:{reverse:u},...d}),t},[])}function iIe(e,t,n,r){if(BQ(n)){if(s$(e))return{step:{signal:`${t}_step`}}}else if(Eh(e)&&l$(e))return{...e,data:r.lookupDataSource(e.data)};return e}function aIe(e){let t=e.component.scales;for(let n of K4){let r=t[n];if(!r)continue;let i=sIe(n,e);r.setWithExplicit(`range`,i)}}function oIe(e,t){let n=e.fieldDef(t);if(n?.bin){let{bin:r,field:i}=n,a=LQ(t),o=e.getName(a);if(Eh(r)&&r.binned&&r.step!==void 0)return new c8(()=>{let n=e.scaleName(t),i=`(domain("${n}")[1] - domain("${n}")[0]) / ${r.step}`;return`${e.getSignalName(o)} / (${i})`});if(ZQ(r)){let t=b2(e,i,r);return new c8(()=>{let n=e.getSignalName(t),r=`(${n}.stop - ${n}.start) / ${n}.step`;return`${e.getSignalName(o)} / (${r})`})}}}function sIe(e,t){let n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get(`type`);for(let r of mBe)if(n[r]!==void 0){let a=d1(i,r),o=DAe(e,r);if(!a)X(B$(i,r,e));else if(o)X(o);else switch(r){case`range`:{let r=n.range;if(H(r)){if(BQ(e))return j0(r.map(e=>{if(e===`width`||e===`height`){let n=t.getName(e),r=t.getSignalName.bind(t);return c8.fromName(r,n)}return e}))}else if(Eh(r))return j0({data:t.requestDataName(r6.Main),field:r.field,sort:{op:`min`,field:t.vgField(e)}});return j0(r)}case`scheme`:return j0(cIe(n[r]))}}let a=e===$2||e===`xOffset`?`width`:`height`,o=r[a];if(b0(o)){if(BQ(e))if(s1(i)){let n=dIe(o,t,e);if(n)return j0({step:n})}else X(V$(a));else if(HQ(e)){let n=e===r4?`x`:`y`;if(t.getScaleComponent(n).get(`type`)===`band`){let e=fIe(o,i);if(e)return j0(e)}}}let{rangeMin:s,rangeMax:c}=n,l=uIe(e,t);return(s!==void 0||c!==void 0)&&d1(i,`rangeMin`)&&H(l)&&l.length===2?j0([s??l[0],c??l[1]]):M0(l)}function cIe(e){return CAe(e)?{scheme:e.name,...qZ(e,[`name`])}:{scheme:e}}function lIe(e,t,n,{center:r}={}){let i=LQ(e),a=t.getName(i),o=t.getSignalName.bind(t);return e===e4&&c1(n)?r?[c8.fromName(e=>`${o(e)}/2`,a),c8.fromName(e=>`-${o(e)}/2`,a)]:[c8.fromName(o,a),0]:r?[c8.fromName(e=>`-${o(e)}/2`,a),c8.fromName(e=>`${o(e)}/2`,a)]:[0,c8.fromName(o,a)]}function uIe(e,t){let{size:n,config:r,mark:i,encoding:a}=t,{type:o}=Z1(a[e]),s=t.getScaleComponent(e).get(`type`),{domain:c,domainMid:l}=t.specifiedScales[e];switch(e){case $2:case e4:if(XZ([`point`,`band`],s)){let i=mIe(e,n,r.view);if(b0(i))return{step:dIe(i,t,e)}}return lIe(e,t,s);case r4:case i4:return pIe(e,t,s);case v4:{let a=_Ie(i,r),o=vIe(i,n,t,r);return u1(s)?gIe(a,o,hIe(s,r,c,e)):[a,o]}case s4:return[0,Math.PI*2];case y4:return[0,360];case a4:return[0,new c8(()=>`min(${t.getSignalName(P2(t.parent)?`child_width`:`width`)},${t.getSignalName(P2(t.parent)?`child_height`:`height`)})/2`)];case p4:return{step:1e3/r.scale.framesPerSecond};case C4:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case w4:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case _4:return`symbol`;case m4:case h4:case g4:return s===`ordinal`?o===`nominal`?`category`:`ordinal`:l===void 0?i===`rect`||i===`geoshape`?`heatmap`:`ramp`:`diverging`;case b4:case x4:case S4:return[r.scale.minOpacity,r.scale.maxOpacity]}}function dIe(e,t,n){let{encoding:r}=t,i=t.getScaleComponent(n),a=zQ(n),o=r[a];if(Xje({step:e,offsetIsDiscrete:B1(o)&&o1(o.type)})===`offset`&&xje(r,a)){let n=t.getScaleComponent(a),r=`domain('${t.scaleName(a)}').length`;if(n.get(`type`)===`band`){let e=n.get(`paddingInner`)??n.get(`padding`)??0,t=n.get(`paddingOuter`)??n.get(`padding`)??0;r=`bandspace(${r}, ${e}, ${t})`}let o=i.get(`paddingInner`)??i.get(`padding`);return{signal:`${e.step} * ${r} / (1-${ZOe(o)})`}}else return e.step}function fIe(e,t){if(Xje({step:e,offsetIsDiscrete:s1(t)})===`offset`)return{step:e.step}}function pIe(e,t,n){let r=e===r4?`x`:`y`,i=t.getScaleComponent(r);if(!i)return lIe(r,t,n,{center:!0});let a=i.get(`type`),o=t.scaleName(r),{markDef:s,config:c}=t;if(a===`band`){let e=mIe(r,t.size,t.config.view);if(b0(e)){let t=fIe(e,n);if(t)return t}return[0,{signal:`bandwidth('${o}')`}]}else{let n=t.encoding[r];if(Z(n)&&n.timeUnit){let e=lAe(n.timeUnit,e=>`scale('${o}', ${e})`),r=t.config.scale.bandWithNestedOffsetPaddingInner,i=M1({fieldDef:n,markDef:s,config:c})-.5,a=i===0?``:` + ${i}`;if(r){let t=o$(r)?`${r.signal}/2${a}`:`${r/2+i}`,n=o$(r)?`(1 - ${r.signal}/2)${a}`:`${1-r/2+i}`;return[{signal:`${t} * (${e})`},{signal:`${n} * (${e})`}]}return[0,{signal:e}]}return GZ(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function mIe(e,t,n){let r=e===$2?`width`:`height`,i=t[r];return i===void 0?C0(n,r):i}function hIe(e,t,n,r){switch(e){case`quantile`:return t.scale.quantileCount;case`quantize`:return t.scale.quantizeCount;case`threshold`:return n!==void 0&&H(n)?n.length+1:(X(Gke(r)),3)}}function gIe(e,t,n){let r=()=>{let r=h$(t),i=h$(e),a=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${a}, ${a})`};return o$(t)?new c8(r):{signal:r()}}function _Ie(e,t){switch(e){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 Error(R$(`size`,e))}function vIe(e,t,n,r){let i={x:oIe(n,`x`),y:oIe(n,`y`)};switch(e){case`bar`:case`tick`:{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;let e=yIe(t,i,r.view);return yg(e)?e-1:new c8(()=>`${e.signal} - 1`)}case`line`:case`trail`:case`rule`:return r.scale.maxStrokeWidth;case`text`:return r.scale.maxFontSize;case`point`:case`square`:case`circle`:{if(r.scale.maxSize)return r.scale.maxSize;let e=yIe(t,i,r.view);return yg(e)?(d8*e)**2:new c8(()=>`pow(${d8} * ${e.signal}, 2)`)}}throw Error(R$(`size`,e))}function yIe(e,t,n){let r=b0(e.width)?e.width.step:S0(n,`width`),i=b0(e.height)?e.height.step:S0(n,`height`);return t.x||t.y?new c8(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(`, `)})`):Math.min(r,i)}function bIe(e,t){N2(e)?xIe(e,t):CIe(e,t)}function xIe(e,t){let n=e.component.scales,{config:r,encoding:i,markDef:a,specifiedScales:o}=e;for(let s of $(n)){let c=o[s],l=n[s],u=e.getScaleComponent(s),d=Z1(i[s]),f=c[t],p=u.get(`type`),m=u.get(`padding`),h=u.get(`paddingInner`),g=d1(p,t),_=DAe(s,t);if(f!==void 0&&(g?_&&X(_):X(B$(p,t,s))),g&&_===void 0)if(f!==void 0){let e=d.timeUnit,n=d.type;switch(t){case`domainMax`:case`domainMin`:W$(c[t])||n===`temporal`||e?l.set(t,{signal:n0(c[t],{type:n,timeUnit:e})},!0):l.set(t,c[t],!0);break;default:l.copyKeyFromObject(t,c)}}else{let n=Y(f8,t)?f8[t]({model:e,channel:s,fieldOrDatumDef:d,scaleType:p,scalePadding:m,scalePaddingInner:h,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:a,config:r,hasNestedOffsetScale:Sje(i,s),hasSecondaryRangeChannel:!!i[IQ(s)]}):r.scale[t];n!==void 0&&l.set(t,n,!1)}}}function SIe(e){N2(e)?aIe(e):CIe(e,`range`)}function CIe(e,t){let n=e.component.scales;for(let n of e.children)t===`range`?SIe(n):bIe(n,t);for(let r of $(n)){let i;for(let n of e.children){let e=n.component.scales[r];if(e){let n=e.getWithExplicit(t);i=P0(i,n,t,`scale`,cNe((e,n)=>{switch(t){case`range`:return e.step&&n.step?e.step-n.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function wIe(e,t){let n=t.bin;if(ZQ(n)){let r=b2(e,t.field,n);return new c8(()=>e.getSignalName(r))}else if(QQ(n)&&$Q(n)&&n.step!==void 0)return{step:n.step}}function TIe(e,t){if(XZ([m4,h4,g4],e)&&t!==`nominal`)return`hcl`}function EIe(e,t,n,r,i,a){if(!(X1(a)?.bin||H(n)||i!=null||r!=null||XZ([l3.TIME,l3.UTC],e)))return BQ(t)?!0:void 0}function DIe(e,t,n,r,i,a){if(BQ(e)){if(l1(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;let{type:t,orient:o}=i;if(t===`bar`&&!(Z(r)&&(r.bin||r.timeUnit))&&(o===`vertical`&&e===`x`||o===`horizontal`&&e===`y`))return a.continuousBandSize}if(t===l3.POINT)return n.pointPadding}}function OIe(e,t,n,r,i,a=!1){if(e===void 0){if(BQ(t)){let{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r,tickBandPaddingInner:o,bandWithNestedOffsetPaddingInner:s}=i;return a?s:bQ(e,n===`bar`?t:n===`tick`?o:r)}else if(HQ(t)&&r===l3.BAND)return i.offsetBandPaddingInner}}function kIe(e,t,n,r,i,a=!1){if(e===void 0){if(BQ(t)){let{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=i;if(a)return t;if(n===l3.BAND)return bQ(e,o$(r)?{signal:`${r.signal}/2`}:r/2)}else if(HQ(t)){if(n===l3.POINT)return .5;if(n===l3.BAND)return i.offsetBandPaddingOuter}}}function AIe(e,t,n,r){if(n===`x`&&r.xReverse!==void 0)return c1(e)&&t===`descending`?o$(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(c1(e)&&t===`descending`)return!0}function jIe(e,t,n,r,i,a,o){if(n&&n!==`unaggregated`&&c1(i)){if(H(n)){let e=n[0],t=n[n.length-1];if(yg(e)&&e<=0&&yg(t)&&t>=0)return!0}return!1}if(e===`size`&&t.type===`quantitative`&&!u1(i))return!0;if(!(Z(t)&&t.bin)&&XZ([...V4,...ZLe],e)){let{orient:t,type:n}=r;return XZ([`bar`,`area`,`line`,`trail`],n)&&(t===`horizontal`&&e===`y`||t===`vertical`&&e===`x`)?!1:XZ([`bar`,`area`],n)&&!o?!0:a?.zero}return!1}function MIe(e,t,n,r,i=!1){let a=NIe(t,n,r,i),{type:o}=e;return WQ(t)?o===void 0?a:kAe(t,o)?Z(n)&&!OAe(o,n.type)?(X(kke(o,a)),a):o:(X(Oke(t,o,a)),a):null}function NIe(e,t,n,r){switch(t.type){case`nominal`:case`ordinal`:{if(jQ(e)||GQ(e)===`discrete`)return e===`shape`&&t.type===`ordinal`&&X(z$(e,`ordinal`)),`ordinal`;if(UQ(e))return`band`;if(BQ(e)||HQ(e)){if(XZ([`rect`,`bar`,`image`,`rule`,`tick`],n.type)||r)return`band`}else if(n.type===`arc`&&e in H4)return`band`;let i=n[LQ(e)];return h1(i)||W1(t)&&t.axis?.tickBand?`band`:`point`}case`temporal`:return jQ(e)?`time`:GQ(e)===`discrete`?(X(z$(e,`temporal`)),`ordinal`):Z(t)&&t.timeUnit&&X$(t.timeUnit).utc?`utc`:UQ(e)?`band`:`time`;case`quantitative`:return jQ(e)?Z(t)&&ZQ(t.bin)?`bin-ordinal`:`linear`:GQ(e)===`discrete`?(X(z$(e,`quantitative`)),`ordinal`):UQ(e)?`band`:`linear`;case`geojson`:return}throw Error(F$(t.type))}function PIe(e,{ignoreRange:t}={}){FIe(e),OFe(e);for(let t of JRe)bIe(e,t);t||SIe(e)}function FIe(e){N2(e)?e.component.scales=IIe(e):e.component.scales=LIe(e)}function IIe(e){let{encoding:t,mark:n,markDef:r}=e,i={};for(let a of K4){let o=Z1(t[a]);if(o&&n===T3&&a===_4&&o.type===c3)continue;let s=o&&o.scale;if(o&&s!==null&&s!==!1){s??={};let n=Sje(t,a),c=MIe(s,a,o,r,n);i[a]=new u8(e.scaleName(`${a}`,!0),{value:c,explicit:s.type===c})}}return i}function LIe(e){let t=e.component.scales={},n={},r=e.component.resolve;for(let t of e.children){FIe(t);for(let i of $(t.component.scales))if(r.scale[i]??=zPe(i,e),r.scale[i]===`shared`){let e=n[i],a=t.component.scales[i].getWithExplicit(`type`);e?bAe(e.value,a.value)?n[i]=P0(e,a,`type`,`scale`,hBe):(r.scale[i]=`independent`,delete n[i]):n[i]=a}}for(let r of $(n)){let i=e.scaleName(r,!0),a=n[r];t[r]=new u8(i,a);for(let t of e.children){let e=t.component.scales[r];e&&(t.renameScale(e.get(`name`),i),e.merged=!0)}}return t}function N2(e){return e?.type===`unit`}function P2(e){return e?.type===`facet`}function F2(e){return e?.type===`concat`}function I2(e){return e?.type===`layer`}function RIe(e){let t=0;function n(r,i){if(r instanceof Q6&&!r.isGenerator&&!F0(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof J6&&(r.parent instanceof Q6&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof q6){i.name||=`data_${t++}`,!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof X6||r instanceof Z6||r instanceof r8||r instanceof L6||r instanceof z6||r instanceof x8||r instanceof K6||r instanceof w8||r instanceof a8||r instanceof n8||r instanceof y8||r instanceof v8||r instanceof g8||r instanceof C8||r instanceof T8||r instanceof E8||r instanceof Y6||r instanceof O8||r instanceof D8||r instanceof _8)&&i.transform.push(r.assemble()),(r instanceof G6||r instanceof o6||r instanceof S8||r instanceof i8||r instanceof b8)&&i.transform.push(...r.assemble()),r instanceof a6&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof a6?r.setSource(i.name):(i.name||=`data_${t++}`,r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof a6&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||=`data_${t++}`;let a=i.name;!i.source||i.transform.length>0?e.push(i):a=i.source;for(let e of r.children)n(e,{name:null,source:a,transform:[]});break}}}return n}function zIe(e){let t=[],n=RIe(t);for(let t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}function BIe(e,t){let n=[],r=RIe(n),i=0;for(let t of e.sources)t.hasName()||(t.dataName=`source_${i++}`),r(t,t.assemble());for(let e of n)e.transform.length===0&&delete e.transform;let a=0;for(let[e,t]of n.entries())(t.transform??[]).length===0&&!t.source&&n.splice(a++,0,n.splice(e,1)[0]);for(let t of n)for(let n of t.transform??[])n.type===`lookup`&&(n.from=e.outputNodes[n.from].getSource());for(let e of n)e.name in t&&(e.values=t[e.name]);return n}function VIe(e){return e===`top`||e===`left`||o$(e)?`header`:`footer`}function HIe(e){for(let t of L4)UIe(e,t);GIe(e,`x`),GIe(e,`y`)}function UIe(e,t){let{facet:n,config:r,child:i,component:a}=e;if(e.channelHasField(t)){let o=n[t],s=p2(`title`,null,r,t),c=K1(o,r,{allowDisabling:!0,includeDefault:s===void 0||!!s});i.component.layoutHeaders[t].title&&(c=H(c)?c.join(`, `):c,c+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);let l=p2(`labelOrient`,o.header,r,t),u=o.header!==null&&bQ(o.header?.labels,r.header.labels,!0),d=XZ([`bottom`,`right`],l)?`footer`:`header`;a.layoutHeaders[t]={title:o.header===null?null:c,facetFieldDef:o,[d]:t===`facet`?[]:[WIe(e,t,u)]}}}function WIe(e,t,n){let r=t===`row`?`height`:`width`;return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function GIe(e,t){let{child:n}=e;if(n.component.axes[t]){let{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=v2(i,t),i.axis[t]===`shared`){let i=t===`x`?`column`:`row`,a=r[i];for(let r of n.component.axes[t]){let t=VIe(r.get(`orient`));a[t]??=[WIe(e,i,!1)];let n=c2(r,`main`,e.config,{header:!0});n&&a[t][0].axes.push(n),r.mainExtracted=!0}}}}function KIe(e){L2(e),R2(e,`width`),R2(e,`height`)}function qIe(e){L2(e);let t=e.layout.columns===1?`width`:`childWidth`,n=e.layout.columns===void 0?`height`:`childHeight`;R2(e,t),R2(e,n)}function L2(e){for(let t of e.children)t.parseLayoutSize()}function R2(e,t){let n=LPe(t),r=VQ(n),i=e.component.resolve,a=e.component.layoutSize,o;for(let t of e.children){let a=t.component.layoutSize.getWithExplicit(n),s=i.scale[r]??zPe(r,e);if(s===`independent`&&a.value===`step`){o=void 0;break}if(o){if(s===`independent`&&o.value!==a.value){o=void 0;break}o=P0(o,a,n,``)}else o=a}if(o){for(let r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,`merged`,!1);a.setWithExplicit(t,o)}else a.setWithExplicit(t,{explicit:!1,value:void 0})}function JIe(e){let{size:t,component:n}=e;for(let r of V4){let i=LQ(r);if(t[i]!=null&&t[i]!=null){let e=t[i];n.layoutSize.set(i,b0(e)?`step`:e,!0)}else{let t=YIe(e,i);n.layoutSize.set(i,t,!1)}}}function YIe(e,t){let n=t===`width`?`x`:`y`,r=e.config,i=e.getScaleComponent(n);if(i){let e=i.get(`type`),n=i.get(`range`);if(s1(e)){let e=C0(r.view,t);return s$(n)||b0(e)?`step`:e}else return x0(r.view,t)}else if(e.hasProjection||e.mark===`arc`)return x0(r.view,t);else{let e=C0(r.view,t);return b0(e)?e.step:e}}function z2(e,t,n){return Q(t,{suffix:`by_${Q(e)}`,...n})}function XIe(e,t){let{row:n,column:r}=t;if(n&&r){let t=null;for(let i of[n,r])if(D1(i.sort)){let{field:n,op:r=A3}=i.sort;e=t=new n8(e,{joinaggregate:[{op:r,field:n,as:z2(i,i.sort,{forAs:!0})}],groupby:[Q(i)]})}return t}return null}function ZIe(e,t){for(let n of t){let t=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;let r=e.format?.mesh,i=t.format?.feature;if(r&&i)continue;let a=e.format?.feature;if((a||i)&&a!==i)continue;let o=t.format?.mesh;if(!((r||o)&&r!==o)){if(I0(e)&&I0(t)){if(EQ(e.values,t.values))return n}else if(F0(e)&&F0(t)){if(e.url===t.url)return n}else if(lNe(e)&&e.name===n.dataName)return n}}return null}function QIe(e,t){if(e.data||!e.parent){if(e.data===null){let e=new Q6({values:[]});return t.push(e),e}let n=ZIe(e.data,t);if(n)return L0(e.data)||(n.data.format=$Z({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{let n=new Q6(e.data);return t.push(n),n}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function $Ie(e,t,n){let r=0;for(let i of t.transforms){let a,o;if(HMe(i))o=e=new z6(e,i),a=`derived`;else if(k0(i)){let r=yFe(i);o=e=J6.makeWithAncestors(e,{},r,n)??e,e=new L6(e,t,i.filter)}else if(UMe(i))o=e=G6.makeFromTransform(e,i,t),a=`number`;else if(GMe(i))a=`date`,n.getWithExplicit(i.field).value===void 0&&(e=new J6(e,{[i.field]:a}),n.set(i.field,a,!1)),o=e=o6.makeFromTransform(e,i);else if(KMe(i))o=e=K6.makeFromTransform(e,i),a=`number`,r2(t)&&(e=new Y6(e));else if(AMe(i))o=e=w8.make(e,t,i,r++),a=`derived`;else if(zMe(i))o=e=new a8(e,i),a=`number`;else if(BMe(i))o=e=new n8(e,i),a=`number`;else if(qMe(i))o=e=i8.makeFromTransform(e,i),a=`derived`;else if(JMe(i))o=e=new y8(e,i),a=`derived`;else if(YMe(i))o=e=new _8(e,i),a=`derived`;else if(VMe(i))o=e=new v8(e,i),a=`derived`;else if(NMe(i))o=e=new D8(e,i),a=`derived`;else if(RMe(i))e=new O8(e,i);else if(WMe(i))o=e=S8.makeFromTransform(e,i),a=`derived`;else if(PMe(i))o=e=new g8(e,i),a=`derived`;else if(FMe(i))o=e=new T8(e,i),a=`derived`;else if(IMe(i))o=e=new E8(e,i),a=`derived`;else if(LMe(i))o=e=new C8(e,i),a=`derived`;else{X(cke(i));continue}if(o&&a!==void 0)for(let e of o.producedFields()??[])n.set(e,a,!1)}return e}function B2(e){let t=QIe(e,e.component.data.sources),{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,a=!(i&&(L0(i)||F0(i)||I0(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new zze;L0(i)?(uNe(i)?t=new Z6(t,i.sequence):R0(i)&&(t=new X6(t,i.graticule)),a.parseNothing=!0):i?.format?.parse===null&&(a.parseNothing=!0),t=J6.makeExplicit(t,e,a)??t,t=new Y6(t);let o=e.parent&&I2(e.parent);(N2(e)||P2(e))&&o&&(t=G6.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=$Ie(t,e,a));let s=xFe(e),c=bFe(e);t=J6.makeWithAncestors(t,{},{...s,...c},a)??t,N2(e)&&(t=b8.parseAll(t,e),t=x8.parseAll(t,e)),(N2(e)||P2(e))&&(o||(t=G6.makeFromEncoding(t,e)??t),t=o6.makeFromEncoding(t,e)??t,t=z6.parseAllForSortIndex(t,e));let l=t=V2(r6.Raw,e,t);if(N2(e)){let n=K6.makeFromEncoding(t,e);n&&(t=n,r2(e)&&(t=new Y6(t))),t=S8.makeFromEncoding(t,e)??t,t=i8.makeFromEncoding(t,e)??t}let u,d;if(N2(e)){let{markDef:n,mark:r,config:i}=e,{marks:a,scales:o}=d=fNe({invalid:_$(`invalid`,n,i),isPath:f1(r)});a!==o&&o===`include-invalid-values`&&(u=t=V2(r6.PreFilterInvalid,e,t)),a===`exclude-invalid-values`&&(t=r8.make(t,e,d)??t)}let f=t=V2(r6.Main,e,t),p;if(N2(e)&&d){let{marks:n,scales:r}=d;n===`include-invalid-values`&&r===`exclude-invalid-values`&&(t=r8.make(t,e,d)??t,p=t=V2(r6.PostFilterInvalid,e,t))}N2(e)&&oPe(e,f);let m=null;if(P2(e)){let r=e.getName(`facet`);t=XIe(t,e.facet)??t,m=new q6(t,e,r,f.getSource()),n[r]=m}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:l,main:f,facetRoot:m,ancestorParse:a,preFilterInvalid:u,postFilterInvalid:p}}function V2(e,t,n){let{outputNodes:r,outputNodeRefCounts:i}=t.component.data,a=t.getDataName(e),o=new a6(n,a,e,i);return r[a]=o,o}function eLe(e){return e===!1||e===null}function tLe(e,t,n){let{encoding:r,config:i}=e,a=Z1(r[t])??Z1(r[IQ(t)]),{format:o,formatType:s}=e.axis(t)||{};if(S1(s))return{text:w1({fieldOrDatumDef:a,field:`datum.value`,format:o,formatType:s,config:i}),...n};if(o===void 0&&s===void 0&&i.customFormatTypes){if(I1(a)===`quantitative`){if(W1(a)&&a.stack===`normalize`&&i.normalizedNumberFormatType)return{text:w1({fieldOrDatumDef:a,field:`datum.value`,format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:w1({fieldOrDatumDef:a,field:`datum.value`,format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(I1(a)===`temporal`&&i.timeFormatType&&Z(a)&&!a.timeUnit)return{text:w1({fieldOrDatumDef:a,field:`datum.value`,format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function nLe(e){return V4.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[sLe(n,e)]),t),{})}function rLe(e){let{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(let r of e.children){r.parseAxesAndHeaders();for(let i of $(r.component.axes))n.axis[i]=v2(e.component.resolve,i),n.axis[i]===`shared`&&(t[i]=iLe(t[i],r.component.axes[i]),t[i]||(n.axis[i]=`independent`,delete t[i]))}for(let i of V4){for(let a of e.children)if(a.component.axes[i]){if(n.axis[i]===`independent`){t[i]=(t[i]??[]).concat(a.component.axes[i]);for(let e of a.component.axes[i]){let{value:t,explicit:n}=e.getWithExplicit(`orient`);if(!o$(t)){if(r[t]>0&&!n){let n=yBe[t];r[t]>r[n]&&e.set(`orient`,n,!1)}r[t]++}}}delete a.component.axes[i]}if(n.axis[i]===`independent`&&t[i]&&t[i].length>1)for(let[e,n]of(t[i]||[]).entries())e>0&&n.get(`grid`)&&!n.explicit.grid&&(n.implicit.grid=!1)}}function iLe(e,t){if(e){if(e.length!==t.length)return;let n=e.length;for(let r=0;re.clone());return e}function aLe(e,t){for(let n of k8){let r=P0(e.getWithExplicit(n),t.getWithExplicit(n),n,`axis`,(e,t)=>{switch(n){case`title`:return w$(e,t);case`gridScale`:return{explicit:e.explicit,value:bQ(e.value,t.value)}}return N0(e,t,n,`axis`)});e.setWithExplicit(n,r)}return e}function oLe(e,t,n,r,i){if(t===`disable`)return n!==void 0;switch(n||={},t){case`titleAngle`:case`labelAngle`:return e===(o$(n.labelAngle)?n.labelAngle:wQ(n.labelAngle));case`values`:return!!n.values;case`encode`:return!!n.encoding||!!n.labelAngle;case`title`:if(e===CPe(r,i))return!0}return e===n[t]}function sLe(e,t){let n=t.axis(e),r=new vBe,i=Z1(t.encoding[e]),{mark:a,config:o}=t,s=n?.orient||o[e===`x`?`axisX`:`axisY`]?.orient||o.axis?.orient||bPe(e),c=t.getScaleComponent(e).get(`type`),l=dPe(e,c,s,t.config),u=n===void 0?l2(`disable`,o.style,n?.style,l).configValue:!n;if(r.set(`disable`,u,n!==void 0),u)return r;n||={};let d=hPe(i,n,e,o.style,l),f=HAe(n.formatType,i,c),p=VAe(i,i.type,n.format,n.formatType,o,!0),m={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:c,orient:s,labelAngle:d,format:p,formatType:f,mark:a,config:o};for(let i of k8){let a=i in R6?R6[i](m):bje(i)?n[i]:void 0,s=a!==void 0,c=oLe(a,i,n,t,e);if(s&&c)r.set(i,a,c);else{let{configValue:e=void 0,configFrom:t=void 0}=bje(i)&&i!==`values`?l2(i,o.style,n.style,l):{},u=e!==void 0;s&&!u?r.set(i,a,c):(t!==`vgAxisConfig`||bBe.has(i)&&u||i0(e)||o$(e))&&r.set(i,e,!1)}}let h=n.encoding??{},g=F3.reduce((n,i)=>{if(!r.hasAxisPart(i))return n;let a=RPe(h[i]??{},t),o=i===`labels`?tLe(t,e,a):a;return o!==void 0&&!aQ(o)&&(n[i]={update:o}),n},{});return aQ(g)||r.set(`encode`,g,!!n.encoding||n.labelAngle!==void 0),r}function cLe({encoding:e,size:t}){for(let n of V4){let r=LQ(n);b0(t[r])&&R1(e[n])&&(delete t[r],X(V$(r)))}return t}function H2(e,t){let{config:n}=e;return{...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`include`,orient:`ignore`,theta:`ignore`}),...Y0(`x`,e,{defaultPos:`mid`}),...Y0(`y`,e,{defaultPos:`mid`}),...q0(`size`,e),...q0(`angle`,e),...lLe(e,n,t)}}function lLe(e,t,n){return n?{shape:{value:n}}:q0(`shape`,e)}function uLe(e,t,n){if(_$(`align`,e,n)===void 0)return`center`}function dLe(e,t,n){if(_$(`baseline`,e,n)===void 0)return`middle`}function fLe(e){if(XZ([v3,g3,ZRe],e.mark)){let t=kje(e.mark,e.encoding);if(t.length>0)return pLe(e,t)}else if(e.mark===_3){let t=J4.some(t=>_$(t,e.markDef,e.config));if(e.stack&&!e.fieldDef(`size`)&&t)return mLe(e)}return U2(e)}function pLe(e,t){return[{name:e.getName(`pathgroup`),type:`group`,from:{facet:{name:j8+e.requestDataName(r6.Main),data:e.requestDataName(r6.Main),groupby:t}},encode:{update:{width:{field:{group:`width`}},height:{field:{group:`height`}}}},marks:U2(e,{fromPrefix:j8})}]}function mLe(e){let[t]=U2(e,{fromPrefix:M8}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:`min`,suffix:`start`,expr:t}),r({prefix:`max`,suffix:`start`,expr:t}),r({prefix:`min`,suffix:`end`,expr:t}),r({prefix:`max`,suffix:`end`,expr:t})].map(e=>`scale('${n}',${e})`).join(`,`)})`,a,o;e.stack.fieldChannel===`x`?(a={...KZ(t.encode.update,[`y`,`yc`,`y2`,`height`,...J4]),x:{signal:i(`min`,`datum`)},x2:{signal:i(`max`,`datum`)},clip:{value:!0}},o={x:{field:{group:`x`},mult:-1},height:{field:{group:`height`}}},t.encode.update={...qZ(t.encode.update,[`y`,`yc`,`y2`]),height:{field:{group:`height`}}}):(a={...KZ(t.encode.update,[`x`,`xc`,`x2`,`width`]),y:{signal:i(`min`,`datum`)},y2:{signal:i(`max`,`datum`)},clip:{value:!0}},o={y:{field:{group:`y`},mult:-1},width:{field:{group:`width`}}},t.encode.update={...qZ(t.encode.update,[`x`,`xc`,`x2`]),width:{field:{group:`width`}}});for(let n of J4){let r=v$(n,e.markDef,e.config);t.encode.update[n]?(a[n]=t.encode.update[n],delete t.encode.update[n]):r&&(a[n]=p$(r)),r&&(t.encode.update[n]={value:0})}let s=[];if(e.stack.groupbyChannels?.length>0)for(let t of e.stack.groupbyChannels){let n=e.fieldDef(t),r=Q(n);r&&s.push(r),(n?.bin||n?.timeUnit)&&s.push(Q(n,{binSuffix:`end`}))}return a=[`stroke`,`strokeWidth`,`strokeJoin`,`strokeCap`,`strokeDash`,`strokeDashOffset`,`strokeMiterLimit`,`strokeOpacity`].reduce((n,r)=>{if(t.encode.update[r])return{...n,[r]:t.encode.update[r]};{let t=v$(r,e.markDef,e.config);return t===void 0?n:{...n,[r]:p$(t)}}},a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0}),[{type:`group`,from:{facet:{data:e.requestDataName(r6.Main),name:M8+e.requestDataName(r6.Main),groupby:s,aggregate:{fields:[r({suffix:`start`}),r({suffix:`start`}),r({suffix:`end`}),r({suffix:`end`})],ops:[`min`,`max`,`min`,`max`]}}},encode:{update:a},marks:[{type:`group`,encode:{update:o},marks:[t]}]}]}function hLe(e){let{encoding:t,stack:n,mark:r,markDef:i,config:a}=e,o=t.order;if(!(!H(o)&&H1(o)&&YZ(o.value)||!o&&YZ(_$(`order`,i,a)))){if((H(o)||Z(o))&&!n)return x$(o,{expr:`datum`});if(f1(r)){let e=i.orient===`horizontal`?`y`:`x`,n=t[e];if(Z(n))return{field:e}}}}function U2(e,t={fromPrefix:``}){let{mark:n,markDef:r,encoding:i,config:a}=e,o=bQ(r.clip,gLe(e),_Le(e)),s=g$(r),c=i.key,l=hLe(e),u=vLe(e);u&&Object.values(e.component.selection).some(e=>e.type===`point`&&!e.bind&&e.on!==`pointerover`)&&(e.markDef.cursor??=`pointer`);let d=_$(`aria`,r,a),f=A8[n].postEncodingTransform?A8[n].postEncodingTransform(e):null;return[{name:e.getName(`marks`),type:A8[n].vgMark,...o?{clip:o}:{},...s?{style:s}:{},...c?{key:c.field}:{},...l?{sort:l}:{},...u||{},...d===!1?{aria:d}:{},from:{data:t.fromPrefix+e.requestDataName(r6.Main)},encode:{update:A8[n].encodeEntry(e)},...f?{transform:f}:{}}]}function gLe(e){let t=e.getScaleComponent(`x`),n=e.getScaleComponent(`y`);return t?.get(`selectionExtent`)||n?.get(`selectionExtent`)?!0:void 0}function _Le(e){let t=e.component.projection;return t&&!t.isFit?!0:void 0}function vLe(e){if(!e.component.selection)return null;let t=$(e.component.selection).length,n=t,r=e.parent;for(;r&&n===0;)n=$(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark===`geoshape`||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}function W2(e,t,n,r,i){if(A1(e))return new gBe(e,t,n,i);if(w0(e))return new PBe(e,t,n,r,i);if(a0(e))return new N8(e,t,n,r,i);if(Yje(e))return new _Be(e,t,n,i);throw Error(T$(e))}function yLe(e,t={}){t.logger&&Kke(t.logger),t.fieldTitle&&fje(t.fieldTitle);try{let n=iMe(Oh(t.config,e.config)),r=tNe(e,n),i=W2(r,null,``,void 0,n);return i.parse(),DFe(i.component.data,i),{spec:xLe(i,bLe(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&qke(),t.fieldTitle&&pje()}}function bLe(e,t,n,r){let i=r.component.layoutSize.get(`width`),a=r.component.layoutSize.get(`height`);if(t===void 0?(t={type:`pad`},r.hasAxisOrientSignalRef()&&(t.resize=!0)):xg(t)&&(t={type:t}),i&&a&&aNe(t.type)){if(i===`step`&&a===`step`)X(O$()),t.type=`pad`;else if(i===`step`||a===`step`){let e=i===`step`?`width`:`height`;X(O$(VQ(e))),t.type=oNe(e===`width`?`height`:`width`)}}return{...$(t).length===1&&t.type?t.type===`pad`?{}:{autosize:t.type}:{autosize:t},...sNe(n,!1),...sNe(e,!0)}}function xLe(e,t,n={},r){let i=e.config?aMe(e.config):void 0,a=BIe(e.component.data,n),o=e.assembleSelectionData(a),s=e.assembleProjections(),c=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0),d=e.assembleLayoutSignals();d=d.filter(e=>(e.name===`width`||e.name===`height`)&&e.value!==void 0?(t[e.name]=+e.value,!1):!0);let{params:f,...p}=t;return{$schema:`https://vega.github.io/schema/vega/v6.json`,...e.description?{description:e.description}:{},...p,...c?{title:c}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...d,...e.assembleSelectionTopLevelSignals([]),...Jje(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}var SLe,G2,$,K2,q2,J2,Y2,X2,Z2,Q2,$2,e4,t4,n4,r4,i4,a4,o4,s4,c4,l4,u4,d4,f4,p4,m4,h4,g4,_4,v4,y4,b4,x4,S4,C4,w4,T4,E4,D4,O4,k4,A4,j4,M4,CLe,N4,P4,wLe,F4,I4,L4,R4,TLe,ELe,DLe,OLe,kLe,ALe,jLe,MLe,NLe,PLe,FLe,ILe,LLe,RLe,zLe,BLe,VLe,HLe,ULe,WLe,GLe,KLe,qLe,JLe,YLe,z4,XLe,B4,V4,H4,ZLe,U4,QLe,$Le,eRe,tRe,nRe,rRe,iRe,aRe,oRe,W4,sRe,G4,K4,q4,cRe,lRe,uRe,dRe,fRe,pRe,mRe,hRe,gRe,J4,_Re,vRe,yRe,bRe,xRe,SRe,CRe,wRe,Y4,TRe,ERe,DRe,ORe,kRe,X4,ARe,jRe,MRe,Z4,Q4,$4,NRe,e3,PRe,t3,n3,FRe,IRe,r3,i3,a3,o3,s3,c3,l3,u3,LRe,d3,f3,p3,RRe,zRe,BRe,VRe,HRe,URe,WRe,GRe,KRe,qRe,JRe,m3,h3,g3,_3,YRe,v3,y3,XRe,b3,x3,S3,ZRe,C3,w3,T3,QRe,$Re,eze,tze,E3,D3,nze,rze,O3,ize,k3,aze,oze,A3,sze,j3,M3,N3,P3,F3,cze,I3,lze,L3,R3,z3,uze,dze,B3,fze,pze,V3,mze,hze,H3,gze,U3,W3,_ze,vze,G3,K3,yze,bze,q3,xze,J3,Sze,Y3,Cze,X3,Z3,Q3,wze,Tze,Eze,Dze,$3,Oze,kze,Aze,e6,jze,Mze,Nze,Pze,t6,Fze,Ize,Lze,Rze,n6,zze,r6,i6,a6,o6,s6,c6,l6,Bze,Vze,u6,d6,f6,p6,m6,h6,g6,_6,Hze,Uze,Wze,v6,y6,b6,x6,S6,Gze,Kze,qze,Jze,Yze,C6,w6,T6,E6,D6,Xze,O6,k6,A6,Zze,j6,M6,Qze,N6,P6,$ze,F6,I6,L6,R6,z6,B6,V6,eBe,H6,tBe,U6,W6,G6,K6,q6,J6,Y6,X6,Z6,Q6,$6,e8,t8,nBe,rBe,iBe,aBe,oBe,sBe,cBe,lBe,uBe,dBe,fBe,n8,r8,i8,a8,o8,s8,c8,pBe,l8,u8,mBe,d8,f8,hBe,p8,m8,h8,g8,_8,v8,y8,b8,x8,S8,C8,w8,T8,E8,D8,O8,gBe,_Be,k8,vBe,yBe,bBe,xBe,SBe,CBe,wBe,TBe,EBe,DBe,OBe,kBe,ABe,jBe,MBe,NBe,A8,j8,M8,N8,PBe,FBe,IBe=o((()=>{Ag(),ZY(),mK(),LOe(),SLe={version:`6.4.3`},G2=structuredClone,Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>DQ(e)).join(`,`)})`},$=Object.keys,K2=Object.values,q2=Object.entries,J2=42,Y2=Object.getPrototypeOf(structuredClone({})),X2=`row`,Z2=`column`,Q2=`facet`,$2=`x`,e4=`y`,t4=`x2`,n4=`y2`,r4=`xOffset`,i4=`yOffset`,a4=`radius`,o4=`radius2`,s4=`theta`,c4=`theta2`,l4=`latitude`,u4=`longitude`,d4=`latitude2`,f4=`longitude2`,p4=`time`,m4=`color`,h4=`fill`,g4=`stroke`,_4=`shape`,v4=`size`,y4=`angle`,b4=`opacity`,x4=`fillOpacity`,S4=`strokeOpacity`,C4=`strokeWidth`,w4=`strokeDash`,T4=`text`,E4=`order`,D4=`detail`,O4=`key`,k4=`tooltip`,A4=`href`,j4=`url`,M4=`description`,CLe={x:1,y:1,x2:1,y2:1},N4={theta:1,theta2:1,radius:1,radius2:1},P4={longitude:1,longitude2:1,latitude:1,latitude2:1},wLe=$(P4),F4={...CLe,...N4,...P4,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time: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},I4={row:1,column:1,facet:1},L4=$(I4),R4={...F4,...I4},TLe=$(R4),{order:ELe,detail:DLe,tooltip:OLe,...kLe}=R4,{row:ALe,column:jLe,facet:MLe,...NLe}=kLe,PLe=[t4,n4,d4,f4,c4,o4],FLe=$(F4),{x:ILe,y:LLe,x2:RLe,y2:zLe,xOffset:BLe,yOffset:VLe,latitude:HLe,longitude:ULe,latitude2:WLe,longitude2:GLe,theta:KLe,theta2:qLe,radius:JLe,radius2:YLe,...z4}=F4,XLe=$(z4),B4={x:1,y:1},V4=$(B4),H4={theta:1,radius:1},ZLe=$(H4),U4={xOffset:1,yOffset:1},QLe={time:1},{text:$Le,tooltip:eRe,href:tRe,url:nRe,description:rRe,detail:iRe,key:aRe,order:oRe,...W4}=z4,sRe=$(W4),G4={...B4,...H4,...U4,...W4},K4=$(G4),q4={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:cRe,...lRe}=q4,uRe={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb: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},dRe={count:1,min:1,max:1},fRe=new Set([`count`,`valid`,`missing`,`distinct`]),pRe=new Set([`count`,`sum`,`distinct`,`valid`,`missing`]),mRe=new Set([`mean`,`average`,`median`,`q1`,`q3`,`min`,`max`]),hRe=$({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}),gRe={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},J4=[`cornerRadius`,`cornerRadiusTopLeft`,`cornerRadiusTopRight`,`cornerRadiusBottomLeft`,`cornerRadiusBottomRight`],_Re=` – `,vRe=`Autosize "fit" only works for single views and layered views.`,yRe=`Scale bindings are currently only supported for scales with unbinned, continuous domains.`,bRe=`Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc`,xRe=`Legend bindings are only supported for selections over an individual field or encoding channel.`,SRe=`The same selection must be used to override scale domains in a layered view.`,CRe=`Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.`,wRe=`Multiple timer selections in one unit spec are not supported. Ignoring all but the first.`,Y4=`Animation involving facet, layer, or concat is currently unsupported.`,TRe=`Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).`,ERe=`Attempt to add the same child twice.`,DRe=`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.`,ORe=`Arc marks uses theta channel rather than angle, replacing angle with theta.`,kRe=`Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.`,X4=`Domains that should be unioned has conflicting sort properties. Sort will be set to true.`,ARe=`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.`,jRe=`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.`,MRe=`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.`,Z4=wh(2),Q4=Z4,$4=[`january`,`february`,`march`,`april`,`may`,`june`,`july`,`august`,`september`,`october`,`november`,`december`],NRe=$4.map(e=>e.substr(0,3)),e3=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`],PRe=e3.map(e=>e.substr(0,3)),t3={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},n3=$(t3),FRe={"year-month":`%b %Y `,"year-month-date":`%b %d, %Y `},IRe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},r3={quantitative:`quantitative`,ordinal:`ordinal`,temporal:`temporal`,nominal:`nominal`,geojson:`geojson`},i3=r3.quantitative,a3=r3.ordinal,o3=r3.temporal,s3=r3.nominal,c3=r3.geojson,l3={LINEAR:`linear`,LOG:`log`,POW:`pow`,SQRT:`sqrt`,TIME:`time`,UTC:`utc`,POINT:`point`,BAND:`band`},u3={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`},LRe={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},d3=new Set([`linear`,`log`,`pow`,`sqrt`,`symlog`]),f3=new Set([...d3,`time`,`utc`]),p3=new Set([`quantile`,`quantize`,`threshold`]),RRe=new Set([...f3,...p3,`sequential`,`identity`]),zRe=new Set([`ordinal`,`bin-ordinal`,`point`,`band`]),BRe={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5},{type:VRe,domain:HRe,range:URe,rangeMax:WRe,rangeMin:GRe,scheme:KRe,...qRe}={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},JRe=$(qRe),m3={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`},h3=m3.arc,g3=m3.area,_3=m3.bar,YRe=m3.image,v3=m3.line,y3=m3.point,XRe=m3.rect,b3=m3.rule,x3=m3.text,S3=m3.tick,ZRe=m3.trail,C3=m3.circle,w3=m3.square,T3=m3.geoshape,QRe=new Set($(m3)),$Re=[`stroke`,`strokeWidth`,`strokeDash`,`strokeDashOffset`,`strokeOpacity`,`strokeJoin`,`strokeMiterLimit`],eze=[`fill`,`fillOpacity`],tze=[...$Re,...eze],E3=$({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),D3=[`binSpacing`,`continuousBandSize`,`discreteBandSize`,`minBandSize`],nze={area:[`line`,`point`],bar:D3,rect:D3,line:[`point`],tick:[`bandSize`,`thickness`,...D3]},rze={color:`#4c78a8`,invalid:`break-paths-show-path-domains`,timeUnitBandSize:1},O3=$({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}),ize={horizontal:[`cornerRadiusTopRight`,`cornerRadiusBottomRight`],vertical:[`cornerRadiusTopLeft`,`cornerRadiusTopRight`]},k3={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},aze={...k3,binSpacing:1},oze={...k3,thickness:1},A3=`min`,sze={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1},j3=(e,t)=>{switch(t.fieldTitle){case`plain`:return e.field;case`functional`:return dje(e);default:return uje(e,t)}},M3=j3,N3={compatible:!0},P3={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`}},F3=[`domain`,`grid`,`labels`,`ticks`,`title`],cze={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`},I3={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},lze={...I3,style:1,labelExpr:1,encoding:1},L3=$({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}),R3=class{name;run;constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return a0(e)?jAe(e.mark)===this.name:!1}},z3=`boxplot`,uze=[`box`,`median`,`outliers`,`rule`,`ticks`],dze=new R3(z3,Fje),B3=`errorbar`,fze=[`ticks`,`rule`],pze=new R3(B3,Rje),V3=`errorband`,mze=[`band`,`borders`],hze=new R3(V3,Kje),H3={},p0(z3,Fje,uze),p0(B3,Rje,fze),p0(V3,Kje,mze),gze=[`gradientHorizontalMaxLength`,`gradientHorizontalMinLength`,`gradientVerticalMaxLength`,`gradientVerticalMinLength`,`unselectedOpacity`],U3={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`},W3={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`},_ze=$(U3),vze=$(W3),G3=$({header:1,headerRow:1,headerColumn:1,headerFacet:1}),K3=[`size`,`shape`,`fill`,`stroke`,`strokeDash`,`strokeWidth`,`opacity`],yze={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},bze={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},q3=`_vgsid_`,xze={point:{on:`click`,fields:[q3],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`}},J3=20,Sze=$({align:1,bounds:1,center:1,columns:1,spacing:1}),Y3=20,Cze={background:`white`,padding:5,timeFormat:`%b %d, %Y`,countTitle:`Count of Records`,view:{continuousWidth:300,continuousHeight:300,step:Y3},mark:rze,arc:{},area:{},bar:aze,circle:{},geoshape:{},image:{},line:{},point:{},rect:k3,rule:{color:`black`},square:{},text:{color:`black`},tick:oze,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:BRe,projection:{},legend:yze,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:xze,style:{},title:{},facet:{spacing:J3},concat:{spacing:J3},normalizedNumberFormat:`.0%`},X3=[`#4c78a8`,`#f58518`,`#e45756`,`#72b7b2`,`#54a24b`,`#eeca3b`,`#b279a2`,`#ff9da6`,`#9d755d`,`#bab0ac`],Z3={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Q3={blue:X3[0],orange:X3[1],red:X3[2],teal:X3[3],green:X3[4],yellow:X3[5],purple:X3[6],pink:X3[7],brown:X3[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`},wze=[...O3,...L3,...G3,`background`,`padding`,`legend`,`lineBreak`,`scale`,`style`,`title`,`view`],Tze=new Set([`view`,...QRe]),Eze=`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`.split(`.`),Dze={view:[`continuousWidth`,`continuousHeight`,`discreteWidth`,`discreteHeight`,`step`],...nze},$3=class{map(e,t){return A1(e)?this.mapFacet(e,t):cMe(e)?this.mapRepeat(e,t):y0(e)?this.mapHConcat(e,t):v0(e)?this.mapVConcat(e,t):_0(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(w0(e))return this.mapLayer(e,t);if(a0(e))return this.mapUnit(e,t);throw Error(T$(e))}mapLayer(e,t){return{...e,layer:e.layer.map(e=>this.mapLayerOrUnit(e,t))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map(e=>this.map(e,t))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map(e=>this.map(e,t))}}mapConcat(e,t){let{concat:n,...r}=e;return{...r,concat:n.map(e=>this.map(e,t))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}},Oze={zero:1,center:1,normalize:1},kze=new Set([h3,_3,g3,b3,y3,C3,w3,v3,x3,S3]),Aze=new Set([_3,g3,h3]),e6=.7,jze=class{name=`path-overlay`;hasMatchingType(e,t){if(a0(e)){let{mark:n,encoding:r}=e,i=m1(n)?n:{type:n};switch(i.type){case`line`:case`rule`:case`trail`:return!!E0(i,t[i.type],r);case`area`:return!!E0(i,t[i.type],r)||!!xMe(i,t[i.type])}}return!1}run(e,t,n){let{config:r}=t,{params:i,projection:a,mark:o,name:s,encoding:c,...l}=e,u=s0(c,r),d=m1(o)?o:{type:o},f=E0(d,r[d.type],u),p=d.type===`area`&&xMe(d,r[d.type]),m=[{name:s,...i?{params:i}:{},mark:yMe({...d.type===`area`&&_$(`opacity`,d,r)==null&&_$(`fillOpacity`,d,r)==null?{opacity:e6}:{},...d}),encoding:qZ(u,[`shape`])}],h=pMe(mMe(d,u,r),u),g=u;if(h){let{fieldChannel:e,offset:t}=h;g={...u,[e]:{...u[e],...t?{stack:t}:{}}}}return g=qZ(g,[`y2`,`x2`]),p&&m.push({...a?{projection:a}:{},mark:{type:`line`,...KZ(d,[`clip`,`interpolate`,`tension`,`tooltip`]),...p},encoding:g}),f&&m.push({...a?{projection:a}:{},mark:{type:`point`,opacity:1,filled:!0,...KZ(d,[`clip`,`tooltip`]),...f},encoding:g}),n({...l,layer:m},{...t,config:bMe(r)})}},Mze=class{name=`RuleForRangedLine`;hasMatchingType(e){if(a0(e)){let{encoding:t,mark:n}=e;if(n===`line`||m1(n)&&n.type===`line`)for(let e of PLe){let n=t[PQ(e)];if(t[e]&&(Z(n)&&!QQ(n.bin)||L1(n)))return!0}}return!1}run(e,t,n){let{encoding:r,mark:i}=e;return X(bke(!!r.x2,!!r.y2)),n({...e,mark:Eh(i)?{...i,type:`rule`}:`rule`},t)}},Nze=class extends $3{nonFacetUnitNormalizers=[dze,pze,hze,new jze,new Mze];map(e,t){if(a0(e)){let n=o0(e.encoding,X2),r=o0(e.encoding,Z2),i=o0(e.encoding,Q2);if(n||r||i)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){let{parentEncoding:n,parentProjection:r}=t,i=D0(e.encoding,t.repeater),a={...e,...e.name?{name:[t.repeaterPrefix,e.name].filter(e=>e).join(`_`)}:{},...i?{encoding:i}:{}};if(n||r)return this.mapUnitWithParentEncodingOrProjection(a,t);let o=this.mapLayerOrUnit.bind(this);for(let e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(a,t.config))return e.run(a,t,o);return a}mapRepeat(e,t){return lMe(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){let{repeat:n,spec:r,...i}=e,{row:a,column:o,layer:s}=n,{repeater:c={},repeaterPrefix:l=``}=t;return a||o?this.mapRepeat({...e,repeat:{...a?{row:a}:{},...o?{column:o}:{}},spec:{repeat:{layer:s},spec:r}},t):{...i,layer:s.map(e=>{let n={...c,layer:e},i=`${(r.name?`${r.name}_`:``)+l}child__layer_${cQ(e)}`,a=this.mapLayerOrUnit(r,{...t,repeater:n,repeaterPrefix:i});return a.name=i,a})}}mapNonLayerRepeat(e,t){let{repeat:n,spec:r,data:i,...a}=e;!H(n)&&e.columns&&(e=qZ(e,[`columns`]),X(M$(`repeat`)));let o=[],{repeater:s={},repeaterPrefix:c=``}=t,l=!H(n)&&n.row||[s?s.row:null],u=!H(n)&&n.column||[s?s.column:null],d=H(n)&&n||[s?s.repeat:null];for(let e of d)for(let i of l)for(let a of u){let l={repeat:e,row:i,column:a,layer:s.layer},u=`${(r.name?`${r.name}_`:``)+c}child__${H(n)?`${cQ(e)}`:(n.row?`row_${cQ(i)}`:``)+(n.column?`column_${cQ(a)}`:``)}`,d=this.map(r,{...t,repeater:l,repeaterPrefix:u});d.name=u,o.push(qZ(d,[`data`]))}let f=H(n)?e.columns:n.column?n.column.length:1;return{data:r.data??i,align:`all`,...a,columns:f,concat:o}}mapFacet(e,t){let{facet:n}=e;return O1(n)&&e.columns&&(e=qZ(e,[`columns`]),X(M$(`facet`))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){let{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:a,config:o}=t,s=OMe({parentProjection:a,projection:r}),c=DMe({parentEncoding:i,encoding:D0(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...c?{encoding:c}:{}},{config:o})}mapFacetedUnit(e,t){let{row:n,column:r,facet:i,...a}=e.encoding,{mark:o,width:s,projection:c,height:l,view:u,params:d,encoding:f,...p}=e,{facetMapping:m,layout:h}=this.getFacetMappingAndLayout({row:n,column:r,facet:i},t),g=D0(a,t.repeater);return this.mapFacet({...p,...h,facet:m,spec:{...s?{width:s}:{},...l?{height:l}:{},...u?{view:u}:{},...c?{projection:c}:{},mark:o,encoding:g,...d?{params:d}:{}}},t)}getFacetMappingAndLayout(e,t){let{row:n,column:r,facet:i}=e;if(n||r){i&&X(vke([...n?[X2]:[],...r?[Z2]:[]]));let t={},a={};for(let n of[X2,Z2]){let r=e[n];if(r){let{align:e,center:i,spacing:o,columns:s,...c}=r;t[n]=c;for(let e of[`align`,`center`,`spacing`])r[e]!==void 0&&(a[e]??={},a[e][n]=r[e])}}return{facetMapping:t,layout:a}}else{let{align:e,center:n,spacing:r,columns:a,...o}=i;return{facetMapping:SMe(o,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...r?{spacing:r}:{},...a?{columns:a}:{}}}}}mapLayer(e,{parentEncoding:t,parentProjection:n,...r}){let{encoding:i,projection:a,...o}=e,s={...r,parentEncoding:DMe({parentEncoding:t,encoding:i,layer:!0}),parentProjection:OMe({parentProjection:n,projection:a})};return super.mapLayer({...o,...e.name?{name:[s.repeaterPrefix,e.name].filter(e=>e).join(`_`)}:{}},s)}},Pze=class extends $3{map(e,t){return t.emptySelections??={},t.selectionPredicates??={},e=ZMe(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if(e=ZMe(e,t),e.encoding){let n={};for(let[r,i]of q2(e.encoding))n[r]=QMe(i,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){let{selection:n,...r}=e;return n?{...r,params:q2(n).map(([e,n])=>{let{init:r,bind:i,empty:a,...o}=n;o.type===`single`?(o.type=`point`,o.toggle=!1):o.type===`multi`&&(o.type=`point`),t.emptySelections[e]=a!==`none`;for(let n of K2(t.selectionPredicates[e]??{}))n.empty=a!==`none`;return{name:e,value:r,select:o,bind:i}})}:e}},t6=class extends $3{map(e,t){let n=t.selections??[];if(e.params&&!a0(e)){let t=[];for(let r of e.params)g0(r)?n.push(r):t.push(r);e.params=t}return t.selections=n,super.map(e,t)}mapUnit(e,t){let n=t.selections;if(!n||!n.length)return e;let r=(t.path??[]).concat(e.name),i=[];for(let t of n)if(!t.views||!t.views.length)i.push(t);else for(let n of t.views)(xg(n)&&(n===e.name||r.includes(n))||H(n)&&n.map(e=>r.indexOf(e)).every((e,t,n)=>e!==-1&&(t===0||e>n[t-1])))&&i.push(t);return i.length&&(e.params=i),e}};for(let e of[`mapFacet`,`mapRepeat`,`mapHConcat`,`mapVConcat`,`mapLayer`]){let t=t6.prototype[e];t6.prototype[e]=function(e,n){return t.call(this,e,eNe(e,n))}}Fze=new Nze,Ize=new Pze,Lze=new t6,Rze=[`background`,`padding`],n6=class e{explicit;implicit;constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new e(G2(this.explicit),G2(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return bQ(this.explicit[e],this.implicit[e])}getWithExplicit(e){return this.explicit[e]===void 0?this.implicit[e]===void 0?{explicit:!1,value:void 0}:{explicit:!1,value:this.implicit[e]}:{explicit:!0,value:this.explicit[e]}}setWithExplicit(e,{value:t,explicit:n}){t!==void 0&&this.set(e,t,n)}set(e,t,n){return delete this[n?`implicit`:`explicit`][e],this[n?`explicit`:`implicit`][e]=t,this}copyKeyFromSplit(e,{explicit:t,implicit:n}){t[e]===void 0?n[e]!==void 0&&this.set(e,n[e],!1):this.set(e,t[e],!0)}copyKeyFromObject(e,t){t[e]!==void 0&&this.set(e,t[e],!0)}copyAll(e){for(let t of $(e.combine())){let n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}},zze=class extends n6{explicit;implicit;parseNothing;constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){let e=super.clone();return e.parseNothing=this.parseNothing,e}},(function(e){e[e.Raw=0]=`Raw`,e[e.Main=1]=`Main`,e[e.Row=2]=`Row`,e[e.Column=3]=`Column`,e[e.Lookup=4]=`Lookup`,e[e.PreFilterInvalid=5]=`PreFilterInvalid`,e[e.PostFilterInvalid=6]=`PostFilterInvalid`})(r6||={}),i6=class{debugName;_children=[];_parent=null;_hash;constructor(e,t){this.debugName=t,e&&(this.parent=e)}clone(){throw 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)){X(ERe);return}t===void 0?this._children.push(e):this._children.splice(t,0,e)}removeChild(e){let t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(let t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){let t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){let e=this._parent,t=e.parent;for(let t of this._children)t.parent=e;this._children=[],e.removeChild(this);let n=e.parent.removeChild(e);this._parent=t,t.addChild(this,n),e.parent=this}},a6=class extends i6{type;refCounts;_source;_name;clone(){let 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,n,r){super(e,t),this.type=n,this.refCounts=r,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 ${xQ()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}},o6=class e extends i6{timeUnits;clone(){return new e(null,G2(this.timeUnits))}constructor(e,t){super(e),this.timeUnits=t}static makeFromEncoding(t,n){let r=n.reduceFieldDef((e,t,r)=>{let{field:i,timeUnit:a}=t;if(a){let o;if(q$(a)){if(N2(n)){let{mark:e,markDef:r,config:s}=n,c=M1({fieldDef:t,markDef:r,config:s});(p1(e)||c)&&(o={timeUnit:X$(a),field:i})}}else o={as:Q(t,{forAs:!0}),field:i,timeUnit:a};if(N2(n)){let{mark:e,markDef:i,config:a}=n,s=M1({fieldDef:t,markDef:i,config:a});p1(e)&&BQ(r)&&s!==.5&&(o.rectBandPosition=s)}o&&(e[JZ(o)]=o)}return e},{});return aQ(r)?null:new e(t,r)}static makeFromTransform(t,n){let{timeUnit:r,...i}={...n},a=X$(r),o={...i,timeUnit:a};return new e(t,{[JZ(o)]:o})}merge(e){this.timeUnits={...this.timeUnits};for(let t in e.timeUnits)this.timeUnits[t]||(this.timeUnits[t]=e.timeUnits[t]);for(let t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){let t={};for(let[n,r]of q2(this.timeUnits)){let i=z0(r)?r.as:`${r.field}_end`;e.has(i)||(t[n]=r)}this.timeUnits=t}producedFields(){return new Set(K2(this.timeUnits).map(e=>z0(e)?e.as:mNe(e.field)))}dependentFields(){return new Set(K2(this.timeUnits).map(e=>e.field))}hash(){return`TimeUnit ${JZ(this.timeUnits)}`}assemble(){let e=[];for(let t of K2(this.timeUnits)){let{rectBandPosition:n}=t,r=X$(t.timeUnit);if(z0(t)){let{field:i,as:a}=t,{unit:o,utc:s,...c}=r,l=[a,`${a}_end`];e.push({field:gQ(i),type:`timeunit`,...o?{units:Y$(o)}:{},...s?{timezone:`utc`}:{},...c,as:l}),e.push(...gNe(l,n,r))}else if(t){let{field:i}=t,a=hQ(i),o=hNe({timeUnit:r,field:a}),s=mNe(a);e.push({type:`formula`,expr:o,as:s}),e.push(...gNe([a,s],n,r))}}return e}},s6=`offsetted_rect_start`,c6=`offsetted_rect_end`,l6=`_tuple_fields`,Bze=class{hasChannel;hasField;hasSelectionId;timeUnit;items;constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}},Vze={defined:()=>!0,parse:(e,t,n)=>{let r=t.name,i=t.project??=new Bze,a={},o={},s=new Set,c=(e,t)=>{let n=t===`visual`?e.channel:e.field,i=cQ(`${r}_${n}`);for(let e=1;s.has(i);e++)i=cQ(`${r}_${n}_${e}`);return s.add(i),{[t]:i}},l=t.type,u=e.config.selection[l],d=n.value===void 0?null:tg(n.value),{fields:f,encodings:p}=Eh(n.select)?n.select:{};if(!f&&!p&&d){for(let e of d)if(Eh(e))for(let t of $(e))UOe(t)?(p||=[]).push(t):l===`interval`?(X(CRe),p=u.encodings):(f??=[]).push(t)}!f&&!p&&(p=u.encodings,`fields`in u&&(f=u.fields));for(let t of p??[]){let n=e.fieldDef(t);if(n){let r=n.field;if(n.aggregate){X($Oe(t,n.aggregate));continue}else if(!r){X(A$(t));continue}if(n.timeUnit&&!q$(n.timeUnit)){r=e.vgField(t);let i={timeUnit:n.timeUnit,as:r,field:n.field};o[JZ(i)]=i}if(!a[r]){let o=l===`interval`&&WQ(t)&&c1(e.getScaleComponent(t).get(`type`))?`R`:n.bin?`R-RE`:`E`,s={field:r,channel:t,type:o,index:i.items.length};s.signals={...c(s,`data`),...c(s,`visual`)},i.items.push(a[r]=s),i.hasField[r]=a[r],i.hasSelectionId=i.hasSelectionId||r===q3,AQ(t)?(s.geoChannel=t,s.channel=kQ(t),i.hasChannel[s.channel]=a[r]):i.hasChannel[t]=a[r]}}else X(A$(t))}for(let e of f??[]){if(i.hasField[e])continue;let t={type:`E`,field:e,index:i.items.length};t.signals={...c(t,`data`)},i.items.push(t),i.hasField[e]=t,i.hasSelectionId=i.hasSelectionId||e===q3}d&&(t.init=d.map(e=>i.items.map(t=>Eh(e)?e[t.geoChannel||t.channel]===void 0?e[t.field]:e[t.geoChannel||t.channel]:e))),aQ(o)||(i.timeUnit=new o6(null,o))},signals:(e,t,n)=>{let r=t.name+l6;return n.filter(e=>e.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(vNe)})}},u6=`_curr`,d6=`anim_value`,f6=`anim_clock`,p6=`eased_anim_clock`,m6=`min_extent`,h6=`max_range_extent`,g6=`last_tick_at`,_6=`is_playing`,Hze=1/60*1e3,Uze=(e,t)=>[{name:p6,update:f6},{name:`${e}_domain`,init:`domain('${t}')`},{name:m6,init:`extent(${e}_domain)[0]`},{name:h6,init:`extent(range('${t}'))[1]`},{name:d6,update:`invert('${t}', ${p6})`}],Wze={defined:e=>e.type===`point`,topLevelSignals:(e,t,n)=>(i2(t)&&(n=n.concat([{name:f6,init:`0`,on:[{events:{type:`timer`,throttle:Hze},update:`${_6} ? (${f6} + (now() - ${g6}) > ${h6} ? 0 : ${f6} + (now() - ${g6})) : ${f6}`}]},{name:g6,init:`now()`,on:[{events:[{signal:f6},{signal:_6}],update:`now()`}]},{name:_6,init:`true`}])),n),signals:(e,t,n)=>{let r=t.name,i=r+l6,a=t.project,o=`(item().isVoronoi ? datum.datum : datum)`,s=K2(e.component.selection??{}).reduce((e,t)=>t.type===`interval`?e.concat(t.name+y6):e,[]).map(e=>`indexof(item().mark.name, '${e}') < 0`).join(` && `),c=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${s?` && ${s}`:``}`,l=`unit: ${n2(e)}, `;if(t.project.hasSelectionId)l+=`${q3}: ${o}[${W(q3)}]`;else if(i2(t))l+=`fields: ${i}, values: [${d6} ? ${d6} : ${m6}]`;else{let t=a.items.map(t=>e.fieldDef(t.channel)?.bin?`[${o}[${W(e.vgField(t.channel,{}))}], ${o}[${W(e.vgField(t.channel,{binSuffix:`end`}))}]]`:`${o}[${W(t.field)}]`).join(`, `);l+=`fields: ${i}, values: [${t}]`}if(i2(t))return n.concat(Uze(t.name,e.scaleName(p4)),[{name:r+P6,on:[{events:[{signal:p6},{signal:d6}],update:`{${l}}`,force:!0}]}]);{let e=t.events;return n.concat([{name:r+P6,on:e?[{events:e,update:`${c} ? {${l}} : null`,force:!0}]:[]}])}}},v6={defined:e=>e.type===`interval`&&e.resolve===`global`&&e.bind&&e.bind===`scales`,parse:(e,t)=>{let n=t.scales=[];for(let r of t.project.items){let i=r.channel;if(!WQ(i))continue;let a=e.getScaleComponent(i),o=a?a.get(`type`):void 0;if(o==`sequential`&&X(bRe),!a||!c1(o)){X(yRe);continue}a.set(`selectionExtent`,{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{let r=t.scales.filter(e=>n.filter(t=>t.name===e.signals.data).length===0);if(!e.parent||U0(e)||r.length===0)return n;let i=n.find(e=>e.name===t.name),a=i.update;if(a.includes(F6))i.update=`{${r.map(e=>`${W(gQ(e.field))}: ${e.signals.data}`).join(`, `)}}`;else{for(let e of r){let t=`${W(gQ(e.field))}: ${e.signals.data}`;a.includes(t)||(a=`${a.substring(0,a.length-1)}, ${t}}`)}i.update=a}return n.concat(r.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!U0(e))for(let e of t.scales){let t=n.find(t=>t.name===e.signals.data);t.push=`outer`,delete t.value,delete t.update}return n}},y6=`_brush`,b6=`_scale_trigger`,x6=`geo_interval_init_tick`,S6=`_init`,Gze=`_center`,Kze={defined:e=>e.type===`interval`,parse:(e,t,n)=>{if(e.hasProjection){let e={...Eh(n.select)?n.select:{}};e.fields=[q3],e.encodings||=n.value?$(n.value):[u4,l4],n.select={type:`interval`,...e}}if(t.translate&&!v6.defined(t)){let e=`!event.item || event.item.mark.name !== ${W(t.name+y6)}`;for(let n of t.events){if(!n.between){X(`${n} is not an ordered event stream for interval selections.`);continue}let t=tg(n.between[0].filter??=[]);t.includes(e)||t.push(e)}}},signals:(e,t,n)=>{let r=t.name,i=r+P6,a=K2(t.project.hasChannel).filter(e=>e.channel===$2||e.channel===e4),o=t.init?t.init[0]:null;if(n.push(...a.reduce((n,r)=>n.concat(ENe(e,t,r,o?.[r.index])),[])),e.hasProjection){let s=W(e.projectionName()),c=e.projectionName()+Gze,{x:l,y:u}=t.project.hasChannel,d=l?.signals.visual,f=u?.signals.visual,p=l?o?.[l.index]:`${c}[0]`,m=u?o?.[u.index]:`${c}[1]`,h=t=>e.getSizeSignalRef(t).signal,g=`[[${d?`${d}[0]`:`0`}, ${f?`${f}[0]`:`0`}],[${d?`${d}[1]`:h(`width`)}, ${f?`${f}[1]`:h(`height`)}]]`;o&&(n.unshift({name:r+S6,init:`[scale(${s}, [${l?p[0]:p}, ${u?m[0]:m}]), scale(${s}, [${l?p[1]:p}, ${u?m[1]:m}])]`}),(!l||!u)&&(n.find(e=>e.name===c)||n.unshift({name:c,update:`invert(${s}, [${h(`width`)}/2, ${h(`height`)}/2])`})));let _=`vlSelectionTuples(${`intersect(${g}, {markname: ${W(e.getName(`marks`))}}, unit.mark)`}, ${`{unit: ${n2(e)}}`})`,v=a.map(e=>e.signals.visual);return n.concat({name:i,on:[{events:[...v.length?[{signal:v.join(` || `)}]:[],...o?[{signal:x6}]:[]],update:_}]})}else{if(!v6.defined(t)){let t=r+b6,i=a.map(t=>{let n=t.channel,{data:r,visual:i}=t.signals,a=W(e.scaleName(n)),o=c1(e.getScaleComponent(n).get(`type`))?`+`:``;return`(!isArray(${r}) || (${o}invert(${a}, ${i})[0] === ${o}${r}[0] && ${o}invert(${a}, ${i})[1] === ${o}${r}[1]))`});i.length&&n.push({name:t,value:{},on:[{events:a.map(t=>({scale:e.scaleName(t.channel)})),update:`${i.join(` && `)} ? ${t} : {}`}]})}let s=a.map(e=>e.signals.data),c=`unit: ${n2(e)}, fields: ${r+l6}, values`;return n.concat({name:i,...o?{init:`{${c}: ${B0(o)}}`}:{},...s.length?{on:[{events:[{signal:s.join(` || `)}],update:`${s.join(` && `)} ? {${c}: [${s}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(N2(e)&&e.hasProjection&&t.init&&(n.filter(e=>e.name===x6).length||n.unshift({name:x6,value:null,on:[{events:`timer{1}`,update:`${x6} === null ? {} : ${x6}`}]})),n),marks:(e,t,n)=>{let r=t.name,{x:i,y:a}=t.project.hasChannel,o=i?.signals.visual,s=a?.signals.visual,c=`data(${W(t.name+N6)})`;if(v6.defined(t)||!i&&!a)return n;let l={x:i===void 0?{value:0}:{signal:`${o}[0]`},y:a===void 0?{value:0}:{signal:`${s}[0]`},x2:i===void 0?{field:{group:`width`}}:{signal:`${o}[1]`},y2:a===void 0?{field:{group:`height`}}:{signal:`${s}[1]`}};if(t.resolve===`global`)for(let t of $(l))l[t]=[{test:`${c}.length && ${c}[0].unit === ${n2(e)}`,...l[t]},{value:0}];let{fill:u,fillOpacity:d,cursor:f,...p}=t.mark,m=$(p).reduce((e,t)=>(e[t]=[{test:[i!==void 0&&`${o}[0] !== ${o}[1]`,a!==void 0&&`${s}[0] !== ${s}[1]`].filter(e=>e).join(` && `),value:p[t]},{value:null}],e),{}),h=f??(t.translate?`move`:null);return[{name:`${r+y6}_bg`,type:`rect`,clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:d}},update:l}},...n,{name:r+y6,type:`rect`,clip:!0,encode:{enter:{...h?{cursor:{value:h}}:{},fill:{value:`transparent`}},update:{...l,...m}}}]}},qze={left:`x`,center:`xc`,right:`x2`},Jze={top:`y`,middle:`yc`,bottom:`y2`},Yze=new Set([`aria`,`width`,`height`]),C6=`voronoi`,w6={defined:e=>e.type===`point`&&e.nearest,parse:(e,t)=>{if(t.events)for(let n of t.events)n.markname=e.getName(C6)},marks:(e,t,n)=>{let{x:r,y:i}=t.project.hasChannel,a=e.mark;if(f1(a))return X(eke(a)),n;let o={name:e.getName(C6),type:`path`,interactive:!0,aria:!1,from:{data:e.getName(`marks`)},encode:{update:{fill:{value:`transparent`},strokeWidth:{value:.35},stroke:{value:`transparent`},isVoronoi:{value:!0},...DNe(e,{reactiveGeom:!0})}},transform:[{type:`voronoi`,x:{expr:r||!i?`datum.datum.x || 0`:`0`},y:{expr:i||!r?`datum.datum.y || 0`:`0`},size:[e.getSizeSignalRef(`width`),e.getSizeSignalRef(`height`)]}]},s=0,c=!1;return n.forEach((t,n)=>{let r=t.name??``;r===e.component.mark[0].name?s=n:r.includes(C6)&&(c=!0)}),c||n.splice(s+1,0,o),n}},T6={defined:e=>e.type===`point`&&e.resolve===`global`&&e.bind&&e.bind!==`scales`&&!m0(e.bind),parse:(e,t,n)=>ePe(t,n),topLevelSignals:(e,t,n)=>{let r=t.name,i=t.project,a=t.bind,o=t.init?.[0],s=w6.defined(t)?`(item().isVoronoi ? datum.datum : datum)`:`datum`;return i.items.forEach((e,i)=>{let c=cQ(`${r}_${e.field}`);n.filter(e=>e.name===c).length||n.unshift({name:c,...o?{init:B0(o[i])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${W(e.field)}] : null`}]:[],bind:a[e.field]??a[e.channel]??a})}),n},signals:(e,t,n)=>{let r=t.name,i=t.project,a=n.find(e=>e.name===r+P6),o=r+l6,s=i.items.map(e=>cQ(`${r}_${e.field}`)),c=s.map(e=>`${e} !== null`).join(` && `);return s.length&&(a.update=`${c} ? {fields: ${o}, values: [${s.join(`, `)}]} : null`),delete a.value,delete a.on,n}},E6=`_toggle`,D6={defined:e=>e.type===`point`&&!i2(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+E6,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{let n=t.name+P6,r=t.name+E6;return`${r} ? null : ${n}, ${t.resolve===`global`?`${r} ? null : true, `:`${r} ? null : {unit: ${n2(e)}}, `}${r} ? ${n} : null`}},Xze={defined:e=>e.clear!==void 0&&e.clear!==!1&&!i2(e),parse:(e,t)=>{t.clear&&=xg(t.clear)?ZG(t.clear,`view`):t.clear},topLevelSignals:(e,t,n)=>{if(T6.defined(t))for(let e of t.project.items){let r=n.findIndex(n=>n.name===cQ(`${t.name}_${e.field}`));r!==-1&&n[r].on.push({events:t.clear,update:`null`})}return n},signals:(e,t,n)=>{function r(e,r){e!==-1&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if(t.type===`interval`)for(let e of t.project.items){let t=n.findIndex(t=>t.name===e.signals.visual);r(t,`[0, 0]`),t===-1&&r(n.findIndex(t=>t.name===e.signals.data),`null`)}else{let e=n.findIndex(e=>e.name===t.name+P6);r(e,`null`),D6.defined(t)&&(e=n.findIndex(e=>e.name===t.name+E6),r(e,`false`))}return n}},O6={defined:e=>{let t=e.resolve===`global`&&e.bind&&m0(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==q3;return t&&!n&&X(xRe),t&&n},parse:(e,t,n)=>{let r=G2(n);if(r.select=xg(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},ePe(t,r),Eh(n.select)&&(n.select.on||n.select.clear)){let e=`event.item && indexof(event.item.mark.role, "legend") < 0`;for(let n of t.events)n.filter=tg(n.filter??[]),n.filter.includes(e)||n.filter.push(e)}let i=h0(t.bind)?t.bind.legend:`click`;t.bind={legend:{merge:xg(i)?ZG(i,`view`):tg(i)}}},topLevelSignals:(e,t,n)=>{let r=t.name,i=h0(t.bind)&&t.bind.legend,a=e=>t=>{let n=G2(t);return n.markname=e,n};for(let e of t.project.items){if(!e.hasLegend)continue;let o=`${cQ(e.field)}_legend`,s=`${r}_${o}`;if(n.filter(e=>e.name===s).length===0){let e=i.merge.map(a(`${o}_symbols`)).concat(i.merge.map(a(`${o}_labels`))).concat(i.merge.map(a(`${o}_entries`)));n.unshift({name:s,...t.init?{}:{value:null},on:[{events:e,update:`isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value`,force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]})}}return n},signals:(e,t,n)=>{let r=t.name,i=t.project,a=n.find(e=>e.name===r+P6),o=r+l6,s=i.items.filter(e=>e.hasLegend).map(e=>cQ(`${r}_${cQ(e.field)}_legend`)),c=`${s.map(e=>`${e} !== null`).join(` && `)} ? {fields: ${o}, values: [${s.join(`, `)}]} : null`;t.events&&s.length>0?a.on.push({events:s.map(e=>({signal:e})),update:c}):s.length>0&&(a.update=c,delete a.value,delete a.on);let l=n.find(e=>e.name===r+E6),u=h0(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push({...l.on[0],events:u}):l.on[0].events=u),n}},k6=`_translate_anchor`,A6=`_translate_delta`,Zze={defined:e=>e.type===`interval`&&e.translate,signals:(e,t,n)=>{let r=t.name,i=v6.defined(t),a=r+k6,{x:o,y:s}=t.project.hasChannel,c=ZG(t.translate,`scope`);return i||(c=c.map(e=>(e.between[0].markname=r+y6,e))),n.push({name:a,value:{},on:[{events:c.map(e=>e.between[0]),update:`{x: x(unit), y: y(unit)${o===void 0?``:`, extent_x: ${i?H0(e,$2):`slice(${o.signals.visual})`}`}${s===void 0?``:`, extent_y: ${i?H0(e,e4):`slice(${s.signals.visual})`}`}}`}]},{name:r+A6,value:{},on:[{events:c,update:`{x: ${a}.x - x(unit), y: ${a}.y - y(unit)}`}]}),o!==void 0&&ZNe(e,t,o,`width`,n),s!==void 0&&ZNe(e,t,s,`height`,n),n}},j6=`_zoom_anchor`,M6=`_zoom_delta`,Qze={defined:e=>e.type===`interval`&&e.zoom,signals:(e,t,n)=>{let r=t.name,i=v6.defined(t),a=r+M6,{x:o,y:s}=t.project.hasChannel,c=W(e.scaleName($2)),l=W(e.scaleName(e4)),u=ZG(t.zoom,`scope`);return i||(u=u.map(e=>(e.markname=r+y6,e))),n.push({name:r+j6,on:[{events:u,update:i?`{${[c?`x: invert(${c}, x(unit))`:``,l?`y: invert(${l}, y(unit))`:``].filter(e=>e).join(`, `)}}`:`{x: x(unit), y: y(unit)}`}]},{name:a,on:[{events:u,force:!0,update:`pow(1.001, event.deltaY * pow(16, event.deltaMode))`}]}),o!==void 0&&QNe(e,t,o,`width`,n),s!==void 0&&QNe(e,t,s,`height`,n),n}},N6=`_store`,P6=`_tuple`,$ze=`_modify`,F6=`vlSelectionResolve`,I6=[Wze,Kze,Vze,D6,T6,v6,O6,Xze,Zze,Qze,w6],L6=class e extends i6{model;filter;expr;_dependentFields;clone(){return new e(null,this.model,G2(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=o2(this.model,this.filter,this),this._dependentFields=nPe(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:`filter`,expr:this.expr}}hash(){return`Filter ${this.expr}`}},R6={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??pPe(n,e),gridScale:({model:e,channel:t})=>mPe(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||_Pe(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||gPe(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??vPe(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??yPe(t.type,n,Z(t)&&!!t.timeUnit,Z(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{let a=e===`x`?`width`:e===`y`?`height`:void 0,o=a?t.getSizeSignalRef(a):void 0;return n.tickCount??xPe({fieldOrDatumDef:r,scaleType:i,size:o,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??SPe({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;let r=CPe(t,n);if(r!==void 0)return r;let i=t.typedFieldDef(n),a=n===`x`?`x2`:`y2`,o=t.fieldDef(a);return S$(i?[QAe(i)]:[],Z(o)?[QAe(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>wPe(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??TPe(n,t)},z6=class e extends i6{transform;_dependentFields;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this._dependentFields=nPe(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((n,r)=>{if(U1(n)&&YAe(n.sort)){let{field:i,timeUnit:a}=n,o=n.sort,s=o.map((e,t)=>`${gAe({field:i,timeUnit:a,equal:e})} ? ${t} : `).join(``)+o.length;t=new e(t,{calculate:s,as:d2(n,r,{forAs:!0})})}}),t}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 ${JZ(this.transform)}`}},B6=[`row`,`column`],V6=[`header`,`footer`],eBe={column:{start:0,end:1},row:{start:1,end:0}},H6=$({...bze,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),tBe=class extends n6{},U6={symbols:BPe,gradient:VPe,labels:HPe,entries:UPe},W6={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{let{format:r,formatType:i}=t;return VAe(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{let{formatType:r}=e;return HAe(r,t,n)},gradientLength:e=>{let{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??$Pe(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??tFe(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??JPe(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>K1(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(jQ(n)&&l1(t)){if(e===`gradient`)return}else if(e===`symbol`)return;return e},values:({fieldOrDatumDef:e,legend:t})=>qPe(t,e)},G6=class e extends i6{bins;clone(){return new e(null,G2(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(t,n){let r=n.reduceFieldDef((e,t,r)=>{if(V1(t)&&ZQ(t.bin)){let{key:i,binComponent:a}=mFe(t,t.bin,n);e[i]={...a,...e[i],...uFe(n,t,r,n.config)}}return e},{});return aQ(r)?null:new e(t,r)}static makeFromTransform(t,n,r){let{key:i,binComponent:a}=mFe(n,n.bin,r);return new e(t,{[i]:a})}merge(e,t){for(let n of $(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=eQ([...this.bins[n].as,...e.bins[n].as],JZ)):this.bins[n]=e.bins[n];for(let t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(K2(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(K2(this.bins).map(e=>e.field))}hash(){return`Bin ${JZ(this.bins)}`}assemble(){return K2(this.bins).flatMap(e=>{let t=[],[n,...r]=e.as,{extent:i,...a}=e.bin,o={type:`bin`,field:gQ(e.field),as:n,signal:e.signal,...e$(i)?{extent:null}:{extent:i},...e.span?{span:{signal:`span(${e.span})`}}:{},...a};!i&&e.extentSignal&&(t.push({type:`extent`,field:gQ(e.field),signal:e.extentSignal}),o.extent={signal:e.extentSignal}),t.push(o);for(let e of r)for(let r=0;r<2;r++)t.push({type:`formula`,expr:Q({field:n[r]},{expr:`datum`}),as:e[r]});return e.formula&&t.push({type:`formula`,expr:e.formula,as:e.formulaAs}),t})}},K6=class e extends i6{dimensions;measures;clone(){return new e(null,new Set(this.dimensions),G2(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(e=>{e.aggregate&&(r=!0)});let i={},a=new Set;return!r||(n.forEachFieldDef((e,t)=>{let{aggregate:r,field:o}=e;if(r)if(r===`count`)i[`*`]??={},i[`*`].count=new Set([Q(e,{forAs:!0})]);else{if(KQ(r)||qQ(r)){let e=KQ(r)?`argmin`:`argmax`,t=r[e];i[t]??={},i[t][e]=new Set([Q({op:e,field:t},{forAs:!0})])}else i[o]??={},i[o][r]=new Set([Q(e,{forAs:!0})]);WQ(t)&&n.scaleDomain(t)===`unaggregated`&&(i[o]??={},i[o].min=new Set([Q({field:o,aggregate:`min`},{forAs:!0})]),i[o].max=new Set([Q({field:o,aggregate:`max`},{forAs:!0})]))}else hFe(a,t,e,n)}),a.size+$(i).length===0)?null:new e(t,a,i)}static makeFromTransform(t,n){let r=new Set,i={};for(let e of n.aggregate){let{op:t,field:n,as:r}=e;t&&(t===`count`?(i[`*`]??={},i[`*`].count=new Set([r||Q(e,{forAs:!0})])):(i[n]??={},i[n][t]??=new Set,i[n][t].add(r||Q(e,{forAs:!0}))))}for(let e of n.groupby??[])r.add(e);return r.size+$(i).length===0?null:new e(t,r,i)}merge(e){return tQ(this.dimensions,e.dimensions)?(gFe(this.measures,e.measures),!0):(Jke(`different dimensions, cannot merge`),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...$(this.measures)])}producedFields(){let e=new Set;for(let t of $(this.measures))for(let n of $(this.measures[t])){let r=this.measures[t][n];r.size===0?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${JZ({dimensions:this.dimensions,measures:this.measures})}`}assemble(){let e=[],t=[],n=[];for(let r of $(this.measures))for(let i of $(this.measures[r]))for(let a of this.measures[r][i])n.push(a),e.push(i),t.push(r===`*`?null:gQ(r));return{type:`aggregate`,groupby:[...this.dimensions].map(gQ),ops:e,fields:t,as:n}}},q6=class extends i6{model;name;data;column;row;facet;childModel;constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(let e of L4){let n=t.facet[e];if(n){let{bin:r,sort:i}=n;this[e]={name:t.getName(`${e}_domain`),fields:[Q(n),...ZQ(r)?[Q(n,{binSuffix:`end`})]:[]],...D1(i)?{sortField:i}:H(i)?{sortIndexField:d2(n,e)}:{}}}}this.childModel=t.child}hash(){let e=`Facet`;for(let t of L4)this[t]&&(e+=` ${t.charAt(0)}:${JZ(this[t])}`);return e}get fields(){let e=[];for(let t of L4)this[t]?.fields&&e.push(...this[t].fields);return e}dependentFields(){let e=new Set(this.fields);for(let t of L4)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(){let e={};for(let t of V4){let n=this.childModel.component.scales[t];if(n&&!n.merged){let r=n.get(`type`),i=n.get(`range`);if(s1(r)&&s$(i)){let n=A2(j2(this.childModel,t));n?e[t]=n:X(k$(t))}}}return e}assembleRowColumnHeaderData(e,t,n){let r={row:`y`,column:`x`,facet:void 0}[e],i=[],a=[],o=[];r&&n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),a.push(`max`)):(i.push(n[r]),a.push(`distinct`)),o.push(`distinct_${n[r]}`));let{sortField:s,sortIndexField:c}=this[e];if(s){let{op:e=A3,field:t}=s;i.push(t),a.push(e),o.push(Q(s,{forAs:!0}))}else c&&(i.push(c),a.push(`max`),o.push(c));return{name:this[e].name,source:t??this.data,transform:[{type:`aggregate`,groupby:this[e].fields,...i.length?{fields:i,ops:a,as:o}:{}}]}}assembleFacetHeaderData(e){let{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,r=[],i={};for(let e of B6){for(let t of V6){let r=n[e]?.[t]??[];for(let t of r)if(t.axes?.length>0){i[e]=!0;break}}if(i[e]){let n=`length(data("${this.facet.name}"))`,i=e===`row`?t?{signal:`ceil(${n} / ${t})`}:1:t?{signal:`min(${n}, ${t})`}:{signal:n};r.push({name:`${this.facet.name}_${e}`,transform:[{type:`sequence`,start:0,stop:i}]})}}let{row:a,column:o}=i;return(a||o)&&r.unshift(this.assembleRowColumnHeaderData(`facet`,null,e)),r}assemble(){let e=[],t=null,n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:a}=this;if(r&&i&&(n.x||n.y)){t=`cross_${this.column.name}_${this.row.name}`;let r=[].concat(n.x??[],n.y??[]),i=r.map(()=>`distinct`);e.push({name:t,source:this.data,transform:[{type:`aggregate`,groupby:this.fields,fields:r,ops:i}]})}for(let r of[Z2,X2])this[r]&&e.push(this.assembleRowColumnHeaderData(r,t,n));if(a){let t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}},J6=class e extends i6{_parse;clone(){return new e(null,G2(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${JZ(this._parse)}`}static makeExplicit(e,t,n){let r={},i=t.data;return!L0(i)&&i?.format?.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(t,n,r,i){for(let e of $(r)){let t=i.getWithExplicit(e);t.value!==void 0&&(t.explicit||t.value===r[e]||t.value===`derived`||r[e]===`flatten`?delete r[e]:X(N$(e,r[e],t.value)))}for(let e of $(n)){let t=i.get(e);t!==void 0&&(t===n[e]?delete n[e]:X(N$(e,n[e],t)))}let a=new n6(n,r);i.copyAll(a);let o={};for(let e of $(a.combine())){let t=a.get(e);t!==null&&(o[e]=t)}return $(o).length===0||i.parseNothing?null:new e(t,o)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){let e={};for(let t of $(this._parse)){let n=this._parse[t];yQ(t)===1&&(e[t]=n)}return e}producedFields(){return new Set($(this._parse))}dependentFields(){return new Set($(this._parse))}assembleTransforms(e=!1){return $(this._parse).filter(t=>!e||yQ(t)>1).map(e=>{let t=vFe(e,this._parse[e]);return t?{type:`formula`,expr:t,as:vQ(e)}:null}).filter(e=>e!==null)}},Y6=class e extends i6{clone(){return new e(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([q3])}hash(){return`Identifier`}assemble(){return{type:`identifier`,as:q3}}},X6=class e extends i6{params;clone(){return new e(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${JZ(this.params)}`}assemble(){return{type:`graticule`,...this.params===!0?{}:this.params}}},Z6=class e extends i6{params;clone(){return new e(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 ${JZ(this.params)}`}assemble(){return{type:`sequence`,...this.params}}},Q6=class extends i6{_data;_name;_generator;constructor(e){super(null),e??={name:`source`};let t;if(L0(e)||(t=e.format?{...qZ(e.format,[`parse`])}:{}),I0(e))this._data={values:e.values};else if(F0(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];XZ([`json`,`csv`,`tsv`,`dsv`,`topojson`],n)||(n=`json`),t.type=n}}else dNe(e)?this._data={values:[{type:`Sphere`}]}:(lNe(e)||L0(e))&&(this._data={});this._generator=L0(e),e.name&&(this._name=e.name),t&&!aQ(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 Error(`Source nodes have to be roots.`)}remove(){throw Error(`Source nodes are roots and cannot be removed.`)}hash(){throw Error(`Cannot hash sources`)}assemble(){return{name:this._name,...this._data,transform:[]}}},$6=class{#e;constructor(){this.#e=!1}setModified(){this.#e=!0}get modifiedFlag(){return this.#e}},e8=class extends $6{getNodeDepths(e,t,n){n.set(e,t);for(let r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){let t=[...this.getNodeDepths(e,0,new Map).entries()].sort((e,t)=>t[1]-e[1]);for(let e of t)this.run(e[0]);return this.modifiedFlag}},t8=class extends $6{optimize(e){this.run(e);for(let t of e.children)this.optimize(t);return this.modifiedFlag}},nBe=class extends t8{mergeNodes(e,t){let n=t.shift();for(let r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){let t=e.children.map(e=>e.hash()),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}},rBe=class extends t8{requiresSelectionId;constructor(e){super(),this.requiresSelectionId=e&&r2(e)}run(e){e instanceof Y6&&(this.requiresSelectionId&&(x2(e.parent)||e.parent instanceof K6||e.parent instanceof J6)||(this.setModified(),e.remove()))}},iBe=class extends $6{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof o6&&(n=e.producedFields(),nQ(n,t)&&(this.setModified(),e.removeFormulas(t),e.producedFields.length===0&&e.remove()));for(let r of e.children)this.run(r,new Set([...t,...n]))}},aBe=class extends t8{constructor(){super()}run(e){e instanceof a6&&!e.isRequired()&&(this.setModified(),e.remove())}},oBe=class extends e8{run(e){if(!x2(e)&&!(e.numChildren()>1)){for(let t of e.children)if(t instanceof J6)if(e instanceof J6)this.setModified(),e.merge(t);else{if(iQ(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}},sBe=class extends e8{run(e){let t=[...e.children],n=e.children.filter(e=>e instanceof J6);if(e.numChildren()>1&&n.length>=1){let r={},i=new Set;for(let e of n){let t=e.parse;for(let e of $(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(let e of i)delete r[e];if(!aQ(r)){this.setModified();let n=new J6(e,r);for(let i of t){if(i instanceof J6)for(let e of $(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof J6&&$(i.parse).length===0&&i.remove()}}}}},cBe=class extends e8{run(e){e instanceof a6||e.numChildren()>0||e instanceof q6||e instanceof Q6||(this.setModified(),e.remove())}},lBe=class extends e8{run(e){let t=e.children.filter(e=>e instanceof o6),n=t.pop();for(let e of t)this.setModified(),n.merge(e)}},uBe=class extends e8{run(e){let t=e.children.filter(e=>e instanceof K6),n={};for(let e of t){let t=JZ(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(let t of $(n)){let r=n[t];if(r.length>1){let t=r.pop();for(let n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}},dBe=class extends e8{model;constructor(e){super(),this.model=e}run(e){let t=!(x2(e)||e instanceof L6||e instanceof J6||e instanceof Y6),n=[],r=[];for(let i of e.children)i instanceof G6&&(t&&!iQ(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){let t=n.pop();for(let e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof G6?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){let e=r.pop();for(let t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}},fBe=class extends e8{run(e){let t=[...e.children];if(!ZZ(t,e=>e instanceof a6)||e.numChildren()<=1)return;let n=[],r;for(let i of t)if(i instanceof a6){let t=i;for(;t.numChildren()===1;){let[e]=t.children;if(e instanceof a6)t=e;else break}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(let e of n)e.parent.removeChild(e),e.parent=r}}},n8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=eQ(this.transform.groupby.concat(e),e=>e)}dependentFields(){let e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(e=>e.field).filter(e=>e!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??Q(e)}hash(){return`JoinAggregateTransform ${JZ(this.transform)}`}assemble(){let e=[],t=[],n=[];for(let r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(r.field===void 0?null:r.field);let r=this.transform.groupby;return{type:`joinaggregate`,as:n,ops:t,fields:e,...r===void 0?{}:{groupby:r}}}},r8=class e extends i6{filter;clone(){return new e(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(t,n,r){let{config:i,markDef:a}=n,{marks:o,scales:s}=r;if(o===`include-invalid-values`&&s===`include-invalid-values`)return null;let c=n.reduceFieldDef((e,t,r)=>{let o=WQ(r)&&n.getScaleComponent(r);if(o){let n=o.get(`type`),{aggregate:s}=t,c=g1({scaleChannel:r,markDef:a,config:i,scaleType:n,isCountAggregate:YQ(s)});c!==`show`&&c!==`always-valid`&&(e[t.field]=t)}return e},{});return $(c).length?new e(t,c):null}dependentFields(){return new Set($(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${JZ(this.filter)}`}assemble(){let e=$(this.filter).reduce((e,t)=>{let n=this.filter[t],r=Q(n,{expr:`datum`});return n!==null&&(n.type===`temporal`?e.push(`(isDate(${r}) || (${S2(r)}))`):n.type===`quantitative`&&e.push(S2(r))),e},[]);return e.length>0?{type:`filter`,expr:e.join(` && `)}:null}},i8=class e extends i6{_stack;clone(){return new e(null,G2(this._stack))}constructor(e,t){super(e),this._stack=t}static makeFromTransform(t,n){let{stack:r,groupby:i,as:a,offset:o=`zero`}=n,s=[],c=[];if(n.sort!==void 0)for(let e of n.sort)s.push(e.field),c.push(bQ(e.order,`ascending`));let l={field:s,order:c},u;return u=CFe(a)?a:xg(a)?[a,`${a}_end`]:[`${n.stack}_start`,`${n.stack}_end`],new e(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:o,sort:l,facetby:[],as:u})}static makeFromEncoding(t,n){let r=n.stack,{encoding:i}=n;if(!r)return null;let{groupbyChannels:a,fieldChannel:o,offset:s,impute:c}=r,l=a.map(e=>{let t=i[e];return X1(t)}).filter(e=>!!e),u=SFe(n),d=n.encoding.order,f;if(H(d)||Z(d))f=x$(d);else{let e=tje(d)?d.sort:o===`y`?`descending`:`ascending`;f=u.reduce((t,n)=>(t.field.includes(n)||(t.field.push(n),t.order.push(e)),t),{field:[],order:[]})}return new e(t,{dimensionFieldDefs:l,stackField:n.vgField(o),facetby:[],stackby:u,sort:f,offset:s,impute:c,as:[n.vgField(o,{suffix:`start`,forAs:!0}),n.vgField(o,{suffix:`end`,forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){let 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 ${JZ(this._stack)}`}getGroupbyFields(){let{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map(e=>e.bin?t?[Q(e,{binSuffix:`mid`})]:[Q(e,{}),Q(e,{binSuffix:`end`})]:[Q(e)]).flat():n??[]}assemble(){let e=[],{facetby:t,dimensionFieldDefs:n,stackField:r,stackby:i,sort:a,offset:o,impute:s,as:c}=this._stack;if(s)for(let a of n){let{bandPosition:n=.5,bin:o}=a;if(o){let t=Q(a,{expr:`datum`}),r=Q(a,{expr:`datum`,binSuffix:`end`});e.push({type:`formula`,expr:`${S2(t)} ? ${n}*${t}+${1-n}*${r} : ${t}`,as:Q(a,{binSuffix:`mid`,forAs:!0})})}e.push({type:`impute`,field:r,groupby:[...i,...t],key:Q(a,{binSuffix:`mid`}),method:`value`,value:0})}return e.push({type:`stack`,groupby:[...this.getGroupbyFields(),...t],field:r,sort:a,as:c,offset:o}),e}},a8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=eQ(this.transform.groupby.concat(e),e=>e)}dependentFields(){let e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach(t=>e.add(t.field)),this.transform.window.map(e=>e.field).filter(e=>e!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??Q(e)}hash(){return`WindowTransform ${JZ(this.transform)}`}assemble(){let e=[],t=[],n=[],r=[];for(let i of this.transform.window)t.push(i.op),n.push(this.getDefaultName(i)),r.push(i.param===void 0?null:i.param),e.push(i.field===void 0?null:i.field);let i=this.transform.frame,a=this.transform.groupby;if(i&&i[0]===null&&i[1]===null&&t.every(e=>JQ(e)))return{type:`joinaggregate`,as:n,ops:t,fields:e,...a===void 0?{}:{groupby:a}};let o=[],s=[];if(this.transform.sort!==void 0)for(let e of this.transform.sort)o.push(e.field),s.push(e.order??`ascending`);let c={field:o,order:s},l=this.transform.ignorePeers;return{type:`window`,params:r,as:n,ops:t,fields:e,sort:c,...l===void 0?{}:{ignorePeers:l},...a===void 0?{}:{groupby:a},...i===void 0?{}:{frame:i}}}},o8=`scale_`,s8=5,c8=class e{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}signal;static fromName(t,n){return new e(()=>t(n))}},pBe=[`type`,`clipAngle`,`clipExtent`,`center`,`rotate`,`precision`,`reflectX`,`reflectY`,`coefficient`,`distance`,`fraction`,`lobes`,`parallel`,`radius`,`ratio`,`spacing`,`tilt`],l8=class extends n6{specifiedProjection;size;data;merged=!1;constructor(e,t,n,r){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=r}get isFit(){return!!this.data}},u8=class extends n6{merged=!1;constructor(e,t){super({},{name:e}),this.setWithExplicit(`type`,t)}domainHasZero(){let e=this.get(`type`);if(XZ([l3.LOG,l3.TIME,l3.UTC],e))return`definitely-not`;let t=this.get(`zero`);if(t===!0||t===void 0&&XZ([l3.LINEAR,l3.SQRT,l3.POW],e))return`definitely`;let n=this.get(`domains`);if(n.length>0){let e=!1,t=!1,r=!1;for(let i of n){if(H(i)){let n=i[0],r=i[i.length-1];if(yg(n)&&yg(r))if(n<=0&&r>=0){e=!0;continue}else{t=!0;continue}}r=!0}if(e)return`definitely`;if(t&&!r)return`definitely-not`}return`maybe`}},mBe=[`range`,`scheme`],d8=.95,f8={bins:({model:e,fieldOrDatumDef:t})=>Z(t)?wIe(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>TIe(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:a})=>EIe(e,t,n,r,i,a),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>DIe(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:a})=>OIe(e,t,n.type,r,i.scale,a),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:a})=>kIe(e,t,n,r,i.scale,a),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>AIe(t,Z(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:a,hasSecondaryRangeChannel:o})=>jIe(e,t,n,r,i,a.scale,o)},hBe=cNe((e,t)=>xAe(e)-xAe(t)),p8=class{nameMap;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}},m8=class{type;parent;config;name;size;title;description;data;transforms;layout;scaleNameMap;projectionNameMap;signalNameMap;component;view;constructor(e,t,n,r,i,a,o){this.type=t,this.parent=n,this.config=i,this.parent=n,this.config=i,this.view=r$(o),this.name=e.name??r,this.title=a$(e.title)?{text:e.title}:e.title?r$(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new p8,this.projectionNameMap=n?n.projectionNameMap:new p8,this.signalNameMap=n?n.signalNameMap:new p8,this.data=e.data,this.description=e.description,this.transforms=XMe(e.transform??[]),this.layout=t===`layer`||t===`unit`?{}:Qje(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:A1(e)||n?.component.data.isFaceted&&e.data===void 0},layoutSize:new n6,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...a?G2(a):{}},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(){PIe(this)}parseProjection(){ZFe(this)}renameTopLevelLayoutSizeSignal(){this.getName(`width`)!==`width`&&this.renameSignal(this.getName(`width`),`width`),this.getName(`height`)!==`height`&&this.renameSignal(this.getName(`height`),`height`)}parseLegends(){nFe(this)}assembleEncodeFromView(e){let{style:t,...n}=e,r={};for(let e of $(n)){let t=n[e];t!==void 0&&(r[e]=p$(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),!e&&(this.description&&(t.description=p$(this.description)),this.type===`unit`||this.type===`layer`)?{width:this.getSizeSignalRef(`width`),height:this.getSizeSignalRef(`height`),...t}:aQ(t)?void 0:t}assembleLayout(){if(!this.layout)return;let{spacing:e,...t}=this.layout,{component:n,config:r}=this,i=NPe(n.layoutHeaders,r);return{padding:e,...this.assembleDefaultLayout(),...t,...i?{titleBand:i}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){let{layoutHeaders:e}=this.component,t=[];for(let n of L4)e[n].title&&t.push(EPe(this,n));for(let e of B6)t=t.concat(kPe(this,e));return t}assembleAxes(){return lPe(this.component.axes,this.config)}assembleLegends(){return KFe(this)}assembleProjections(){return JFe(this)}assembleTitle(){let{encoding:e,...t}=this.title??{},n={...i$(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(n.text)return XZ([`unit`,`layer`],this.type)?XZ([`middle`,void 0],n.anchor)&&(n.frame??=`group`):n.anchor??=`start`,aQ(n)?void 0:n}assembleGroup(e=[]){let t={};e=e.concat(this.assembleSignals()),e.length>0&&(t.signals=e);let n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());let r=!this.parent||P2(this.parent)?nIe(this):[];r.length>0&&(t.scales=r);let i=this.assembleAxes();i.length>0&&(t.axes=i);let a=this.assembleLegends();return a.length>0&&(t.legends=a),t}getName(e){return cQ((this.name?`${this.name}_`:``)+e)}getDataName(e){return this.getName(r6[e].toLowerCase())}requestDataName(e){let t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(P2(this.parent)){let t=VQ(LPe(e)),n=this.component.scales[t];if(n&&!n.merged){let e=n.get(`type`),r=n.get(`range`);if(s1(e)&&s$(r)){let e=n.get(`name`),r=A2(j2(this,t));return r?{signal:IPe(e,n,Q({aggregate:`distinct`,field:r},{expr:`datum`}))}:(X(k$(t)),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){let 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(MQ(e)&&WQ(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 Error(`getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().`);let t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){let t=this.getScaleComponent(e);return t?t.get(`type`):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw Error(tke(t));return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some(e=>e.hasOrientSignalRef())||this.component.axes.y?.some(e=>e.hasOrientSignalRef())}},h8=class extends m8{vgField(e,t={}){let n=this.fieldDef(e);if(n)return Q(n,t)}reduceFieldDef(e,t){return Oje(this.getMapping(),(t,n,r)=>{let i=X1(n);return i?e(t,i,r):t},t)}forEachFieldDef(e,t){c0(this.getMapping(),(t,n)=>{let r=X1(t);r&&e(r,n)},t)}},g8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=G2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??`value`,n[1]??`density`];let r=this.transform.resolve??`shared`;this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${JZ(this.transform)}`}assemble(){let{density:e,...t}=this.transform,n={type:`kde`,field:e,...t};return n.resolve=this.transform.resolve,n}},_8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=G2(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${JZ(this.transform)}`}assemble(){let{extent:e,param:t}=this.transform;return{type:`extent`,field:e,signal:t}}},v8=class e extends i6{transform;clone(){return new e(this.parent,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=G2(t);let{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map((e,t)=>r[t]??e)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${JZ(this.transform)}`}assemble(){let{flatten:e,as:t}=this.transform;return{type:`flatten`,fields:e,as:t}}},y8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=G2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??`key`,n[1]??`value`]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${JZ(this.transform)}`}assemble(){let{fold:e,as:t}=this.transform;return{type:`fold`,fields:e,as:t}}},b8=class e extends i6{fields;geojson;signal;clone(){return new e(null,G2(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(let i of[[u4,l4],[f4,d4]]){let a=i.map(e=>{let t=Z1(n.encoding[e]);return Z(t)?t.field:L1(t)?{expr:`${t.datum}`}:H1(t)?{expr:`${t.value}`}:void 0});(a[0]||a[1])&&(t=new e(t,a,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(_4)){let i=n.typedFieldDef(_4);i.type===c3&&(t=new e(t,null,i.field,n.getName(`geojson_${r}`)))}return t}constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}dependentFields(){let e=(this.fields??[]).filter(xg);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${JZ(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}]}},x8=class e extends i6{projection;fields;as;clone(){return new e(null,this.projection,G2(this.fields),G2(this.as))}constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(let r of[[u4,l4],[f4,d4]]){let i=r.map(e=>{let t=Z1(n.encoding[e]);return Z(t)?t.field:L1(t)?{expr:`${t.datum}`}:H1(t)?{expr:`${t.value}`}:void 0}),a=r[0]===f4?`2`:``;(i[0]||i[1])&&(t=new e(t,n.projectionName(),i,[n.getName(`x${a}`),n.getName(`y${a}`)]))}return t}dependentFields(){return new Set(this.fields.filter(xg))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${JZ(this.fields)} ${JZ(this.as)}`}assemble(){return{type:`geopoint`,projection:this.projection,fields:this.fields,as:this.as}}},S8=class e extends i6{transform;clone(){return new e(null,G2(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){let{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(`,`)})`}}static makeFromTransform(t,n){return new e(t,n)}static makeFromEncoding(t,n){let r=n.encoding,i=r.x,a=r.y;if(Z(i)&&Z(a)){let o=i.impute?i:a.impute?a:void 0;if(o===void 0)return;let s=i.impute?a:a.impute?i:void 0,{method:c,value:l,frame:u,keyvals:d}=o.impute,f=kje(n.mark,r);return new e(t,{impute:o.field,key:s.field,...c?{method:c}:{},...l===void 0?{}:{value:l},...u?{frame:u}:{},...d===void 0?{}:{keyvals:d},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${JZ(this.transform)}`}assemble(){let{impute:e,key:t,keyvals:n,method:r,groupby:i,value:a,frame:o=[null,null]}=this.transform,s={type:`impute`,field:e,key:t,...n?{keyvals:kMe(n)?this.processSequence(n):n}:{},method:`value`,...i?{groupby:i}:{},value:!r||r===`value`?a:null};return r&&r!==`value`?[s,{type:`window`,as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:o,ignorePeers:!1,...i?{groupby:i}:{}},{type:`formula`,expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]:[s]}},C8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=G2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[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 ${JZ(this.transform)}`}assemble(){let{loess:e,on:t,...n}=this.transform;return{type:`loess`,x:t,y:e,...n}}},w8=class e extends i6{transform;secondary;clone(){return new e(null,G2(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(t,n,r,i){let a=n.component.data.sources,{from:o}=r,s=null;if(jMe(o)){let e=ZIe(o.data,a);e||(e=new Q6(o.data),a.push(e));let t=n.getName(`lookup_${i}`);s=new a6(e,t,r6.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[t]=s}else if(MMe(o)){let e=o.param;r={as:e,...r};let t;try{t=n.getSelectionComponent(cQ(e),e)}catch{throw Error(nke(e))}if(s=t.materialized,!s)throw Error(rke(e))}return new e(t,r,s.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?tg(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${JZ({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:tg(this.transform.as)}:{}};else{let t=this.transform.as;xg(t)||(X(DRe),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}:{}}}},T8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=G2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??`prob`,n[1]??`value`]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${JZ(this.transform)}`}assemble(){let{quantile:e,...t}=this.transform;return{type:`quantile`,field:e,...t}}},E8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=G2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[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 ${JZ(this.transform)}`}assemble(){let{regression:e,on:t,...n}=this.transform;return{type:`regression`,x:t,y:e,...n}}},D8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=eQ((this.transform.groupby??[]).concat(e),e=>e)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${JZ(this.transform)}`}assemble(){let{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return{type:`pivot`,field:e,value:t,...r===void 0?{}:{limit:r},...i===void 0?{}:{op:i},...n===void 0?{}:{groupby:n}}}},O8=class e extends i6{transform;clone(){return new e(null,G2(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${JZ(this.transform)}`}assemble(){return{type:`sample`,size:this.transform.sample}}},gBe=class e extends h8{facet;child;children;constructor(e,t,n,r){super(e,`facet`,t,n,r,e.resolve),this.child=W2(e.spec,this,this.getName(`child`),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!O1(e))return{facet:this.initFacetFieldDef(e,`facet`)};let t=$(e),n={};for(let r of t){if(![X2,Z2].includes(r)){X(R$(r,`facet`));break}let t=e[r];if(t.field===void 0){X(L$(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){let n=$1(e,t);return n.header?n.header=r$(n.header):n.header===null&&(n.header=null),n}channelHasField(e){return Y(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=B2(this),this.child.parseData()}parseLayoutSize(){L2(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,K2(this.component.selection).some(e=>i2(e))&&U$(Y4)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),HIe(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){let e={};for(let t of L4)for(let n of V6){let r=this.component.layoutHeaders[t],i=r[n],{facetFieldDef:a}=r;if(a){let n=p2(`titleOrient`,a.header,this.config,t);if([`right`,`bottom`].includes(n)){let r=f2(t,n);e.titleAnchor??={},e.titleAnchor[r]=`end`}}if(i?.[0]){let i=t===`row`?`height`:`width`,a=n===`header`?`headerBand`:`footerBand`;t!==`facet`&&!this.child.component.layoutSize.get(i)&&(e[a]??={},e[a][t]=.5),r.title&&(e.offset??={},e.offset[t===`row`?`rowTitle`:`columnTitle`]=10)}}return e}assembleDefaultLayout(){let{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0,r=`all`;return(!t&&this.component.resolve.scale.x===`independent`||!e&&this.component.resolve.scale.y===`independent`)&&(r=`none`),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:`full`,align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof e))return{signal:`length(data('${this.getName(`column_domain`)}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof e?{...this.channelHasField(`column`)?{encode:{update:{columns:{field:Q(this.facet.column,{prefix:`distinct`})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){let t=[],n=[],r=[];if(this.child instanceof e){if(this.child.channelHasField(`column`)){let e=Q(this.child.facet.column);t.push(e),n.push(`distinct`),r.push(`distinct_${e}`)}}else for(let e of V4){let i=this.child.component.scales[e];if(i&&!i.merged){let a=i.get(`type`),o=i.get(`range`);if(s1(a)&&s$(o)){let i=A2(j2(this.child,e));i?(t.push(i),n.push(`distinct`),r.push(`distinct_${i}`)):X(k$(e))}}}return{fields:t,ops:n,as:r}}assembleFacet(){let{name:e,data:t}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:a,as:o}=this.getCardinalityAggregateForChild(),s=[];for(let e of L4){let t=this.facet[e];if(t){s.push(Q(t));let{bin:c,sort:l}=t;if(ZQ(c)&&s.push(Q(t,{binSuffix:`end`})),D1(l)){let{field:e,op:s=A3}=l,c=z2(t,l);n&&r?(i.push(c),a.push(`max`),o.push(c)):(i.push(e),a.push(s),o.push(c))}else if(H(l)){let n=d2(t,e);i.push(n),a.push(`max`),o.push(n)}}}let c=!!n&&!!r;return{name:e,data:t,groupby:s,...c||i.length>0?{aggregate:{...c?{cross:c}:{},...i.length?{fields:i,ops:a,as:o}:{}}}:{}}}facetSortFields(e){let{facet:t}=this,n=t[e];return n?D1(n.sort)?[z2(n,n.sort,{expr:`datum`})]:H(n.sort)?[d2(n,e,{expr:`datum`})]:[Q(n,{expr:`datum`})]:[]}facetSortOrder(e){let{facet:t}=this,n=t[e];if(n){let{sort:e}=n;return[(D1(e)?e.order:!H(e)&&e)||`ascending`]}return[]}assembleLabelTitle(){let{facet:e,config:t}=this;if(e.facet)return h2(e.facet,`facet`,t);let n={row:[`top`,`bottom`],column:[`left`,`right`]};for(let r of B6)if(e[r]){let i=p2(`labelOrient`,e[r]?.header,t,r);if(n[r].includes(i))return h2(e[r],r,t)}}assembleMarks(){let{child:e}=this,t=this.component.data.facetRoot,n=zIe(t),r=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),a=e.assembleGroupStyle();return[{name:this.getName(`cell`),type:`group`,...i?{title:i}:{},...a?{style:a}:{},from:{facet:this.assembleFacet()},sort:{field:L4.map(e=>this.facetSortFields(e)).flat(),order:L4.map(e=>this.facetSortOrder(e)).flat()},...n.length>0?{data:n}:{},...r?{encode:{update:r}}:{},...e.assembleGroup(bNe(this,[]))}]}getMapping(){return this.facet}},_Be=class extends m8{children;constructor(e,t,n,r){super(e,`concat`,t,n,r,e.resolve),(e.resolve?.axis?.x===`shared`||e.resolve?.axis?.y===`shared`)&&X(TRe),this.children=this.getChildren(e).map((e,t)=>W2(e,this,this.getName(`concat_${t}`),void 0,r))}parseData(){this.component.data=B2(this);for(let e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(let e of this.children){e.parseSelections();for(let t of $(e.component.selection))this.component.selection[t]=e.component.selection[t]}K2(this.component.selection).some(e=>i2(e))&&U$(Y4)}parseMarkGroup(){for(let e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(let e of this.children)e.parseAxesAndHeaders()}getChildren(e){return v0(e)?e.vconcat:y0(e)?e.hconcat:e.concat}parseLayoutSize(){qIe(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){let e=g2(this);for(let t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{let t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return{type:`group`,name:e.getName(`group`),...t?{title:t}:{},...n?{style:n}:{},...r?{encode:{update:r}}:{},...e.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){let e=this.layout.columns;return{...e==null?{}:{columns:e},bounds:`full`,align:`each`}}},k8=$({disable:1,gridScale:1,scale:1,...I3,labelExpr:1,encode:1}),vBe=class e extends n6{explicit;implicit;mainExtracted;constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new e(G2(this.explicit),G2(this.implicit),this.mainExtracted)}hasAxisPart(e){return e===`axis`?!0:e===`grid`||e===`title`?!!this.get(e):!eLe(this.get(e))}hasOrientSignalRef(){return o$(this.explicit.orient)}},yBe={bottom:`top`,top:`bottom`,left:`right`,right:`left`},bBe=new Set([`grid`,`translate`,`format`,`formatType`,`orient`,`labelExpr`,`tickCount`,`position`,`tickMinStep`]),xBe={vgMark:`arc`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`ignore`,orient:`ignore`,theta:`ignore`}),...Y0(`x`,e,{defaultPos:`mid`}),...Y0(`y`,e,{defaultPos:`mid`}),...$0(e,`radius`),...$0(e,`theta`)})},SBe={vgMark:`area`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`include`,size:`ignore`,theta:`ignore`}),...Z0(`x`,e,{defaultPos:`zeroOrMin`,defaultPos2:`zeroOrMin`,range:e.markDef.orient===`horizontal`}),...Z0(`y`,e,{defaultPos:`zeroOrMin`,defaultPos2:`zeroOrMin`,range:e.markDef.orient===`vertical`}),...t2(e)})},CBe={vgMark:`rect`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...$0(e,`x`),...$0(e,`y`)})},wBe={vgMark:`shape`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`ignore`,orient:`ignore`,theta:`ignore`})}),postEncodingTransform:e=>{let{encoding:t}=e,n=t.shape;return[{type:`geoshape`,projection:e.projectionName(),...n&&Z(n)&&n.type===c3?{field:Q(n,{expr:`datum`})}:{}}]}},TBe={vgMark:`image`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`ignore`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...$0(e,`x`),...$0(e,`y`),...G0(e,`url`)})},EBe={vgMark:`line`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`ignore`,orient:`ignore`,theta:`ignore`}),...Y0(`x`,e,{defaultPos:`mid`}),...Y0(`y`,e,{defaultPos:`mid`}),...q0(`size`,e,{vgChannel:`strokeWidth`}),...t2(e)})},DBe={vgMark:`trail`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`include`,orient:`ignore`,theta:`ignore`}),...Y0(`x`,e,{defaultPos:`mid`}),...Y0(`y`,e,{defaultPos:`mid`}),...q0(`size`,e),...t2(e)})},OBe={vgMark:`symbol`,encodeEntry:e=>H2(e)},kBe={vgMark:`symbol`,encodeEntry:e=>H2(e,`circle`)},ABe={vgMark:`symbol`,encodeEntry:e=>H2(e,`square`)},jBe={vgMark:`rect`,encodeEntry:e=>({...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...$0(e,`x`),...$0(e,`y`)})},MBe={vgMark:`rule`,encodeEntry:e=>{let{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...Z0(`x`,e,{defaultPos:n===`horizontal`?`zeroOrMax`:`mid`,defaultPos2:`zeroOrMin`,range:n!==`vertical`}),...Z0(`y`,e,{defaultPos:n===`vertical`?`zeroOrMax`:`mid`,defaultPos2:`zeroOrMin`,range:n!==`horizontal`}),...q0(`size`,e,{vgChannel:`strokeWidth`})}}},NBe={vgMark:`text`,encodeEntry:e=>{let{config:t,encoding:n}=e;return{...e2(e,{align:`include`,baseline:`include`,color:`include`,size:`ignore`,orient:`ignore`,theta:`include`}),...Y0(`x`,e,{defaultPos:`mid`}),...Y0(`y`,e,{defaultPos:`mid`}),...G0(e),...q0(`size`,e,{vgChannel:`fontSize`}),...q0(`angle`,e),...YNe(`align`,uLe(e.markDef,n,t)),...YNe(`baseline`,dLe(e.markDef,n,t)),...Y0(`radius`,e,{defaultPos:null}),...Y0(`theta`,e,{defaultPos:null})}}},A8={arc:xBe,area:SBe,bar:CBe,circle:kBe,geoshape:wBe,image:TBe,line:EBe,point:OBe,rect:jBe,rule:MBe,square:ABe,text:NBe,tick:{vgMark:`rect`,encodeEntry:e=>{let{config:t,markDef:n}=e,r=n.orient,i=r===`horizontal`?`x`:`y`,a=r===`horizontal`?`y`:`x`,o=r===`horizontal`?`height`:`width`;return{...e2(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...$0(e,i),...Y0(a,e,{defaultPos:`mid`,vgChannel:a===`y`?`yc`:`xc`}),[o]:p$(_$(`thickness`,n,t))}}},trail:DBe},j8=`faceted_path_`,M8=`stack_group_`,N8=class extends h8{markDef;encoding;specifiedScales={};stack;specifiedAxes={};specifiedLegends={};specifiedProjection={};selection=[];children=[];constructor(e,t,n,r={},i){super(e,`unit`,t,n,i,void 0,Zje(e)?e.view:void 0);let a=m1(e.mark)?{...e.mark}:{type:e.mark},o=a.type;a.filled===void 0&&(a.filled=_Me(a,i,{graticule:e.data&&R0(e.data)}));let s=this.encoding=Eje(e.encoding||{},o,a.filled,i);this.markDef=mMe(a,s,i),this.size=cLe({encoding:s,size:Zje(e)?{...r,...e.width===void 0?{}:{width:e.width},...e.height===void 0?{}:{height:e.height}}:r}),this.stack=pMe(this.markDef,s),this.specifiedScales=this.initScales(o,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter(e=>g0(e)),this.alignStackOrderWithColorDomain()}get hasProjection(){let{encoding:e}=this,t=this.mark===T3,n=e&&wLe.some(t=>B1(e[t]));return t||n}scaleDomain(e){let 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 K4.reduce((e,n)=>{let r=Z1(t[n]);return r&&(e[n]=this.initScale(r.scale??{})),e},{})}initScale(e){let{domain:t,range:n}=e,r=r$(e);return H(t)&&(r.domain=t.map(d$)),H(n)&&(r.range=n.map(d$)),r}initAxes(e){return V4.reduce((t,n)=>{let r=e[n];if(B1(r)||n===$2&&B1(e.x2)||n===e4&&B1(e.y2)){let e=B1(r)?r.axis:void 0;t[n]=e&&this.initAxis({...e})}return t},{})}initAxis(e){let t=$(e),n={};for(let r of t){let t=e[r];n[r]=i0(t)?u$(t):d$(t)}return n}initLegends(e){return sRe.reduce((t,n)=>{let r=Z1(e[n]);if(r&&KOe(n)){let e=r.legend;t[n]=e&&r$(e)}return t},{})}alignStackOrderWithColorDomain(){let{color:e,fill:t,order:n,xOffset:r,yOffset:i}=this.encoding,a=t||e,o=Z(a)?a:void 0,s=o?.field,c=o?.scale,l=o?.type,u=c?.domain,d=r||i,f=Z(d)?d:void 0,p=`_${s}_sort_index`;if(!n&&Array.isArray(u)&&typeof s==`string`&&l===`nominal`)if(f&&!f.sort)f.sort=u;else{if(!this.stack)return;let e=`indexof(${W(u)}, datum['${s}'])`,t=this.markDef?.orient===`horizontal`?`ascending`:`descending`;this.transforms.push({calculate:e,as:p}),this.encoding.order={field:p,type:`quantitative`,sort:t}}}parseData(){this.component.data=B2(this)}parseLayoutSize(){JIe(this)}parseSelections(){this.component.selection=rPe(this,this.selection)}parseMarkGroup(){this.component.mark=fLe(this)}parseAxesAndHeaders(){this.component.axes=nLe(this)}assembleSelectionTopLevelSignals(e){return xNe(this,e)}assembleSignals(){return[...cPe(this),...yNe(this,[])]}assembleSelectionData(e){return SNe(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return g2(this)}correctDataNames=e=>(e.from?.data&&(e.from.data=this.lookupDataSource(e.from.data),`time`in this.encoding&&(e.from.data=e.from.data+u6)),e.from?.facet?.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e);assembleMarks(){let e=this.component.mark??[];return(!this.parent||!I2(this.parent))&&(e=CNe(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){let{style:e}=this.view||{};return e===void 0?this.encoding.x||this.encoding.y?`cell`:`view`:e}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return o0(this.encoding,e)}fieldDef(e){let t=this.encoding[e];return X1(t)}typedFieldDef(e){let t=this.fieldDef(e);return V1(t)?t:null}},PBe=class e extends m8{children;constructor(t,n,r,i,a){super(t,`layer`,n,r,a,t.resolve,t.view);let o={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((t,n)=>{if(w0(t))return new e(t,this,this.getName(`layer_${n}`),o,a);if(a0(t))return new N8(t,this,this.getName(`layer_${n}`),o,a);throw Error(T$(t))})}parseData(){this.component.data=B2(this);for(let e of this.children)e.parseData()}parseLayoutSize(){KIe(this)}parseSelections(){this.component.selection={};for(let e of this.children){e.parseSelections();for(let t of $(e.component.selection))this.component.selection[t]=e.component.selection[t]}K2(this.component.selection).some(e=>i2(e))&&U$(Y4)}parseMarkGroup(){for(let e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){rLe(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),cPe(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),g2(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleGroupStyle(){let e=new Set;for(let t of this.children)for(let n of tg(t.assembleGroupStyle()))e.add(n);let 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(let t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return wNe(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),KFe(this))}},FBe=SLe.version}));function LBe(e){let[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var RBe=o((()=>{})),zBe=c({carbong10:()=>vVe,carbong100:()=>bVe,carbong90:()=>yVe,carbonwhite:()=>_Ve,dark:()=>VBe,excel:()=>HBe,fivethirtyeight:()=>GBe,ggplot2:()=>KBe,googlecharts:()=>iVe,latimes:()=>XBe,powerbi:()=>pVe,quartz:()=>ZBe,urbaninstitute:()=>rVe,version:()=>xVe,vox:()=>QBe});function P8({theme:e,background:t}){let n=[`white`,`g10`].includes(e)?`light`:`dark`,r=S5.gridBg[e],i=S5.textPrimary[e],a=S5.textSecondary[e],o=n===`dark`?hVe:gVe,s=n===`dark`?`#d4bbff`:`#6929c4`;return{background:t,arc:{fill:s},area:{fill:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{stroke:s},circle:{fill:s},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:`start`,dy:-15,fontSize:16,font:b5,fontWeight:600},axis:{labelColor:a,labelFontSize:12,labelFont:mVe,labelFontWeight:x5,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:S5.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:b5,fill:a,fontWeight:x5},"guide-title":{font:b5,fill:a,fontWeight:x5}},range:{category:o,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`]}}}var BBe,F8,I8,VBe,L8,HBe,R8,z8,UBe,WBe,B8,V8,GBe,H8,KBe,qBe,JBe,U8,W8,YBe,G8,K8,q8,J8,Y8,XBe,X8,Z8,ZBe,Q8,QBe,$8,e5,$Be,t5,n5,eVe,tVe,nVe,r5,rVe,i5,a5,o5,iVe,s5,c5,l5,u5,d5,f5,p5,m5,h5,aVe,g5,oVe,sVe,cVe,lVe,uVe,dVe,fVe,_5,v5,y5,pVe,b5,mVe,x5,S5,hVe,gVe,_Ve,vVe,yVe,bVe,xVe,SVe=o((()=>{BBe={version:`3.0.0`},F8=`#fff`,I8=`#888`,VBe={background:`#333`,view:{stroke:I8},title:{color:F8,subtitleColor:F8},style:{"guide-label":{fill:F8},"guide-title":{fill:F8}},axis:{domainColor:F8,gridColor:I8,tickColor:F8}},L8=`#4572a7`,HBe={background:`#fff`,arc:{fill:L8},area:{fill:L8},line:{stroke:L8,strokeWidth:2},path:{stroke:L8},rect:{fill:L8},shape:{stroke:L8},symbol:{fill:L8,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`]}},R8=`#30a2da`,z8=`#cbcbcb`,UBe=`#999`,WBe=`#333`,B8=`#f0f0f0`,V8=`#333`,GBe={arc:{fill:R8},area:{fill:R8},axis:{domainColor:z8,grid:!0,gridColor:z8,gridWidth:1,labelColor:UBe,labelFontSize:10,titleColor:WBe,tickColor:z8,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:B8,group:{fill:B8},legend:{labelColor:V8,labelFontSize:11,padding:1,symbolSize:30,symbolType:`square`,titleColor:V8,titleFontSize:14,titlePadding:10},line:{stroke:R8,strokeWidth:2},path:{stroke:R8,strokeWidth:.5},rect:{fill:R8},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:R8},bar:{binSpacing:2,fill:R8,stroke:null},title:{anchor:`start`,fontSize:24,fontWeight:600,offset:20}},H8=`#000`,KBe={group:{fill:`#e5e5e5`},arc:{fill:H8},area:{fill:H8},line:{stroke:H8},path:{stroke:H8},rect:{fill:H8},shape:{stroke:H8},symbol:{fill:H8,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`]}},qBe=22,JBe=`normal`,U8=`Benton Gothic, sans-serif`,W8=11.5,YBe=`normal`,G8=`#82c6df`,K8=`Benton Gothic Bold, sans-serif`,q8=`normal`,J8=13,Y8={"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`]},XBe={background:`#ffffff`,title:{anchor:`start`,color:`#000000`,font:K8,fontSize:qBe,fontWeight:JBe},arc:{fill:G8},area:{fill:G8},line:{stroke:G8,strokeWidth:2},path:{stroke:G8},rect:{fill:G8},shape:{stroke:G8},symbol:{fill:G8,size:30},axis:{labelFont:U8,labelFontSize:W8,labelFontWeight:YBe,titleFont:K8,titleFontSize:J8,titleFontWeight:q8},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:U8,labelFontSize:W8,symbolType:`square`,titleFont:K8,titleFontSize:J8,titleFontWeight:q8},range:{category:Y8[`category-6`],diverging:Y8[`fireandice-6`],heatmap:Y8[`fire-7`],ordinal:Y8[`fire-7`],ramp:Y8[`fire-7`]}},X8=`#ab5787`,Z8=`#979797`,ZBe={background:`#f9f9f9`,arc:{fill:X8},area:{fill:X8},line:{stroke:X8},path:{stroke:X8},rect:{fill:X8},shape:{stroke:X8},symbol:{fill:X8,size:30},axis:{domainColor:Z8,domainWidth:.5,gridWidth:.2,labelColor:Z8,tickColor:Z8,tickWidth:.2,titleColor:Z8},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`]}},Q8=`#3e5c69`,QBe={background:`#fff`,arc:{fill:Q8},area:{fill:Q8},line:{stroke:Q8},path:{stroke:Q8},rect:{fill:Q8},shape:{stroke:Q8},symbol:{fill:Q8},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`]}},$8=`#1696d2`,e5=`#000000`,$Be=`#FFFFFF`,t5=`Lato`,n5=`Lato`,eVe=`Lato`,tVe=`#DEDDDD`,nVe=18,r5={"shades-blue":[`#CFE8F3`,`#A2D4EC`,`#73BFE2`,`#46ABDB`,`#1696D2`,`#12719E`,`#0A4C6A`,`#062635`],"six-groups-cat-1":[`#1696d2`,`#ec008b`,`#fdbf11`,`#000000`,`#d2d2d2`,`#55b748`],"six-groups-seq":[`#cfe8f3`,`#a2d4ec`,`#73bfe2`,`#46abdb`,`#1696d2`,`#12719e`],"diverging-colors":[`#ca5800`,`#fdbf11`,`#fdd870`,`#fff2cf`,`#cfe8f3`,`#73bfe2`,`#1696d2`,`#0a4c6a`]},rVe={background:$Be,title:{anchor:`start`,fontSize:nVe,font:t5},axisX:{domain:!0,domainColor:e5,domainWidth:1,grid:!1,labelFontSize:12,labelFont:n5,labelAngle:0,tickColor:e5,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:t5},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:tVe,gridWidth:1,labelFontSize:12,labelFont:n5,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:t5,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:n5,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:t5,orient:`right`,offset:10},view:{stroke:`transparent`},range:{category:r5[`six-groups-cat-1`],diverging:r5[`diverging-colors`],heatmap:r5[`diverging-colors`],ordinal:r5[`six-groups-seq`],ramp:r5[`shades-blue`]},area:{fill:$8},rect:{fill:$8},line:{color:$8,stroke:$8,strokeWidth:5},trail:{color:$8,stroke:$8,strokeWidth:0,size:1},path:{stroke:$8,strokeWidth:.5},point:{filled:!0},text:{font:eVe,color:$8,fontSize:11,align:`center`,fontWeight:400,size:11},style:{bar:{fill:$8,stroke:null}},arc:{fill:$8},shape:{stroke:$8},symbol:{fill:$8,size:30}},i5=`#3366CC`,a5=`#ccc`,o5=`Arial, sans-serif`,iVe={arc:{fill:i5},area:{fill:i5},path:{stroke:i5},rect:{fill:i5},shape:{stroke:i5},symbol:{stroke:i5},circle:{fill:i5},background:`#fff`,padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:o5,fontSize:12},"guide-title":{font:o5,fontSize:12},"group-title":{font:o5,fontSize:12}},title:{font:o5,fontSize:14,fontWeight:`bold`,dy:-3,anchor:`start`},axis:{gridColor:a5,tickColor:a5,domain:!1,grid:!0},range:{category:[`#4285F4`,`#DB4437`,`#F4B400`,`#0F9D58`,`#AB47BC`,`#00ACC1`,`#FF7043`,`#9E9D24`,`#5C6BC0`,`#F06292`,`#00796B`,`#C2185B`],heatmap:[`#c6dafc`,`#5e97f6`,`#2a56c6`]}},s5=e=>e*1.3333333333333333,c5=s5(9),l5=s5(10),u5=s5(12),d5=`Segoe UI`,f5=`wf_standard-font, helvetica, arial, sans-serif`,p5=`#252423`,m5=`#605E5C`,h5=`transparent`,aVe=`#C8C6C4`,g5=`#118DFF`,oVe=`#12239E`,sVe=`#E66C37`,cVe=`#6B007B`,lVe=`#E044A7`,uVe=`#744EC2`,dVe=`#D9B300`,fVe=`#D64550`,_5=g5,v5=`#DEEFFF`,y5=[v5,_5],pVe={view:{stroke:h5},background:h5,font:d5,header:{titleFont:f5,titleFontSize:u5,titleColor:p5,labelFont:d5,labelFontSize:l5,labelColor:m5},axis:{ticks:!1,grid:!1,domain:!1,labelColor:m5,labelFontSize:c5,titleFont:f5,titleColor:p5,titleFontSize:u5,titleFontWeight:`normal`},axisQuantitative:{tickCount:3,grid:!0,gridColor:aVe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:g5},line:{stroke:g5,strokeWidth:3,strokeCap:`round`,strokeJoin:`round`},text:{font:d5,fontSize:c5,fill:m5},arc:{fill:g5},area:{fill:g5,line:!0,opacity:.6},path:{stroke:g5},rect:{fill:g5},point:{fill:g5,filled:!0,size:75},shape:{stroke:g5},symbol:{fill:g5,strokeWidth:1.5,size:50},legend:{titleFont:d5,titleFontWeight:`bold`,titleColor:m5,labelFont:d5,labelFontSize:l5,labelColor:m5,symbolType:`circle`,symbolSize:75},range:{category:[g5,oVe,sVe,cVe,lVe,uVe,dVe,fVe],diverging:y5,heatmap:y5,ordinal:[v5,`#c7e4ff`,`#b0d9ff`,`#9aceff`,`#83c3ff`,`#6cb9ff`,`#55aeff`,`#3fa3ff`,`#2898ff`,_5]}},b5=`IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif`,mVe=`IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif`,x5=400,S5={textPrimary:{g90:`#f4f4f4`,g100:`#f4f4f4`,white:`#161616`,g10:`#161616`},textSecondary:{g90:`#c6c6c6`,g100:`#c6c6c6`,white:`#525252`,g10:`#525252`},layerAccent01:{white:`#e0e0e0`,g10:`#e0e0e0`,g90:`#525252`,g100:`#393939`},gridBg:{white:`#ffffff`,g10:`#ffffff`,g90:`#161616`,g100:`#161616`}},hVe=[`#8a3ffc`,`#33b1ff`,`#007d79`,`#ff7eb6`,`#fa4d56`,`#fff1f1`,`#6fdc8c`,`#4589ff`,`#d12771`,`#d2a106`,`#08bdba`,`#bae6ff`,`#ba4e00`,`#d4bbff`],gVe=[`#6929c4`,`#1192e8`,`#005d5d`,`#9f1853`,`#fa4d56`,`#570408`,`#198038`,`#002d9c`,`#ee538b`,`#b28600`,`#009d9a`,`#012749`,`#8a3800`,`#a56eff`],_Ve=P8({theme:`white`,background:`#ffffff`}),vVe=P8({theme:`g10`,background:`#f4f4f4`}),yVe=P8({theme:`g90`,background:`#262626`}),bVe=P8({theme:`g100`,background:`#161616`}),xVe=BBe.version}));function CVe(e,t,n,r){if(H(e))return`[${e.map(e=>t(xg(e)?e:TVe(e,n))).join(`, `)}]`;if(Eh(e)){let i=``,{title:a,image:o,...s}=e;a&&(i+=`

${t(a)}

`),o&&(i+=``);let c=Object.keys(s);if(c.length>0){i+=``;for(let e of c){let r=s[e];r!==void 0&&(Eh(r)&&(r=TVe(r,n)),i+=``)}i+=`
${t(e)}${t(r)}
`}return i||`{}`}return t(e)}function wVe(e){let t=[];return function(n,r){if(typeof r!=`object`||!r)return r;let i=t.indexOf(this)+1;return t.length=i,t.length>e?`[Object]`:t.indexOf(r)>=0?`[Circular]`:(t.push(r),r)}}function TVe(e,t){return JSON.stringify(e,wVe(t))}function EVe(e){return String(e).replace(/&/g,`&`).replace(/=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function NVe(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}var PVe,FVe,C5,IVe,LVe,RVe=o((()=>{Ag(),PVe={version:`1.0.0`},FVe=`#vg-tooltip-element { + : v !== v && u === u ? ${r} : `}function rTe(e){let t=this;eTe(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function iTe(e){let t=this;if(e.params){let n=t.get(e.id);n||V(`Invalid operator id: `+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function aTe(e,t){t||={};let n=this;for(let r in e){let i=e[r];t[r]=H(i)?i.map(e=>XW(e,n,t)):XW(i,n,t)}return t}function XW(e,t,n){if(!e||!Hm(e))return e;for(let r=0,i=rG.length,a;re&&e.$tupleid?Eb:e);return t.fn[n]||(t.fn[n]=Sh(r,e.$order,t.expr.codegen))}function dTe(e,t){let n=e.$encode,r={};for(let e in n){let i=n[e];r[e]=bm(t.encodeExpression(i.$expr),i.$fields),r[e].output=i.$output}return r}function fTe(e,t){return t}function pTe(e,t){let n=e.$subflow;return function(e,r,i){let a=t.fork().parse(n),o=a.get(n.operators[0].id),s=a.signals.parent;return s&&s.set(i),o.detachSubflow=()=>t.detach(a),o}}function mTe(){return Eb}function hTe(e){var t=this,n=e.filter==null?void 0:t.eventExpression(e.filter),r=e.stream==null?void 0:t.get(e.stream),i;e.source?r=t.events(e.source,e.type,n):e.merge&&(i=e.merge.map(e=>t.get(e)),r=i[0].merge.apply(i[0],i.slice(1))),e.between&&(i=e.between.map(e=>t.get(e)),r=r.between(i[0],i[1])),e.filter&&(r=r.filter(n)),e.throttle!=null&&(r=r.throttle(+e.throttle)),e.debounce!=null&&(r=r.debounce(+e.debounce)),r??V(`Invalid stream definition: `+JSON.stringify(e)),e.consume&&r.consume(!0),t.stream(e,r)}function gTe(e){var t=this,n=Hm(n=e.source)?n.$ref:n,r=t.get(n),i=null,a=e.update,o=void 0;r||V(`Source not defined: `+e.source),i=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),a&&a.$expr&&(a.$params&&(o=t.parseParameters(a.$params)),a=t.handlerExpression(a.$expr)),t.update(e,r,i,a,o)}function _Te(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(n=>{let i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(n=>{let r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(t=>t.getState(e))),n}function vTe(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(e=>{n.update(t.signals[e],i[e],iG)}),Object.keys(r||{}).forEach(e=>{n.pulse(t.data[e].input,n.changeset().remove(Lm).insert(r[e]))}),(e.subcontext||[]).forEach((e,n)=>{let r=t.subcontext[n];r&&r.setState(e)})}function ZW(e,t,n,r){return new QW(e,t,n,r)}function QW(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||nG,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function $W(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}var eG,tG,nG,rG,iG,aG=o((()=>{dg(),nx(),eG=cg([`rule`]),tG=cg([`group`,`image`,`rect`]),nG={operator:(e,t)=>YW(e,[`_`],t.code),parameter:(e,t)=>YW(e,[`datum`,`_`],t.code),event:(e,t)=>YW(e,[`event`],t.code),handler:(e,t)=>YW(e,[`_`,`event`],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{let{marktype:n,channels:r}=t,i=`var o=item,datum=o.datum,m=0,$;`;for(let e in r){let t=`o[`+W(e)+`]`;i+=`$=${r[e].code};if(${t}!==$)${t}=$,m=1;`}return i+=$we(r,n),i+=`return m;`,YW(e,[`item`,`_`],i)},codegen:{get(e){let t=`[${e.map(W).join(`][`)}]`,n=Function(`_`,`return _${t};`);return n.path=t,n},comparator(e,t){let n,r=Function(`a`,`b`,`var u, v; return `+e.map((e,r)=>{let i=t[r],a,o;return e.path?(a=`a${e.path}`,o=`b${e.path}`):((n||={})[`f`+r]=e,a=`this.f${r}(a)`,o=`this.f${r}(b)`),nTe(a,o,-i,i)}).join(``)+`0;`);return n?r.bind(n):r}}},rG=[{key:`$ref`,parse:oTe},{key:`$key`,parse:cTe},{key:`$expr`,parse:sTe},{key:`$field`,parse:lTe},{key:`$encode`,parse:dTe},{key:`$compare`,parse:uTe},{key:`$context`,parse:fTe},{key:`$subflow`,parse:pTe},{key:`$tupleid`,parse:mTe}],iG={skip:!0},QW.prototype=$W.prototype={fork(){let e=new $W(this);return(this.subcontext||=[]).push(e),e},detach(e){this.subcontext=this.subcontext.filter(t=>t!==e);let t=Object.keys(e.nodes);for(let n of t)e.nodes[n]._targets=null;for(let n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){let n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),tTe(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push(()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(let r in e.data){let i=n.data[r]||(n.data[r]={});e.data[r].forEach(e=>i[e]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[JW(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:Qwe,parseOperator:rTe,parseOperatorParameters:iTe,parseParameters:aTe,parseStream:hTe,parseUpdate:gTe,getState:_Te,setState:vTe}}));function yTe(e){let t=e.container();t&&(t.setAttribute(`role`,`graphics-document`),t.setAttribute(`aria-roleDescription`,`visualization`),oG(t,e.description()))}function oG(e,t){e&&(t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t))}function bTe(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}function xTe(e){let t=e._signals.cursor||(e._signals.cursor=e.add({user:PG,item:null}));e.on(e.events(`view`,`pointermove`),t,(e,n)=>{let r=t.value,i=r?qh(r)?r:r.user:PG,a=n.item&&n.item.cursor||null;return r&&i===r.user&&a==r.item?r:{user:i,item:a}}),e.add(null,function(t){let n=t.cursor,r=this.value;return qh(n)||(r=n.item,n=n.user),sG(e,n&&n!==PG?n:r||n),r},{cursor:t})}function sG(e,t){let n=e.globalCursor()?typeof document<`u`&&document.body:e.container();if(n)return t==null?n.style.removeProperty(`cursor`):n.style.cursor=t}function cG(e,t){var n=e._runtime.data;return Ph(n,t)||V(`Unrecognized data set: `+t),n[t]}function STe(e,t){return arguments.length<2?cG(this,e).values.value:lG.call(this,e,jb().remove(Lm).insert(t))}function lG(e,t){Fce(t)||V(`Second argument to changes must be a changeset.`);let n=cG(this,e);return n.modified=!0,this.pulse(n.input,t)}function CTe(e,t){return lG.call(this,e,jb().insert(t))}function wTe(e,t){return lG.call(this,e,jb().remove(t))}function uG(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function dG(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function fG(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function TTe(e){var t=fG(e),n=uG(e),r=dG(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach(t=>{try{t(n,r)}catch(t){e.error(t)}})}function ETe(e,t,n){var r=e._renderer,i=r&&r.canvas(),a,o,s;return i&&(s=fG(e),o=t.changedTouches?t.changedTouches[0]:t,a=Ik(o,i),a[0]-=s[0],a[1]-=s[1]),t.dataflow=e,t.item=n,t.vega=DTe(e,n,a),t}function DTe(e,t,n){let r=t?t.mark.marktype===`group`?t:t.mark.group:null;function i(e){var n=r,i;if(e){for(i=t;i;i=i.mark.group)if(i.mark.name===e){n=i;break}}return n&&n.mark&&n.mark.interactive?n:{}}function a(e){if(!e)return n;qh(e)&&(e=i(e));let t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:Oh(e),item:Oh(t||{}),group:i,xy:a,x:e=>a(e)[0],y:e=>a(e)[1]}}function OTe(e){let t=Ah({defaults:{}},e),n=(e,t)=>{t.forEach(t=>{H(e[t])&&(e[t]=cg(e[t]))})};return n(t.defaults,[`prevent`,`allow`]),n(t,[`view`,`window`,`selector`]),t}function pG(e,t,n,r){e._eventListeners.push({type:n,sources:_h(t),handler:r})}function kTe(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[t]:i?!i[t]:e.preventDefault()}function mG(e,t,n){let r=e._eventConfig&&e._eventConfig[t];return r===!1||Hm(r)&&!r[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function ATe(e,t,n){var r=this,i=new Pb(n),a=function(n,a){r.runAsync(null,()=>{e===FG&&kTe(r,t)&&n.preventDefault(),i.receive(ETe(r,n,a))})},o;if(e===IG)mG(r,`timer`,t)&&r.timer(a,t);else if(e===FG)mG(r,`view`,t)&&r.addEventListener(t,a,RG);else if(e===LG?mG(r,`window`,t)&&typeof window<`u`&&(o=[window]):typeof document<`u`&&mG(r,`selector`,t)&&(o=Array.from(document.querySelectorAll(e))),!o)r.warn(`Can not resolve event source: `+e);else{for(var s=0,c=o.length;s=0;)t[i].stop();for(i=r.length;--i>=0;)for(o=r[i],a=o.sources.length;--a>=0;)o.sources[a].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),i=n.length;--i>=0;)c=n[i].type,s=n[i].handler,this._handler.off(c,s);return this}function vG(e,t,n){let r=document.createElement(e);for(let e in t)r.setAttribute(e,t[e]);return n!=null&&(r.textContent=n),r}function NTe(e,t,n){if(!t)return;let r=n.param,i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,t)})}},r.debounce&&(i.update=kh(r.debounce,i.update))),(r.input==null&&r.element?PTe:ITe)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function PTe(e,t,n,r){let i=n.event||`input`,a=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,a),pG(r,t,i,a),e.set=e=>{t.value=e,t.dispatchEvent(FTe(i))}}function FTe(e){return typeof Event<`u`?new Event(e):{type:e}}function ITe(e,t,n,r){let i=r.signal(n.signal),a=vG(`div`,{class:zG}),o=n.input===`radio`?a:a.appendChild(vG(`label`));o.appendChild(vG(`span`,{class:BG},n.name||n.signal)),t.appendChild(a);let s=LTe;switch(n.input){case`checkbox`:s=RTe;break;case`select`:s=zTe;break;case`radio`:s=BTe;break;case`range`:s=VTe;break}s(e,o,n,i)}function LTe(e,t,n,r){let i=vG(`input`);for(let e in n)e!==`signal`&&e!==`element`&&i.setAttribute(e===`input`?`type`:e,n[e]);i.setAttribute(`name`,n.signal),i.value=r,t.appendChild(i),i.addEventListener(`input`,()=>e.update(i.value)),e.elements=[i],e.set=e=>i.value=e}function RTe(e,t,n,r){let i={type:`checkbox`,name:n.signal};r&&(i.checked=!0);let a=vG(`input`,i);t.appendChild(a),a.addEventListener(`change`,()=>e.update(a.checked)),e.elements=[a],e.set=e=>a.checked=!!e||null}function zTe(e,t,n,r){let i=vG(`select`,{name:n.signal}),a=n.labels||[];n.options.forEach((e,t)=>{let n={value:e};yG(e,r)&&(n.selected=!0),i.appendChild(vG(`option`,n,(a[t]||e)+``))}),t.appendChild(i),i.addEventListener(`change`,()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{let s={type:`radio`,name:n.signal,value:t};yG(t,r)&&(s.checked=!0);let c=vG(`input`,s);c.addEventListener(`change`,()=>e.update(t));let l=vG(`label`,{},(a[o]||t)+``);return l.prepend(c),i.appendChild(l),c}),e.set=t=>{let n=e.elements,r=n.length;for(let e=0;e{c.textContent=s.value,e.update(+s.value)};s.addEventListener(`input`,l),s.addEventListener(`change`,l),e.elements=[s],e.set=e=>{s.value=e,c.textContent=e}}function yG(e,t){return e===t||e+``==t+``}function bG(e,t,n,r,i,a){return t||=new r(e.loader()),t.initialize(n,uG(e),dG(e),fG(e),i,a).background(e.background())}function xG(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function HTe(e,t,n,r){let i=new r(e.loader(),xG(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,fG(e),e);return t&&t.handlers().forEach(e=>{i.on(e.type,e.handler)}),i}function UTe(e,t){let n=this,r=n._renderType,i=n._eventConfig.bind,a=Uk(r);e=n._el=e?SG(n,e,!0):null,yTe(n),a||n.error(`Unrecognized renderer type: `+r);let o=a.handler||rj,s=e?a.renderer:a.headless;return n._renderer=s?bG(n,n._renderer,e,s):null,n._handler=HTe(n,n._handler,e,o),n._redraw=!0,e&&i!==`none`&&(t=t?n._elBind=SG(n,t,!0):e.appendChild(vG(`form`,{class:`vega-bindings`})),n._bind.forEach(e=>{e.param.element&&i!==`container`&&(e.element=SG(n,e.param.element,!!e.param.input))}),n._bind.forEach(e=>{NTe(n,e.element||t,e)})),n}function SG(e,t,n){if(typeof t==`string`)if(typeof document<`u`){if(t=document.querySelector(t),!t)return e.error(`Signal bind element not found: `+t),null}else return e.error(`DOM document instance not found.`),null;if(t&&n)try{t.textContent=``}catch(n){t=null,e.error(n)}return t}function CG(e){return Hm(e)?{top:HG(e.top),bottom:HG(e.bottom),left:HG(e.left),right:HG(e.right)}:UG(HG(e))}async function wG(e,t,n,r){let i=Uk(t),a=i&&i.headless;return a||V(`Unrecognized renderer type: `+t),await e.runAsync(),bG(e,null,null,a,n,r).renderAsync(e._scenegraph.root)}async function WTe(e,t){e!==zj.Canvas&&e!==zj.SVG&&e!==zj.PNG&&V(`Unrecognized image type: `+e);let n=await wG(this,e,t);return e===zj.SVG?GTe(n.svg(),`image/svg+xml`):n.canvas().toDataURL(`image/png`)}function GTe(e,t){let n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function KTe(e,t){return(await wG(this,zj.Canvas,e,t)).canvas()}async function qTe(e){return(await wG(this,zj.SVG,e)).svg()}function JTe(e,t,n){return ZW(e,tx,BW,n).parse(t)}function YTe(e){var t=this._runtime.scales;return Ph(t,e)||V(`Unrecognized scale or projection: `+e),t[e].value}function TG(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===KG?r.left+r.right:0)}function EG(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===KG?r.top+r.bottom:0)}function XTe(e){var t=e._signals,n=t[WG],r=t[GG],i=t[KG];function a(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,t=>{e._width=t.size,e._viewWidth=TG(e,t.size),a()},{size:n}),e._resizeHeight=e.add(null,t=>{e._height=t.size,e._viewHeight=EG(e,t.size),a()},{size:r});let o=e.add(null,a,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,o.rank=i.rank+1}function ZTe(e,t,n,r,i,a){this.runAfter(o=>{let s=0;o._autosize=0,o.width()!==n&&(s=1,o.signal(WG,n,qG),o._resizeWidth.skip(!0)),o.height()!==r&&(s=1,o.signal(GG,r,qG),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==i[0]||o._origin[1]!==i[1])&&(o._resize=1,o._origin=i),s&&o.run(`enter`),a&&o.runAfter(e=>e.resize())},!1,1)}function QTe(e){return this._runtime.getState(e||{data:$Te,signals:eEe,recurse:!0})}function $Te(e,t){return t.modified&&H(t.input.value)&&!e.startsWith(`_:vega:_`)}function eEe(e,t){return!(e===`parent`||t instanceof tx.proxy)}function tEe(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},e=>{e._trigger=!0}),this}function nEe(e,t){function n(t){e({timestamp:Date.now(),elapsed:t})}this._timers.push(Tbe(n,t))}function rEe(e,t,n,r){let i=e.element();i&&i.setAttribute(`title`,iEe(r))}function iEe(e){return e==null?``:H(e)?DG(e):Hm(e)&&!Vh(e)?aEe(e):e+``}function aEe(e){return Object.keys(e).map(t=>{let n=e[t];return t+`: `+(H(n)?DG(n):OG(n))}).join(` +`)}function DG(e){return`[`+e.map(OG).join(`, `)+`]`}function OG(e){return H(e)?`[…]`:Hm(e)&&!Vh(e)?`{…}`:e}function oEe(){if(this.renderer()===`canvas`&&this._renderer._canvas){let e=null,t=()=>{e?.();let n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener(`change`,t),e=()=>{n.removeEventListener(`change`,t)},this._renderer._canvas.getContext(`2d`).pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function kG(e,t){let n=this;if(t||={},Bb.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){let r=Ah({},e.locale,t.locale);n.locale(oce(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||zj.Canvas,n._scenegraph=new FA;let r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||rEe,n._redraw=!0,n._handler=new rj().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=OTe(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);let i=JTe(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(e=>({state:null,param:Ah({},e)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=TG(n,n._width),n._viewHeight=EG(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,XTe(n),bTe(n),xTe(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function AG(e,t){return Ph(e._signals,t)?e._signals[t]:V(`Unrecognized signal name: `+W(t))}function jG(e,t){let n=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return n.length?n[0]:null}function MG(e,t,n,r){let i=jG(n,r);return i||(i=xG(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function NG(e,t,n){let r=jG(t,n);return r&&t._targets.remove(r),e}var PG,FG,IG,LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,qG,sEe=o((()=>{dg(),nx(),Uj(),m_(),qW(),aG(),sz(),pb(),PG=`default`,FG=`view`,IG=`timer`,LG=`window`,RG={trap:!1},zG=`vega-bind`,BG=`vega-bind-name`,VG=`vega-bind-radio`,HG=e=>+e||0,UG=e=>({top:e,bottom:e,left:e,right:e}),WG=`width`,GG=`height`,KG=`padding`,qG={skip:!0},U(kG,Bb,{async evaluate(e,t,n){if(await Bb.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,TTe(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}return n&&wb(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){let t=e==null?null:e+``;return t!==this._desc&&oG(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){let r=AG(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal(`width`,e):this.signal(`width`)},height(e){return arguments.length?this.signal(`height`,e):this.signal(`height`)},padding(e){return arguments.length?this.signal(`padding`,CG(e)):CG(this.signal(`padding`))},autosize(e){return arguments.length?this.signal(`autosize`,e):this.signal(`autosize`)},background(e){return arguments.length?this.signal(`background`,e):this.signal(`background`)},renderer(e){return arguments.length?(Uk(e)||V(`Unrecognized renderer type: `+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Bb.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(AG(this,`autosize`))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:ZTe,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=xG(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,a;--r>=0;)if(a=n[r].type,i=n[r].handler,e===a&&(t===i||t===i.raw)){this._handler.off(a,i);break}return this},addResizeListener(e){let t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return MG(this,e,AG(this,e),t)},removeSignalListener(e,t){return NG(this,AG(this,e),t)},addDataListener(e,t){return MG(this,e,cG(this,e).values,t)},removeDataListener(e,t){return NG(this,cG(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){let t=sG(this,null);this._globalCursor=!!e,t&&sG(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:nEe,events:ATe,finalize:MTe,hover:jTe,data:STe,change:lG,insert:CTe,remove:wTe,scale:YTe,initialize:UTe,toImageURL:WTe,toCanvas:KTe,toSVG:qTe,getState:QTe,setState:tEe,_watchPixelRatio:oEe})}));function JG(e,t,n){return lK=t||QG,uK=n||cK,XG(e.trim()).map(ZG)}function cEe(e){return uK[e]}function YG(e,t,n,r,i){let a=e.length,o=0,s;for(;t' after between selector: `+e;r=r.map(ZG);let i=ZG(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function uEe(e){let t={source:lK},n=[],r=[0,0],i=0,a=0,o=e.length,s=0,c,l;if(e[o-1]===nK){if(s=e.lastIndexOf(tK),s>=0){try{r=dEe(e.substring(s+1,o-1))}catch{throw`Invalid throttle specification: `+e}e=e.slice(0,s).trim(),o=e.length}else throw`Unmatched right brace: `+e;s=0}if(!o)throw e;if(e[0]===aK&&(i=++s),c=YG(e,s,rK),c1?(t.type=n[1],i?t.markname=n[0].slice(1):cEe(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)===`!`&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function dEe(e){let t=e.split(iK);if(!e.length||t.length>2)throw e;return t.map(t=>{let n=+t;if(n!==n)throw e;return n})}var QG,$G,eK,tK,nK,rK,iK,aK,oK,sK,cK,lK,uK,dK=o((()=>{QG=`view`,$G=`[`,eK=`]`,tK=`{`,nK=`}`,rK=`:`,iK=`,`,aK=`@`,oK=`>`,sK=/[[\]{}]/,cK={"*":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}}));function fEe(e){return Hm(e)?e:{type:e||`pad`}}function pEe(e){return Hm(e)?e.signal?e:{top:Sq(e.top),bottom:Sq(e.bottom),left:Sq(e.left),right:Sq(e.right)}:Cq(Sq(e))}function fK(e,t,n,r){return n==null?0:(Hm(n)&&!H(n)||H(n)&&n.length&&Hm(n[0])?e.update[t]=n:e[r||`enter`][t]={value:n},1)}function pK(e,t,n){for(let n in t)fK(e,n,t[n]);for(let t in n)fK(e,t,n[t],`update`)}function mK(e,t,n){for(let r in t)n&&Ph(n,r)||(e[r]=Ah(e[r]||{},t[r]));return e}function hK(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function mEe(e,t,n,r,i){let a={},o={},s,c,l,u;for(c in c=`lineBreak`,t===`text`&&i[c]!=null&&!hK(c,e)&&gK(a,c,i[c]),(n==`legend`||String(n).startsWith(`axis`))&&(n=null),u=n===`frame`?i.group:n===`mark`?Ah({},i.mark,i[t]):null,u)l=hK(c,e)||(c===`fill`||c===`stroke`)&&(hK(`fill`,e)||hK(`stroke`,e)),l||gK(a,c,u[c]);for(c in _h(r).forEach(t=>{let n=i.style&&i.style[t];for(let t in n)hK(t,e)||gK(a,t,n[t])}),e=Ah({},e),a)u=a[c],u.signal?(s||={})[c]=u:o[c]=u;return e.enter=Ah(o,e.enter),s&&(e.update=Ah(s,e.update)),e}function gK(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}function _K(e){if(e.gradient!=null)return gEe(e);let t=e.signal?`(${e.signal})`:e.color?hEe(e.color):e.field==null?e.value===void 0?void 0:W(e.value):yK(e.field);return e.scale!=null&&(t=_Ee(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${vK(e.exponent)})`),e.mult!=null&&(t+=`*${vK(e.mult)}`),e.offset!=null&&(t+=`+${vK(e.offset)}`),e.round&&(t=`round(${t})`),t}function hEe(e){return e.c?Wq(`hcl`,e.h,e.c,e.l):e.h||e.s?Wq(`hsl`,e.h,e.s,e.l):e.l||e.a?Wq(`lab`,e.l,e.a,e.b):e.r||e.g||e.b?Wq(`rgb`,e.r,e.g,e.b):null}function gEe(e){let t=[e.start,e.stop,e.count].map(e=>e==null?null:W(e));for(;t.length&&qm(t)==null;)t.pop();return t.unshift(Uq(e.gradient)),`gradient(${t.join(`,`)})`}function vK(e){return Hm(e)?`(`+_K(e)+`)`:e}function yK(e){return bK(Hm(e)?e:{datum:e})}function bK(e){let t,n,r;if(e.signal)t=`datum`,r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t=`item`;n-->0;)t+=`.mark.group`;e.parent?(r=e.parent,t+=`.datum`):r=e.group}else e.datum?(t=`datum`,r=e.datum):V(`Invalid field reference: `+W(e));return e.signal||(r=qh(r)?km(r).map(W).join(`][`):bK(r)),t+`[`+r+`]`}function _Ee(e,t){let n=Uq(e.scale);return e.range==null?(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+`+`:``)+`_bandwidth(${n})`+(+e.band==1?``:`*`+vK(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t??=`0`):t=`lerp(_range(${n}), ${+e.range})`,t}function vEe(e){let t=``;return e.forEach(e=>{let n=_K(e);t+=e.test?`(${e.test})?${n}:`:n}),qm(t)===`:`&&(t+=`null`),t}function xK(e,t,n,r,i,a){let o={};a||={},a.encoders={$encode:o},e=mEe(e,t,n,r,i.config);for(let n in e)o[n]=yEe(e[n],t,a,i);return a}function yEe(e,t,n,r){let i={},a={};for(let t in e)e[t]!=null&&(i[t]=xEe(bEe(e[t]),r,n,a));return{$expr:{marktype:t,channels:i},$fields:Object.keys(a),$output:Object.keys(e)}}function bEe(e){return H(e)?vEe(e):_K(e)}function xEe(e,t,n,r){let i=EW(e,t);return i.$fields.forEach(e=>r[e]=1),Ah(n,i.$params),i.$expr}function SK(e,t){V(e+` for "outer" push: `+W(t))}function CK(e,t){let n=e.name;if(e.push===Gq)t.signals[n]||SK(`No prior signal definition`,n),Kq.forEach(t=>{e[t]!==void 0&&SK(`Invalid property `,t)});else{let r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function wK(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function TK(e,t,n,r){return new wK(e,t,n,r)}function EK(e,t){return TK(`operator`,e,t)}function DK(e){let t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function OK(e,t){return t?{$field:e,$name:t}:{$field:e}}function kK(e,t){return{$compare:e,$order:t}}function SEe(e,t){let n={$key:e};return t&&(n.$flat=!0),n}function CEe(e){return Hm(e)?(e.order===Yq?`-`:`+`)+AK(e.op,e.field):``}function AK(e,t){return(e&&e.signal?`$`+e.signal:e||``)+(e&&t?`_`:``)+(t&&t.signal?`$`+t.signal:t?.replace(/\W+/g,`_`).replace(/^_+|_+$/g,``)||``)}function jK(e){return e&&e.signal}function wEe(e){return e&&e.expr}function MK(e){if(jK(e))return!0;if(Hm(e)){for(let t in e)if(MK(e[t]))return!0}return!1}function NK(e,t){return e??t}function PK(e){return e&&e.signal||e}function FK(e,t){return(e.merge?EEe:e.stream?DEe:e.type?OEe:V(`Invalid stream specification: `+W(e)))(e,t)}function TEe(e){return e===Xq?Zq:e||Zq}function EEe(e,t){let n=IK({merge:e.merge.map(e=>FK(e,t))},e,t);return t.addStream(n).id}function DEe(e,t){let n=IK({stream:FK(e.stream,t)},e,t);return t.addStream(n).id}function OEe(e,t){let n;e.type===Qq?(n=t.event(Qq,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(TEe(e.source),e.type);let r=IK({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function IK(e,t,n){let r=t.between;return r&&(r.length!==2&&V(`Stream "between" parameter must have 2 entries: `+W(t)),e.between=[FK(r[0],n),FK(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(kEe(t.marktype,t.markname,t.markrole)),t.source===Xq&&r.push(`inScope(event.item)`),r.length&&(e.filter=EW(`(`+r.join(`)&&(`)+`)`,n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function kEe(e,t,n){return`event.item`+(e&&e!==`*`?`&&event.item.mark.marktype==='`+e+`'`:``)+(n?`&&event.item.mark.role==='`+n+`'`:``)+(t?`&&event.item.mark.name==='`+t+`'`:``)}function AEe(e,t,n){let r=e.encode,i={target:n},a=e.events,o=e.update,s=[];a||V(`Signal update missing events specification.`),qh(a)&&(a=JG(a,t.isSubscope()?Xq:Zq)),a=_h(a).filter(e=>e.signal||e.scale?(s.push(e),0):1),s.length>1&&(s=[MEe(s)]),a.length&&s.push(a.length>1?{merge:a}:a[0]),r!=null&&(o&&V(`Signal encode and update are mutually exclusive.`),o=`encode(item(),`+W(r)+`)`),i.update=qh(o)?EW(o,t):o.expr==null?o.value==null?o.signal==null?V(`Invalid signal update specification.`):{$expr:$q,$params:{$value:t.signalRef(o.signal)}}:o.value:EW(o.expr,t),e.force&&(i.options={force:!0}),s.forEach(e=>t.addUpdate(Ah(jEe(e,t),i)))}function jEe(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):FK(e,t)}}function MEe(e){return{signal:`[`+e.map(e=>e.scale?`scale("`+e.scale+`")`:e.signal)+`]`}}function NEe(e,t){let n=t.getSignal(e.name),r=e.update;e.init&&(r?V(`Signals can not include both init and update expressions.`):(r=e.init,n.initonly=!0)),r&&(r=EW(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(e=>AEe(e,t,n.id))}function PEe(e,t){let n=e.type||`linear`;xD(n)||V(`Unrecognized scale type: `+W(n)),t.addScale(e.name,{type:n,domain:void 0})}function FEe(e,t){let n=t.getScale(e.name).params,r;for(r in n.domain=BK(e.domain,e,t),e.range!=null&&(n.range=HK(e,t,n)),e.interpolate!=null&&GEe(e.interpolate,n),e.nice!=null&&(n.nice=WEe(e.nice,t)),e.bins!=null&&(n.bins=UEe(e.bins,t)),e)Ph(n,r)||r===`name`||(n[r]=LK(e[r],t))}function LK(e,t){return Hm(e)?e.signal?t.signalRef(e.signal):V(`Unsupported object: `+W(e)):e}function RK(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>LK(e,t))}function zK(e){V(`Can not find data set: `+W(e))}function BK(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&V(`No scale domain defined for domainMin/domainMax to override.`);return}return e.signal?n.signalRef(e.signal):(H(e)?IEe:e.fields?REe:LEe)(e,t,n)}function IEe(e,t,n){return e.map(e=>LK(e,n))}function LEe(e,t,n){let r=n.getData(e.data);return r||zK(e.data),wD(t.type)?r.valuesRef(n,e.field,VK(e.sort,!1)):kD(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function REe(e,t,n){let r=e.data,i=e.fields.reduce((e,t)=>(t=qh(t)?{data:r,field:t}:H(t)||t.signal?zEe(t,n):t,e.push(t),e),[]);return(wD(t.type)?BEe:kD(t.type)?VEe:HEe)(e,n,i)}function zEe(e,t){let n=`_:vega:_`+kJ++,r=iJ({});if(H(e))r.value={$ingest:e};else if(e.signal){let i=`setdata(`+W(n)+`,`+e.signal+`)`;r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,TJ({})]),{data:n,field:`data`}}function BEe(e,t,n){let r=VK(e.sort,!0),i,a,o=n.map(e=>{let n=t.getData(e.data);return n||zK(e.data),n.countsRef(t,e.field,r)}),s={groupby:qq,pulse:o};r&&(i=r.op||`count`,a=r.field?AK(i,r.field):`count`,s.ops=[AJ[i]],s.fields=[t.fieldRef(a)],s.as=[a]),i=t.add(tJ(s));let c=t.add(iJ({pulse:DK(i)}));return a=t.add(OJ({field:qq,sort:t.sortRef(r),pulse:DK(c)})),DK(a)}function VK(e,t){return e&&(!e.field&&!e.op?Hm(e)?e.field=`key`:e={field:`key`}:!e.field&&e.op!==`count`?V(`No field provided for sort aggregate op: `+e.op):t&&e.field&&e.op&&!AJ[e.op]&&V(`Multiple domain scales can not be sorted using `+e.op)),e}function VEe(e,t,n){let r=n.map(e=>{let n=t.getData(e.data);return n||zK(e.data),n.domainRef(t,e.field)});return DK(t.add(gJ({values:r})))}function HEe(e,t,n){let r=n.map(e=>{let n=t.getData(e.data);return n||zK(e.data),n.extentRef(t,e.field)});return DK(t.add(hJ({extents:r})))}function UEe(e,t){return e.signal||H(e)?RK(e,t):t.objectProperty(e)}function WEe(e,t){return e.signal?t.signalRef(e.signal):Hm(e)?{interval:LK(e.interval),step:LK(e.step)}:LK(e)}function GEe(e,t){t.interpolate=LK(e.type||e),e.gamma!=null&&(t.interpolateGamma=LK(e.gamma))}function HK(e,t,n){let r=t.config.range,i=e.range;if(i.signal)return t.signalRef(i.signal);if(qh(i)){if(r&&Ph(r,i))return e=Ah({},e,{range:r[i]}),HK(e,t,n);i===`width`?i=[0,{signal:`width`}]:i===`height`?i=wD(e.type)?[0,{signal:`height`}]:[{signal:`height`},0]:V(`Unrecognized scale range value: `+W(i))}else if(i.scheme){n.scheme=H(i.scheme)?RK(i.scheme,t):LK(i.scheme,t),i.extent&&(n.schemeExtent=RK(i.extent,t)),i.count&&(n.schemeCount=LK(i.count,t));return}else if(i.step){n.rangeStep=LK(i.step,t);return}else if(wD(e.type)&&!H(i))return BK(i,e,t);else H(i)||V(`Unsupported range type: `+W(i));return i.map(e=>(H(e)?RK:LK)(e,t))}function KEe(e,t){let n=t.config.projection||{},r={};for(let n in e)n!==`name`&&(r[n]=UK(e[n],n,t));for(let e in n)r[e]??(r[e]=UK(n[e],e,t));t.addProjection(e.name,r)}function UK(e,t,n){return H(e)?e.map(e=>UK(e,t,n)):Hm(e)?e.signal?n.signalRef(e.signal):t===`fit`?e:V(`Unsupported parameter object: `+W(e)):e}function WK(e){return e.type=rY,e.interactive=e.interactive||!1,e}function GK(e,t){let n=(n,r)=>NK(e[n],NK(t[n],r));return n.isVertical=n=>IJ===NK(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>NK(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>NK(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>NK(e.columns,NK(t.columns,+n.isVertical(!0))),n}function KK(e,t){let n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function qEe(e,t,n){let r=t.config.style[n];return r&&r[e]}function qK(e,t,n){return`item.anchor === '${LJ}' ? ${e} : item.anchor === '${zJ}' ? ${t} : ${n}`}function JEe(e){let t=e(`tickBand`),n=e(`tickOffset`),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},Hm(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t===`extent`?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e(`bandPosition`),i=e(`tickExtra`)),{extra:i,band:r,offset:n}}function JK(e,t){return t?e?Hm(e)?Object.assign({},e,{offset:JK(e.offset,t)}):{value:e,offset:t}:t:e}function YK(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=mK(e.encode,t,eY)):e.interactive=!1,e}function YEe(e,t,n,r){let i=GK(e,n),a=i.isVertical(),o=i.gradientThickness(),s=i.gradientLength(),c,l,u,d,f;a?(l=[0,1],u=[0,0],d=o,f=s):(l=[0,0],u=[1,0],d=s,f=o);let p={enter:c={opacity:tY,x:tY,y:tY,width:wq(d),height:wq(f)},update:Ah({},c,{opacity:nY,fill:{gradient:t,start:l,stop:u}}),exit:{opacity:tY}};return pK(p,{stroke:i(`gradientStrokeColor`),strokeWidth:i(`gradientStrokeWidth`)},{opacity:i(`gradientOpacity`)}),YK({type:iY,role:Iq,encode:p},r)}function XEe(e,t,n,r,i){let a=GK(e,n),o=a.isVertical(),s=a.gradientThickness(),c=a.gradientLength(),l,u,d,f,p=``;o?(l=`y`,d=`y2`,u=`x`,f=`width`,p=`1-`):(l=`x`,d=`x2`,u=`y`,f=`height`);let m={opacity:tY,fill:{scale:t,field:WJ}};m[l]={signal:p+`datum.perc`,mult:c},m[u]=tY,m[d]={signal:p+`datum.perc2`,mult:c},m[f]=wq(s);let h={enter:m,update:Ah({},m,{opacity:nY}),exit:{opacity:tY}};return pK(h,{stroke:a(`gradientStrokeColor`),strokeWidth:a(`gradientStrokeWidth`)},{opacity:a(`gradientOpacity`)}),YK({type:iY,role:Pq,key:WJ,from:i,encode:h},r)}function XK(e,t,n,r){let i=GK(e,t),a=i.isVertical(),o=wq(i.gradientThickness()),s=i.gradientLength(),c=i(`labelOverlap`),l,u,d,f,p=``,m={enter:l={opacity:tY},update:u={opacity:nY,text:{field:VJ}},exit:{opacity:tY}};return pK(m,{fill:i(`labelColor`),fillOpacity:i(`labelOpacity`),font:i(`labelFont`),fontSize:i(`labelFontSize`),fontStyle:i(`labelFontStyle`),fontWeight:i(`labelFontWeight`),limit:NK(e.labelLimit,t.gradientLabelLimit)}),a?(l.align={value:`left`},l.baseline=u.baseline={signal:uY},d=`y`,f=`x`,p=`1-`):(l.align=u.align={signal:lY},l.baseline={value:`top`},d=`x`,f=`y`),l[d]=u[d]={signal:p+`datum.perc`,mult:s},l[f]=u[f]=o,o.offset=NK(e.labelOffset,t.gradientLabelOffset)||0,c=c?{separation:i(`labelSeparation`),method:c,order:`datum.index`}:void 0,YK({type:sY,role:Lq,style:GJ,key:WJ,from:r,encode:m,overlap:c},n)}function ZEe(e,t,n,r,i){let a=GK(e,t),o=n.entries,s=!!(o&&o.interactive),c=o?o.name:void 0,l=a(`clipHeight`),u=a(`symbolOffset`),d={data:`value`},f=`(${i}) ? datum.${HJ} : datum.${QJ}`,p=l?wq(l):{field:QJ},m=`datum.${BJ}`,h=`max(1, ${i})`,g,_,v,y,b;p.mult=.5,g={enter:_={opacity:tY,x:{signal:f,mult:.5,offset:u},y:p},update:v={opacity:nY,x:_.x,y:_.y},exit:{opacity:tY}};let x=null,S=null;e.fill||(x=t.symbolBaseFillColor,S=t.symbolBaseStrokeColor),pK(g,{fill:a(`symbolFillColor`,x),shape:a(`symbolType`),size:a(`symbolSize`),stroke:a(`symbolStrokeColor`,S),strokeDash:a(`symbolDash`),strokeDashOffset:a(`symbolDashOffset`),strokeWidth:a(`symbolStrokeWidth`)},{opacity:a(`symbolOpacity`)}),$J.forEach(t=>{e[t]&&(v[t]=_[t]={scale:e[t],field:WJ})});let C=YK({type:oY,role:Rq,key:WJ,from:d,clip:l?!0:void 0,encode:g},n.symbols),w=wq(u);w.offset=a(`labelOffset`),g={enter:_={opacity:tY,x:{signal:f,offset:w},y:p},update:v={opacity:nY,text:{field:VJ},x:_.x,y:_.y},exit:{opacity:tY}},pK(g,{align:a(`labelAlign`),baseline:a(`labelBaseline`),fill:a(`labelColor`),fillOpacity:a(`labelOpacity`),font:a(`labelFont`),fontSize:a(`labelFontSize`),fontStyle:a(`labelFontStyle`),fontWeight:a(`labelFontWeight`),limit:a(`labelLimit`)});let T=YK({type:sY,role:Lq,style:GJ,key:WJ,from:d,encode:g},n.labels);return g={enter:{noBound:{value:!l},width:tY,height:l?wq(l):tY,opacity:tY},exit:{opacity:tY},update:v={opacity:nY,row:{signal:null},column:{signal:null}}},a.isVertical(!0)?(y=`ceil(item.mark.items.length / ${h})`,v.row.signal=`${m}%${y}`,v.column.signal=`floor(${m} / ${y})`,b={field:[`row`,m]}):(v.row.signal=`floor(${m} / ${h})`,v.column.signal=`${m} % ${h}`,b={field:m}),v.column.signal=`(${i})?${v.column.signal}:${m}`,r={facet:{data:r,name:`value`,groupby:BJ}},WK({role:Eq,from:r,encode:mK(g,o,eY),marks:[C,T],name:c,interactive:s,sort:b})}function QEe(e,t){let n=GK(e,t);return{align:n(`gridAlign`),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n(`rowPadding`),column:n(`columnPadding`)}}}function $Ee(e,t,n,r){let i=GK(e,t),a={enter:{opacity:tY},update:{opacity:nY,x:{field:{group:`padding`}},y:{field:{group:`padding`}}},exit:{opacity:tY}};return pK(a,{orient:i(`titleOrient`),_anchor:i(`titleAnchor`),anchor:{signal:_Y},angle:{signal:vY},align:{signal:gY},baseline:{signal:yY},text:e.title,fill:i(`titleColor`),fillOpacity:i(`titleOpacity`),font:i(`titleFont`),fontSize:i(`titleFontSize`),fontStyle:i(`titleFontStyle`),fontWeight:i(`titleFontWeight`),limit:i(`titleLimit`),lineHeight:i(`titleLineHeight`)},{align:i(`titleAlign`),baseline:i(`titleBaseline`)}),YK({type:sY,role:zq,style:KJ,from:r,encode:a},n)}function eDe(e,t){let n;return Hm(e)&&(e.signal?n=e.signal:e.path?n=`pathShape(`+ZK(e.path)+`)`:e.sphere&&(n=`geoShape(`+ZK(e.sphere)+`, {type: "Sphere"})`)),n?t.signalRef(n):!!e}function ZK(e){return Hm(e)&&e.signal?e.signal:W(e)}function QK(e){let t=e.role||``;return t.startsWith(`axis`)||t.startsWith(`legend`)||t.startsWith(`title`)?t:e.type===rY?Eq:t||`mark`}function tDe(e){return{marktype:e.type,name:e.name||void 0,role:e.role||QK(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function nDe(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function $K(e,t){let n=fle(e.type);n||V(`Unrecognized transform type: `+W(e.type));let r=TK(n.type.toLowerCase(),null,eq(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function eq(e,t,n){let r={},i=e.params.length;for(let a=0;atq(e,t,n)):tq(e,i,n)}function tq(e,t,n){let r=e.type;if(jK(t))return CY(r)?V(`Expression references can not be signals.`):wY(r)?n.fieldRef(t):TY(r)?n.compareRef(t):n.signalRef(t.signal);{let i=e.expr||wY(r);return i&&bY(t)?n.exprRef(t.expr,t.as):i&&xY(t)?OK(t.field,t.as):CY(r)?EW(t,n):SY(r)?DK(n.getData(t).values):wY(r)?OK(t):TY(r)?n.compareRef(t):t}}function iDe(e,t,n){return qh(t.from)||V(`Lookup "from" parameter must be a string literal.`),n.getData(t.from).lookupRef(n,t.key)}function aDe(e,t,n){let r=t[e.name];return e.array?(H(r)||V(`Expected an array of sub-parameters. Instead: `+W(r)),r.map(t=>nq(e,t,n))):nq(e,r,n)}function nq(e,t,n){let r=e.params.length,i;for(let n=0;ne??`null`).join(`,`)+`),0)`,t);c.update=l.$expr,c.params=l.$params}function lq(e,t){let n=QK(e),r=e.type===rY,i=e.from&&e.from.facet,a=e.overlap,o=e.layout||n===`scope`||n===`frame`,s,c,l,u,d,f,p,m=n===`mark`||o||i,h=oDe(e.from,r,t);c=t.add(oJ({key:h.key||(e.key?OK(e.key):void 0),pulse:h.pulse,clean:!r}));let g=DK(c);c=l=t.add(iJ({pulse:g})),c=t.add(mJ({markdef:tDe(e),interactive:nDe(e.interactive,t),clip:eDe(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef(`parent`):null,index:t.markpath(),pulse:DK(c)}));let _=DK(c);c=u=t.add(sJ(xK(e.encode,e.type,n,e.style,t,{mod:!1,pulse:_}))),c.params.parent=t.encode(),e.transform&&e.transform.forEach(e=>{let n=$K(e,t),r=n.metadata;(r.generates||r.changes)&&V(`Mark transforms should not generate new data.`),r.nomod||(u.params.mod=!0),n.params.pulse=DK(c),t.add(c=n)}),e.sort&&(c=t.add(EJ({sort:t.compareRef(e.sort),pulse:DK(c)})));let v=DK(c);(i||o)&&(o=t.add(DJ({layout:t.objectProperty(e.layout),legends:t.legends,mark:_,pulse:v})),f=DK(o));let y=t.add(rJ({mark:_,pulse:f||v}));p=DK(y),r&&(m&&(s=t.operators,s.pop(),o&&s.pop()),t.pushState(v,f||p,g),i?sDe(e,t,h):m?cDe(e,t,h):t.parse(e),t.popState(),m&&(o&&s.push(o),s.push(y))),a&&(p=lDe(a,p,t));let b=t.add(CJ({pulse:p})),x=t.add(TJ({pulse:DK(b)},void 0,t.parent()));e.name!=null&&(d=e.name,t.addData(d,new iq(t,l,b,x)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&V(`Marks only support modify triggers.`),cq(e,t,d)}))}function lDe(e,t,n){let r=e.method,i=e.bound,a=e.separation,o={separation:jK(a)?n.signalRef(a.signal):a,method:jK(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),i){let e=i.tolerance;o.boundTolerance=jK(e)?n.signalRef(e.signal):+e,o.boundScale=n.scaleRef(i.scale),o.boundOrient=i.orient}return DK(n.add(_J(o)))}function uDe(e,t){let n=t.config.legend,r=e.encode||{},i=GK(e,n),a=r.legend||{},o=a.name||void 0,s=a.interactive,c=a.style,l={},u=0,d,f,p;$J.forEach(t=>e[t]?(l[t]=e[t],u||=e[t]):0),u||V(`Missing valid scale for legend.`);let m=dDe(e,t.scaleType(u)),h={title:e.title!=null,scales:l,type:m,vgrad:m!==`symbol`&&i.isVertical()},g=DK(t.add(iJ(null,[h]))),_={enter:{x:{value:0},y:{value:0}}},v=DK(t.add(fJ(f={type:m,scale:t.scaleRef(u),count:t.objectProperty(i(`tickCount`)),limit:t.property(i(`symbolLimit`)),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return m===XJ?(p=[YEe(e,u,n,r.gradient),XK(e,n,r.labels,v)],f.count=f.count||t.signalRef(`max(2,2*floor((${PK(i.gradientLength())})/100))`)):m===ZJ?p=[XEe(e,u,n,r.gradient,v),XK(e,n,r.labels,v)]:(d=QEe(e,n),p=[ZEe(e,n,r,v,PK(d.columns))],f.size=mDe(e,t,p[0].marks)),p=[WK({role:Fq,from:g,encode:_,marks:p,layout:d,interactive:s})],h.title&&p.push($Ee(e,n,r.title,g)),lq(WK({role:Nq,from:g,encode:mK(pDe(i,e,n),a,eY),marks:p,aria:i(`aria`),description:i(`description`),zindex:i(`zindex`),name:o,interactive:s,style:c}),t)}function dDe(e,t){let n=e.type||YJ;return!e.type&&fDe(e)===1&&(e.fill||e.stroke)&&(n=CD(t)?XJ:TD(t)?ZJ:YJ),n===XJ?TD(t)?ZJ:XJ:n}function fDe(e){return $J.reduce((t,n)=>t+ +!!e[n],0)}function pDe(e,t,n){let r={enter:{},update:{}};return pK(r,{orient:e(`orient`),offset:e(`offset`),padding:e(`padding`),titlePadding:e(`titlePadding`),cornerRadius:e(`cornerRadius`),fill:e(`fillColor`),stroke:e(`strokeColor`),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e(`legendX`),y:e(`legendY`),format:t.format,formatType:t.formatType}),r}function mDe(e,t,n){return EW(`max(ceil(sqrt(${PK(uq(`size`,e,n))})+${PK(uq(`strokeWidth`,e,n))}),${PK(hDe(n[1].encode,t,GJ))})`,t)}function uq(e,t,n){return t[e]?`scale("${t[e]}",datum)`:KK(e,n[0].encode)}function hDe(e,t,n){return KK(`fontSize`,e)||qEe(`fontSize`,t,n)}function gDe(e,t){e=qh(e)?{text:e}:e;let n=GK(e,t.config.title),r=e.encode||{},i=r.group||{},a=i.name||void 0,o=i.interactive,s=i.style,c=[],l=DK(t.add(iJ(null,[{}])));return c.push(yDe(e,n,_De(e),l)),e.subtitle&&c.push(bDe(e,n,r.subtitle,l)),lq(WK({role:Bq,from:l,encode:vDe(n,i),marks:c,aria:n(`aria`),description:n(`description`),zindex:n(`zindex`),name:a,interactive:o,style:s}),t)}function _De(e){let t=e.encode;return t&&t.title||Ah({name:e.name,interactive:e.interactive,style:e.style},t)}function vDe(e,t){let n={enter:{},update:{}};return pK(n,{orient:e(`orient`),anchor:e(`anchor`),align:{signal:cY},angle:{signal:EY},limit:e(`limit`),frame:e(`frame`),offset:e(`offset`)||0,padding:e(`subtitlePadding`)}),mK(n,t,eY)}function yDe(e,t,n,r){let i={value:0},a=e.text,o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return pK(o,{text:a,align:{signal:`item.mark.group.align`},angle:{signal:`item.mark.group.angle`},limit:{signal:`item.mark.group.limit`},baseline:`top`,dx:t(`dx`),dy:t(`dy`),fill:t(`color`),font:t(`font`),fontSize:t(`fontSize`),fontStyle:t(`fontStyle`),fontWeight:t(`fontWeight`),lineHeight:t(`lineHeight`)},{align:t(`align`),angle:t(`angle`),baseline:t(`baseline`)}),YK({type:sY,role:Vq,style:qJ,from:r,encode:o},n)}function bDe(e,t,n,r){let i={value:0},a=e.subtitle,o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return pK(o,{text:a,align:{signal:`item.mark.group.align`},angle:{signal:`item.mark.group.angle`},limit:{signal:`item.mark.group.limit`},baseline:`top`,dx:t(`dx`),dy:t(`dy`),fill:t(`subtitleColor`),font:t(`subtitleFont`),fontSize:t(`subtitleFontSize`),fontStyle:t(`subtitleFontStyle`),fontWeight:t(`subtitleFontWeight`),lineHeight:t(`subtitleLineHeight`)},{align:t(`align`),angle:t(`angle`),baseline:t(`baseline`)}),YK({type:sY,role:Hq,style:JJ,from:r,encode:o},n)}function xDe(e,t){let n=[];e.transform&&e.transform.forEach(e=>{n.push($K(e,t))}),e.on&&e.on.forEach(n=>{cq(n,t,e.name)}),t.addDataPipeline(e.name,SDe(e,t,n))}function SDe(e,t,n){let r=[],i=null,a=!1,o=!1,s,c,l,u,d;for(e.values?jK(e.values)||MK(e.format)?(r.push(fq(t,e)),r.push(i=dq())):r.push(i=dq({$ingest:e.values,$format:e.format})):e.url?MK(e.url)||MK(e.format)?(r.push(fq(t,e)),r.push(i=dq())):r.push(i=dq({$request:e.url,$format:e.format})):e.source&&(i=s=_h(e.source).map(e=>DK(t.getData(e).output)),r.push(null)),c=0,l=n.length;ce==null?!hK(t,r):(n.update[t]=WY(wq(e),n.update[t]),!1),a=i(e(`titleX`),`x`),o=i(e(`titleY`),`y`);n.enter.auto=o===a?wq(o):kY(t,wq(o),wq(a))}function jDe(e,t){let n=CDe(e,t),r=e.encode||{},i=r.axis||{},a=i.name||void 0,o=i.interactive,s=i.style,c=GK(e,n),l=JEe(c),u={scale:e.scale,ticks:!!c(`ticks`),labels:!!c(`labels`),grid:!!c(`grid`),domain:!!c(`domain`),title:e.title!=null},d=DK(t.add(iJ({},[u]))),f=DK(t.add(nJ({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),p=[],m;return u.grid&&p.push(TDe(e,n,r.grid,f,l)),u.ticks&&(m=c(`tickSize`),p.push(DDe(e,n,r.ticks,f,m,l))),u.labels&&(m=u.ticks?m:0,p.push(ODe(e,n,r.labels,f,m,l))),u.domain&&p.push(wDe(e,n,r.domain,d)),u.title&&p.push(kDe(e,n,r.title,d)),lq(WK({role:Dq,from:d,encode:mK(MDe(c,e),i,eY),marks:p,aria:c(`aria`),description:c(`description`),zindex:c(`zindex`),name:a,interactive:o,style:s}),t)}function MDe(e,t){let n={enter:{},update:{}};return pK(n,{orient:e(`orient`),offset:e(`offset`)||0,position:NK(t.position,0),titlePadding:e(`titlePadding`),minExtent:e(`minExtent`),maxExtent:e(`maxExtent`),range:{signal:`abs(span(range("${t.scale}")))`},translate:e(`translate`),format:t.format,formatType:t.formatType}),n}function _q(e,t,n){let r=_h(e.signals),i=_h(e.scales);return n||r.forEach(e=>CK(e,t)),_h(e.projections).forEach(e=>KEe(e,t)),i.forEach(e=>PEe(e,t)),_h(e.data).forEach(e=>xDe(e,t)),i.forEach(e=>FEe(e,t)),(n||r).forEach(e=>NEe(e,t)),_h(e.axes).forEach(e=>jDe(e,t)),_h(e.marks).forEach(e=>lq(e,t)),_h(e.legends).forEach(e=>uDe(e,t)),e.title&&gDe(e.title,t),t.parseLambdas(),t}function NDe(e,t){let n=t.config,r=DK(t.root=t.add(EK())),i=PDe(e,n);i.forEach(e=>CK(e,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;let a=t.add(iJ()),o=t.add(sJ(xK(GY(e.encode),rY,Tq,e.style,t,{pulse:DK(a)}))),s=t.add(DJ({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef(`autosize`),mark:r,pulse:DK(o)}));t.operators.pop(),t.pushState(DK(o),DK(s),null),_q(e,t,i),t.operators.push(s);let c=t.add(rJ({mark:r,pulse:DK(s)}));return c=t.add(CJ({pulse:DK(c)})),c=t.add(TJ({pulse:DK(c)})),t.addData(`root`,new iq(t,a,a,c)),t}function vq(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function PDe(e,t){let n=n=>NK(e[n],t[n]),r=[vq(`background`,n(`background`)),vq(`autosize`,fEe(n(`autosize`))),vq(`padding`,pEe(n(`padding`))),vq(`width`,n(`width`)||0),vq(`height`,n(`height`)||0)],i=r.reduce((e,t)=>(e[t.name]=t,e),{}),a={};return _h(e.signals).forEach(e=>{Ph(i,e.name)?e=Ah(i[e.name],e):r.push(e),a[e.name]=e}),_h(t.signals).forEach(e=>{!Ph(a,e.name)&&!Ph(i,e.name)&&r.push(e)}),r}function yq(e,t){this.config=e||{},this.options=t||{},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 bq(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function xq(e){return(H(e)?FDe:IDe)(e)}function FDe(e){let t=e.length,n=`[`;for(let r=0;r0?`,`:``)+(Hm(t)?t.signal||xq(t):W(t))}return n+`]`}function IDe(e){let t=`{`,n=0,r,i;for(r in e)i=e[r],t+=(++n>1?`,`:``)+W(r)+`:`+(Hm(i)?i.signal||xq(i):W(i));return t+`}`}function LDe(){let e=`sans-serif`,t=`#4c78a8`,n=`#000`,r=`#888`,i=`#ddd`;return{description:`Vega visualization`,padding:0,autosize:`pad`,background:null,events:{defaults:{allow:[`wheel`]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:`bold`},"group-title":{fill:n,font:e,fontSize:13,fontWeight:`bold`},"group-subtitle":{fill:n,font:e,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:i},view:{fill:`transparent`}},title:{orient:`top`,anchor:`middle`,offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,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:i,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:r,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 RDe(e,t,n){return Hm(e)||V(`Input Vega specification must be an object.`),t=Wm(LDe(),t,e.config),NDe(e,new yq(t,n)).toRuntime()}var Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,zDe=o((()=>{dg(),qW(),dK(),AO(),nx(),Sq=e=>+e||0,Cq=e=>({top:e,bottom:e,left:e,right:e}),wq=e=>Hm(e)&&!H(e)?Ah({},e):{value:e},Tq=`frame`,Eq=`scope`,Dq=`axis`,Oq=`axis-domain`,kq=`axis-grid`,Aq=`axis-label`,jq=`axis-tick`,Mq=`axis-title`,Nq=`legend`,Pq=`legend-band`,Fq=`legend-entry`,Iq=`legend-gradient`,Lq=`legend-label`,Rq=`legend-symbol`,zq=`legend-title`,Bq=`title`,Vq=`title-text`,Hq=`title-subtitle`,Uq=e=>qh(e)?W(e):e.signal?`(${e.signal})`:yK(e),Wq=(e,t,n,r)=>`(${e}(${[t,n,r].map(_K).join(`,`)})+'')`,Gq=`outer`,Kq=[`value`,`update`,`init`,`react`,`bind`],qq=OK(`key`),Jq=`ascending`,Yq=`descending`,Xq=`scope`,Zq=`view`,Qq=`timer`,$q={code:`_.$value`,ast:{type:`Identifier`,value:`value`}},eJ=e=>(t,n,r)=>TK(e,n,t||void 0,r),tJ=eJ(`aggregate`),nJ=eJ(`axisticks`),rJ=eJ(`bound`),iJ=eJ(`collect`),aJ=eJ(`compare`),oJ=eJ(`datajoin`),sJ=eJ(`encode`),cJ=eJ(`expression`),lJ=eJ(`facet`),uJ=eJ(`field`),dJ=eJ(`key`),fJ=eJ(`legendentries`),pJ=eJ(`load`),mJ=eJ(`mark`),hJ=eJ(`multiextent`),gJ=eJ(`multivalues`),_J=eJ(`overlap`),vJ=eJ(`params`),yJ=eJ(`prefacet`),bJ=eJ(`projection`),xJ=eJ(`proxy`),SJ=eJ(`relay`),CJ=eJ(`render`),wJ=eJ(`scale`),TJ=eJ(`sieve`),EJ=eJ(`sortitems`),DJ=eJ(`viewlayout`),OJ=eJ(`values`),kJ=0,AJ={min:`min`,max:`max`,count:`sum`},jJ=`top`,MJ=`left`,NJ=`right`,PJ=`bottom`,FJ=`center`,IJ=`vertical`,LJ=`start`,RJ=`middle`,zJ=`end`,BJ=`index`,VJ=`label`,HJ=`offset`,UJ=`perc`,WJ=`value`,GJ=`guide-label`,KJ=`guide-title`,qJ=`group-title`,JJ=`group-subtitle`,YJ=`symbol`,XJ=`gradient`,ZJ=`discrete`,QJ=`size`,$J=[QJ,`shape`,`fill`,`stroke`,`strokeWidth`,`strokeDash`,`opacity`],eY={name:1,style:1,interactive:1},tY={value:0},nY={value:1},rY=`group`,iY=`rect`,aY=`rule`,oY=`symbol`,sY=`text`,cY=qK(W(MJ),W(NJ),W(FJ)),lY=`datum.${UJ}<=0?"${MJ}":datum.${UJ}>=1?"${NJ}":"${FJ}"`,uY=`datum.${UJ}<=0?"${PJ}":datum.${UJ}>=1?"${jJ}":"${RJ}"`,dY=`item.orient === "left"`,fY=`item.orient === "right"`,pY=`(${dY} || ${fY})`,mY=`datum.vgrad && ${pY}`,hY=qK(`"top"`,`"bottom"`,`"middle"`),gY=`datum.vgrad && ${fY} ? (${qK(`"right"`,`"left"`,`"center"`)}) : (${pY} && !(datum.vgrad && ${dY})) ? "left" : ${cY}`,_Y=`item._anchor || (${pY} ? "middle" : "start")`,vY=`${mY} ? (${dY} ? -90 : 90) : 0`,yY=`${pY} ? (datum.vgrad ? (${fY} ? "bottom" : "top") : ${hY}) : "top"`,bY=e=>e&&e.expr,xY=e=>e&&e.field,SY=e=>e===`data`,CY=e=>e===`expr`,wY=e=>e===`field`,TY=e=>e===`compare`,iq.fromEntries=function(e,t){let n=t.length,r=t[n-1],i=t[n-2],a=t[0],o=null,s=1;for(a&&a.type===`load`&&(a=t[1]),e.add(t[0]);se===PJ||e===jJ,OY=(e,t,n)=>jK(e)?FY(e.signal,t,n):e===MJ||e===jJ?t:n,kY=(e,t,n)=>jK(e)?NY(e.signal,t,n):DY(e)?t:n,AY=(e,t,n)=>jK(e)?PY(e.signal,t,n):DY(e)?n:t,jY=(e,t,n)=>jK(e)?IY(e.signal,t,n):e===jJ?{value:t}:{value:n},MY=(e,t,n)=>jK(e)?LY(e.signal,t,n):e===NJ?{value:t}:{value:n},NY=(e,t,n)=>RY(`${e} === '${jJ}' || ${e} === '${PJ}'`,t,n),PY=(e,t,n)=>RY(`${e} !== '${jJ}' && ${e} !== '${PJ}'`,t,n),FY=(e,t,n)=>BY(`${e} === '${MJ}' || ${e} === '${jJ}'`,t,n),IY=(e,t,n)=>BY(`${e} === '${jJ}'`,t,n),LY=(e,t,n)=>BY(`${e} === '${NJ}'`,t,n),RY=(e,t,n)=>(t=t==null?t:wq(t),n=n==null?n:wq(n),zY(t)&&zY(n)?(t=t?t.signal||W(t.value):null,n=n?n.signal||W(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[Ah({test:e},t)].concat(n||[])),zY=e=>e==null||Object.keys(e).length===1,BY=(e,t,n)=>({signal:`${e} ? (${HY(t)}) : (${HY(n)})`}),VY=(e,t,n,r,i)=>({signal:(r==null?``:`${e} === '${MJ}' ? (${HY(r)}) : `)+(n==null?``:`${e} === '${PJ}' ? (${HY(n)}) : `)+(i==null?``:`${e} === '${NJ}' ? (${HY(i)}) : `)+(t==null?``:`${e} === '${jJ}' ? (${HY(t)}) : `)+`(null)`}),HY=e=>jK(e)?e.signal:e==null?null:W(e),UY=(e,t)=>t===0?0:jK(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},WY=(e,t)=>{let n=e.signal;return n&&n.endsWith(`(null)`)?{signal:n.slice(0,-6)+t.signal}:e},GY=e=>mK({enter:{x:{value:0},y:{value:0}},update:{width:{signal:`width`},height:{signal:`height`}}},e),yq.prototype=bq.prototype={parse(e){return _q(e,this)},fork(){return new bq(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(e){return this.operators.push(e),e.id=this.id(),e.refs&&=(e.refs.forEach(t=>{t.$ref=e.id}),null),e},proxy(e){let t=e instanceof wK?DK(e):e;return this.add(xJ({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||={},i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,`input`),n(t.output,e,`output`),n(t.values,e,`values`);for(let r in t.index)n(t.index[r],e,`index:`+r)}return this},pushState(e,t,n){this._encode.push(DK(this.add(TJ({pulse:e})))),this._parent.push(t),this._lookup.push(n?DK(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return qm(this._parent)},encode(){return qm(this._encode)},lookup(){return qm(this._lookup)},markpath(){let e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(qh(e))return OK(e,t);e.signal||V(`Unsupported field reference: `+W(e));let n=e.signal,r=this.field[n];if(!r){let e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=DK(this.add(uJ(e)))}return r},compareRef(e){let t=!1,n=e=>jK(e)?(t=!0,this.signalRef(e.signal)):wEe(e)?(t=!0,this.exprRef(e.expr)):e,r=_h(e.field).map(n),i=_h(e.order).map(n);return t?DK(this.add(aJ({fields:r,orders:i}))):kK(r,i)},keyRef(e,t){let n=!1,r=e=>jK(e)?(n=!0,DK(i[e.signal])):e,i=this.signals;return e=_h(e).map(r),n?DK(this.add(dJ({fields:e,flat:t}))):SEe(e,t)},sortRef(e){if(!e)return e;let t=AK(e.op,e.field),n=e.order||Jq;return n.signal?DK(this.add(aJ({fields:t,orders:this.signalRef(n.signal)}))):kK(t,n)},event(e,t){let n=e+`:`+t;if(!this.events[n]){let r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return Ph(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&V(`Duplicate signal name: `+W(e));let n=t instanceof wK?t:this.add(EK(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||V(`Unrecognized signal name: `+W(e)),this.signals[e]},signalRef(e){return this.signals[e]?DK(this.signals[e]):(Ph(this.lambdas,e)||(this.lambdas[e]=this.add(EK(null))),DK(this.lambdas[e]))},parseLambdas(){let e=Object.keys(this.lambdas);for(let t=0,n=e.length;tHO,CanvasHandler:()=>rj,CanvasRenderer:()=>ij,DATE:()=>_y,DAY:()=>`day`,DAYOFYEAR:()=>vy,Dataflow:()=>Bb,Debug:()=>4,DisallowedObjectProperties:()=>zm,Error:()=>1,EventStream:()=>Pb,Gradient:()=>wpe,GroupItem:()=>WO,HOURS:()=>yy,Handler:()=>IA,HybridHandler:()=>Nj,HybridRenderer:()=>Mj,Info:()=>3,Item:()=>UO,MILLISECONDS:()=>Sy,MINUTES:()=>by,MONTH:()=>hy,Marks:()=>NA,MultiPulse:()=>zb,None:()=>0,Operator:()=>Nb,Parameters:()=>Mb,Pulse:()=>Ib,QUARTER:()=>my,RenderType:()=>zj,Renderer:()=>LA,ResourceLoader:()=>uA,SECONDS:()=>xy,SVGHandler:()=>aj,SVGRenderer:()=>Ej,SVGStringRenderer:()=>Aj,Scenegraph:()=>FA,TIME_UNITS:()=>Cy,Transform:()=>G,View:()=>kG,WEEK:()=>gy,Warn:()=>2,YEAR:()=>py,accessor:()=>bm,accessorFields:()=>Sm,accessorName:()=>xm,array:()=>_h,ascending:()=>wh,bandwidthNRD:()=>ax,bin:()=>wle,bootstrapCI:()=>Ele,boundClip:()=>Phe,boundContext:()=>qO,boundItem:()=>jk,boundMark:()=>Gme,boundStroke:()=>KO,changeset:()=>jb,clampRange:()=>yh,codegenExpression:()=>MH,compare:()=>Sh,constant:()=>Oh,cumulativeLogNormal:()=>mx,cumulativeNormal:()=>cx,cumulativeUniform:()=>vx,dayofyear:()=>Uv,debounce:()=>kh,defaultLocale:()=>lb,definition:()=>fle,densityLogNormal:()=>px,densityNormal:()=>sx,densityUniform:()=>_x,detectTimeUnits:()=>fy,domChild:()=>Pk,domClear:()=>Fk,domCreate:()=>Mk,domFind:()=>Nk,dotbin:()=>Dle,error:()=>V,expressionFunction:()=>TW,extend:()=>Ah,extent:()=>Mh,extentIndex:()=>Nh,falsy:()=>Rm,fastmap:()=>Ih,field:()=>jm,flush:()=>Rh,font:()=>Dk,fontFamily:()=>Ek,fontSize:()=>xk,format:()=>bb,formatLocale:()=>sb,formats:()=>gb,hasOwnProperty:()=>Ph,id:()=>Nm,identity:()=>Pm,inferType:()=>mce,inferTypes:()=>hce,ingest:()=>Db,inherits:()=>U,inrange:()=>zh,interpolate:()=>PD,interpolateColors:()=>jD,interpolateRange:()=>AD,intersect:()=>khe,intersectBoxLine:()=>XO,intersectPath:()=>JO,intersectPoint:()=>YO,intersectRule:()=>Xpe,isArray:()=>H,isBoolean:()=>Bh,isDate:()=>Vh,isFunction:()=>bh,isIterable:()=>Uh,isNumber:()=>Wh,isObject:()=>Hm,isRegExp:()=>Kh,isString:()=>qh,isTuple:()=>Tb,key:()=>Yh,lerp:()=>Xh,lineHeight:()=>Sk,loader:()=>xb,locale:()=>oce,logger:()=>Bm,lruCache:()=>Zh,markup:()=>Rk,merge:()=>$h,mergeConfig:()=>Wm,multiLineOffset:()=>wk,one:()=>Im,pad:()=>ng,panLinear:()=>$m,panLog:()=>eh,panPow:()=>th,panSymlog:()=>nh,parse:()=>RDe,parseExpression:()=>AH,parseSelector:()=>JG,path:()=>rC,pathCurves:()=>NO,pathEqual:()=>Fhe,pathParse:()=>PO,pathRectangle:()=>Ipe,pathRender:()=>FO,pathSymbols:()=>Ape,pathTrail:()=>Lpe,peek:()=>qm,point:()=>Ik,projection:()=>YL,quantileLogNormal:()=>hx,quantileNormal:()=>lx,quantileUniform:()=>yx,quantiles:()=>rx,quantizeInterpolator:()=>MD,quarter:()=>hh,quartiles:()=>ix,random:()=>Ox,randomInteger:()=>Ale,randomKDE:()=>dx,randomLCG:()=>kle,randomLogNormal:()=>Mle,randomMixture:()=>Nle,randomNormal:()=>ux,randomUniform:()=>Ple,read:()=>xce,regressionConstant:()=>bx,regressionExp:()=>Ile,regressionLinear:()=>Tx,regressionLoess:()=>Vle,regressionLog:()=>Fle,regressionPoly:()=>Rle,regressionPow:()=>Lle,regressionQuad:()=>Ex,renderModule:()=>Uk,repeat:()=>eg,resetDefaultLocale:()=>sce,resetSVGDefIds:()=>Lhe,responseType:()=>bce,runtimeContext:()=>ZW,sampleCurve:()=>Dx,sampleLogNormal:()=>fx,sampleNormal:()=>ox,sampleUniform:()=>gx,scale:()=>bD,sceneEqual:()=>Wk,sceneFromJSON:()=>qme,scenePickVisit:()=>rk,sceneToJSON:()=>Kme,sceneVisit:()=>nk,sceneZOrder:()=>tk,scheme:()=>LD,serializeXML:()=>yj,setHybridRendererOptions:()=>Ohe,setRandom:()=>Tle,span:()=>rg,splitAccessPath:()=>km,stringValue:()=>W,textMetrics:()=>jA,timeBin:()=>dy,timeFloor:()=>ty,timeFormatLocale:()=>cb,timeInterval:()=>ry,timeOffset:()=>oy,timeSequence:()=>ly,timeUnitSpecifier:()=>Vv,timeUnits:()=>Bv,toBoolean:()=>ig,toDate:()=>ag,toNumber:()=>Ym,toSet:()=>cg,toString:()=>sg,transform:()=>ple,transforms:()=>tx,truncate:()=>lg,truthy:()=>Lm,tupleid:()=>Eb,typeParsers:()=>vb,utcFloor:()=>ny,utcInterval:()=>iy,utcOffset:()=>sy,utcSequence:()=>uy,utcdayofyear:()=>Jv,utcquarter:()=>gh,utcweek:()=>Yv,version:()=>qY,visitArray:()=>ug,week:()=>Wv,writeConfig:()=>Gm,zero:()=>Fm,zoomLinear:()=>ih,zoomLog:()=>ah,zoomPow:()=>oh,zoomSymlog:()=>sh}),KY,qY,JY=o((()=>{dg(),dg(),nx(),Rue(),d_e(),k_e(),Mye(),Gbe(),gSe(),MSe(),PSe(),oCe(),hCe(),xCe(),Nx(),qy(),Sb(),Uj(),AO(),eR(),sEe(),pb(),qW(),zDe(),aG(),MU(),dK(),KY=`6.3.1`,Ah(tx,Yle,Hge,f_e,fye,zbe,_Se,fSe,NSe,rCe,sCe,gCe),qY=KY}));function VDe(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}function YY(e,t,n,r,i,a){let o=e=>aX[e.type](o,e);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=r,o.event=i,o.item=a,rX.forEach(e=>o.fn[e]=(...t)=>i.vega[e](...t)),o(e)}var XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX,HDe=o((()=>{dg(),XY={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},ZY={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},QY={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e},$Y=Array.prototype.slice,eX=(e,t,n)=>{let r=n?n(t[0]):t[0];return r[e].apply(r,$Y.call(t,1))},tX=(e,t=0,n=1,r=0,i=0,a=0,o=0)=>qh(e)?new Date(e):new Date(e,t,n,r,i,a,o),nX={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:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:tX,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return eX(`join`,arguments)},indexof:function(){return eX(`indexOf`,arguments)},lastindexof:function(){return eX(`lastIndexOf`,arguments)},slice:function(){return eX(`slice`,arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(wh),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return eX(`substring`,arguments,String)},split:function(){return eX(`split`,arguments,String)},replace:function(){return eX(`replace`,arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),encodeURIComponent:e=>encodeURIComponent(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)},rX=[`view`,`item`,`group`,`xy`,`x`,`y`],iX=new Set([Function,eval,setTimeout,setInterval]),typeof setImmediate==`function`&&iX.add(setImmediate),aX={Literal:(e,t)=>t.value,Identifier:(e,t)=>{let n=t.name;return e.memberDepth>0?n:n===`datum`?e.datum:n===`event`?e.event:n===`item`?e.item:XY[n]||e.params[`$`+n]},MemberExpression:(e,t)=>{let n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);let i=e(t.property);if(n&&--e.memberDepth,iX.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{let n=t.arguments,r=t.callee.name;return r.startsWith(`_`)&&(r=r.slice(1)),r===`if`?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||nX[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>ZY[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>QY[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator===`&&`?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((t,n)=>{e.memberDepth+=1;let r=e(n.key);--e.memberDepth;let i=e(n.value);return zm.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):iX.has(i)?console.error(`Prevented interpretation of method "${r}" which could lead to insecure code execution`):t[r]=i,t},{})},oX={operator(e,t){let n=t.ast,r=e.functions;return e=>YY(n,r,e)},parameter(e,t){let n=t.ast,r=e.functions;return(e,t)=>YY(n,r,t,e)},event(e,t){let n=t.ast,r=e.functions;return e=>YY(n,r,void 0,void 0,e)},handler(e,t){let n=t.ast,r=e.functions;return(e,t)=>{let i=t.item&&t.item.datum;return YY(n,r,e,i,t)}},encode(e,t){let{marktype:n,channels:r}=t,i=e.functions,a=n===`group`||n===`image`||n===`rect`;return(e,t)=>{let o=e.datum,s=0,c;for(let n in r)c=YY(r[n].ast,i,t,o,void 0,e),e[n]!==c&&(e[n]=c,s=1);return n!==`rule`&&VDe(e,r,a),s}}}}));function sX(e){this.type=e}function UDe(e){switch(e.type){case UX:return e.elements;case WX:case qX:return[e.left,e.right];case GX:return[e.callee].concat(e.arguments);case KX:return[e.test,e.consequent,e.alternate];case JX:return[e.object,e.property];case YX:return e.properties;case VX:return[e.key,e.value];case XX:return[e.argument];case HX:case BX:case zX:default:return[]}}function cX(e,t){if(!e)throw Error(`ASSERT: `+t)}function lX(e){return e>=48&&e<=57}function uX(e){return`0123456789abcdefABCDEF`.includes(e)}function dX(e){return`01234567`.includes(e)}function WDe(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function fX(e){return e===10||e===13||e===8232||e===8233}function pX(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&NZ.test(String.fromCharCode(e))}function mX(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&PZ.test(String.fromCharCode(e))}function hX(){for(;J<$X;){let e=QX.charCodeAt(J);if(WDe(e)||fX(e))++J;else break}}function gX(e){var t,n,r,i=0;for(n=e===`u`?4:2,t=0;t1114111||e!==`}`)&&OX({},xZ,jZ),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function _X(){var e=QX.charCodeAt(J++),t=String.fromCharCode(e);for(e===92&&(QX.charCodeAt(J)!==117&&OX({},xZ,jZ),++J,e=gX(`u`),(!e||e===`\\`||!pX(e.charCodeAt(0)))&&OX({},xZ,jZ),t=e);J<$X&&(e=QX.charCodeAt(J),mX(e));)++J,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),QX.charCodeAt(J)!==117&&OX({},xZ,jZ),++J,e=gX(`u`),(!e||e===`\\`||!mX(e.charCodeAt(0)))&&OX({},xZ,jZ),t+=e);return t}function KDe(){for(var e=J++,t;J<$X;){if(t=QX.charCodeAt(J),t===92)return J=e,_X();if(mX(t))++J;else break}return QX.slice(e,J)}function qDe(){var e=J,t=QX.charCodeAt(J)===92?_X():KDe();return{type:t.length===1?rZ:FZ.hasOwnProperty(t)?iZ:t===`null`?aZ:t===`true`||t===`false`?tZ:rZ,value:t,start:e,end:J}}function vX(){var e=J,t=QX.charCodeAt(J),n,r=QX[J],i,a,o;switch(t){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++J,{type:sZ,value:String.fromCharCode(t),start:e,end:J};default:if(n=QX.charCodeAt(J+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return J+=2,{type:sZ,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:J};case 33:case 61:return J+=2,QX.charCodeAt(J)===61&&++J,{type:sZ,value:QX.slice(e,J),start:e,end:J}}}if(o=QX.substr(J,4),o===`>>>=`)return J+=4,{type:sZ,value:o,start:e,end:J};if(a=o.substr(0,3),a===`>>>`||a===`<<=`||a===`>>=`)return J+=3,{type:sZ,value:a,start:e,end:J};if(i=a.substr(0,2),r===i[1]&&`+-<>&|`.includes(r)||i===`=>`)return J+=2,{type:sZ,value:i,start:e,end:J};if(i===`//`&&OX({},xZ,jZ),`<>=!+-*%&|^/`.includes(r))return++J,{type:sZ,value:r,start:e,end:J};OX({},xZ,jZ)}function JDe(e){let t=``;for(;J<$X&&uX(QX[J]);)t+=QX[J++];return t.length===0&&OX({},xZ,jZ),pX(QX.charCodeAt(J))&&OX({},xZ,jZ),{type:oZ,value:parseInt(`0x`+t,16),start:e,end:J}}function YDe(e){let t=`0`+QX[J++];for(;J<$X&&dX(QX[J]);)t+=QX[J++];return(pX(QX.charCodeAt(J))||lX(QX.charCodeAt(J)))&&OX({},xZ,jZ),{type:oZ,value:parseInt(t,8),octal:!0,start:e,end:J}}function yX(){var e,t,n=QX[J];if(cX(lX(n.charCodeAt(0))||n===`.`,`Numeric literal must start with a decimal digit or a decimal point`),t=J,e=``,n!==`.`){if(e=QX[J++],n=QX[J],e===`0`){if(n===`x`||n===`X`)return++J,JDe(t);if(dX(n))return YDe(t);n&&lX(n.charCodeAt(0))&&OX({},xZ,jZ)}for(;lX(QX.charCodeAt(J));)e+=QX[J++];n=QX[J]}if(n===`.`){for(e+=QX[J++];lX(QX.charCodeAt(J));)e+=QX[J++];n=QX[J]}if(n===`e`||n===`E`)if(e+=QX[J++],n=QX[J],(n===`+`||n===`-`)&&(e+=QX[J++]),lX(QX.charCodeAt(J)))for(;lX(QX.charCodeAt(J));)e+=QX[J++];else OX({},xZ,jZ);return pX(QX.charCodeAt(J))&&OX({},xZ,jZ),{type:oZ,value:parseFloat(e),start:t,end:J}}function XDe(){var e=``,t,n,r,i,a=!1;for(t=QX[J],cX(t===`'`||t===`"`,`String literal must starts with a quote`),n=J,++J;J<$X;)if(r=QX[J++],r===t){t=``;break}else if(r===`\\`)if(r=QX[J++],!r||!fX(r.charCodeAt(0)))switch(r){case`u`:case`x`:QX[J]===`{`?(++J,e+=GDe()):e+=gX(r);break;case`n`:e+=` +`;break;case`r`:e+=`\r`;break;case`t`:e+=` `;break;case`b`:e+=`\b`;break;case`f`:e+=`\f`;break;case`v`:e+=`\v`;break;default:dX(r)?(i=`01234567`.indexOf(r),i!==0&&(a=!0),J<$X&&dX(QX[J])&&(a=!0,i=i*8+`01234567`.indexOf(QX[J++]),`0123`.includes(r)&&J<$X&&dX(QX[J])&&(i=i*8+`01234567`.indexOf(QX[J++]))),e+=String.fromCharCode(i)):e+=r;break}else r===`\r`&&QX[J]===` +`&&++J;else if(fX(r.charCodeAt(0)))break;else e+=r;return t!==``&&OX({},xZ,jZ),{type:cZ,value:e,octal:a,start:n,end:J}}function ZDe(e,t){let n=e;t.includes(`u`)&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(e,t)=>{if(parseInt(t,16)<=1114111)return`x`;OX({},DZ)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,`x`));try{new RegExp(n)}catch{OX({},DZ)}try{return new RegExp(e,t)}catch{return null}}function QDe(){var e=QX[J],t,n,r,i;for(cX(e===`/`,`Regular expression literal must start with a slash`),t=QX[J++],n=!1,r=!1;J<$X;)if(e=QX[J++],t+=e,e===`\\`)e=QX[J++],fX(e.charCodeAt(0))&&OX({},OZ),t+=e;else if(fX(e.charCodeAt(0)))OX({},OZ);else if(n)e===`]`&&(n=!1);else if(e===`/`){r=!0;break}else e===`[`&&(n=!0);return r||OX({},OZ),i=t.substr(1,t.length-2),{value:i,literal:t}}function $De(){for(var e,t=``,n=``;J<$X&&(e=QX[J],mX(e.charCodeAt(0)));)++J,e===`\\`&&J<$X?OX({},xZ,jZ):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&OX({},DZ,n),{value:n,literal:t}}function eOe(){var e,t,n,r;return eZ=null,hX(),e=J,t=QDe(),n=$De(),r=ZDe(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:J}}function tOe(e){return e.type===rZ||e.type===iZ||e.type===tZ||e.type===aZ}function bX(){if(hX(),J>=$X)return{type:nZ,start:J,end:J};let e=QX.charCodeAt(J);return pX(e)?qDe():e===40||e===41||e===59?vX():e===39||e===34?XDe():e===46?lX(QX.charCodeAt(J+1))?yX():vX():lX(e)?yX():vX()}function xX(){let e=eZ;return J=e.end,eZ=bX(),J=e.end,e}function SX(){let e=J;eZ=bX(),J=e}function nOe(e){let t=new sX(uZ);return t.elements=e,t}function CX(e,t,n){let r=new sX(e===`||`||e===`&&`?gZ:dZ);return r.operator=e,r.left=t,r.right=n,r}function rOe(e,t){let n=new sX(fZ);return n.callee=e,n.arguments=t,n}function iOe(e,t,n){let r=new sX(pZ);return r.test=e,r.consequent=t,r.alternate=n,r}function wX(e){let t=new sX(mZ);return t.name=e,t}function TX(e){let t=new sX(hZ);return t.value=e.value,t.raw=QX.slice(e.start,e.end),e.regex&&(t.raw===`//`&&(t.raw=`/(?:)/`),t.regex=e.regex),t}function EX(e,t,n){let r=new sX(_Z);return r.computed=e===`[`,r.object=t,r.property=n,r.computed||(n.member=!0),r}function aOe(e){let t=new sX(vZ);return t.properties=e,t}function DX(e,t,n){let r=new sX(yZ);return r.key=t,r.value=n,r.kind=e,r}function oOe(e,t){let n=new sX(bZ);return n.operator=e,n.argument=t,n.prefix=!0,n}function OX(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(e,t)=>(cX(t`:case`<=`:case`>=`:case`instanceof`:case`in`:t=7;break;case`<<`:case`>>`:case`>>>`:t=8;break;case`+`:case`-`:t=9;break;case`*`:case`/`:case`%`:t=11;break}return t}function _Oe(){var e=eZ,t,n,r,i,a,o,s,c=FX(),l;if(r=eZ,i=IX(r),i===0)return c;for(r.prec=i,xX(),t=[e,eZ],o=FX(),a=[c,r,o];(i=IX(eZ))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,c=a.pop(),t.pop(),n=CX(s,c,o),a.push(n);r=xX(),r.prec=i,a.push(r),t.push(eZ),n=FX(),a.push(n)}for(l=a.length-1,n=a[l],t.pop();l>1;)t.pop(),n=CX(a[l-1].value,a[l-2],n),l-=2;return n}function LX(){var e=_Oe(),t,n;return jX(`?`)&&(xX(),t=LX(),AX(`:`),n=LX(),e=iOe(e,t,n)),e}function RX(){let e=LX();if(jX(`,`))throw Error(MZ);return e}function vOe(e){QX=e,J=0,$X=QX.length,eZ=null,SX();let t=RX();if(eZ.type!==nZ)throw Error(`Unexpect token after expression.`);return t}var zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,J,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,yOe=o((()=>{dg(),zX=`RawCode`,BX=`Literal`,VX=`Property`,HX=`Identifier`,UX=`ArrayExpression`,WX=`BinaryExpression`,GX=`CallExpression`,KX=`ConditionalExpression`,qX=`LogicalExpression`,JX=`MemberExpression`,YX=`ObjectExpression`,XX=`UnaryExpression`,sX.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=UDe(this),n=0,r=t.length;n`,ZX[rZ]=`Identifier`,ZX[iZ]=`Keyword`,ZX[aZ]=`Null`,ZX[oZ]=`Numeric`,ZX[sZ]=`Punctuator`,ZX[cZ]=`String`,ZX[lZ]=`RegularExpression`,uZ=`ArrayExpression`,dZ=`BinaryExpression`,fZ=`CallExpression`,pZ=`ConditionalExpression`,mZ=`Identifier`,hZ=`Literal`,gZ=`LogicalExpression`,_Z=`MemberExpression`,vZ=`ObjectExpression`,yZ=`Property`,bZ=`UnaryExpression`,xZ=`Unexpected token %0`,SZ=`Unexpected number`,CZ=`Unexpected string`,wZ=`Unexpected identifier`,TZ=`Unexpected reserved word`,EZ=`Unexpected end of input`,DZ=`Invalid regular expression`,OZ=`Invalid regular expression: missing /`,kZ=`Octal literals are not allowed in strict mode.`,AZ=`Duplicate data property in object literal not allowed in strict mode`,jZ=`ILLEGAL`,MZ=`Disabled.`,NZ=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]`),PZ=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]`),FZ={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},IZ={if:1}})),bOe=c({accessPathDepth:()=>gQ,accessPathWithDatum:()=>lQ,accessWithDatumToUnescapedPath:()=>dQ,compile:()=>cLe,contains:()=>qZ,deepEqual:()=>CQ,deleteNestedProperty:()=>sQ,duplicate:()=>F2,entries:()=>L2,every:()=>YZ,fieldIntersection:()=>tQ,flatAccessWithDatum:()=>uQ,getFirstDefined:()=>_Q,hasIntersection:()=>$Z,hasProperty:()=>Y,hash:()=>GZ,internalField:()=>yQ,isBoolean:()=>rQ,isEmpty:()=>nQ,isEqual:()=>SOe,isInternalField:()=>bQ,isNullOrFalse:()=>KZ,isNumeric:()=>SQ,isPrimitive:()=>iQ,keys:()=>$,logicalExpr:()=>oQ,mergeDeep:()=>XZ,never:()=>HZ,normalize:()=>WMe,normalizeAngle:()=>xQ,omit:()=>WZ,pick:()=>UZ,prefixGenerator:()=>eQ,removePathFromField:()=>hQ,replaceAll:()=>mQ,replacePathInField:()=>pQ,resetIdCounter:()=>wOe,setEqual:()=>QZ,some:()=>JZ,stringify:()=>wQ,titleCase:()=>cQ,unescapeSingleQuoteAndPathDot:()=>fQ,unique:()=>ZZ,uniqueId:()=>vQ,vals:()=>I2,varName:()=>aQ,version:()=>wBe});function LZ(e){return Y(e,`or`)}function RZ(e){return Y(e,`and`)}function zZ(e){return Y(e,`not`)}function BZ(e,t){if(zZ(e))BZ(e.not,t);else if(RZ(e))for(let n of e.and)BZ(n,t);else if(LZ(e))for(let n of e.or)BZ(n,t);else t(e)}function VZ(e,t){return zZ(e)?{not:VZ(e.not,t)}:RZ(e)?{and:e.and.map(e=>VZ(e,t))}:LZ(e)?{or:e.or.map(e=>VZ(e,t))}:t(e)}function HZ(e){throw Error(e)}function UZ(e,t){let n={};for(let r of t)Ph(e,r)&&(n[r]=e[r]);return n}function WZ(e,t){let n={...e};for(let e of t)delete n[e];return n}function GZ(e){if(Wh(e))return e;let t=qh(e)?e:wQ(e);if(t.length<250)return t;let n=0;for(let e=0;et===0?e:`[${e}]`),r=e.map((t,n)=>e.slice(0,n+1).join(``));for(let e of r)t.add(e)}return t}function tQ(e,t){return e===void 0||t===void 0||$Z(eQ(e),eQ(t))}function nQ(e){return $(e).length===0}function rQ(e){return e===!0||e===!1}function iQ(e){return qh(e)||Wh(e)||rQ(e)}function aQ(e){let t=e.replace(/\W/g,`_`);return(e.match(/^\d+/)?`_`:``)+t}function oQ(e,t){return zZ(e)?`!(${oQ(e.not,t)})`:RZ(e)?`(${e.and.map(e=>oQ(e,t)).join(`) && (`)})`:LZ(e)?`(${e.or.map(e=>oQ(e,t)).join(`) || (`)})`:t(e)}function sQ(e,t){if(t.length===0)return!0;let n=t.shift();return n in e&&sQ(e[n],t)&&delete e[n],nQ(e)}function cQ(e){return e.charAt(0).toUpperCase()+e.substr(1)}function lQ(e,t=`datum`){let n=km(e),r=[];for(let e=1;e<=n.length;e++){let i=`[${n.slice(0,e).map(W).join(`][`)}]`;r.push(`${t}${i}`)}return r.join(` && `)}function uQ(e,t=`datum`){return`${t}[${W(km(e).join(`.`))}]`}function dQ(e){return`datum['${e.replaceAll(`'`,`\\'`)}']`}function fQ(e){return e.replaceAll(`\\'`,`'`).replaceAll(`\\.`,`.`)}function COe(e){return e.replace(/(\[|\]|\.|'|")/g,`\\$1`)}function pQ(e){return`${km(e).map(COe).join(`\\.`)}`}function mQ(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`),`g`),n)}function hQ(e){return`${km(e).join(`.`)}`}function gQ(e){return e?km(e).length:0}function _Q(...e){return e.find(e=>e!==void 0)}function vQ(e){let t=++R2;return e?String(e)+t:t}function wOe(){R2=42}function yQ(e){return bQ(e)?e:`__${e}`}function bQ(e){return e.startsWith(`__`)}function xQ(e){if(e!==void 0)return(e%360+360)%360}function SQ(e){return Wh(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}function CQ(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!CQ(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let n of e.entries())if(!t.has(n[0]))return!1;for(let n of e.entries())if(!CQ(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e.entries())if(!t.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==z2.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==z2.toString)return e.toString()===t.toString();let i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!CQ(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function wQ(e){let t=[];return(function e(n){if(n?.toJSON&&typeof n.toJSON==`function`&&(n=n.toJSON()),n===void 0)return;if(typeof n==`number`)return isFinite(n)?`${n}`:`null`;if(typeof n!=`object`)return JSON.stringify(n);let r,i;if(Array.isArray(n)){for(i=`[`,r=0;rZQ(e[t])?aQ(`_${t}_${L2(e[t])}`):aQ(`_${t}_${e[t]}`)).join(``)}`}function JQ(e){return e===!0||XQ(e)&&!e.binned}function YQ(e){return e===`binned`||XQ(e)&&e.binned===!0}function XQ(e){return Hm(e)}function ZQ(e){return Y(e,`param`)}function QQ(e){switch(e){case B2:case V2:case c4:case i4:case a4:case o4:case p4:case u4:case d4:case f4:case s4:return 6;case m4:return 4;default:return 10}}function $Q(e){return Y(e,`expr`)}function e$(e,{level:t}={level:0}){let n=$(e||{}),r={};for(let i of n)r[i]=t===0?c$(e[i]):e$(e[i],{level:t-1});return r}function t$(e){let{anchor:t,frame:n,offset:r,orient:i,angle:a,limit:o,color:s,subtitleColor:c,subtitleFont:l,subtitleFontSize:u,subtitleFontStyle:d,subtitleFontWeight:f,subtitleLineHeight:p,subtitlePadding:m,...h}=e,g={...h,...s?{fill:s}:{}},_={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...a===void 0?{}:{angle:a},...o===void 0?{}:{limit:o}},v={...c?{subtitleColor:c}:{},...l?{subtitleFont:l}:{},...u?{subtitleFontSize:u}:{},...d?{subtitleFontStyle:d}:{},...f?{subtitleFontWeight:f}:{},...p?{subtitleLineHeight:p}:{},...m?{subtitlePadding:m}:{}};return{titleMarkConfig:g,subtitleMarkConfig:UZ(e,[`align`,`baseline`,`dx`,`dy`,`limit`]),nonMarkTitleProperties:_,subtitle:v}}function n$(e){return qh(e)||H(e)&&qh(e[0])}function r$(e){return Y(e,`signal`)}function i$(e){return Y(e,`step`)}function a$(e){return!H(e)&&Y(e,`fields`)&&!Y(e,`data`)}function MOe(e){return!H(e)&&Y(e,`fields`)&&Y(e,`data`)}function o$(e){return!H(e)&&Y(e,`field`)&&Y(e,`data`)}function s$(e){let t=H(e.condition)?e.condition.map(l$):l$(e.condition);return{...c$(e),condition:t}}function c$(e){if($Q(e)){let{expr:t,...n}=e;return{signal:t,...n}}return e}function l$(e){if($Q(e)){let{expr:t,...n}=e;return{signal:t,...n}}return e}function u$(e){if($Q(e)){let{expr:t,...n}=e;return{signal:t,...n}}return r$(e)?e:e===void 0?void 0:{value:e}}function NOe(e){return r$(e)?e.signal:W(e)}function d$(e){return r$(e)?e.signal:W(e.value)}function f$(e){return r$(e)?e.signal:e==null?null:W(e)}function POe(e,t,n){for(let r of n){let n=h$(r,t.markDef,t.config);n!==void 0&&(e[r]=u$(n))}return e}function p$(e){return[].concat(e.type,e.style??[])}function m$(e,t,n,r={}){let{vgChannel:i,ignoreVgConfig:a}=r;return i&&Y(t,i)?t[i]:t[e]===void 0?a&&(!i||i===e)?void 0:h$(e,t,n,r):t[e]}function h$(e,t,n,{vgChannel:r}={}){let i=g$(e,t,n.style);return _Q(r?i:void 0,i,r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function g$(e,t,n){return _$(e,p$(t),n)}function _$(e,t,n){t=_h(t);let r;for(let i of t){let t=n[i];Y(t,e)&&(r=t[e])}return r}function v$(e,t){return _h(e).reduce((e,n)=>(e.field.push(Q(n,t)),e.order.push(n.sort??`ascending`),e),{field:[],order:[]})}function y$(e,t){let n=[...e];return t.forEach(e=>{for(let t of n)if(CQ(t,e))return;n.push(e)}),n}function b$(e,t){return CQ(e,t)||!t?e:e?[..._h(e),..._h(t)].join(`, `):t}function x$(e,t){let n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((n$(n)||r$(n))&&(n$(r)||r$(r)))return{explicit:e.explicit,value:b$(n,r)};if(n$(n)||r$(n))return{explicit:e.explicit,value:n};if(n$(r)||r$(r))return{explicit:e.explicit,value:r};if(!n$(n)&&!r$(n)&&!n$(r)&&!r$(r))return{explicit:e.explicit,value:y$(n,r)};throw Error(`It should never reach here`)}function S$(e){return`Invalid specification ${wQ(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}function C$(e){return`${e==`width`?`Width`:`Height`} "container" only works for single views and layered views.`}function w$(e){return`${e==`width`?`Width`:`Height`} "container" only works well with autosize "fit" or "fit-${e==`width`?`x`:`y`}".`}function T$(e){return e?`Dropping "fit-${e}" because spec has discrete ${PQ(e)}.`:`Dropping "fit" because spec has discrete size.`}function E$(e){return`Unknown field for ${e}. Cannot calculate view size.`}function D$(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function FOe(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function IOe(e){return`The "nearest" transform is not supported for ${e} marks.`}function O$(e){return`Selection not supported for ${e} yet.`}function LOe(e){return`Cannot find a selection named "${e}".`}function ROe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function zOe(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}function BOe(e){return`Unknown repeated value "${e}".`}function VOe(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function HOe(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${W(e)}.`}function UOe(e,t,n,r){return`${e.length?`Multiple `:`No `}matching ${W(t)} encoding found for selection ${W(n.param)}. Using "field": ${W(r)}.`}function WOe(e){return`Unrecognized parse "${e}".`}function GOe(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function KOe(e){return`Ignoring an invalid transform: ${wQ(e)}.`}function qOe(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function JOe(e){let{parentProjection:t,projection:n}=e;return`Layer's shared projection ${wQ(t)} is overridden by a child projection ${wQ(n)}.`}function YOe(e){return`${e}Offset dropped because ${e} is continuous`}function XOe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${wQ(n)}}.`}function ZOe(e){return`Invalid field type "${e}".`}function QOe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function $Oe(e){return`Invalid aggregation operator "${e}".`}function eke(e,t){let{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?`fill and stroke`:n?`fill`:`stroke`}.`}function tke(e){return`Position range does not support relative band size for ${e}.`}function k$(e,t){return`Dropping ${wQ(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function A$(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function nke(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function rke(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function ike(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function ake(e){return`Facet encoding dropped as ${e.join(` and `)} ${e.length>1?`are`:`is`} also specified.`}function j$(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t===`ordinal`?`order`:`magnitude`}.`}function oke(e){return`The ${e} for range marks cannot be an expression`}function ske(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?`x2 and y2`:e?`x2`:`y2`}. We will use the rule mark (line segments) instead.`}function cke(e,t){return`Specified orient "${e}" overridden with "${t}".`}function lke(e){return`Cannot use the scale property "${e}" with non-color channel.`}function uke(e){return`Cannot use the relative band size with ${e} scale.`}function dke(e){return`Using unaggregated domain with raw field has no effect (${wQ(e)}).`}function fke(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function pke(e){return`Unaggregated domain is currently unsupported for log scale (${wQ(e)}).`}function mke(e){return`Cannot apply size to non-oriented mark "${e}".`}function hke(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function gke(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function _ke(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function vke(e){return`The step for "${e}" is dropped because the ${e===`width`?`x`:`y`} is continuous.`}function yke(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${wQ(n)} and ${wQ(r)}). Using ${wQ(n)}.`}function bke(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${wQ(n)} and ${wQ(r)}). Using the union of the two domains.`}function xke(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Ske(e){return`Dropping sort property ${wQ(e)} as unioned domains only support boolean or op "count", "min", and "max".`}function Cke(e,t){return`Unioning discrete legend values from ${e} and ${t}.`}function wke(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Tke(e){return`Stack is applied to a non-linear scale (${e}).`}function Eke(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function M$(e,t){return`Invalid ${e}: ${wQ(t)}.`}function Dke(e){return`Dropping day from datetime ${wQ(e)} as day cannot be combined with other units.`}function Oke(e,t){return`${t?`extent `:``}${t&&e?`and `:``}${e?`center `:``}${t&&e?`are `:`is `}not needed when data are aggregated.`}function kke(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Ake(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function jke(e){return`1D error band does not support ${e}.`}function Mke(e){return`Channel ${e} is required for "binned" bin.`}function Nke(e){return`Channel ${e} should not be used with "binned" bin.`}function Pke(e){return`Domain for ${e} is required for threshold scale.`}function Fke(e){return H4=e,H4}function Ike(){return H4=V4,H4}function N$(...e){H4.error(...e)}function X(...e){H4.warn(...e)}function Lke(...e){H4.debug(...e)}function P$(e){if(e&&Hm(e)){for(let t of K4)if(Y(e,t))return!0}return!1}function Rke(e){if(SQ(e)&&(e=+e),Wh(e))return e>4&&X(M$(`quarter`,e)),e-1;throw Error(M$(`quarter`,e))}function zke(e){if(SQ(e)&&(e=+e),Wh(e))return e-1;{let t=e.toLowerCase(),n=U4.indexOf(t);if(n!==-1)return n;let r=t.substr(0,3),i=SRe.indexOf(r);if(i!==-1)return i;throw Error(M$(`month`,e))}}function Bke(e){if(SQ(e)&&(e=+e),Wh(e))return e%7;{let t=e.toLowerCase(),n=W4.indexOf(t);if(n!==-1)return n;let r=t.substr(0,3),i=CRe.indexOf(r);if(i!==-1)return i;throw Error(M$(`day`,e))}}function F$(e,t){let n=[];if(t&&e.day!==void 0&&$(e).length>1&&(X(Dke(e)),e=F2(e),delete e.day),e.year===void 0?n.push(2012):n.push(e.year),e.month!==void 0){let r=t?zke(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){let r=t?Rke(e.quarter):e.quarter;n.push(Wh(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){let r=t?Bke(e.day):e.day;n.push(Wh(r)?r+1:`${r}+1`)}else n.push(1);for(let t of[`hours`,`minutes`,`seconds`,`milliseconds`]){let r=e[t];n.push(r===void 0?0:r)}return n}function I$(e){let t=F$(e,!0).join(`, `);return e.utc?`utc(${t})`:`datetime(${t})`}function Vke(e){let t=F$(e,!1).join(`, `);return e.utc?`utc(${t})`:`datetime(${t})`}function Hke(e){let t=F$(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}function Uke(e){return Ph(G4,e)}function L$(e){return Hm(e)?e.binned:Wke(e)}function Wke(e){return e?.startsWith(`binned`)}function R$(e){return e.startsWith(`utc`)}function Gke(e){return e.substring(3)}function z$(e){return K4.filter(t=>qke(e,t))}function Kke(e){let t=z$(e);return t[t.length-1]}function qke(e,t){let n=e.indexOf(t);return!(n<0||n>0&&t===`seconds`&&e.charAt(n-1)===`i`||e.length>n+3&&t===`day`&&e.charAt(n+3)===`o`||n>0&&t===`year`&&e.charAt(n-1)===`f`)}function Jke(e,t,{end:n}={end:!1}){let r=lQ(t),i=R$(e)?`utc`:``;function a(e){return e===`quarter`?`(${i}quarter(${r})-1)`:`${i}${e}(${r})`}let o,s={};for(let t of K4)qke(e,t)&&(s[t]=a(t),o=t);return n&&(s[o]+=`+1`),Vke(s)}function Yke(e){if(e)return`timeUnitSpecifier(${wQ(z$(e))}, ${wQ(wRe)})`}function Xke(e,t,n){if(!e)return;let r=Yke(e);return`${n||R$(e)?`utc`:`time`}Format(${t}, ${r})`}function B$(e){if(!e)return;let t;return qh(e)?t=Wke(e)?{unit:e.substring(6),binned:!0}:{unit:e}:Hm(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),R$(t.unit)&&(t.utc=!0,t.unit=Gke(t.unit)),t}function Zke(e){let{utc:t,...n}=B$(e);return n.unit?(t?`utc`:``)+$(n).map(e=>aQ(`${e===`unit`?``:`_${e}_`}${n[e]}`)).join(``):`${t?`utc`:``}timeunit${$(n).map(e=>aQ(`_${e}_${n[e]}`)).join(``)}`}function Qke(e,t=e=>e){let n=B$(e),r=Kke(n.unit);if(r&&r!==`day`){let e={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:i,part:a}=eAe(r,n.step);return`${t(I$({...e,[a]:+e[a]+i}))} - ${t(I$(e))}`}}function $ke(e){return Ph(TRe,e)}function eAe(e,t=1){if($ke(e))return{part:e,step:t};switch(e){case`day`:case`dayofyear`:return{part:`date`,step:t};case`quarter`:return{part:`month`,step:t*3};case`week`:return{part:`date`,step:t*7}}}function tAe(e){return Y(e,`param`)}function V$(e){return!!e?.field&&e.equal!==void 0}function H$(e){return!!e?.field&&e.lt!==void 0}function U$(e){return!!e?.field&&e.lte!==void 0}function W$(e){return!!e?.field&&e.gt!==void 0}function G$(e){return!!e?.field&&e.gte!==void 0}function K$(e){return!!(e?.field&&(H(e.range)&&e.range.length===2||r$(e.range)))}function q$(e){return!!e?.field&&(H(e.oneOf)||H(e.in))}function nAe(e){return!!e?.field&&e.valid!==void 0}function rAe(e){return q$(e)||V$(e)||K$(e)||H$(e)||W$(e)||U$(e)||G$(e)}function J$(e,t){return K1(e,{timeUnit:t,wrapTime:!0})}function iAe(e,t){return e.map(e=>J$(e,t))}function aAe(e,t=!0){let{field:n}=e,{unit:r,binned:i}=B$(e.timeUnit)||{},a=Q(e,{expr:`datum`}),o=r?`time(${i?a:Jke(r,n)})`:a;if(V$(e))return`${o}===${J$(e.equal,r)}`;if(H$(e)){let t=e.lt;return`${o}<${J$(t,r)}`}else if(W$(e)){let t=e.gt;return`${o}>${J$(t,r)}`}else if(U$(e)){let t=e.lte;return`${o}<=${J$(t,r)}`}else if(G$(e)){let t=e.gte;return`${o}>=${J$(t,r)}`}else if(q$(e))return`indexof([${iAe(e.oneOf,r).join(`,`)}], ${o}) !== -1`;else if(nAe(e))return Y$(o,e.valid);else if(K$(e)){let{range:n}=e$(e),i=r$(n)?{signal:`${n.signal}[0]`}:n[0],a=r$(n)?{signal:`${n.signal}[1]`}:n[1];if(i!==null&&a!==null&&t)return`inrange(${o}, [${J$(i,r)}, ${J$(a,r)}])`;let s=[];return i!==null&&s.push(`${o} >= ${J$(i,r)}`),a!==null&&s.push(`${o} <= ${J$(a,r)}`),s.length>0?s.join(` && `):`true`}throw Error(`Invalid field predicate: ${wQ(e)}`)}function Y$(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function oAe(e){return rAe(e)&&e.timeUnit?{...e,timeUnit:B$(e.timeUnit)}:e}function sAe(e){return e===`quantitative`||e===`temporal`}function X$(e){return e===`ordinal`||e===`nominal`}function cAe(e){if(e)switch(e=e.toLowerCase(),e){case`q`:case J4:return`quantitative`;case`t`:case X4:return`temporal`;case`o`:case Y4:return`ordinal`;case`n`:case Z4:return`nominal`;case Q4:return`geojson`}}function lAe(e,t){let n=e3[e],r=e3[t];return n===r||n===`ordinal-position`&&r===`time`||r===`ordinal-position`&&n===`time`}function uAe(e){return ERe[e]}function dAe(e){return t3.has(e)}function Z$(e){return ORe.has(e)}function Q$(e){return DRe.has(e)}function $$(e){return n3.has(e)}function e1(e){return r3.has(e)}function fAe(e){return!qh(e)&&Y(e,`name`)}function pAe(e){return Y(e,`param`)}function mAe(e){return Y(e,`unionWith`)}function hAe(e){return Hm(e)&&`field`in e}function t1(e,t){switch(t){case`type`:case`domain`:case`reverse`:case`range`:return!0;case`scheme`:case`interpolate`:return![`point`,`band`,`identity`].includes(e);case`bins`:return![`point`,`band`,`identity`,`ordinal`].includes(e);case`round`:return $$(e)||e===`band`||e===`point`;case`padding`:case`rangeMin`:case`rangeMax`:return $$(e)||[`point`,`band`].includes(e);case`paddingOuter`:case`align`:return[`point`,`band`].includes(e);case`paddingInner`:return e===`band`;case`domainMax`:case`domainMid`:case`domainMin`:case`domainRaw`:case`clamp`:return $$(e);case`nice`:return $$(e)||e===`quantize`||e===`threshold`;case`exponent`:return e===`pow`;case`base`:return e===`log`;case`constant`:return e===`symlog`;case`zero`:return Q$(e)&&!qZ([`log`,`time`,`utc`,`threshold`,`quantile`],e)}}function gAe(e,t){switch(t){case`interpolate`:case`scheme`:case`domainMid`:return OQ(e)?void 0:lke(t);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 _Ae(e,t){return qZ([Y4,Z4],t)?e===void 0||Z$(e):t===X4?qZ([$4.TIME,$4.UTC,void 0],e):t!==J4||dAe(e)||e1(e)||e===void 0}function vAe(e,t,n=!1){if(!VQ(e))return!1;switch(e){case U2:case W2:case q2:case J2:case Z2:case Y2:return $$(t)?!0:t===`band`||t===`point`&&!n;case r4:return qZ([`linear`,`band`],t);case c4:case p4:case u4:case d4:case f4:case l4:return $$(t)||e1(t)||qZ([`band`,`point`,`ordinal`],t);case i4:case a4:case o4:return t!==`band`;case m4:case s4:return t===`ordinal`||e1(t)}}function yAe(e){return Hm(e)&&`value`in e}function n1(e){return[`line`,`area`,`trail`].includes(e)}function r1(e){return[`rect`,`bar`,`image`,`arc`,`tick`].includes(e)}function i1(e){return Y(e,`type`)}function a1(e){return Y(e,`band`)}function bAe(e){return i1(e)?e.type:e}function xAe(e,{isPath:t}){return e===void 0||e===`break-paths-show-path-domains`?t?`break-paths-show-domains`:`filter`:e===null?`show`:e}function o1({markDef:e,config:t,scaleChannel:n,scaleType:r,isCountAggregate:i}){if(!r||!Q$(r)||i)return`always-valid`;let a=xAe(m$(`invalid`,e,t),{isPath:n1(e.type)});return t.scale?.invalid?.[n]===void 0?a:`show`}function SAe(e){return e===`break-paths-filter-domains`||e===`break-paths-show-domains`}function CAe({scaleName:e,scale:t,mode:n}){let r=`domain('${e}')`;if(!t||!e)return;let i=`${r}[0]`,a=`peek(${r})`,o=t.domainHasZero();return o===`definitely`?{scale:e,value:0}:o===`maybe`?{signal:`scale('${e}', inrange(0, ${r}) ? 0 : ${n===`zeroOrMin`?i:a})`}:{signal:`scale('${e}', ${n===`zeroOrMin`?i:a})`}}function wAe({scaleChannel:e,channelDef:t,scale:n,scaleName:r,markDef:i,config:a}){let o=n?.get(`type`),s=B1(t),c=o1({scaleChannel:e,markDef:i,config:a,scaleType:o,isCountAggregate:KQ(s?.aggregate)});if(s&&c===`show`){let t=a.scale.invalid?.[e]??`zero-or-min`;return{test:Y$(Q(s,{expr:`datum`}),!1),...TAe(t,n,r)}}}function TAe(e,t,n){if(yAe(e)){let{value:t}=e;return r$(t)?{signal:t.signal}:{value:t}}return CAe({scale:t,scaleName:n,mode:`zeroOrMin`})}function s1(e){let{channel:t,channelDef:n,markDef:r,scale:i,scaleName:a,config:o}=e,s=jQ(t),c=u1(e),l=wAe({scaleChannel:s,channelDef:n,scale:i,scaleName:a,markDef:r,config:o});return l===void 0?c:[l,c]}function EAe(e){let{datum:t}=e;return P$(t)?I$(t):`${wQ(t)}`}function c1(e,t,n,r){let i={};if(t&&(i.scale=t),D1(e)){let{datum:t}=e;P$(t)?i.signal=I$(t):r$(t)?i.signal=t.signal:$Q(t)?i.signal=t.expr:i.value=t}else i.field=Q(e,n);if(r){let{offset:e,band:t}=r;e&&(i.offset=e),t&&(i.band=t)}return i}function l1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:a=`end`,bandPosition:o=.5}){let s=!r$(o)&&0{let r=K1(t,{timeUnit:Z(e)&&!L$(e.timeUnit)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return r===void 0?t:{signal:r}})}function q1(e,t){return JQ(e.bin)?VQ(t)&&[`ordinal`,`nominal`].includes(e.type):(console.warn(`Only call this method for binned field defs.`),!1)}function J1(e){return e?.condition}function lje(e){return Ph(QRe,e)}function Y1(e){return Y(e,`mark`)}function X1(e,t){let n=e?.[t];return n?H(n)?JZ(n,e=>!!e.field):Z(n)||w1(n):!1}function uje(e,t){let n=e?.[t];return n?H(n)?JZ(n,e=>!!e.field):Z(n)||D1(n)||T1(n):!1}function dje(e,t){if(LQ(t)){let n=e[t];if((Z(n)||D1(n))&&(X$(n.type)||Z(n)&&n.timeUnit))return uje(e,IQ(t))}return!1}function fje(e){return JZ(mLe,t=>{if(X1(e,t)){let n=e[t];if(H(n))return JZ(n,e=>!!e.aggregate);{let e=B1(n);return e&&!!e.aggregate}}return!1})}function pje(e,t){let n=[],r=[],i=[],a=[],o={};return Q1(e,(s,c)=>{if(Z(s)){let{field:l,aggregate:u,bin:d,timeUnit:f,...p}=s;if(u||f||d){let e=L1(s)?.title,m=Q(s,{forAs:!0}),h={...e?[]:{title:I1(s,t,{allowDisabling:!0})},...p,field:m};if(u){let e;if(WQ(u)?(e=`argmax`,m=Q({op:`argmax`,field:u.argmax},{forAs:!0}),h.field=`${m}.${l}`):UQ(u)?(e=`argmin`,m=Q({op:`argmin`,field:u.argmin},{forAs:!0}),h.field=`${m}.${l}`):u!==`boxplot`&&u!==`errorbar`&&u!==`errorband`&&(e=u),e){let t={op:e,as:m};l&&(t.field=l),a.push(t)}}else if(n.push(m),j1(s)&&JQ(d)){if(r.push({bin:d,field:l,as:m}),n.push(Q(s,{binSuffix:`end`})),q1(s,c)&&n.push(Q(s,{binSuffix:`range`})),LQ(c)){let e={field:`${m}_end`};o[`${c}2`]=e}h.bin=`binned`,AQ(c)||(h.type=J4)}else if(f&&!L$(f)){i.push({timeUnit:f,field:l,as:m});let e=j1(s)&&s.type!==X4&&`time`;e&&(c===h4||c===y4?h.formatType=e:DOe(c)?h.legend={formatType:e,...h.legend}:LQ(c)&&(h.axis={formatType:e,...h.axis}))}o[c]=h}else n.push(l),o[c]=e[c]}else o[c]=e[c]}),{bins:r,timeUnits:i,aggregate:a,groupby:n,encoding:o}}function mje(e,t,n){let r=kOe(t,n);if(!r)return!1;if(r===`binned`){let n=e[t===G2?U2:W2];return!!(Z(n)&&Z(e[t])&&YQ(n.bin))}return!0}function hje(e,t,n,r){let i={};for(let t of $(e))kQ(t)||X(nke(t));for(let a of wLe){if(!e[a])continue;let o=e[a];if(zQ(a)){let e=EOe(a),t=i[e];if(Z(t)&&sAe(t.type)&&Z(o)&&!t.timeUnit){X(YOe(e));continue}}if(a===`angle`&&t===`arc`&&!e.theta&&(X(_Re),a=Z2),!mje(e,a,t)){X(A$(a,t));continue}if(a===c4&&t===`line`&&B1(e[a])?.aggregate){X(vRe);continue}if(a===i4&&(n?`fill`in e:`stroke`in e)){X(eke(`encoding`,{fill:`fill`in e,stroke:`stroke`in e}));continue}if(a===_4||a===g4&&!H(o)&&!M1(o)||a===y4&&H(o)){if(o){if(a===g4){let t=e[a];if(WAe(t)){i[a]=t;continue}}i[a]=_h(o).reduce((e,t)=>(Z(t)?e.push(U1(t,a)):X(k$(t,a)),e),[])}}else{if(a===y4&&o===null)i[a]=null;else if(!Z(o)&&!D1(o)&&!M1(o)&&!C1(o)&&!r$(o)){X(k$(o,a));continue}i[a]=ije(o,a,r)}}return i}function Z1(e,t){let n={};for(let r of $(e))n[r]=ije(e[r],r,t,{compositeMark:!0});return n}function gje(e){let t=[];for(let n of $(e))if(X1(e,n)){let r=e[n],i=_h(r);for(let e of i)Z(e)?t.push(e):w1(e)&&t.push(e.condition)}return t}function Q1(e,t,n){if(e)for(let r of $(e)){let i=e[r];if(H(i))for(let e of i)t.call(n,e,r);else t.call(n,i,r)}}function _je(e,t,n,r){return e?$(e).reduce((n,i)=>{let a=e[i];return H(a)?a.reduce((e,n)=>t.call(r,e,n,i),n):t.call(r,n,a,i)},n):n}function vje(e,t){return $(t).reduce((n,r)=>{switch(r){case U2:case W2:case b4:case S4:case x4:case G2:case K2:return n;case q2:case J2:if(e===`line`||e===`area`||e===`trail`){let e=t[r];if(Z(e)){let i=t[r===q2?U2:W2];if(Z(i)&&!i.aggregate&&!e.aggregate){let t=Q(i,{}),r=Q(e,{});t&&r&&t!==r&&n.push(t)}}}return n;case Z2:case Q2:case Y2:case X2:case r4:case $2:case e4:case t4:case n4:case h4:case s4:case l4:case y4:return n;case g4:if(e===`line`||e===`trail`)return n;case _4:case v4:{let e=t[r];if(H(e)||Z(e))for(let t of _h(e))t.aggregate||n.push(Q(t,{}));return n}case c4:if(e===`trail`)return n;case i4:case a4:case o4:case u4:case d4:case f4:case m4:case p4:{let e=B1(t[r]);return e&&!e.aggregate&&n.push(Q(e,{})),n}}},[])}function yje(e){let{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(H(t)){for(let e of t)e.aggregate?(r||=[],r.push(e)):(i||=[],i.push(e));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return H(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function $1(e,t,n,r=!0){if(`tooltip`in n)return{tooltip:n.tooltip};let i=e.map(({fieldPrefix:e,titlePrefix:n})=>{let i=r?` of ${e0(t)}`:``;return{field:e+t.field,type:t.type,title:r$(n)?{signal:`${n}"${escape(i)}"`}:n+i}}),a=gje(n).map(YAe);return{tooltip:[...i,...ZZ(a,GZ)]}}function e0(e){let{title:t,field:n}=e;return _Q(t,n)}function t0(e,t,n,r,i){let{scale:a,axis:o}=n;return({partName:s,mark:c,positionPrefix:l,endPositionPrefix:u=void 0,extraEncoding:d={}})=>{let f=e0(n);return bje(e,s,i,{mark:c,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...f===void 0?{}:{title:f},...a===void 0?{}:{scale:a},...o===void 0?{}:{axis:o}},...qh(u)?{[`${t}2`]:{field:`${u}_${n.field}`}}:{},...r,...d}})}}function bje(e,t,n,r){let{clip:i,color:a,opacity:o}=e,s=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...a?{color:a}:{},...o?{opacity:o}:{},...i1(r.mark)?r.mark:{type:r.mark},style:`${s}-${String(t)}`,...Bh(e[t])?{}:e[t]}}]:[]}function xje(e,t,n){let{encoding:r}=e,i=t===`vertical`?`y`:`x`,a=r[i],o=r[`${i}2`],s=r[`${i}Error`],c=r[`${i}Error2`];return{continuousAxisChannelDef:n0(a,n),continuousAxisChannelDef2:n0(o,n),continuousAxisChannelDefError:n0(s,n),continuousAxisChannelDefError2:n0(c,n),continuousAxis:i}}function n0(e,t){if(e?.aggregate){let{aggregate:n,...r}=e;return n!==t&&X(Ake(n,t)),r}else return e}function Sje(e,t){let{mark:n,encoding:r}=e,{x:i,y:a}=r;if(i1(n)&&n.orient)return n.orient;if(O1(i)){if(O1(a)){let e=Z(i)&&i.aggregate,n=Z(a)&&a.aggregate;if(!e&&n===t)return`vertical`;if(!n&&e===t)return`horizontal`;if(e===t&&n===t)throw Error(`Both x and y cannot have aggregate`);return G1(a)&&!G1(i)?`horizontal`:`vertical`}return`horizontal`}else if(O1(a))return`vertical`;else throw Error(`Need a valid continuous axis for ${t}s`)}function Cje(e){return Wh(e)?`tukey`:e}function wje(e,{config:t}){e={...e,encoding:Z1(e.encoding,t)};let{mark:n,encoding:r,params:i,projection:a,...o}=e,s=i1(n)?n:{type:n};i&&X(O$(`boxplot`));let c=s.extent??t.boxplot.extent,l=m$(`size`,s,t),u=s.invalid,d=Cje(c),{bins:f,timeUnits:p,transform:m,continuousAxisChannelDef:h,continuousAxis:g,groupby:_,aggregate:v,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:S}=Eje(e,c,t),C=hQ(h.field),{color:w,size:T,...E}=y,D=e=>t0(s,g,h,e,t.boxplot),O=D(E),k=D(y),A=(Hm(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||`#4c78a8`,j=D({...E,...T?{size:T}:{},color:{condition:{test:`${dQ(`lower_box_${h.field}`)} >= ${dQ(`upper_box_${h.field}`)}`,...w||{value:A}}}}),M=$1([{fieldPrefix:d===`min-max`?`upper_whisker_`:`max_`,titlePrefix:`Max`},{fieldPrefix:`upper_box_`,titlePrefix:`Q3`},{fieldPrefix:`mid_box_`,titlePrefix:`Median`},{fieldPrefix:`lower_box_`,titlePrefix:`Q1`},{fieldPrefix:d===`min-max`?`lower_whisker_`:`min_`,titlePrefix:`Min`}],h,y),ee={type:`tick`,color:`black`,opacity:1,orient:b,invalid:u,aria:!1},N=d===`min-max`?M:$1([{fieldPrefix:`upper_whisker_`,titlePrefix:`Upper Whisker`},{fieldPrefix:`lower_whisker_`,titlePrefix:`Lower Whisker`}],h,y),te=[...O({partName:`rule`,mark:{type:`rule`,invalid:u,aria:!1},positionPrefix:`lower_whisker`,endPositionPrefix:`lower_box`,extraEncoding:N}),...O({partName:`rule`,mark:{type:`rule`,invalid:u,aria:!1},positionPrefix:`upper_box`,endPositionPrefix:`upper_whisker`,extraEncoding:N}),...O({partName:`ticks`,mark:ee,positionPrefix:`lower_whisker`,extraEncoding:N}),...O({partName:`ticks`,mark:ee,positionPrefix:`upper_whisker`,extraEncoding:N})],ne=[...d===`tukey`?[]:te,...k({partName:`box`,mark:{type:`bar`,...l?{size:l}:{},orient:x,invalid:u,ariaRoleDescription:`box`},positionPrefix:`lower_box`,endPositionPrefix:`upper_box`,extraEncoding:M}),...j({partName:`median`,mark:{type:`tick`,invalid:u,...Hm(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:b,aria:!1},positionPrefix:`mid_box`,extraEncoding:M})];if(d===`min-max`)return{...o,transform:(o.transform??[]).concat(m),layer:ne};let P=dQ(`lower_box_${h.field}`),re=dQ(`upper_box_${h.field}`),F=`(${re} - ${P})`,ie=`${P} - ${c} * ${F}`,ae=`${re} + ${c} * ${F}`,oe=dQ(h.field),se={joinaggregate:Tje(h.field),groupby:_},ce={transform:[{filter:`(${ie} <= ${oe}) && (${oe} <= ${ae})`},{aggregate:[{op:`min`,field:h.field,as:`lower_whisker_${C}`},{op:`max`,field:h.field,as:`upper_whisker_${C}`},{op:`min`,field:`lower_box_${h.field}`,as:`lower_box_${C}`},{op:`max`,field:`upper_box_${h.field}`,as:`upper_box_${C}`},...v],groupby:_}],layer:te},{tooltip:le,...ue}=E,{scale:de,axis:fe}=h,pe=e0(h),me=bje(s,`outliers`,t.boxplot,{transform:[{filter:`(${oe} < ${ie}) || (${oe} > ${ae})`}],mark:`point`,encoding:{[g]:{field:h.field,type:h.type,...pe===void 0?{}:{title:pe},...de===void 0?{}:{scale:de},...fe===void 0?{}:{axis:fe}},...ue,...w?{color:w}:{},...S?{tooltip:S}:{}}})[0],he,ge=[...f,...p,se];return me?he={transform:ge,layer:[me,ce]}:(he=ce,he.transform.unshift(...ge)),{...o,layer:[he,{transform:m,layer:ne}]}}function Tje(e){let t=hQ(e);return[{op:`q1`,field:e,as:`lower_box_${t}`},{op:`q3`,field:e,as:`upper_box_${t}`}]}function Eje(e,t,n){let r=Sje(e,k3),{continuousAxisChannelDef:i,continuousAxis:a}=xje(e,r,k3),o=i.field,s=hQ(o),c=Cje(t),l=[...Tje(o),{op:`median`,field:o,as:`mid_box_${s}`},{op:`min`,field:o,as:(c===`min-max`?`lower_whisker_`:`min_`)+s},{op:`max`,field:o,as:(c===`min-max`?`upper_whisker_`:`max_`)+s}],u=c===`min-max`||c===`tukey`?[]:[{calculate:`${dQ(`upper_box_${s}`)} - ${dQ(`lower_box_${s}`)}`,as:`iqr_${s}`},{calculate:`min(${dQ(`upper_box_${s}`)} + ${dQ(`iqr_${s}`)} * ${t}, ${dQ(`max_${s}`)})`,as:`upper_whisker_${s}`},{calculate:`max(${dQ(`lower_box_${s}`)} - ${dQ(`iqr_${s}`)} * ${t}, ${dQ(`min_${s}`)})`,as:`lower_whisker_${s}`}],{[a]:d,...f}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:m}=yje(f),{bins:h,timeUnits:g,aggregate:_,groupby:v,encoding:y}=pje(m,n),b=r===`vertical`?`horizontal`:`vertical`,x=r;return{bins:h,timeUnits:g,transform:[...h,...g,{aggregate:[..._,...l],groupby:v},...u],groupby:v,aggregate:_,continuousAxisChannelDef:i,continuousAxis:a,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:p}}function Dje(e,{config:t}){e={...e,encoding:Z1(e.encoding,t)};let{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:a,ticksOrient:o,markDef:s,outerSpec:c,tooltipEncoding:l}=Mje(e,A3,t);delete a.size;let u=t0(s,i,r,a,t.errorbar),d=s.thickness,f=s.size,p={type:`tick`,orient:o,aria:!1,...d===void 0?{}:{thickness:d},...f===void 0?{}:{size:f}},m=[...u({partName:`ticks`,mark:p,positionPrefix:`lower`,extraEncoding:l}),...u({partName:`ticks`,mark:p,positionPrefix:`upper`,extraEncoding:l}),...u({partName:`rule`,mark:{type:`rule`,ariaRoleDescription:`errorbar`,...d===void 0?{}:{size:d}},positionPrefix:`lower`,endPositionPrefix:`upper`,extraEncoding:l})];return{...c,transform:n,...m.length>1?{layer:m}:{...m[0]}}}function Oje(e,t){let{encoding:n}=e;if(kje(n))return{orient:Sje(e,t),inputType:`raw`};let r=Aje(n),i=jje(n),a=n.x,o=n.y;if(r){if(i)throw Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);let e=n.x2,r=n.y2;if(A1(e)&&A1(r))throw Error(`${t} cannot have both x2 and y2`);if(A1(e)){if(O1(a))return{orient:`horizontal`,inputType:`aggregated-upper-lower`};throw Error(`Both x and x2 have to be quantitative in ${t}`)}else if(A1(r)){if(O1(o))return{orient:`vertical`,inputType:`aggregated-upper-lower`};throw Error(`Both y and y2 have to be quantitative in ${t}`)}throw Error(`No ranged axis`)}else{let e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(A1(r)&&!A1(e))throw Error(`${t} cannot have xError2 without xError`);if(A1(s)&&!A1(i))throw Error(`${t} cannot have yError2 without yError`);if(A1(e)&&A1(i))throw Error(`${t} cannot have both xError and yError with both are quantiative`);if(A1(e)){if(O1(a))return{orient:`horizontal`,inputType:`aggregated-error`};throw Error(`All x, xError, and xError2 (if exist) have to be quantitative`)}else if(A1(i)){if(O1(o))return{orient:`vertical`,inputType:`aggregated-error`};throw Error(`All y, yError, and yError2 (if exist) have to be quantitative`)}throw Error(`No ranged axis`)}}function kje(e){return(A1(e.x)||A1(e.y))&&!A1(e.x2)&&!A1(e.y2)&&!A1(e.xError)&&!A1(e.xError2)&&!A1(e.yError)&&!A1(e.yError2)}function Aje(e){return A1(e.x2)||A1(e.y2)}function jje(e){return A1(e.xError)||A1(e.xError2)||A1(e.yError)||A1(e.yError2)}function Mje(e,t,n){let{mark:r,encoding:i,params:a,projection:o,...s}=e,c=i1(r)?r:{type:r};a&&X(O$(t));let{orient:l,inputType:u}=Oje(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:f,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:m,continuousAxis:h}=xje(e,l,t),{errorBarSpecificAggregate:g,postAggregateCalculates:_,tooltipSummary:v,tooltipTitleWithFieldName:y}=Nje(c,d,f,p,m,u,t,n),{[h]:b,[h===`x`?`x2`:`y2`]:x,[h===`x`?`xError`:`yError`]:S,[h===`x`?`xError2`:`yError2`]:C,...w}=i,{bins:T,timeUnits:E,aggregate:D,groupby:O,encoding:k}=pje(w,n),A=[...D,...g],j=u===`raw`?O:[],M=$1(v,d,k,y);return{transform:[...s.transform??[],...T,...E,...A.length===0?[]:[{aggregate:A,groupby:j}],..._],groupby:j,continuousAxisChannelDef:d,continuousAxis:h,encodingWithoutContinuousAxis:k,ticksOrient:l===`vertical`?`horizontal`:`vertical`,markDef:c,outerSpec:s,tooltipEncoding:M}}function Nje(e,t,n,r,i,a,o,s){let c=[],l=[],u=t.field,d,f=!1;if(a===`raw`){let t=e.center?e.center:e.extent?e.extent===`iqr`?`median`:`mean`:s.errorbar.center,n=e.extent?e.extent:t===`mean`?`stderr`:`iqr`;if(t===`median`!=(n===`iqr`)&&X(kke(t,n,o)),n===`stderr`||n===`stdev`)c=[{op:n,field:u,as:`extent_${u}`},{op:t,field:u,as:`center_${u}`}],l=[{calculate:`${dQ(`center_${u}`)} + ${dQ(`extent_${u}`)}`,as:`upper_${u}`},{calculate:`${dQ(`center_${u}`)} - ${dQ(`extent_${u}`)}`,as:`lower_${u}`}],d=[{fieldPrefix:`center_`,titlePrefix:cQ(t)},{fieldPrefix:`upper_`,titlePrefix:Pje(t,n,`+`)},{fieldPrefix:`lower_`,titlePrefix:Pje(t,n,`-`)}],f=!0;else{let e,t,r;n===`ci`?(e=`mean`,t=`ci0`,r=`ci1`):(e=`median`,t=`q1`,r=`q3`),c=[{op:t,field:u,as:`lower_${u}`},{op:r,field:u,as:`upper_${u}`},{op:e,field:u,as:`center_${u}`}],d=[{fieldPrefix:`upper_`,titlePrefix:I1({field:u,aggregate:r,type:`quantitative`},s,{allowDisabling:!1})},{fieldPrefix:`lower_`,titlePrefix:I1({field:u,aggregate:t,type:`quantitative`},s,{allowDisabling:!1})},{fieldPrefix:`center_`,titlePrefix:I1({field:u,aggregate:e,type:`quantitative`},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&X(Oke(e.center,e.extent)),a===`aggregated-upper-lower`?(d=[],l=[{calculate:dQ(n.field),as:`upper_${u}`},{calculate:dQ(u),as:`lower_${u}`}]):a===`aggregated-error`&&(d=[{fieldPrefix:``,titlePrefix:u}],l=[{calculate:`${dQ(u)} + ${dQ(r.field)}`,as:`upper_${u}`}],i?l.push({calculate:`${dQ(u)} + ${dQ(i.field)}`,as:`lower_${u}`}):l.push({calculate:`${dQ(u)} - ${dQ(r.field)}`,as:`lower_${u}`}));for(let e of l)d.push({fieldPrefix:e.as.substring(0,6),titlePrefix:mQ(mQ(e.calculate,`datum['`,``),`']`,``)})}return{postAggregateCalculates:l,errorBarSpecificAggregate:c,tooltipSummary:d,tooltipTitleWithFieldName:f}}function Pje(e,t,n){return`${cQ(e)} ${n} ${t}`}function Fje(e,{config:t}){e={...e,encoding:Z1(e.encoding,t)};let{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:a,markDef:o,outerSpec:s,tooltipEncoding:c}=Mje(e,j3,t),l=o,u=t0(l,i,r,a,t.errorband),d=e.encoding.x!==void 0&&e.encoding.y!==void 0,f={type:d?`area`:`rect`},p={type:d?`line`:`rule`},m={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return d?(f={...f,...m,ariaRoleDescription:`errorband`},p={...p,...m,aria:!1}):l.interpolate?X(jke(`interpolate`)):l.tension&&X(jke(`tension`)),{...s,transform:n,layer:[...u({partName:`band`,mark:f,positionPrefix:`lower`,endPositionPrefix:`upper`,extraEncoding:c}),...u({partName:`borders`,mark:p,positionPrefix:`lower`,extraEncoding:c}),...u({partName:`borders`,mark:p,positionPrefix:`upper`,extraEncoding:c})]}}function r0(e,t,n){let r=new O3(e,t);M3[e]={normalizer:r,parts:n}}function Ije(){return $(M3)}function i0(e){return e===`legend`||!!e?.legend}function a0(e){return i0(e)&&Hm(e)}function o0(e){return!!e?.select}function Lje(e){let t=[];for(let n of e||[]){if(o0(n))continue;let{expr:e,bind:r,...i}=n;if(r&&e){let n={...i,bind:r,init:e};t.push(n)}else{let n={...i,...e?{update:e}:{},...r?{bind:r}:{}};t.push(n)}}return t}function Rje(e){return c0(e)||l0(e)||s0(e)}function s0(e){return Y(e,`concat`)}function c0(e){return Y(e,`vconcat`)}function l0(e){return Y(e,`hconcat`)}function zje({step:e,offsetIsDiscrete:t}){return t?e.for??`offset`:`position`}function u0(e){return Y(e,`step`)}function Bje(e){return Y(e,`view`)||Y(e,`width`)||Y(e,`height`)}function Vje(e,t,n){let r=n[t],i={},{spacing:a,columns:o}=r;a!==void 0&&(i.spacing=a),o!==void 0&&(b1(e)&&!v1(e.facet)||s0(e))&&(i.columns=o),c0(e)&&(i.columns=1);for(let t of dze)if(e[t]!==void 0)if(t===`spacing`){let n=e[t];i[t]=Wh(n)?n:{row:n.row??a,column:n.column??a}}else i[t]=e[t];return i}function d0(e,t){return e[t]??e[t===`width`?`continuousWidth`:`continuousHeight`]}function f0(e,t){let n=p0(e,t);return u0(n)?n.step:z3}function p0(e,t){return _Q(e[t]??e[t===`width`?`discreteWidth`:`discreteHeight`],{step:e.step})}function Hje(e={}){return{signals:[{name:`color`,value:Hm(e)?{...H3,...e}:H3}],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 Uje(e){return{signals:[{name:`fontSize`,value:Hm(e)?{...V3,...e}:V3}],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 Wje(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function Gje(e){let t=$(e||{}),n={};for(let r of t){let t=e[r];n[r]=J1(t)?s$(t):c$(t)}return n}function Kje(e){let t=$(e),n={};for(let r of t)n[r]=Gje(e[r]);return n}function qje(e={}){let{color:t,font:n,fontSize:r,selection:i,...a}=e,o=Wm({},F2(fze),n?Wje(n):{},t?Hje(t):{},r?Uje(r):{},a||{});i&&Gm(o,`selection`,i,!0);let s=WZ(o,pze);for(let e of[`background`,`lineBreak`,`padding`])o[e]&&(s[e]=c$(o[e]));for(let e of v3)o[e]&&(s[e]=e$(o[e]));for(let e of D3)o[e]&&(s[e]=Gje(o[e]));for(let e of F3)o[e]&&(s[e]=e$(o[e]));if(o.legend&&(s.legend=e$(o.legend)),o.scale){let{invalid:e,...t}=o.scale,n=e$(e,{level:1});s.scale={...e$(t),...$(n).length>0?{invalid:n}:{}}}return o.style&&(s.style=Kje(o.style)),o.title&&(s.title=e$(o.title)),o.view&&(s.view=e$(o.view)),s}function Jje(e){e=F2(e);for(let t of hze)delete e[t];if(e.axis)for(let t in e.axis)J1(e.axis[t])&&delete e.axis[t];if(e.legend)for(let t of aze)delete e.legend[t];if(e.mark){for(let t of g3)delete e.mark[t];e.mark.tooltip&&Hm(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(Lje(e.params)),delete e.params);for(let t of mze){for(let n of g3)delete e[t][n];let n=gze[t];if(n)for(let r of n)delete e[t][r];Xje(e,t)}for(let t of Ije())delete e[t];Yje(e);for(let t in e)Hm(e[t])&&nQ(e[t])&&delete e[t];return nQ(e)?void 0:e}function Yje(e){let{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=t$(e.title);nQ(t)||(e.style[`group-title`]={...e.style[`group-title`],...t}),nQ(n)||(e.style[`group-subtitle`]={...e.style[`group-subtitle`],...n}),nQ(r)?delete e.title:e.title=r}function Xje(e,t,n,r){let i=e[t];t===`view`&&(n=`cell`);let a={...i,...e.style[n??t]};nQ(a)||(e.style[n??t]=a),delete e[t]}function m0(e){return Y(e,`layer`)}function Zje(e){return Y(e,`repeat`)}function Qje(e){return!H(e.repeat)&&Y(e.repeat,`layer`)}function $je(e){return Ph(_ze,e)}function h0(e){return Z(e)&&E1(e)===`quantitative`&&!e.bin}function eMe(e,t,{orient:n,type:r}){let i=t===`x`?`y`:`radius`,a=t===`x`&&[`bar`,`area`].includes(r),o=e[t],s=e[i];if(Z(o)&&Z(s)){if(h0(o)&&h0(s)){if(o.stack)return t;if(s.stack)return i;let e=Z(o)&&!!o.aggregate;if(e!==(Z(s)&&!!s.aggregate))return e?t:i;if(a){if(n===`vertical`)return i;if(n===`horizontal`)return t}}else if(h0(o))return t;else if(h0(s))return i}else if(h0(o))return a&&n===`vertical`?void 0:t;else if(h0(s))return a&&n===`horizontal`?void 0:i}function tMe(e){switch(e){case`x`:return`y`;case`y`:return`x`;case`theta`:return`radius`;case`radius`:return`theta`}}function nMe(e,t){let n=i1(e)?e:{type:e},r=n.type;if(!vze.has(r))return null;let i=eMe(t,`x`,n)||eMe(t,`theta`,n);if(!i)return null;let a=t[i],o=Z(a)?Q(a,{}):void 0,s=tMe(i),c=[],l=new Set;if(t[s]){let e=t[s],n=Z(e)?Q(e,{}):void 0;n&&n!==o&&(c.push(s),l.add(n))}let u=s===`x`?`xOffset`:`yOffset`,d=t[u],f=Z(d)?Q(d,{}):void 0;f&&f!==o&&(c.push(u),l.add(f));let p=zLe.reduce((e,n)=>{if(n!==`tooltip`&&X1(t,n)){let r=t[n];for(let t of _h(r)){let r=B1(t);if(r.aggregate)continue;let i=Q(r,{});(!i||!l.has(i))&&e.push({channel:n,fieldDef:r})}}return e},[]),m;return a.stack===void 0?yze.has(r)&&(m=`zero`):m=Bh(a.stack)?a.stack?`zero`:null:a.stack,!m||!$je(m)||fje(t)&&p.length===0?null:(a?.scale?.type&&a?.scale?.type!==$4.LINEAR&&a?.stack&&X(Tke(a.scale.type)),A1(t[NQ(i)])?(a.stack!==void 0&&X(wke(i)),null):(Z(a)&&a.aggregate&&!nRe.has(a.aggregate)&&X(Eke(a.aggregate)),{groupbyChannels:c,groupbyFields:l,fieldChannel:i,impute:a.impute!==null&&n1(r),stackBy:p,offset:m}))}function rMe(e,t,n){let r=e$(e),i=m$(`orient`,r,n);if(r.orient=sMe(r.type,t,i),i!==void 0&&i!==r.orient&&X(cke(r.orient,i)),r.type===`bar`&&r.orient){let e=m$(`cornerRadiusEnd`,r,n);if(e!==void 0){let n=r.orient===`horizontal`&&t.x2||r.orient===`vertical`&&t.y2?[`cornerRadius`]:qRe[r.orient];for(let t of n)r[t]=e;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}let a=m$(`opacity`,r,n),o=m$(`fillOpacity`,r,n);return a===void 0&&o===void 0&&(r.opacity=aMe(r.type,t)),m$(`cursor`,r,n)===void 0&&(r.cursor=iMe(r,t,n)),r}function iMe(e,t,n){return t.href||e.href||m$(`href`,e,n)?`pointer`:e.cursor}function aMe(e,t){if(qZ([l3,f3,p3,m3],e)&&!fje(t))return W3}function oMe(e,t,{graticule:n}){if(n)return!1;let r=h$(`filled`,e,t),i=e.type;return _Q(r,i!==l3&&i!==c3&&i!==u3)}function sMe(e,t,n){switch(e){case l3:case p3:case m3:case zRe:case RRe:return}let{x:r,y:i,x2:a,y2:o}=t;switch(e){case d3:case s3:if(Z(r)&&(YQ(r.bin)||Z(i)&&i.aggregate&&!r.aggregate))return`vertical`;if(Z(i)&&(YQ(i.bin)||Z(r)&&r.aggregate&&!i.aggregate))return`horizontal`;if(o||a){if(n)return n;if(!a)return(Z(r)&&r.type===J4&&!JQ(r.bin)||k1(r))&&Z(i)&&YQ(i.bin)?`horizontal`:`vertical`;if(!o)return(Z(i)&&i.type===J4&&!JQ(i.bin)||k1(i))&&Z(r)&&YQ(r.bin)?`vertical`:`horizontal`}case u3:if(a&&!(Z(r)&&YQ(r.bin))&&o&&!(Z(i)&&YQ(i.bin)))return;case o3:if(o)return Z(i)&&YQ(i.bin)?`horizontal`:`vertical`;if(a)return Z(r)&&YQ(r.bin)?`vertical`:`horizontal`;if(e===u3){if(r&&!i)return`vertical`;if(i&&!r)return`horizontal`}case c3:case f3:{let t=KAe(r),a=KAe(i);if(n)return n;if(t&&!a)return e===`tick`?`vertical`:`horizontal`;if(!t&&a)return e===`tick`?`horizontal`:`vertical`;if(t&&a)return`vertical`;{let e=j1(r)&&r.type===X4,t=j1(i)&&i.type===X4;if(e&&!t)return`vertical`;if(!e&&t)return`horizontal`}return}}return`vertical`}function cMe(e){let{point:t,line:n,...r}=e;return $(r).length>1?r:r.type}function lMe(e){for(let t of[`line`,`area`,`rule`,`trail`])e[t]&&(e={...e,[t]:WZ(e[t],[`point`,`line`])});return e}function g0(e,t={},n){return e.point===`transparent`?{opacity:0}:e.point?Hm(e.point)?e.point:{}:e.point===void 0?t.point||n.shape?Hm(t.point)?t.point:{}:void 0:null}function uMe(e,t={}){return e.line?e.line===!0?{}:e.line:e.line===void 0?t.line?t.line===!0?{}:t.line:void 0:null}function dMe(e,t){return t?v1(e)?hMe(e,t):fMe(e,t):e}function _0(e,t){return t?hMe(e,t):e}function v0(e,t,n){let r=t[e];if(BAe(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};X(BOe(r.repeat));return}return t}function fMe(e,t){if(e=v0(`field`,e,t),e!==void 0){if(e===null)return null;if(x1(e)&&_1(e.sort)){let n=v0(`field`,e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function pMe(e,t){if(Z(e))return fMe(e,t);{let n=v0(`datum`,e,t);return n!==e&&!n.type&&(n.type=`nominal`),n}}function mMe(e,t){if(A1(e)){let n=pMe(e,t);if(n)return n;if(C1(e))return{condition:e.condition}}else{if(T1(e)){let n=pMe(e.condition,t);if(n)return{...e,condition:n};{let{condition:t,...n}=e;return n}}return e}}function hMe(e,t){let n={};for(let r in e)if(Y(e,r)){let i=e[r];if(H(i))n[r]=i.map(e=>mMe(e,t)).filter(e=>e);else{let e=mMe(i,t);e!==void 0&&(n[r]=e)}}return n}function gMe({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){let i=new Set([...$(e),...$(t)]);for(let a of i){let i=t[a],o=e[a];if(A1(i)){let e={...o,...i};r[a]=e}else T1(i)?r[a]={...i,condition:{...o,...i.condition}}:i||i===null?r[a]=i:(n||M1(o)||r$(o)||A1(o)||H(o))&&(r[a]=o)}}else r=t;return!r||nQ(r)?void 0:r}function _Me(e){let{parentProjection:t,projection:n}=e;return t&&n&&X(JOe({parentProjection:t,projection:n})),n??t}function y0(e){return Y(e,`filter`)}function vMe(e){return Y(e,`stop`)}function yMe(e){return Y(e,`lookup`)}function bMe(e){return Y(e,`data`)}function xMe(e){return Y(e,`param`)}function SMe(e){return Y(e,`pivot`)}function CMe(e){return Y(e,`density`)}function wMe(e){return Y(e,`quantile`)}function TMe(e){return Y(e,`regression`)}function EMe(e){return Y(e,`loess`)}function DMe(e){return Y(e,`sample`)}function OMe(e){return Y(e,`window`)}function kMe(e){return Y(e,`joinaggregate`)}function AMe(e){return Y(e,`flatten`)}function jMe(e){return Y(e,`calculate`)}function MMe(e){return Y(e,`bin`)}function NMe(e){return Y(e,`impute`)}function PMe(e){return Y(e,`timeUnit`)}function FMe(e){return Y(e,`aggregate`)}function IMe(e){return Y(e,`stack`)}function LMe(e){return Y(e,`fold`)}function RMe(e){return Y(e,`extent`)&&!Y(e,`density`)&&!Y(e,`regression`)}function zMe(e){return e.map(e=>y0(e)?{filter:VZ(e.filter,oAe)}:e)}function BMe(e,t){let{transform:n,...r}=e;if(n){let e=n.map(e=>{if(y0(e))return{filter:b0(e,t)};if(MMe(e)&&XQ(e.bin))return{...e,bin:HMe(e.bin)};if(yMe(e)){let{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e});return{...r,transform:e}}return e}function VMe(e,t){let n=F2(e);if(Z(n)&&XQ(n.bin)&&(n.bin=HMe(n.bin)),N1(n)&&n.scale?.domain?.selection){let{selection:e,...t}=n.scale.domain;n.scale.domain={...t,...e?{param:e}:{}}}if(C1(n))if(H(n.condition))n.condition=n.condition.map(e=>{let{selection:n,param:r,test:i,...a}=e;return r?e:{...a,test:b0(e,t)}});else{let{selection:e,param:r,test:i,...a}=VMe(n.condition,t);n.condition=r?n.condition:{...a,test:b0(n.condition,t)}}return n}function HMe(e){let t=e.extent;if(t?.selection){let{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function b0(e,t){let n=e=>VZ(e,e=>{let n={param:e,empty:t.emptySelections[e]??!0};return t.selectionPredicates[e]??=[],t.selectionPredicates[e].push(n),n});return e.selection?n(e.selection):VZ(e.test||e.filter,e=>e.selection?n(e.selection):e)}function UMe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function WMe(e,t){t===void 0&&(t=qje(e.config));let n=GMe(e,t),{width:r,height:i}=e,a=qMe(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...a?{autosize:a}:{}}}function GMe(e,t={}){let n={config:t};return Eze.map(wze.map(Tze.map(e,n),n),n)}function KMe(e){return qh(e)?{type:e}:e??{}}function qMe(e,t,n){let{width:r,height:i}=t,a=Y1(e)||m0(e),o={};a?r==`container`&&i==`container`?(o.type=`fit`,o.contains=`padding`):r==`container`?(o.type=`fit-x`,o.contains=`padding`):i==`container`&&(o.type=`fit-y`,o.contains=`padding`):(r==`container`&&(X(C$(`width`)),r=void 0),i==`container`&&(X(C$(`height`)),i=void 0));let s={type:`pad`,...o,...n?KMe(n.autosize):{},...KMe(e.autosize)};if(s.type===`fit`&&!a&&(X(sRe),s.type=`pad`),r==`container`&&!(s.type==`fit`||s.type==`fit-x`)&&X(w$(`width`)),i==`container`&&!(s.type==`fit`||s.type==`fit-y`)&&X(w$(`height`)),!CQ(s,{type:`pad`}))return s}function JMe(e){return[`fit`,`fit-x`,`fit-y`].includes(e)}function YMe(e){return e?`fit-${RQ(e)}`:`fit`}function XMe(e,t){let n={};for(let t of Dze)e&&e[t]!==void 0&&(n[t]=c$(e[t]));return t&&(n.params=e.params),n}function x0(e){return{explicit:!0,value:e}}function S0(e){return{explicit:!1,value:e}}function ZMe(e){return(t,n,r,i)=>{let a=e(t.value,n.value);return a>0?t:a<0?n:C0(t,n,r,i)}}function C0(e,t,n,r){return e.explicit&&t.explicit&&X(yke(n,r,e.value,t.value)),e}function w0(e,t,n,r,i=C0){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:CQ(e.value,t.value)?e:i(e,t,n,r)}function T0(e){return Y(e,`url`)}function E0(e){return Y(e,`values`)}function QMe(e){return Y(e,`name`)&&!T0(e)&&!E0(e)&&!D0(e)}function D0(e){return e&&($Me(e)||eNe(e)||O0(e))}function $Me(e){return Y(e,`sequence`)}function eNe(e){return Y(e,`sphere`)}function O0(e){return Y(e,`graticule`)}function tNe({invalid:e,isPath:t}){switch(xAe(e,{isPath:t})){case`filter`:return{marks:`exclude-invalid-values`,scales:`exclude-invalid-values`};case`break-paths-show-domains`:return{marks:t?`include-invalid-values`:`exclude-invalid-values`,scales:`include-invalid-values`};case`break-paths-filter-domains`:return{marks:t?`include-invalid-values`:`exclude-invalid-values`,scales:`exclude-invalid-values`};case`show`:return{marks:`include-invalid-values`,scales:`include-invalid-values`}}}function nNe(e){let{marks:t,scales:n}=tNe(e);return t===n?q3.Main:n===`include-invalid-values`?q3.PreFilterInvalid:q3.PostFilterInvalid}function k0(e){return e.as!==void 0}function rNe(e){return`${e}_end`}function iNe({timeUnit:e,field:t,reverse:n}){let{unit:r,utc:i}=e,{part:a,step:o}=eAe(Kke(r),e.step);return`${i?`utcOffset`:`timeOffset`}('${a}', ${dQ(t)}, ${n?-o:o})`}function aNe([e,t],n,r){if(n!==void 0&&n!==.5){let i=dQ(e),a=dQ(t);return[{type:`formula`,expr:oNe([iNe({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${Z3}`},{type:`formula`,expr:oNe([i,a],n+.5),as:`${e}_${Q3}`}]}return[]}function oNe([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}function sNe(e){let{signals:t,hasLegend:n,index:r,...i}=e;return i.field=pQ(i.field),i}function A0(e,t=!0,n=Pm){if(H(e)){let r=e.map(e=>A0(e,t,n));return t?`[${r.join(`, `)}]`:r}else if(P$(e))return n(t?I$(e):Hke(e));return t?n(wQ(e)):e}function cNe(e,t){for(let n of I2(e.component.selection??{})){let r=n.name,i=`${r}${w6}, ${n.resolve===`global`?`true`:`{unit: ${K0(e)}}`}`;for(let r of E6)r.defined(n)&&(r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(i=r.modifyExpr(e,n,i)));t.push({name:r+Hze,on:[{events:{signal:n.name+w6},update:`modify(${W(n.name+C6)}, ${i})`}]})}return j0(t)}function lNe(e,t){if(e.component.selection&&$(e.component.selection).length){let n=W(e.getName(`cell`));t.unshift({name:`facet`,value:{},on:[{events:JG(`pointermove`,`scope`),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return j0(t)}function uNe(e,t){let n=!1;for(let r of I2(e.component.selection??{})){let i=r.name,a=W(i+C6);if(t.filter(e=>e.name===i).length===0){let e=r.resolve===`global`?`union`:r.resolve,n=r.type===`point`?`, true, true)`:`)`;t.push({name:r.name,update:`${T6}(${a}, ${W(e)}${n}`})}n=!0;for(let n of E6)n.defined(r)&&n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}return n&&t.filter(e=>e.name===`unit`).length===0&&t.unshift({name:`unit`,value:{},on:[{events:`pointermove`,update:`isTuple(group()) ? group() : unit`}]}),j0(t)}function dNe(e,t){let n=[],r=[],i=K0(e,{escape:!1});for(let a of I2(e.component.selection??{})){let o={name:a.name+C6};if(a.project.hasSelectionId&&(o.transform=[{type:`collect`,sort:{field:L3}}]),a.init){let e=a.project.items.map(sNe);o.values=a.project.hasSelectionId?a.init.map(e=>({unit:i,[L3]:A0(e,!1)[0]})):a.init.map(t=>({unit:i,fields:e,values:A0(t,!1)}))}if([...n,...t].filter(e=>e.name===a.name+C6).length||n.push(o),J0(a)&&t.length){let n=e.lookupDataSource(e.getDataName(q3.Main)),i=t.find(e=>e.name===n),a=i.transform.find(e=>e.type===`filter`&&e.expr.includes(`vlSelectionTest`));if(a){i.transform=i.transform.filter(e=>e!==a);let e={name:i.name+e6,source:i.name,transform:[a]};r.push(e)}}}return n.concat(t,r)}function fNe(e,t){for(let n of I2(e.component.selection??{}))for(let r of E6)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function pNe(e,t){for(let n of e.children)C2(n)&&(t=fNe(n,t));return t}function mNe(e,t,n,r){let i=JNe(e,t.param,t);return{signal:Q$(n.get(`type`))&&H(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function j0(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}function M0(e,t){return`domain(${W(e.scaleName(t))})`}function N0(e){return e.parent&&E2(e.parent)&&(!e.parent.parent||N0(e.parent.parent))}function hNe(e,t,n,r){let i=!e.hasProjection,a=n.channel,o=n.signals.visual,s=W(i?e.scaleName(a):e.projectionName()),c=e=>`scale(${s}, ${e})`,l=e.getSizeSignalRef(a===U2?`width`:`height`).signal,u=`${a}(unit)`,d=t.events.reduce((e,t)=>[...e,{events:t.between[0],update:`[${u}, ${u}]`},{events:t,update:`[${o}[0], clamp(${u}, 0, ${l})]`}],[]);if(i){let i=n.signals.data,l=c6.defined(t),u=e.getScaleComponent(a),f=u?u.get(`type`):void 0,p=r?{init:A0(r,!0,c)}:{value:[]};return d.push({events:{signal:t.name+u6},update:Q$(f)?`[${c(`${i}[0]`)}, ${c(`${i}[1]`)}]`:`[0, 0]`}),l?[{name:i,on:[]}]:[{name:o,...p,on:d},{name:i,...r?{init:A0(r)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${s}, ${o})`}]}]}else{let e=a===U2?0:1,n=t.name+f6;return[{name:o,...r?{init:`[${n}[0][${e}], ${n}[1][${e}]]`}:{value:[]},on:d}]}}function P0({model:e,channelDef:t,vgChannel:n,invalidValueRef:r,mainRefFn:i}){let a=C1(t)&&t.condition,o=[];a&&(o=_h(a).map(t=>{let n=i(t);if(zAe(t)){let{param:r,empty:i}=t;return{test:qNe(e,{param:r,empty:i}),...n}}else return{test:X0(e,t.test),...n}})),r!==void 0&&o.push(r);let s=i(t);return s!==void 0&&o.push(s),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function F0(e,t=`text`){let n=e.encoding[t];return P0({model:e,channelDef:n,vgChannel:t,mainRefFn:t=>I0(t,e.config),invalidValueRef:void 0})}function I0(e,t,n=`datum`){if(e){if(M1(e))return u$(e.value);if(A1(e)){let{format:r,formatType:i}=z1(e);return p1({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function gNe(e,t={}){let{encoding:n,markDef:r,config:i,stack:a}=e,o=n.tooltip;if(H(o))return{tooltip:vNe({tooltip:o},a,i,t)};{let s=t.reactiveGeom?`datum.datum`:`datum`;return P0({model:e,channelDef:o,vgChannel:`tooltip`,mainRefFn:e=>{let o=yNe(e,i,s);if(o)return o;if(e===null)return;let c=m$(`tooltip`,r,i);if(c===!0&&(c={content:`encoding`}),qh(c))return{value:c};if(Hm(c))return r$(c)?c:c.content===`encoding`?vNe(n,a,i,t):{signal:s}},invalidValueRef:void 0})}}function _Ne(e,t,n,{reactiveGeom:r}={}){let i={...n,...n.tooltipFormat},a=new Set,o=r?`datum.datum`:`datum`,s=[];function c(n,r){let c=jQ(r),l=j1(n)?n:{...n,type:e[c].type},u=_h(l.title||R1(l,i)).join(`, `).replaceAll(/"/g,`\\"`),d;if(LQ(r)){let t=r===`x`?`x2`:`y2`,n=B1(e[t]);if(YQ(l.bin)&&n){let e=Q(l,{expr:o}),r=Q(n,{expr:o}),{format:s,formatType:c}=z1(l);d=g1(e,r,s,c,i),a.add(t)}}if((LQ(r)||r===Z2||r===Y2)&&t&&t.fieldChannel===r&&t.offset===`normalize`){let{format:e,formatType:t}=z1(l);d=p1({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:i,normalizeStack:!0}).signal}d??=yNe(l,i,o).signal,s.push({channel:r,key:u,value:d})}Q1(e,(e,t)=>{Z(e)?c(e,t):w1(e)&&c(e.condition,t)});let l={};for(let{channel:e,key:t,value:n}of s)!a.has(e)&&!l[t]&&(l[t]=n);return l}function vNe(e,t,n,{reactiveGeom:r}={}){let i=_Ne(e,t,n,{reactiveGeom:r}),a=L2(i).map(([e,t])=>`"${e}": ${t}`);return a.length>0?{signal:`{${a.join(`, `)}}`}:void 0}function yNe(e,t,n=`datum`){if(Z(e)&&X$(e.type)&&!e.timeUnit&&!z1(e).format&&!z1(e).formatType){let t=`${n}["${e.field}"]`;return{signal:`isValid(${t}) ? isArray(${t}) ? join(${t}, '\\n') : ${t} : ""+${t}`}}return I0(e,t,n)}function bNe(e){let{markDef:t,config:n}=e,r=m$(`aria`,t,n);return r===!1?{}:{...r?{aria:r}:{},...xNe(e),...SNe(e)}}function xNe(e){let{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};let i=m$(`ariaRoleDescription`,n,r);return i==null?Ph(aRe,t)?{}:{ariaRoleDescription:{value:t}}:{ariaRoleDescription:{value:i}}}function SNe(e){let{encoding:t,markDef:n,config:r,stack:i}=e,a=t.description;if(a)return P0({model:e,channelDef:a,vgChannel:`description`,mainRefFn:t=>I0(t,e.config),invalidValueRef:void 0});let o=m$(`description`,n,r);if(o!=null)return{description:u$(o)};if(r.aria===!1)return{};let s=_Ne(t,i,r);if(!nQ(s))return{description:{signal:L2(s).filter(([e])=>!e.startsWith(`_`)).map(([e,t])=>[e,t.replaceAll(`\\n`,` `)]).map(([e,t],n)=>`"${n>0?`; `:``}${e}: " + (${t})`).join(` + `)}}}function L0(e,t,n={}){let{markDef:r,encoding:i,config:a}=t,{vgChannel:o}=n,{defaultRef:s,defaultValue:c}=n,l=i[e];s===void 0&&(c??=m$(e,r,a,{vgChannel:o,ignoreVgConfig:!C1(l)}),c!==void 0&&(s=u$(c)));let u={markDef:r,config:a,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},d=wAe({...u,scaleChannel:e,channelDef:l});return P0({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:d,mainRefFn:t=>u1({...u,channel:e,channelDef:t,stack:null,defaultRef:s})})}function CNe(e,t={filled:void 0}){let{markDef:n,encoding:r,config:i}=e,{type:a}=n,o=t.filled??m$(`filled`,n,i),s=qZ([`bar`,`point`,`circle`,`square`,`geoshape`],a)?`transparent`:void 0,c=m$(o===!0?`color`:void 0,n,i,{vgChannel:`fill`})??i.mark[o===!0&&`color`]??s,l=m$(o===!1?`color`:void 0,n,i,{vgChannel:`stroke`})??i.mark[o===!1&&`color`],u=o?`fill`:`stroke`,d={...c?{fill:u$(c)}:{},...l?{stroke:u$(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&X(eke(`property`,{fill:`fill`in n,stroke:`stroke`in n})),{...d,...L0(`color`,e,{vgChannel:u,defaultValue:o?c:l}),...L0(`fill`,e,{defaultValue:r.fill?c:void 0}),...L0(`stroke`,e,{defaultValue:r.stroke?l:void 0})}}function wNe(e){let{encoding:t,mark:n}=e,r=t.order;return!n1(n)&&M1(r)?P0({model:e,channelDef:r,vgChannel:`zindex`,mainRefFn:e=>u$(e.value),invalidValueRef:void 0}):{}}function R0({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){let a=`${e}Offset`,o=t[a],s=n[a];if((a===`xOffset`||a===`yOffset`)&&s)return{offsetType:`encoding`,offset:u1({channel:a,channelDef:s,markDef:t,config:r?.config,scaleName:r.scaleName(a),scale:r.getScaleComponent(a),stack:null,defaultRef:u$(o),bandPosition:i})};let c=t[a];return c?{offsetType:`visual`,offset:c}:{}}function z0(e,t,{defaultPos:n,vgChannel:r}){let{encoding:i,markDef:a,config:o,stack:s}=t,c=i[e],l=i[NQ(e)],u=t.scaleName(e),d=t.getScaleComponent(e),{offset:f,offsetType:p}=R0({channel:e,markDef:a,encoding:i,model:t,bandPosition:.5}),m=B0({model:t,defaultPos:n,channel:e,scaleName:u,scale:d}),h=!c&&LQ(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:TNe({channel:e,channelDef:c,channel2Def:l,markDef:a,config:o,scaleName:u,scale:d,stack:s,offset:f,defaultRef:m,bandPosition:p===`encoding`?0:void 0});return h?{[r||e]:h}:void 0}function TNe(e){let{channel:t,channelDef:n,scaleName:r,stack:i,offset:a,markDef:o}=e;if(A1(n)&&i&&t===i.fieldChannel){if(Z(n)){let e=n.bandPosition;if(e===void 0&&o.type===`text`&&(t===`radius`||t===`theta`)&&(e=.5),e!==void 0)return l1({scaleName:r,fieldOrDatumDef:n,startSuffix:`start`,bandPosition:e,offset:a})}return c1(n,r,{suffix:`end`},{offset:a})}return s1(e)}function B0({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){let{markDef:a,config:o}=e;return()=>{let s=jQ(n),c=MQ(n),l=m$(n,a,o,{vgChannel:c});if(l!==void 0)return d1(n,l);switch(t){case`zeroOrMin`:return ENe({scaleName:r,scale:i,mode:`zeroOrMin`,mainChannel:s,config:o});case`zeroOrMax`:return ENe({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:s,config:o});case`mid`:return{...e[PQ(n)],mult:.5}}}}function ENe({mainChannel:e,config:t,...n}){let r=CAe(n),{mode:i}=n;if(r)return r;switch(e){case`radius`:{if(i===`zeroOrMin`)return{value:0};let{widthSignal:e,heightSignal:t}=i.zeroOrMax;return{signal:`min(${e},${t})/2`}}case`theta`:return i===`zeroOrMin`?{value:0}:{signal:`2*PI`};case`x`:return i===`zeroOrMin`?{value:0}:{field:{group:`width`}};case`y`:return i===`zeroOrMin`?{field:{group:`height`}}:{value:0}}}function DNe(e,t,n,r=`middle`){if(e===`radius`||e===`theta`)return MQ(e);let i=e===`x`?`align`:`baseline`,a=m$(i,t,n),o;return r$(a)?(X(oke(i)),o=void 0):o=a,e===`x`?Ize[o||(r===`top`?`left`:`center`)]:Lze[o||r]}function V0(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?ONe(e,t,{defaultPos:n,defaultPos2:r}):z0(e,t,{defaultPos:n})}function ONe(e,t,{defaultPos:n,defaultPos2:r}){let{markDef:i,config:a}=t,o=NQ(e),s=PQ(e),c=kNe(t,r,o);return{...z0(e,t,{defaultPos:n,vgChannel:c[s]?DNe(e,i,a):MQ(e)}),...c}}function kNe(e,t,n){let{encoding:r,mark:i,markDef:a,stack:o,config:s}=e,c=jQ(n),l=PQ(n),u=MQ(n),d=r[c],f=e.scaleName(c),p=e.getScaleComponent(c),{offset:m}=n in r||n in a?R0({channel:n,markDef:a,encoding:r,model:e}):R0({channel:c,markDef:a,encoding:r,model:e});if(!d&&(n===`x2`||n===`y2`)&&(r.latitude||r.longitude)){let t=PQ(n),r=e.markDef[t];return r==null?{[u]:{field:e.getName(n)}}:{[t]:{value:r}}}let h=ANe({channel:n,channelDef:d,channel2Def:r[n],markDef:a,config:s,scaleName:f,scale:p,stack:o,offset:m,defaultRef:void 0});return h===void 0?H0(n,a)||H0(n,{[n]:g$(n,a,s.style),[l]:g$(l,a,s.style)})||H0(n,s[i])||H0(n,s.mark)||{[u]:B0({model:e,defaultPos:t,channel:n,scaleName:f,scale:p})()}:{[u]:h}}function ANe({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:a,scale:o,stack:s,offset:c,defaultRef:l}){return A1(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0)?c1(t,a,{suffix:`start`},{offset:c}):s1({channel:e,channelDef:n,scaleName:a,scale:o,stack:s,markDef:r,config:i,offset:c,defaultRef:l})}function H0(e,t){let n=PQ(e),r=MQ(e);if(t[r]!==void 0)return{[r]:d1(e,t[r])};if(t[e]!==void 0)return{[r]:d1(e,t[e])};if(t[n]){let r=t[n];if(a1(r))X(tke(n));else return{[n]:d1(e,r)}}}function U0(e,t){let{config:n,encoding:r,markDef:i}=e,a=i.type,o=NQ(t),s=PQ(t),c=r[t],l=r[o],u=e.getScaleComponent(t),d=u?u.get(`type`):void 0,f=i.orient,p=r[s]??r.size??m$(`size`,i,n,{vgChannel:s}),m=FQ(t),h=a===`bar`&&(t===`x`?f===`vertical`:f===`horizontal`)||a===`tick`&&(t===`y`?f===`vertical`:f===`horizontal`);return Z(c)&&(JQ(c.bin)||YQ(c.bin)||c.timeUnit&&!l)&&!(p&&!a1(p))&&!r[m]&&!Z$(d)?PNe({fieldDef:c,fieldDef2:l,channel:t,model:e}):(A1(c)&&Z$(d)||h)&&!l?MNe(c,t,e):ONe(t,e,{defaultPos:`zeroOrMax`,defaultPos2:`zeroOrMin`})}function jNe(e,t,n,r,i,a,o){if(a1(i))if(n){let e=n.get(`type`);if(e===`band`){let e=`bandwidth('${t}')`;i.band!==1&&(e=`${i.band} * ${e}`);let n=h$(`minBandSize`,{type:o},r);return{signal:n?`max(${f$(n)}, ${e})`:e}}else i.band!==1&&X(uke(e))}else return{mult:i.band,field:{group:e}};else if(r$(i))return i;else if(i)return{value:i};if(n){let e=n.get(`range`);if(i$(e)&&Wh(e.step))return{value:e.step-2}}if(!a){let{bandPaddingInner:t,barBandPaddingInner:n,rectBandPaddingInner:i,tickBandPaddingInner:a}=r.scale,s=_Q(t,o===`tick`?a:o===`bar`?n:i);if(r$(s))return{signal:`(1 - (${s.signal})) * ${e}`};if(Wh(s))return{signal:`${1-s} * ${e}`}}return{value:f0(r.view,e)-2}}function MNe(e,t,n){let{markDef:r,encoding:i,config:a,stack:o}=n,s=r.orient,c=n.scaleName(t),l=n.getScaleComponent(t),u=PQ(t),d=NQ(t),f=FQ(t),p=n.scaleName(f),m=n.getScaleComponent(IQ(t)),h=r.type===`tick`||s===`horizontal`&&t===`y`||s===`vertical`&&t===`x`,g;(i.size||r.size)&&(h?g=L0(`size`,n,{vgChannel:u,defaultRef:u$(r.size)}):X(mke(r.type)));let _=!!g,v=HAe({channel:t,fieldDef:e,markDef:r,config:a,scaleType:(l||m)?.get(`type`),useVlSizeChannel:h});g||={[u]:jNe(u,p||c,m||l,a,v,!!e,r.type)};let y=DNe(t,r,a,(l||m)?.get(`type`)===`band`&&a1(v)&&!_?`top`:`middle`),b=y===`xc`||y===`yc`,{offset:x,offsetType:S}=R0({channel:t,markDef:r,encoding:i,model:n,bandPosition:b?.5:0}),C=(b&&S!==`encoding`&&Z(e)&&e.timeUnit&&!i[d]?S1({fieldDef:e,markDef:r,config:a}):void 0)??(b?S===`encoding`?0:.5:r$(v)?{signal:`(1-${v})/2`}:a1(v)?(1-v.band)/2:0),w=s1({channel:t,channelDef:e,markDef:r,config:a,scaleName:c,scale:l,stack:o,offset:x,defaultRef:B0({model:n,defaultPos:`mid`,channel:t,scaleName:c,scale:l}),bandPosition:C});if(u)return{[y]:w,...g};{let e=MQ(d),t=g[u],n=x?{...t,offset:x}:t;return{[y]:w,[e]:H(w)?[w[0],{...w[1],offset:n}]:{...w,offset:n}}}}function NNe(e,t,n,r,i,a,o){if(TQ(e))return 0;let s=e===`x`||e===`y2`,c=s?-t/2:t/2;if(r$(n)||r$(i)||r$(r)||a){let e=f$(n),t=f$(i),l=f$(r),u=f$(a),d=a?`(${o} < ${u} ? ${s?``:`-`}0.5 * (${u} - (${o})) : ${c})`:c,f=l?`${l} + `:``,p=e?`(${e} ? -1 : 1) * `:``,m=t?`(${t} + ${d})`:d;return{signal:f+p+m}}else return i||=0,r+(n?-i-c:+i+c)}function PNe({fieldDef:e,fieldDef2:t,channel:n,model:r}){let{config:i,markDef:a,encoding:o}=r,s=r.getScaleComponent(n),c=r.scaleName(n),l=s?s.get(`type`):void 0,u=s.get(`reverse`),d=HAe({channel:n,fieldDef:e,markDef:a,config:i,scaleType:l}),f=(r.component.axes[n]?.[0])?.get(`translate`)??.5,p=LQ(n)?m$(`binSpacing`,a,i)??0:0,m=NQ(n),h=MQ(n),g=MQ(m),_=h$(`minBandSize`,a,i),{offset:v}=R0({channel:n,markDef:a,encoding:o,model:r,bandPosition:0}),{offset:y}=R0({channel:m,markDef:a,encoding:o,model:r,bandPosition:0}),b=DAe({fieldDef:e,scaleName:c}),x=NNe(n,p,u,f,v,_,b),S=NNe(m,p,u,f,y??v,_,b),C=r$(d)?{signal:`(1-${d.signal})/2`}:a1(d)?(1-d.band)/2:.5,w=S1({fieldDef:e,fieldDef2:t,markDef:a,config:i});if(JQ(e.bin)||e.timeUnit){let t=e.timeUnit&&w!==.5;return{[g]:FNe({fieldDef:e,scaleName:c,bandPosition:C,offset:S,useRectOffsetField:t}),[h]:FNe({fieldDef:e,scaleName:c,bandPosition:r$(C)?{signal:`1-${C.signal}`}:1-C,offset:x,useRectOffsetField:t})}}else if(YQ(e.bin)){let n=c1(e,c,{},{offset:S});if(Z(t))return{[g]:n,[h]:c1(t,c,{},{offset:x})};if(XQ(e.bin)&&e.bin.step)return{[g]:n,[h]:{signal:`scale("${c}", ${Q(e,{expr:`datum`})} + ${e.bin.step})`,offset:x}}}X(Mke(m))}function FNe({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return l1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:Z3,endSuffix:Q3}:{}})}function W0(e,t){let{fill:n=void 0,stroke:r=void 0}=t.color===`include`?CNe(e):{};return{...LNe(e.markDef,t),...INe(`fill`,n),...INe(`stroke`,r),...L0(`opacity`,e),...L0(`fillOpacity`,e),...L0(`strokeOpacity`,e),...L0(`strokeWidth`,e),...L0(`strokeDash`,e),...wNe(e),...gNe(e),...F0(e,`href`),...bNe(e)}}function INe(e,t){return t?{[e]:t}:{}}function LNe(e,t){return iRe.reduce((n,r)=>(!Rze.has(r)&&Y(e,r)&&t[r]!==`ignore`&&(n[r]=u$(e[r])),n),{})}function G0(e){let{config:t,markDef:n}=e,r=new Set;if(e.forEachFieldDef((i,a)=>{let o;if(!VQ(a)||!(o=e.getScaleType(a)))return;let s=KQ(i.aggregate);if(SAe(o1({scaleChannel:a,markDef:n,config:t,scaleType:o,isCountAggregate:s}))){let t=e.vgField(a,{expr:`datum`,binSuffix:e.stack?.impute?`mid`:void 0});t&&r.add(t)}}),r.size>0)return{defined:{signal:[...r].map(e=>Y$(e,!0)).join(` && `)}}}function RNe(e,t){if(t!==void 0)return{[e]:u$(t)}}function zNe(e,t,n){let r=e.fieldDef(t)?.field;for(let i of I2(e.component.selection??{})){let e=i.project.hasField[r]??i.project.hasChannel[t];if(e&&v6.defined(i)){let t=n.get(`selections`)??[];t.push(i.name),n.set(`selections`,t,!1),e.hasLegend=!0}}}function BNe(e,t,n,r,i){let a=t.name,o=a+y6,s=a+b6,c=n.channel,l=c6.defined(t),u=i.find(e=>e.name===n.signals[l?`data`:`visual`]),d=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(c),p=f?.get(`type`),m=f?.get(`reverse`),h=l?c===U2?m?``:`-`:m?`-`:``:``,g=`${o}.extent_${c}`,_=`${h}${s}.${c} / ${l?`${d}`:`span(${g})`}`,v=`${!l||!f?`panLinear`:p===`log`?`panLog`:p===`symlog`?`panSymlog`:p===`pow`?`panPow`:`panLinear`}(${g}, ${_}${l?p===`pow`?`, ${f.get(`exponent`)??1}`:p===`symlog`?`, ${f.get(`constant`)??1}`:``:``})`;u.on.push({events:{signal:s},update:l?v:`clampRange(${v}, 0, ${d})`})}function VNe(e,t,n,r,i){let a=t.name,o=n.channel,s=c6.defined(t),c=i.find(e=>e.name===n.signals[s?`data`:`visual`]),l=e.getSizeSignalRef(r).signal,u=e.getScaleComponent(o),d=u?.get(`type`),f=s?M0(e,o):c.name,p=a+S6,m=`${a}${x6}.${o}`,h=`${!s||!u?`zoomLinear`:d===`log`?`zoomLog`:d===`symlog`?`zoomSymlog`:d===`pow`?`zoomPow`:`zoomLinear`}(${f}, ${m}, ${p}${s?d===`pow`?`, ${u.get(`exponent`)??1}`:d===`symlog`?`, ${u.get(`constant`)??1}`:``:``})`;c.on.push({events:{signal:p},update:s?h:`clampRange(${h}, 0, ${l})`})}function HNe(e){let t=e.parent;for(;t&&!w2(t);)t=t.parent;return t}function K0(e,{escape:t}={escape:!0}){let n=t?W(e.name):e.name,r=HNe(e);if(r){let{facet:e}=r;for(let t of D4)e[t]&&(n+=` + '__facet_${t}_' + (facet[${W(r.vgField(t))}])`)}return n}function q0(e){return I2(e.component.selection??{}).reduce((e,t)=>e||t.project.hasSelectionId,!1)}function UNe(e,t){(qh(t.select)||!t.select.on)&&delete e.events,(qh(t.select)||!t.select.clear)&&delete e.clear,(qh(t.select)||!t.select.toggle)&&delete e.toggle}function J0(e){return e.events?.find(e=>`type`in e&&e.type===`timer`)}function Y0(e){let t=[];return e.type===`Identifier`?[e.name]:e.type===`Literal`?[e.value]:(e.type===`MemberExpression`&&(t.push(...Y0(e.object)),t.push(...Y0(e.property))),t)}function WNe(e){return e.object.type===`MemberExpression`?WNe(e.object):e.object.name===`datum`}function GNe(e){let t=vOe(e),n=new Set;return t.visit(e=>{e.type===`MemberExpression`&&WNe(e)&&n.add(Y0(e).slice(1).join(`.`))}),n}function KNe(e,t){let n={},r=e.config.selection;if(!t||!t.length)return n;let i=0;for(let a of t){let t=aQ(a.name),o=a.select,s=qh(o)?o:o.type,c=Hm(o)?F2(o):{type:s},l=r[s];for(let e in l)e===`fields`||e===`encodings`||(e===`mark`&&(c.mark={...l.mark,...c.mark}),(c[e]===void 0||c[e]===!0)&&(c[e]=F2(l[e]??c[e])));let u=n[t]={...c,name:t,type:s,init:a.value,bind:a.bind,events:qh(c.on)?JG(c.on,`scope`):_h(F2(c.on))};if(J0(u)&&(i++,i>1)){delete n[t];continue}let d=F2(a);for(let t of E6)t.defined(u)&&t.parse&&t.parse(e,u,d)}return i>1&&X(pRe),n}function qNe(e,t,n,r=`datum`){let i=qh(t)?t:t.param,a=aQ(i),o=W(a+C6),s;try{s=e.getSelectionComponent(a,i)}catch{return`!!${a}`}if(s.project.timeUnit){let t=n??e.component.data.raw,r=s.project.timeUnit.clone();t.parent?r.insertAsParentOf(t):t.parent=r}let c=`${s.project.hasSelectionId?`vlSelectionIdTest(`:`vlSelectionTest(`}${o}, ${r}${s.resolve===`global`?`)`:`, ${W(s.resolve)})`}`,l=`length(data(${o}))`;return t.empty===!1?`${l} && ${c}`:`!${l} || ${c}`}function JNe(e,t,n){let r=aQ(t),i=n.encoding,a=n.field,o;try{o=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!a)a=o.project.items[0].field,o.project.items.length>1&&X(HOe(a));else if(i&&!a){let e=o.project.items.filter(e=>e.channel===i);!e.length||e.length>1?(a=o.project.items[0].field,X(UOe(e,i,n,a))):a=e[0].field}return`${o.name}[${W(pQ(a))}]`}function YNe(e,t){for(let[n,r]of L2(e.component.selection??{})){let i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new Y3(new D6(t,e,{param:n}),i,q3.Lookup,e.component.data.outputNodeRefCounts)}}function X0(e,t,n){return oQ(t,t=>qh(t)?t:tAe(t)?qNe(e,t,n):aAe(t))}function XNe(e,t){if(e)return H(e)&&!n$(e)?e.map(e=>R1(e,t)).join(`, `):e}function Z0(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function Q0(e,t,n,r={header:!1}){let{disable:i,orient:a,scale:o,labelExpr:s,title:c,zindex:l,...u}=e.combine();if(!i){for(let e in u){let n=e,r=ZRe[n],i=u[n];if(r&&r!==t&&r!==`both`)delete u[n];else if(J1(i)){let{condition:e,...t}=i,r=_h(e),a=w3[n];if(a){let{vgProp:e,part:i}=a;Z0(u,i,e,[...r.map(e=>{let{test:t,...n}=e;return{test:X0(null,t),...n}}),t]),delete u[n]}else a===null&&(u[n]={signal:r.map(e=>{let{test:t,...n}=e;return`${X0(null,t)} ? ${d$(n)} : `}).join(``)+d$(t)})}else if(r$(i)){let e=w3[n];if(e){let{vgProp:t,part:r}=e;Z0(u,r,t,i),delete u[n]}}qZ([`labelAlign`,`labelBaseline`],n)&&u[n]===null&&delete u[n]}if(t===`grid`){if(!u.grid)return;if(u.encode){let{grid:e}=u.encode;u.encode={...e?{grid:e}:{}},nQ(u.encode)&&delete u.encode}return{scale:o,orient:a,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:_Q(l,0)}}else{if(!r.header&&e.mainExtracted)return;if(s!==void 0){let e=s;u.encode?.labels?.update&&r$(u.encode.labels.update.text)&&(e=mQ(s,`datum.label`,u.encode.labels.update.text.signal)),Z0(u,`labels`,`text`,{signal:e})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(let t of T3)e.hasAxisPart(t)||delete u.encode[t];nQ(u.encode)&&delete u.encode}let t=XNe(c,n);return{scale:o,orient:a,grid:!1,...t?{title:t}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:_Q(l,0)}}}}function ZNe(e){let{axes:t}=e.component,n=[];for(let r of j4)if(t[r]){for(let i of t[r])if(!i.get(`disable`)&&!i.get(`gridScale`)){let t=r===`x`?`height`:`width`,i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}}return n}function QNe(e,t){let{x:n=[],y:r=[]}=e;return[...n.map(e=>Q0(e,`grid`,t)),...r.map(e=>Q0(e,`grid`,t)),...n.map(e=>Q0(e,`main`,t)),...r.map(e=>Q0(e,`main`,t))].filter(e=>e)}function $Ne(e,t,n,r){return Object.assign.apply(null,[{},...e.map(e=>{if(e===`axisOrient`){let e=n===`x`?`bottom`:`left`,i=t[n===`x`?`axisBottom`:`axisLeft`]||{},a=t[n===`x`?`axisTop`:`axisRight`]||{},o=new Set([...$(i),...$(a)]),s={};for(let t of o.values())s[t]={signal:`${r.signal} === "${e}" ? ${f$(i[t])} : ${f$(a[t])}`};return s}return t[e]})])}function ePe(e,t,n,r){let i=t===`band`?[`axisDiscrete`,`axisBand`]:t===`point`?[`axisDiscrete`,`axisPoint`]:dAe(t)?[`axisQuantitative`]:t===`time`||t===`utc`?[`axisTemporal`]:[],a=e===`x`?`axisX`:`axisY`,o=r$(n)?`axisOrient`:`axis${cQ(n)}`,s=[...i,...i.map(e=>a+e.substr(4))],c=[`axis`,o,a];return{vlOnlyAxisConfig:$Ne(s,r,e,n),vgAxisConfig:$Ne(c,r,e,n),axisConfigStyle:tPe([...c,...s],r)}}function tPe(e,t){let n=[{}];for(let r of e){let e=t[r]?.style;if(e){e=_h(e);for(let r of e)n.push(t.style[r])}}return Object.assign.apply(null,n)}function $0(e,t,n,r={}){let i=_$(e,n,t);if(i!==void 0)return{configFrom:`style`,configValue:i};for(let t of[`vlOnlyAxisConfig`,`vgAxisConfig`,`axisConfigStyle`])if(r[t]?.[e]!==void 0)return{configFrom:t,configValue:r[t][e]};return{}}function nPe(e,t){return!Z$(e)&&Z(t)&&!JQ(t?.bin)&&!YQ(t?.bin)}function rPe(e,t){let n=t===`x`?`y`:`x`;if(e.getScaleComponent(n))return e.scaleName(n)}function iPe(e,t,n,r,i){let a=t?.labelAngle;if(a!==void 0)return r$(a)?a:xQ(a);{let{configValue:a}=$0(`labelAngle`,r,t?.style,i);return a===void 0?n===U2&&qZ([Z4,Y4],e.type)&&!(Z(e)&&e.timeUnit)?270:void 0:xQ(a)}}function e2(e){return`(((${e.signal} % 360) + 360) % 360)`}function aPe(e,t,n,r){if(e!==void 0)if(n===`x`){if(r$(e)){let n=e2(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${r$(t)?`(${t.signal} === "top")`:t===`top`} ? "bottom" : "top"`}}if(450;if(a||u){let s=t===`row`?`height`:`width`;return{name:e.getName(`${t}_${n}`),type:`group`,role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:yPe(o,t)}:{},...u&&c?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...a?{title:a}:{},...i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{},...u?{axes:l}:{}}}}return null}function xPe(e,t){return Uze[t][e]}function SPe(e,t){let n={};for(let r of D4){let i=e[r];if(i?.facetFieldDef){let{titleAnchor:e,titleOrient:a}=i2([`titleAnchor`,`titleOrient`],i.facetFieldDef.header,t,r),o=n2(r,a),s=xPe(e,o);s!==void 0&&(n[o]=s)}}return nQ(n)?void 0:n}function CPe(e,t,n,r,i){let a={};for(let o of r){if(!i[o])continue;let r=r2(o,t?.header,e,n);r!==void 0&&(a[i[o]]=r)}return a}function o2(e){return[...s2(e,`width`),...s2(e,`height`),...s2(e,`childWidth`),...s2(e,`childHeight`)]}function s2(e,t){let n=t===`width`?`x`:`y`,r=e.component.layoutSize.get(t);if(r==null||r===`merged`)return[];let i=e.getSizeSignalRef(t).signal;if(r===`step`){let t=e.getScaleComponent(n);if(t){let r=t.get(`type`),a=t.get(`range`);if(Z$(r)&&i$(a)){let r=e.scaleName(n);return w2(e.parent)&&e.parent.component.resolve.scale[n]===`independent`?[wPe(r,a)]:[wPe(r,a),{name:i,update:TPe(r,t,`domain('${r}').length`)}]}}throw Error(`layout size is step although width/height is not step.`)}else if(r==`container`){let t=i.endsWith(`width`),n=t?`containerSize()[0]`:`containerSize()[1]`,r=`isFinite(${n}) ? ${n} : ${d0(e.config.view,t?`width`:`height`)}`;return[{name:i,init:r,on:[{update:r,events:`window:resize`}]}]}else return[{name:i,value:r}]}function wPe(e,t){let n=`${e}_step`;return r$(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function TPe(e,t,n){let r=t.get(`type`),i=t.get(`padding`),a=_Q(t.get(`paddingOuter`),i),o=t.get(`paddingInner`);return o=r===`band`?o===void 0?i:o:1,`bandspace(${n}, ${f$(o)}, ${f$(a)}) * ${e}_step`}function EPe(e){return e===`childWidth`?`width`:e===`childHeight`?`height`:e}function DPe(e,t){return $(e).reduce((n,r)=>({...n,...P0({model:t,channelDef:e[r],vgChannel:r,mainRefFn:e=>u$(e.value),invalidValueRef:void 0})}),{})}function OPe(e,t){if(w2(t))return e===`theta`?`independent`:`shared`;if(E2(t))return`shared`;if(T2(t))return LQ(e)||e===`theta`||e===`radius`?`independent`:`shared`;throw Error(`invalid model type for resolve`)}function c2(e,t){let n=e.scale[t],r=LQ(t)?`axis`:`legend`;return n===`independent`?(e[r][t]===`shared`&&X(xke(t)),`independent`):e[r][t]||`shared`}function kPe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:a}){if(a!==`symbol`)return;let{markDef:o,encoding:s,config:c,mark:l}=n,u=o.filled&&l!==`trail`,d={...POe({},n,WRe),...CNe(n,{filled:u})},f=i.get(`symbolOpacity`)??c.legend.symbolOpacity,p=i.get(`symbolFillColor`)??c.legend.symbolFillColor,m=i.get(`symbolStrokeColor`)??c.legend.symbolStrokeColor,h=f===void 0?NPe(s.opacity)??o.opacity:void 0;if(d.fill){if(r===`fill`||u&&r===i4)delete d.fill;else if(Y(d.fill,`field`))p?delete d.fill:(d.fill=u$(c.legend.symbolBaseFillColor??`black`),d.fillOpacity=u$(h??1));else if(H(d.fill)){let e=l2(s.fill??s.color)??o.fill??(u&&o.color);e&&(d.fill=u$(e))}}if(d.stroke){if(r===`stroke`||!u&&r===i4)delete d.stroke;else if(Y(d.stroke,`field`)||m)delete d.stroke;else if(H(d.stroke)){let e=_Q(l2(s.stroke||s.color),o.stroke,u?o.color:void 0);e&&(d.stroke={value:e})}}if(r!==u4){let e=Z(t)&&FPe(n,i,t);e?d.opacity=[{test:e,...u$(h??1)},u$(c.legend.unselectedOpacity)]:h&&(d.opacity=u$(h))}return d={...d,...e},nQ(d)?void 0:d}function APe(e,{model:t,legendType:n,legendCmpt:r}){if(n!==`gradient`)return;let{config:i,markDef:a,encoding:o}=t,s={},c=(r.get(`gradientOpacity`)??i.legend.gradientOpacity)===void 0?NPe(o.opacity)||a.opacity:void 0;return c&&(s.opacity=u$(c)),s={...s,...e},nQ(s)?void 0:s}function jPe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){let a=n.legend(r)||{},o=n.config,s=Z(t)?FPe(n,i,t):void 0,c=s?[{test:s,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:u}=a,d;f1(u)?d=m1({fieldOrDatumDef:t,field:`datum.value`,format:l,formatType:u,config:o}):l===void 0&&u===void 0&&o.customFormatTypes&&(t.type===`quantitative`&&o.numberFormatType?d=m1({fieldOrDatumDef:t,field:`datum.value`,format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type===`temporal`&&o.timeFormatType&&Z(t)&&t.timeUnit===void 0&&(d=m1({fieldOrDatumDef:t,field:`datum.value`,format:o.timeFormat,formatType:o.timeFormatType,config:o})));let f={...c?{opacity:c}:{},...d?{text:d}:{},...e};return nQ(f)?void 0:f}function MPe(e,{legendCmpt:t}){return t.get(`selections`)?.length?{...e,fill:{value:`transparent`}}:e}function NPe(e){return PPe(e,(e,t)=>Math.max(e,t.value))}function l2(e){return PPe(e,(e,t)=>_Q(e,t.value))}function PPe(e,t){if(GAe(e))return _h(e.condition).reduce(t,e.value);if(M1(e))return e.value}function FPe(e,t,n){let r=t.get(`selections`);if(!r?.length)return;let i=W(n.field);return r.map(e=>`(!length(data(${W(aQ(e)+C6)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`).join(` || `)}function IPe(e,t){let n=e.values;if(H(n))return cje(t,n);if(r$(n))return n}function LPe(e,t,n,r){if(t!==`shape`){let e=l2(n)??r;if(e)return e}switch(e){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 RPe(e){let{legend:t}=e;return _Q(t.type,zPe(e))}function zPe({channel:e,timeUnit:t,scaleType:n}){if(OQ(e)){if(qZ([`quarter`,`month`,`day`],t))return`symbol`;if($$(n))return`gradient`}return`symbol`}function BPe({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?`gradientDirection`:`symbolDirection`]??VPe(n,t)}function VPe(e,t){switch(e){case`top`:case`bottom`:return`horizontal`;case`left`:case`right`:case`none`:case void 0:return;default:return t===`gradient`?`horizontal`:void 0}}function HPe({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){let{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:o,gradientVerticalMaxLength:s,gradientVerticalMinLength:c}=e;if($$(i))return n===`horizontal`?r===`top`||r===`bottom`?UPe(t,`width`,o,a):o:UPe(t,`height`,c,s)}function UPe(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function WPe(e){if(qZ([`quantile`,`threshold`,`log`,`symlog`],e))return`greedy`}function GPe(e){let t=C2(e)?KPe(e):XPe(e);return e.component.legends=t,t}function KPe(e){let{encoding:t}=e,n={};for(let r of[i4,...I3]){let i=V1(t[r]);!i||!e.getScaleComponent(r)||r===s4&&Z(i)&&i.type===Q4||(n[r]=YPe(e,r))}return n}function qPe(e,t){let n=e.scaleName(t);if(e.mark===`trail`){if(t===`color`)return{stroke:n};if(t===`size`)return{strokeWidth:n}}return t===`color`?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function JPe(e,t,n,r){switch(t){case`disable`:return n!==void 0;case`values`:return!!n?.values;case`title`:if(t===`title`&&e===r?.title)return!0}return e===(n||{})[t]}function YPe(e,t){let n=e.legend(t),{markDef:r,encoding:i,config:a}=e,o=a.legend,s=new Wze({},qPe(e,t));zNe(e,t,s);let c=n===void 0?o.disable:!n;if(s.set(`disable`,c,n!==void 0),c)return s;n||={};let l=e.getScaleComponent(t).get(`type`),u=V1(i[t]),d=Z(u)?B$(u.timeUnit)?.unit:void 0,f=n.orient||a.legend.orient||`right`,p=RPe({legend:n,channel:t,timeUnit:d,scaleType:l}),m=BPe({legend:n,legendType:p,orient:f,legendConfig:o}),h={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:o,config:a,scaleType:l,orient:f,legendType:p,direction:m};for(let r of M6){if(p===`gradient`&&r.startsWith(`symbol`)||p===`symbol`&&r.startsWith(`gradient`))continue;let i=r in P6?P6[r](h):n[r];if(i!==void 0){let o=JPe(i,r,n,e.fieldDef(t));(o||a.legend[r]===void 0)&&s.set(r,i,o)}}let g=n?.encoding??{},_=s.get(`selections`),v={},y={fieldOrDatumDef:u,model:e,channel:t,legendCmpt:s,legendType:p};for(let t of[`labels`,`legend`,`title`,`symbols`,`gradient`,`entries`]){let n=DPe(g[t]??{},e),r=t in N6?N6[t](n,y):n;r!==void 0&&!nQ(r)&&(v[t]={..._?.length&&Z(u)?{name:`${aQ(u.field)}_legend_${t}`}:{},..._?.length?{interactive:!0}:{},update:_?.length?{...r,cursor:{value:`pointer`}}:r})}return nQ(v)||s.set(`encode`,v,!!n?.encoding),s}function XPe(e){let{legends:t,resolve:n}=e.component;for(let r of e.children){GPe(r);for(let i of $(r.component.legends))n.legend[i]=c2(e.component.resolve,i),n.legend[i]===`shared`&&(t[i]=ZPe(t[i],r.component.legends[i]),t[i]||(n.legend[i]=`independent`,delete t[i]))}for(let r of $(t))for(let t of e.children)t.component.legends[r]&&n.legend[r]===`shared`&&delete t.component.legends[r];return t}function ZPe(e,t){if(!e)return t.clone();let n=e.getWithExplicit(`orient`),r=t.getWithExplicit(`orient`);if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(let n of M6){let r=w0(e.getWithExplicit(n),t.getWithExplicit(n),n,`legend`,(e,t)=>{switch(n){case`symbolType`:return QPe(e,t);case`title`:return x$(e,t);case`type`:return i=!0,S0(`symbol`)}return C0(e,t,n,`legend`)});e.setWithExplicit(n,r)}return i&&(e.implicit?.encode?.gradient&&sQ(e.implicit,[`encode`,`gradient`]),e.explicit?.encode?.gradient&&sQ(e.explicit,[`encode`,`gradient`])),e}function QPe(e,t){return t.value===`circle`?t:e}function $Pe(e,t,n,r){if(q1(t,n)){let i=C2(e)?e.axis(n)??e.legend(n)??{}:{},a=Q(t,{expr:`datum`}),o=Q(t,{expr:`datum`,binSuffix:`end`});return{formulaAs:Q(t,{binSuffix:`range`,forAs:!0}),formula:g1(a,o,i.format,i.formatType,r)}}return{}}function eFe(e,t){return`${qQ(e)}_${t}`}function tFe(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function u2(e,t,n){let r=eFe(W1(n,void 0)??{},t);return e.getName(`${r}_bins`)}function nFe(e){return`as`in e}function rFe(e,t,n){let r,i;r=nFe(e)?qh(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Q(e,{forAs:!0}),Q(e,{binSuffix:`end`,forAs:!0})];let a={...W1(t,void 0)},o=eFe(a,e.field),{signal:s,extentSignal:c}=tFe(n,o);if(ZQ(a.extent)){let e=a.extent;i=JNe(n,e.param,e),delete a.extent}return{key:o,binComponent:{bin:a,field:e.field,as:[r],...s?{signal:s}:{},...c?{extentSignal:c}:{},...i?{span:i}:{}}}}function iFe(e,t,n,r){let i=C2(r)?r.encoding[NQ(t)]:void 0;if(j1(n)&&C2(r)&&UAe(n,i,r.markDef,r.config)){e.add(Q(n,{})),e.add(Q(n,{suffix:`end`}));let{mark:i,markDef:a,config:o}=r,s=S1({fieldDef:n,markDef:a,config:o});r1(i)&&s!==.5&&LQ(t)&&(e.add(Q(n,{suffix:Z3})),e.add(Q(n,{suffix:Q3}))),n.bin&&q1(n,t)&&e.add(Q(n,{binSuffix:`range`}))}else if(DQ(t)){let n=EQ(t);e.add(r.getName(n))}else e.add(Q(n));return N1(n)&&hAe(n.scale?.range)&&e.add(n.scale.range.field),e}function aFe(e,t){for(let n of $(t)){let r=t[n];for(let t of $(r))n in e?e[n][t]=new Set([...e[n][t]??[],...r[t]]):e[n]={[t]:r[t]}}}function oFe(e){return e.startsWith(`'`)&&e.endsWith(`'`)||e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e}function sFe(e,t){let n=lQ(e);return t===`number`?`toNumber(${n})`:t===`boolean`?`toBoolean(${n})`:t===`string`?`toString(${n})`:t===`date`?`toDate(${n})`:t===`flatten`?n:t.startsWith(`date:`)?`timeParse(${n},'${oFe(t.slice(5,t.length))}')`:t.startsWith(`utc:`)?`utcParse(${n},'${oFe(t.slice(4,t.length))}')`:(X(WOe(t)),null)}function cFe(e){let t={};return BZ(e.filter,e=>{if(rAe(e)){let n=null;V$(e)?n=c$(e.equal):U$(e)?n=c$(e.lte):H$(e)?n=c$(e.lt):W$(e)?n=c$(e.gt):G$(e)?n=c$(e.gte):K$(e)?n=e.range[0]:q$(e)&&(n=(e.oneOf??e.in)[0]),n&&(P$(n)?t[e.field]=`date`:Wh(n)?t[e.field]=`number`:qh(n)&&(t[e.field]=`string`)),e.timeUnit&&(t[e.field]=`date`)}}),t}function lFe(e){let t={};function n(e){G1(e)?t[e.field]=`date`:e.type===`quantitative`&&jOe(e.aggregate)?t[e.field]=`number`:gQ(e.field)>1?e.field in t||(t[e.field]=`flatten`):N1(e)&&_1(e.sort)&&gQ(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]=`flatten`))}if((C2(e)||w2(e))&&e.forEachFieldDef((t,r)=>{if(j1(t))n(t);else{let i=jQ(r),a=e.fieldDef(i);n({...t,type:a.type})}}),C2(e)){let{mark:n,markDef:r,encoding:i}=e;if(n1(n)&&!e.encoding.order){let e=i[r.orient===`horizontal`?`y`:`x`];Z(e)&&e.type===`quantitative`&&!(e.field in t)&&(t[e.field]=`number`)}}return t}function uFe(e){let t={};if(C2(e)&&e.component.selection)for(let n of $(e.component.selection)){let r=e.component.selection[n];for(let e of r.project.items)!e.channel&&gQ(e.field)>1&&(t[e.field]=`flatten`)}return t}function d2(e){return e instanceof H6||e instanceof B6||e instanceof V6}function f2(e){return`isValid(${e}) && isFinite(+${e})`}function dFe(e){return e.stack.stackBy.reduce((e,t)=>{let n=t.fieldDef,r=Q(n);return r&&e.push(r),e},[])}function fFe(e){return H(e)&&e.every(e=>qh(e))&&e.length>1}function pFe(e){function t(n){if(!(n instanceof L6)){let r=n.clone();if(r instanceof Y3){let t=X6+r.getSource();r.setSource(t),e.model.component.data.outputNodes[t]=r}else(r instanceof I6||r instanceof J6||r instanceof Y6||r instanceof K6)&&r.addDimensions(e.fields);for(let e of n.children.flatMap(t))e.parent=r;return[r]}return n.children.flatMap(t)}return t}function p2(e){if(e instanceof L6)if(e.numChildren()===1&&!(e.children[0]instanceof Y3)){let t=e.children[0];(t instanceof I6||t instanceof J6||t instanceof Y6||t instanceof K6)&&t.addDimensions(e.fields),t.swapWithParent(),p2(e)}else{let t=e.model.component.data.main;mFe(t);let n=pFe(e),r=e.children.map(n).flat();for(let e of r)e.parent=t}else e.children.map(p2)}function mFe(e){if(e instanceof Y3&&e.type===q3.Main&&e.numChildren()===1){let t=e.children[0];t instanceof L6||(t.swapWithParent(),mFe(e))}}function m2(e){for(let t of e){for(let e of t.children)if(e.parent!==t)return!1;if(!m2(t.children))return!1}return!0}function h2(e,t){let n=!1;for(let r of t)n=e.optimize(r)||n;return n}function hFe(e,t,n){let r=e.sources,i=!1;return i=h2(new Jze,r)||i,i=h2(new Kze(t),r)||i,r=r.filter(e=>e.numChildren()>0),i=h2(new Zze,r)||i,r=r.filter(e=>e.numChildren()>0),n||(i=h2(new Yze,r)||i,i=h2(new eBe(t),r)||i,i=h2(new qze,r)||i,i=h2(new Xze,r)||i,i=h2(new $ze,r)||i,i=h2(new Qze,r)||i,i=h2(new Gze,r)||i,i=h2(new tBe,r)||i),e.sources=r,i}function gFe(e,t){m2(e.sources);let n=0,r=0;for(let r=0;r({signal:`{data: ${K1(e,{timeUnit:n,type:t})}}`}))}function g2(e,t,n){let r=B$(n)?.unit;return t===`temporal`||r?SFe(e,t,r):[e]}function _2(e,t,n,r){let{encoding:i,markDef:a,mark:o,config:s,stack:c}=n,l=V1(i[r]),{type:u}=l,d=l.timeUnit,f=nNe({invalid:h$(`invalid`,a,s),isPath:n1(o)});if(mAe(t)){let i=_2(e,void 0,n,r);return x0([...g2(t.unionWith,u,d),...i.value])}else if(r$(t))return x0([t]);else if(t&&t!==`unaggregated`&&!pAe(t))return x0(g2(t,u,d));if(c&&r===c.fieldChannel){if(c.offset===`normalize`)return S0([[0,1]]);let e=n.requestDataName(f);return S0([{data:e,field:n.vgField(r,{suffix:`start`})},{data:e,field:n.vgField(r,{suffix:`end`})}])}let p=VQ(r)&&Z(l)?wFe(n,r,e):void 0;if(D1(l))return S0(g2([l.datum],u,d));let m=l;if(t===`unaggregated`){let{field:e}=l;return S0([{data:n.requestDataName(f),field:Q({field:e,aggregate:`min`})},{data:n.requestDataName(f),field:Q({field:e,aggregate:`max`})}])}else if(JQ(m.bin)){if(Z$(e))return S0(e===`bin-ordinal`?[]:[{data:rQ(p)?n.requestDataName(f):n.requestDataName(q3.Raw),field:n.vgField(r,q1(m,r)?{binSuffix:`range`}:{}),sort:p===!0||!Hm(p)?{field:n.vgField(r,{}),op:`min`}:p}]);{let{bin:e}=m;if(JQ(e)){let t=u2(n,m.field,e);return S0([new Q6(()=>{let e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}else return S0([{data:n.requestDataName(f),field:n.vgField(r,{})}])}}else if(m.timeUnit&&qZ([`time`,`utc`],e)){let e=i[NQ(r)];if(UAe(m,e,a,s)){let t=n.requestDataName(f),i=S1({fieldDef:m,fieldDef2:e,markDef:a,config:s}),c=r1(o)&&i!==.5&&LQ(r);return S0([{data:t,field:n.vgField(r,c?{suffix:Z3}:{})},{data:t,field:n.vgField(r,{suffix:c?Q3:`end`})}])}}return S0(p?[{data:rQ(p)?n.requestDataName(f):n.requestDataName(q3.Raw),field:n.vgField(r),sort:p}]:[{data:n.requestDataName(f),field:n.vgField(r)}])}function v2(e,t){let{op:n,field:r,order:i}=e;return{op:n??(t?`sum`:b3),...r?{field:pQ(r)}:{},...i?{order:i}:{}}}function CFe(e,t){let n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t)?.bin,a=pAe(r)?r:void 0,o=XQ(i)&&ZQ(i.extent)?i.extent:void 0;(a||o)&&n.set(`selectionExtent`,a??o,!0)}function wFe(e,t,n){if(!Z$(n))return;let r=e.fieldDef(t),i=r.sort;if(RAe(i))return{op:`min`,field:t2(r,t),order:`ascending`};let{stack:a}=e,o=a?new Set([...a.groupbyFields,...a.stackBy.map(e=>e.fieldDef.field)]):void 0;if(_1(i))return v2(i,a&&!o.has(i.field));if(LAe(i)){let{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:c}=r,l=a&&!o.has(c);if(UQ(s)||WQ(s))return v2({field:Q(r),order:n},l);if(GQ(s)||!s)return v2({op:s,field:c,order:n},l)}else if(i===`descending`)return{op:`min`,field:e.vgField(t),order:`descending`};else if(qZ([`ascending`,void 0],i))return!0}function TFe(e,t){let{aggregate:n,type:r}=e;return n?qh(n)&&!rRe.has(n)?{valid:!1,reason:fke(n)}:r===`quantitative`&&t===`log`?{valid:!1,reason:pke(e)}:{valid:!0}:{valid:!1,reason:dke(e)}}function y2(e,t,n,r){return e.explicit&&t.explicit&&X(bke(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function EFe(e){let t=ZZ(e.map(e=>{if(o$(e)){let{sort:t,...n}=e;return n}return e}),GZ),n=ZZ(e.map(e=>{if(o$(e)){let t=e.sort;return t!==void 0&&!rQ(t)&&(`op`in t&&t.op===`count`&&delete t.field,t.order===`ascending`&&delete t.order),t}}).filter(e=>e!==void 0),GZ);if(t.length===0)return;if(t.length===1){let t=e[0];if(o$(t)&&n.length>0){let e=n[0];if(n.length>1){X(B4);let t=n.filter(e=>Hm(e)&&`op`in e&&e.op!==`min`);e=n.every(e=>Hm(e)&&`op`in e)&&t.length===1?t[0]:!0}else if(Hm(e)&&`field`in e){let n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return{...t,sort:e}}return t}let r=ZZ(n.map(e=>rQ(e)||!(`op`in e)||qh(e.op)&&Ph(eRe,e.op)?e:(X(Ske(e)),!0)),GZ),i;r.length===1?i=r[0]:r.length>1&&(X(B4),i=!0);let a=ZZ(e.map(e=>o$(e)?e.data:null),e=>e);return a.length===1&&a[0]!==null?{data:a[0],fields:t.map(e=>e.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function b2(e){if(o$(e)&&qh(e.field))return e.field;if(a$(e)){let t;for(let n of e.fields)if(o$(n)&&qh(n.field)){if(!t)t=n.field;else if(t!==n.field)return X(yRe),t}return X(bRe),t}else if(MOe(e)){X(xRe);let t=e.fields[0];return qh(t)?t:void 0}}function x2(e,t){return EFe(e.component.scales[t].get(`domains`).map(t=>(o$(t)&&(t.data=e.lookupDataSource(t.data)),t)))}function DFe(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function OFe(e,t){if(C2(e)){let n=e.fieldDef(t);if(n?.field)return n.field}let n=(e.children??[]).map(e=>OFe(e,t)).filter(e=>!!e);if(n.length>0){let e=ZZ(n,GZ);return e.length===1?e[0]:void 0}}function kFe(e,t,n){if(t===n)return!0;let r=e.getScaleType(t),i=e.getScaleType(n);return!r||!i?!1:Z$(r)===Z$(i)}function AFe(e,t){return e?`field:${e}`:`channel:${String(t)}`}function jFe(e){if(H(e)){let t=e.filter(iQ);return t.length>0?t:null}if(a$(e)){let t=[];if(t.push(...e.fields.flatMap(e=>H(e)?e.filter(iQ):[])),t.length>0)return ZZ(t,GZ)}return null}function S2(e,t){try{return jFe(x2(e,t))}catch{return null}}function MFe(e,t,n){let r=S2(e,t),i=S2(e,n);return r&&i?ZZ([...r,...i],GZ):null}function NFe(e,t,n){t&&t.length>0&&(e.getWithExplicit(`values`)?.explicit||(n&&X(n),e.set(`values`,t,!1)))}function PFe(e,t,n){let r=e.getScaleComponent(t),i=e.getScaleComponent(n);if(!r||!i)return!1;let a=r.getWithExplicit(`domains`),o=i.getWithExplicit(`domains`);if(!(a?.explicit&&o?.explicit))return!1;let s=x2(e,t),c=x2(e,n);return GZ(s)===GZ(c)}function FFe(e){let t=e.component.legends,n={};for(let r of $(t)){let i=AFe(OFe(e,r),r);if(!n[i]){n[i]=[{channel:r,cmpt:t[r].clone()}];continue}let a=!1;for(let o of n[i])if(kFe(e,o.channel,r)&&ZPe(o.cmpt,t[r])){let t=e.getScaleType(o.channel),n=e.getScaleType(r);t&&n&&Z$(t)&&Z$(n)&&(PFe(e,o.channel,r)?NFe(o.cmpt,S2(e,o.channel)):NFe(o.cmpt,MFe(e,o.channel,r),Cke(o.channel,r))),a=!0;break}a||n[i].push({channel:r,cmpt:t[r].clone()})}return I2(n).flat().map(t=>IFe(t.cmpt,e.config)).filter(e=>e!==void 0)}function IFe(e,t){let{disable:n,labelExpr:r,selections:i,...a}=e.combine();if(!n){if(t.aria===!1&&a.aria==null&&(a.aria=!1),a.encode?.symbols){let e=a.encode.symbols.update;e.fill&&e.fill.value!==`transparent`&&!e.stroke&&!a.stroke&&(e.stroke={value:`transparent`});for(let t of I3)a[t]&&delete e[t]}if(a.title||delete a.title,r!==void 0){let e=r;a.encode?.labels?.update&&r$(a.encode.labels.update.text)&&(e=mQ(r,`datum.label`,a.encode.labels.update.text.signal)),DFe(a,`labels`,`text`,{signal:e})}return a}}function LFe(e){return E2(e)||T2(e)?RFe(e):zFe(e)}function RFe(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),zFe(e))}function zFe(e){let t=e.component.projection;if(!t||t.merged)return[];let n=t.combine(),{name:r}=n;if(t.data){let i={signal:`[${t.size.map(e=>e.signal).join(`, `)}]`},a=t.data.reduce((t,n)=>{let r=r$(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return qZ(t,r)||t.push(r),t},[]);if(a.length<=0)throw Error(`Projection's fit didn't find any data sources`);return[{name:r,size:i,fit:{signal:a.length>1?`[${a.join(`, `)}]`:a[0]},...n}]}else return[{name:r,translate:{signal:`[width / 2, height / 2]`},...n}]}function BFe(e){e.component.projection=C2(e)?VFe(e):WFe(e)}function VFe(e){if(e.hasProjection){let t=e$(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef(`width`),e.getSizeSignalRef(`height`)]:void 0,i=n?HFe(e):void 0,a=new $6(e.projectionName(!0),{...e$(e.config.projection),...t},r,i);return a.get(`type`)||a.set(`type`,`equalEarth`,!1),a}}function HFe(e){let t=[],{encoding:n}=e;for(let r of[[e4,$2],[n4,t4]])(V1(n[r[0]])||V1(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(s4)&&e.typedFieldDef(s4).type===Q4&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(q3.Main)),t}function UFe(e,t){let n=YZ(nBe,n=>!!(!Ph(e.explicit,n)&&!Ph(t.explicit,n)||Ph(e.explicit,n)&&Ph(t.explicit,n)&&CQ(e.get(n),t.get(n))));if(CQ(e.size,t.size)){if(n)return e;if(CQ(e.explicit,{}))return t;if(CQ(t.explicit,{}))return e}return null}function WFe(e){if(e.children.length===0)return;let t;for(let t of e.children)BFe(t);let n=YZ(e.children,e=>{let n=e.component.projection;if(!n)return!0;if(t){let e=UFe(t,n);return e&&(t=e),!!e}else return t=n,!0});if(t&&n){let n=e.projectionName(!0),r=new $6(n,t.specifiedProjection,t.size,F2(t.data));for(let t of e.children){let e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get(`name`),n),e.merged=!0)}return r}}function GFe(e){return E2(e)||T2(e)?e.children.reduce((e,t)=>e.concat(GFe(t)),KFe(e)):KFe(e)}function KFe(e){return $(e.component.scales).reduce((t,n)=>{let r=e.component.scales[n];if(r.merged)return t;let i=r.combine(),{name:a,type:o,selectionExtent:s,domains:c,range:l,reverse:u,...d}=i,f=qFe(i.range,a,n,e),p=x2(e,n),m=s?mNe(e,s,r,p):null;return t.push({name:a,type:o,...p?{domain:p}:{},...m?{domainRaw:m}:{},range:f,...u===void 0?{}:{reverse:u},...d}),t},[])}function qFe(e,t,n,r){if(LQ(n)){if(i$(e))return{step:{signal:`${t}_step`}}}else if(Hm(e)&&o$(e))return{...e,data:r.lookupDataSource(e.data)};return e}function JFe(e){let t=e.component.scales;for(let n of I4){let r=t[n];if(!r)continue;let i=XFe(n,e);r.setWithExplicit(`range`,i)}}function YFe(e,t){let n=e.fieldDef(t);if(n?.bin){let{bin:r,field:i}=n,a=PQ(t),o=e.getName(a);if(Hm(r)&&r.binned&&r.step!==void 0)return new Q6(()=>{let n=e.scaleName(t),i=`(domain("${n}")[1] - domain("${n}")[0]) / ${r.step}`;return`${e.getSignalName(o)} / (${i})`});if(JQ(r)){let t=u2(e,i,r);return new Q6(()=>{let n=e.getSignalName(t),r=`(${n}.stop - ${n}.start) / ${n}.step`;return`${e.getSignalName(o)} / (${r})`})}}}function XFe(e,t){let n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get(`type`);for(let r of rBe)if(n[r]!==void 0){let a=t1(i,r),o=gAe(e,r);if(!a)X(_ke(i,r,e));else if(o)X(o);else switch(r){case`range`:{let r=n.range;if(H(r)){if(LQ(e))return x0(r.map(e=>{if(e===`width`||e===`height`){let n=t.getName(e),r=t.getSignalName.bind(t);return Q6.fromName(r,n)}return e}))}else if(Hm(r))return x0({data:t.requestDataName(q3.Main),field:r.field,sort:{op:`min`,field:t.vgField(e)}});return x0(r)}case`scheme`:return x0(ZFe(n[r]))}}let a=e===U2||e===`xOffset`?`width`:`height`,o=r[a];if(u0(o)){if(LQ(e))if(Z$(i)){let n=eIe(o,t,e);if(n)return x0({step:n})}else X(vke(a));else if(zQ(e)){let n=e===q2?`x`:`y`;if(t.getScaleComponent(n).get(`type`)===`band`){let e=tIe(o,i);if(e)return x0(e)}}}let{rangeMin:s,rangeMax:c}=n,l=$Fe(e,t);return(s!==void 0||c!==void 0)&&t1(i,`rangeMin`)&&H(l)&&l.length===2?x0([s??l[0],c??l[1]]):S0(l)}function ZFe(e){return fAe(e)?{scheme:e.name,...WZ(e,[`name`])}:{scheme:e}}function QFe(e,t,n,{center:r}={}){let i=PQ(e),a=t.getName(i),o=t.getSignalName.bind(t);return e===W2&&Q$(n)?r?[Q6.fromName(e=>`${o(e)}/2`,a),Q6.fromName(e=>`-${o(e)}/2`,a)]:[Q6.fromName(o,a),0]:r?[Q6.fromName(e=>`-${o(e)}/2`,a),Q6.fromName(e=>`${o(e)}/2`,a)]:[0,Q6.fromName(o,a)]}function $Fe(e,t){let{size:n,config:r,mark:i,encoding:a}=t,{type:o}=V1(a[e]),s=t.getScaleComponent(e).get(`type`),{domain:c,domainMid:l}=t.specifiedScales[e];switch(e){case U2:case W2:if(qZ([`point`,`band`],s)){let i=rIe(e,n,r.view);if(u0(i))return{step:eIe(i,t,e)}}return QFe(e,t,s);case q2:case J2:return nIe(e,t,s);case c4:{let a=oIe(i,r),o=sIe(i,n,t,r);return e1(s)?aIe(a,o,iIe(s,r,c,e)):[a,o]}case Z2:return[0,Math.PI*2];case l4:return[0,360];case Y2:return[0,new Q6(()=>`min(${t.getSignalName(w2(t.parent)?`child_width`:`width`)},${t.getSignalName(w2(t.parent)?`child_height`:`height`)})/2`)];case r4:return{step:1e3/r.scale.framesPerSecond};case p4:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case m4:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case s4:return`symbol`;case i4:case a4:case o4:return s===`ordinal`?o===`nominal`?`category`:`ordinal`:l===void 0?i===`rect`||i===`geoshape`?`heatmap`:`ramp`:`diverging`;case u4:case d4:case f4:return[r.scale.minOpacity,r.scale.maxOpacity]}}function eIe(e,t,n){let{encoding:r}=t,i=t.getScaleComponent(n),a=IQ(n),o=r[a];if(zje({step:e,offsetIsDiscrete:A1(o)&&X$(o.type)})===`offset`&&uje(r,a)){let n=t.getScaleComponent(a),r=`domain('${t.scaleName(a)}').length`;if(n.get(`type`)===`band`){let e=n.get(`paddingInner`)??n.get(`padding`)??0,t=n.get(`paddingOuter`)??n.get(`padding`)??0;r=`bandspace(${r}, ${e}, ${t})`}let o=i.get(`paddingInner`)??i.get(`padding`);return{signal:`${e.step} * ${r} / (1-${NOe(o)})`}}else return e.step}function tIe(e,t){if(zje({step:e,offsetIsDiscrete:Z$(t)})===`offset`)return{step:e.step}}function nIe(e,t,n){let r=e===q2?`x`:`y`,i=t.getScaleComponent(r);if(!i)return QFe(r,t,n,{center:!0});let a=i.get(`type`),o=t.scaleName(r),{markDef:s,config:c}=t;if(a===`band`){let e=rIe(r,t.size,t.config.view);if(u0(e)){let t=tIe(e,n);if(t)return t}return[0,{signal:`bandwidth('${o}')`}]}else{let n=t.encoding[r];if(Z(n)&&n.timeUnit){let e=Qke(n.timeUnit,e=>`scale('${o}', ${e})`),r=t.config.scale.bandWithNestedOffsetPaddingInner,i=S1({fieldDef:n,markDef:s,config:c})-.5,a=i===0?``:` + ${i}`;if(r){let t=r$(r)?`${r.signal}/2${a}`:`${r/2+i}`,n=r$(r)?`(1 - ${r.signal}/2)${a}`:`${1-r/2+i}`;return[{signal:`${t} * (${e})`},{signal:`${n} * (${e})`}]}return[0,{signal:e}]}return HZ(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function rIe(e,t,n){let r=e===U2?`width`:`height`,i=t[r];return i===void 0?p0(n,r):i}function iIe(e,t,n,r){switch(e){case`quantile`:return t.scale.quantileCount;case`quantize`:return t.scale.quantizeCount;case`threshold`:return n!==void 0&&H(n)?n.length+1:(X(Pke(r)),3)}}function aIe(e,t,n){let r=()=>{let r=f$(t),i=f$(e),a=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${a}, ${a})`};return r$(t)?new Q6(r):{signal:r()}}function oIe(e,t){switch(e){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 Error(A$(`size`,e))}function sIe(e,t,n,r){let i={x:YFe(n,`x`),y:YFe(n,`y`)};switch(e){case`bar`:case`tick`:{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;let e=cIe(t,i,r.view);return Wh(e)?e-1:new Q6(()=>`${e.signal} - 1`)}case`line`:case`trail`:case`rule`:return r.scale.maxStrokeWidth;case`text`:return r.scale.maxFontSize;case`point`:case`square`:case`circle`:{if(r.scale.maxSize)return r.scale.maxSize;let e=cIe(t,i,r.view);return Wh(e)?(t8*e)**2:new Q6(()=>`pow(${t8} * ${e.signal}, 2)`)}}throw Error(A$(`size`,e))}function cIe(e,t,n){let r=u0(e.width)?e.width.step:f0(n,`width`),i=u0(e.height)?e.height.step:f0(n,`height`);return t.x||t.y?new Q6(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(`, `)})`):Math.min(r,i)}function lIe(e,t){C2(e)?uIe(e,t):fIe(e,t)}function uIe(e,t){let n=e.component.scales,{config:r,encoding:i,markDef:a,specifiedScales:o}=e;for(let s of $(n)){let c=o[s],l=n[s],u=e.getScaleComponent(s),d=V1(i[s]),f=c[t],p=u.get(`type`),m=u.get(`padding`),h=u.get(`paddingInner`),g=t1(p,t),_=gAe(s,t);if(f!==void 0&&(g?_&&X(_):X(_ke(p,t,s))),g&&_===void 0)if(f!==void 0){let e=d.timeUnit,n=d.type;switch(t){case`domainMax`:case`domainMin`:P$(c[t])||n===`temporal`||e?l.set(t,{signal:K1(c[t],{type:n,timeUnit:e})},!0):l.set(t,c[t],!0);break;default:l.copyKeyFromObject(t,c)}}else{let n=Y(n8,t)?n8[t]({model:e,channel:s,fieldOrDatumDef:d,scaleType:p,scalePadding:m,scalePaddingInner:h,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:a,config:r,hasNestedOffsetScale:dje(i,s),hasSecondaryRangeChannel:!!i[NQ(s)]}):r.scale[t];n!==void 0&&l.set(t,n,!1)}}}function dIe(e){C2(e)?JFe(e):fIe(e,`range`)}function fIe(e,t){let n=e.component.scales;for(let n of e.children)t===`range`?dIe(n):lIe(n,t);for(let r of $(n)){let i;for(let n of e.children){let e=n.component.scales[r];if(e){let n=e.getWithExplicit(t);i=w0(i,n,t,`scale`,ZMe((e,n)=>{switch(t){case`range`:return e.step&&n.step?e.step-n.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function pIe(e,t){let n=t.bin;if(JQ(n)){let r=u2(e,t.field,n);return new Q6(()=>e.getSignalName(r))}else if(YQ(n)&&XQ(n)&&n.step!==void 0)return{step:n.step}}function mIe(e,t){if(qZ([i4,a4,o4],e)&&t!==`nominal`)return`hcl`}function hIe(e,t,n,r,i,a){if(!(B1(a)?.bin||H(n)||i!=null||r!=null||qZ([$4.TIME,$4.UTC],e)))return LQ(t)?!0:void 0}function gIe(e,t,n,r,i,a){if(LQ(e)){if($$(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;let{type:t,orient:o}=i;if(t===`bar`&&!(Z(r)&&(r.bin||r.timeUnit))&&(o===`vertical`&&e===`x`||o===`horizontal`&&e===`y`))return a.continuousBandSize}if(t===$4.POINT)return n.pointPadding}}function _Ie(e,t,n,r,i,a=!1){if(e===void 0){if(LQ(t)){let{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r,tickBandPaddingInner:o,bandWithNestedOffsetPaddingInner:s}=i;return a?s:_Q(e,n===`bar`?t:n===`tick`?o:r)}else if(zQ(t)&&r===$4.BAND)return i.offsetBandPaddingInner}}function vIe(e,t,n,r,i,a=!1){if(e===void 0){if(LQ(t)){let{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=i;if(a)return t;if(n===$4.BAND)return _Q(e,r$(r)?{signal:`${r.signal}/2`}:r/2)}else if(zQ(t)){if(n===$4.POINT)return .5;if(n===$4.BAND)return i.offsetBandPaddingOuter}}}function yIe(e,t,n,r){if(n===`x`&&r.xReverse!==void 0)return Q$(e)&&t===`descending`?r$(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(Q$(e)&&t===`descending`)return!0}function bIe(e,t,n,r,i,a,o){if(n&&n!==`unaggregated`&&Q$(i)){if(H(n)){let e=n[0],t=n[n.length-1];if(Wh(e)&&e<=0&&Wh(t)&&t>=0)return!0}return!1}if(e===`size`&&t.type===`quantitative`&&!e1(i))return!0;if(!(Z(t)&&t.bin)&&qZ([...j4,...BLe],e)){let{orient:t,type:n}=r;return qZ([`bar`,`area`,`line`,`trail`],n)&&(t===`horizontal`&&e===`y`||t===`vertical`&&e===`x`)?!1:qZ([`bar`,`area`],n)&&!o?!0:a?.zero}return!1}function xIe(e,t,n,r,i=!1){let a=SIe(t,n,r,i),{type:o}=e;return VQ(t)?o===void 0?a:vAe(t,o)?Z(n)&&!_Ae(o,n.type)?(X(gke(o,a)),a):o:(X(hke(t,o,a)),a):null}function SIe(e,t,n,r){switch(t.type){case`nominal`:case`ordinal`:{if(OQ(e)||HQ(e)===`discrete`)return e===`shape`&&t.type===`ordinal`&&X(j$(e,`ordinal`)),`ordinal`;if(BQ(e))return`band`;if(LQ(e)||zQ(e)){if(qZ([`rect`,`bar`,`image`,`rule`,`tick`],n.type)||r)return`band`}else if(n.type===`arc`&&e in M4)return`band`;let i=n[PQ(e)];return a1(i)||P1(t)&&t.axis?.tickBand?`band`:`point`}case`temporal`:return OQ(e)?`time`:HQ(e)===`discrete`?(X(j$(e,`temporal`)),`ordinal`):Z(t)&&t.timeUnit&&B$(t.timeUnit).utc?`utc`:BQ(e)?`band`:`time`;case`quantitative`:return OQ(e)?Z(t)&&JQ(t.bin)?`bin-ordinal`:`linear`:HQ(e)===`discrete`?(X(j$(e,`quantitative`)),`ordinal`):BQ(e)?`band`:`linear`;case`geojson`:return}throw Error(ZOe(t.type))}function CIe(e,{ignoreRange:t}={}){wIe(e),_Fe(e);for(let t of LRe)lIe(e,t);t||dIe(e)}function wIe(e){C2(e)?e.component.scales=TIe(e):e.component.scales=EIe(e)}function TIe(e){let{encoding:t,mark:n,markDef:r}=e,i={};for(let a of I4){let o=V1(t[a]);if(o&&n===h3&&a===s4&&o.type===Q4)continue;let s=o&&o.scale;if(o&&s!==null&&s!==!1){s??={};let n=dje(t,a),c=xIe(s,a,o,r,n);i[a]=new e8(e.scaleName(`${a}`,!0),{value:c,explicit:s.type===c})}}return i}function EIe(e){let t=e.component.scales={},n={},r=e.component.resolve;for(let t of e.children){wIe(t);for(let i of $(t.component.scales))if(r.scale[i]??=OPe(i,e),r.scale[i]===`shared`){let e=n[i],a=t.component.scales[i].getWithExplicit(`type`);e?lAe(e.value,a.value)?n[i]=w0(e,a,`type`,`scale`,iBe):(r.scale[i]=`independent`,delete n[i]):n[i]=a}}for(let r of $(n)){let i=e.scaleName(r,!0),a=n[r];t[r]=new e8(i,a);for(let t of e.children){let e=t.component.scales[r];e&&(t.renameScale(e.get(`name`),i),e.merged=!0)}}return t}function C2(e){return e?.type===`unit`}function w2(e){return e?.type===`facet`}function T2(e){return e?.type===`concat`}function E2(e){return e?.type===`layer`}function DIe(e){let t=0;function n(r,i){if(r instanceof H6&&!r.isGenerator&&!T0(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof R6&&(r.parent instanceof H6&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof L6){i.name||=`data_${t++}`,!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof B6||r instanceof V6||r instanceof q6||r instanceof D6||r instanceof k6||r instanceof d8||r instanceof I6||r instanceof m8||r instanceof Y6||r instanceof K6||r instanceof l8||r instanceof c8||r instanceof o8||r instanceof p8||r instanceof h8||r instanceof g8||r instanceof z6||r instanceof v8||r instanceof _8||r instanceof s8)&&i.transform.push(r.assemble()),(r instanceof F6||r instanceof X3||r instanceof f8||r instanceof J6||r instanceof u8)&&i.transform.push(...r.assemble()),r instanceof Y3&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof Y3?r.setSource(i.name):(i.name||=`data_${t++}`,r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof Y3&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||=`data_${t++}`;let a=i.name;!i.source||i.transform.length>0?e.push(i):a=i.source;for(let e of r.children)n(e,{name:null,source:a,transform:[]});break}}}return n}function OIe(e){let t=[],n=DIe(t);for(let t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}function kIe(e,t){let n=[],r=DIe(n),i=0;for(let t of e.sources)t.hasName()||(t.dataName=`source_${i++}`),r(t,t.assemble());for(let e of n)e.transform.length===0&&delete e.transform;let a=0;for(let[e,t]of n.entries())(t.transform??[]).length===0&&!t.source&&n.splice(a++,0,n.splice(e,1)[0]);for(let t of n)for(let n of t.transform??[])n.type===`lookup`&&(n.from=e.outputNodes[n.from].getSource());for(let e of n)e.name in t&&(e.values=t[e.name]);return n}function AIe(e){return e===`top`||e===`left`||r$(e)?`header`:`footer`}function jIe(e){for(let t of D4)MIe(e,t);PIe(e,`x`),PIe(e,`y`)}function MIe(e,t){let{facet:n,config:r,child:i,component:a}=e;if(e.channelHasField(t)){let o=n[t],s=r2(`title`,null,r,t),c=I1(o,r,{allowDisabling:!0,includeDefault:s===void 0||!!s});i.component.layoutHeaders[t].title&&(c=H(c)?c.join(`, `):c,c+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);let l=r2(`labelOrient`,o.header,r,t),u=o.header!==null&&_Q(o.header?.labels,r.header.labels,!0),d=qZ([`bottom`,`right`],l)?`footer`:`header`;a.layoutHeaders[t]={title:o.header===null?null:c,facetFieldDef:o,[d]:t===`facet`?[]:[NIe(e,t,u)]}}}function NIe(e,t,n){let r=t===`row`?`height`:`width`;return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function PIe(e,t){let{child:n}=e;if(n.component.axes[t]){let{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=c2(i,t),i.axis[t]===`shared`){let i=t===`x`?`column`:`row`,a=r[i];for(let r of n.component.axes[t]){let t=AIe(r.get(`orient`));a[t]??=[NIe(e,i,!1)];let n=Q0(r,`main`,e.config,{header:!0});n&&a[t][0].axes.push(n),r.mainExtracted=!0}}}}function FIe(e){D2(e),O2(e,`width`),O2(e,`height`)}function IIe(e){D2(e);let t=e.layout.columns===1?`width`:`childWidth`,n=e.layout.columns===void 0?`height`:`childHeight`;O2(e,t),O2(e,n)}function D2(e){for(let t of e.children)t.parseLayoutSize()}function O2(e,t){let n=EPe(t),r=RQ(n),i=e.component.resolve,a=e.component.layoutSize,o;for(let t of e.children){let a=t.component.layoutSize.getWithExplicit(n),s=i.scale[r]??OPe(r,e);if(s===`independent`&&a.value===`step`){o=void 0;break}if(o){if(s===`independent`&&o.value!==a.value){o=void 0;break}o=w0(o,a,n,``)}else o=a}if(o){for(let r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,`merged`,!1);a.setWithExplicit(t,o)}else a.setWithExplicit(t,{explicit:!1,value:void 0})}function LIe(e){let{size:t,component:n}=e;for(let r of j4){let i=PQ(r);if(t[i]!=null&&t[i]!=null){let e=t[i];n.layoutSize.set(i,u0(e)?`step`:e,!0)}else{let t=RIe(e,i);n.layoutSize.set(i,t,!1)}}}function RIe(e,t){let n=t===`width`?`x`:`y`,r=e.config,i=e.getScaleComponent(n);if(i){let e=i.get(`type`),n=i.get(`range`);if(Z$(e)){let e=p0(r.view,t);return i$(n)||u0(e)?`step`:e}else return d0(r.view,t)}else if(e.hasProjection||e.mark===`arc`)return d0(r.view,t);else{let e=p0(r.view,t);return u0(e)?e.step:e}}function k2(e,t,n){return Q(t,{suffix:`by_${Q(e)}`,...n})}function zIe(e,t){let{row:n,column:r}=t;if(n&&r){let t=null;for(let i of[n,r])if(_1(i.sort)){let{field:n,op:r=b3}=i.sort;e=t=new K6(e,{joinaggregate:[{op:r,field:n,as:k2(i,i.sort,{forAs:!0})}],groupby:[Q(i)]})}return t}return null}function BIe(e,t){for(let n of t){let t=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;let r=e.format?.mesh,i=t.format?.feature;if(r&&i)continue;let a=e.format?.feature;if((a||i)&&a!==i)continue;let o=t.format?.mesh;if(!((r||o)&&r!==o)){if(E0(e)&&E0(t)){if(CQ(e.values,t.values))return n}else if(T0(e)&&T0(t)){if(e.url===t.url)return n}else if(QMe(e)&&e.name===n.dataName)return n}}return null}function VIe(e,t){if(e.data||!e.parent){if(e.data===null){let e=new H6({values:[]});return t.push(e),e}let n=BIe(e.data,t);if(n)return D0(e.data)||(n.data.format=XZ({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{let n=new H6(e.data);return t.push(n),n}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function HIe(e,t,n){let r=0;for(let i of t.transforms){let a,o;if(jMe(i))o=e=new k6(e,i),a=`derived`;else if(y0(i)){let r=cFe(i);o=e=R6.makeWithAncestors(e,{},r,n)??e,e=new D6(e,t,i.filter)}else if(MMe(i))o=e=F6.makeFromTransform(e,i,t),a=`number`;else if(PMe(i))a=`date`,n.getWithExplicit(i.field).value===void 0&&(e=new R6(e,{[i.field]:a}),n.set(i.field,a,!1)),o=e=X3.makeFromTransform(e,i);else if(FMe(i))o=e=I6.makeFromTransform(e,i),a=`number`,q0(t)&&(e=new z6(e));else if(yMe(i))o=e=m8.make(e,t,i,r++),a=`derived`;else if(OMe(i))o=e=new Y6(e,i),a=`number`;else if(kMe(i))o=e=new K6(e,i),a=`number`;else if(IMe(i))o=e=J6.makeFromTransform(e,i),a=`derived`;else if(LMe(i))o=e=new l8(e,i),a=`derived`;else if(RMe(i))o=e=new s8(e,i),a=`derived`;else if(AMe(i))o=e=new c8(e,i),a=`derived`;else if(SMe(i))o=e=new _8(e,i),a=`derived`;else if(DMe(i))e=new v8(e,i);else if(NMe(i))o=e=f8.makeFromTransform(e,i),a=`derived`;else if(CMe(i))o=e=new o8(e,i),a=`derived`;else if(wMe(i))o=e=new h8(e,i),a=`derived`;else if(TMe(i))o=e=new g8(e,i),a=`derived`;else if(EMe(i))o=e=new p8(e,i),a=`derived`;else{X(KOe(i));continue}if(o&&a!==void 0)for(let e of o.producedFields()??[])n.set(e,a,!1)}return e}function A2(e){let t=VIe(e,e.component.data.sources),{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,a=!(i&&(D0(i)||T0(i)||E0(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Oze;D0(i)?($Me(i)?t=new V6(t,i.sequence):O0(i)&&(t=new B6(t,i.graticule)),a.parseNothing=!0):i?.format?.parse===null&&(a.parseNothing=!0),t=R6.makeExplicit(t,e,a)??t,t=new z6(t);let o=e.parent&&E2(e.parent);(C2(e)||w2(e))&&o&&(t=F6.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=HIe(t,e,a));let s=uFe(e),c=lFe(e);t=R6.makeWithAncestors(t,{},{...s,...c},a)??t,C2(e)&&(t=u8.parseAll(t,e),t=d8.parseAll(t,e)),(C2(e)||w2(e))&&(o||(t=F6.makeFromEncoding(t,e)??t),t=X3.makeFromEncoding(t,e)??t,t=k6.parseAllForSortIndex(t,e));let l=t=j2(q3.Raw,e,t);if(C2(e)){let n=I6.makeFromEncoding(t,e);n&&(t=n,q0(e)&&(t=new z6(t))),t=f8.makeFromEncoding(t,e)??t,t=J6.makeFromEncoding(t,e)??t}let u,d;if(C2(e)){let{markDef:n,mark:r,config:i}=e,{marks:a,scales:o}=d=tNe({invalid:m$(`invalid`,n,i),isPath:n1(r)});a!==o&&o===`include-invalid-values`&&(u=t=j2(q3.PreFilterInvalid,e,t)),a===`exclude-invalid-values`&&(t=q6.make(t,e,d)??t)}let f=t=j2(q3.Main,e,t),p;if(C2(e)&&d){let{marks:n,scales:r}=d;n===`include-invalid-values`&&r===`exclude-invalid-values`&&(t=q6.make(t,e,d)??t,p=t=j2(q3.PostFilterInvalid,e,t))}C2(e)&&YNe(e,f);let m=null;if(w2(e)){let r=e.getName(`facet`);t=zIe(t,e.facet)??t,m=new L6(t,e,r,f.getSource()),n[r]=m}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:l,main:f,facetRoot:m,ancestorParse:a,preFilterInvalid:u,postFilterInvalid:p}}function j2(e,t,n){let{outputNodes:r,outputNodeRefCounts:i}=t.component.data,a=t.getDataName(e),o=new Y3(n,a,e,i);return r[a]=o,o}function UIe(e){return e===!1||e===null}function WIe(e,t,n){let{encoding:r,config:i}=e,a=V1(r[t])??V1(r[NQ(t)]),{format:o,formatType:s}=e.axis(t)||{};if(f1(s))return{text:m1({fieldOrDatumDef:a,field:`datum.value`,format:o,formatType:s,config:i}),...n};if(o===void 0&&s===void 0&&i.customFormatTypes){if(E1(a)===`quantitative`){if(P1(a)&&a.stack===`normalize`&&i.normalizedNumberFormatType)return{text:m1({fieldOrDatumDef:a,field:`datum.value`,format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:m1({fieldOrDatumDef:a,field:`datum.value`,format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(E1(a)===`temporal`&&i.timeFormatType&&Z(a)&&!a.timeUnit)return{text:m1({fieldOrDatumDef:a,field:`datum.value`,format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function GIe(e){return j4.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[XIe(n,e)]),t),{})}function KIe(e){let{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(let r of e.children){r.parseAxesAndHeaders();for(let i of $(r.component.axes))n.axis[i]=c2(e.component.resolve,i),n.axis[i]===`shared`&&(t[i]=qIe(t[i],r.component.axes[i]),t[i]||(n.axis[i]=`independent`,delete t[i]))}for(let i of j4){for(let a of e.children)if(a.component.axes[i]){if(n.axis[i]===`independent`){t[i]=(t[i]??[]).concat(a.component.axes[i]);for(let e of a.component.axes[i]){let{value:t,explicit:n}=e.getWithExplicit(`orient`);if(!r$(t)){if(r[t]>0&&!n){let n=cBe[t];r[t]>r[n]&&e.set(`orient`,n,!1)}r[t]++}}}delete a.component.axes[i]}if(n.axis[i]===`independent`&&t[i]&&t[i].length>1)for(let[e,n]of(t[i]||[]).entries())e>0&&n.get(`grid`)&&!n.explicit.grid&&(n.implicit.grid=!1)}}function qIe(e,t){if(e){if(e.length!==t.length)return;let n=e.length;for(let r=0;re.clone());return e}function JIe(e,t){for(let n of y8){let r=w0(e.getWithExplicit(n),t.getWithExplicit(n),n,`axis`,(e,t)=>{switch(n){case`title`:return x$(e,t);case`gridScale`:return{explicit:e.explicit,value:_Q(e.value,t.value)}}return C0(e,t,n,`axis`)});e.setWithExplicit(n,r)}return e}function YIe(e,t,n,r,i){if(t===`disable`)return n!==void 0;switch(n||={},t){case`titleAngle`:case`labelAngle`:return e===(r$(n.labelAngle)?n.labelAngle:xQ(n.labelAngle));case`values`:return!!n.values;case`encode`:return!!n.encoding||!!n.labelAngle;case`title`:if(e===fPe(r,i))return!0}return e===n[t]}function XIe(e,t){let n=t.axis(e),r=new sBe,i=V1(t.encoding[e]),{mark:a,config:o}=t,s=n?.orient||o[e===`x`?`axisX`:`axisY`]?.orient||o.axis?.orient||lPe(e),c=t.getScaleComponent(e).get(`type`),l=ePe(e,c,s,t.config),u=n===void 0?$0(`disable`,o.style,n?.style,l).configValue:!n;if(r.set(`disable`,u,n!==void 0),u)return r;n||={};let d=iPe(i,n,e,o.style,l),f=jAe(n.formatType,i,c),p=AAe(i,i.type,n.format,n.formatType,o,!0),m={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:c,orient:s,labelAngle:d,format:p,formatType:f,mark:a,config:o};for(let i of y8){let a=i in O6?O6[i](m):lje(i)?n[i]:void 0,s=a!==void 0,c=YIe(a,i,n,t,e);if(s&&c)r.set(i,a,c);else{let{configValue:e=void 0,configFrom:t=void 0}=lje(i)&&i!==`values`?$0(i,o.style,n.style,l):{},u=e!==void 0;s&&!u?r.set(i,a,c):(t!==`vgAxisConfig`||lBe.has(i)&&u||J1(e)||r$(e))&&r.set(i,e,!1)}}let h=n.encoding??{},g=T3.reduce((n,i)=>{if(!r.hasAxisPart(i))return n;let a=DPe(h[i]??{},t),o=i===`labels`?WIe(t,e,a):a;return o!==void 0&&!nQ(o)&&(n[i]={update:o}),n},{});return nQ(g)||r.set(`encode`,g,!!n.encoding||n.labelAngle!==void 0),r}function ZIe({encoding:e,size:t}){for(let n of j4){let r=PQ(n);u0(t[r])&&O1(e[n])&&(delete t[r],X(vke(r)))}return t}function M2(e,t){let{config:n}=e;return{...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`include`,orient:`ignore`,theta:`ignore`}),...z0(`x`,e,{defaultPos:`mid`}),...z0(`y`,e,{defaultPos:`mid`}),...L0(`size`,e),...L0(`angle`,e),...QIe(e,n,t)}}function QIe(e,t,n){return n?{shape:{value:n}}:L0(`shape`,e)}function $Ie(e,t,n){if(m$(`align`,e,n)===void 0)return`center`}function eLe(e,t,n){if(m$(`baseline`,e,n)===void 0)return`middle`}function tLe(e){if(qZ([c3,o3,BRe],e.mark)){let t=vje(e.mark,e.encoding);if(t.length>0)return nLe(e,t)}else if(e.mark===s3){let t=R4.some(t=>m$(t,e.markDef,e.config));if(e.stack&&!e.fieldDef(`size`)&&t)return rLe(e)}return N2(e)}function nLe(e,t){return[{name:e.getName(`pathgroup`),type:`group`,from:{facet:{name:x8+e.requestDataName(q3.Main),data:e.requestDataName(q3.Main),groupby:t}},encode:{update:{width:{field:{group:`width`}},height:{field:{group:`height`}}}},marks:N2(e,{fromPrefix:x8})}]}function rLe(e){let[t]=N2(e,{fromPrefix:S8}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:`min`,suffix:`start`,expr:t}),r({prefix:`max`,suffix:`start`,expr:t}),r({prefix:`min`,suffix:`end`,expr:t}),r({prefix:`max`,suffix:`end`,expr:t})].map(e=>`scale('${n}',${e})`).join(`,`)})`,a,o;e.stack.fieldChannel===`x`?(a={...UZ(t.encode.update,[`y`,`yc`,`y2`,`height`,...R4]),x:{signal:i(`min`,`datum`)},x2:{signal:i(`max`,`datum`)},clip:{value:!0}},o={x:{field:{group:`x`},mult:-1},height:{field:{group:`height`}}},t.encode.update={...WZ(t.encode.update,[`y`,`yc`,`y2`]),height:{field:{group:`height`}}}):(a={...UZ(t.encode.update,[`x`,`xc`,`x2`,`width`]),y:{signal:i(`min`,`datum`)},y2:{signal:i(`max`,`datum`)},clip:{value:!0}},o={y:{field:{group:`y`},mult:-1},width:{field:{group:`width`}}},t.encode.update={...WZ(t.encode.update,[`x`,`xc`,`x2`]),width:{field:{group:`width`}}});for(let n of R4){let r=h$(n,e.markDef,e.config);t.encode.update[n]?(a[n]=t.encode.update[n],delete t.encode.update[n]):r&&(a[n]=u$(r)),r&&(t.encode.update[n]={value:0})}let s=[];if(e.stack.groupbyChannels?.length>0)for(let t of e.stack.groupbyChannels){let n=e.fieldDef(t),r=Q(n);r&&s.push(r),(n?.bin||n?.timeUnit)&&s.push(Q(n,{binSuffix:`end`}))}return a=[`stroke`,`strokeWidth`,`strokeJoin`,`strokeCap`,`strokeDash`,`strokeDashOffset`,`strokeMiterLimit`,`strokeOpacity`].reduce((n,r)=>{if(t.encode.update[r])return{...n,[r]:t.encode.update[r]};{let t=h$(r,e.markDef,e.config);return t===void 0?n:{...n,[r]:u$(t)}}},a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0}),[{type:`group`,from:{facet:{data:e.requestDataName(q3.Main),name:S8+e.requestDataName(q3.Main),groupby:s,aggregate:{fields:[r({suffix:`start`}),r({suffix:`start`}),r({suffix:`end`}),r({suffix:`end`})],ops:[`min`,`max`,`min`,`max`]}}},encode:{update:a},marks:[{type:`group`,encode:{update:o},marks:[t]}]}]}function iLe(e){let{encoding:t,stack:n,mark:r,markDef:i,config:a}=e,o=t.order;if(!(!H(o)&&M1(o)&&KZ(o.value)||!o&&KZ(m$(`order`,i,a)))){if((H(o)||Z(o))&&!n)return v$(o,{expr:`datum`});if(n1(r)){let e=i.orient===`horizontal`?`y`:`x`,n=t[e];if(Z(n))return{field:e}}}}function N2(e,t={fromPrefix:``}){let{mark:n,markDef:r,encoding:i,config:a}=e,o=_Q(r.clip,aLe(e),oLe(e)),s=p$(r),c=i.key,l=iLe(e),u=sLe(e);u&&Object.values(e.component.selection).some(e=>e.type===`point`&&!e.bind&&e.on!==`pointerover`)&&(e.markDef.cursor??=`pointer`);let d=m$(`aria`,r,a),f=b8[n].postEncodingTransform?b8[n].postEncodingTransform(e):null;return[{name:e.getName(`marks`),type:b8[n].vgMark,...o?{clip:o}:{},...s?{style:s}:{},...c?{key:c.field}:{},...l?{sort:l}:{},...u||{},...d===!1?{aria:d}:{},from:{data:t.fromPrefix+e.requestDataName(q3.Main)},encode:{update:b8[n].encodeEntry(e)},...f?{transform:f}:{}}]}function aLe(e){let t=e.getScaleComponent(`x`),n=e.getScaleComponent(`y`);return t?.get(`selectionExtent`)||n?.get(`selectionExtent`)?!0:void 0}function oLe(e){let t=e.component.projection;return t&&!t.isFit?!0:void 0}function sLe(e){if(!e.component.selection)return null;let t=$(e.component.selection).length,n=t,r=e.parent;for(;r&&n===0;)n=$(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark===`geoshape`||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}function P2(e,t,n,r,i){if(b1(e))return new aBe(e,t,n,i);if(m0(e))return new CBe(e,t,n,r,i);if(Y1(e))return new C8(e,t,n,r,i);if(Rje(e))return new oBe(e,t,n,i);throw Error(S$(e))}function cLe(e,t={}){t.logger&&Fke(t.logger),t.fieldTitle&&tje(t.fieldTitle);try{let n=qje(Wm(t.config,e.config)),r=WMe(e,n),i=P2(r,null,``,void 0,n);return i.parse(),gFe(i.component.data,i),{spec:uLe(i,lLe(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&Ike(),t.fieldTitle&&nje()}}function lLe(e,t,n,r){let i=r.component.layoutSize.get(`width`),a=r.component.layoutSize.get(`height`);if(t===void 0?(t={type:`pad`},r.hasAxisOrientSignalRef()&&(t.resize=!0)):qh(t)&&(t={type:t}),i&&a&&JMe(t.type)){if(i===`step`&&a===`step`)X(T$()),t.type=`pad`;else if(i===`step`||a===`step`){let e=i===`step`?`width`:`height`;X(T$(RQ(e))),t.type=YMe(e===`width`?`height`:`width`)}}return{...$(t).length===1&&t.type?t.type===`pad`?{}:{autosize:t.type}:{autosize:t},...XMe(n,!1),...XMe(e,!0)}}function uLe(e,t,n={},r){let i=e.config?Jje(e.config):void 0,a=kIe(e.component.data,n),o=e.assembleSelectionData(a),s=e.assembleProjections(),c=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0),d=e.assembleLayoutSignals();d=d.filter(e=>(e.name===`width`||e.name===`height`)&&e.value!==void 0?(t[e.name]=+e.value,!1):!0);let{params:f,...p}=t;return{$schema:`https://vega.github.io/schema/vega/v6.json`,...e.description?{description:e.description}:{},...p,...c?{title:c}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...d,...e.assembleSelectionTopLevelSignals([]),...Lje(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}var dLe,F2,$,I2,L2,R2,z2,B2,V2,H2,U2,W2,G2,K2,q2,J2,Y2,X2,Z2,Q2,$2,e4,t4,n4,r4,i4,a4,o4,s4,c4,l4,u4,d4,f4,p4,m4,h4,g4,_4,v4,y4,b4,x4,S4,fLe,C4,w4,pLe,T4,E4,D4,O4,mLe,hLe,gLe,_Le,vLe,yLe,bLe,xLe,SLe,CLe,wLe,TLe,ELe,DLe,OLe,kLe,ALe,jLe,MLe,NLe,PLe,FLe,ILe,LLe,RLe,k4,zLe,A4,j4,M4,BLe,N4,VLe,HLe,ULe,WLe,GLe,KLe,qLe,JLe,YLe,P4,XLe,F4,I4,L4,ZLe,QLe,$Le,eRe,tRe,nRe,rRe,iRe,aRe,R4,oRe,sRe,cRe,lRe,uRe,dRe,fRe,pRe,z4,mRe,hRe,gRe,_Re,vRe,B4,yRe,bRe,xRe,V4,H4,U4,SRe,W4,CRe,G4,K4,wRe,TRe,q4,J4,Y4,X4,Z4,Q4,$4,e3,ERe,t3,n3,r3,DRe,ORe,kRe,ARe,jRe,MRe,NRe,PRe,FRe,IRe,LRe,i3,a3,o3,s3,RRe,c3,l3,zRe,u3,d3,f3,BRe,p3,m3,h3,VRe,HRe,URe,WRe,g3,_3,GRe,KRe,v3,qRe,y3,JRe,YRe,b3,XRe,x3,S3,C3,w3,T3,ZRe,E3,QRe,D3,O3,k3,$Re,eze,A3,tze,nze,j3,rze,ize,M3,aze,N3,P3,oze,sze,F3,I3,cze,lze,L3,uze,R3,dze,z3,fze,B3,V3,H3,pze,mze,hze,gze,U3,_ze,vze,yze,W3,bze,xze,Sze,Cze,G3,wze,Tze,Eze,Dze,K3,Oze,q3,J3,Y3,X3,Z3,Q3,$3,kze,Aze,e6,t6,n6,r6,i6,a6,o6,s6,jze,Mze,Nze,c6,l6,u6,d6,f6,Pze,Fze,Ize,Lze,Rze,p6,m6,h6,g6,_6,zze,v6,y6,b6,Bze,x6,S6,Vze,C6,w6,Hze,T6,E6,D6,O6,k6,A6,j6,Uze,M6,Wze,N6,P6,F6,I6,L6,R6,z6,B6,V6,H6,U6,W6,G6,Gze,Kze,qze,Jze,Yze,Xze,Zze,Qze,$ze,eBe,tBe,K6,q6,J6,Y6,X6,Z6,Q6,nBe,$6,e8,rBe,t8,n8,iBe,r8,i8,a8,o8,s8,c8,l8,u8,d8,f8,p8,m8,h8,g8,_8,v8,aBe,oBe,y8,sBe,cBe,lBe,uBe,dBe,fBe,pBe,mBe,hBe,gBe,_Be,vBe,yBe,bBe,xBe,SBe,b8,x8,S8,C8,CBe,wBe,TBe=o((()=>{dg(),JY(),dK(),yOe(),dLe={version:`6.4.3`},F2=structuredClone,Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>wQ(e)).join(`,`)})`},$=Object.keys,I2=Object.values,L2=Object.entries,R2=42,z2=Object.getPrototypeOf(structuredClone({})),B2=`row`,V2=`column`,H2=`facet`,U2=`x`,W2=`y`,G2=`x2`,K2=`y2`,q2=`xOffset`,J2=`yOffset`,Y2=`radius`,X2=`radius2`,Z2=`theta`,Q2=`theta2`,$2=`latitude`,e4=`longitude`,t4=`latitude2`,n4=`longitude2`,r4=`time`,i4=`color`,a4=`fill`,o4=`stroke`,s4=`shape`,c4=`size`,l4=`angle`,u4=`opacity`,d4=`fillOpacity`,f4=`strokeOpacity`,p4=`strokeWidth`,m4=`strokeDash`,h4=`text`,g4=`order`,_4=`detail`,v4=`key`,y4=`tooltip`,b4=`href`,x4=`url`,S4=`description`,fLe={x:1,y:1,x2:1,y2:1},C4={theta:1,theta2:1,radius:1,radius2:1},w4={longitude:1,longitude2:1,latitude:1,latitude2:1},pLe=$(w4),T4={...fLe,...C4,...w4,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time: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},E4={row:1,column:1,facet:1},D4=$(E4),O4={...T4,...E4},mLe=$(O4),{order:hLe,detail:gLe,tooltip:_Le,...vLe}=O4,{row:yLe,column:bLe,facet:xLe,...SLe}=vLe,CLe=[G2,K2,t4,n4,Q2,X2],wLe=$(T4),{x:TLe,y:ELe,x2:DLe,y2:OLe,xOffset:kLe,yOffset:ALe,latitude:jLe,longitude:MLe,latitude2:NLe,longitude2:PLe,theta:FLe,theta2:ILe,radius:LLe,radius2:RLe,...k4}=T4,zLe=$(k4),A4={x:1,y:1},j4=$(A4),M4={theta:1,radius:1},BLe=$(M4),N4={xOffset:1,yOffset:1},VLe={time:1},{text:HLe,tooltip:ULe,href:WLe,url:GLe,description:KLe,detail:qLe,key:JLe,order:YLe,...P4}=k4,XLe=$(P4),F4={...A4,...M4,...N4,...P4},I4=$(F4),L4={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:ZLe,...QLe}=L4,$Le={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb: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},eRe={count:1,min:1,max:1},tRe=new Set([`count`,`valid`,`missing`,`distinct`]),nRe=new Set([`count`,`sum`,`distinct`,`valid`,`missing`]),rRe=new Set([`mean`,`average`,`median`,`q1`,`q3`,`min`,`max`]),iRe=$({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}),aRe={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},R4=[`cornerRadius`,`cornerRadiusTopLeft`,`cornerRadiusTopRight`,`cornerRadiusBottomLeft`,`cornerRadiusBottomRight`],oRe=` – `,sRe=`Autosize "fit" only works for single views and layered views.`,cRe=`Scale bindings are currently only supported for scales with unbinned, continuous domains.`,lRe=`Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc`,uRe=`Legend bindings are only supported for selections over an individual field or encoding channel.`,dRe=`The same selection must be used to override scale domains in a layered view.`,fRe=`Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.`,pRe=`Multiple timer selections in one unit spec are not supported. Ignoring all but the first.`,z4=`Animation involving facet, layer, or concat is currently unsupported.`,mRe=`Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).`,hRe=`Attempt to add the same child twice.`,gRe=`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.`,_Re=`Arc marks uses theta channel rather than angle, replacing angle with theta.`,vRe=`Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.`,B4=`Domains that should be unioned has conflicting sort properties. Sort will be set to true.`,yRe=`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.`,bRe=`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.`,xRe=`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.`,V4=Bm(2),H4=V4,U4=[`january`,`february`,`march`,`april`,`may`,`june`,`july`,`august`,`september`,`october`,`november`,`december`],SRe=U4.map(e=>e.substr(0,3)),W4=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`],CRe=W4.map(e=>e.substr(0,3)),G4={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},K4=$(G4),wRe={"year-month":`%b %Y `,"year-month-date":`%b %d, %Y `},TRe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},q4={quantitative:`quantitative`,ordinal:`ordinal`,temporal:`temporal`,nominal:`nominal`,geojson:`geojson`},J4=q4.quantitative,Y4=q4.ordinal,X4=q4.temporal,Z4=q4.nominal,Q4=q4.geojson,$4={LINEAR:`linear`,LOG:`log`,POW:`pow`,SQRT:`sqrt`,TIME:`time`,UTC:`utc`,POINT:`point`,BAND:`band`},e3={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`},ERe={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},t3=new Set([`linear`,`log`,`pow`,`sqrt`,`symlog`]),n3=new Set([...t3,`time`,`utc`]),r3=new Set([`quantile`,`quantize`,`threshold`]),DRe=new Set([...n3,...r3,`sequential`,`identity`]),ORe=new Set([`ordinal`,`bin-ordinal`,`point`,`band`]),kRe={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5},{type:ARe,domain:jRe,range:MRe,rangeMax:NRe,rangeMin:PRe,scheme:FRe,...IRe}={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},LRe=$(IRe),i3={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`},a3=i3.arc,o3=i3.area,s3=i3.bar,RRe=i3.image,c3=i3.line,l3=i3.point,zRe=i3.rect,u3=i3.rule,d3=i3.text,f3=i3.tick,BRe=i3.trail,p3=i3.circle,m3=i3.square,h3=i3.geoshape,VRe=new Set($(i3)),HRe=[`stroke`,`strokeWidth`,`strokeDash`,`strokeDashOffset`,`strokeOpacity`,`strokeJoin`,`strokeMiterLimit`],URe=[`fill`,`fillOpacity`],WRe=[...HRe,...URe],g3=$({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),_3=[`binSpacing`,`continuousBandSize`,`discreteBandSize`,`minBandSize`],GRe={area:[`line`,`point`],bar:_3,rect:_3,line:[`point`],tick:[`bandSize`,`thickness`,..._3]},KRe={color:`#4c78a8`,invalid:`break-paths-show-path-domains`,timeUnitBandSize:1},v3=$({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}),qRe={horizontal:[`cornerRadiusTopRight`,`cornerRadiusBottomRight`],vertical:[`cornerRadiusTopLeft`,`cornerRadiusTopRight`]},y3={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},JRe={...y3,binSpacing:1},YRe={...y3,thickness:1},b3=`min`,XRe={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1},x3=(e,t)=>{switch(t.fieldTitle){case`plain`:return e.field;case`functional`:return eje(e);default:return $Ae(e,t)}},S3=x3,C3={compatible:!0},w3={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`}},T3=[`domain`,`grid`,`labels`,`ticks`,`title`],ZRe={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`},E3={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},QRe={...E3,style:1,labelExpr:1,encoding:1},D3=$({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}),O3=class{name;run;constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return Y1(e)?bAe(e.mark)===this.name:!1}},k3=`boxplot`,$Re=[`box`,`median`,`outliers`,`rule`,`ticks`],eze=new O3(k3,wje),A3=`errorbar`,tze=[`ticks`,`rule`],nze=new O3(A3,Dje),j3=`errorband`,rze=[`band`,`borders`],ize=new O3(j3,Fje),M3={},r0(k3,wje,$Re),r0(A3,Dje,tze),r0(j3,Fje,rze),aze=[`gradientHorizontalMaxLength`,`gradientHorizontalMinLength`,`gradientVerticalMaxLength`,`gradientVerticalMinLength`,`unselectedOpacity`],N3={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`},P3={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`},oze=$(N3),sze=$(P3),F3=$({header:1,headerRow:1,headerColumn:1,headerFacet:1}),I3=[`size`,`shape`,`fill`,`stroke`,`strokeDash`,`strokeWidth`,`opacity`],cze={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},lze={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},L3=`_vgsid_`,uze={point:{on:`click`,fields:[L3],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`}},R3=20,dze=$({align:1,bounds:1,center:1,columns:1,spacing:1}),z3=20,fze={background:`white`,padding:5,timeFormat:`%b %d, %Y`,countTitle:`Count of Records`,view:{continuousWidth:300,continuousHeight:300,step:z3},mark:KRe,arc:{},area:{},bar:JRe,circle:{},geoshape:{},image:{},line:{},point:{},rect:y3,rule:{color:`black`},square:{},text:{color:`black`},tick:YRe,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:kRe,projection:{},legend:cze,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:uze,style:{},title:{},facet:{spacing:R3},concat:{spacing:R3},normalizedNumberFormat:`.0%`},B3=[`#4c78a8`,`#f58518`,`#e45756`,`#72b7b2`,`#54a24b`,`#eeca3b`,`#b279a2`,`#ff9da6`,`#9d755d`,`#bab0ac`],V3={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},H3={blue:B3[0],orange:B3[1],red:B3[2],teal:B3[3],green:B3[4],yellow:B3[5],purple:B3[6],pink:B3[7],brown:B3[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`},pze=[...v3,...D3,...F3,`background`,`padding`,`legend`,`lineBreak`,`scale`,`style`,`title`,`view`],mze=new Set([`view`,...VRe]),hze=`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`.split(`.`),gze={view:[`continuousWidth`,`continuousHeight`,`discreteWidth`,`discreteHeight`,`step`],...GRe},U3=class{map(e,t){return b1(e)?this.mapFacet(e,t):Zje(e)?this.mapRepeat(e,t):l0(e)?this.mapHConcat(e,t):c0(e)?this.mapVConcat(e,t):s0(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(m0(e))return this.mapLayer(e,t);if(Y1(e))return this.mapUnit(e,t);throw Error(S$(e))}mapLayer(e,t){return{...e,layer:e.layer.map(e=>this.mapLayerOrUnit(e,t))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map(e=>this.map(e,t))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map(e=>this.map(e,t))}}mapConcat(e,t){let{concat:n,...r}=e;return{...r,concat:n.map(e=>this.map(e,t))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}},_ze={zero:1,center:1,normalize:1},vze=new Set([a3,s3,o3,u3,l3,p3,m3,c3,d3,f3]),yze=new Set([s3,o3,a3]),W3=.7,bze=class{name=`path-overlay`;hasMatchingType(e,t){if(Y1(e)){let{mark:n,encoding:r}=e,i=i1(n)?n:{type:n};switch(i.type){case`line`:case`rule`:case`trail`:return!!g0(i,t[i.type],r);case`area`:return!!g0(i,t[i.type],r)||!!uMe(i,t[i.type])}}return!1}run(e,t,n){let{config:r}=t,{params:i,projection:a,mark:o,name:s,encoding:c,...l}=e,u=Z1(c,r),d=i1(o)?o:{type:o},f=g0(d,r[d.type],u),p=d.type===`area`&&uMe(d,r[d.type]),m=[{name:s,...i?{params:i}:{},mark:cMe({...d.type===`area`&&m$(`opacity`,d,r)==null&&m$(`fillOpacity`,d,r)==null?{opacity:W3}:{},...d}),encoding:WZ(u,[`shape`])}],h=nMe(rMe(d,u,r),u),g=u;if(h){let{fieldChannel:e,offset:t}=h;g={...u,[e]:{...u[e],...t?{stack:t}:{}}}}return g=WZ(g,[`y2`,`x2`]),p&&m.push({...a?{projection:a}:{},mark:{type:`line`,...UZ(d,[`clip`,`interpolate`,`tension`,`tooltip`]),...p},encoding:g}),f&&m.push({...a?{projection:a}:{},mark:{type:`point`,opacity:1,filled:!0,...UZ(d,[`clip`,`tooltip`]),...f},encoding:g}),n({...l,layer:m},{...t,config:lMe(r)})}},xze=class{name=`RuleForRangedLine`;hasMatchingType(e){if(Y1(e)){let{encoding:t,mark:n}=e;if(n===`line`||i1(n)&&n.type===`line`)for(let e of CLe){let n=t[jQ(e)];if(t[e]&&(Z(n)&&!YQ(n.bin)||D1(n)))return!0}}return!1}run(e,t,n){let{encoding:r,mark:i}=e;return X(ske(!!r.x2,!!r.y2)),n({...e,mark:Hm(i)?{...i,type:`rule`}:`rule`},t)}},Sze=class extends U3{nonFacetUnitNormalizers=[eze,nze,ize,new bze,new xze];map(e,t){if(Y1(e)){let n=X1(e.encoding,B2),r=X1(e.encoding,V2),i=X1(e.encoding,H2);if(n||r||i)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){let{parentEncoding:n,parentProjection:r}=t,i=_0(e.encoding,t.repeater),a={...e,...e.name?{name:[t.repeaterPrefix,e.name].filter(e=>e).join(`_`)}:{},...i?{encoding:i}:{}};if(n||r)return this.mapUnitWithParentEncodingOrProjection(a,t);let o=this.mapLayerOrUnit.bind(this);for(let e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(a,t.config))return e.run(a,t,o);return a}mapRepeat(e,t){return Qje(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){let{repeat:n,spec:r,...i}=e,{row:a,column:o,layer:s}=n,{repeater:c={},repeaterPrefix:l=``}=t;return a||o?this.mapRepeat({...e,repeat:{...a?{row:a}:{},...o?{column:o}:{}},spec:{repeat:{layer:s},spec:r}},t):{...i,layer:s.map(e=>{let n={...c,layer:e},i=`${(r.name?`${r.name}_`:``)+l}child__layer_${aQ(e)}`,a=this.mapLayerOrUnit(r,{...t,repeater:n,repeaterPrefix:i});return a.name=i,a})}}mapNonLayerRepeat(e,t){let{repeat:n,spec:r,data:i,...a}=e;!H(n)&&e.columns&&(e=WZ(e,[`columns`]),X(VOe(`repeat`)));let o=[],{repeater:s={},repeaterPrefix:c=``}=t,l=!H(n)&&n.row||[s?s.row:null],u=!H(n)&&n.column||[s?s.column:null],d=H(n)&&n||[s?s.repeat:null];for(let e of d)for(let i of l)for(let a of u){let l={repeat:e,row:i,column:a,layer:s.layer},u=`${(r.name?`${r.name}_`:``)+c}child__${H(n)?`${aQ(e)}`:(n.row?`row_${aQ(i)}`:``)+(n.column?`column_${aQ(a)}`:``)}`,d=this.map(r,{...t,repeater:l,repeaterPrefix:u});d.name=u,o.push(WZ(d,[`data`]))}let f=H(n)?e.columns:n.column?n.column.length:1;return{data:r.data??i,align:`all`,...a,columns:f,concat:o}}mapFacet(e,t){let{facet:n}=e;return v1(n)&&e.columns&&(e=WZ(e,[`columns`]),X(VOe(`facet`))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){let{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:a,config:o}=t,s=_Me({parentProjection:a,projection:r}),c=gMe({parentEncoding:i,encoding:_0(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...c?{encoding:c}:{}},{config:o})}mapFacetedUnit(e,t){let{row:n,column:r,facet:i,...a}=e.encoding,{mark:o,width:s,projection:c,height:l,view:u,params:d,encoding:f,...p}=e,{facetMapping:m,layout:h}=this.getFacetMappingAndLayout({row:n,column:r,facet:i},t),g=_0(a,t.repeater);return this.mapFacet({...p,...h,facet:m,spec:{...s?{width:s}:{},...l?{height:l}:{},...u?{view:u}:{},...c?{projection:c}:{},mark:o,encoding:g,...d?{params:d}:{}}},t)}getFacetMappingAndLayout(e,t){let{row:n,column:r,facet:i}=e;if(n||r){i&&X(ake([...n?[B2]:[],...r?[V2]:[]]));let t={},a={};for(let n of[B2,V2]){let r=e[n];if(r){let{align:e,center:i,spacing:o,columns:s,...c}=r;t[n]=c;for(let e of[`align`,`center`,`spacing`])r[e]!==void 0&&(a[e]??={},a[e][n]=r[e])}}return{facetMapping:t,layout:a}}else{let{align:e,center:n,spacing:r,columns:a,...o}=i;return{facetMapping:dMe(o,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...r?{spacing:r}:{},...a?{columns:a}:{}}}}}mapLayer(e,{parentEncoding:t,parentProjection:n,...r}){let{encoding:i,projection:a,...o}=e,s={...r,parentEncoding:gMe({parentEncoding:t,encoding:i,layer:!0}),parentProjection:_Me({parentProjection:n,projection:a})};return super.mapLayer({...o,...e.name?{name:[s.repeaterPrefix,e.name].filter(e=>e).join(`_`)}:{}},s)}},Cze=class extends U3{map(e,t){return t.emptySelections??={},t.selectionPredicates??={},e=BMe(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if(e=BMe(e,t),e.encoding){let n={};for(let[r,i]of L2(e.encoding))n[r]=VMe(i,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){let{selection:n,...r}=e;return n?{...r,params:L2(n).map(([e,n])=>{let{init:r,bind:i,empty:a,...o}=n;o.type===`single`?(o.type=`point`,o.toggle=!1):o.type===`multi`&&(o.type=`point`),t.emptySelections[e]=a!==`none`;for(let n of I2(t.selectionPredicates[e]??{}))n.empty=a!==`none`;return{name:e,value:r,select:o,bind:i}})}:e}},G3=class extends U3{map(e,t){let n=t.selections??[];if(e.params&&!Y1(e)){let t=[];for(let r of e.params)o0(r)?n.push(r):t.push(r);e.params=t}return t.selections=n,super.map(e,t)}mapUnit(e,t){let n=t.selections;if(!n||!n.length)return e;let r=(t.path??[]).concat(e.name),i=[];for(let t of n)if(!t.views||!t.views.length)i.push(t);else for(let n of t.views)(qh(n)&&(n===e.name||r.includes(n))||H(n)&&n.map(e=>r.indexOf(e)).every((e,t,n)=>e!==-1&&(t===0||e>n[t-1])))&&i.push(t);return i.length&&(e.params=i),e}};for(let e of[`mapFacet`,`mapRepeat`,`mapHConcat`,`mapVConcat`,`mapLayer`]){let t=G3.prototype[e];G3.prototype[e]=function(e,n){return t.call(this,e,UMe(e,n))}}wze=new Sze,Tze=new Cze,Eze=new G3,Dze=[`background`,`padding`],K3=class e{explicit;implicit;constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new e(F2(this.explicit),F2(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return _Q(this.explicit[e],this.implicit[e])}getWithExplicit(e){return this.explicit[e]===void 0?this.implicit[e]===void 0?{explicit:!1,value:void 0}:{explicit:!1,value:this.implicit[e]}:{explicit:!0,value:this.explicit[e]}}setWithExplicit(e,{value:t,explicit:n}){t!==void 0&&this.set(e,t,n)}set(e,t,n){return delete this[n?`implicit`:`explicit`][e],this[n?`explicit`:`implicit`][e]=t,this}copyKeyFromSplit(e,{explicit:t,implicit:n}){t[e]===void 0?n[e]!==void 0&&this.set(e,n[e],!1):this.set(e,t[e],!0)}copyKeyFromObject(e,t){t[e]!==void 0&&this.set(e,t[e],!0)}copyAll(e){for(let t of $(e.combine())){let n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}},Oze=class extends K3{explicit;implicit;parseNothing;constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){let e=super.clone();return e.parseNothing=this.parseNothing,e}},(function(e){e[e.Raw=0]=`Raw`,e[e.Main=1]=`Main`,e[e.Row=2]=`Row`,e[e.Column=3]=`Column`,e[e.Lookup=4]=`Lookup`,e[e.PreFilterInvalid=5]=`PreFilterInvalid`,e[e.PostFilterInvalid=6]=`PostFilterInvalid`})(q3||={}),J3=class{debugName;_children=[];_parent=null;_hash;constructor(e,t){this.debugName=t,e&&(this.parent=e)}clone(){throw 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)){X(hRe);return}t===void 0?this._children.push(e):this._children.splice(t,0,e)}removeChild(e){let t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(let t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){let t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){let e=this._parent,t=e.parent;for(let t of this._children)t.parent=e;this._children=[],e.removeChild(this);let n=e.parent.removeChild(e);this._parent=t,t.addChild(this,n),e.parent=this}},Y3=class extends J3{type;refCounts;_source;_name;clone(){let 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,n,r){super(e,t),this.type=n,this.refCounts=r,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 ${vQ()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}},X3=class e extends J3{timeUnits;clone(){return new e(null,F2(this.timeUnits))}constructor(e,t){super(e),this.timeUnits=t}static makeFromEncoding(t,n){let r=n.reduceFieldDef((e,t,r)=>{let{field:i,timeUnit:a}=t;if(a){let o;if(L$(a)){if(C2(n)){let{mark:e,markDef:r,config:s}=n,c=S1({fieldDef:t,markDef:r,config:s});(r1(e)||c)&&(o={timeUnit:B$(a),field:i})}}else o={as:Q(t,{forAs:!0}),field:i,timeUnit:a};if(C2(n)){let{mark:e,markDef:i,config:a}=n,s=S1({fieldDef:t,markDef:i,config:a});r1(e)&&LQ(r)&&s!==.5&&(o.rectBandPosition=s)}o&&(e[GZ(o)]=o)}return e},{});return nQ(r)?null:new e(t,r)}static makeFromTransform(t,n){let{timeUnit:r,...i}={...n},a=B$(r),o={...i,timeUnit:a};return new e(t,{[GZ(o)]:o})}merge(e){this.timeUnits={...this.timeUnits};for(let t in e.timeUnits)this.timeUnits[t]||(this.timeUnits[t]=e.timeUnits[t]);for(let t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){let t={};for(let[n,r]of L2(this.timeUnits)){let i=k0(r)?r.as:`${r.field}_end`;e.has(i)||(t[n]=r)}this.timeUnits=t}producedFields(){return new Set(I2(this.timeUnits).map(e=>k0(e)?e.as:rNe(e.field)))}dependentFields(){return new Set(I2(this.timeUnits).map(e=>e.field))}hash(){return`TimeUnit ${GZ(this.timeUnits)}`}assemble(){let e=[];for(let t of I2(this.timeUnits)){let{rectBandPosition:n}=t,r=B$(t.timeUnit);if(k0(t)){let{field:i,as:a}=t,{unit:o,utc:s,...c}=r,l=[a,`${a}_end`];e.push({field:pQ(i),type:`timeunit`,...o?{units:z$(o)}:{},...s?{timezone:`utc`}:{},...c,as:l}),e.push(...aNe(l,n,r))}else if(t){let{field:i}=t,a=fQ(i),o=iNe({timeUnit:r,field:a}),s=rNe(a);e.push({type:`formula`,expr:o,as:s}),e.push(...aNe([a,s],n,r))}}return e}},Z3=`offsetted_rect_start`,Q3=`offsetted_rect_end`,$3=`_tuple_fields`,kze=class{hasChannel;hasField;hasSelectionId;timeUnit;items;constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}},Aze={defined:()=>!0,parse:(e,t,n)=>{let r=t.name,i=t.project??=new kze,a={},o={},s=new Set,c=(e,t)=>{let n=t===`visual`?e.channel:e.field,i=aQ(`${r}_${n}`);for(let e=1;s.has(i);e++)i=aQ(`${r}_${n}_${e}`);return s.add(i),{[t]:i}},l=t.type,u=e.config.selection[l],d=n.value===void 0?null:_h(n.value),{fields:f,encodings:p}=Hm(n.select)?n.select:{};if(!f&&!p&&d){for(let e of d)if(Hm(e))for(let t of $(e))TOe(t)?(p||=[]).push(t):l===`interval`?(X(fRe),p=u.encodings):(f??=[]).push(t)}!f&&!p&&(p=u.encodings,`fields`in u&&(f=u.fields));for(let t of p??[]){let n=e.fieldDef(t);if(n){let r=n.field;if(n.aggregate){X(FOe(t,n.aggregate));continue}else if(!r){X(D$(t));continue}if(n.timeUnit&&!L$(n.timeUnit)){r=e.vgField(t);let i={timeUnit:n.timeUnit,as:r,field:n.field};o[GZ(i)]=i}if(!a[r]){let o=l===`interval`&&VQ(t)&&Q$(e.getScaleComponent(t).get(`type`))?`R`:n.bin?`R-RE`:`E`,s={field:r,channel:t,type:o,index:i.items.length};s.signals={...c(s,`data`),...c(s,`visual`)},i.items.push(a[r]=s),i.hasField[r]=a[r],i.hasSelectionId=i.hasSelectionId||r===L3,DQ(t)?(s.geoChannel=t,s.channel=EQ(t),i.hasChannel[s.channel]=a[r]):i.hasChannel[t]=a[r]}}else X(D$(t))}for(let e of f??[]){if(i.hasField[e])continue;let t={type:`E`,field:e,index:i.items.length};t.signals={...c(t,`data`)},i.items.push(t),i.hasField[e]=t,i.hasSelectionId=i.hasSelectionId||e===L3}d&&(t.init=d.map(e=>i.items.map(t=>Hm(e)?e[t.geoChannel||t.channel]===void 0?e[t.field]:e[t.geoChannel||t.channel]:e))),nQ(o)||(i.timeUnit=new X3(null,o))},signals:(e,t,n)=>{let r=t.name+$3;return n.filter(e=>e.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(sNe)})}},e6=`_curr`,t6=`anim_value`,n6=`anim_clock`,r6=`eased_anim_clock`,i6=`min_extent`,a6=`max_range_extent`,o6=`last_tick_at`,s6=`is_playing`,jze=1/60*1e3,Mze=(e,t)=>[{name:r6,update:n6},{name:`${e}_domain`,init:`domain('${t}')`},{name:i6,init:`extent(${e}_domain)[0]`},{name:a6,init:`extent(range('${t}'))[1]`},{name:t6,update:`invert('${t}', ${r6})`}],Nze={defined:e=>e.type===`point`,topLevelSignals:(e,t,n)=>(J0(t)&&(n=n.concat([{name:n6,init:`0`,on:[{events:{type:`timer`,throttle:jze},update:`${s6} ? (${n6} + (now() - ${o6}) > ${a6} ? 0 : ${n6} + (now() - ${o6})) : ${n6}`}]},{name:o6,init:`now()`,on:[{events:[{signal:n6},{signal:s6}],update:`now()`}]},{name:s6,init:`true`}])),n),signals:(e,t,n)=>{let r=t.name,i=r+$3,a=t.project,o=`(item().isVoronoi ? datum.datum : datum)`,s=I2(e.component.selection??{}).reduce((e,t)=>t.type===`interval`?e.concat(t.name+l6):e,[]).map(e=>`indexof(item().mark.name, '${e}') < 0`).join(` && `),c=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${s?` && ${s}`:``}`,l=`unit: ${K0(e)}, `;if(t.project.hasSelectionId)l+=`${L3}: ${o}[${W(L3)}]`;else if(J0(t))l+=`fields: ${i}, values: [${t6} ? ${t6} : ${i6}]`;else{let t=a.items.map(t=>e.fieldDef(t.channel)?.bin?`[${o}[${W(e.vgField(t.channel,{}))}], ${o}[${W(e.vgField(t.channel,{binSuffix:`end`}))}]]`:`${o}[${W(t.field)}]`).join(`, `);l+=`fields: ${i}, values: [${t}]`}if(J0(t))return n.concat(Mze(t.name,e.scaleName(r4)),[{name:r+w6,on:[{events:[{signal:r6},{signal:t6}],update:`{${l}}`,force:!0}]}]);{let e=t.events;return n.concat([{name:r+w6,on:e?[{events:e,update:`${c} ? {${l}} : null`,force:!0}]:[]}])}}},c6={defined:e=>e.type===`interval`&&e.resolve===`global`&&e.bind&&e.bind===`scales`,parse:(e,t)=>{let n=t.scales=[];for(let r of t.project.items){let i=r.channel;if(!VQ(i))continue;let a=e.getScaleComponent(i),o=a?a.get(`type`):void 0;if(o==`sequential`&&X(lRe),!a||!Q$(o)){X(cRe);continue}a.set(`selectionExtent`,{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{let r=t.scales.filter(e=>n.filter(t=>t.name===e.signals.data).length===0);if(!e.parent||N0(e)||r.length===0)return n;let i=n.find(e=>e.name===t.name),a=i.update;if(a.includes(T6))i.update=`{${r.map(e=>`${W(pQ(e.field))}: ${e.signals.data}`).join(`, `)}}`;else{for(let e of r){let t=`${W(pQ(e.field))}: ${e.signals.data}`;a.includes(t)||(a=`${a.substring(0,a.length-1)}, ${t}}`)}i.update=a}return n.concat(r.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!N0(e))for(let e of t.scales){let t=n.find(t=>t.name===e.signals.data);t.push=`outer`,delete t.value,delete t.update}return n}},l6=`_brush`,u6=`_scale_trigger`,d6=`geo_interval_init_tick`,f6=`_init`,Pze=`_center`,Fze={defined:e=>e.type===`interval`,parse:(e,t,n)=>{if(e.hasProjection){let e={...Hm(n.select)?n.select:{}};e.fields=[L3],e.encodings||=n.value?$(n.value):[e4,$2],n.select={type:`interval`,...e}}if(t.translate&&!c6.defined(t)){let e=`!event.item || event.item.mark.name !== ${W(t.name+l6)}`;for(let n of t.events){if(!n.between){X(`${n} is not an ordered event stream for interval selections.`);continue}let t=_h(n.between[0].filter??=[]);t.includes(e)||t.push(e)}}},signals:(e,t,n)=>{let r=t.name,i=r+w6,a=I2(t.project.hasChannel).filter(e=>e.channel===U2||e.channel===W2),o=t.init?t.init[0]:null;if(n.push(...a.reduce((n,r)=>n.concat(hNe(e,t,r,o?.[r.index])),[])),e.hasProjection){let s=W(e.projectionName()),c=e.projectionName()+Pze,{x:l,y:u}=t.project.hasChannel,d=l?.signals.visual,f=u?.signals.visual,p=l?o?.[l.index]:`${c}[0]`,m=u?o?.[u.index]:`${c}[1]`,h=t=>e.getSizeSignalRef(t).signal,g=`[[${d?`${d}[0]`:`0`}, ${f?`${f}[0]`:`0`}],[${d?`${d}[1]`:h(`width`)}, ${f?`${f}[1]`:h(`height`)}]]`;o&&(n.unshift({name:r+f6,init:`[scale(${s}, [${l?p[0]:p}, ${u?m[0]:m}]), scale(${s}, [${l?p[1]:p}, ${u?m[1]:m}])]`}),(!l||!u)&&(n.find(e=>e.name===c)||n.unshift({name:c,update:`invert(${s}, [${h(`width`)}/2, ${h(`height`)}/2])`})));let _=`vlSelectionTuples(${`intersect(${g}, {markname: ${W(e.getName(`marks`))}}, unit.mark)`}, ${`{unit: ${K0(e)}}`})`,v=a.map(e=>e.signals.visual);return n.concat({name:i,on:[{events:[...v.length?[{signal:v.join(` || `)}]:[],...o?[{signal:d6}]:[]],update:_}]})}else{if(!c6.defined(t)){let t=r+u6,i=a.map(t=>{let n=t.channel,{data:r,visual:i}=t.signals,a=W(e.scaleName(n)),o=Q$(e.getScaleComponent(n).get(`type`))?`+`:``;return`(!isArray(${r}) || (${o}invert(${a}, ${i})[0] === ${o}${r}[0] && ${o}invert(${a}, ${i})[1] === ${o}${r}[1]))`});i.length&&n.push({name:t,value:{},on:[{events:a.map(t=>({scale:e.scaleName(t.channel)})),update:`${i.join(` && `)} ? ${t} : {}`}]})}let s=a.map(e=>e.signals.data),c=`unit: ${K0(e)}, fields: ${r+$3}, values`;return n.concat({name:i,...o?{init:`{${c}: ${A0(o)}}`}:{},...s.length?{on:[{events:[{signal:s.join(` || `)}],update:`${s.join(` && `)} ? {${c}: [${s}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(C2(e)&&e.hasProjection&&t.init&&(n.filter(e=>e.name===d6).length||n.unshift({name:d6,value:null,on:[{events:`timer{1}`,update:`${d6} === null ? {} : ${d6}`}]})),n),marks:(e,t,n)=>{let r=t.name,{x:i,y:a}=t.project.hasChannel,o=i?.signals.visual,s=a?.signals.visual,c=`data(${W(t.name+C6)})`;if(c6.defined(t)||!i&&!a)return n;let l={x:i===void 0?{value:0}:{signal:`${o}[0]`},y:a===void 0?{value:0}:{signal:`${s}[0]`},x2:i===void 0?{field:{group:`width`}}:{signal:`${o}[1]`},y2:a===void 0?{field:{group:`height`}}:{signal:`${s}[1]`}};if(t.resolve===`global`)for(let t of $(l))l[t]=[{test:`${c}.length && ${c}[0].unit === ${K0(e)}`,...l[t]},{value:0}];let{fill:u,fillOpacity:d,cursor:f,...p}=t.mark,m=$(p).reduce((e,t)=>(e[t]=[{test:[i!==void 0&&`${o}[0] !== ${o}[1]`,a!==void 0&&`${s}[0] !== ${s}[1]`].filter(e=>e).join(` && `),value:p[t]},{value:null}],e),{}),h=f??(t.translate?`move`:null);return[{name:`${r+l6}_bg`,type:`rect`,clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:d}},update:l}},...n,{name:r+l6,type:`rect`,clip:!0,encode:{enter:{...h?{cursor:{value:h}}:{},fill:{value:`transparent`}},update:{...l,...m}}}]}},Ize={left:`x`,center:`xc`,right:`x2`},Lze={top:`y`,middle:`yc`,bottom:`y2`},Rze=new Set([`aria`,`width`,`height`]),p6=`voronoi`,m6={defined:e=>e.type===`point`&&e.nearest,parse:(e,t)=>{if(t.events)for(let n of t.events)n.markname=e.getName(p6)},marks:(e,t,n)=>{let{x:r,y:i}=t.project.hasChannel,a=e.mark;if(n1(a))return X(IOe(a)),n;let o={name:e.getName(p6),type:`path`,interactive:!0,aria:!1,from:{data:e.getName(`marks`)},encode:{update:{fill:{value:`transparent`},strokeWidth:{value:.35},stroke:{value:`transparent`},isVoronoi:{value:!0},...gNe(e,{reactiveGeom:!0})}},transform:[{type:`voronoi`,x:{expr:r||!i?`datum.datum.x || 0`:`0`},y:{expr:i||!r?`datum.datum.y || 0`:`0`},size:[e.getSizeSignalRef(`width`),e.getSizeSignalRef(`height`)]}]},s=0,c=!1;return n.forEach((t,n)=>{let r=t.name??``;r===e.component.mark[0].name?s=n:r.includes(p6)&&(c=!0)}),c||n.splice(s+1,0,o),n}},h6={defined:e=>e.type===`point`&&e.resolve===`global`&&e.bind&&e.bind!==`scales`&&!i0(e.bind),parse:(e,t,n)=>UNe(t,n),topLevelSignals:(e,t,n)=>{let r=t.name,i=t.project,a=t.bind,o=t.init?.[0],s=m6.defined(t)?`(item().isVoronoi ? datum.datum : datum)`:`datum`;return i.items.forEach((e,i)=>{let c=aQ(`${r}_${e.field}`);n.filter(e=>e.name===c).length||n.unshift({name:c,...o?{init:A0(o[i])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${W(e.field)}] : null`}]:[],bind:a[e.field]??a[e.channel]??a})}),n},signals:(e,t,n)=>{let r=t.name,i=t.project,a=n.find(e=>e.name===r+w6),o=r+$3,s=i.items.map(e=>aQ(`${r}_${e.field}`)),c=s.map(e=>`${e} !== null`).join(` && `);return s.length&&(a.update=`${c} ? {fields: ${o}, values: [${s.join(`, `)}]} : null`),delete a.value,delete a.on,n}},g6=`_toggle`,_6={defined:e=>e.type===`point`&&!J0(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+g6,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{let n=t.name+w6,r=t.name+g6;return`${r} ? null : ${n}, ${t.resolve===`global`?`${r} ? null : true, `:`${r} ? null : {unit: ${K0(e)}}, `}${r} ? ${n} : null`}},zze={defined:e=>e.clear!==void 0&&e.clear!==!1&&!J0(e),parse:(e,t)=>{t.clear&&=qh(t.clear)?JG(t.clear,`view`):t.clear},topLevelSignals:(e,t,n)=>{if(h6.defined(t))for(let e of t.project.items){let r=n.findIndex(n=>n.name===aQ(`${t.name}_${e.field}`));r!==-1&&n[r].on.push({events:t.clear,update:`null`})}return n},signals:(e,t,n)=>{function r(e,r){e!==-1&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if(t.type===`interval`)for(let e of t.project.items){let t=n.findIndex(t=>t.name===e.signals.visual);r(t,`[0, 0]`),t===-1&&r(n.findIndex(t=>t.name===e.signals.data),`null`)}else{let e=n.findIndex(e=>e.name===t.name+w6);r(e,`null`),_6.defined(t)&&(e=n.findIndex(e=>e.name===t.name+g6),r(e,`false`))}return n}},v6={defined:e=>{let t=e.resolve===`global`&&e.bind&&i0(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==L3;return t&&!n&&X(uRe),t&&n},parse:(e,t,n)=>{let r=F2(n);if(r.select=qh(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},UNe(t,r),Hm(n.select)&&(n.select.on||n.select.clear)){let e=`event.item && indexof(event.item.mark.role, "legend") < 0`;for(let n of t.events)n.filter=_h(n.filter??[]),n.filter.includes(e)||n.filter.push(e)}let i=a0(t.bind)?t.bind.legend:`click`;t.bind={legend:{merge:qh(i)?JG(i,`view`):_h(i)}}},topLevelSignals:(e,t,n)=>{let r=t.name,i=a0(t.bind)&&t.bind.legend,a=e=>t=>{let n=F2(t);return n.markname=e,n};for(let e of t.project.items){if(!e.hasLegend)continue;let o=`${aQ(e.field)}_legend`,s=`${r}_${o}`;if(n.filter(e=>e.name===s).length===0){let e=i.merge.map(a(`${o}_symbols`)).concat(i.merge.map(a(`${o}_labels`))).concat(i.merge.map(a(`${o}_entries`)));n.unshift({name:s,...t.init?{}:{value:null},on:[{events:e,update:`isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value`,force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]})}}return n},signals:(e,t,n)=>{let r=t.name,i=t.project,a=n.find(e=>e.name===r+w6),o=r+$3,s=i.items.filter(e=>e.hasLegend).map(e=>aQ(`${r}_${aQ(e.field)}_legend`)),c=`${s.map(e=>`${e} !== null`).join(` && `)} ? {fields: ${o}, values: [${s.join(`, `)}]} : null`;t.events&&s.length>0?a.on.push({events:s.map(e=>({signal:e})),update:c}):s.length>0&&(a.update=c,delete a.value,delete a.on);let l=n.find(e=>e.name===r+g6),u=a0(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push({...l.on[0],events:u}):l.on[0].events=u),n}},y6=`_translate_anchor`,b6=`_translate_delta`,Bze={defined:e=>e.type===`interval`&&e.translate,signals:(e,t,n)=>{let r=t.name,i=c6.defined(t),a=r+y6,{x:o,y:s}=t.project.hasChannel,c=JG(t.translate,`scope`);return i||(c=c.map(e=>(e.between[0].markname=r+l6,e))),n.push({name:a,value:{},on:[{events:c.map(e=>e.between[0]),update:`{x: x(unit), y: y(unit)${o===void 0?``:`, extent_x: ${i?M0(e,U2):`slice(${o.signals.visual})`}`}${s===void 0?``:`, extent_y: ${i?M0(e,W2):`slice(${s.signals.visual})`}`}}`}]},{name:r+b6,value:{},on:[{events:c,update:`{x: ${a}.x - x(unit), y: ${a}.y - y(unit)}`}]}),o!==void 0&&BNe(e,t,o,`width`,n),s!==void 0&&BNe(e,t,s,`height`,n),n}},x6=`_zoom_anchor`,S6=`_zoom_delta`,Vze={defined:e=>e.type===`interval`&&e.zoom,signals:(e,t,n)=>{let r=t.name,i=c6.defined(t),a=r+S6,{x:o,y:s}=t.project.hasChannel,c=W(e.scaleName(U2)),l=W(e.scaleName(W2)),u=JG(t.zoom,`scope`);return i||(u=u.map(e=>(e.markname=r+l6,e))),n.push({name:r+x6,on:[{events:u,update:i?`{${[c?`x: invert(${c}, x(unit))`:``,l?`y: invert(${l}, y(unit))`:``].filter(e=>e).join(`, `)}}`:`{x: x(unit), y: y(unit)}`}]},{name:a,on:[{events:u,force:!0,update:`pow(1.001, event.deltaY * pow(16, event.deltaMode))`}]}),o!==void 0&&VNe(e,t,o,`width`,n),s!==void 0&&VNe(e,t,s,`height`,n),n}},C6=`_store`,w6=`_tuple`,Hze=`_modify`,T6=`vlSelectionResolve`,E6=[Nze,Fze,Aze,_6,h6,c6,v6,zze,Bze,Vze,m6],D6=class e extends J3{model;filter;expr;_dependentFields;clone(){return new e(null,this.model,F2(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=X0(this.model,this.filter,this),this._dependentFields=GNe(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:`filter`,expr:this.expr}}hash(){return`Filter ${this.expr}`}},O6={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??nPe(n,e),gridScale:({model:e,channel:t})=>rPe(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||oPe(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||aPe(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??sPe(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??cPe(t.type,n,Z(t)&&!!t.timeUnit,Z(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{let a=e===`x`?`width`:e===`y`?`height`:void 0,o=a?t.getSizeSignalRef(a):void 0;return n.tickCount??uPe({fieldOrDatumDef:r,scaleType:i,size:o,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??dPe({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;let r=fPe(t,n);if(r!==void 0)return r;let i=t.typedFieldDef(n),a=n===`x`?`x2`:`y2`,o=t.fieldDef(a);return y$(i?[VAe(i)]:[],Z(o)?[VAe(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>pPe(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??mPe(n,t)},k6=class e extends J3{transform;_dependentFields;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this._dependentFields=GNe(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((n,r)=>{if(N1(n)&&RAe(n.sort)){let{field:i,timeUnit:a}=n,o=n.sort,s=o.map((e,t)=>`${aAe({field:i,timeUnit:a,equal:e})} ? ${t} : `).join(``)+o.length;t=new e(t,{calculate:s,as:t2(n,r,{forAs:!0})})}}),t}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 ${GZ(this.transform)}`}},A6=[`row`,`column`],j6=[`header`,`footer`],Uze={column:{start:0,end:1},row:{start:1,end:0}},M6=$({...lze,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),Wze=class extends K3{},N6={symbols:kPe,gradient:APe,labels:jPe,entries:MPe},P6={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{let{format:r,formatType:i}=t;return AAe(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{let{formatType:r}=e;return jAe(r,t,n)},gradientLength:e=>{let{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??HPe(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??WPe(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??LPe(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>I1(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(OQ(n)&&$$(t)){if(e===`gradient`)return}else if(e===`symbol`)return;return e},values:({fieldOrDatumDef:e,legend:t})=>IPe(t,e)},F6=class e extends J3{bins;clone(){return new e(null,F2(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(t,n){let r=n.reduceFieldDef((e,t,r)=>{if(j1(t)&&JQ(t.bin)){let{key:i,binComponent:a}=rFe(t,t.bin,n);e[i]={...a,...e[i],...$Pe(n,t,r,n.config)}}return e},{});return nQ(r)?null:new e(t,r)}static makeFromTransform(t,n,r){let{key:i,binComponent:a}=rFe(n,n.bin,r);return new e(t,{[i]:a})}merge(e,t){for(let n of $(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=ZZ([...this.bins[n].as,...e.bins[n].as],GZ)):this.bins[n]=e.bins[n];for(let t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(I2(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(I2(this.bins).map(e=>e.field))}hash(){return`Bin ${GZ(this.bins)}`}assemble(){return I2(this.bins).flatMap(e=>{let t=[],[n,...r]=e.as,{extent:i,...a}=e.bin,o={type:`bin`,field:pQ(e.field),as:n,signal:e.signal,...ZQ(i)?{extent:null}:{extent:i},...e.span?{span:{signal:`span(${e.span})`}}:{},...a};!i&&e.extentSignal&&(t.push({type:`extent`,field:pQ(e.field),signal:e.extentSignal}),o.extent={signal:e.extentSignal}),t.push(o);for(let e of r)for(let r=0;r<2;r++)t.push({type:`formula`,expr:Q({field:n[r]},{expr:`datum`}),as:e[r]});return e.formula&&t.push({type:`formula`,expr:e.formula,as:e.formulaAs}),t})}},I6=class e extends J3{dimensions;measures;clone(){return new e(null,new Set(this.dimensions),F2(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(e=>{e.aggregate&&(r=!0)});let i={},a=new Set;return!r||(n.forEachFieldDef((e,t)=>{let{aggregate:r,field:o}=e;if(r)if(r===`count`)i[`*`]??={},i[`*`].count=new Set([Q(e,{forAs:!0})]);else{if(UQ(r)||WQ(r)){let e=UQ(r)?`argmin`:`argmax`,t=r[e];i[t]??={},i[t][e]=new Set([Q({op:e,field:t},{forAs:!0})])}else i[o]??={},i[o][r]=new Set([Q(e,{forAs:!0})]);VQ(t)&&n.scaleDomain(t)===`unaggregated`&&(i[o]??={},i[o].min=new Set([Q({field:o,aggregate:`min`},{forAs:!0})]),i[o].max=new Set([Q({field:o,aggregate:`max`},{forAs:!0})]))}else iFe(a,t,e,n)}),a.size+$(i).length===0)?null:new e(t,a,i)}static makeFromTransform(t,n){let r=new Set,i={};for(let e of n.aggregate){let{op:t,field:n,as:r}=e;t&&(t===`count`?(i[`*`]??={},i[`*`].count=new Set([r||Q(e,{forAs:!0})])):(i[n]??={},i[n][t]??=new Set,i[n][t].add(r||Q(e,{forAs:!0}))))}for(let e of n.groupby??[])r.add(e);return r.size+$(i).length===0?null:new e(t,r,i)}merge(e){return QZ(this.dimensions,e.dimensions)?(aFe(this.measures,e.measures),!0):(Lke(`different dimensions, cannot merge`),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...$(this.measures)])}producedFields(){let e=new Set;for(let t of $(this.measures))for(let n of $(this.measures[t])){let r=this.measures[t][n];r.size===0?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${GZ({dimensions:this.dimensions,measures:this.measures})}`}assemble(){let e=[],t=[],n=[];for(let r of $(this.measures))for(let i of $(this.measures[r]))for(let a of this.measures[r][i])n.push(a),e.push(i),t.push(r===`*`?null:pQ(r));return{type:`aggregate`,groupby:[...this.dimensions].map(pQ),ops:e,fields:t,as:n}}},L6=class extends J3{model;name;data;column;row;facet;childModel;constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(let e of D4){let n=t.facet[e];if(n){let{bin:r,sort:i}=n;this[e]={name:t.getName(`${e}_domain`),fields:[Q(n),...JQ(r)?[Q(n,{binSuffix:`end`})]:[]],..._1(i)?{sortField:i}:H(i)?{sortIndexField:t2(n,e)}:{}}}}this.childModel=t.child}hash(){let e=`Facet`;for(let t of D4)this[t]&&(e+=` ${t.charAt(0)}:${GZ(this[t])}`);return e}get fields(){let e=[];for(let t of D4)this[t]?.fields&&e.push(...this[t].fields);return e}dependentFields(){let e=new Set(this.fields);for(let t of D4)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(){let e={};for(let t of j4){let n=this.childModel.component.scales[t];if(n&&!n.merged){let r=n.get(`type`),i=n.get(`range`);if(Z$(r)&&i$(i)){let n=b2(x2(this.childModel,t));n?e[t]=n:X(E$(t))}}}return e}assembleRowColumnHeaderData(e,t,n){let r={row:`y`,column:`x`,facet:void 0}[e],i=[],a=[],o=[];r&&n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),a.push(`max`)):(i.push(n[r]),a.push(`distinct`)),o.push(`distinct_${n[r]}`));let{sortField:s,sortIndexField:c}=this[e];if(s){let{op:e=b3,field:t}=s;i.push(t),a.push(e),o.push(Q(s,{forAs:!0}))}else c&&(i.push(c),a.push(`max`),o.push(c));return{name:this[e].name,source:t??this.data,transform:[{type:`aggregate`,groupby:this[e].fields,...i.length?{fields:i,ops:a,as:o}:{}}]}}assembleFacetHeaderData(e){let{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,r=[],i={};for(let e of A6){for(let t of j6){let r=n[e]?.[t]??[];for(let t of r)if(t.axes?.length>0){i[e]=!0;break}}if(i[e]){let n=`length(data("${this.facet.name}"))`,i=e===`row`?t?{signal:`ceil(${n} / ${t})`}:1:t?{signal:`min(${n}, ${t})`}:{signal:n};r.push({name:`${this.facet.name}_${e}`,transform:[{type:`sequence`,start:0,stop:i}]})}}let{row:a,column:o}=i;return(a||o)&&r.unshift(this.assembleRowColumnHeaderData(`facet`,null,e)),r}assemble(){let e=[],t=null,n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:a}=this;if(r&&i&&(n.x||n.y)){t=`cross_${this.column.name}_${this.row.name}`;let r=[].concat(n.x??[],n.y??[]),i=r.map(()=>`distinct`);e.push({name:t,source:this.data,transform:[{type:`aggregate`,groupby:this.fields,fields:r,ops:i}]})}for(let r of[V2,B2])this[r]&&e.push(this.assembleRowColumnHeaderData(r,t,n));if(a){let t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}},R6=class e extends J3{_parse;clone(){return new e(null,F2(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${GZ(this._parse)}`}static makeExplicit(e,t,n){let r={},i=t.data;return!D0(i)&&i?.format?.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(t,n,r,i){for(let e of $(r)){let t=i.getWithExplicit(e);t.value!==void 0&&(t.explicit||t.value===r[e]||t.value===`derived`||r[e]===`flatten`?delete r[e]:X(GOe(e,r[e],t.value)))}for(let e of $(n)){let t=i.get(e);t!==void 0&&(t===n[e]?delete n[e]:X(GOe(e,n[e],t)))}let a=new K3(n,r);i.copyAll(a);let o={};for(let e of $(a.combine())){let t=a.get(e);t!==null&&(o[e]=t)}return $(o).length===0||i.parseNothing?null:new e(t,o)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){let e={};for(let t of $(this._parse)){let n=this._parse[t];gQ(t)===1&&(e[t]=n)}return e}producedFields(){return new Set($(this._parse))}dependentFields(){return new Set($(this._parse))}assembleTransforms(e=!1){return $(this._parse).filter(t=>!e||gQ(t)>1).map(e=>{let t=sFe(e,this._parse[e]);return t?{type:`formula`,expr:t,as:hQ(e)}:null}).filter(e=>e!==null)}},z6=class e extends J3{clone(){return new e(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([L3])}hash(){return`Identifier`}assemble(){return{type:`identifier`,as:L3}}},B6=class e extends J3{params;clone(){return new e(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${GZ(this.params)}`}assemble(){return{type:`graticule`,...this.params===!0?{}:this.params}}},V6=class e extends J3{params;clone(){return new e(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 ${GZ(this.params)}`}assemble(){return{type:`sequence`,...this.params}}},H6=class extends J3{_data;_name;_generator;constructor(e){super(null),e??={name:`source`};let t;if(D0(e)||(t=e.format?{...WZ(e.format,[`parse`])}:{}),E0(e))this._data={values:e.values};else if(T0(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];qZ([`json`,`csv`,`tsv`,`dsv`,`topojson`],n)||(n=`json`),t.type=n}}else eNe(e)?this._data={values:[{type:`Sphere`}]}:(QMe(e)||D0(e))&&(this._data={});this._generator=D0(e),e.name&&(this._name=e.name),t&&!nQ(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 Error(`Source nodes have to be roots.`)}remove(){throw Error(`Source nodes are roots and cannot be removed.`)}hash(){throw Error(`Cannot hash sources`)}assemble(){return{name:this._name,...this._data,transform:[]}}},U6=class{#e;constructor(){this.#e=!1}setModified(){this.#e=!0}get modifiedFlag(){return this.#e}},W6=class extends U6{getNodeDepths(e,t,n){n.set(e,t);for(let r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){let t=[...this.getNodeDepths(e,0,new Map).entries()].sort((e,t)=>t[1]-e[1]);for(let e of t)this.run(e[0]);return this.modifiedFlag}},G6=class extends U6{optimize(e){this.run(e);for(let t of e.children)this.optimize(t);return this.modifiedFlag}},Gze=class extends G6{mergeNodes(e,t){let n=t.shift();for(let r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){let t=e.children.map(e=>e.hash()),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}},Kze=class extends G6{requiresSelectionId;constructor(e){super(),this.requiresSelectionId=e&&q0(e)}run(e){e instanceof z6&&(this.requiresSelectionId&&(d2(e.parent)||e.parent instanceof I6||e.parent instanceof R6)||(this.setModified(),e.remove()))}},qze=class extends U6{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof X3&&(n=e.producedFields(),$Z(n,t)&&(this.setModified(),e.removeFormulas(t),e.producedFields.length===0&&e.remove()));for(let r of e.children)this.run(r,new Set([...t,...n]))}},Jze=class extends G6{constructor(){super()}run(e){e instanceof Y3&&!e.isRequired()&&(this.setModified(),e.remove())}},Yze=class extends W6{run(e){if(!d2(e)&&!(e.numChildren()>1)){for(let t of e.children)if(t instanceof R6)if(e instanceof R6)this.setModified(),e.merge(t);else{if(tQ(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}},Xze=class extends W6{run(e){let t=[...e.children],n=e.children.filter(e=>e instanceof R6);if(e.numChildren()>1&&n.length>=1){let r={},i=new Set;for(let e of n){let t=e.parse;for(let e of $(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(let e of i)delete r[e];if(!nQ(r)){this.setModified();let n=new R6(e,r);for(let i of t){if(i instanceof R6)for(let e of $(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof R6&&$(i.parse).length===0&&i.remove()}}}}},Zze=class extends W6{run(e){e instanceof Y3||e.numChildren()>0||e instanceof L6||e instanceof H6||(this.setModified(),e.remove())}},Qze=class extends W6{run(e){let t=e.children.filter(e=>e instanceof X3),n=t.pop();for(let e of t)this.setModified(),n.merge(e)}},$ze=class extends W6{run(e){let t=e.children.filter(e=>e instanceof I6),n={};for(let e of t){let t=GZ(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(let t of $(n)){let r=n[t];if(r.length>1){let t=r.pop();for(let n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}},eBe=class extends W6{model;constructor(e){super(),this.model=e}run(e){let t=!(d2(e)||e instanceof D6||e instanceof R6||e instanceof z6),n=[],r=[];for(let i of e.children)i instanceof F6&&(t&&!tQ(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){let t=n.pop();for(let e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof F6?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){let e=r.pop();for(let t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}},tBe=class extends W6{run(e){let t=[...e.children];if(!JZ(t,e=>e instanceof Y3)||e.numChildren()<=1)return;let n=[],r;for(let i of t)if(i instanceof Y3){let t=i;for(;t.numChildren()===1;){let[e]=t.children;if(e instanceof Y3)t=e;else break}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(let e of n)e.parent.removeChild(e),e.parent=r}}},K6=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=ZZ(this.transform.groupby.concat(e),e=>e)}dependentFields(){let e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(e=>e.field).filter(e=>e!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??Q(e)}hash(){return`JoinAggregateTransform ${GZ(this.transform)}`}assemble(){let e=[],t=[],n=[];for(let r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(r.field===void 0?null:r.field);let r=this.transform.groupby;return{type:`joinaggregate`,as:n,ops:t,fields:e,...r===void 0?{}:{groupby:r}}}},q6=class e extends J3{filter;clone(){return new e(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(t,n,r){let{config:i,markDef:a}=n,{marks:o,scales:s}=r;if(o===`include-invalid-values`&&s===`include-invalid-values`)return null;let c=n.reduceFieldDef((e,t,r)=>{let o=VQ(r)&&n.getScaleComponent(r);if(o){let n=o.get(`type`),{aggregate:s}=t,c=o1({scaleChannel:r,markDef:a,config:i,scaleType:n,isCountAggregate:KQ(s)});c!==`show`&&c!==`always-valid`&&(e[t.field]=t)}return e},{});return $(c).length?new e(t,c):null}dependentFields(){return new Set($(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${GZ(this.filter)}`}assemble(){let e=$(this.filter).reduce((e,t)=>{let n=this.filter[t],r=Q(n,{expr:`datum`});return n!==null&&(n.type===`temporal`?e.push(`(isDate(${r}) || (${f2(r)}))`):n.type===`quantitative`&&e.push(f2(r))),e},[]);return e.length>0?{type:`filter`,expr:e.join(` && `)}:null}},J6=class e extends J3{_stack;clone(){return new e(null,F2(this._stack))}constructor(e,t){super(e),this._stack=t}static makeFromTransform(t,n){let{stack:r,groupby:i,as:a,offset:o=`zero`}=n,s=[],c=[];if(n.sort!==void 0)for(let e of n.sort)s.push(e.field),c.push(_Q(e.order,`ascending`));let l={field:s,order:c},u;return u=fFe(a)?a:qh(a)?[a,`${a}_end`]:[`${n.stack}_start`,`${n.stack}_end`],new e(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:o,sort:l,facetby:[],as:u})}static makeFromEncoding(t,n){let r=n.stack,{encoding:i}=n;if(!r)return null;let{groupbyChannels:a,fieldChannel:o,offset:s,impute:c}=r,l=a.map(e=>{let t=i[e];return B1(t)}).filter(e=>!!e),u=dFe(n),d=n.encoding.order,f;if(H(d)||Z(d))f=v$(d);else{let e=WAe(d)?d.sort:o===`y`?`descending`:`ascending`;f=u.reduce((t,n)=>(t.field.includes(n)||(t.field.push(n),t.order.push(e)),t),{field:[],order:[]})}return new e(t,{dimensionFieldDefs:l,stackField:n.vgField(o),facetby:[],stackby:u,sort:f,offset:s,impute:c,as:[n.vgField(o,{suffix:`start`,forAs:!0}),n.vgField(o,{suffix:`end`,forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){let 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 ${GZ(this._stack)}`}getGroupbyFields(){let{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map(e=>e.bin?t?[Q(e,{binSuffix:`mid`})]:[Q(e,{}),Q(e,{binSuffix:`end`})]:[Q(e)]).flat():n??[]}assemble(){let e=[],{facetby:t,dimensionFieldDefs:n,stackField:r,stackby:i,sort:a,offset:o,impute:s,as:c}=this._stack;if(s)for(let a of n){let{bandPosition:n=.5,bin:o}=a;if(o){let t=Q(a,{expr:`datum`}),r=Q(a,{expr:`datum`,binSuffix:`end`});e.push({type:`formula`,expr:`${f2(t)} ? ${n}*${t}+${1-n}*${r} : ${t}`,as:Q(a,{binSuffix:`mid`,forAs:!0})})}e.push({type:`impute`,field:r,groupby:[...i,...t],key:Q(a,{binSuffix:`mid`}),method:`value`,value:0})}return e.push({type:`stack`,groupby:[...this.getGroupbyFields(),...t],field:r,sort:a,as:c,offset:o}),e}},Y6=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=ZZ(this.transform.groupby.concat(e),e=>e)}dependentFields(){let e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach(t=>e.add(t.field)),this.transform.window.map(e=>e.field).filter(e=>e!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??Q(e)}hash(){return`WindowTransform ${GZ(this.transform)}`}assemble(){let e=[],t=[],n=[],r=[];for(let i of this.transform.window)t.push(i.op),n.push(this.getDefaultName(i)),r.push(i.param===void 0?null:i.param),e.push(i.field===void 0?null:i.field);let i=this.transform.frame,a=this.transform.groupby;if(i&&i[0]===null&&i[1]===null&&t.every(e=>GQ(e)))return{type:`joinaggregate`,as:n,ops:t,fields:e,...a===void 0?{}:{groupby:a}};let o=[],s=[];if(this.transform.sort!==void 0)for(let e of this.transform.sort)o.push(e.field),s.push(e.order??`ascending`);let c={field:o,order:s},l=this.transform.ignorePeers;return{type:`window`,params:r,as:n,ops:t,fields:e,sort:c,...l===void 0?{}:{ignorePeers:l},...a===void 0?{}:{groupby:a},...i===void 0?{}:{frame:i}}}},X6=`scale_`,Z6=5,Q6=class e{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}signal;static fromName(t,n){return new e(()=>t(n))}},nBe=[`type`,`clipAngle`,`clipExtent`,`center`,`rotate`,`precision`,`reflectX`,`reflectY`,`coefficient`,`distance`,`fraction`,`lobes`,`parallel`,`radius`,`ratio`,`spacing`,`tilt`],$6=class extends K3{specifiedProjection;size;data;merged=!1;constructor(e,t,n,r){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=r}get isFit(){return!!this.data}},e8=class extends K3{merged=!1;constructor(e,t){super({},{name:e}),this.setWithExplicit(`type`,t)}domainHasZero(){let e=this.get(`type`);if(qZ([$4.LOG,$4.TIME,$4.UTC],e))return`definitely-not`;let t=this.get(`zero`);if(t===!0||t===void 0&&qZ([$4.LINEAR,$4.SQRT,$4.POW],e))return`definitely`;let n=this.get(`domains`);if(n.length>0){let e=!1,t=!1,r=!1;for(let i of n){if(H(i)){let n=i[0],r=i[i.length-1];if(Wh(n)&&Wh(r))if(n<=0&&r>=0){e=!0;continue}else{t=!0;continue}}r=!0}if(e)return`definitely`;if(t&&!r)return`definitely-not`}return`maybe`}},rBe=[`range`,`scheme`],t8=.95,n8={bins:({model:e,fieldOrDatumDef:t})=>Z(t)?pIe(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>mIe(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:a})=>hIe(e,t,n,r,i,a),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>gIe(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:a})=>_Ie(e,t,n.type,r,i.scale,a),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:a})=>vIe(e,t,n,r,i.scale,a),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>yIe(t,Z(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:a,hasSecondaryRangeChannel:o})=>bIe(e,t,n,r,i,a.scale,o)},iBe=ZMe((e,t)=>uAe(e)-uAe(t)),r8=class{nameMap;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}},i8=class{type;parent;config;name;size;title;description;data;transforms;layout;scaleNameMap;projectionNameMap;signalNameMap;component;view;constructor(e,t,n,r,i,a,o){this.type=t,this.parent=n,this.config=i,this.parent=n,this.config=i,this.view=e$(o),this.name=e.name??r,this.title=n$(e.title)?{text:e.title}:e.title?e$(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new r8,this.projectionNameMap=n?n.projectionNameMap:new r8,this.signalNameMap=n?n.signalNameMap:new r8,this.data=e.data,this.description=e.description,this.transforms=zMe(e.transform??[]),this.layout=t===`layer`||t===`unit`?{}:Vje(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:b1(e)||n?.component.data.isFaceted&&e.data===void 0},layoutSize:new K3,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...a?F2(a):{}},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(){CIe(this)}parseProjection(){BFe(this)}renameTopLevelLayoutSizeSignal(){this.getName(`width`)!==`width`&&this.renameSignal(this.getName(`width`),`width`),this.getName(`height`)!==`height`&&this.renameSignal(this.getName(`height`),`height`)}parseLegends(){GPe(this)}assembleEncodeFromView(e){let{style:t,...n}=e,r={};for(let e of $(n)){let t=n[e];t!==void 0&&(r[e]=u$(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),!e&&(this.description&&(t.description=u$(this.description)),this.type===`unit`||this.type===`layer`)?{width:this.getSizeSignalRef(`width`),height:this.getSizeSignalRef(`height`),...t}:nQ(t)?void 0:t}assembleLayout(){if(!this.layout)return;let{spacing:e,...t}=this.layout,{component:n,config:r}=this,i=SPe(n.layoutHeaders,r);return{padding:e,...this.assembleDefaultLayout(),...t,...i?{titleBand:i}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){let{layoutHeaders:e}=this.component,t=[];for(let n of D4)e[n].title&&t.push(hPe(this,n));for(let e of A6)t=t.concat(vPe(this,e));return t}assembleAxes(){return QNe(this.component.axes,this.config)}assembleLegends(){return FFe(this)}assembleProjections(){return LFe(this)}assembleTitle(){let{encoding:e,...t}=this.title??{},n={...t$(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(n.text)return qZ([`unit`,`layer`],this.type)?qZ([`middle`,void 0],n.anchor)&&(n.frame??=`group`):n.anchor??=`start`,nQ(n)?void 0:n}assembleGroup(e=[]){let t={};e=e.concat(this.assembleSignals()),e.length>0&&(t.signals=e);let n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());let r=!this.parent||w2(this.parent)?GFe(this):[];r.length>0&&(t.scales=r);let i=this.assembleAxes();i.length>0&&(t.axes=i);let a=this.assembleLegends();return a.length>0&&(t.legends=a),t}getName(e){return aQ((this.name?`${this.name}_`:``)+e)}getDataName(e){return this.getName(q3[e].toLowerCase())}requestDataName(e){let t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(w2(this.parent)){let t=RQ(EPe(e)),n=this.component.scales[t];if(n&&!n.merged){let e=n.get(`type`),r=n.get(`range`);if(Z$(e)&&i$(r)){let e=n.get(`name`),r=b2(x2(this,t));return r?{signal:TPe(e,n,Q({aggregate:`distinct`,field:r},{expr:`datum`}))}:(X(E$(t)),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){let 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(kQ(e)&&VQ(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 Error(`getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().`);let t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){let t=this.getScaleComponent(e);return t?t.get(`type`):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw Error(LOe(t));return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some(e=>e.hasOrientSignalRef())||this.component.axes.y?.some(e=>e.hasOrientSignalRef())}},a8=class extends i8{vgField(e,t={}){let n=this.fieldDef(e);if(n)return Q(n,t)}reduceFieldDef(e,t){return _je(this.getMapping(),(t,n,r)=>{let i=B1(n);return i?e(t,i,r):t},t)}forEachFieldDef(e,t){Q1(this.getMapping(),(t,n)=>{let r=B1(t);r&&e(r,n)},t)}},o8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=F2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??`value`,n[1]??`density`];let r=this.transform.resolve??`shared`;this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${GZ(this.transform)}`}assemble(){let{density:e,...t}=this.transform,n={type:`kde`,field:e,...t};return n.resolve=this.transform.resolve,n}},s8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=F2(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${GZ(this.transform)}`}assemble(){let{extent:e,param:t}=this.transform;return{type:`extent`,field:e,signal:t}}},c8=class e extends J3{transform;clone(){return new e(this.parent,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=F2(t);let{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map((e,t)=>r[t]??e)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${GZ(this.transform)}`}assemble(){let{flatten:e,as:t}=this.transform;return{type:`flatten`,fields:e,as:t}}},l8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=F2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??`key`,n[1]??`value`]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${GZ(this.transform)}`}assemble(){let{fold:e,as:t}=this.transform;return{type:`fold`,fields:e,as:t}}},u8=class e extends J3{fields;geojson;signal;clone(){return new e(null,F2(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(let i of[[e4,$2],[n4,t4]]){let a=i.map(e=>{let t=V1(n.encoding[e]);return Z(t)?t.field:D1(t)?{expr:`${t.datum}`}:M1(t)?{expr:`${t.value}`}:void 0});(a[0]||a[1])&&(t=new e(t,a,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(s4)){let i=n.typedFieldDef(s4);i.type===Q4&&(t=new e(t,null,i.field,n.getName(`geojson_${r}`)))}return t}constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}dependentFields(){let e=(this.fields??[]).filter(qh);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${GZ(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}]}},d8=class e extends J3{projection;fields;as;clone(){return new e(null,this.projection,F2(this.fields),F2(this.as))}constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(let r of[[e4,$2],[n4,t4]]){let i=r.map(e=>{let t=V1(n.encoding[e]);return Z(t)?t.field:D1(t)?{expr:`${t.datum}`}:M1(t)?{expr:`${t.value}`}:void 0}),a=r[0]===n4?`2`:``;(i[0]||i[1])&&(t=new e(t,n.projectionName(),i,[n.getName(`x${a}`),n.getName(`y${a}`)]))}return t}dependentFields(){return new Set(this.fields.filter(qh))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${GZ(this.fields)} ${GZ(this.as)}`}assemble(){return{type:`geopoint`,projection:this.projection,fields:this.fields,as:this.as}}},f8=class e extends J3{transform;clone(){return new e(null,F2(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){let{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(`,`)})`}}static makeFromTransform(t,n){return new e(t,n)}static makeFromEncoding(t,n){let r=n.encoding,i=r.x,a=r.y;if(Z(i)&&Z(a)){let o=i.impute?i:a.impute?a:void 0;if(o===void 0)return;let s=i.impute?a:a.impute?i:void 0,{method:c,value:l,frame:u,keyvals:d}=o.impute,f=vje(n.mark,r);return new e(t,{impute:o.field,key:s.field,...c?{method:c}:{},...l===void 0?{}:{value:l},...u?{frame:u}:{},...d===void 0?{}:{keyvals:d},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${GZ(this.transform)}`}assemble(){let{impute:e,key:t,keyvals:n,method:r,groupby:i,value:a,frame:o=[null,null]}=this.transform,s={type:`impute`,field:e,key:t,...n?{keyvals:vMe(n)?this.processSequence(n):n}:{},method:`value`,...i?{groupby:i}:{},value:!r||r===`value`?a:null};return r&&r!==`value`?[s,{type:`window`,as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:o,ignorePeers:!1,...i?{groupby:i}:{}},{type:`formula`,expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]:[s]}},p8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=F2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[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 ${GZ(this.transform)}`}assemble(){let{loess:e,on:t,...n}=this.transform;return{type:`loess`,x:t,y:e,...n}}},m8=class e extends J3{transform;secondary;clone(){return new e(null,F2(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(t,n,r,i){let a=n.component.data.sources,{from:o}=r,s=null;if(bMe(o)){let e=BIe(o.data,a);e||(e=new H6(o.data),a.push(e));let t=n.getName(`lookup_${i}`);s=new Y3(e,t,q3.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[t]=s}else if(xMe(o)){let e=o.param;r={as:e,...r};let t;try{t=n.getSelectionComponent(aQ(e),e)}catch{throw Error(ROe(e))}if(s=t.materialized,!s)throw Error(zOe(e))}return new e(t,r,s.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?_h(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${GZ({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:_h(this.transform.as)}:{}};else{let t=this.transform.as;qh(t)||(X(gRe),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}:{}}}},h8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=F2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??`prob`,n[1]??`value`]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${GZ(this.transform)}`}assemble(){let{quantile:e,...t}=this.transform;return{type:`quantile`,field:e,...t}}},g8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=F2(t);let n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[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 ${GZ(this.transform)}`}assemble(){let{regression:e,on:t,...n}=this.transform;return{type:`regression`,x:t,y:e,...n}}},_8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=ZZ((this.transform.groupby??[]).concat(e),e=>e)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${GZ(this.transform)}`}assemble(){let{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return{type:`pivot`,field:e,value:t,...r===void 0?{}:{limit:r},...i===void 0?{}:{op:i},...n===void 0?{}:{groupby:n}}}},v8=class e extends J3{transform;clone(){return new e(null,F2(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${GZ(this.transform)}`}assemble(){return{type:`sample`,size:this.transform.sample}}},aBe=class e extends a8{facet;child;children;constructor(e,t,n,r){super(e,`facet`,t,n,r,e.resolve),this.child=P2(e.spec,this,this.getName(`child`),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!v1(e))return{facet:this.initFacetFieldDef(e,`facet`)};let t=$(e),n={};for(let r of t){if(![B2,V2].includes(r)){X(A$(r,`facet`));break}let t=e[r];if(t.field===void 0){X(k$(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){let n=U1(e,t);return n.header?n.header=e$(n.header):n.header===null&&(n.header=null),n}channelHasField(e){return Y(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=A2(this),this.child.parseData()}parseLayoutSize(){D2(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,I2(this.component.selection).some(e=>J0(e))&&N$(z4)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),jIe(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){let e={};for(let t of D4)for(let n of j6){let r=this.component.layoutHeaders[t],i=r[n],{facetFieldDef:a}=r;if(a){let n=r2(`titleOrient`,a.header,this.config,t);if([`right`,`bottom`].includes(n)){let r=n2(t,n);e.titleAnchor??={},e.titleAnchor[r]=`end`}}if(i?.[0]){let i=t===`row`?`height`:`width`,a=n===`header`?`headerBand`:`footerBand`;t!==`facet`&&!this.child.component.layoutSize.get(i)&&(e[a]??={},e[a][t]=.5),r.title&&(e.offset??={},e.offset[t===`row`?`rowTitle`:`columnTitle`]=10)}}return e}assembleDefaultLayout(){let{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0,r=`all`;return(!t&&this.component.resolve.scale.x===`independent`||!e&&this.component.resolve.scale.y===`independent`)&&(r=`none`),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:`full`,align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof e))return{signal:`length(data('${this.getName(`column_domain`)}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof e?{...this.channelHasField(`column`)?{encode:{update:{columns:{field:Q(this.facet.column,{prefix:`distinct`})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){let t=[],n=[],r=[];if(this.child instanceof e){if(this.child.channelHasField(`column`)){let e=Q(this.child.facet.column);t.push(e),n.push(`distinct`),r.push(`distinct_${e}`)}}else for(let e of j4){let i=this.child.component.scales[e];if(i&&!i.merged){let a=i.get(`type`),o=i.get(`range`);if(Z$(a)&&i$(o)){let i=b2(x2(this.child,e));i?(t.push(i),n.push(`distinct`),r.push(`distinct_${i}`)):X(E$(e))}}}return{fields:t,ops:n,as:r}}assembleFacet(){let{name:e,data:t}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:a,as:o}=this.getCardinalityAggregateForChild(),s=[];for(let e of D4){let t=this.facet[e];if(t){s.push(Q(t));let{bin:c,sort:l}=t;if(JQ(c)&&s.push(Q(t,{binSuffix:`end`})),_1(l)){let{field:e,op:s=b3}=l,c=k2(t,l);n&&r?(i.push(c),a.push(`max`),o.push(c)):(i.push(e),a.push(s),o.push(c))}else if(H(l)){let n=t2(t,e);i.push(n),a.push(`max`),o.push(n)}}}let c=!!n&&!!r;return{name:e,data:t,groupby:s,...c||i.length>0?{aggregate:{...c?{cross:c}:{},...i.length?{fields:i,ops:a,as:o}:{}}}:{}}}facetSortFields(e){let{facet:t}=this,n=t[e];return n?_1(n.sort)?[k2(n,n.sort,{expr:`datum`})]:H(n.sort)?[t2(n,e,{expr:`datum`})]:[Q(n,{expr:`datum`})]:[]}facetSortOrder(e){let{facet:t}=this,n=t[e];if(n){let{sort:e}=n;return[(_1(e)?e.order:!H(e)&&e)||`ascending`]}return[]}assembleLabelTitle(){let{facet:e,config:t}=this;if(e.facet)return a2(e.facet,`facet`,t);let n={row:[`top`,`bottom`],column:[`left`,`right`]};for(let r of A6)if(e[r]){let i=r2(`labelOrient`,e[r]?.header,t,r);if(n[r].includes(i))return a2(e[r],r,t)}}assembleMarks(){let{child:e}=this,t=this.component.data.facetRoot,n=OIe(t),r=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),a=e.assembleGroupStyle();return[{name:this.getName(`cell`),type:`group`,...i?{title:i}:{},...a?{style:a}:{},from:{facet:this.assembleFacet()},sort:{field:D4.map(e=>this.facetSortFields(e)).flat(),order:D4.map(e=>this.facetSortOrder(e)).flat()},...n.length>0?{data:n}:{},...r?{encode:{update:r}}:{},...e.assembleGroup(lNe(this,[]))}]}getMapping(){return this.facet}},oBe=class extends i8{children;constructor(e,t,n,r){super(e,`concat`,t,n,r,e.resolve),(e.resolve?.axis?.x===`shared`||e.resolve?.axis?.y===`shared`)&&X(mRe),this.children=this.getChildren(e).map((e,t)=>P2(e,this,this.getName(`concat_${t}`),void 0,r))}parseData(){this.component.data=A2(this);for(let e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(let e of this.children){e.parseSelections();for(let t of $(e.component.selection))this.component.selection[t]=e.component.selection[t]}I2(this.component.selection).some(e=>J0(e))&&N$(z4)}parseMarkGroup(){for(let e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(let e of this.children)e.parseAxesAndHeaders()}getChildren(e){return c0(e)?e.vconcat:l0(e)?e.hconcat:e.concat}parseLayoutSize(){IIe(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){let e=o2(this);for(let t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{let t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return{type:`group`,name:e.getName(`group`),...t?{title:t}:{},...n?{style:n}:{},...r?{encode:{update:r}}:{},...e.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){let e=this.layout.columns;return{...e==null?{}:{columns:e},bounds:`full`,align:`each`}}},y8=$({disable:1,gridScale:1,scale:1,...E3,labelExpr:1,encode:1}),sBe=class e extends K3{explicit;implicit;mainExtracted;constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new e(F2(this.explicit),F2(this.implicit),this.mainExtracted)}hasAxisPart(e){return e===`axis`?!0:e===`grid`||e===`title`?!!this.get(e):!UIe(this.get(e))}hasOrientSignalRef(){return r$(this.explicit.orient)}},cBe={bottom:`top`,top:`bottom`,left:`right`,right:`left`},lBe=new Set([`grid`,`translate`,`format`,`formatType`,`orient`,`labelExpr`,`tickCount`,`position`,`tickMinStep`]),uBe={vgMark:`arc`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`ignore`,orient:`ignore`,theta:`ignore`}),...z0(`x`,e,{defaultPos:`mid`}),...z0(`y`,e,{defaultPos:`mid`}),...U0(e,`radius`),...U0(e,`theta`)})},dBe={vgMark:`area`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`include`,size:`ignore`,theta:`ignore`}),...V0(`x`,e,{defaultPos:`zeroOrMin`,defaultPos2:`zeroOrMin`,range:e.markDef.orient===`horizontal`}),...V0(`y`,e,{defaultPos:`zeroOrMin`,defaultPos2:`zeroOrMin`,range:e.markDef.orient===`vertical`}),...G0(e)})},fBe={vgMark:`rect`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...U0(e,`x`),...U0(e,`y`)})},pBe={vgMark:`shape`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`ignore`,orient:`ignore`,theta:`ignore`})}),postEncodingTransform:e=>{let{encoding:t}=e,n=t.shape;return[{type:`geoshape`,projection:e.projectionName(),...n&&Z(n)&&n.type===Q4?{field:Q(n,{expr:`datum`})}:{}}]}},mBe={vgMark:`image`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`ignore`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...U0(e,`x`),...U0(e,`y`),...F0(e,`url`)})},hBe={vgMark:`line`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`ignore`,orient:`ignore`,theta:`ignore`}),...z0(`x`,e,{defaultPos:`mid`}),...z0(`y`,e,{defaultPos:`mid`}),...L0(`size`,e,{vgChannel:`strokeWidth`}),...G0(e)})},gBe={vgMark:`trail`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,size:`include`,orient:`ignore`,theta:`ignore`}),...z0(`x`,e,{defaultPos:`mid`}),...z0(`y`,e,{defaultPos:`mid`}),...L0(`size`,e),...G0(e)})},_Be={vgMark:`symbol`,encodeEntry:e=>M2(e)},vBe={vgMark:`symbol`,encodeEntry:e=>M2(e,`circle`)},yBe={vgMark:`symbol`,encodeEntry:e=>M2(e,`square`)},bBe={vgMark:`rect`,encodeEntry:e=>({...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...U0(e,`x`),...U0(e,`y`)})},xBe={vgMark:`rule`,encodeEntry:e=>{let{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...V0(`x`,e,{defaultPos:n===`horizontal`?`zeroOrMax`:`mid`,defaultPos2:`zeroOrMin`,range:n!==`vertical`}),...V0(`y`,e,{defaultPos:n===`vertical`?`zeroOrMax`:`mid`,defaultPos2:`zeroOrMin`,range:n!==`horizontal`}),...L0(`size`,e,{vgChannel:`strokeWidth`})}}},SBe={vgMark:`text`,encodeEntry:e=>{let{config:t,encoding:n}=e;return{...W0(e,{align:`include`,baseline:`include`,color:`include`,size:`ignore`,orient:`ignore`,theta:`include`}),...z0(`x`,e,{defaultPos:`mid`}),...z0(`y`,e,{defaultPos:`mid`}),...F0(e),...L0(`size`,e,{vgChannel:`fontSize`}),...L0(`angle`,e),...RNe(`align`,$Ie(e.markDef,n,t)),...RNe(`baseline`,eLe(e.markDef,n,t)),...z0(`radius`,e,{defaultPos:null}),...z0(`theta`,e,{defaultPos:null})}}},b8={arc:uBe,area:dBe,bar:fBe,circle:vBe,geoshape:pBe,image:mBe,line:hBe,point:_Be,rect:bBe,rule:xBe,square:yBe,text:SBe,tick:{vgMark:`rect`,encodeEntry:e=>{let{config:t,markDef:n}=e,r=n.orient,i=r===`horizontal`?`x`:`y`,a=r===`horizontal`?`y`:`x`,o=r===`horizontal`?`height`:`width`;return{...W0(e,{align:`ignore`,baseline:`ignore`,color:`include`,orient:`ignore`,size:`ignore`,theta:`ignore`}),...U0(e,i),...z0(a,e,{defaultPos:`mid`,vgChannel:a===`y`?`yc`:`xc`}),[o]:u$(m$(`thickness`,n,t))}}},trail:gBe},x8=`faceted_path_`,S8=`stack_group_`,C8=class extends a8{markDef;encoding;specifiedScales={};stack;specifiedAxes={};specifiedLegends={};specifiedProjection={};selection=[];children=[];constructor(e,t,n,r={},i){super(e,`unit`,t,n,i,void 0,Bje(e)?e.view:void 0);let a=i1(e.mark)?{...e.mark}:{type:e.mark},o=a.type;a.filled===void 0&&(a.filled=oMe(a,i,{graticule:e.data&&O0(e.data)}));let s=this.encoding=hje(e.encoding||{},o,a.filled,i);this.markDef=rMe(a,s,i),this.size=ZIe({encoding:s,size:Bje(e)?{...r,...e.width===void 0?{}:{width:e.width},...e.height===void 0?{}:{height:e.height}}:r}),this.stack=nMe(this.markDef,s),this.specifiedScales=this.initScales(o,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter(e=>o0(e)),this.alignStackOrderWithColorDomain()}get hasProjection(){let{encoding:e}=this,t=this.mark===h3,n=e&&pLe.some(t=>A1(e[t]));return t||n}scaleDomain(e){let 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 I4.reduce((e,n)=>{let r=V1(t[n]);return r&&(e[n]=this.initScale(r.scale??{})),e},{})}initScale(e){let{domain:t,range:n}=e,r=e$(e);return H(t)&&(r.domain=t.map(c$)),H(n)&&(r.range=n.map(c$)),r}initAxes(e){return j4.reduce((t,n)=>{let r=e[n];if(A1(r)||n===U2&&A1(e.x2)||n===W2&&A1(e.y2)){let e=A1(r)?r.axis:void 0;t[n]=e&&this.initAxis({...e})}return t},{})}initAxis(e){let t=$(e),n={};for(let r of t){let t=e[r];n[r]=J1(t)?s$(t):c$(t)}return n}initLegends(e){return XLe.reduce((t,n)=>{let r=V1(e[n]);if(r&&OOe(n)){let e=r.legend;t[n]=e&&e$(e)}return t},{})}alignStackOrderWithColorDomain(){let{color:e,fill:t,order:n,xOffset:r,yOffset:i}=this.encoding,a=t||e,o=Z(a)?a:void 0,s=o?.field,c=o?.scale,l=o?.type,u=c?.domain,d=r||i,f=Z(d)?d:void 0,p=`_${s}_sort_index`;if(!n&&Array.isArray(u)&&typeof s==`string`&&l===`nominal`)if(f&&!f.sort)f.sort=u;else{if(!this.stack)return;let e=`indexof(${W(u)}, datum['${s}'])`,t=this.markDef?.orient===`horizontal`?`ascending`:`descending`;this.transforms.push({calculate:e,as:p}),this.encoding.order={field:p,type:`quantitative`,sort:t}}}parseData(){this.component.data=A2(this)}parseLayoutSize(){LIe(this)}parseSelections(){this.component.selection=KNe(this,this.selection)}parseMarkGroup(){this.component.mark=tLe(this)}parseAxesAndHeaders(){this.component.axes=GIe(this)}assembleSelectionTopLevelSignals(e){return uNe(this,e)}assembleSignals(){return[...ZNe(this),...cNe(this,[])]}assembleSelectionData(e){return dNe(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return o2(this)}correctDataNames=e=>(e.from?.data&&(e.from.data=this.lookupDataSource(e.from.data),`time`in this.encoding&&(e.from.data=e.from.data+e6)),e.from?.facet?.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e);assembleMarks(){let e=this.component.mark??[];return(!this.parent||!E2(this.parent))&&(e=fNe(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){let{style:e}=this.view||{};return e===void 0?this.encoding.x||this.encoding.y?`cell`:`view`:e}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return X1(this.encoding,e)}fieldDef(e){let t=this.encoding[e];return B1(t)}typedFieldDef(e){let t=this.fieldDef(e);return j1(t)?t:null}},CBe=class e extends i8{children;constructor(t,n,r,i,a){super(t,`layer`,n,r,a,t.resolve,t.view);let o={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((t,n)=>{if(m0(t))return new e(t,this,this.getName(`layer_${n}`),o,a);if(Y1(t))return new C8(t,this,this.getName(`layer_${n}`),o,a);throw Error(S$(t))})}parseData(){this.component.data=A2(this);for(let e of this.children)e.parseData()}parseLayoutSize(){FIe(this)}parseSelections(){this.component.selection={};for(let e of this.children){e.parseSelections();for(let t of $(e.component.selection))this.component.selection[t]=e.component.selection[t]}I2(this.component.selection).some(e=>J0(e))&&N$(z4)}parseMarkGroup(){for(let e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){KIe(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),ZNe(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),o2(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleGroupStyle(){let e=new Set;for(let t of this.children)for(let n of _h(t.assembleGroupStyle()))e.add(n);let 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(let t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return pNe(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),FFe(this))}},wBe=dLe.version}));function EBe(e){let[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var DBe=o((()=>{})),OBe=c({carbong10:()=>sVe,carbong100:()=>lVe,carbong90:()=>cVe,carbonwhite:()=>oVe,dark:()=>ABe,excel:()=>jBe,fivethirtyeight:()=>PBe,ggplot2:()=>FBe,googlecharts:()=>qBe,latimes:()=>zBe,powerbi:()=>nVe,quartz:()=>BBe,urbaninstitute:()=>KBe,version:()=>uVe,vox:()=>VBe});function w8({theme:e,background:t}){let n=[`white`,`g10`].includes(e)?`light`:`dark`,r=f5.gridBg[e],i=f5.textPrimary[e],a=f5.textSecondary[e],o=n===`dark`?iVe:aVe,s=n===`dark`?`#d4bbff`:`#6929c4`;return{background:t,arc:{fill:s},area:{fill:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{stroke:s},circle:{fill:s},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:`start`,dy:-15,fontSize:16,font:u5,fontWeight:600},axis:{labelColor:a,labelFontSize:12,labelFont:rVe,labelFontWeight:d5,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:f5.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:u5,fill:a,fontWeight:d5},"guide-title":{font:u5,fill:a,fontWeight:d5}},range:{category:o,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`]}}}var kBe,T8,E8,ABe,D8,jBe,O8,k8,MBe,NBe,A8,j8,PBe,M8,FBe,IBe,LBe,N8,P8,RBe,F8,I8,L8,R8,z8,zBe,B8,V8,BBe,H8,VBe,U8,W8,HBe,G8,K8,UBe,WBe,GBe,q8,KBe,J8,Y8,X8,qBe,Z8,Q8,$8,e5,t5,n5,r5,i5,a5,JBe,o5,YBe,XBe,ZBe,QBe,$Be,eVe,tVe,s5,c5,l5,nVe,u5,rVe,d5,f5,iVe,aVe,oVe,sVe,cVe,lVe,uVe,dVe=o((()=>{kBe={version:`3.0.0`},T8=`#fff`,E8=`#888`,ABe={background:`#333`,view:{stroke:E8},title:{color:T8,subtitleColor:T8},style:{"guide-label":{fill:T8},"guide-title":{fill:T8}},axis:{domainColor:T8,gridColor:E8,tickColor:T8}},D8=`#4572a7`,jBe={background:`#fff`,arc:{fill:D8},area:{fill:D8},line:{stroke:D8,strokeWidth:2},path:{stroke:D8},rect:{fill:D8},shape:{stroke:D8},symbol:{fill:D8,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`]}},O8=`#30a2da`,k8=`#cbcbcb`,MBe=`#999`,NBe=`#333`,A8=`#f0f0f0`,j8=`#333`,PBe={arc:{fill:O8},area:{fill:O8},axis:{domainColor:k8,grid:!0,gridColor:k8,gridWidth:1,labelColor:MBe,labelFontSize:10,titleColor:NBe,tickColor:k8,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:A8,group:{fill:A8},legend:{labelColor:j8,labelFontSize:11,padding:1,symbolSize:30,symbolType:`square`,titleColor:j8,titleFontSize:14,titlePadding:10},line:{stroke:O8,strokeWidth:2},path:{stroke:O8,strokeWidth:.5},rect:{fill:O8},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:O8},bar:{binSpacing:2,fill:O8,stroke:null},title:{anchor:`start`,fontSize:24,fontWeight:600,offset:20}},M8=`#000`,FBe={group:{fill:`#e5e5e5`},arc:{fill:M8},area:{fill:M8},line:{stroke:M8},path:{stroke:M8},rect:{fill:M8},shape:{stroke:M8},symbol:{fill:M8,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`]}},IBe=22,LBe=`normal`,N8=`Benton Gothic, sans-serif`,P8=11.5,RBe=`normal`,F8=`#82c6df`,I8=`Benton Gothic Bold, sans-serif`,L8=`normal`,R8=13,z8={"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`]},zBe={background:`#ffffff`,title:{anchor:`start`,color:`#000000`,font:I8,fontSize:IBe,fontWeight:LBe},arc:{fill:F8},area:{fill:F8},line:{stroke:F8,strokeWidth:2},path:{stroke:F8},rect:{fill:F8},shape:{stroke:F8},symbol:{fill:F8,size:30},axis:{labelFont:N8,labelFontSize:P8,labelFontWeight:RBe,titleFont:I8,titleFontSize:R8,titleFontWeight:L8},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:N8,labelFontSize:P8,symbolType:`square`,titleFont:I8,titleFontSize:R8,titleFontWeight:L8},range:{category:z8[`category-6`],diverging:z8[`fireandice-6`],heatmap:z8[`fire-7`],ordinal:z8[`fire-7`],ramp:z8[`fire-7`]}},B8=`#ab5787`,V8=`#979797`,BBe={background:`#f9f9f9`,arc:{fill:B8},area:{fill:B8},line:{stroke:B8},path:{stroke:B8},rect:{fill:B8},shape:{stroke:B8},symbol:{fill:B8,size:30},axis:{domainColor:V8,domainWidth:.5,gridWidth:.2,labelColor:V8,tickColor:V8,tickWidth:.2,titleColor:V8},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`]}},H8=`#3e5c69`,VBe={background:`#fff`,arc:{fill:H8},area:{fill:H8},line:{stroke:H8},path:{stroke:H8},rect:{fill:H8},shape:{stroke:H8},symbol:{fill:H8},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`]}},U8=`#1696d2`,W8=`#000000`,HBe=`#FFFFFF`,G8=`Lato`,K8=`Lato`,UBe=`Lato`,WBe=`#DEDDDD`,GBe=18,q8={"shades-blue":[`#CFE8F3`,`#A2D4EC`,`#73BFE2`,`#46ABDB`,`#1696D2`,`#12719E`,`#0A4C6A`,`#062635`],"six-groups-cat-1":[`#1696d2`,`#ec008b`,`#fdbf11`,`#000000`,`#d2d2d2`,`#55b748`],"six-groups-seq":[`#cfe8f3`,`#a2d4ec`,`#73bfe2`,`#46abdb`,`#1696d2`,`#12719e`],"diverging-colors":[`#ca5800`,`#fdbf11`,`#fdd870`,`#fff2cf`,`#cfe8f3`,`#73bfe2`,`#1696d2`,`#0a4c6a`]},KBe={background:HBe,title:{anchor:`start`,fontSize:GBe,font:G8},axisX:{domain:!0,domainColor:W8,domainWidth:1,grid:!1,labelFontSize:12,labelFont:K8,labelAngle:0,tickColor:W8,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:G8},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:WBe,gridWidth:1,labelFontSize:12,labelFont:K8,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:G8,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:K8,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:G8,orient:`right`,offset:10},view:{stroke:`transparent`},range:{category:q8[`six-groups-cat-1`],diverging:q8[`diverging-colors`],heatmap:q8[`diverging-colors`],ordinal:q8[`six-groups-seq`],ramp:q8[`shades-blue`]},area:{fill:U8},rect:{fill:U8},line:{color:U8,stroke:U8,strokeWidth:5},trail:{color:U8,stroke:U8,strokeWidth:0,size:1},path:{stroke:U8,strokeWidth:.5},point:{filled:!0},text:{font:UBe,color:U8,fontSize:11,align:`center`,fontWeight:400,size:11},style:{bar:{fill:U8,stroke:null}},arc:{fill:U8},shape:{stroke:U8},symbol:{fill:U8,size:30}},J8=`#3366CC`,Y8=`#ccc`,X8=`Arial, sans-serif`,qBe={arc:{fill:J8},area:{fill:J8},path:{stroke:J8},rect:{fill:J8},shape:{stroke:J8},symbol:{stroke:J8},circle:{fill:J8},background:`#fff`,padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:X8,fontSize:12},"guide-title":{font:X8,fontSize:12},"group-title":{font:X8,fontSize:12}},title:{font:X8,fontSize:14,fontWeight:`bold`,dy:-3,anchor:`start`},axis:{gridColor:Y8,tickColor:Y8,domain:!1,grid:!0},range:{category:[`#4285F4`,`#DB4437`,`#F4B400`,`#0F9D58`,`#AB47BC`,`#00ACC1`,`#FF7043`,`#9E9D24`,`#5C6BC0`,`#F06292`,`#00796B`,`#C2185B`],heatmap:[`#c6dafc`,`#5e97f6`,`#2a56c6`]}},Z8=e=>e*1.3333333333333333,Q8=Z8(9),$8=Z8(10),e5=Z8(12),t5=`Segoe UI`,n5=`wf_standard-font, helvetica, arial, sans-serif`,r5=`#252423`,i5=`#605E5C`,a5=`transparent`,JBe=`#C8C6C4`,o5=`#118DFF`,YBe=`#12239E`,XBe=`#E66C37`,ZBe=`#6B007B`,QBe=`#E044A7`,$Be=`#744EC2`,eVe=`#D9B300`,tVe=`#D64550`,s5=o5,c5=`#DEEFFF`,l5=[c5,s5],nVe={view:{stroke:a5},background:a5,font:t5,header:{titleFont:n5,titleFontSize:e5,titleColor:r5,labelFont:t5,labelFontSize:$8,labelColor:i5},axis:{ticks:!1,grid:!1,domain:!1,labelColor:i5,labelFontSize:Q8,titleFont:n5,titleColor:r5,titleFontSize:e5,titleFontWeight:`normal`},axisQuantitative:{tickCount:3,grid:!0,gridColor:JBe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:o5},line:{stroke:o5,strokeWidth:3,strokeCap:`round`,strokeJoin:`round`},text:{font:t5,fontSize:Q8,fill:i5},arc:{fill:o5},area:{fill:o5,line:!0,opacity:.6},path:{stroke:o5},rect:{fill:o5},point:{fill:o5,filled:!0,size:75},shape:{stroke:o5},symbol:{fill:o5,strokeWidth:1.5,size:50},legend:{titleFont:t5,titleFontWeight:`bold`,titleColor:i5,labelFont:t5,labelFontSize:$8,labelColor:i5,symbolType:`circle`,symbolSize:75},range:{category:[o5,YBe,XBe,ZBe,QBe,$Be,eVe,tVe],diverging:l5,heatmap:l5,ordinal:[c5,`#c7e4ff`,`#b0d9ff`,`#9aceff`,`#83c3ff`,`#6cb9ff`,`#55aeff`,`#3fa3ff`,`#2898ff`,s5]}},u5=`IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif`,rVe=`IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif`,d5=400,f5={textPrimary:{g90:`#f4f4f4`,g100:`#f4f4f4`,white:`#161616`,g10:`#161616`},textSecondary:{g90:`#c6c6c6`,g100:`#c6c6c6`,white:`#525252`,g10:`#525252`},layerAccent01:{white:`#e0e0e0`,g10:`#e0e0e0`,g90:`#525252`,g100:`#393939`},gridBg:{white:`#ffffff`,g10:`#ffffff`,g90:`#161616`,g100:`#161616`}},iVe=[`#8a3ffc`,`#33b1ff`,`#007d79`,`#ff7eb6`,`#fa4d56`,`#fff1f1`,`#6fdc8c`,`#4589ff`,`#d12771`,`#d2a106`,`#08bdba`,`#bae6ff`,`#ba4e00`,`#d4bbff`],aVe=[`#6929c4`,`#1192e8`,`#005d5d`,`#9f1853`,`#fa4d56`,`#570408`,`#198038`,`#002d9c`,`#ee538b`,`#b28600`,`#009d9a`,`#012749`,`#8a3800`,`#a56eff`],oVe=w8({theme:`white`,background:`#ffffff`}),sVe=w8({theme:`g10`,background:`#f4f4f4`}),cVe=w8({theme:`g90`,background:`#262626`}),lVe=w8({theme:`g100`,background:`#161616`}),uVe=kBe.version}));function fVe(e,t,n,r){if(H(e))return`[${e.map(e=>t(qh(e)?e:mVe(e,n))).join(`, `)}]`;if(Hm(e)){let i=``,{title:a,image:o,...s}=e;a&&(i+=`

${t(a)}

`),o&&(i+=``);let c=Object.keys(s);if(c.length>0){i+=``;for(let e of c){let r=s[e];r!==void 0&&(Hm(r)&&(r=mVe(r,n)),i+=``)}i+=`
${t(e)}${t(r)}
`}return i||`{}`}return t(e)}function pVe(e){let t=[];return function(n,r){if(typeof r!=`object`||!r)return r;let i=t.indexOf(this)+1;return t.length=i,t.length>e?`[Object]`:t.indexOf(r)>=0?`[Circular]`:(t.push(r),r)}}function mVe(e,t){return JSON.stringify(e,pVe(t))}function hVe(e){return String(e).replace(/&/g,`&`).replace(/=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function SVe(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}var CVe,wVe,p5,TVe,EVe,DVe=o((()=>{dg(),CVe={version:`1.0.0`},wVe=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -267,8 +255,8 @@ endobj #vg-tooltip-element.dark-theme td.key { color: #bfbfbf; } -`,C5=`vg-tooltip-element`,IVe={offsetX:10,offsetY:10,id:C5,styleId:`vega-tooltip-style`,theme:`light`,disableDefaultStyle:!1,sanitize:EVe,maxDepth:2,formatTooltip:CVe,baseURL:``,anchor:`cursor`,position:[`top`,`bottom`,`left`,`right`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]},LVe=class{call;options;el;constructor(e){this.options={...IVe,...e};let t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){let e=document.createElement(`style`);e.setAttribute(`id`,this.options.styleId),e.innerHTML=DVe(t);let n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){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)),r==null||r===``){this.el.classList.remove(`visible`,`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add(`visible`,`${this.options.theme}-theme`);let{x:i,y:a}=this.options.anchor===`mark`?kVe(e,t,n,this.el.getBoundingClientRect(),this.options):OVe(t,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${a}px`,this.el.style.left=`${i}px`}},PVe.version}));function w5(e,t){return SHe.call(e,t)}function T5(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function O5(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function zVe(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function k5(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&s[l-1]==`constructor`))throw 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(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!D5(f))throw new W5(`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`,a,t,e);else D5(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new W5(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=wHe[t.op].call(t,c,f,e);if(o.test===!1)throw new W5(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=G5[t.op].call(t,c,f,e);if(o.test===!1)throw new W5(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new W5('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new W5("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new W5("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&k5(e.value))throw new W5("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new W5("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new W5(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=HVe([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new W5(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function HVe(e,t,n){try{if(!Array.isArray(e))throw new W5(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)M5(E5(t),E5(e),n||!0);else{n||=N5;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function I5(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=T5(t),o=T5(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(w5(t,l)&&!(t[l]===void 0&&u!==void 0&&Array.isArray(t)===!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?I5(u,d,n,r+`/`+O5(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+O5(l),value:E5(u)}),n.push({op:`replace`,path:r+`/`+O5(l),value:E5(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+O5(l),value:E5(u)}),n.push({op:`remove`,path:r+`/`+O5(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(!(!s&&a.length==o.length))for(var c=0;c=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}return q5=e,q5}function L5(){if(kHe)return J5;kHe=1;let e=Object.freeze({loose:!0}),t=Object.freeze({});return J5=n=>n?typeof n==`object`?n:e:t,J5}function R5(){return AHe?X5:(AHe=1,X5={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},X5)}function z5(){return jHe?Z5:(jHe=1,Z5=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Z5)}function B5(){return MHe?Y5.exports:(MHe=1,(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=R5(),a=z5();t=e.exports={};let o=t.re=[],s=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})(Y5,Y5.exports),Y5.exports)}function ZVe(){if(NHe)return Q5;NHe=1;let e=/^[0-9]+$/,t=(t,n)=>{let r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:tt(n,e)},Q5}function V5(){if(PHe)return $5;PHe=1;let e=z5(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=R5(),{safeRe:r,t:i}=B5(),a=L5(),{compareIdentifiers:o}=ZVe();class s{constructor(o,c){if(c=a(c),o instanceof s){if(o.loose===!!c.loose&&o.includePrerelease===!!c.includePrerelease)return o;o=o.version}else if(typeof o!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);if(o.length>t)throw TypeError(`version is longer than ${t} characters`);e(`SemVer`,o,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=o.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!l)throw TypeError(`Invalid Version: ${o}`);if(this.raw=o,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>n||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>n||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>n||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),o(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}return $5=s,$5}function H5(){if(FHe)return e7;FHe=1;let e=V5();return e7=(t,n,r)=>new e(t,r).compare(new e(n,r)),e7}function QVe(){if(IHe)return t7;IHe=1;let e=H5();return t7=(t,n,r)=>e(t,n,r)===0,t7}function $Ve(){if(LHe)return n7;LHe=1;let e=H5();return n7=(t,n,r)=>e(t,n,r)!==0,n7}function eHe(){if(RHe)return r7;RHe=1;let e=H5();return r7=(t,n,r)=>e(t,n,r)>0,r7}function tHe(){if(zHe)return i7;zHe=1;let e=H5();return i7=(t,n,r)=>e(t,n,r)>=0,i7}function nHe(){if(BHe)return a7;BHe=1;let e=H5();return a7=(t,n,r)=>e(t,n,r)<0,a7}function rHe(){if(VHe)return o7;VHe=1;let e=H5();return o7=(t,n,r)=>e(t,n,r)<=0,o7}function iHe(){if(HHe)return s7;HHe=1;let e=QVe(),t=$Ve(),n=eHe(),r=tHe(),i=nHe(),a=rHe();return s7=(o,s,c,l)=>{switch(s){case`===`:return typeof o==`object`&&(o=o.version),typeof c==`object`&&(c=c.version),o===c;case`!==`:return typeof o==`object`&&(o=o.version),typeof c==`object`&&(c=c.version),o!==c;case``:case`=`:case`==`:return e(o,c,l);case`!=`:return t(o,c,l);case`>`:return n(o,c,l);case`>=`:return r(o,c,l);case`<`:return i(o,c,l);case`<=`:return a(o,c,l);default:throw TypeError(`Invalid operator: ${s}`)}},s7}function aHe(){if(UHe)return c7;UHe=1;let e=Symbol(`SemVer ANY`);class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(` `),o(`comparator`,r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value=``:this.value=this.operator+this.semver.version,o(`comp`,this)}parse(t){let n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],a=t.match(n);if(!a)throw TypeError(`Invalid comparator: ${t}`);this.operator=a[1]===void 0?``:a[1],this.operator===`=`&&(this.operator=``),a[2]?this.semver=new s(a[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(o(`Comparator.test`,t,this.options.loose),this.semver===e||t===e)return!0;if(typeof t==`string`)try{t=new s(t,this.options)}catch{return!1}return a(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new c(e.value,r).test(this.value):e.operator===``?e.value===``||new c(this.value,r).test(e.semver):(r=n(r),r.includePrerelease&&(this.value===`<0.0.0-0`||e.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||e.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&e.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&e.operator.startsWith(`<`)||this.semver.version===e.semver.version&&this.operator.includes(`=`)&&e.operator.includes(`=`)||a(this.semver,`<`,e.semver,r)&&this.operator.startsWith(`>`)&&e.operator.startsWith(`<`)||a(this.semver,`>`,e.semver,r)&&this.operator.startsWith(`<`)&&e.operator.startsWith(`>`)))}}c7=t;let n=L5(),{safeRe:r,t:i}=B5(),a=iHe(),o=z5(),s=V5(),c=oHe();return c7}function oHe(){if(WHe)return l7;WHe=1;let e=/\s+/g;class t{constructor(n,a){if(a=r(a),n instanceof t)return n.loose===!!a.loose&&n.includePrerelease===!!a.includePrerelease?n:new t(n.raw,a);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=n.trim().replace(e,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!m(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&h(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&f)|(this.options.loose&&p))+`:`+e,r=n.get(t);if(r)return r;let o=this.options.loose,h=o?s[c.HYPHENRANGELOOSE]:s[c.HYPHENRANGE];e=e.replace(h,D(this.options.includePrerelease)),a(`hyphen replace`,e),e=e.replace(s[c.COMPARATORTRIM],l),a(`comparator trim`,e),e=e.replace(s[c.TILDETRIM],u),a(`tilde trim`,e),e=e.replace(s[c.CARETTRIM],d),a(`caret trim`,e);let g=e.split(` `).map(e=>_(e,this.options)).join(` `).split(/\s+/).map(e=>E(e,this.options));o&&(g=g.filter(e=>(a(`loose invalid filter`,e,this.options),!!e.match(s[c.COMPARATORLOOSE])))),a(`range list`,g);let v=new Map,y=g.map(e=>new i(e,this.options));for(let e of y){if(m(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let b=[...v.values()];return n.set(t,b),b}intersects(e,n){if(!(e instanceof t))throw TypeError(`a Range is required`);return this.set.some(t=>g(t,n)&&e.set.some(e=>g(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new o(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,h=e=>e.value===``,g=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},_=(e,t)=>(a(`comp`,e,t),e=x(e,t),a(`caret`,e),e=y(e,t),a(`tildes`,e),e=C(e,t),a(`xrange`,e),e=T(e,t),a(`stars`,e),e),v=e=>!e||e.toLowerCase()===`x`||e===`*`,y=(e,t)=>e.trim().split(/\s+/).map(e=>b(e,t)).join(` `),b=(e,t)=>{let n=t.loose?s[c.TILDELOOSE]:s[c.TILDE];return e.replace(n,(t,n,r,i,o)=>{a(`tilde`,e,t,n,r,i,o);let s;return v(n)?s=``:v(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:v(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(a(`replaceTilde pr`,o),s=`>=${n}.${r}.${i}-${o} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,a(`tilde return`,s),s})},x=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(` `),S=(e,t)=>{a(`caret`,e,t);let n=t.loose?s[c.CARETLOOSE]:s[c.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,o,s)=>{a(`caret`,e,t,n,i,o,s);let c;return v(n)?c=``:v(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(o)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${o}${r} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a(`caret return`,c),c})},C=(e,t)=>(a(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>w(e,t)).join(` `)),w=(e,t)=>{e=e.trim();let n=t.loose?s[c.XRANGELOOSE]:s[c.XRANGE];return e.replace(n,(n,r,i,o,s,c)=>{a(`xRange`,e,n,r,i,o,s,c);let l=v(i),u=l||v(o),d=u||v(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(o=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:o=+o+1),r===`<`&&(c=`-0`),n=`${r+i}.${o}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),a(`xRange return`,n),n})},T=(e,t)=>(a(`replaceStars`,e,t),e.trim().replace(s[c.STAR],``)),E=(e,t)=>(a(`replaceGTE0`,e,t),e.trim().replace(s[t.includePrerelease?c.GTE0PRE:c.GTE0],``)),D=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=v(r)?``:v(i)?`>=${r}.0.0${e?`-0`:``}`:v(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=v(l)?``:v(u)?`<${+l+1}.0.0-0`:v(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),O=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return l7}function sHe(){if(GHe)return u7;GHe=1;let e=oHe();return u7=(t,n,r)=>{try{n=new e(n,r)}catch{return!1}return n.test(t)},u7}function cHe(e,t,n){let r=e.open(t),{origin:i}=new URL(t),a=40;function o(t){t.source===r&&(a=0,e.removeEventListener(`message`,o,!1))}e.addEventListener(`message`,o,!1);function s(){a<=0||(r.postMessage(n,i),setTimeout(s,250),--a)}setTimeout(s,250)}function lHe(e,...t){for(let n of t)uHe(e,n);return e}function uHe(e,t){for(let n of Object.keys(t))kh(e,n,t[n],!0)}function dHe(e){return typeof e==`function`}function fHe(e,t,n,r){let i=`${t}
`,a=`
${n}`,o=window.open(``);o.document.write(i+e+a),o.document.title=`${g7[r]} JSON Source`}function pHe(e,t,n){if(e.$schema){let r=LBe(e.$schema);n&&n!==r.library&&t.warn(`The given visualization spec is written in ${g7[r.library]}, but mode argument sets ${g7[n]??n}.`);let i=r.library;return d7(_7[i],`^${r.version.slice(1)}`)||t.warn(`The input spec uses ${g7[i]} ${r.version}, but the current version of ${g7[i]} is v${_7[i]}.`),i}return`mark`in e||`encoding`in e||`layer`in e||`hconcat`in e||`vconcat`in e||`facet`in e||`repeat`in e?`vega-lite`:`marks`in e||`signals`in e||`scales`in e||`axes`in e?`vega`:n??`vega`}function mHe(e){return!!(e&&`load`in e)}function hHe(e){return mHe(e)?e:p7.loader(e)}function gHe(e){let t=e.usermeta?.embedOptions??{};return xg(t.defaultStyle)&&(t.defaultStyle=!1),t}async function _He(e,t,n={}){let r,i;xg(t)?(i=hHe(n.loader),r=JSON.parse(await i.load(t))):r=t;let a=gHe(r),o=a.loader;(!i||o)&&(i=hHe(n.loader??o));let s=await vHe(a,i),c=await vHe(n,i),l={...lHe(c,s),config:Oh(c.config??{},s.config??{})};return await bHe(e,r,l,i)}async function vHe(e,t){let n=xg(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=xg(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...r?{patch:r}:{},...n?{config:n}:{}}}function yHe(e){let t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function bHe(e,t,n={},r){let i=n.theme?Oh(zBe[n.theme],n.config??{}):n.config,a=_g(n.actions)?n.actions:lHe({},KHe,n.actions??{}),o={...qHe,...n.i18n},s=n.renderer??`svg`,c=n.logger??wh(p7.Warn);n.logLevel!==void 0&&c.level(n.logLevel);let l=n.downloadFileName??`visualization`,u=typeof e==`string`?document.querySelector(e):e;if(!u)throw Error(`${e} does not exist`);if(n.defaultStyle!==!1){let e=`vega-embed-style`,{root:t,rootContainer:r}=yHe(u);if(!t.getElementById(e)){let t=document.createElement(`style`);t.id=e,t.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?f7.toString():n.defaultStyle,r.appendChild(t)}}let d=pHe(t,c,n.mode),f=JHe[d](t,c,i);if(d===`vega-lite`&&f.$schema){let e=LBe(f.$schema);d7(_7.vega,`^${e.version.slice(1)}`)||c.warn(`The compiled spec uses Vega ${e.version}, but current version is v${_7.vega}.`)}u.classList.add(`vega-embed`),a&&u.classList.add(`has-actions`),u.innerHTML=``;let p=u;if(a){let e=document.createElement(`div`);e.classList.add(XHe),u.appendChild(e),p=e}let m=n.patch;if(m&&(f=m instanceof Function?m(f):M5(f,m,!0,!1).newDocument),n.formatLocale&&p7.formatLocale(n.formatLocale),n.timeFormatLocale&&p7.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(let e in n.expressionFunctions){let t=n.expressionFunctions[e];`fn`in t?p7.expressionFunction(e,t.fn,t.visitor):t instanceof Function&&p7.expressionFunction(e,t)}let{ast:h}=n,g=p7.parse(f,d===`vega-lite`?{}:i,{ast:h}),_=new(n.viewClass||p7.View)(g,{loader:r,logger:c,renderer:s,...h?{expr:p7.expressionInterpreter??n.expr??lX}:{}});if(_.addSignalListener(`autosize`,(e,t)=>{let{type:n}=t;n==`fit-x`?(p.classList.add(`fit-x`),p.classList.remove(`fit-y`)):n==`fit-y`?(p.classList.remove(`fit-x`),p.classList.add(`fit-y`)):n==`fit`?p.classList.add(`fit-x`,`fit-y`):p.classList.remove(`fit-x`,`fit-y`)}),n.tooltip!==!1){let{loader:e,tooltip:t}=n,r=e&&!mHe(e)?e?.baseURL:void 0,i=dHe(t)?t:new LVe({baseURL:r,...t===!0?{}:t}).call;_.tooltip(i)}let{hover:v}=n;if(v===void 0&&(v=d===`vega`),v){let{hoverSet:e,updateSet:t}=typeof v==`boolean`?{}:v;_.hover(e,t)}n&&(n.width!=null&&_.width(n.width),n.height!=null&&_.height(n.height),n.padding!=null&&_.padding(n.padding)),await _.initialize(p,n.bind).runAsync();let y;if(a!==!1){let e=u;if(n.defaultStyle!==!1||n.forceActionsMenu){let t=document.createElement(`details`);t.title=o.CLICK_TO_VIEW_ACTIONS,u.append(t),e=t;let n=document.createElement(`summary`);n.innerHTML=YHe,t.append(n),y=e=>{t.contains(e.target)||t.removeAttribute(`open`)},document.addEventListener(`click`,y)}let r=document.createElement(`div`);if(e.append(r),r.classList.add(`vega-actions`),a===!0||a.export!==!1){for(let e of[`svg`,`png`])if(a===!0||a.export===!0||a.export[e]){let t=o[`${e.toUpperCase()}_ACTION`],i=document.createElement(`a`),a=Eh(n.scaleFactor)?n.scaleFactor[e]:n.scaleFactor;i.text=t,i.href=`#`,i.target=`_blank`,i.download=`${l}.${e}`,i.addEventListener(`mousedown`,async function(t){t.preventDefault();let n=await _.toImageURL(e,a);this.href=n}),r.append(i)}}if(a===!0||a.source!==!1){let e=document.createElement(`a`);e.text=o.SOURCE_ACTION,e.href=`#`,e.addEventListener(`click`,function(e){fHe(nh(t),n.sourceHeader??``,n.sourceFooter??``,d),e.preventDefault()}),r.append(e)}if(d===`vega-lite`&&(a===!0||a.compiled!==!1)){let e=document.createElement(`a`);e.text=o.COMPILED_ACTION,e.href=`#`,e.addEventListener(`click`,function(e){fHe(nh(f),n.sourceHeader??``,n.sourceFooter??``,`vega`),e.preventDefault()}),r.append(e)}if(a===!0||a.editor!==!1){let e=n.editorUrl??`https://vega.github.io/editor/`,a=document.createElement(`a`);a.text=o.EDITOR_ACTION,a.href=`#`,a.addEventListener(`click`,function(n){cHe(window,e,{config:i,mode:m?`vega`:d,renderer:s,spec:nh(m?f:t)}),n.preventDefault()}),r.append(a)}}function b(){y&&document.removeEventListener(`click`,y),_.finalize()}return{view:_,spec:t,vgSpec:f,finalize:b,embedOptions:n}}var xHe,SHe,U5,W5,CHe,G5,wHe,THe,K5,EHe,DHe,q5,OHe,J5,kHe,Y5,X5,AHe,Z5,jHe,MHe,Q5,NHe,$5,PHe,e7,FHe,t7,IHe,n7,LHe,r7,RHe,i7,zHe,a7,BHe,o7,VHe,s7,HHe,c7,UHe,l7,WHe,u7,GHe,d7,f7,p7,m7,h7,KHe,qHe,g7,_7,JHe,YHe,XHe,ZHe=o((()=>{Sie(),ZY(),oOe(),IBe(),RBe(),SVe(),RVe(),xHe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),SHe=Object.prototype.hasOwnProperty,U5=function(e){xHe(t,e);function t(t,n,r,i,a){var o=this.constructor,s=e.call(this,BVe(t,{name:n,index:r,operation:i,tree:a}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=a,Object.setPrototypeOf(s,o.prototype),s.message=BVe(t,{name:n,index:r,operation:i,tree:a}),s}return t}(Error),W5=U5,CHe=E5,G5={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=A5(n,this.path);r&&=E5(r);var i=j5(n,{op:`remove`,path:this.from}).removed;return j5(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=A5(n,this.from);return j5(n,{op:`add`,path:this.path,value:E5(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:P5(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},wHe={add:function(e,t,n){return D5(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:G5.move,copy:G5.copy,test:G5.test,_get:G5._get},THe=Object.freeze({__proto__:null,JsonPatchError:W5,_areEquals:P5,applyOperation:j5,applyPatch:M5,applyReducer:VVe,deepClone:CHe,getValueByPointer:A5,validate:HVe,validator:N5}),K5=new WeakMap,EHe=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),DHe=function(){function e(e,t){this.callback=e,this.observer=t}return e}(),Object.assign({},THe,Object.freeze({__proto__:null,compare:JVe,generate:F5,observe:qVe,unobserve:KVe}),{JsonPatchError:U5,deepClone:E5,escapePathComponent:O5,unescapePathComponent:zVe}),Y5={exports:{}},d7=YVe(sHe()),f7=`.vega-embed { +`,p5=`vg-tooltip-element`,TVe={offsetX:10,offsetY:10,id:p5,styleId:`vega-tooltip-style`,theme:`light`,disableDefaultStyle:!1,sanitize:hVe,maxDepth:2,formatTooltip:fVe,baseURL:``,anchor:`cursor`,position:[`top`,`bottom`,`left`,`right`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]},EVe=class{call;options;el;constructor(e){this.options={...TVe,...e};let t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){let e=document.createElement(`style`);e.setAttribute(`id`,this.options.styleId),e.innerHTML=gVe(t);let n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){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)),r==null||r===``){this.el.classList.remove(`visible`,`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add(`visible`,`${this.options.theme}-theme`);let{x:i,y:a}=this.options.anchor===`mark`?vVe(e,t,n,this.el.getBoundingClientRect(),this.options):_Ve(t,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${a}px`,this.el.style.left=`${i}px`}},CVe.version}));function m5(e,t){return dHe.call(e,t)}function h5(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function v5(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function OVe(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function y5(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&s[l-1]==`constructor`))throw 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(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!_5(f))throw new P5(`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`,a,t,e);else _5(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new P5(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=pHe[t.op].call(t,c,f,e);if(o.test===!1)throw new P5(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=F5[t.op].call(t,c,f,e);if(o.test===!1)throw new P5(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new P5('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new P5("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new P5("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&y5(e.value))throw new P5("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new P5("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new P5(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=jVe([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new P5(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function jVe(e,t,n){try{if(!Array.isArray(e))throw new P5(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)S5(g5(t),g5(e),n||!0);else{n||=C5;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function E5(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=h5(t),o=h5(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(m5(t,l)&&!(t[l]===void 0&&u!==void 0&&Array.isArray(t)===!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?E5(u,d,n,r+`/`+v5(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+v5(l),value:g5(u)}),n.push({op:`replace`,path:r+`/`+v5(l),value:g5(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+v5(l),value:g5(u)}),n.push({op:`remove`,path:r+`/`+v5(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(!(!s&&a.length==o.length))for(var c=0;c=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}return L5=e,L5}function D5(){if(vHe)return R5;vHe=1;let e=Object.freeze({loose:!0}),t=Object.freeze({});return R5=n=>n?typeof n==`object`?n:e:t,R5}function O5(){return yHe?B5:(yHe=1,B5={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},B5)}function k5(){return bHe?V5:(bHe=1,V5=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},V5)}function A5(){return xHe?z5.exports:(xHe=1,(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=O5(),a=k5();t=e.exports={};let o=t.re=[],s=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})(z5,z5.exports),z5.exports)}function BVe(){if(SHe)return H5;SHe=1;let e=/^[0-9]+$/,t=(t,n)=>{let r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:tt(n,e)},H5}function j5(){if(CHe)return U5;CHe=1;let e=k5(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=O5(),{safeRe:r,t:i}=A5(),a=D5(),{compareIdentifiers:o}=BVe();class s{constructor(o,c){if(c=a(c),o instanceof s){if(o.loose===!!c.loose&&o.includePrerelease===!!c.includePrerelease)return o;o=o.version}else if(typeof o!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);if(o.length>t)throw TypeError(`version is longer than ${t} characters`);e(`SemVer`,o,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=o.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!l)throw TypeError(`Invalid Version: ${o}`);if(this.raw=o,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>n||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>n||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>n||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),o(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}return U5=s,U5}function M5(){if(wHe)return W5;wHe=1;let e=j5();return W5=(t,n,r)=>new e(t,r).compare(new e(n,r)),W5}function VVe(){if(THe)return G5;THe=1;let e=M5();return G5=(t,n,r)=>e(t,n,r)===0,G5}function HVe(){if(EHe)return K5;EHe=1;let e=M5();return K5=(t,n,r)=>e(t,n,r)!==0,K5}function UVe(){if(DHe)return q5;DHe=1;let e=M5();return q5=(t,n,r)=>e(t,n,r)>0,q5}function WVe(){if(OHe)return J5;OHe=1;let e=M5();return J5=(t,n,r)=>e(t,n,r)>=0,J5}function GVe(){if(kHe)return Y5;kHe=1;let e=M5();return Y5=(t,n,r)=>e(t,n,r)<0,Y5}function KVe(){if(AHe)return X5;AHe=1;let e=M5();return X5=(t,n,r)=>e(t,n,r)<=0,X5}function qVe(){if(jHe)return Z5;jHe=1;let e=VVe(),t=HVe(),n=UVe(),r=WVe(),i=GVe(),a=KVe();return Z5=(o,s,c,l)=>{switch(s){case`===`:return typeof o==`object`&&(o=o.version),typeof c==`object`&&(c=c.version),o===c;case`!==`:return typeof o==`object`&&(o=o.version),typeof c==`object`&&(c=c.version),o!==c;case``:case`=`:case`==`:return e(o,c,l);case`!=`:return t(o,c,l);case`>`:return n(o,c,l);case`>=`:return r(o,c,l);case`<`:return i(o,c,l);case`<=`:return a(o,c,l);default:throw TypeError(`Invalid operator: ${s}`)}},Z5}function JVe(){if(MHe)return Q5;MHe=1;let e=Symbol(`SemVer ANY`);class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(` `),o(`comparator`,r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value=``:this.value=this.operator+this.semver.version,o(`comp`,this)}parse(t){let n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],a=t.match(n);if(!a)throw TypeError(`Invalid comparator: ${t}`);this.operator=a[1]===void 0?``:a[1],this.operator===`=`&&(this.operator=``),a[2]?this.semver=new s(a[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(o(`Comparator.test`,t,this.options.loose),this.semver===e||t===e)return!0;if(typeof t==`string`)try{t=new s(t,this.options)}catch{return!1}return a(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new c(e.value,r).test(this.value):e.operator===``?e.value===``||new c(this.value,r).test(e.semver):(r=n(r),r.includePrerelease&&(this.value===`<0.0.0-0`||e.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||e.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&e.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&e.operator.startsWith(`<`)||this.semver.version===e.semver.version&&this.operator.includes(`=`)&&e.operator.includes(`=`)||a(this.semver,`<`,e.semver,r)&&this.operator.startsWith(`>`)&&e.operator.startsWith(`<`)||a(this.semver,`>`,e.semver,r)&&this.operator.startsWith(`<`)&&e.operator.startsWith(`>`)))}}Q5=t;let n=D5(),{safeRe:r,t:i}=A5(),a=qVe(),o=k5(),s=j5(),c=YVe();return Q5}function YVe(){if(NHe)return $5;NHe=1;let e=/\s+/g;class t{constructor(n,a){if(a=r(a),n instanceof t)return n.loose===!!a.loose&&n.includePrerelease===!!a.includePrerelease?n:new t(n.raw,a);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=n.trim().replace(e,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!m(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&h(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&f)|(this.options.loose&&p))+`:`+e,r=n.get(t);if(r)return r;let o=this.options.loose,h=o?s[c.HYPHENRANGELOOSE]:s[c.HYPHENRANGE];e=e.replace(h,D(this.options.includePrerelease)),a(`hyphen replace`,e),e=e.replace(s[c.COMPARATORTRIM],l),a(`comparator trim`,e),e=e.replace(s[c.TILDETRIM],u),a(`tilde trim`,e),e=e.replace(s[c.CARETTRIM],d),a(`caret trim`,e);let g=e.split(` `).map(e=>_(e,this.options)).join(` `).split(/\s+/).map(e=>E(e,this.options));o&&(g=g.filter(e=>(a(`loose invalid filter`,e,this.options),!!e.match(s[c.COMPARATORLOOSE])))),a(`range list`,g);let v=new Map,y=g.map(e=>new i(e,this.options));for(let e of y){if(m(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let b=[...v.values()];return n.set(t,b),b}intersects(e,n){if(!(e instanceof t))throw TypeError(`a Range is required`);return this.set.some(t=>g(t,n)&&e.set.some(e=>g(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new o(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,h=e=>e.value===``,g=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},_=(e,t)=>(a(`comp`,e,t),e=x(e,t),a(`caret`,e),e=y(e,t),a(`tildes`,e),e=C(e,t),a(`xrange`,e),e=T(e,t),a(`stars`,e),e),v=e=>!e||e.toLowerCase()===`x`||e===`*`,y=(e,t)=>e.trim().split(/\s+/).map(e=>b(e,t)).join(` `),b=(e,t)=>{let n=t.loose?s[c.TILDELOOSE]:s[c.TILDE];return e.replace(n,(t,n,r,i,o)=>{a(`tilde`,e,t,n,r,i,o);let s;return v(n)?s=``:v(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:v(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(a(`replaceTilde pr`,o),s=`>=${n}.${r}.${i}-${o} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,a(`tilde return`,s),s})},x=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(` `),S=(e,t)=>{a(`caret`,e,t);let n=t.loose?s[c.CARETLOOSE]:s[c.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,o,s)=>{a(`caret`,e,t,n,i,o,s);let c;return v(n)?c=``:v(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(o)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${o}${r} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a(`caret return`,c),c})},C=(e,t)=>(a(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>w(e,t)).join(` `)),w=(e,t)=>{e=e.trim();let n=t.loose?s[c.XRANGELOOSE]:s[c.XRANGE];return e.replace(n,(n,r,i,o,s,c)=>{a(`xRange`,e,n,r,i,o,s,c);let l=v(i),u=l||v(o),d=u||v(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(o=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:o=+o+1),r===`<`&&(c=`-0`),n=`${r+i}.${o}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),a(`xRange return`,n),n})},T=(e,t)=>(a(`replaceStars`,e,t),e.trim().replace(s[c.STAR],``)),E=(e,t)=>(a(`replaceGTE0`,e,t),e.trim().replace(s[t.includePrerelease?c.GTE0PRE:c.GTE0],``)),D=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=v(r)?``:v(i)?`>=${r}.0.0${e?`-0`:``}`:v(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=v(l)?``:v(u)?`<${+l+1}.0.0-0`:v(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),O=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return $5}function XVe(){if(PHe)return e7;PHe=1;let e=YVe();return e7=(t,n,r)=>{try{n=new e(n,r)}catch{return!1}return n.test(t)},e7}function ZVe(e,t,n){let r=e.open(t),{origin:i}=new URL(t),a=40;function o(t){t.source===r&&(a=0,e.removeEventListener(`message`,o,!1))}e.addEventListener(`message`,o,!1);function s(){a<=0||(r.postMessage(n,i),setTimeout(s,250),--a)}setTimeout(s,250)}function QVe(e,...t){for(let n of t)$Ve(e,n);return e}function $Ve(e,t){for(let n of Object.keys(t))Gm(e,n,t[n],!0)}function eHe(e){return typeof e==`function`}function tHe(e,t,n,r){let i=`${t}
`,a=`
${n}`,o=window.open(``);o.document.write(i+e+a),o.document.title=`${a7[r]} JSON Source`}function nHe(e,t,n){if(e.$schema){let r=EBe(e.$schema);n&&n!==r.library&&t.warn(`The given visualization spec is written in ${a7[r.library]}, but mode argument sets ${a7[n]??n}.`);let i=r.library;return t7(o7[i],`^${r.version.slice(1)}`)||t.warn(`The input spec uses ${a7[i]} ${r.version}, but the current version of ${a7[i]} is v${o7[i]}.`),i}return`mark`in e||`encoding`in e||`layer`in e||`hconcat`in e||`vconcat`in e||`facet`in e||`repeat`in e?`vega-lite`:`marks`in e||`signals`in e||`scales`in e||`axes`in e?`vega`:n??`vega`}function rHe(e){return!!(e&&`load`in e)}function iHe(e){return rHe(e)?e:n7.loader(e)}function aHe(e){let t=e.usermeta?.embedOptions??{};return qh(t.defaultStyle)&&(t.defaultStyle=!1),t}async function oHe(e,t,n={}){let r,i;qh(t)?(i=iHe(n.loader),r=JSON.parse(await i.load(t))):r=t;let a=aHe(r),o=a.loader;(!i||o)&&(i=iHe(n.loader??o));let s=await sHe(a,i),c=await sHe(n,i),l={...QVe(c,s),config:Wm(c.config??{},s.config??{})};return await lHe(e,r,l,i)}async function sHe(e,t){let n=qh(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=qh(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...r?{patch:r}:{},...n?{config:n}:{}}}function cHe(e){let t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function lHe(e,t,n={},r){let i=n.theme?Wm(OBe[n.theme],n.config??{}):n.config,a=Bh(n.actions)?n.actions:QVe({},IHe,n.actions??{}),o={...LHe,...n.i18n},s=n.renderer??`svg`,c=n.logger??Bm(n7.Warn);n.logLevel!==void 0&&c.level(n.logLevel);let l=n.downloadFileName??`visualization`,u=typeof e==`string`?document.querySelector(e):e;if(!u)throw Error(`${e} does not exist`);if(n.defaultStyle!==!1){let e=`vega-embed-style`,{root:t,rootContainer:r}=cHe(u);if(!t.getElementById(e)){let t=document.createElement(`style`);t.id=e,t.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?FHe.toString():n.defaultStyle,r.appendChild(t)}}let d=nHe(t,c,n.mode),f=RHe[d](t,c,i);if(d===`vega-lite`&&f.$schema){let e=EBe(f.$schema);t7(o7.vega,`^${e.version.slice(1)}`)||c.warn(`The compiled spec uses Vega ${e.version}, but current version is v${o7.vega}.`)}u.classList.add(`vega-embed`),a&&u.classList.add(`has-actions`),u.innerHTML=``;let p=u;if(a){let e=document.createElement(`div`);e.classList.add(BHe),u.appendChild(e),p=e}let m=n.patch;if(m&&(f=m instanceof Function?m(f):S5(f,m,!0,!1).newDocument),n.formatLocale&&n7.formatLocale(n.formatLocale),n.timeFormatLocale&&n7.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(let e in n.expressionFunctions){let t=n.expressionFunctions[e];`fn`in t?n7.expressionFunction(e,t.fn,t.visitor):t instanceof Function&&n7.expressionFunction(e,t)}let{ast:h}=n,g=n7.parse(f,d===`vega-lite`?{}:i,{ast:h}),_=new(n.viewClass||n7.View)(g,{loader:r,logger:c,renderer:s,...h?{expr:n7.expressionInterpreter??n.expr??oX}:{}});if(_.addSignalListener(`autosize`,(e,t)=>{let{type:n}=t;n==`fit-x`?(p.classList.add(`fit-x`),p.classList.remove(`fit-y`)):n==`fit-y`?(p.classList.remove(`fit-x`),p.classList.add(`fit-y`)):n==`fit`?p.classList.add(`fit-x`,`fit-y`):p.classList.remove(`fit-x`,`fit-y`)}),n.tooltip!==!1){let{loader:e,tooltip:t}=n,r=e&&!rHe(e)?e?.baseURL:void 0,i=eHe(t)?t:new EVe({baseURL:r,...t===!0?{}:t}).call;_.tooltip(i)}let{hover:v}=n;if(v===void 0&&(v=d===`vega`),v){let{hoverSet:e,updateSet:t}=typeof v==`boolean`?{}:v;_.hover(e,t)}n&&(n.width!=null&&_.width(n.width),n.height!=null&&_.height(n.height),n.padding!=null&&_.padding(n.padding)),await _.initialize(p,n.bind).runAsync();let y;if(a!==!1){let e=u;if(n.defaultStyle!==!1||n.forceActionsMenu){let t=document.createElement(`details`);t.title=o.CLICK_TO_VIEW_ACTIONS,u.append(t),e=t;let n=document.createElement(`summary`);n.innerHTML=zHe,t.append(n),y=e=>{t.contains(e.target)||t.removeAttribute(`open`)},document.addEventListener(`click`,y)}let r=document.createElement(`div`);if(e.append(r),r.classList.add(`vega-actions`),a===!0||a.export!==!1){for(let e of[`svg`,`png`])if(a===!0||a.export===!0||a.export[e]){let t=o[`${e.toUpperCase()}_ACTION`],i=document.createElement(`a`),a=Hm(n.scaleFactor)?n.scaleFactor[e]:n.scaleFactor;i.text=t,i.href=`#`,i.target=`_blank`,i.download=`${l}.${e}`,i.addEventListener(`mousedown`,async function(t){t.preventDefault();let n=await _.toImageURL(e,a);this.href=n}),r.append(i)}}if(a===!0||a.source!==!1){let e=document.createElement(`a`);e.text=o.SOURCE_ACTION,e.href=`#`,e.addEventListener(`click`,function(e){tHe(vm(t),n.sourceHeader??``,n.sourceFooter??``,d),e.preventDefault()}),r.append(e)}if(d===`vega-lite`&&(a===!0||a.compiled!==!1)){let e=document.createElement(`a`);e.text=o.COMPILED_ACTION,e.href=`#`,e.addEventListener(`click`,function(e){tHe(vm(f),n.sourceHeader??``,n.sourceFooter??``,`vega`),e.preventDefault()}),r.append(e)}if(a===!0||a.editor!==!1){let e=n.editorUrl??`https://vega.github.io/editor/`,a=document.createElement(`a`);a.text=o.EDITOR_ACTION,a.href=`#`,a.addEventListener(`click`,function(n){ZVe(window,e,{config:i,mode:m?`vega`:d,renderer:s,spec:vm(m?f:t)}),n.preventDefault()}),r.append(a)}}function b(){y&&document.removeEventListener(`click`,y),_.finalize()}return{view:_,spec:t,vgSpec:f,finalize:b,embedOptions:n}}var uHe,dHe,N5,P5,fHe,F5,pHe,mHe,I5,hHe,gHe,L5,_He,R5,vHe,z5,B5,yHe,V5,bHe,xHe,H5,SHe,U5,CHe,W5,wHe,G5,THe,K5,EHe,q5,DHe,J5,OHe,Y5,kHe,X5,AHe,Z5,jHe,Q5,MHe,$5,NHe,e7,PHe,t7,FHe,n7,r7,i7,IHe,LHe,a7,o7,RHe,zHe,BHe,VHe=o((()=>{zie(),JY(),HDe(),TBe(),DBe(),dVe(),DVe(),uHe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),dHe=Object.prototype.hasOwnProperty,N5=function(e){uHe(t,e);function t(t,n,r,i,a){var o=this.constructor,s=e.call(this,kVe(t,{name:n,index:r,operation:i,tree:a}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=a,Object.setPrototypeOf(s,o.prototype),s.message=kVe(t,{name:n,index:r,operation:i,tree:a}),s}return t}(Error),P5=N5,fHe=g5,F5={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=b5(n,this.path);r&&=g5(r);var i=x5(n,{op:`remove`,path:this.from}).removed;return x5(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=b5(n,this.from);return x5(n,{op:`add`,path:this.path,value:g5(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:w5(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},pHe={add:function(e,t,n){return _5(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:F5.move,copy:F5.copy,test:F5.test,_get:F5._get},mHe=Object.freeze({__proto__:null,JsonPatchError:P5,_areEquals:w5,applyOperation:x5,applyPatch:S5,applyReducer:AVe,deepClone:fHe,getValueByPointer:b5,validate:jVe,validator:C5}),I5=new WeakMap,hHe=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),gHe=function(){function e(e,t){this.callback=e,this.observer=t}return e}(),Object.assign({},mHe,Object.freeze({__proto__:null,compare:LVe,generate:T5,observe:IVe,unobserve:FVe}),{JsonPatchError:N5,deepClone:g5,escapePathComponent:v5,unescapePathComponent:OVe}),z5={exports:{}},t7=RVe(XVe()),FHe=`.vega-embed { position: relative; display: inline-block; box-sizing: border-box; @@ -386,18 +374,30 @@ endobj transform: scale(1); } } -`,{version:`7.1.0`}.version,p7=iOe,m7=ROe,h7=typeof window<`u`?window:void 0,m7===void 0&&h7?.vl?.compile&&(m7=h7.vl),KHe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},qHe={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`},g7={vega:`Vega`,"vega-lite":`Vega-Lite`},_7={vega:p7.version,"vega-lite":m7?m7.version:`not available`},JHe={vega:e=>e,"vega-lite":(e,t,n)=>m7.compile(e,{config:n,logger:t}).spec},YHe=` +`,{version:`7.1.0`}.version,n7=BDe,r7=bOe,i7=typeof window<`u`?window:void 0,r7===void 0&&i7?.vl?.compile&&(r7=i7.vl),IHe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},LHe={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`},a7={vega:`Vega`,"vega-lite":`Vega-Lite`},o7={vega:n7.version,"vega-lite":r7?r7.version:`not available`},RHe={vega:e=>e,"vega-lite":(e,t,n)=>r7.compile(e,{config:n,logger:t}).spec},zHe=` -`,XHe=`chart-wrapper`})),QHe=c({default:()=>$He});function $He({spec:e,label:t}){let n=(0,v7.useRef)(null),r=(0,v7.useRef)(null),[i,a]=(0,v7.useState)(``);return(0,v7.useEffect)(()=>{let t=!1;a(``),r.current?.finalize(),r.current=null;let i=n.current;if(i)return i.replaceChildren(),_He(i,e,{mode:`vega-lite`,actions:!1,renderer:`svg`,tooltip:!0,hover:!0}).then(e=>{t?e.finalize():r.current=e}).catch(()=>{t||a(`This chart could not be rendered.`)}),()=>{t=!0,r.current?.finalize(),r.current=null,i.replaceChildren()}},[e]),(0,y7.jsxs)(`div`,{className:`cg-vega-frame`,role:`img`,"aria-label":t,children:[(0,y7.jsx)(`div`,{ref:n,className:`cg-vega-host`}),i&&(0,y7.jsx)(`div`,{className:`cg-ch-empty`,children:i})]})}var v7,y7,eUe=o((()=>{v7=u(f(),1),ZHe(),y7=Dp()}));eUe();var tUe={week:`Weekly`,month:`Monthly`,quarter:`Quarterly`,year:`Yearly`},nUe=[6,12,24,36],b7=72,x7=18;function rUe(){let e={stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`};return(0,B.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,"aria-hidden":!0,children:[(0,B.jsx)(`path`,{d:`M2.5 11.5h4v-4h4v-3h3`,...e}),(0,B.jsx)(`path`,{d:`M2.5 13.5h11`,...e,opacity:`0.45`})]})}function iUe(e){let t={server:[],snapshot:[],refused:[]};for(let n of e){let e=Km(n);e===`server`?t.server.push(n):e===`snapshot`?t.snapshot.push(n):t.refused.push({field:n,why:rie(n)})}return t}function aUe(e){let t=e.length+1,n=new Set(e.map(e=>e.id));for(;n.has(`tsr_${t}`);)t+=1;return`tsr_${t}`}function oUe({scope:e,pids:t,fields:n,rows:r,display:i,onDisplay:a,locked:o}){let s=(0,L.useMemo)(()=>iUe(n),[n]),c=(0,L.useMemo)(()=>[...s.server,...s.snapshot],[s.server,s.snapshot]),l=(0,L.useMemo)(()=>new Set(s.snapshot.map(e=>e.key)),[s.snapshot]),u=id.includes(i?.tsBucket??``)?i.tsBucket:zm,d=typeof i?.tsSpan?.lastN==`number`?i.tsSpan.lastN:12,f=(0,L.useMemo)(()=>{let e=(i?.tsFields??[]).filter(e=>c.some(t=>t.key===e));return e.length?e:c.slice(0,1).map(e=>e.key)},[i?.tsFields,c]),p=(0,L.useMemo)(()=>f.filter(e=>!l.has(e)),[f,l]),m=(0,L.useMemo)(()=>f.filter(e=>l.has(e)),[f,l]),h=(0,L.useMemo)(()=>i?.tsRows??[],[i?.tsRows]),g=(0,L.useMemo)(()=>i?.tsDeltas??[],[i?.tsDeltas]),_=i?.tsStyles,v=i?.tsGridlines!==!1,y=i?.tsSparkline===!0,[b,x]=(0,L.useState)(null),[S,C]=(0,L.useState)(`idle`),[w,T]=(0,L.useState)(0),[E,D]=(0,L.useState)(new Set),O=(0,L.useRef)(0),k=Wd();(0,L.useEffect)(()=>{if(k)return;if(!p.length||!t.length){x(null),C(`idle`);return}let n=++O.current;C(`loading`),tf(Bm({pids:t,bucket:u,span:{lastN:d},fields:p}),e).then(({payload:e,status:t})=>{if(n===O.current){if(!e){x(null),T(t),C(`error`);return}x(e),C(`idle`)}})},[k,e,t,u,d,p]);let A=(0,L.useMemo)(()=>Gm(b),[b]),j=(0,L.useMemo)(()=>{if(!m.length||!A.columns.length)return A;let e=new Map(n.map(e=>[e.key,e])),t=m.map(t=>e.get(t)).filter(e=>!!e).map(e=>iie(e,r??[],A.columns,b?.meta?.today));return{...A,rows:[...A.rows,...t],empty:!1}},[A,m,n,r,b?.meta?.today]),M=(0,L.useMemo)(()=>mie(j,{customRows:h,deltas:g,bucket:u,today:b?.meta?.today}),[j,h,g,u,b?.meta?.today]),ee=(0,L.useCallback)(()=>{let e=gie(M);Rm(`Time series.csv`,new Blob([``+e],{type:`text/csv;charset=utf-8`}))},[M]),N=(0,L.useCallback)(e=>{D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),te=e=>{e.length&&a?.({tsFields:e.slice(0,12)})},ne=e=>a?.({tsRows:e.length?e.slice(0,12):void 0}),P=e=>{let t=g.includes(e)?g.filter(t=>t!==e):[...g,e];a?.({tsDeltas:t.length?t:void 0})},re=(e,t)=>{let n={..._??{}},r={...Xm(_,e),...t},i={};r.bold&&(i.bold=!0),r.line&&(i.line=!0),i.bold||i.line?n[e]=i:delete n[e],a?.({tsStyles:Object.keys(n).length?n:void 0})};if(k)return(0,B.jsx)(`div`,{className:`cg-mode-empty`,children:`The time-series view runs in the web app. Open Loopable in a browser tab to see it.`});if(!c.length)return(0,B.jsx)(`div`,{className:`cg-mode-empty`,children:`This table has no number fields to plot. A time series needs either a metric with a period, or a numeric column to snapshot — add one from a column menu, then pick it here.`});let F=c.filter(e=>!f.includes(e.key)),ie=M.columns.length+2+ +!!y,ae=m.length>0&&M.columns.length===0&&S!==`loading`;return(0,B.jsxs)(`div`,{className:`cg-ts`,children:[(0,B.jsxs)(`div`,{className:`cg-ts-bar`,children:[(0,B.jsxs)(`label`,{className:`cg-ts-ctl`,children:[(0,B.jsx)(`span`,{className:`cg-ts-ctl-k`,children:`Period`}),(0,B.jsx)(`select`,{className:`cg-select`,value:u,onChange:e=>a?.({tsBucket:e.target.value}),disabled:!a,children:id.map(e=>(0,B.jsx)(`option`,{value:e,children:tUe[e]},e))})]}),(0,B.jsxs)(`label`,{className:`cg-ts-ctl`,children:[(0,B.jsx)(`span`,{className:`cg-ts-ctl-k`,children:`Span`}),(0,B.jsx)(`select`,{className:`cg-select`,value:String(d),onChange:e=>a?.({tsSpan:{lastN:Number(e.target.value)}}),disabled:!a,children:nUe.map(e=>(0,B.jsxs)(`option`,{value:e,children:[`Last `,e]},e))})]}),(0,B.jsx)(pm,{label:g.length?`Compare · ${g.length}`:`Compare`,icon:(0,B.jsx)(rUe,{}),active:g.length>0,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Compare each period with`}),(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`Each choice adds a sub-row under every metric. A comparison that cannot be answered for a metric says so in the footnotes rather than printing a number.`}),ad.map(e=>(0,B.jsxs)(`label`,{className:`cg-check-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:g.includes(e),disabled:!a,onChange:()=>P(e)}),(0,B.jsx)(`span`,{className:`cg-check-label`,children:Jm[e]})]},e))]})}),(0,B.jsxs)(`span`,{className:`cg-ts-group`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-tog`+(v?` is-on`:``),"aria-pressed":v,disabled:!a,onClick:()=>a?.({tsGridlines:!v&&void 0}),children:`Gridlines`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-tog`+(y?` is-on`:``),"aria-pressed":y,disabled:!a,onClick:()=>a?.({tsSparkline:!y||void 0}),children:`Trend`})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-tb-btn`,onClick:ee,disabled:M.empty,children:`Export CSV`}),(0,B.jsx)(`span`,{className:`cg-ts-pool`,children:o?`This record`:`${M.pool.toLocaleString()} ${M.pool===1?`customer`:`customers`}`})]}),S===`error`&&(0,B.jsx)(`div`,{className:`cg-ts-note cg-ts-error`,children:w===400?`That span is too wide to bucket. Choose a shorter span or a larger period.`:w===403?`None of these records are in your book.`:`The time series could not be loaded. Nothing is shown rather than a guess.`}),ae&&(0,B.jsxs)(`div`,{className:`cg-ts-note`,children:[m.length===1?`That column has`:`Those columns have`,` no period of its own, so `,m.length===1?`it is`:`they are`,` shown as a snapshot across the periods on the sheet — and this sheet has no periods yet. Add one metric with a period and `,m.length===1?`it`:`they`,` will appear beside it.`]}),s.refused.length>0&&(0,B.jsx)(`div`,{className:`cg-ts-refused`,children:s.refused.map(({field:e,why:t})=>(0,B.jsx)(`span`,{className:`cg-ts-refchip`,title:t,children:e.label},e.key))}),S===`loading`&&!b&&(0,B.jsx)(`div`,{className:`cg-ts-note`,children:(0,B.jsx)(`span`,{className:`lp-spin`,role:`status`,"aria-label":`Loading`})}),b&&(0,B.jsx)(`div`,{className:`cg-ts-scroll`,children:(0,B.jsxs)(`table`,{className:`cg-ts-table`+(v?``:` is-nogrid`),children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`cg-ts-stick`,children:`Metric`}),M.columns.map(e=>(0,B.jsxs)(`th`,{className:e.partial?`is-partial`:void 0,children:[e.label,e.partial&&(0,B.jsx)(`span`,{className:`cg-ts-partial`,children:` · partial`})]},e.key)),(0,B.jsx)(`th`,{className:`cg-ts-total`,children:`Total`}),y&&(0,B.jsx)(`th`,{className:`cg-ts-sparkhead`,children:`Trend`})]})}),(0,B.jsxs)(`tbody`,{children:[M.rows.map(e=>(0,B.jsx)(cUe,{row:e,sheet:M,style:Xm(_,e.id),styles:_,sparkline:y,charted:E.has(e.id),editable:!!a,metricRow:j.rows.find(t=>t.field===e.id),onToggleChart:()=>N(e.id),onStyle:t=>re(e.id,t),onRemove:()=>{e.kind===`metric`?te(f.filter(t=>t!==e.id)):ne(h.filter(t=>t.id!==e.id))},onEditRow:t=>ne(h.map(n=>n.id===e.id?{...n,...t}:n))},e.id)),a&&(0,B.jsx)(`tr`,{className:`cg-ts-addrow`,children:(0,B.jsx)(`th`,{className:`cg-ts-stick`,colSpan:ie,children:(0,B.jsxs)(`span`,{className:`cg-ts-addbar`,children:[(0,B.jsx)(Gp,{fields:F,value:void 0,onChange:e=>te([...f,e]),className:`cg-select cg-ts-addsel`,ariaLabel:`Add a metric row`,disabled:!F.length||f.length>=12,placeholder:F.length?f.length>=12?`At the 12-metric limit`:`+ Add metric`:`Every metric is on the sheet`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-tog`,disabled:h.length>=12,onClick:()=>ne([...h,{id:aUe(h),kind:`note`,label:``}]),children:`+ Note`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-tog`,disabled:h.length>=12,onClick:()=>ne([...h,{id:aUe(h),kind:`formula`,label:``,expr:``}]),children:`+ Formula`})]})})})]})]})}),b&&M.empty&&(0,B.jsx)(`div`,{className:`cg-ts-note`,children:`No metrics returned a series for this span.`}),M.notes.length>0&&(0,B.jsx)(`ul`,{className:`cg-ts-notes`,children:M.notes.map(e=>(0,B.jsx)(`li`,{children:e},e))})]})}function sUe({style:e,editable:t,onStyle:n,onRemove:r,label:i}){return t?(0,B.jsxs)(`span`,{className:`cg-ts-rowtools`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-rowtool`+(e.bold?` is-on`:``),"aria-pressed":!!e.bold,"aria-label":`Bold ${i}`,title:`Bold`,onClick:()=>n({bold:!e.bold||void 0}),children:`B`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-rowtool`+(e.line?` is-on`:``),"aria-pressed":!!e.line,"aria-label":`Rule above ${i}`,title:`Rule above`,onClick:()=>n({line:!e.line||void 0}),children:`―`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-rowtool`,"aria-label":`Remove ${i}`,title:`Remove row`,onClick:r,children:`×`})]}):null}function cUe({row:e,sheet:t,style:n,styles:r,sparkline:i,charted:a,editable:o,metricRow:s,onToggleChart:c,onStyle:l,onRemove:u,onEditRow:d}){let f=(0,L.useMemo)(()=>{if(!a||!s)return null;let n=Qm(s,t.columns);return n.points.length?th({spec:{id:e.id,kind:`line`,agg:e.agg??`sum`},model:n,yTitle:e.label,formatValue:e=>e.toLocaleString(void 0,{maximumFractionDigits:2})}):null},[a,s,t.columns,e.id,e.agg,e.label]),p=t.columns.length+2+ +!!i,m=(n.line?`is-ruled`:``)+(n.bold?` is-bold`:``)||void 0;return e.kind===`note`?(0,B.jsx)(`tr`,{className:`cg-ts-noterow `+(m??``),children:(0,B.jsx)(`th`,{className:`cg-ts-stick`,colSpan:p,children:(0,B.jsxs)(`span`,{className:`cg-ts-rowhead`,children:[o?(0,B.jsx)(`input`,{className:`cg-ts-rowinput`,value:e.label,maxLength:120,placeholder:`Note — type a heading for this section`,"aria-label":`Note row label`,onChange:e=>d({label:e.target.value})}):(0,B.jsx)(`span`,{className:`cg-ts-rowlabel`,children:e.label}),(0,B.jsx)(sUe,{style:n,editable:o,onStyle:l,onRemove:u,label:e.label||`note row`})]})})}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`tr`,{className:m,children:[(0,B.jsx)(`th`,{scope:`row`,className:`cg-ts-stick`,children:(0,B.jsxs)(`span`,{className:`cg-ts-rowhead`,children:[(0,B.jsxs)(`span`,{className:`cg-ts-rowmain`,children:[e.kind===`formula`?o?(0,B.jsx)(`input`,{className:`cg-ts-rowinput`,value:e.label,maxLength:120,placeholder:`Formula row name`,"aria-label":`Formula row label`,onChange:e=>d({label:e.target.value})}):(0,B.jsx)(`span`,{className:`cg-ts-rowlabel`,children:e.label}):(0,B.jsx)(`button`,{type:`button`,className:`cg-ts-rowbtn`,onClick:c,"aria-pressed":a,title:a?`Show as a row of numbers`:`Show as a line`,children:e.label}),e.sublabel&&(0,B.jsx)(`span`,{className:`cg-ts-rowsub`,children:e.sublabel}),e.kind===`formula`&&(o?(0,B.jsx)(`input`,{className:`cg-ts-rowinput cg-ts-rowexpr`,value:e.expr??``,maxLength:200,spellCheck:!1,placeholder:`= [Sales] - [Returns]`,"aria-label":`Formula`,onChange:e=>d({expr:e.target.value})}):(0,B.jsx)(`span`,{className:`cg-ts-rowsub`,children:e.expr}))]}),(0,B.jsx)(sUe,{style:n,editable:o,onStyle:l,onRemove:u,label:e.label||`row`})]})}),e.cells.map((n,i)=>{let a=t.columns[i],o=Xm(r,e.id,a?.key);return(0,B.jsx)(`td`,{className:(n.partial?`is-partial`:``)+(o.bold?` is-bold`:``)||void 0,children:Zre(n.value,Hm)},a?.key??i)}),(0,B.jsx)(`td`,{className:`cg-ts-total`,children:e.total==null?``:Hm(e.total)}),i&&(0,B.jsx)(`td`,{className:`cg-ts-spark`,children:(0,B.jsx)(uUe,{values:e.cells.map(e=>e.value),label:e.label})})]}),e.deltas.map(e=>(0,B.jsx)(lUe,{delta:e,sparkline:i},e.kind)),a&&(0,B.jsx)(`tr`,{className:`cg-ts-chartrow`,children:(0,B.jsx)(`td`,{colSpan:p,children:f?(0,B.jsx)($He,{spec:f,label:`${e.label} over time`}):(0,B.jsx)(`div`,{className:`cg-ts-note`,children:`Nothing to plot — every period for this metric is unanswered.`})})})]})}function lUe({delta:e,sparkline:t}){return(0,B.jsxs)(`tr`,{className:`cg-ts-delta`,children:[(0,B.jsx)(`th`,{scope:`row`,className:`cg-ts-stick`,children:e.label}),e.values.map((t,n)=>(0,B.jsx)(`td`,{className:t==null?void 0:t>=0?`is-up`:`is-down`,children:e.percent?Wm(t):t==null?`—`:`${t>0?`+`:``}${Hm(t)}`},n)),(0,B.jsx)(`td`,{className:`cg-ts-total`}),t&&(0,B.jsx)(`td`,{className:`cg-ts-spark`})]})}function uUe({values:e,label:t}){let n=(0,L.useMemo)(()=>fie(e,b7,x7),[e]);if(!n.length)return(0,B.jsx)(`span`,{className:`cg-ts-sparkempty`,children:`—`});let r=e.filter(e=>e!=null).length;return(0,B.jsx)(`svg`,{className:`cg-ts-sparksvg`,width:b7,height:x7,viewBox:`0 0 ${b7} ${x7}`,role:`img`,"aria-label":`${t}: trend over ${r} of ${e.length} periods`,children:n.map((e,t)=>(0,B.jsx)(`polyline`,{points:pie(e),fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinejoin:`round`,strokeLinecap:`round`},t))})}function S7(e){return!Number.isFinite(e)||e<0?`—`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function dUe(e){let t=[];return e.by&&t.push(e.by),e.ts&&t.push(e.ts.slice(0,16).replace(`T`,` `)),t.join(` · `)}function fUe({pid:e,docs:t,docPayload:n,onAdd:r,onFetch:i,onDelete:a}){let o=(0,L.useRef)(null),[s,c]=(0,L.useState)(null),[l,u]=(0,L.useState)(!1),d=(0,L.useRef)(null),[f,p]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(!(!n||d.current==null)&&!(n.pid!==e||n.docId!==d.current)){d.current=null;try{let e=atob(n.data_b64),t=new Uint8Array(e.length);for(let n=0;nURL.revokeObjectURL(r),0)}catch{c(`That file could not be decoded. Nothing was downloaded.`)}}},[n,e]);let m=e=>{if(c(null),!e)return;if(e.size>5242880){c(`${e.name} is ${S7(e.size)}. The limit is ${S7(Nd)}, so it was not uploaded.`),o.current&&(o.current.value=``);return}u(!0);let t=new FileReader;t.onerror=()=>{u(!1),c(`${e.name} could not be read.`)},t.onload=()=>{u(!1);let n=String(t.result??``),i=n.indexOf(`,`);if(i<0){c(`${e.name} could not be encoded.`);return}r({name:e.name,mime:e.type||`application/octet-stream`,size:e.size,data_b64:n.slice(i+1)}),o.current&&(o.current.value=``)},t.readAsDataURL(e)};return(0,B.jsxs)(`section`,{className:`cg-detail-section cg-docs`,children:[(0,B.jsx)(`div`,{className:`cg-detail-section-title`,children:`Documents`}),t.length===0?(0,B.jsx)(`div`,{className:`cg-docs-empty`,children:`No documents on this customer yet.`}):(0,B.jsx)(`ul`,{className:`cg-docs-list`,children:t.map(e=>(0,B.jsxs)(`li`,{className:`cg-docs-row`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn cg-docs-name`,title:`Download ${e.name}`,onClick:()=>{c(null),d.current=e.id,i(e.id)},children:e.name}),(0,B.jsxs)(`span`,{className:`cg-docs-meta`,children:[S7(e.size),dUe(e)?` · ${dUe(e)}`:``]}),e.canDelete!==!1&&(0,B.jsx)(`button`,{type:`button`,className:`cg-docs-del`+(f===e.id?` is-armed`:``),"aria-label":f===e.id?`Delete ${e.name}?`:`Delete ${e.name}`,onClick:()=>{if(f!==e.id){p(e.id);return}p(null),a(e.id)},children:f===e.id?`Delete?`:`×`})]},e.id))}),(0,B.jsxs)(`div`,{className:`cg-docs-add`,children:[(0,B.jsx)(`input`,{ref:o,type:`file`,className:`cg-docs-file`,"aria-label":`Add a document`,disabled:l,onChange:e=>m(e.target.files?.[0])}),(0,B.jsxs)(`span`,{className:`cg-docs-cap`,children:[`Up to `,S7(Nd),` per file.`]})]}),s&&(0,B.jsx)(`div`,{className:`cg-docs-error`,children:s})]})}var pUe=`application/x-cg-field`;function mUe(e,t){let n=new Set(t),r=new Set,i=[];for(let t of e??[])!n.has(t)||r.has(t)||(r.add(t),i.push(t));for(let e of t)r.has(e)||(r.add(e),i.push(e));return i}function hUe(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0||r===i)return e;let a=[...e];return a.splice(r,1),a.splice(i,0,t),a}function gUe(e,t,n){let r=e.indexOf(t),i=r+n;if(r<0||i<0||i>=e.length)return e;let a=[...e];return a.splice(r,1),a.splice(i,0,t),a}var _Ue=class extends Error{status;constructor(e,t){super(e),this.name=`RecordCommentsError`,this.status=t}};async function C7(e){let t=null;try{t=await e.json()}catch{}if(e.status===401&&Vd(Id),!e.ok)throw new _Ue(t?.error?.message||`The server answered ${e.status}.`,e.status);return t}async function vUe(e,t){let n=await C7(await fetch(`${Pd}/customers/${e}/comments`,{credentials:Fd,signal:t}));return Array.isArray(n.comments)?n.comments:[]}async function yUe(e,t){return(await C7(await fetch(`${Pd}/customers/${e}/comments`,{method:`POST`,credentials:Fd,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t})}))).comment}async function bUe(e,t){await C7(await fetch(`${Pd}/customers/${e}/comments/${encodeURIComponent(t)}`,{method:`DELETE`,credentials:Fd}))}function xUe(e){return{pid:e,comments:[],draft:``,loading:!0,posting:!1,error:``}}function SUe(e,t){if(t.type===`record`)return xUe(t.pid);if(t.pid!==e.pid)return e;switch(t.type){case`loaded`:return{...e,comments:t.comments,loading:!1,error:``};case`load-failed`:return{...e,loading:!1,error:t.error};case`draft`:return{...e,draft:t.draft};case`posting`:return{...e,posting:!0,error:``};case`posted`:return{...e,comments:[...e.comments,t.comment],draft:``,posting:!1};case`post-failed`:return{...e,posting:!1,error:t.error};case`deleted`:return{...e,comments:e.comments.filter(e=>e.id!==t.commentId)};case`delete-failed`:return{...e,error:t.error}}}function CUe(e){return e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)||`?`}function wUe(e){let t=new Date(e);return Number.isFinite(t.getTime())?new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t):e}function TUe({pid:e,viewer:t}){let[n,r]=(0,L.useReducer)(SUe,e,xUe),{comments:i,draft:a,loading:o,posting:s,error:c}=n,l=(0,L.useRef)(null);(0,L.useEffect)(()=>{let t=new AbortController;return r({type:`record`,pid:e}),vUe(e,t.signal).then(t=>r({type:`loaded`,pid:e,comments:t})).catch(t=>{t instanceof DOMException&&t.name===`AbortError`||r({type:`load-failed`,pid:e,error:t instanceof Error?t.message:`Comments could not be loaded.`})}),()=>t.abort()},[e]);let u=async t=>{t.preventDefault();let n=a.trim();if(!n||s)return;let i=e;r({type:`posting`,pid:i});try{let t=await yUe(i,n);r({type:`posted`,pid:i,comment:t}),i===e&&l.current?.focus()}catch(e){r({type:`post-failed`,pid:i,error:e instanceof Error?e.message:`That comment was not saved.`})}},d=async t=>{let n=e;try{await bUe(n,t.id),r({type:`deleted`,pid:n,commentId:t.id})}catch(e){r({type:`delete-failed`,pid:n,error:e instanceof Error?e.message:`That comment was not deleted.`})}};return(0,B.jsxs)(`aside`,{className:`cg-record-comments`,"aria-label":`Record comments`,children:[(0,B.jsxs)(`div`,{className:`cg-record-comments-head`,children:[(0,B.jsx)(`h2`,{children:`Comments`}),(0,B.jsx)(`span`,{children:i.length.toLocaleString()})]}),(0,B.jsxs)(`div`,{className:`cg-record-comment-feed`,"aria-live":`polite`,children:[o&&(0,B.jsx)(`div`,{className:`cg-record-comment-state`,children:(0,B.jsx)(`span`,{className:`lp-spin`,role:`status`,"aria-label":`Loading`})}),!o&&i.length===0&&!c&&(0,B.jsx)(`div`,{className:`cg-record-comment-state`,children:`No comments yet. Add context for the team here.`}),i.map(e=>{let n=t?.isAdmin===!0||t?.name?.trim().toLowerCase()===e.authorKey.toLowerCase();return(0,B.jsxs)(`article`,{className:`cg-record-comment`,children:[(0,B.jsx)(`div`,{className:`cg-record-comment-avatar`,"aria-hidden":!0,children:CUe(e.author)}),(0,B.jsxs)(`div`,{className:`cg-record-comment-content`,children:[(0,B.jsxs)(`div`,{className:`cg-record-comment-meta`,children:[(0,B.jsx)(`strong`,{children:e.author}),(0,B.jsx)(`time`,{dateTime:e.createdAt,children:wUe(e.createdAt)}),n&&(0,B.jsx)(`button`,{type:`button`,className:`cg-record-comment-delete`,"aria-label":`Delete comment by ${e.author}`,title:`Delete comment`,onClick:()=>void d(e),children:`×`})]}),(0,B.jsx)(`p`,{children:e.body})]})]},e.id)}),c&&(0,B.jsx)(`div`,{className:`cg-record-comment-error`,children:c})]}),(0,B.jsxs)(`form`,{className:`cg-record-comment-compose`,onSubmit:e=>void u(e),children:[(0,B.jsx)(`label`,{htmlFor:`cg-comment-${e}`,children:`Add a comment`}),(0,B.jsx)(`textarea`,{ref:l,id:`cg-comment-${e}`,value:a,maxLength:4e3,placeholder:`Share an update or leave context…`,onChange:t=>r({type:`draft`,pid:e,draft:t.target.value}),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),(0,B.jsxs)(`div`,{className:`cg-record-comment-compose-foot`,children:[(0,B.jsx)(`span`,{children:`Ctrl/⌘ + Enter to post`}),(0,B.jsx)(`button`,{type:`submit`,disabled:s||!a.trim(),children:s?`Posting…`:`Comment`})]})]})]})}function EUe(e,t){let n=t.trim();if(!n)return null;if(e.type===`url`)return/^https?:\/\//i.test(n)?n:/^[\w-]+(\.[\w-]+)+/.test(n)?`https://${n}`:null;if(e.type===`email`)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)?`mailto:${n}`:null;if(e.type===`phone`){let e=n.replace(/[\s().-]/g,``);return/^\+?\d{5,}$/.test(e)?`tel:${e}`:null}return null}function DUe({value:e,...t}){let n=(0,L.useRef)(null);return(0,L.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{e.style.height=`auto`;let t=window.getComputedStyle(e),n=t.boxSizing===`border-box`?(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0):0;e.style.height=`${e.scrollHeight+n}px`};return t(),window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),(0,B.jsx)(`textarea`,{ref:n,value:e,...t})}function OUe({name:e,avatars:t}){let n=t?.[e];if(n&&n.startsWith(`data:image/`))return(0,B.jsx)(`img`,{className:`cg-detail-avatar`,src:n,alt:``,"aria-hidden":!0});let r=lp(e);return(0,B.jsx)(`span`,{className:`cg-detail-avatar cg-detail-avatar--initials`,style:{background:r.bg,color:r.fg},"aria-hidden":!0,children:Pre(e)})}function kUe(){return(0,B.jsx)(`svg`,{width:`10`,height:`14`,viewBox:`0 0 10 14`,"aria-hidden":!0,focusable:`false`,children:[3,7,11].map(e=>[3,7].map(t=>(0,B.jsx)(`circle`,{cx:t,cy:e,r:`1.15`,fill:`currentColor`},`${t}-${e}`)))})}function AUe({fields:e,record:t,titleKey:n,positionLabel:r,canPrev:i,canNext:a,onPrev:o,onNext:s,onClose:c,onNotesChange:l,onNotesCommit:u,viewer:d,docs:f,docPayload:p,onDocAdd:m,onDocFetch:h,onDocDelete:g,recordLayout:_,onRecordLayout:v,scope:y,userOptions:b,userAvatars:x}){let S=(0,L.useRef)(null),C=(0,L.useId)(),w=(0,L.useId)(),T=String(t[n]??`Untitled`),E=!Wd(),D=e.filter(e=>e.source===`overlay`),O=D.filter(e=>!ed(e.type)&&e.type!==`checkbox`&&e.type!==`rating`),k=D.filter(e=>e.type===`checkbox`),A=D.filter(e=>e.type===`rating`),j=D.filter(e=>ed(e.type)),M=e.filter(e=>e.source!==`overlay`&&e.key!==n),ee=new Map(e.map(e=>[e.key,e])),N=[...O,...k,...A,...j,...M].map(e=>e.key),[te,ne]=(0,L.useState)(null);(0,L.useEffect)(()=>{ne(e=>e&&JSON.stringify(e)===JSON.stringify(_??[])?null:e)},[_]);let P=mUe(te??_,N),re=(0,L.useRef)(null),[F,ie]=(0,L.useState)(null),[ae,oe]=(0,L.useState)(null),se=(0,L.useRef)(new Map),ce=(0,L.useRef)(null);(0,L.useLayoutEffect)(()=>{let e=ce.current;e&&(ce.current=null,se.current.get(e)?.focus())});let[le,ue]=(0,L.useState)(null),de=le&&P.includes(le)?le:P[0],fe=e=>{e!==P&&(ne(e),v?.(e))},[pe,me]=(0,L.useState)(`fields`),he=y!=null,ge=he?pe:`fields`,[_e,ve]=(0,L.useState)({mode:`timeseries`}),ye=(0,L.useMemo)(()=>[Number(t.pid)],[t.pid]),be=(0,L.useMemo)(()=>[t],[t]),xe=(e,t)=>(0,B.jsx)(`button`,{type:`button`,className:`cg-detail-grip`,ref:t=>{se.current.set(e.key,t)},draggable:!0,tabIndex:e.key===de?0:-1,onFocus:()=>ue(e.key),"aria-label":`Reorder ${e.label}, position ${t+1} of ${P.length}`,title:`Drag to reorder — or press the arrow keys`,onDragStart:t=>{re.current=e.key,ie(e.key),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(pUe,e.key);let n=t.currentTarget.parentElement;n&&t.dataTransfer.setDragImage(n,14,n.clientHeight/2)},onDragEnd:()=>{re.current=null,ie(null),oe(null)},onKeyDown:t=>{if(t.key!==`ArrowUp`&&t.key!==`ArrowDown`)return;t.preventDefault();let n=gUe(P,e.key,t.key===`ArrowUp`?-1:1);n!==P&&(ce.current=e.key,fe(n))},children:(0,B.jsx)(kUe,{})}),Se=(e,n)=>{let r=`cg-ov-${e.key}`,i=See(e,d),a=e.type===`user`&&!b?.length,o=i&&!a,s=o&&!ed(e.type)&&e.type!==`checkbox`&&e.type!==`rating`&&e.type!==`date`&&e.type!==`int`&&e.type!==`currency`&&e.type!==`pct`,c=o&&!s,f=`cg-detail-field`+(s?` cg-detail-field--edit`:``)+(c?` cg-detail-field--control`:``)+(ae===e.key?` is-dropzone`:``)+(F===e.key?` is-dragging`:``),p;if(s){let n=String(t[e.key]??``),i=EUe(e,n);p=(0,B.jsxs)(`div`,{className:`cg-detail-editwrap`,children:[(0,B.jsx)(DUe,{id:r,className:`cg-detail-textarea`,value:n,placeholder:`Add ${e.label.toLowerCase()}…`,onChange:t=>l(e.key,t.target.value),onBlur:t=>u(e.key,t.target.value)}),i&&(0,B.jsx)(`a`,{className:`cg-detail-action`,href:i,target:e.type===`url`?`_blank`:void 0,rel:e.type===`url`?`noopener noreferrer`:void 0,children:e.type===`url`?`Open link`:e.type===`email`?`Send email`:`Call`})]})}else if(e.source===`overlay`&&e.type===`checkbox`)p=(0,B.jsx)(`input`,{id:r,type:`checkbox`,className:`cg-detail-checkbox`,checked:gp(t[e.key]),disabled:!o,onChange:t=>u(e.key,t.target.checked?`1`:``)});else if(c&&e.type===`rating`){let n=rd(e),i=Em(e,t[e.key]);p=(0,B.jsx)(`span`,{className:`cg-detail-value cg-detail-value--live`,role:`group`,"aria-labelledby":`${r}-lbl`,children:(0,B.jsx)(`span`,{className:`cg-detail-stars`,children:Array.from({length:n},(e,t)=>t+1).map(n=>(0,B.jsx)(`button`,{type:`button`,className:`cg-detail-star`,"aria-pressed":n<=i,"aria-label":n===i?`Clear ${e.label}`:`${n} star${n===1?``:`s`}`,title:n===i?`Click again to clear`:void 0,onClick:()=>u(e.key,Nre(e,t[e.key],n)),children:(0,B.jsx)(bm,{on:n<=i})},n))})})}else if(c&&(e.type===`select`||e.type===`user`)){let n=xm(t[e.key]),i=wm(e,b,n);p=(0,B.jsxs)(`span`,{className:`cg-detail-value cg-detail-value--live cg-detail-pickslot`,children:[e.type===`user`&&n!==``&&(0,B.jsx)(OUe,{name:n,avatars:x}),(0,B.jsxs)(`select`,{id:r,className:`cg-detail-select`,value:n,onChange:t=>u(e.key,t.target.value),children:[(0,B.jsx)(`option`,{value:``,children:e.type===`user`?`Unassigned`:`None`}),i.map(e=>(0,B.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]})}else if(c&&e.type===`multiselect`){let n=t[e.key],i=Cm(n),a=wm(e,b,n);p=(0,B.jsx)(`span`,{className:`cg-detail-value cg-detail-value--live`,role:`group`,"aria-labelledby":`${r}-lbl`,children:a.length===0?(0,B.jsx)(`span`,{className:`cg-detail-nochoice`,children:`No choices yet. Add them from the column menu.`}):(0,B.jsx)(`span`,{className:`cg-detail-chips`,children:a.map(t=>{let r=i.includes(t.value);return(0,B.jsx)(`button`,{type:`button`,className:`cg-detail-chip`+(r?` is-on`:``),"aria-pressed":r,title:t.stale?`No longer a choice on this field`:void 0,onClick:()=>u(e.key,jre(n,t.value)),children:t.label},t.value)})})})}else if(c&&e.type===`date`){let n=t[e.key],i=Dre(n);p=i===null?(0,B.jsxs)(`span`,{className:`cg-detail-value cg-detail-value--live cg-detail-pickslot`,children:[(0,B.jsx)(`input`,{id:r,type:`text`,className:`cg-detail-input`,value:xm(n),title:`This value is not a date the picker can read — it is shown as stored.`,onChange:t=>l(e.key,t.target.value),onBlur:t=>u(e.key,t.target.value)}),(0,B.jsx)(`span`,{className:`cg-detail-hint`,children:`not a recognised date`})]}):(0,B.jsx)(`span`,{className:`cg-detail-value cg-detail-value--live`,children:(0,B.jsx)(`input`,{id:r,type:`date`,className:`cg-detail-input`,value:i,onChange:t=>u(e.key,kre(n,t.target.value))})})}else if(c&&(e.type===`int`||e.type===`currency`||e.type===`pct`)){let n=e.type===`currency`?`$`:e.type===`pct`?`%`:``;p=(0,B.jsxs)(`span`,{className:`cg-detail-value cg-detail-value--live cg-detail-pickslot`,children:[e.type===`currency`&&(0,B.jsx)(`span`,{className:`cg-detail-unit`,children:n}),(0,B.jsx)(`input`,{id:r,type:`number`,className:`cg-detail-input cg-detail-input--num`,value:Tm(t[e.key]),step:e.type===`int`?1:`any`,placeholder:`—`,onChange:t=>l(e.key,t.target.value),onBlur:n=>{let r=Mre(n.target.value);r===null?l(e.key,Tm(t[e.key])):u(e.key,r)}}),e.type===`pct`&&(0,B.jsx)(`span`,{className:`cg-detail-unit`,children:n})]})}else if(e.source===`overlay`&&e.type===`rating`)p=(0,B.jsx)(`span`,{className:`cg-detail-value`,title:a?void 0:`You do not have permission to edit this field`,children:(0,B.jsx)(Ere,{value:Em(e,t[e.key]),max:rd(e)})});else{let n=e.source===`overlay`?a?`No assignable people were supplied for this workspace`:`You do not have permission to edit this field`:void 0,r=e.type===`user`&&xm(t[e.key])!==``;p=(0,B.jsxs)(`span`,{className:`cg-detail-value`+(r?` cg-detail-pickslot`:``),title:n,children:[r&&(0,B.jsx)(OUe,{name:xm(t[e.key]),avatars:x}),yp(e,t[e.key])||`—`]})}let m=c&&(e.type===`rating`||e.type===`multiselect`),h=!m&&(s||c||e.source===`overlay`&&e.type===`checkbox`);return(0,B.jsxs)(`div`,{className:f,onDragOver:t=>{re.current&&(t.preventDefault(),t.dataTransfer.dropEffect=`move`,ae!==e.key&&oe(e.key))},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||oe(t=>t===e.key?null:t)},onDrop:t=>{t.preventDefault();let n=t.dataTransfer.getData(`application/x-cg-field`)||re.current;oe(null),n&&fe(hUe(P,n,e.key))},children:[xe(e,n),h?(0,B.jsx)(`label`,{className:`cg-detail-label`,htmlFor:r,children:e.label}):(0,B.jsx)(`span`,{className:`cg-detail-label`,id:m?`${r}-lbl`:void 0,children:e.label}),p]},e.key)};return jp({panelRef:S,onDismiss:c,dismissOnOutside:!0,initialFocus:`[data-overlay-autofocus]`,trapFocus:!0}),(0,B.jsx)(Mp,{children:(0,B.jsx)(`div`,{className:`cg-record-backdrop`,children:(0,B.jsxs)(`div`,{className:`cg-record-modal`+(E?``:` cg-record-modal--single`),ref:S,role:`dialog`,"aria-modal":`true`,"aria-labelledby":C,"data-overlay-kind":`record-detail`,tabIndex:-1,children:[(0,B.jsxs)(`div`,{className:`cg-detail-header`,children:[(0,B.jsxs)(`div`,{className:`cg-detail-nav`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-detail-navbtn`,onClick:o,disabled:!i,"aria-label":`Previous record`,title:`Previous record`,children:`‹`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-detail-navbtn`,onClick:s,disabled:!a,"aria-label":`Next record`,title:`Next record`,children:`›`}),(0,B.jsx)(`span`,{className:`cg-detail-pos`,children:r})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-detail-close`,"data-overlay-autofocus":!0,onClick:c,"aria-label":`Close panel`,title:`Close`,children:`×`})]}),(0,B.jsxs)(`div`,{className:`cg-record-layout`,children:[(0,B.jsxs)(`main`,{className:`cg-record-main`,children:[(0,B.jsx)(`div`,{className:`cg-detail-titlewrap`,children:(0,B.jsx)(`div`,{className:`cg-detail-title`,id:C,title:T,children:T})}),he&&(0,B.jsx)(`div`,{className:`cg-record-tabs`,role:`tablist`,"aria-label":`Record view`,children:[`fields`,`insights`].map(e=>(0,B.jsx)(`button`,{type:`button`,role:`tab`,id:`${w}-${e}`,"aria-selected":ge===e,"aria-controls":`${w}-panel`,className:`cg-record-tab`+(ge===e?` is-on`:``),onClick:()=>me(e),children:e===`fields`?`Fields`:`Insights`},e))}),(0,B.jsx)(`div`,{className:`cg-detail-body`,id:`${w}-panel`,role:he?`tabpanel`:void 0,"aria-labelledby":he?`${w}-${ge}`:void 0,children:ge===`insights`&&y?(0,B.jsx)(`div`,{className:`cg-record-insights`,children:(0,B.jsx)(oUe,{scope:y,pids:ye,fields:e,rows:be,display:_e,onDisplay:e=>ve(t=>({...t,...e})),locked:!0})}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`section`,{className:`cg-detail-section cg-detail-fieldlist`,children:P.map((e,t)=>{let n=ee.get(e);return n?Se(n,t):null})}),m&&h&&g&&(0,B.jsx)(fUe,{pid:Number(t.pid),docs:f??[],docPayload:p,onAdd:m,onFetch:h,onDelete:g})]})})]}),E&&(0,B.jsx)(TUe,{pid:Number(t.pid),viewer:d},Number(t.pid))]})]})})})}var w7=(e,t)=>typeof e==`number`&&t-e<=12e4;function jUe(e,t){let n={},r=e=>{if(!e)return;let n=Object.entries(e).filter(([,e])=>w7(e,t));return n.length?Object.fromEntries(n.slice(-64)):void 0},i=e=>{if(!e)return;let n=Object.entries(e).filter(([,e])=>w7(e.at,t));return n.length?Object.fromEntries(n.slice(-64)):void 0},a=r(e?.created),o=i(e?.renamed),s=r(e?.deleted),c=i(e?.moved);return a&&(n.created=a),o&&(n.renamed=o),s&&(n.deleted=s),c&&(n.moved=c),n}function MUe(e,t,n,r){let i=e??[],a=[],o=new Set;for(let e of i){if(w7(n?.deleted?.[e.id],r))continue;o.add(e.id);let t=n?.renamed?.[e.id];a.push(w7(t?.at,r)&&t?{...e,name:t.name}:e)}for(let e of t??[])o.has(e.id)||w7(n?.created?.[e.id],r)&&(w7(n?.deleted?.[e.id],r)||a.push(e));return a.sort((e,t)=>(e.order??0)-(t.order??0)||e.name.localeCompare(t.name))}function NUe(e,t,n,r,i){let a=r?.moved?.[e],o=w7(a?.at,i)&&a?a.folderId:t??null;return o==null?null:n.some(e=>e.id===o)?o:null}function PUe(e,t,n){let r=new Map(t.map(e=>[e.id,[]])),i=[];for(let t of e){let e=n(t),a=e==null?void 0:r.get(e);a?a.push(t):i.push(t)}let a=t.map(e=>({folder:e,items:r.get(e.id)??[]}));return a.push({folder:null,items:i}),a}function FUe(){return`fld_${typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}`}function IUe({views:e,activeViewId:t,saveState:n,onSelect:r,onCreate:i,onRename:a,onNote:o,onDuplicate:s,onDelete:c,lists:l=[],onAddToList:u,onCohortLock:d,today:f,onExport:p,folders:m,folderIdOf:h,onFolderCreate:g,onFolderRename:_,onFolderDelete:v,onFolderDuplicate:y,onItemMove:b,folderAddPreview:x,onFolderAddToList:S,viewer:C,onToggleLock:w,userOptions:T=[]}){let[E,D]=(0,L.useState)(null),[O,k]=(0,L.useState)(null),[A,j]=(0,L.useState)(``),[M,ee]=(0,L.useState)(`personal`),[N,te]=(0,L.useState)([]),[ne,P]=(0,L.useState)(null),[re,F]=(0,L.useState)(null),[ie,ae]=(0,L.useState)(null),[oe,se]=(0,L.useState)(``),[ce,le]=(0,L.useState)(null),[ue,de]=(0,L.useState)(null),[fe,pe]=(0,L.useState)(``),[me,he]=(0,L.useState)(null),ge=me?e.find(e=>e.id===me.viewId):void 0,_e=ce?e.find(e=>e.id===ce.viewId):void 0,ve=ne?e.find(e=>e.id===ne.viewId):void 0,ye=!!ve&&Od(ve,C),[be,xe]=(0,L.useState)(new Set),[Se,Ce]=(0,L.useState)(null),[we,Te]=(0,L.useState)(null),[Ee,De]=(0,L.useState)(!1),[Oe,ke]=(0,L.useState)(``),[Ae,je]=(0,L.useState)({shape:jd,tone:Md}),[Me,Ne]=(0,L.useState)(null),[Pe,Fe]=(0,L.useState)(null),[Ie,Le]=(0,L.useState)(null),[Re,ze]=(0,L.useState)(``),[Be,Ve]=(0,L.useState)(null),[He,Ue]=(0,L.useState)(``),[We,Ge]=(0,L.useState)(()=>{try{return localStorage.getItem(`aios-views-rail`)===`1`}catch{return!1}}),Ke=()=>Ge(e=>{let t=!e;try{localStorage.setItem(`aios-views-rail`,t?`1`:`0`)}catch{}return t}),qe=He.trim().toLowerCase(),Je=qe?e.filter(e=>(e.name||``).toLowerCase().includes(qe)):e,Ye=!!m&&!!h&&!!b,Xe=PUe(Je,Ye?m:[],e=>h?h(e.id):null),Ze=Se?m?.find(e=>e.id===Se.id):void 0,Qe=Pe&&x?x(Pe):null,$e=e=>Ye?{onDragOver:t=>{t.preventDefault(),Ve(e??`__root__`)},onDragLeave:()=>Ve(null),onDrop:t=>{t.preventDefault(),Ve(null);let n=t.dataTransfer.getData(`text/plain`);n&&b?.(n,e)}}:{},et=ie?e.find(e=>e.id===ie.viewId):void 0,tt=()=>{let e=A.trim();!e||!E||(i(e,E,zee({edit:M,users:N},`personal`,T)),j(``),ee(`personal`),te([]),D(null))},nt=()=>{let e=Oe.trim();e&&(g?.(e,Vee(Ae)),ke(``),je({shape:jd,tone:Md}),De(!1))},I=e=>{k(null),De(!1),D(e)},rt=()=>{k(null),D(null),De(!0)},it=e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=[...e.currentTarget.querySelectorAll(`[role="menuitem"]`)];if(!t.length)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1)%t.length:(n-1+t.length)%t.length]?.focus()};return(0,B.jsxs)(`aside`,{className:`cg-views`+(We?` is-collapsed`:``),"aria-label":`Customer views`,children:[(0,B.jsx)(`div`,{className:`cg-views-top`,children:(0,B.jsx)(`button`,{type:`button`,className:`cg-rail-toggle`,"aria-label":We?`Expand views`:`Minimize views`,"aria-expanded":!We,title:We?`Expand views`:`Minimize views`,onClick:Ke,children:(0,B.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M2.5 4.4h11M2.5 8h11M2.5 11.6h11`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`})})})}),(0,B.jsx)(`div`,{className:`cg-sr-only`,"aria-live":`polite`,children:n===`saving`?`Saving changes…`:`All changes saved`}),(0,B.jsx)(`div`,{className:`cg-create-new`,children:(0,B.jsxs)(`button`,{type:`button`,className:`cg-link-btn cg-create-btn`,"aria-haspopup":`menu`,"aria-expanded":!!O,onClick:e=>k(t=>t?null:e.currentTarget),children:[(0,B.jsx)(`span`,{className:`cg-create-icon`,"aria-hidden":`true`,children:`+`}),(0,B.jsx)(`span`,{className:`cg-create-label`,children:`Create new…`})]})}),(0,B.jsxs)(`div`,{className:`cg-find-view`,children:[(0,B.jsxs)(`svg`,{className:`cg-find-view-icon`,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.4`,stroke:`currentColor`,strokeWidth:`1.35`}),(0,B.jsx)(`path`,{d:`m10.4 10.4 3.1 3.1`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`})]}),(0,B.jsx)(`input`,{type:`text`,value:He,placeholder:`Find a view`,"aria-label":`Find a view`,onChange:e=>Ue(e.target.value),onKeyDown:e=>{e.key===`Escape`&&Ue(``)}})]}),E&&(0,B.jsxs)(`div`,{className:`cg-view-create cg-create-form`,children:[(0,B.jsxs)(`label`,{htmlFor:`cg-new-view`,children:[`New `,Rf[E].toLowerCase(),` view`]}),(0,B.jsx)(`input`,{id:`cg-new-view`,className:`cg-input`,autoFocus:!0,value:A,placeholder:`e.g. Florida at risk`,onChange:e=>j(e.target.value),onKeyDown:e=>{e.key===`Enter`&&tt(),e.key===`Escape`&&D(null)}}),(0,B.jsxs)(`div`,{className:`cg-perm`,role:`radiogroup`,"aria-label":`Who can edit this view`,children:[(0,B.jsx)(`span`,{className:`cg-perm-title`,children:`Who can edit`}),Dd.map(e=>(0,B.jsxs)(`label`,{className:`cg-radio-row cg-perm-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-view-perm`,checked:M===e,onChange:()=>ee(e)}),(0,B.jsxs)(`span`,{className:`cg-perm-label`,children:[Lee[e],(0,B.jsx)(`span`,{className:`cg-perm-blurb`,children:Ree[e]})]})]},e)),M===`users`&&(0,B.jsxs)(`div`,{className:`cg-perm-users`,children:[T.length===0?(0,B.jsx)(`span`,{className:`cg-perm-empty`,children:`No other accounts to pick — this will save as Personal.`}):T.map(e=>(0,B.jsxs)(`label`,{className:`cg-perm-user`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:N.includes(e),onChange:t=>te(n=>t.target.checked?[...n,e].slice(0,50):n.filter(t=>t!==e))}),(0,B.jsx)(`span`,{children:e})]},e)),T.length>0&&N.length===0&&(0,B.jsx)(`span`,{className:`cg-perm-empty`,children:`Pick at least one person, or this saves as Personal.`})]})]}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,onClick:tt,disabled:!A.trim(),children:`Create`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>D(null),children:`Cancel`})]})]}),Ye&&g&&Ee&&(0,B.jsxs)(`div`,{className:`cg-view-create cg-create-form cg-fold-form`,children:[(0,B.jsx)(`label`,{htmlFor:`cg-new-folder`,children:`New folder`}),(0,B.jsx)(`input`,{id:`cg-new-folder`,className:`cg-input`,autoFocus:!0,value:Oe,placeholder:`Folder name`,onChange:e=>ke(e.target.value),onKeyDown:e=>{e.key===`Enter`&&nt(),e.key===`Escape`&&De(!1)}}),(0,B.jsxs)(`div`,{className:`cg-fold-pick`,role:`group`,"aria-label":`Folder icon`,children:[(0,B.jsx)(`div`,{className:`cg-fold-pick-row`,children:kd.map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-fold-swatch`+(Ae.shape===e?` is-on`:``),"aria-pressed":Ae.shape===e,"aria-label":Fte[e],title:Fte[e],onClick:()=>je(t=>({...t,shape:e})),children:(0,B.jsx)(Hp,{icon:{shape:e,tone:Ae.tone},size:15})},e))}),(0,B.jsx)(`div`,{className:`cg-fold-pick-row`,children:Ad.map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-fold-swatch`+(Ae.tone===e?` is-on`:``),"aria-pressed":Ae.tone===e,"aria-label":Pte[e],title:Pte[e],onClick:()=>je(t=>({...t,tone:e})),children:(0,B.jsx)(Hp,{icon:{shape:Ae.shape,tone:e},size:15})},e))})]}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,onClick:nt,disabled:!Oe.trim(),children:`Create`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>De(!1),children:`Cancel`})]})]}),O&&(0,B.jsxs)(Np,{anchor:O,className:`cg-view-menu cg-create-flyout`,placement:`right-start`,role:`menu`,ariaLabel:`Create new`,onDismiss:()=>k(null),onKeyDown:it,dataKind:`create-new`,children:[Ite.map(e=>(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`cg-create-row`,onClick:()=>I(e),children:[(0,B.jsx)(Lp,{mode:e,tone:Lte[e],size:16}),(0,B.jsx)(`span`,{children:Rf[e]})]},e)),Ye&&g&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`cg-menu-sep`,role:`separator`,"aria-hidden":!0}),(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`cg-create-row`,onClick:()=>rt(),children:[(0,B.jsx)(Hp,{size:16}),(0,B.jsx)(`span`,{children:`Folder`})]})]})]}),(0,B.jsx)(`div`,{className:`cg-view-list cg-views-scroll`,children:Xe.map(e=>{let n=e.folder?.id??null;if(qe&&e.folder&&e.items.length===0)return null;let i=n===null,o=n!=null&&be.has(n);return(0,B.jsxs)(`div`,{className:(i?`cg-fold-root`:`cg-fold`)+(Be===(n??`__root__`)?` is-drop`:``),...$e(n),children:[e.folder&&(0,B.jsxs)(`div`,{className:`cg-fold-head`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`cg-fold-toggle`,"aria-expanded":!o,onClick:()=>xe(t=>{let n=new Set(t);return n.has(e.folder.id)?n.delete(e.folder.id):n.add(e.folder.id),n}),children:[(0,B.jsx)(`span`,{className:`cg-fold-chev`+(o?` is-shut`:``),"aria-hidden":!0,children:`▾`}),(0,B.jsx)(Hp,{icon:e.folder.icon,size:16}),we===e.folder.id?(0,B.jsx)(`input`,{className:`cg-input cg-fold-rename`,autoFocus:!0,defaultValue:e.folder.name,onClick:e=>e.stopPropagation(),onBlur:t=>{let n=t.target.value.trim();n&&n!==e.folder.name&&_?.(e.folder.id,n),Te(null)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&Te(null)}}):(0,B.jsx)(`span`,{className:`cg-fold-name`,children:e.folder.name}),(0,B.jsx)(`span`,{className:`cg-fold-count`,children:e.items.length})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-view-more`,"aria-label":`Actions for folder ${e.folder.name}`,"aria-haspopup":`menu`,onClick:t=>Ce(n=>n?.id===e.folder.id?null:{id:e.folder.id,anchor:t.currentTarget}),children:`···`})]}),!o&&e.items.map(e=>{let n=e.id===t,i=re===e.id,o=wd(e);return(0,B.jsxs)(`div`,{className:`cg-view-row`+(n?` is-active`:``)+(e.config?.cohortLock?` cg-view-lockset`:``),draggable:Ye&&!i&&Od(e,C),onDragStart:t=>t.dataTransfer.setData(`text/plain`,e.id),children:[i?(0,B.jsx)(`input`,{className:`cg-view-rename cg-input`,autoFocus:!0,defaultValue:e.name,onBlur:t=>{let n=t.target.value.trim();n&&n!==e.name&&a(e.id,n),F(null)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&F(null)}}):(0,B.jsxs)(`button`,{type:`button`,className:`cg-view-main`,onClick:()=>r(e.id),title:e.note?`${e.name} — ${e.note}`:e.name,children:[(0,B.jsx)(Lp,{mode:o,tone:Lte[o],size:16}),(0,B.jsxs)(`span`,{className:`cg-view-text`,children:[(0,B.jsx)(`span`,{className:`cg-view-name`,children:e.name}),e.note&&(0,B.jsx)(`span`,{className:`cg-view-desc`,children:e.note})]}),(e.kind===`locked`||Td(e))&&(0,B.jsx)(`span`,{className:`cg-view-lock`,role:`img`,"aria-label":e.kind===`locked`?`${e.name}, a locked view`:`${Rf[o]} view, locked`,title:e.kind===`locked`?`Locked — this view shows only the records locked into it. Filters, sorts and columns still narrow within them.`+(Td(e)?` It also stays a ${Rf[o].toLowerCase()}.`:``):`Locked — this view stays a ${Rf[o].toLowerCase()}. Filters, sorts and columns are still editable.`,children:(0,B.jsx)(Vp,{})})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-view-more`,"aria-label":`Actions for ${e.name}`,"aria-haspopup":`menu`,"aria-expanded":ne?.viewId===e.id,onClick:t=>P(n=>n?.viewId===e.id?null:{viewId:e.id,anchor:t.currentTarget}),children:`···`})]},e.id)}),e.folder&&!o&&e.items.length===0&&(0,B.jsx)(`div`,{className:`cg-fold-empty`,children:`Empty — drag a view here.`})]},n??`__root__`)})}),Se&&Ze&&(0,B.jsxs)(Np,{anchor:Se.anchor,className:`cg-view-menu`,placement:`bottom-end`,role:`menu`,ariaLabel:`Actions for folder ${Ze.name}`,onDismiss:()=>{Ce(null),Ne(null)},dataKind:`folder-menu`,children:[(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,className:`cg-menu-item`,onClick:()=>{Te(Ze.id),Ce(null)},children:`Rename`}),x&&S&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,className:`cg-menu-item`,onClick:()=>{Fe(Ze.id),Le(Se.anchor),ze(f?`${Ze.name} · ${f}`:Ze.name),Ce(null)},children:`Add to cohort…`}),y&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,className:`cg-menu-item`,onClick:()=>{y(Ze.id),Ce(null)},children:`Duplicate folder and its views`}),v&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,className:`cg-menu-item cg-menu-item--danger`+(Me===Ze.id?` is-armed`:``),onClick:()=>{if(Me!==Ze.id){Ne(Ze.id);return}v(Ze.id),Ne(null),Ce(null)},children:Me===Ze.id?`Delete folder? Its views move to the top level.`:`Delete folder`})]}),ue&&d&&(()=>{let t=e.find(e=>e.id===ue.viewId)?.config?.cohortLock;return(0,B.jsxs)(Np,{anchor:ue.anchor,className:`cg-pop cg-lock-pop`,placement:`bottom-start`,role:`dialog`,ariaLabel:`Lock this view to a locked view`,onDismiss:()=>de(null),dataKind:`view-cohort-lock`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Lock to a locked view`}),(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`This view can then only ever show the records locked into the view you pick. Filters still narrow within it, and the lock cannot be removed as a condition.`}),(l??[]).map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-pick-row`+(e.id===t?` is-on`:``),onClick:()=>{d(ue.viewId,e.id),de(null)},children:e.name},e.id)),t&&(0,B.jsx)(`button`,{type:`button`,className:`cg-pick-row cg-lock-clear`,onClick:()=>{d(ue.viewId,null),de(null)},children:`Unlock — show the whole table again`})]})})(),Pe&&Ie&&Qe&&S&&(0,B.jsxs)(Np,{anchor:Ie??void 0,className:`cg-pop cg-fold-addpop`,placement:`bottom-start`,role:`dialog`,ariaLabel:`Add this folder's customers to a locked view`,onDismiss:()=>Fe(null),dataKind:`folder-add-to-list`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Add to cohort`}),(0,B.jsxs)(`div`,{className:`cg-pop-note`,children:[Qe.pids.length.toLocaleString(),` customer`,Qe.pids.length===1?``:`s`,` from `,Qe.counted.toLocaleString(),` `,`view`,Qe.counted===1?``:`s`,` in this folder, counted once each.`]}),Qe.skipped.length>0&&(0,B.jsxs)(`div`,{className:`cg-pop-note cg-fold-skipped`,children:[`Not included:`,Qe.skipped.map(e=>(0,B.jsxs)(`span`,{className:`cg-fold-skip`,children:[e.name,` — `,e.why]},e.name))]}),(l??[]).map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-pick-row`,onClick:()=>{S(Pe,e.id,e.name),Fe(null)},children:e.name},e.id)),(0,B.jsxs)(`div`,{className:`cg-view-create`,children:[(0,B.jsx)(`label`,{htmlFor:`cg-fold-new-list`,children:`Lock records into a new view`}),(0,B.jsx)(`input`,{id:`cg-fold-new-list`,className:`cg-input`,"data-overlay-autofocus":!0,value:Re,onChange:e=>ze(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Re.trim()&&(S(Pe,``,Re.trim()),Fe(null))}}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!Re.trim()||Qe.pids.length===0,onClick:()=>{S(Pe,``,Re.trim()),Fe(null)},children:`Create and add`})]})]}),ne&&ve&&(0,B.jsxs)(Np,{anchor:ne.anchor,className:`cg-view-menu`,placement:`bottom-end`,role:`menu`,ariaLabel:`Actions for ${ve.name}`,onDismiss:()=>P(null),onKeyDown:it,dataKind:`saved-view-menu`,children:[p&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{he({viewId:ve.id,anchor:ne.anchor}),P(null)},children:(0,B.jsx)(zp,{icon:`download`,text:`Export`})}),(0,B.jsx)(`div`,{className:`cg-menu-sep`,role:`separator`,"aria-hidden":!0})]}),ye&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{F(ve.id),P(null)},children:(0,B.jsx)(zp,{icon:`rename`,text:`Rename`})}),ye&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{se(ve.note??``),ae({viewId:ve.id,anchor:ne.anchor}),P(null)},children:(0,B.jsx)(zp,{icon:`description`,text:ve.note?`Edit description`:`Add description`})}),(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{s(ve.id),P(null)},children:(0,B.jsx)(zp,{icon:`duplicate`,text:`Duplicate`})}),u&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{pe(f?`${ve.name} · ${f}`:ve.name),le({viewId:ve.id,anchor:ne.anchor}),P(null)},children:(0,B.jsx)(zp,{icon:`cohortAdd`,text:`Add to locked view`})}),d&&l.length>0&&ye&&ve.kind!==`locked`&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{de({viewId:ve.id,anchor:ne.anchor}),P(null)},children:(0,B.jsx)(zp,{icon:`permissions`,text:ve.config?.cohortLock?`Change the lock…`:`Lock to a locked view…`})}),w&&ve.kind!==`system`&&ye&&Ed(ve,C)&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{w(ve.id,!Td(ve)),P(null)},children:(0,B.jsx)(zp,{icon:Td(ve)?`unlock`:(0,B.jsx)(Ip,{mode:wd(ve),size:16}),text:Td(ve)?`Unlock view`:`Lock as ${Rf[wd(ve)]}`})}),!Cd(ve)&&ye&&(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,className:`is-danger`,onClick:()=>{c(ve.id),P(null)},children:(0,B.jsx)(zp,{icon:`trash`,text:`Delete`})})]}),me&&ge&&p&&(0,B.jsxs)(Np,{anchor:me.anchor,className:`cg-view-menu`,placement:`bottom-end`,role:`menu`,ariaLabel:`Export ${ge.name}`,onDismiss:()=>he(null),onKeyDown:it,dataKind:`view-export`,children:[(0,B.jsxs)(`div`,{className:`cg-pop-title cg-export-title`,children:[`Export `,ge.name]}),Fre.map(e=>(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{p(ge.id,e),he(null)},children:Ire[e]},e))]}),ce&&_e&&u&&(0,B.jsxs)(Np,{anchor:ce.anchor,className:`cg-pop cg-add-list-pop`,placement:`bottom-end`,role:`dialog`,ariaLabel:`Add ${_e.name} to a locked view`,onDismiss:()=>le(null),dataKind:`add-to-list`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Add to cohort`}),(0,B.jsxs)(`div`,{className:`cg-pop-note`,children:[`Adds the customers `,(0,B.jsx)(`strong`,{children:_e.name}),` matches right now. The cohort stays fixed as the data changes.`]}),l.map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-pick-row`,onClick:()=>{u(_e.id,e.id,e.name),le(null)},children:e.name},e.id)),(0,B.jsxs)(`div`,{className:`cg-view-create`,children:[(0,B.jsx)(`label`,{htmlFor:`cg-new-list`,children:`Lock records into a new view`}),(0,B.jsx)(`input`,{id:`cg-new-list`,className:`cg-input`,"data-overlay-autofocus":!0,value:fe,placeholder:`e.g. Q3 call plan`,onChange:e=>pe(e.target.value),onKeyDown:e=>{e.key===`Enter`&&fe.trim()&&(u(_e.id,``,fe.trim()),le(null))}}),(0,B.jsx)(`div`,{className:`cg-form-actions`,children:(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!fe.trim(),onClick:()=>{u(_e.id,``,fe.trim()),le(null)},children:`Create and add`})})]})]}),ie&&et&&(0,B.jsxs)(Np,{anchor:ie.anchor,className:`cg-pop cg-view-note-pop`,placement:`bottom-end`,role:`dialog`,ariaLabel:`Description for ${et.name}`,onDismiss:()=>ae(null),dataKind:`saved-view-note`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Description`}),(0,B.jsxs)(`label`,{className:`cg-column-note`,children:[(0,B.jsx)(`span`,{children:`Shown under this view's name in the list.`}),(0,B.jsx)(`textarea`,{"data-overlay-autofocus":!0,value:oe,maxLength:2e3,placeholder:`What is this list for?…`,onChange:e=>se(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:oe===(et.note??``),onClick:()=>{o(et.id,oe),ae(null)},children:`Save description`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>ae(null),children:`Cancel`})]})]})]})}var T7=30,LUe={ABS:[1,1],ROUND:[1,2],ROUNDUP:[1,2],ROUNDDOWN:[1,2],INT:[1,1],MOD:[2,2],SQRT:[1,1],POWER:[2,2],EXP:[1,1],LN:[1,1],SUM:[1,T7],AVERAGE:[1,T7],COUNT:[1,T7],COUNTA:[1,T7],MIN:[1,T7],MAX:[1,T7],IF:[2,3],AND:[1,T7],OR:[1,T7],NOT:[1,1],IFERROR:[2,2],ISBLANK:[1,1],CONCATENATE:[1,T7],LEFT:[1,2],RIGHT:[1,2],MID:[3,3],LEN:[1,1],TRIM:[1,1],UPPER:[1,1],LOWER:[1,1],PROPER:[1,1],VALUE:[1,1],TEXT:[2,2],TODAY:[0,0],YEAR:[1,1],MONTH:[1,1],DAY:[1,1],DAYS:[2,2]},RUe={CONCAT:`CONCATENATE`},zUe=new Set([`<`,`<=`,`>`,`>=`,`=`,`!=`]);function BUe(e){let t=[],n=0;for(;n=e.length)return`a text value is missing its closing quote`;if(e[r]===`"`){if(e[r+1]===`"`){i+=`"`,r+=2;continue}break}i+=e[r],r+=1}t.push({t:`str`,v:i}),n=r+1;continue}if(/[0-9]/.test(r)||r===`.`&&/[0-9]/.test(e[n+1]??``)){let r=/^(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)/.exec(e.slice(n));if(!r||/^[0-9.]/.test(e[n+r[0].length]??``))return`unreadable number at "${e.slice(n,n+8)}"`;t.push({t:`num`,v:Number(r[0])}),n+=r[0].length;continue}if(/[A-Za-z_]/.test(r)){let r=/^[A-Za-z_][A-Za-z0-9_]*/.exec(e.slice(n));t.push({t:`ident`,v:r[0]}),n+=r[0].length;continue}let i=e.slice(n,n+2);if(i===`<=`||i===`>=`||i===`!=`||i===`==`||i===`<>`){t.push({t:`op`,v:i===`==`?`=`:i===`<>`?`!=`:i}),n+=2;continue}if(`+-*/^&(),<>=`.includes(r)){t.push({t:`op`,v:r}),n+=1;continue}return`unexpected character "${r}"`}return t}function E7(e){if(typeof e!=`string`||e.trim()===``)return{ok:!1,error:`the formula is empty`};if(e.length>500)return{ok:!1,error:`formula longer than 500 characters`};let t=BUe(e);if(typeof t==`string`)return{ok:!1,error:t};if(t.length===0)return{ok:!1,error:`the formula is empty`};if(t.length>200)return{ok:!1,error:`formula has more than 200 tokens`};let n=0,r=()=>t[n],i=e=>{let r=t[n];return r?.t===`op`&&r.v===e},a=null,o=e=>(a===null&&(a=e),null);function s(e){if(e>24)return o(`formula is nested too deeply`);let t=c(e);if(!t)return null;let i=r();if(i?.t===`op`&&zUe.has(i.v)){n+=1;let a=c(e);if(!a)return null;let s=r();return s?.t===`op`&&zUe.has(s.v)?o(`comparisons cannot be chained (a < b < c)`):{t:`cmp`,op:i.v,l:t,r:a}}return t}function c(e){let t=l(e);if(!t)return null;for(;i(`&`);){n+=1;let r=l(e);if(!r)return null;t={t:`bin`,op:`&`,l:t,r}}return t}function l(e){let t=u(e);if(!t)return null;for(;;)if(i(`+`)||i(`-`)){let i=r().v;n+=1;let a=u(e);if(!a)return null;t={t:`bin`,op:i,l:t,r:a}}else return t}function u(e){let t=d(e);if(!t)return null;for(;;)if(i(`*`)||i(`/`)){let i=r().v;n+=1;let a=d(e);if(!a)return null;t={t:`bin`,op:i,l:t,r:a}}else return t}function d(e){if(e>24)return o(`formula is nested too deeply`);let t=f(e);if(!t)return null;if(i(`^`)){n+=1;let r=d(e+1);return r?{t:`bin`,op:`^`,l:t,r}:null}return t}function f(e){if(e>24)return o(`formula is nested too deeply`);if(i(`-`)){n+=1;let t=f(e+1);return t?{t:`neg`,e:t}:null}return p(e)}function p(e){if(e>24)return o(`formula is nested too deeply`);let t=r();if(!t)return o(`the formula ends unexpectedly`);if(t.t===`num`)return n+=1,{t:`num`,v:t.v};if(t.t===`str`)return n+=1,{t:`str`,v:t.v};if(t.t===`ref`)return n+=1,{t:`ref`,k:t.k};if(t.t===`op`&&t.v===`(`){n+=1;let t=s(e+1);return t?i(`)`)?(n+=1,t):o(`missing closing parenthesis`):null}if(t.t===`ident`){let r=t.v.toUpperCase();if(r===`TRUE`||r===`FALSE`)return n+=1,{t:`bool`,v:r===`TRUE`};let a=RUe[r]??r;if(!(a in LUe))return o(`unknown function ${r} — see the formula help for what is available`);if(n+=1,!i(`(`))return o(`${a} must be called with parentheses: ${a}(…)`);n+=1;let c=[];if(!i(`)`))for(;;){let t=s(e+1);if(!t)return null;if(c.push(t),i(`,`)){n+=1;continue}break}if(!i(`)`))return o(`missing closing parenthesis on ${a}(…)`);n+=1;let[l,u]=LUe[a];return c.lengthu?o(l===u?`${a} takes exactly ${l} argument${l===1?``:`s`}`:`${a} takes ${l} to ${u} arguments`):{t:`call`,fn:a,args:c}}return o(`unexpected "${t.t===`op`?t.v:String(t.v)}"`)}let m=s(1);if(!m)return{ok:!1,error:a??`could not parse the formula`};if(n!==t.length){let e=t[n];return{ok:!1,error:`unexpected "${e.t===`op`||e.t===`ident`?e.v:e.t===`ref`?`{${e.k}}`:String(e.v)}" after the formula`}}return{ok:!0,ast:m,refs:VUe(m)}}function VUe(e){let t=[],n=e=>{switch(e.t){case`ref`:t.includes(e.k)||t.push(e.k);return;case`neg`:n(e.e);return;case`bin`:case`cmp`:n(e.l),n(e.r);return;case`call`:e.args.forEach(n);return;default:return}};return n(e),t}function D7(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(e==null)return null;if(typeof e==`string`){let t=e.trim();if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}return null}function O7(e){return typeof e==`number`&&Number.isFinite(e)?e:typeof e==`string`?D7(e):null}function k7(e){return e==null?``:typeof e==`string`?e:typeof e==`boolean`?e?`TRUE`:`FALSE`:HUe(e)}function HUe(e){return String(Number.isInteger(e)?e:Number(e.toFixed(10)))}function UUe(e,t){if(!Number.isInteger(t)||t<-10||t>10)return null;let n=10**t,r=Math.sign(e)*Math.round(Math.abs(e)*n)/n;return Number.isFinite(r)?r:null}function A7(e){if(typeof e!=`string`)return null;let t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]);return r<1||r>12||i<1||i>31?null:{y:n,m:r,d:i}}function WUe(e){return Date.UTC(e.y,e.m-1,e.d)/864e5}function GUe(e,t){let n=/^(\$?)(#,##0|0)(?:\.(0+))?(%?)$/.exec(t.trim());if(!n)return null;let[,r,i,a,o]=n,s=e;o===`%`&&(s*=100);let c=a?a.length:0,l=s<0||Object.is(s,-0)?`-`:``,[u,d]=Math.abs(s).toFixed(c).split(`.`);return i===`#,##0`&&(u=u.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)),l+r+u+(c?`.`+d:``)+(o===`%`?`%`:``)}function j7(e,t){let n=[];for(let r of e){let e=t(r);if(e==null)continue;let i=O7(e);i!=null&&n.push(i)}return n}function KUe(e,t,n){let r=e=>KUe(e,t,n);switch(e.t){case`num`:return e.v;case`str`:return e.v;case`bool`:return e.v;case`ref`:{let n=t(e.k);return typeof n==`string`||typeof n==`number`&&Number.isFinite(n)?n:null}case`neg`:{let t=O7(r(e.e));return t==null?null:-t}case`bin`:{if(e.op===`&`)return k7(r(e.l))+k7(r(e.r));let t=O7(r(e.l));if(t==null)return null;let n=O7(r(e.r));if(n==null)return null;let i;switch(e.op){case`+`:i=t+n;break;case`-`:i=t-n;break;case`*`:i=t*n;break;case`/`:if(n===0)return null;i=t/n;break;case`^`:i=t**+n;break}return Number.isFinite(i)?i:null}case`cmp`:{let t=r(e.l),n=r(e.r),i=typeof t==`number`?t:null,a=typeof n==`number`?n:null,o=i??(typeof t==`string`?D7(t):null),s=a??(typeof n==`string`?D7(n):null);if(o!=null&&s!=null)return qUe(e.op,o,s);if(typeof t==`string`&&typeof n==`string`){let r=t.trim().toLowerCase(),i=n.trim().toLowerCase();return r===``||i===``?null:qUe(e.op,ri),0)}return null}case`call`:switch(e.fn){case`ABS`:{let t=O7(r(e.args[0]));return t==null?null:Math.abs(t)}case`ROUND`:case`ROUNDUP`:case`ROUNDDOWN`:{let t=O7(r(e.args[0]));if(t==null)return null;let n=e.args.length>1?O7(r(e.args[1])):0;if(n==null||!Number.isInteger(n)||n<-10||n>10)return null;if(e.fn===`ROUND`)return UUe(t,n);let i=10**n,a=t*i,o=(e.fn===`ROUNDUP`?Math.sign(a)*Math.ceil(Math.abs(a)):Math.sign(a)*Math.floor(Math.abs(a)))/i;return Number.isFinite(o)?o:null}case`INT`:{let t=O7(r(e.args[0]));return t==null?null:Math.floor(t)}case`MOD`:{let t=O7(r(e.args[0])),n=O7(r(e.args[1]));return t==null||n==null||n===0?null:t-n*Math.floor(t/n)}case`SQRT`:{let t=O7(r(e.args[0]));return t==null||t<0?null:Math.sqrt(t)}case`POWER`:{let t=O7(r(e.args[0])),n=O7(r(e.args[1]));if(t==null||n==null)return null;let i=t**+n;return Number.isFinite(i)?i:null}case`EXP`:{let t=O7(r(e.args[0]));if(t==null)return null;let n=Math.exp(t);return Number.isFinite(n)?n:null}case`LN`:{let t=O7(r(e.args[0]));return t==null||t<=0?null:Math.log(t)}case`SUM`:return j7(e.args,r).reduce((e,t)=>e+t,0);case`AVERAGE`:{let t=j7(e.args,r);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}case`COUNT`:return j7(e.args,r).length;case`COUNTA`:{let t=0;for(let n of e.args){let e=r(n);e!=null&&e!==``&&(t+=1)}return t}case`MIN`:case`MAX`:{let t=j7(e.args,r);return t.length===0?null:e.fn===`MIN`?Math.min(...t):Math.max(...t)}case`IF`:{let t=r(e.args[0]);return typeof t==`boolean`?t?r(e.args[1]):e.args.length>2?r(e.args[2]):null:null}case`AND`:case`OR`:for(let t of e.args){let n=r(t);if(typeof n!=`boolean`)return null;if(e.fn===`AND`&&!n)return!1;if(e.fn===`OR`&&n)return!0}return e.fn===`AND`;case`NOT`:{let t=r(e.args[0]);return typeof t==`boolean`?!t:null}case`IFERROR`:return r(e.args[0])??r(e.args[1]);case`ISBLANK`:{let t=r(e.args[0]);return t==null||t===``}case`CONCATENATE`:return e.args.map(e=>k7(r(e))).join(``);case`LEFT`:case`RIGHT`:{let t=k7(r(e.args[0])),n=e.args.length>1?O7(r(e.args[1])):1;return n==null||!Number.isInteger(n)||n<0?null:e.fn===`LEFT`?t.slice(0,n):n===0?``:t.slice(-n)}case`MID`:{let t=k7(r(e.args[0])),n=O7(r(e.args[1])),i=O7(r(e.args[2]));return n==null||i==null||!Number.isInteger(n)||!Number.isInteger(i)||n<1||i<0?null:t.slice(n-1,n-1+i)}case`LEN`:return k7(r(e.args[0])).length;case`TRIM`:return k7(r(e.args[0])).replace(/\s+/g,` `).trim();case`UPPER`:return k7(r(e.args[0])).toUpperCase();case`LOWER`:return k7(r(e.args[0])).toLowerCase();case`PROPER`:return k7(r(e.args[0])).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase());case`VALUE`:return O7(r(e.args[0]));case`TEXT`:{let t=O7(r(e.args[0])),n=r(e.args[1]);return t==null||typeof n!=`string`?null:GUe(t,n)}case`TODAY`:return typeof n.today==`string`&&A7(n.today)?n.today:null;case`YEAR`:case`MONTH`:case`DAY`:{let t=A7(r(e.args[0]));return t?e.fn===`YEAR`?t.y:e.fn===`MONTH`?t.m:t.d:null}case`DAYS`:{let t=A7(r(e.args[0])),n=A7(r(e.args[1]));return!t||!n?null:Math.round(WUe(t)-WUe(n))}}return null;default:return null}}function qUe(e,t,n){switch(e){case`<`:return t`:return t>n;case`>=`:return t>=n;case`=`:return t===n;case`!=`:return t!==n}}function JUe(e,t,n={}){try{let r=KUe(e,t,n);return typeof r==`number`?Number.isFinite(r)?r:null:typeof r==`string`?r:typeof r==`boolean`?r?`TRUE`:`FALSE`:null}catch{return null}}function YUe(e){let t=new Map;for(let[n,r]of e){let i=E7(r);t.set(n,i.ok?i.refs.filter(t=>e.has(t)&&t!==n):[])}let n=[],r=new Map,i=new Set,a=(e,o)=>{let s=r.get(e);if(s===2)return!i.has(e);if(s===1){for(let t=o.lastIndexOf(e);t({value:e,label:zf[e]}));function P7(e){return e===`select`||e===`multiselect`}var F7=[`Not started`,`In progress`,`Blocked`,`Done`],XUe=0;function I7(){return XUe+=1,`choice-${XUe}`}function L7(e,t=void 0){return e.map(e=>({id:I7(),label:e,color:ap(t?.[e])??ap(pp(e))}))}function R7(e,t){let n=e.map(e=>t===`multiselect`?e.label.replace(/,/g,` `):e.label),r=pee(n.join(` -`)),i=new Map;e.forEach((e,t)=>{let r=n[t].trim();r&&!i.has(r.toLowerCase())&&i.set(r.toLowerCase(),e)});let a={};for(let e of r){let t=ap(i.get(e.toLowerCase())?.color);t&&t!==ap(pp(e))&&(a[e]=t)}return{options:r,colors:a}}function ZUe(e,t){return e.map(e=>`${e}\u0000${ap(t?Object.entries(t).find(([t])=>t.trim().toLowerCase()===e.toLowerCase())?.[1]:void 0)??ap(pp(e))}`).join(``)}function QUe({value:e,disabled:t,label:n,onPick:r}){let[i,a]=(0,L.useState)(!1),o=(0,L.useRef)(null),s=cp(e);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{ref:o,type:`button`,className:`cg-option-color`,disabled:t,style:{background:s?.bg??ap(e)??`#FFFFFF`},"aria-label":`Colour for ${n}${s?` — ${s.label}`:``}`,"aria-haspopup":`dialog`,"aria-expanded":i,title:`Change option colour`,onClick:()=>a(e=>!e)}),i&&o.current&&(0,B.jsx)(Np,{anchor:o.current,className:`cg-pop cg-swatch-pop`,onDismiss:()=>a(!1),role:`dialog`,ariaLabel:`Colour for ${n}`,dataKind:`option-colour`,children:(0,B.jsx)(`div`,{className:`cg-swatch-grid`,children:sp.map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-swatch`+(s?.id===e.id?` is-on`:``),style:{background:e.bg,color:e.fg},"aria-label":e.label,"aria-pressed":s?.id===e.id,title:e.label,onClick:()=>{r(e.bg),a(!1)},children:s?.id===e.id&&(0,B.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`m3.5 8.5 3 3 6-6.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})},e.id))})})]})}function z7({idPrefix:e,drafts:t,onDrafts:n,colorCode:r,onColorCode:i,type:a}){let o=(e,r)=>n(t.map(t=>t.id===e?{...t,...r}:t)),s=R7(t,a);return(0,B.jsxs)(`div`,{className:`cg-options-editor`,children:[(0,B.jsxs)(`div`,{className:`cg-options-head`,children:[(0,B.jsx)(`strong`,{children:`Options`}),(0,B.jsxs)(`label`,{className:`cg-option-toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),(0,B.jsx)(`span`,{children:`Color-code options`})]})]}),(0,B.jsx)(`div`,{className:`cg-option-list`,children:t.map((i,s)=>(0,B.jsxs)(`div`,{className:`cg-option-row`,children:[(0,B.jsx)(QUe,{value:ap(i.color)??ip[s%ip.length].bg,disabled:!r,label:i.label||`option ${s+1}`,onPick:e=>o(i.id,{color:e})}),(0,B.jsx)(`input`,{id:`${e}-${i.id}`,className:`cg-input cg-option-name`,type:`text`,maxLength:120,value:i.label,placeholder:`Option name`,"aria-label":`Option ${s+1}`,onChange:e=>{let t=a===`multiselect`?e.target.value.replace(/,/g,` `):e.target.value;o(i.id,{label:t})},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n([...t,{id:I7(),label:``,color:ip[t.length%ip.length].bg}]))}}),(0,B.jsx)(`button`,{type:`button`,className:`cg-option-remove`,"aria-label":`Remove ${i.label||`option ${s+1}`}`,title:`Remove option`,onClick:()=>n(t.filter(e=>e.id!==i.id)),children:(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]},i.id))}),(0,B.jsx)(`button`,{type:`button`,className:`cg-option-add`,onClick:()=>n([...t,{id:I7(),label:``,color:ip[t.length%ip.length].bg}]),children:`Add option`}),(0,B.jsxs)(`span`,{className:`cg-field-hint`,children:[s.options.length,` option`,s.options.length===1?``:`s`,`.`,a===`multiselect`&&` Commas inside an option are not supported.`]})]})}function $Ue({value:e,onPick:t,offerMeasure:n,only:r}){let[i,a]=(0,L.useState)(``),o=i.trim().toLowerCase(),s=[...r?N7.filter(e=>r.includes(e.value)):N7,...n?[{value:`measure`,label:`Metric`}]:[]].filter(e=>!o||e.label.toLowerCase().includes(o));return(0,B.jsxs)(`div`,{className:`cg-type-picker`,children:[(0,B.jsxs)(`div`,{className:`cg-type-search`,children:[(0,B.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.4`,stroke:`currentColor`,strokeWidth:`1.35`}),(0,B.jsx)(`path`,{d:`m10.4 10.4 3.1 3.1`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`})]}),(0,B.jsx)(`input`,{type:`text`,value:i,placeholder:`Find a field type`,"aria-label":`Find a field type`,onChange:e=>a(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`cg-type-list`,role:`listbox`,"aria-label":`Field type`,children:[s.map(n=>(0,B.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e===n.value,className:`cg-type-row`+(e===n.value?` is-on`:``),onClick:()=>t(n.value),children:[(0,B.jsx)(Fp,{type:n.value===`measure`?`currency`:n.value,size:16}),(0,B.jsx)(`span`,{className:`cg-type-label`,children:n.label}),e===n.value&&(0,B.jsx)(`svg`,{className:`cg-type-check`,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`m3.5 8.5 3 3 6-6.5`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},n.value)),s.length===0&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`No matching type.`})]})]})}var eWe=`new:`,tWe=$u.filter(e=>e!==`formula`&&e!==`created_time`),nWe={kind:`ltm`};function B7({title:e,sub:t,onClose:n}){return(0,B.jsxs)(`div`,{className:`cg-column-head`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`cg-column-title`,children:e}),t&&(0,B.jsx)(`div`,{className:`cg-column-type`,children:t})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-icon-btn`,onClick:n,"aria-label":`Close column menu`,children:`×`})]})}function rWe({value:e,onValue:t}){return(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Scope`}),(0,B.jsxs)(`select`,{className:`cg-select cg-scope-select`,value:e,"aria-label":`Field scope`,onChange:e=>t(e.target.value),children:[(0,B.jsx)(`option`,{value:`cohort`,disabled:e!==`cohort`,children:`The cohort table only (retired)`}),(0,B.jsx)(`option`,{value:`global`,children:`All customer tables`})]})]})}function V7({kind:e,fields:t,formulaText:n,onFormulaText:r,formulaError:i,maxValue:a,onMaxValue:o,idPrefix:s,showFormulaHelp:c=!0}){if(e===`formula`){let e=t.filter(e=>e.key!==`__proto__`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Formula`}),(0,B.jsx)(`textarea`,{className:`cg-input cg-formula-editor`,rows:3,value:n,placeholder:`MAX(0, {revenue_ly} - {revenue_ytd})`,"aria-label":`Formula`,onChange:e=>r(e.target.value)})]}),(0,B.jsx)(`div`,{className:`cg-cond-line cg-formula-insert`,children:(0,B.jsx)(Gp,{ariaLabel:`Insert a field reference`,placeholder:`Insert a field reference…`,value:void 0,keepOpen:!0,onChange:e=>r((n+` {`+e+`}`).trimStart()),fields:e.map(e=>({key:e.key,label:e.label,type:e.type}))})}),n.trim()!==``&&i?(0,B.jsx)(`div`,{className:`cg-field-hint cg-formula-error`,children:i}):c?(0,B.jsxs)(`div`,{className:`cg-field-hint`,children:[`Excel-style: numbers, text in quotes, `,`{field}`,` references, + − × ÷ ^ & ( ), IF · AND · OR · SUM · AVERAGE · COUNT · MIN · MAX · ROUND(UP/DOWN) · ABS · MOD · SQRT · CONCATENATE · LEFT · RIGHT · MID · LEN · TRIM · UPPER · LOWER · PROPER · TEXT · VALUE · TODAY · DAYS · YEAR · MONTH · DAY · IFERROR · ISBLANK. Errors show a blank cell.`]}):null]})}return e===`rating`?(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Number of stars`}),(0,B.jsx)(`input`,{id:`${s}-rating-max`,className:`cg-input cg-rating-max`,type:`number`,min:2,max:10,value:a,"aria-label":`Number of stars`,onChange:e=>{let t=Math.round(Number(e.target.value));o(Number.isFinite(t)?Math.max(2,Math.min(10,t)):5)}})]}):e===`created_time`?(0,B.jsx)(`div`,{className:`cg-field-hint`,children:`Read-only. When the record was created in the source system.`}):null}function iWe({state:e,field:t,fields:n,locked:r,viewer:i,sortedDir:a,isFiltered:o,isGrouped:s,groupable:c,onClose:l,onNote:u,onHide:d,onCreate:f,onChangeField:p,onCreateAndSwap:m,onRetype:h,onRename:g,onFormula:_,initialPosition:v,scopeChoice:y=!1,pinnedTo:b=!1,onPinTo:x,onUnpin:S,onPeriod:C,onDelete:w,onDuplicate:T,onPermissions:E,onFormat:D,onSort:O,onClearSort:k,onFilterBy:A,onClearFilter:j,onGroupByField:M,onClearGroup:ee,userOptions:N=[],measures:te=[]}){let[ne,P]=(0,L.useState)(`menu`),[re,F]=(0,L.useState)(t.note??``),[ie,ae]=(0,L.useState)(v??null),[oe,se]=(0,L.useState)(!1),[ce,le]=(0,L.useState)(``),[ue,de]=(0,L.useState)(!1),[fe,pe]=(0,L.useState)(`text`),[me,he]=(0,L.useState)(()=>L7(F7)),[ge,_e]=(0,L.useState)(!0),[ve,ye]=(0,L.useState)(te[0]?.key??``),[be,xe]=(0,L.useState)(nWe),[Se,Ce]=(0,L.useState)(``),[we,Te]=(0,L.useState)(5),[Ee,De]=(0,L.useState)(``),[Oe,ke]=(0,L.useState)(``),[Ae,je]=(0,L.useState)(()=>L7(F7)),[Me,Ne]=(0,L.useState)(!0),[Pe,Fe]=(0,L.useState)(``),[Ie,Le]=(0,L.useState)(5),[Re,ze]=(0,L.useState)(null),[Be,Ve]=(0,L.useState)(t.permissions?.edit??`everyone`),[He,Ue]=(0,L.useState)(()=>({...t.format??{}})),[We,Ge]=(0,L.useState)(`cohort`),[Ke,qe]=(0,L.useState)(t.label),[Je,Ye]=(0,L.useState)(t.type),[Xe,Ze]=(0,L.useState)(()=>L7(nd(t).length?nd(t):F7,t.optionColors)),[Qe,$e]=(0,L.useState)(t.colorCodeOptions!==!1),[et,tt]=(0,L.useState)(()=>rd(t)),[nt,I]=(0,L.useState)(()=>typeof t.formula==`string`?t.formula:``),rt=Ee.startsWith(eWe)?Ee.slice(4):null,it=R7(me,fe),at=it.options,ot=rt?R7(Ae,rt):{options:[],colors:{}},st=ot.options,ct=R7(Xe,Je),lt=ct.options,ut=(0,L.useMemo)(()=>new Set(n.filter(e=>e.type!==`formula`).map(e=>e.key)),[n]),dt=(0,L.useMemo)(()=>{let e=new Map;for(let t of n){if(t.type!==`formula`)continue;let n=typeof t.formula==`string`?t.formula:``;n&&e.set(t.key,n)}return e},[n]),ft=(0,L.useMemo)(()=>Se.trim()===``?{ok:!1,error:`Type a formula`,refs:[]}:M7(Se,ut,dt),[Se,ut,dt]),pt=(0,L.useMemo)(()=>Pe.trim()===``?{ok:!1,error:`Type a formula`,refs:[]}:M7(Pe,ut,dt),[Pe,ut,dt]),mt=te.find(e=>e.key===ve),ht=mt?`${mt.label} · ${Zu(be)}`:``,gt=fe===`measure`&&!ue&&!ce.trim()?ht:ce,_t=gt.trim()!==``&&(!P7(fe)||at.length>0)&&(fe!==`measure`||!!mt)&&(fe!==`formula`||ft.ok),vt=(e,t,n)=>{if(e===`formula`)return{formula:t.trim()};if(e===`rating`)return{max:n}},yt=(e,t,n)=>P7(e)?{colorCodeOptions:n,...Object.keys(t).length?{optionColors:t}:{}}:{},bt=e=>y?{...e??{},scope:We}:e,xt=()=>{let e=gt.trim();if(!(!e||!ie||!_t)){if(fe===`measure`){if(!mt)return;f(e,mt.type,ie===`end`?null:t.key,ie,void 0,{key:mt.key,window:be},bt(void 0)),l();return}f(e,fe,ie===`end`?null:t.key,ie,P7(fe)?at:void 0,void 0,bt({...vt(fe,Se,we),...yt(fe,it.colors,ge)})),l()}},St=rt!=null&&Oe.trim()!==``&&(!P7(rt)||st.length>0)&&(rt!==`formula`||pt.ok),Ct=()=>{!rt||!St||(m(Oe.trim(),rt,P7(rt)?st:void 0,bt({...vt(rt,Pe,Ie),...yt(rt,ot.colors,Me)})),l())},wt=Ke.trim(),Tt=!!g&&wt!==``&&wt!==t.label,Et=P7(Je)&<.join(` -`)!==nd(t).join(` -`),Dt=P7(Je)&&(Qe!==(t.colorCodeOptions!==!1)||ZUe(lt,ct.colors)!==ZUe(nd(t),t.optionColors)),Ot=Je===`rating`&&et!==rd(t),kt=h!=null&&(Je!==t.type||Et||Dt||Ot),At=!P7(Je)||lt.length>0,jt=(0,L.useMemo)(()=>nt.trim()===``?{ok:!1,error:`Type a formula`,refs:[]}:M7(nt,ut,dt,t.key),[nt,ut,dt,t.key]),Mt=!!_&&t.type===`formula`&&nt.trim()!==(typeof t.formula==`string`?t.formula.trim():``),Nt=kt&&!At||Mt&&!jt.ok,Pt=t.measure?Yu(t.measure.window):null,Ft=Re?Yu(Re):null,It=Ft!=null&&JSON.stringify(Ft)!==JSON.stringify(Pt),Lt=!!t.measure&&!!C,Rt=!Nt&&(Tt||kt||Mt||Lt&&It),zt=()=>{Rt&&(kt&&h?h(Je,P7(Je)?lt:void 0,{...Je===`rating`?{max:et}:{},...P7(Je)?{colorCodeOptions:Qe,...Object.keys(ct.colors).length?{optionColors:ct.colors}:{}}:{},...Tt?{label:wt}:{}}):Mt&&_?_(nt.trim(),Tt?wt:void 0):Tt&&g&&g(wt),Lt&&It&&Ft&&C(Ft),l())},Bt=n.filter(e=>e.key!==t.key),Vt=Bt.filter(e=>e.source===`odoo`&&!e.custom),Ht=Bt.filter(e=>!(e.source===`odoo`&&!e.custom)),Ut=t.measure?`Metric, read-only`:t.type===`formula`?`Formula field, computed`:t.type===`created_time`?`Created time, read-only`:t.derived?`Read-only, derived`:t.source===`odoo`?`Read-only source field`:`Editable overlay field`,Wt=t.scope===`cohort`?`${Ut} · this cohort only`:Ut,Gt=t.type===`int`||t.type===`currency`||t.type===`formula`?`number`:t.type===`date`||t.type===`created_time`?`date`:null;if(ie)return(0,B.jsxs)(Np,{anchor:e.anchor,className:`cg-column-menu`,onDismiss:l,role:`dialog`,ariaLabel:ie===`end`?`Add field`:`Insert field ${ie} of ${t.label}`,initialFocus:`[data-overlay-autofocus]`,dataKind:`column-menu`,children:[(0,B.jsx)(B7,{title:ie===`end`?`Add field`:ie===`left`?`Insert field left`:`Insert field right`,sub:ie===`end`?`Added as the last column`:`Next to ${t.label}`,onClose:l}),(0,B.jsxs)(`div`,{className:`cg-column-create`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Name`}),(0,B.jsx)(`input`,{className:`cg-input`,autoFocus:!0,"data-overlay-autofocus":!0,value:gt,onChange:e=>{le(e.target.value),de(!0)},onKeyDown:e=>e.key===`Enter`&&xt()})]}),(0,B.jsxs)(`div`,{className:`cg-type-block`,children:[(0,B.jsx)(`span`,{className:`cg-type-title`,children:`Field type`}),(0,B.jsx)($Ue,{value:fe,onPick:pe,offerMeasure:te.length>0})]}),fe===`measure`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Number`}),(0,B.jsx)(Gp,{ariaLabel:`Number to summarise`,placeholder:`Choose a number…`,value:mt?ve:void 0,onChange:ye,fields:te.map(e=>({key:e.key,label:e.label,type:`measure`}))})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Period`}),(0,B.jsx)(`span`,{className:`cg-measure-window`,children:(0,B.jsx)(Jp,{window:be,onWindow:xe})})]}),(0,B.jsx)(`div`,{className:`cg-field-hint`,children:`A total, average or count over the period you choose — e.g. Sales, last 90 days. Computed for every customer, and read-only.`})]}),(0,B.jsx)(V7,{kind:fe,fields:n,formulaText:Se,onFormulaText:Ce,formulaError:ft.ok?null:ft.error??null,maxValue:we,onMaxValue:Te,idPrefix:`cg-create`}),P7(fe)&&(0,B.jsx)(z7,{idPrefix:`cg-create-option`,drafts:me,onDrafts:he,colorCode:ge,onColorCode:_e,type:fe}),fe===`user`&&(0,B.jsx)(`div`,{className:`cg-field-hint`,children:N.length?`${N.length} people can be assigned, from your user list.`:`No user list yet, so there is no one to assign.`}),y&&(0,B.jsx)(rWe,{value:We,onValue:Ge}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!_t,onClick:xt,children:`Create field`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>v?l():ae(null),children:`Cancel`})]})]})]});if(ne===`edit`)return(0,B.jsxs)(Np,{anchor:e.anchor,className:`cg-column-menu`,onDismiss:l,role:`dialog`,ariaLabel:`Edit field ${t.label}`,initialFocus:`[data-overlay-autofocus]`,dataKind:`column-menu`,children:[(0,B.jsx)(B7,{title:`Edit field`,sub:Wt,onClose:l}),(0,B.jsxs)(`div`,{className:`cg-column-create`,children:[g?(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Name`}),(0,B.jsx)(`input`,{className:`cg-input`,autoFocus:!0,"data-overlay-autofocus":!0,value:Ke,onChange:e=>qe(e.target.value),onKeyDown:e=>e.key===`Enter`&&zt()})]}):(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Name`}),(0,B.jsx)(`input`,{className:`cg-input`,value:t.label,disabled:!0,"aria-label":`Field name (read-only)`}),(0,B.jsx)(`span`,{className:`cg-field-hint`,children:`A source field keeps its name and type from the data source.`})]}),h&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`cg-type-block`,children:[(0,B.jsx)(`span`,{className:`cg-type-title`,children:`Field type`}),(0,B.jsx)($Ue,{value:Je,onPick:e=>Ye(e),offerMeasure:!1,only:tWe})]}),Je===`rating`&&(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Number of stars`}),(0,B.jsx)(`input`,{className:`cg-input cg-rating-max`,type:`number`,min:2,max:10,value:et,"aria-label":`Number of stars`,onChange:e=>{let t=Math.round(Number(e.target.value));tt(Number.isFinite(t)?Math.max(2,Math.min(10,t)):5)}})]}),P7(Je)&&(0,B.jsx)(z7,{idPrefix:`cg-edit-option`,drafts:Xe,onDrafts:Ze,colorCode:Qe,onColorCode:$e,type:Je}),Je!==t.type&&(0,B.jsxs)(`div`,{className:`cg-field-hint`,children:[`Changes `,t.label,` into a `,zf[Je].toLowerCase(),` field, keeping its name and its values as entered. Cells that cannot be read in the new type show blank.`]})]}),Lt&&(0,B.jsxs)(`label`,{className:`cg-edit-period`,children:[(0,B.jsx)(`span`,{children:`Period`}),(0,B.jsx)(`span`,{className:`cg-measure-window`,children:(0,B.jsx)(Jp,{window:Re??t.measure.window,onWindow:ze})}),(0,B.jsx)(`span`,{className:`cg-field-hint`,children:`The window this number is computed over, for every customer.`})]}),!h&&t.type===`formula`&&_&&(0,B.jsx)(V7,{kind:`formula`,fields:n,formulaText:nt,onFormulaText:I,formulaError:jt.ok?null:jt.error??null,maxValue:et,onMaxValue:tt,idPrefix:`cg-edit`,showFormulaHelp:!1}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!Rt,onClick:zt,children:`Save`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>P(`menu`),children:`Back`})]}),!r&&Bt.length>0&&(0,B.jsxs)(`div`,{className:`cg-edit-swap`,children:[(0,B.jsx)(`span`,{className:`cg-type-title`,children:`Change field`}),(0,B.jsx)(`div`,{className:`cg-field-hint`,children:`Show a different field in this column — the current one is hidden, not lost.`}),(0,B.jsxs)(`div`,{className:`cg-column-swap`,children:[(0,B.jsx)(Gp,{className:`cg-swap-select`,ariaLabel:`Change this column to another field`,placeholder:`Choose a field…`,overlayAutofocus:!g,value:Ee||void 0,onChange:De,fields:[...Vt.map(e=>({key:e.key,label:e.label,type:e.type,group:`Pre-set fields`})),...Ht.map(e=>({key:e.key,label:e.label,type:e.type,group:`Your fields`})),...N7.map(e=>({key:eWe+e.value,label:e.label,type:e.value,group:`New field`}))]}),!rt&&(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!Ee,onClick:()=>{p(Ee),l()},children:`Change`})]}),rt&&(0,B.jsxs)(`div`,{className:`cg-column-create cg-swap-create`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsxs)(`span`,{children:[`New `,zf[rt].toLowerCase(),` field`]}),(0,B.jsx)(`input`,{className:`cg-input`,autoFocus:!0,value:Oe,placeholder:`Field name`,onChange:e=>ke(e.target.value),onKeyDown:e=>e.key===`Enter`&&Ct()})]}),(0,B.jsx)(V7,{kind:rt,fields:n,formulaText:Pe,onFormulaText:Fe,formulaError:pt.ok?null:pt.error??null,maxValue:Ie,onMaxValue:Le,idPrefix:`cg-swap`}),P7(rt)&&(0,B.jsx)(z7,{idPrefix:`cg-swap-option`,drafts:Ae,onDrafts:je,colorCode:Me,onColorCode:Ne,type:rt}),rt===`user`&&(0,B.jsx)(`div`,{className:`cg-field-hint`,children:N.length?`${N.length} people can be assigned.`:`No user list was supplied by the host yet.`}),y&&(0,B.jsx)(rWe,{value:We,onValue:Ge}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:!St,onClick:Ct,children:`Create and change`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>De(``),children:`Cancel`})]})]})]})]})]});if(ne===`note`)return(0,B.jsxs)(Np,{anchor:e.anchor,className:`cg-column-menu`,onDismiss:l,role:`dialog`,ariaLabel:`Edit description for ${t.label}`,initialFocus:`[data-overlay-autofocus]`,dataKind:`column-menu`,children:[(0,B.jsx)(B7,{title:`Edit field description`,sub:t.label,onClose:l}),(0,B.jsxs)(`div`,{className:`cg-column-create`,children:[t.description&&(0,B.jsxs)(`div`,{className:`cg-field-hint cg-desc-default`,children:[`Default description: `,t.description]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Your description`}),(0,B.jsx)(`textarea`,{className:`cg-input`,"data-overlay-autofocus":!0,autoFocus:!0,rows:4,value:re,placeholder:t.description?`Write your own to replace the default…`:`Explain how this field should be used…`,onChange:e=>F(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:re===(t.note??``),onClick:()=>{u(re),l()},children:`Save`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>P(`menu`),children:`Back`})]})]})]});if(ne===`permissions`)return(0,B.jsxs)(Np,{anchor:e.anchor,className:`cg-column-menu`,onDismiss:l,role:`dialog`,ariaLabel:`Edit permissions for ${t.label}`,initialFocus:`[data-overlay-autofocus]`,dataKind:`column-menu`,children:[(0,B.jsx)(B7,{title:`Edit field permissions`,sub:t.label,onClose:l}),(0,B.jsxs)(`div`,{className:`cg-column-create`,children:[(0,B.jsxs)(`div`,{className:`cg-field-hint`,children:[`Who can edit this field's values`,t.createdBy?` (created by ${t.createdBy})`:``,`.`]}),[[`everyone`,`Everyone`],[`creator`,`Only the creator`],[`admins`,`Only admins`]].map(([e,t])=>(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-perm`,"data-overlay-autofocus":e===`everyone`||void 0,checked:Be===e,onChange:()=>Ve(e)}),(0,B.jsx)(`span`,{children:t})]},e)),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:Be===(t.permissions?.edit??`everyone`),onClick:()=>{E?.(Be),l()},children:`Save`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>P(`menu`),children:`Back`})]})]})]});if(ne===`format`&&Gt)return(0,B.jsxs)(Np,{anchor:e.anchor,className:`cg-column-menu`,onDismiss:l,role:`dialog`,ariaLabel:`Format ${t.label}`,initialFocus:`[data-overlay-autofocus]`,dataKind:`column-menu`,children:[(0,B.jsx)(B7,{title:`Field format`,sub:t.label,onClose:l}),(0,B.jsxs)(`div`,{className:`cg-column-create`,children:[Gt===`number`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,"data-overlay-autofocus":!0,checked:He.thousands!==!1,onChange:e=>Ue(t=>({...t,thousands:e.target.checked}))}),(0,B.jsx)(`span`,{children:`Thousands separator (12,345)`})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Decimal places`}),(0,B.jsxs)(`select`,{className:`cg-select`,value:Number.isInteger(He.decimals)?String(He.decimals):``,"aria-label":`Decimal places`,onChange:e=>Ue(t=>{let n={...t};return e.target.value===``?delete n.decimals:n.decimals=Number(e.target.value),n}),children:[(0,B.jsx)(`option`,{value:``,children:`As entered`}),[0,1,2,3,4].map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]}),(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:He.abbrev===!0,onChange:e=>Ue(t=>({...t,abbrev:e.target.checked}))}),(0,B.jsx)(`span`,{children:`Abbreviate large numbers (34.0M)`})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,"data-overlay-autofocus":!0,checked:He.time??t.type===`created_time`,onChange:e=>Ue(t=>({...t,time:e.target.checked}))}),(0,B.jsx)(`span`,{children:`Include the time of day`})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:`Time zone`}),(0,B.jsxs)(`select`,{className:`cg-select`,value:He.tz===`utc`?`utc`:`local`,"aria-label":`Time zone`,onChange:e=>Ue(t=>({...t,tz:e.target.value})),children:[(0,B.jsx)(`option`,{value:`local`,children:`Your local time`}),(0,B.jsx)(`option`,{value:`utc`,children:`UTC`})]})]})]}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,disabled:JSON.stringify(He)===JSON.stringify(t.format??{}),onClick:()=>{D?.(He),l()},children:`Save`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,onClick:()=>P(`menu`),children:`Back`})]})]})]});let Kt=!!E&&!!i&&(i.isAdmin||t.createdBy!=null&&t.createdBy===i.name);return(0,B.jsxs)(Np,{anchor:e.anchor,className:`cg-column-menu`,onDismiss:l,role:`dialog`,ariaLabel:`Column settings for ${t.label}`,initialFocus:`[data-overlay-autofocus]`,dataKind:`column-menu`,children:[(0,B.jsx)(B7,{title:t.label,sub:Wt,onClose:l}),Lt&&(0,B.jsxs)(`button`,{type:`button`,className:`cg-column-periodline`,onClick:()=>{qe(t.label),P(`edit`)},children:[(0,B.jsx)(`span`,{className:`cg-swap-label`,children:`Period`}),(0,B.jsx)(`span`,{className:`cg-column-periodval`,children:Zu(t.measure.window)})]}),(0,B.jsxs)(`div`,{className:`cg-column-actions`,children:[(0,B.jsx)(`button`,{type:`button`,"data-overlay-autofocus":!0,onClick:()=>{qe(t.label),P(`edit`)},children:(0,B.jsx)(zp,{icon:`rename`,text:`Edit field`})}),(0,B.jsx)(`div`,{className:`cg-menu-sep`,role:`separator`,"aria-hidden":!0}),T&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{T(),l()},children:(0,B.jsx)(zp,{icon:`duplicate`,text:`Duplicate field`})}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>ae(`left`),children:(0,B.jsx)(zp,{icon:`insertLeft`,text:`Insert field left`})}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>ae(`right`),children:(0,B.jsx)(zp,{icon:`insertRight`,text:`Insert field right`})}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>ae(`end`),children:(0,B.jsx)(zp,{icon:`addEnd`,text:`Add field at end`})}),(0,B.jsx)(`div`,{className:`cg-menu-sep`,role:`separator`,"aria-hidden":!0}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>P(`note`),children:(0,B.jsx)(zp,{icon:`description`,text:`Edit field description`})}),Kt&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>P(`permissions`),children:(0,B.jsx)(zp,{icon:`permissions`,text:`Edit field permissions`})}),Gt&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>P(`format`),children:(0,B.jsx)(zp,{icon:`format`,text:`Field format`})}),(0,B.jsx)(`div`,{className:`cg-menu-sep`,role:`separator`,"aria-hidden":!0}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{O(`asc`),l()},children:(0,B.jsx)(zp,{icon:`sortAsc`,text:`Sort ${ud(t.type,`asc`)}`})}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{O(`desc`),l()},children:(0,B.jsx)(zp,{icon:`sortDesc`,text:`Sort ${ud(t.type,`desc`)}`})}),a!=null&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{k(),l()},children:(0,B.jsx)(zp,{icon:`off`,text:`Don't sort by this field`})}),(0,B.jsx)(`div`,{className:`cg-menu-sep`,role:`separator`,"aria-hidden":!0}),(t.filterable!==!1||t.measure!=null&&te.length>0)&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{A(),l()},children:(0,B.jsx)(zp,{icon:`filter`,text:`Filter by this field`})}),o&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{j(),l()},children:(0,B.jsx)(zp,{icon:`off`,text:`Don't filter by this field`})}),c&&!s&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{M(),l()},children:(0,B.jsx)(zp,{icon:`group`,text:`Group by this field`})}),s&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{ee(),l()},children:(0,B.jsx)(zp,{icon:`off`,text:`Don't group by this field`})}),x&&!b&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{x(),l()},children:(0,B.jsx)(zp,{icon:`pin`,text:`Pin up to this field`})}),S&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{S(),l()},children:(0,B.jsx)(zp,{icon:`unpin`,text:`Unpin all fields`})}),(0,B.jsx)(`div`,{className:`cg-menu-sep`,role:`separator`,"aria-hidden":!0}),(0,B.jsx)(`button`,{type:`button`,disabled:r,title:r?`The primary field stays visible`:void 0,onClick:d,children:(0,B.jsx)(zp,{icon:`hide`,text:`Hide field`})}),w&&(0,B.jsx)(`button`,{type:`button`,className:`is-danger`,title:t.measure?`Removes this formula column from the workspace.`:`Removes this field AND its values on every row.`,onClick:()=>oe?w():se(!0),children:(0,B.jsx)(zp,{icon:`trash`,text:oe?`Delete permanently?`:`Delete field`})})]})]})}var aWe=[`bar`,`line`,`area`,`donut`,`kpi`,`table`],H7=[`sum`,`avg`,`count`,`min`,`max`],oWe={sum:`Sum of`,avg:`Average of`,count:`Count of records`,min:`Smallest`,max:`Largest`},sWe=[`brand`,`categorical`,`sequential`,`diverging`],cWe=[`auto`,`number`,`currency`,`percent`,`compact`],U7=[1,12],W7=[120,800],G7=[`bar`,`line`,`area`];function K7(e){return!!e&&e.startsWith(`measure_`)}function q7(e){return!!e.bucket&&K7(e.y)&&G7.includes(e.kind)}function lWe(e){let t=String(e??``);return/^\d{4}-\d{2}/.test(t)?t.slice(0,7):null}function uWe(e){let t=Number(e.slice(0,4)),n=Number(e.slice(5,7));return!Number.isFinite(t)||!Number.isFinite(n)?e:new Date(Date.UTC(t,n-1,1)).toLocaleDateString(void 0,{month:`short`,year:`numeric`,timeZone:`UTC`})}function J7(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:null}function Y7(e,t,n){if(e===`count`)return n;if(t.length===0)return 0;switch(e){case`sum`:return t.reduce((e,t)=>e+t,0);case`avg`:return t.reduce((e,t)=>e+t,0)/t.length;case`min`:return Math.min(...t);case`max`:return Math.max(...t)}}function dWe(e,t,n){return e===`count`?n:t.length===0?null:Y7(e,t,n)}function X7(e,t,n,r){let i={buckets:[],omitted:0,omittedValue:0,blanks:0,missingY:0,rows:t.length},a=e.y?n.get(e.y):void 0;if(e.y&&!a)return{...i,problem:`The field this chart measured no longer exists.`};if(a&&e.agg!==`count`&&!cd(a.type))return{...i,problem:`${a.label} is not a number, so it cannot be ${e.agg===`avg`?`averaged`:e.agg+`med`}.`};if(e.agg!==`count`&&!a)return{...i,problem:`Choose a number field to measure, or switch to Count.`};if(e.kind===`kpi`){let n=[],r=0;for(let e of t){if(!a)continue;let t=J7(e[a.key]);t==null?r+=1:n.push(t)}return{...i,missingY:r,buckets:[{key:``,label:``,value:Y7(e.agg,n,t.length),n:t.length}]}}let o=e.x?n.get(e.x):void 0;if(!e.x)return{...i,problem:`Choose a field to group by.`};if(!o)return{...i,problem:`The field this chart grouped by no longer exists.`};let s=ld(o.type),c=new Map,l=0,u=0;for(let e of t){let t=e[o.key],n,r;if(s){let e=lWe(t);e==null?(l+=1,n=``,r=`(no date)`):(n=e,r=uWe(e))}else{let e=String(t??``).trim();e===``?(l+=1,n=``,r=`(blank)`):(n=e,r=e)}let i=c.get(n);if(i||(i={label:r,vals:[],n:0},c.set(n,i)),i.n+=1,a){let t=J7(e[a.key]);t==null?u+=1:i.vals.push(t)}}let d=[...c.entries()].map(([t,n])=>({key:t,label:n.label,value:Y7(e.agg,n.vals,n.n),n:n.n}));s?d.sort((e,t)=>e.key===``?1:t.key===``?-1:e.key.localeCompare(t.key)):d.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label));let f=d.filter(e=>e.value<0),p=d.filter(e=>e.value===0).length,m=f.reduce((e,t)=>e+t.value,0),h=0,g=0,_=r?.maxBuckets??12;if(d.length>_){let e=d.slice(0,_),t=d.slice(_);h=t.length,g=t.reduce((e,t)=>e+t.value,0),d=e}return{...i,buckets:d,omitted:h,omittedValue:g,blanks:l,missingY:u,negativeBuckets:f.length,negativeValue:m,zeroBuckets:p}}function fWe(e,t,n){let r=X7({...e,splitBy:void 0},t,n),i={points:[],xOrder:[],seriesOrder:[],omitted:r.omitted,omittedValue:r.omittedValue,omittedSeries:0,omittedSeriesValue:0,nonPositive:0,nonPositiveValue:0,blanks:r.blanks,missingY:r.missingY,rows:r.rows,problem:r.problem};if(r.problem)return i;if(e.kind===`donut`){let e=r.buckets.filter(e=>e.value>0),t=r.negativeBuckets??r.buckets.filter(e=>e.value<0).length,n=t+(r.zeroBuckets??r.buckets.filter(e=>e.value===0).length),a=r.negativeValue??r.buckets.filter(e=>e.value<0).reduce((e,t)=>e+t.value,0);return t>0?{...i,nonPositive:n,nonPositiveValue:a,problem:`A donut cannot represent negative values without misrepresenting the whole. Use a bar or line chart for signed values.`}:r.buckets.length>0&&e.length===0?{...i,nonPositive:n,nonPositiveValue:a,problem:`A donut needs at least one positive value. Zero-value groups cannot be drawn as slices.`}:{...i,points:e.map(e=>({...e,seriesKey:``,seriesLabel:``})),xOrder:e.map(e=>e.key),nonPositive:n,nonPositiveValue:a}}if(!e.splitBy||e.kind===`kpi`)return{...i,points:r.buckets.map(e=>({...e,seriesKey:``,seriesLabel:``})),xOrder:r.buckets.map(e=>e.key)};let a=n.get(e.splitBy),o=e.x?n.get(e.x):void 0;if(!a)return{...i,problem:`The field this chart split into series no longer exists.`};if(!o)return{...i,problem:`The field this chart grouped by no longer exists.`};let s=e=>ld(o.type)?lWe(e[o.key])??``:String(e[o.key]??``).trim(),c=e=>String(e[a.key]??``).trim(),l=new Set(r.buckets.map(e=>e.key)),u=new Map;for(let e of t){if(!l.has(s(e)))continue;let t=c(e),n=u.get(t);n?n.push(e):u.set(t,[e])}let d=[...u.entries()].map(([t,r])=>{let i=X7({...e,splitBy:void 0},r,n);return{key:t,label:t||`(blank)`,data:i,weight:i.buckets.reduce((e,t)=>e+Math.abs(t.value),0)}});d.sort((e,t)=>t.weight-e.weight||e.label.localeCompare(t.label));let f=d.slice(0,12),p=Math.max(0,d.length-f.length),m=d.slice(12).reduce((e,t)=>e+t.weight,0),h=r.buckets.map(e=>e.key),g=new Map(r.buckets.map(e=>[e.key,e.label])),_=[];for(let e of f){let t=new Map(e.data.buckets.map(e=>[e.key,e]));for(let n of h){let r=t.get(n);_.push({key:n,label:g.get(n)??n,value:r?.value??0,n:r?.n??0,seriesKey:e.key,seriesLabel:e.label})}}return{...i,points:_,xOrder:h,seriesOrder:f.map(e=>e.key),omittedSeries:p,omittedSeriesValue:m}}function pWe(e,t){return{id:e,kind:`bar`,x:t.find(e=>e.type===`status`||e.type===`select`)?.key,agg:`count`,size:{w:6,h:280}}}function mWe(e){return e.filter(e=>e.type===`status`||e.type===`select`||e.type===`text`||ld(e.type))}function hWe(e){return e.filter(e=>cd(e.type))}function Z7(e,t,n,r){return!n||n===`auto`?t?yp(t,e):r(e):n===`compact`?r(e):n===`number`?e.toLocaleString(void 0,{maximumFractionDigits:2}):n===`percent`?`${e.toLocaleString(void 0,{maximumFractionDigits:2})}%`:e.toLocaleString(void 0,{style:`currency`,currency:`USD`,maximumFractionDigits:0})}function gWe(e,[t,n]){return Math.max(t,Math.min(n,e))}function _We(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n,r=typeof e.id==`string`&&e.id?e.id:``,i=e.kind,a=e.agg;if(!r||!aWe.includes(i)||!H7.includes(a))continue;let o={id:r,kind:i,agg:a};if(typeof e.x==`string`&&e.x&&(o.x=e.x),typeof e.y==`string`&&e.y&&(o.y=e.y),typeof e.title==`string`&&e.title&&(o.title=e.title.slice(0,60)),typeof e.splitBy==`string`&&e.splitBy&&e.splitBy!==o.x&&(o.splitBy=e.splitBy),o.splitBy&&(i===`bar`||i===`area`)&&e.stacked===!0&&(o.stacked=!0),sWe.includes(e.palette)&&(o.palette=e.palette),e.axis&&typeof e.axis==`object`&&!Array.isArray(e.axis)){let t=e.axis,n={};for(let e of[`x`,`y`]){let r=t[e];if(!r||typeof r!=`object`||Array.isArray(r))continue;let i=r,a={};typeof i.label==`string`&&i.label.trim()&&(a.label=i.label.trim().slice(0,40)),cWe.includes(i.format)&&(a.format=i.format),(a.label!==void 0||a.format!==void 0)&&(n[e]=a)}(n.x||n.y)&&(o.axis=n)}if(e.size&&typeof e.size==`object`&&!Array.isArray(e.size)){let t=e.size,n={};typeof t.w==`number`&&Number.isFinite(t.w)&&(n.w=gWe(Math.round(t.w),U7)),typeof t.h==`number`&&Number.isFinite(t.h)&&(n.h=gWe(Math.round(t.h),W7)),(n.w!==void 0||n.h!==void 0)&&(o.size=n)}if(typeof e.bucket==`string`&&id.includes(e.bucket)&&K7(o.y)&&(o.bucket=e.bucket,e.span&&typeof e.span==`object`&&!Array.isArray(e.span))){let t=e.span.lastN;if(typeof t==`number`&&Number.isFinite(t)){let e=Math.round(t);e>=1&&e<=120&&(o.span={lastN:e})}}if(e.compare===`prior_year`&&(o.bucket||i===`kpi`&&o.agg===`sum`&&K7(o.y))&&(o.compare=`prior_year`),t.push(o),t.length>=12)break}return t.length?t:void 0}var vWe={sum:`Total`,avg:`Average`,count:`Count`,min:`Lowest`,max:`Highest`},Q7=50;function yWe(){let e={stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`};return(0,B.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,"aria-hidden":!0,children:[(0,B.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`1.5`,...e}),(0,B.jsx)(`path`,{d:`M5 7.5h6M5 10h4`,...e})]})}function bWe({mode:e,onMode:t,locked:n=!1,dateField:r,dateChoices:i,stackField:a,stackChoices:o,colorField:s,colorChoices:c,sizeField:l,sizeChoices:u,onPickField:d,clamped:f=!0,onClamp:p,calendarMode:m=`records`,onCalendarMode:h,calendarMetrics:g=[],metricChoices:_=[],onCalendarMetrics:v}){return(0,B.jsxs)(`span`,{className:`cg-modes`,children:[n?(0,B.jsxs)(`span`,{className:`cg-modes-locked`,title:`This view is locked as ${Rf[e]}. Filters, sorts and columns are still editable — its creator or an admin can unlock it from the view menu.`,children:[(0,B.jsx)(Ip,{mode:e}),(0,B.jsxs)(`span`,{children:[`View · `,Rf[e]]}),(0,B.jsx)(Vp,{})]}):(0,B.jsx)(pm,{label:`View · ${Rf[e]}`,icon:(0,B.jsx)(Ip,{mode:e}),active:e!==`grid`,children:n=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`View as`}),Ite.map(r=>(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-viewmode`,checked:e===r,onChange:()=>{t(r),n()}}),(0,B.jsx)(Ip,{mode:r}),(0,B.jsx)(`span`,{children:Rf[r]})]},r))]})}),e===`calendar`&&i.length>0&&(0,B.jsx)(Gp,{className:`cg-mode-field`,ariaLabel:`Calendar date field`,value:r?.key,onChange:e=>d(`dateField`,e),fields:i.map(e=>({key:e.key,label:e.label,type:e.type}))}),e===`kanban`&&o.length>0&&(0,B.jsx)(Gp,{className:`cg-mode-field`,ariaLabel:`Kanban stack field`,value:a?.key,onChange:e=>d(`stackField`,e),fields:o.map(e=>({key:e.key,label:e.label,type:e.type}))}),e===`kanban`&&p&&(0,B.jsx)(`button`,{type:`button`,className:`cg-tb-btn cg-mode-field`+(f?` is-on`:``),"aria-pressed":f,onClick:()=>p(!f&&void 0),title:f?`Cards are trimmed to a standard height. Click to let them grow to their content.`:`Cards grow to their content. Click to trim them to a standard height.`,children:f?`Short cards`:`Full cards`}),e===`calendar`&&h&&(0,B.jsx)(pm,{label:`Day cells · ${m===`summary`?`Summaries`:`Records`}`,icon:(0,B.jsx)(yWe,{}),active:m===`summary`,children:e=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Each day shows`}),[[`records`,`Records`,`The records that fall on that day, listed.`],[`summary`,`Summaries`,`Totals computed over that day's records.`]].map(([t,n,r])=>(0,B.jsxs)(`label`,{className:`cg-radio-row`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-cal-mode`,checked:t===`summary`?m===`summary`:m!==`summary`,onChange:()=>{h(t),e()}}),(0,B.jsxs)(`span`,{className:`cg-check-label`,children:[n,(0,B.jsx)(`span`,{className:`cg-pop-note cg-radio-help`,children:r})]})]},t))]})}),e===`calendar`&&m===`summary`&&v&&(0,B.jsx)(pm,{label:`Totals · ${g.length+1}`,icon:(0,B.jsx)(Ip,{mode:`chart`}),active:g.length>0,children:()=>(0,B.jsxs)(`div`,{className:`cg-pop-body`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Totals per day`}),(0,B.jsxs)(`div`,{className:`cg-pop-note`,children:[`Records is always counted — every other figure in the cell is computed over it. Up to `,4,` more.`]}),_.length===0&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:`This table has no numeric fields to total.`}),_.map(e=>{let t=g.find(t=>t.field===e.key),n=g.length>=4;return(0,B.jsxs)(`div`,{className:`cg-cal-pick`,children:[(0,B.jsxs)(`label`,{className:`cg-check-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:!!t,disabled:!t&&n,onChange:()=>{v(t?g.filter(t=>t.field!==e.key):[...g,{id:`cm_${e.key}`,field:e.key,agg:`sum`}])}}),(0,B.jsx)(Fp,{type:e.type,size:11}),(0,B.jsx)(`span`,{className:`cg-check-label`,children:e.label})]}),t&&(0,B.jsx)(`select`,{className:`cg-select`,value:t.agg,"aria-label":`How to total ${e.label}`,onChange:t=>v(g.map(n=>n.field===e.key?{...n,agg:t.target.value}:n)),children:H7.filter(e=>e!==`count`).map(e=>(0,B.jsx)(`option`,{value:e,children:vWe[e]},e))})]},e.key)})]})}),e===`map`&&c.length>0&&(0,B.jsx)(Gp,{className:`cg-mode-field`,ariaLabel:`Colour pins by`,placeholder:`Colour: none`,value:s?.key??``,onChange:e=>d(`colorField`,e),fields:[{key:``,label:`No colour`,type:void 0},...c.map(e=>({key:e.key,label:`Colour: ${e.label}`,type:e.type}))]}),e===`map`&&u.length>0&&(0,B.jsx)(Gp,{className:`cg-mode-field`,ariaLabel:`Size pins by`,placeholder:`Size: none`,value:l?.key??``,onChange:e=>d(`sizeField`,e),fields:[{key:``,label:`No size`,type:void 0},...u.map(e=>({key:e.key,label:`Size: ${e.label}`,type:e.type}))]})]})}var xWe=(0,L.memo)(function({rows:e,fieldByKey:t,visibleKeys:n,titleKey:r,onOpen:i,onToggleGroup:a}){let o=n.filter(e=>e!==r);return(0,B.jsxs)(`div`,{className:`cg-listview`,children:[e.map((e,n)=>{if(e.kind===`group-footer`)return null;if(e.kind===`group-header`)return(0,B.jsxs)(`button`,{type:`button`,className:`cg-lv-group`,onClick:()=>a(e.groupKey),"aria-expanded":!e.collapsed,children:[(0,B.jsx)(`span`,{className:`cg-lv-chev`,children:e.collapsed?`▶`:`▼`}),(0,B.jsx)(`span`,{className:`cg-lv-group-label`,children:e.label}),(0,B.jsx)(`span`,{className:`cg-lv-count`,children:e.count.toLocaleString()})]},`g:${e.groupKey}:${n}`);let s=e.record;return(0,B.jsxs)(`button`,{type:`button`,className:`cg-lv-row`,onClick:()=>i(s.pid),children:[(0,B.jsx)(`span`,{className:`cg-lv-title`,children:String(s[r]??``)}),(0,B.jsx)(`span`,{className:`cg-lv-cells`,children:o.map(e=>{let n=t.get(e);if(!n)return null;let r=yp(n,s[e]);return r?(0,B.jsxs)(`span`,{className:`cg-lv-cell`,children:[(0,B.jsx)(`span`,{className:`cg-lv-k`,children:n.label}),(0,B.jsx)(`span`,{className:`cg-lv-v`,children:r})]},e):null})})]},`r:${s.pid}:${n}`)}),e.length===0&&(0,B.jsx)(`div`,{className:`cg-mode-empty`,children:`No records match this view.`})]})});function SWe(e,t){let n=Number(e.slice(0,4)),r=Number(e.slice(5,7));return new Date(Date.UTC(n,r-1+t,1)).toISOString().slice(0,7)}function CWe(e){let t=Number(e.slice(0,4)),n=Number(e.slice(5,7));return new Date(Date.UTC(t,n-1,1)).toLocaleDateString(void 0,{month:`long`,year:`numeric`,timeZone:`UTC`})}var wWe=(0,L.memo)(function({rows:e,field:t,today:n,titleKey:r,mode:i=`records`,metrics:a,fieldByKey:o,scope:s=`customer`,onOpen:c}){let l=(0,L.useMemo)(()=>e.map(e=>({pid:e.pid,title:String(e[r]??``),day:String(e[t.key]??``).slice(0,10),row:e})),[e,t.key,r]),u=(0,L.useMemo)(()=>l.filter(e=>/^\d{4}-\d{2}-\d{2}$/.test(e.day)),[l]),d=l.length-u.length,f=(0,L.useMemo)(()=>{if(n&&/^\d{4}-\d{2}/.test(n))return n.slice(0,7);let e=u.map(e=>e.day.slice(0,7)).sort();return e.length?e[e.length-1]:null},[n,u]),[p,m]=(0,L.useState)(f),h=p??f,g=(0,L.useMemo)(()=>{let e=new Map;if(!h)return e;for(let t of u){if(!t.day.startsWith(h))continue;let n=e.get(t.day)??[];n.push({pid:t.pid,title:t.title,row:t.row}),e.set(t.day,n)}return e},[u,h]),_=(0,L.useMemo)(()=>{let e=[{id:`__count__`,label:`Records`,agg:`count`}];for(let t of a??[]){let n=o?.get(t.field);n&&H7.includes(t.agg)&&e.push({id:t.id,label:n.label,field:n,agg:t.agg})}return e},[a,o]),v=(0,L.useMemo)(()=>_.filter(e=>e.field&&Km(e.field)===`server`).map(e=>e.field.key),[_]),[y,b]=(0,L.useState)({}),[x,S]=(0,L.useState)({}),C=(0,L.useRef)(0);if((0,L.useEffect)(()=>{if(i!==`summary`||!v.length||g.size===0){b({}),S({});return}let e=[...g.entries()].map(([e,t])=>({key:e,pids:t.map(e=>e.pid)})),t=++C.current;ete({groups:e,fields:v},s).then(({payload:e})=>{t===C.current&&(b(e?.values??{}),S(e?.windows??{}))})},[i,v,g,s]),!h)return(0,B.jsxs)(`div`,{className:`cg-mode-empty`,children:[`No dates to place on a calendar yet.`,d>0&&` ${d.toLocaleString()} record${d===1?``:`s`} carry no date.`]});let w=Number(h.slice(0,4)),T=Number(h.slice(5,7)),E=new Date(Date.UTC(w,T,0)).getUTCDate(),D=(new Date(Date.UTC(w,T-1,1)).getUTCDay()+6)%7,O=[...Array.from({length:D},()=>null),...Array.from({length:E},(e,t)=>t+1)];for(;O.length%7!=0;)O.push(null);let k=[...g.values()].reduce((e,t)=>e+t.length,0);return(0,B.jsxs)(`div`,{className:`cg-calview`,children:[(0,B.jsxs)(`div`,{className:`cg-cal-bar`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-cal-nav`,"aria-label":`Previous month`,onClick:()=>m(SWe(h,-1)),children:`‹`}),(0,B.jsx)(`span`,{className:`cg-cal-title`,children:CWe(h)}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-cal-nav`,"aria-label":`Next month`,onClick:()=>m(SWe(h,1)),children:`›`}),(0,B.jsx)(`span`,{className:`cg-cal-note`,children:i===`summary`?`Totals over ${k.toLocaleString()} record${k===1?``:`s`} placed this month · by ${t.label}`:`${k.toLocaleString()} in this month · by ${t.label}`}),d>0&&(0,B.jsxs)(`span`,{className:`cg-cal-nodate`,title:`${d.toLocaleString()} matching record${d===1?``:`s`} have no ${t.label} and are not on the calendar. They remain in the Grid and List views.`,children:[d.toLocaleString(),` without a date`]}),i===`summary`&&_.filter(e=>e.field&&x[e.field.key]?.label).map(e=>(0,B.jsxs)(`span`,{className:`cg-cal-window`,children:[e.label,` · `,x[e.field.key].label,`, as of each day`]},e.id))]}),(0,B.jsxs)(`div`,{className:`cg-cal-grid`,children:[[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`].map(e=>(0,B.jsx)(`div`,{className:`cg-cal-dow`,children:e},e)),O.map((e,t)=>{let r=e?`${h}-${String(e).padStart(2,`0`)}`:``,a=e?g.get(r)??[]:[];return(0,B.jsxs)(`div`,{className:`cg-cal-cell`+(e?``:` is-blank`)+(r===n?` is-today`:``),children:[e&&(0,B.jsx)(`div`,{className:`cg-cal-day`,children:e}),i===`summary`?e&&a.length>0&&_.map(e=>{let t=e.field?y[e.field.key]:void 0,n;if(t)n=t[r]??null;else{let t=[];if(e.field)for(let n of a){let r=J7(n.row[e.field.key]);r!=null&&t.push(r)}n=dWe(e.agg,t,a.length)}return(0,B.jsxs)(`div`,{className:`cg-cal-metric`,children:[(0,B.jsx)(Fp,{type:e.field?e.field.type:`int`,size:11}),(0,B.jsx)(`span`,{className:`cg-cal-metric-k`,children:e.label}),(0,B.jsx)(`span`,{className:`cg-cal-metric-v`,children:n==null?`—`:e.field?yp(e.field,n):n.toLocaleString()})]},e.id)}):a.map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-cal-chip`,title:e.title,onClick:()=>c(e.pid),children:e.title},e.pid))]},t)})]})]})}),TWe=(0,L.memo)(function({rows:e,field:t,fieldByKey:n,cardKeys:r,titleKey:i,canMove:a,readOnlyReason:o,clamped:s=!0,onMove:c,onOpen:l}){let[u,d]=(0,L.useState)(new Set),f=(0,L.useMemo)(()=>{let n=t.type===`select`?[...nd(t)]:[],r=new Map(n.map(e=>[e,[]])),i=[];for(let a of e){let e=String(a[t.key]??``).trim();if(e===``){i.push(a);continue}let o=r.get(e);o||(o=[],r.set(e,o),n.push(e)),o.push(a)}let o=n.map(e=>({key:e,label:e,rows:r.get(e)}));return(i.length||a)&&o.push({key:``,label:`(empty)`,rows:i}),o},[e,t,a]),p=e=>t=>{t.preventDefault();let n=Number(t.dataTransfer.getData(`text/plain`));Number.isFinite(n)&&n>0&&c(n,e)},m=(0,L.useRef)(!1);return(0,B.jsxs)(`div`,{className:`cg-kbview`+(s?` is-clamped`:``),children:[o&&(0,B.jsx)(`div`,{className:`cg-kb-note`,children:o}),(0,B.jsx)(`div`,{className:`cg-kb-lanes`,children:f.map(e=>{let o=u.has(e.key),s=o?e.rows:e.rows.slice(0,Q7),c=e.key?fp(t,e.key):void 0;return(0,B.jsxs)(`div`,{className:`cg-kb-lane`,onDragOver:a?e=>e.preventDefault():void 0,onDrop:a?p(e.key):void 0,children:[(0,B.jsxs)(`div`,{className:`cg-kb-head`,children:[(0,B.jsx)(`span`,{className:`cg-kb-pill`,style:c?{background:c.bg,color:c.fg}:void 0,children:e.label}),(0,B.jsx)(`span`,{className:`cg-kb-count`,children:e.rows.length.toLocaleString()})]}),(0,B.jsxs)(`div`,{className:`cg-kb-cards`,children:[s.map(e=>(0,B.jsxs)(`div`,{className:`cg-kb-card`+(a?` is-draggable`:``),draggable:a,role:`button`,tabIndex:0,"aria-label":`Open ${String(e[i]??`record`)}`,onClick:()=>{m.current||l(e.pid)},onKeyDown:t=>{t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),l(e.pid))},onDragStart:a?t=>{m.current=!0,t.dataTransfer.setData(`text/plain`,String(e.pid))}:void 0,onDragEnd:a?()=>{window.setTimeout(()=>{m.current=!1},0)}:void 0,children:[(0,B.jsx)(`span`,{className:`cg-kb-title`,children:String(e[i]??``)}),r.map(t=>{let r=n.get(t);if(!r)return null;let i=yp(r,e[t]);return i?(0,B.jsxs)(`div`,{className:`cg-kb-cell`,children:[(0,B.jsx)(`span`,{className:`cg-lv-k`,children:r.label}),(0,B.jsx)(`span`,{className:`cg-lv-v`,children:i})]},t):null})]},e.pid)),e.rows.length>Q7&&!o&&(0,B.jsxs)(`button`,{type:`button`,className:`cg-link-btn cg-kb-more`,onClick:()=>d(t=>new Set(t).add(e.key)),children:[`Showing first `,Q7,` — show all`,` `,e.rows.length.toLocaleString()]})]})]},e.key||`(empty)`)})})]})});function EWe(e){let{label:t,value:n}=e,r=e.prior??null,i={label:t,value:n,format:e.format??`auto`,delta:null,prior:r,dir:`off`};if(n===0&&r!=null&&r!==0)return{...i,note:`no orders yet`};if(r==null)return i;if(r===0||!Number.isFinite(r)||!Number.isFinite(n))return{...i,note:`no comparable prior period`};let a=(n-r)/Math.abs(r)*100;return{...i,delta:a,dir:a>0?`up`:a<0?`down`:`flat`,deltaLabel:e.deltaLabel??`vs prior`}}function DWe(e){let{rows:t,fieldByKey:n,groupBy:r,columns:i}=e,a=e.sort??`first-desc`,o={columns:i,rows:[],total:0,shown:0,blanks:0};if(!n.has(r))return{...o,problem:`The field this table grouped by no longer exists.`};if(i.length===0)return{...o,problem:`This table has no columns to aggregate.`};let s=i.map(e=>X7({id:`gt-${e.key}`,kind:`bar`,x:r,y:e.y,agg:e.agg,size:void 0},t,n,{maxBuckets:2**53-1})),c=s.find(e=>e.problem)?.problem;if(c)return{...o,problem:c};let l=s[0],u=s.map(e=>new Map(e.buckets.map(e=>[e.key,e]))),d=l.buckets.map(e=>({key:e.key,label:e.label,n:e.n,values:i.map((t,n)=>u[n].get(e.key)?.value??null)}));d.sort((e,t)=>{if(a===`label`)return e.label.localeCompare(t.label);let n=e.values[0],r=t.values[0];return n==null||r==null?n==null?r==null?0:1:-1:a===`first-asc`?n-r:r-n});let f=e.limit??d.length;return{columns:i,rows:d.slice(0,Math.max(0,f)),total:d.length,shown:Math.min(d.length,Math.max(0,f)),blanks:l.blanks}}function OWe(e,t,n){let r={columns:[],rows:[],total:0,shown:0,blanks:0};if(!e.x)return{...r,problem:`Choose a field to group by.`};let i=e.y?n.get(e.y):void 0;if(e.agg!==`count`&&!e.y)return{...r,problem:`Choose a number field to measure, or switch to Count.`};let a=[];return e.agg!==`count`&&e.y&&a.push({key:`measure`,label:`${oWe[e.agg]} ${i?.label??e.y}`,agg:e.agg,y:e.y,format:e.axis?.y?.format}),a.push({key:`n`,label:`Records`,agg:`count`}),DWe({rows:t,fieldByKey:n,groupBy:e.x,columns:a,sort:`first-desc`,limit:25})}function kWe(e){let{values:t,back:n}=e,r=t.length?t[t.length-1]:null;if(r==null||!Number.isFinite(r))return null;let i=t.length-1-n,a=i>=0?t[i]:null;return EWe({label:e.label,value:r,prior:a,format:e.format,deltaLabel:`vs last year`})}var AWe=(0,L.lazy)(()=>Dc(()=>Promise.resolve().then(()=>(eUe(),QHe)),void 0,import.meta.url)),$7=6;function e9(e,[t,n]){return Math.max(t,Math.min(n,e))}var jWe={brand:`Brand`,categorical:`Distinct categories`,sequential:`Low to high`,diverging:`Below / above a midpoint`},MWe={auto:`Automatic`,number:`Plain number`,currency:`Currency`,percent:`Percent`,compact:`Compact (1.2k)`};function t9(e,t,n){let r={...e.axis?.[t]??{},...n};r.label?.trim()||delete r.label,r.format===`auto`&&delete r.format;let i={...e.axis??{}};return r.label===void 0&&r.format===void 0?delete i[t]:i[t]=r,{...e,axis:i.x||i.y?i:void 0}}var NWe={bar:`Bar`,line:`Line`,area:`Area`,donut:`Donut`,kpi:`Single number`,table:`Table`},PWe=oWe,FWe={week:`Weekly`,month:`Monthly`,quarter:`Quarterly`,year:`Yearly`},IWe=[6,12,24,36];function LWe(e){let t=e.span?.lastN??12;return e.compare===`prior_year`?t+(qm[e.bucket]??12):t}function RWe(e){return`${e.bucket}|${LWe(e)}`}var n9=`month`,zWe=qm.month+1;function BWe(e){return e.kind===`kpi`&&e.compare===`prior_year`&&e.agg===`sum`&&K7(e.y)}function VWe(){return`${n9}|${zWe}`}function r9(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e9?(e/1e9).toFixed(1)+`B`:t>=1e6?(e/1e6).toFixed(1)+`M`:t>=1e3?(e/1e3).toFixed(1)+`k`:Number.isInteger(e)?e.toLocaleString():e.toFixed(2)}function HWe({spec:e,data:t,fields:n,yField:r,onChange:i,onRemove:a,canPeriod:o,table:s,kpiCompare:c}){let[l,u]=(0,L.useState)(!1),d=(0,L.useMemo)(()=>mWe(n),[n]),f=(0,L.useMemo)(()=>hWe(n),[n]),p=q7(e)?FWe[e.bucket]:void 0,m=p?`Period`:e.x?n.find(t=>t.key===e.x)?.label:void 0,h=p?`, ${p.toLowerCase()}`:m?` by ${m}`:``,g=e.agg===`count`?`Count of records${h}`:`${PWe[e.agg]} ${r?.label??`…`}${h}`,_=(0,L.useMemo)(()=>th({spec:e,model:t,xTitle:e.axis?.x?.label??m,yTitle:e.axis?.y?.label??(e.agg===`count`?`Records`:r?.label),formatValue:t=>Z7(t,r,e.axis?.y?.format,r9)}),[t,e,m,r]);return(0,B.jsxs)(`div`,{className:`cg-ch-card`,style:{gridColumn:`span ${e.size?.w??$7}`,height:e.size?.h?`${e.size.h}px`:void 0},children:[(0,B.jsxs)(`div`,{className:`cg-ch-head`,children:[(0,B.jsx)(`span`,{className:`cg-ch-title`,title:e.title||g,children:e.title||g}),(0,B.jsx)(`button`,{type:`button`,className:`cg-icon-btn cg-ch-cfg`,"aria-label":`Configure this chart`,"aria-expanded":l,onClick:()=>u(e=>!e),children:(0,B.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M3 4.5h10M3 8h10M3 11.5h10`,stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`})})}),(0,B.jsx)(`button`,{type:`button`,className:`cg-icon-btn cg-ch-del`,"aria-label":`Remove this chart`,onClick:a,children:(0,B.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`})})})]}),l&&(0,B.jsxs)(`div`,{className:`cg-ch-cfgbody`,children:[(0,B.jsxs)(`div`,{className:`cg-ch-row cg-ch-kindrow`,role:`radiogroup`,"aria-label":`Chart type`,children:[(0,B.jsx)(`span`,{children:`Chart`}),(0,B.jsx)(`div`,{className:`cg-ch-kinds`,children:aWe.map(t=>(0,B.jsxs)(`label`,{className:`cg-ch-kind`+(e.kind===t?` is-on`:``),title:NWe[t],children:[(0,B.jsx)(`input`,{type:`radio`,name:`cg-ch-kind-${e.id}`,checked:e.kind===t,onChange:()=>i({...e,kind:t})}),(0,B.jsx)(Kne,{kind:t}),(0,B.jsx)(`span`,{children:NWe[t]})]},t))})]}),(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Show`}),(0,B.jsx)(`select`,{className:`cg-select`,value:e.agg,onChange:t=>{let n=t.target.value;i({...e,agg:n,...e.kind===`kpi`&&n!==`sum`?{compare:void 0}:{}})},children:H7.map(e=>(0,B.jsx)(`option`,{value:e,children:PWe[e]},e))})]}),e.agg!==`count`&&(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Which number`}),(0,B.jsxs)(`select`,{className:`cg-select`,value:e.y??``,onChange:t=>i({...e,y:t.target.value||void 0,...K7(t.target.value)?{}:{bucket:void 0,span:void 0,compare:void 0}}),children:[(0,B.jsx)(`option`,{value:``,children:`Choose a number…`}),f.map(e=>(0,B.jsx)(`option`,{value:e.key,children:e.label},e.key))]})]}),o&&K7(e.y)&&G7.includes(e.kind)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Over time`}),(0,B.jsxs)(`select`,{className:`cg-select`,value:e.bucket??``,onChange:t=>i({...e,bucket:t.target.value||void 0,span:t.target.value?e.span:void 0,compare:t.target.value?e.compare:void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`No — group by a field`}),id.map(e=>(0,B.jsx)(`option`,{value:e,children:FWe[e]},e))]})]}),!!e.bucket&&(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`How far back`}),(0,B.jsx)(`select`,{className:`cg-select`,value:String(e.span?.lastN??12),onChange:t=>i({...e,span:{lastN:Number(t.target.value)}}),children:IWe.map(e=>(0,B.jsxs)(`option`,{value:e,children:[`Last `,e]},e))})]}),!!e.bucket&&(0,B.jsxs)(`label`,{className:`cg-ch-row cg-ch-check`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.compare===`prior_year`,onChange:t=>i({...e,compare:t.target.checked?`prior_year`:void 0})}),(0,B.jsx)(`span`,{children:`Compare to the year before`})]})]}),e.kind===`kpi`&&o&&e.agg===`sum`&&K7(e.y)&&(0,B.jsxs)(`label`,{className:`cg-ch-row cg-ch-check`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.compare===`prior_year`,onChange:t=>i({...e,compare:t.target.checked?`prior_year`:void 0})}),(0,B.jsx)(`span`,{children:`Compare to the year before`})]}),e.kind!==`kpi`&&!(o&&e.bucket&&G7.includes(e.kind))&&(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Grouped by`}),(0,B.jsxs)(`select`,{className:`cg-select`,value:e.x??``,onChange:t=>i({...e,x:t.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`Choose a field…`}),d.map(e=>(0,B.jsx)(`option`,{value:e.key,children:e.label},e.key))]})]}),(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Title`}),(0,B.jsx)(`input`,{className:`cg-input`,value:e.title??``,placeholder:g,maxLength:60,onChange:t=>i({...e,title:t.target.value||void 0})})]}),e.kind!==`kpi`&&e.kind!==`donut`&&e.kind!==`table`&&!(o&&e.bucket&&G7.includes(e.kind))&&(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Break down by`}),(0,B.jsxs)(`select`,{className:`cg-select`,value:e.splitBy??``,onChange:t=>i({...e,splitBy:t.target.value||void 0,stacked:t.target.value?e.stacked:void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`Don't break it down`}),d.filter(t=>t.key!==e.x).map(e=>(0,B.jsx)(`option`,{value:e.key,children:e.label},e.key))]})]}),!!e.splitBy&&(e.kind===`bar`||e.kind===`area`)&&(0,B.jsxs)(`label`,{className:`cg-ch-row cg-ch-check`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.stacked===!0,onChange:t=>i({...e,stacked:t.target.checked||void 0})}),(0,B.jsx)(`span`,{children:`Stack them on top of each other`})]}),e.kind!==`table`&&(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Colours`}),(0,B.jsxs)(`select`,{className:`cg-select`,value:e.palette??``,onChange:t=>i({...e,palette:t.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`Default`}),sWe.map(e=>(0,B.jsx)(`option`,{value:e,children:jWe[e]},e))]})]}),e.kind!==`kpi`&&e.kind!==`table`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Bottom axis label`}),(0,B.jsx)(`input`,{className:`cg-input`,value:e.axis?.x?.label??``,placeholder:m??`Category`,maxLength:40,onChange:t=>i(t9(e,`x`,{label:t.target.value}))})]}),(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Side axis label`}),(0,B.jsx)(`input`,{className:`cg-input`,value:e.axis?.y?.label??``,placeholder:r?.label??`Value`,maxLength:40,onChange:t=>i(t9(e,`y`,{label:t.target.value}))})]})]}),(0,B.jsxs)(`label`,{className:`cg-ch-row`,children:[(0,B.jsx)(`span`,{children:`Number format`}),(0,B.jsx)(`select`,{className:`cg-select`,value:e.axis?.y?.format??`auto`,onChange:t=>i(t9(e,`y`,{format:t.target.value})),children:cWe.map(e=>(0,B.jsx)(`option`,{value:e,children:MWe[e]},e))})]})]}),e.kind===`table`?!s||s.problem?(0,B.jsx)(`div`,{className:`cg-ch-empty`,children:s?.problem??`Choose a field to group by.`}):s.rows.length===0?(0,B.jsx)(`div`,{className:`cg-ch-empty`,children:`No records match this view, so there is nothing to list.`}):(0,B.jsx)(`div`,{className:`cg-ch-viz cg-ch-viz--table`,children:(0,B.jsx)(UWe,{table:s,xLabel:m??`Group`,yField:r})}):t.pending?(0,B.jsx)(`div`,{className:`cg-ch-empty`,children:(0,B.jsx)(`span`,{className:`lp-spin`,role:`status`,"aria-label":`Loading`})}):t.problem?(0,B.jsx)(`div`,{className:`cg-ch-empty`,children:t.problem}):t.points.length===0?(0,B.jsx)(`div`,{className:`cg-ch-empty`,children:`No records match this view, so there is nothing to chart.`}):(0,B.jsx)(`div`,{className:`cg-ch-viz cg-ch-viz--${e.kind}`,children:(0,B.jsx)(L.Suspense,{fallback:(0,B.jsx)(`div`,{className:`cg-ch-loading`,children:(0,B.jsx)(`span`,{className:`lp-spin`,role:`status`,"aria-label":`Loading`})}),children:(0,B.jsx)(AWe,{spec:_,label:e.title||g})})}),e.kind===`kpi`&&c&&(0,B.jsx)(`div`,{className:`cg-ch-kpidelta is-${c.dir}`,title:c.prior==null?void 0:`This period ${Z7(c.value,r,e.axis?.y?.format,r9)} · a year earlier ${Z7(c.prior,r,e.axis?.y?.format,r9)} (month-end anchored)`,children:c.delta==null?(0,B.jsx)(`span`,{children:c.note}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 14 14`,"aria-hidden":!0,children:c.dir===`up`?(0,B.jsx)(`path`,{d:`M3 9.5l4-5 4 5z`,fill:`currentColor`}):c.dir===`down`?(0,B.jsx)(`path`,{d:`M3 4.5l4 5 4-5z`,fill:`currentColor`}):(0,B.jsx)(`path`,{d:`M3 7h8`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})}),(0,B.jsxs)(`span`,{children:[Math.abs(c.delta).toFixed(1),`% `,c.deltaLabel]})]})}),(0,B.jsxs)(`div`,{className:`cg-ch-foot`,children:[(0,B.jsxs)(`span`,{children:[t.rows.toLocaleString(),` records`]}),e.kind===`table`&&s&&!s.problem?(0,B.jsxs)(B.Fragment,{children:[s.shown0&&(0,B.jsxs)(`span`,{children:[`· `,s.blanks.toLocaleString(),` with no value grouped as blank`]})]}):(0,B.jsxs)(B.Fragment,{children:[t.omitted>0&&(0,B.jsxs)(`span`,{title:`The ${t.omitted.toLocaleString()} smallest groups are not drawn. Together they account for ${r9(t.omittedValue)}.`,children:[`· top `,12,` of `,(t.xOrder.length+t.omitted).toLocaleString(),` groups shown (+`,r9(t.omittedValue),` not drawn)`]}),t.omittedSeries>0&&(0,B.jsxs)(`span`,{title:`${t.omittedSeries.toLocaleString()} smaller series are not drawn. Together they account for ${r9(t.omittedSeriesValue)}.`,children:[`· `,t.omittedSeries.toLocaleString(),` series not drawn`]}),t.nonPositive>0&&(0,B.jsxs)(`span`,{title:`Donut slices require positive values. These groups have a combined value of ${r9(t.nonPositiveValue)} and are not included in the circle.`,children:[`· `,t.nonPositive.toLocaleString(),` zero/negative group`,t.nonPositive===1?``:`s`,` not drawn`]}),t.blanks>0&&(0,B.jsxs)(`span`,{children:[`· `,t.blanks.toLocaleString(),` with no value grouped as blank`]}),t.missingY>0&&(0,B.jsxs)(`span`,{title:`These records carry no number for the measured field, so they are counted in the group but excluded from the aggregate.`,children:[`· `,t.missingY.toLocaleString(),` not measurable`]})]})]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-ch-resize`,"aria-label":`Resize ${e.title||g}`,title:`Drag to resize · arrow keys also work`,onPointerDown:t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.parentElement,r=n?.parentElement;if(!n||!r)return;let a=t.clientX,o=t.clientY,s=e.size?.w??$7,c=e.size?.h??n.getBoundingClientRect().height,l=Math.max(1,r.getBoundingClientRect().width/12),u=t=>{let n=e9(Math.round(s+(t.clientX-a)/l),U7),r=e9(Math.round(c+(t.clientY-o)),W7);i({...e,size:{w:n,h:r}})},d=()=>{window.removeEventListener(`pointermove`,u),window.removeEventListener(`pointerup`,d)};window.addEventListener(`pointermove`,u),window.addEventListener(`pointerup`,d)},onKeyDown:t=>{let n=t.key===`ArrowRight`?1:t.key===`ArrowLeft`?-1:0,r=t.key===`ArrowDown`?20:t.key===`ArrowUp`?-20:0;!n&&!r||(t.preventDefault(),i({...e,size:{w:e9((e.size?.w??$7)+n,U7),h:e9((e.size?.h??260)+r,W7)}}))},children:(0,B.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:`M9 3.5L3.5 9M9 7L7 9`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})})})]})}function UWe({table:e,xLabel:t,yField:n}){return(0,B.jsx)(`div`,{className:`cg-ch-table`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:t}),e.columns.map(e=>(0,B.jsx)(`th`,{className:`cg-ch-td-num`,children:e.label},e.key))]})}),(0,B.jsx)(`tbody`,{children:e.rows.map(t=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{title:t.label,children:t.label}),t.values.map((t,r)=>{let i=e.columns[r];return(0,B.jsx)(`td`,{className:`cg-ch-td-num`,children:t==null?`—`:i.agg===`count`?t.toLocaleString():Z7(t,i.y?n:void 0,i.format,r9)},i.key)})]},t.key||`(blank)`))})]})})}function WWe({rows:e,fields:t,fieldByKey:n,charts:r,onCharts:i,scope:a}){let o=(0,L.useMemo)(()=>r.map(t=>fWe(t,e,n)),[r,e,n]),s=(0,L.useMemo)(()=>r.map(t=>t.kind===`table`?OWe(t,e,n):null),[r,e,n]),c=(0,L.useMemo)(()=>e.map(e=>Number(e.pid)).filter(Number.isFinite),[e]),l=(0,L.useMemo)(()=>r.filter(q7),[r]),u=(0,L.useMemo)(()=>r.filter(BWe),[r]),d=(0,L.useMemo)(()=>{let e=new Map,t=(t,n,r,i)=>{let a=e.get(t)??{bucket:n,lastN:r,fields:[]};i&&!a.fields.includes(i)&&a.fields.push(i),e.set(t,a)};for(let e of l)t(RWe(e),e.bucket,LWe(e),e.y);for(let e of u)t(VWe(),n9,zWe,e.y);return e},[l,u]),f=(0,L.useMemo)(()=>JSON.stringify([...d.entries()].map(([e,t])=>[e,[...t.fields].sort()])),[d]),[p,m]=(0,L.useState)({}),[h,g]=(0,L.useState)(!1),_=(0,L.useRef)(0);(0,L.useEffect)(()=>{if(!a||!d.size||!c.length){m({}),g(!1);return}let e=++_.current;g(!0),Promise.all([...d.entries()].map(([e,t])=>tf(Bm({pids:c,bucket:t.bucket,span:{lastN:t.lastN},fields:t.fields}),a).then(({payload:t})=>[e,t]))).then(t=>{e===_.current&&(m(Object.fromEntries(t)),g(!1))})},[a,f,c,d]);let v=(e,t)=>{if(!q7(e))return t;if(!a)return{...t,points:[],problem:`This chart is a trend over periods, but the host has not said which surface this view is, so it cannot be loaded.`};let n=p[RWe(e)];if(!n)return h?{...t,points:[],pending:!0}:{...t,points:[],problem:`The periods could not be loaded, so nothing is drawn rather than a guess.`};let r=Gm(n),i=r.rows.find(t=>t.field===e.y);return i?e.compare===`prior_year`?hie(i,r.columns,e.bucket,e.span?.lastN??12):Qm(i,r.columns):{...t,points:[],problem:`The server returned no series for this metric — a composite metric has no single aggregate to bucket.`}},y=e=>{if(!BWe(e))return;if(!a)return null;let t=p[VWe()];if(!t)return null;let n=Gm(t).rows.find(t=>t.field===e.y);return n?kWe({label:e.title??``,values:n.cells.map(e=>e.value),back:qm[n9],format:e.axis?.y?.format}):null};return(0,B.jsxs)(`div`,{className:`cg-dashview`,children:[(0,B.jsxs)(`div`,{className:`cg-dash-bar`,children:[(0,B.jsxs)(`span`,{className:`cg-cal-note`,children:[e.length.toLocaleString(),` records · every chart describes exactly this view's rows, so filters and cohort scope already apply`]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary cg-dash-add`,disabled:r.length>=12,title:r.length>=12?`A view holds at most 12 charts.`:void 0,onClick:()=>{let e=`ch_${Math.random().toString(36).slice(2,10)}`;i([...r,pWe(e,t)])},children:`+ Add chart`})]}),r.length===0?(0,B.jsx)(`div`,{className:`cg-mode-empty`,children:`No charts on this view yet. "+ Add chart" builds one from the records this view already matches.`}):(0,B.jsx)(`div`,{className:`cg-dash-grid`,children:r.map((e,c)=>(0,B.jsx)(HWe,{spec:e,data:v(e,o[c]),fields:t,yField:e.y?n.get(e.y):void 0,canPeriod:!!a,table:s[c],kpiCompare:y(e),onChange:t=>i(r.map(n=>n.id===e.id?t:n)),onRemove:()=>i(r.filter(t=>t.id!==e.id))},e.id))})]})}var GWe=`M465.85,1189.44l3.99,2.28 0.83,2.79 11.82,12.37 1.25,5.21 -0.42,1.67 0.93,0.27 1.84,-1.87 5.28,-3.59 2.67,-0.04 1.27,-2.84 0.01,-4 1.34,0.06 0.8,-0.54 0.35,-1.18 -0.85,-1.61 4.41,-1.31 5.21,-2.94 2.45,2.22 2.39,2.61 -0.23,3.08 1.45,3.42 5.72,4.51 1.64,4.13 5.42,4.24 4.77,6.42 -0.24,1.6 3.44,5.6 10.1,18.69 -1.2,2.5 3.48,1.11 -0.82,3.54 2.71,1.33 -0.23,1.05 0.6,1.19 0.1,1.96 2.84,-0.18 5.6,4 3.88,1.31 1.05,1.58 1.96,0.68 0.73,2.21 2.26,0.81 1.33,-0.54 0.85,1.93 0.1,1.3 -1.51,6 1.25,7.15 -1.54,3.21 -0.48,2.21 -4.11,5.07 -3.12,-0.75 -2.23,-7.37 0.7,-1.29 2.69,-1.48 -1.23,-0.74 -0.71,-7.66 -2.38,-4.54 -0.15,-0.76 1.23,-1.85 -8.55,4.31 -0.48,0.83 0.26,1.4 -1.61,4.28 -0.44,0.38 -1.54,-0.7 -1.19,-3.05 0.18,-0.65 2.3,-3.58 1.84,-4.69 3.33,-0.95 -3.83,-0.71 -1.53,-2.84 -1.82,-0.84 -1.4,-2.04 -0.6,-2.19 -1.34,-0.49 -0.13,-2.42 -1.73,-0.63 -1.85,-2.05 -0.42,-1.36 0.16,-2 -1.01,0.18 -6.28,-2.61 0.33,-3.47 -1.17,-4.59 -1.25,-1.87 0.52,-1.12 0.56,-0.01 4.97,2.74 -4.53,-4.44 -0.22,-1.24 0.27,-1.01 3.6,0.06 -4.15,-1.01 -1.11,1.79 -0.74,-0.07 -3.52,-4.89 -0.36,-2.99 0.2,-1.69 1.92,-4.97 -0.76,0.43 -2.14,4.75 -0.88,1.01 -3.15,-2.91 -2.02,-0.38 -1.28,-1.5 -1.9,-4.2 -0.49,-2.61 -1.66,-1.7 -0.97,-5.16 -1.29,-3.6 -0.38,-4.03 -0.56,2.26 -0.81,0.22 0.96,2.24 -1.17,0.12 1.33,2.55 0.59,3.93 3.09,12.43 0.14,0.74 -0.46,1.32 -2.41,-0.22 -1.68,-2.6 -1.39,-0.78 -3.7,0.25 0.41,-3.85 -2.1,-4.64 0.03,-0.71 2.47,-1.68 -2.17,0.53 -1.51,-3.85 -0.11,2.24 0.41,1.18 -0.01,1.62 -1.16,1.19 -2.56,-1.78 -1.31,-2.08 -4.81,-2.07 0.47,2.2 -1.27,1.35 2.05,-0.17 3.02,1.59 0.91,1.51 1.41,0.87 -0.84,1.82 2.95,0.33 1.85,3.26 0.07,1.49 -0.29,0.43 -4.34,0.79 -1.65,1.82 -10.66,-7.33 -0.23,-0.97 -3.4,-3.5 -1.86,-3.43 -3.7,-3.22 -2.37,-0.93 0.52,-0.82 -4.21,-1.58 -10.4,-6.91 2.13,-1.44 1.12,-1.97 -0.78,-3.4 0.14,-1.45 0.65,-0.94 0.74,-0.07 1.32,1.81 0.51,6.01 0.75,-4.72 2.64,-0.34 -2.89,-1.31 -2.15,-2.71 -1,-0.11 -4.52,4.8 -3.41,1.78 -2.32,0.36 -4.81,-0.86 -6.43,-3.48 1.34,-2.31 -0.45,-1.79 -0.9,-0.8 -0.01,1.72 -0.42,0.52 -2.54,1.13 -10,-2.64 -4.51,-0.25 -9.78,1.91 -3.89,-0.08 -0.16,-0.67 0.87,-0.39 -0.05,-0.48 -1.1,-1.52 -5.21,-1.69 -2.94,-2.54 0.88,-4.58 1.52,-3.14 -6.34,6.69 -7.41,-2.26 2.55,-4.01 -5.39,-0.22 -0.38,-1.72 -0.78,-0.33 -2.87,1.12 -0.77,-0.66 2.03,-1.91 -2.8,-2.01 0.03,-2.24 0.42,-1.43 3.57,-1.39 -3.39,-0.36 -3.31,2.89 -1.21,0.64 -2.44,-0.45 -1.9,1.93 -2.34,-1.88 -1,2 -1.73,0.56 -0.95,-0.1 -1.14,-1.37 0.23,-1.66 2.49,-4.71 -3.38,3.22 -3.33,0.52 -0.78,1.15 2.29,-0.43 -1.54,4.13 -2.41,0.62 -0.01,0.56 3.42,2.97 -0.55,2.13 -2.33,0.42 -1.48,1.76 5.92,-1.99 0.78,0.19 0.99,1.9 -0.93,1.31 -1.55,0.81 -0.39,1.61 0.21,3.56 -1.54,1.05 -1.11,3.02 -3.64,0.94 -2.89,-0.73 -1.33,-1.22 -1.65,0.81 -1.47,-2.45 -0.42,2.38 -1.33,2.43 -0.55,2.8 -1.32,-3.38 -0.92,1.45 0.14,2.39 -2.54,-0.77 0.44,2.13 -2.63,2.78 -1.59,-0.34 -1.68,1.04 -1.39,-0.63 -0.17,1.88 -0.62,1.18 -2,1.9 -0.93,2.06 -2.82,-1.15 0.13,1.42 -2.22,-0.19 -4.23,1.27 -2.41,-1.7 0.2,-1.73 0.94,-1.42 5.12,-2.47 2.39,-2.72 1.63,-3.03 -0.49,-0.4 -4.11,3.14 -3.57,-1.12 -0.6,-0.47 -0.41,-1.38 1.35,-4.68 3.85,-6.53 0.95,-4.42 -0.48,-4.48 -0.02,-1.47 0.39,-0.46 10.02,-6.56 1.05,0.02 2.69,2.1 5.47,-0.44 6.34,1.76 -0.77,-1.38 -5.12,-1.37 -5.24,-4.17 1.79,-1.43 1.81,-3.12 4.64,-3.19 -1.19,-0.08 -2.98,0.72 -1.46,1.36 -1.73,3.18 -5.64,0.46 -1.09,-1.11 -4.3,2.57 -2.33,2.65 -5.05,2.5 -1.6,1.61 -0.57,1.81 0.39,1.83 -2.8,1.69 -3.12,3.57 -0.39,1.74 0.51,1 -1.24,1.68 -3.24,2.25 -4.22,-1.31 4.09,3.9 0.4,0.95 -0.34,1.97 -1.13,1.74 -5.14,1.77 2.12,1.1 -0.27,1.44 -0.52,0.48 -3.07,1.11 -0.03,-1.58 -0.54,-0.23 -2.71,2.1 -0.21,0.27 0.7,0.45 -1.63,2.36 -3.82,3.28 0.23,0.6 -1.26,4.02 0.56,0.79 5.38,1.8 2.71,1.74 1.04,1.67 -1.26,2.84 -2.04,2.2 -2.79,1.46 -1.79,2.07 -0.75,2.76 -2.32,1.33 0.93,0.34 -0.45,2.79 -3.68,0.9 -0.16,1.34 -4.8,0.85 -1.6,2.88 -5.04,3.16 -0.06,0.7 -2.08,2.82 -2.53,0.49 -0.42,0.39 -0.2,1.67 -2.13,-0.03 -2.2,1.88 -0.49,0.68 0.92,1.84 -0.03,0.75 -0.85,2.09 -1.33,0.84 -0.42,1.15 -1.72,0.09 -4.08,3.74 -3.43,0.75 -1.57,3.23 -3.31,-0.22 -2.38,1.92 1.69,0.65 -5.51,1.75 -1.57,2.53 1.89,0.23 1.25,2.15 -2.28,2.47 -0.53,0.06 -0.22,-1.92 -0.56,-0.37 -1.29,2.89 -0.97,1.14 -8.34,3.59 -0.5,2.32 -1.05,1.4 -0.22,-4.01 -1.05,-0.34 -6.85,4.17 -1.44,1.97 -1.43,-0.31 -1.65,1.39 -1.44,-0.61 -3.2,2.5 -3.25,0.13 -0.15,-1.65 0.72,-1.43 2.41,-0.15 -1.77,-1.38 -1.81,-0.13 -1.57,1.11 -0.99,3.46 -3.78,5.03 -1.06,-0.09 -1.22,1.4 -1.28,0.42 -0.81,-0.51 0.52,-0.58 -0.94,-2.02 -0.54,-0.68 -1,-0.08 0.13,4.14 -0.63,0.83 -2.17,0.84 -1.49,-1.83 -1.41,-0.36 0.22,1.81 -0.35,1.13 -2.32,1.53 0.64,-5.6 1.87,-1.44 2.37,-0.03 8.52,-10.52 5.23,-3.8 5.48,-2.32 0.43,0.14 -0.5,0.76 0.34,0.47 3.34,-0.8 0.24,0.47 -0.28,0.59 -1.21,0.6 0.04,0.5 2.3,2.69 0.65,-0.35 -0.14,-1.68 0.59,-0.32 2,0.14 1.06,0.95 1.66,0.23 0.24,-0.55 -0.43,-0.65 -1.95,-1.44 -0.68,-1.44 2.7,-6.29 5.88,-5.09 5.71,-2.63 4.16,-4.02 0.26,1.37 2.5,0.44 0.16,-5.09 3.87,-5.43 2.13,-1.44 3.28,-3.42 1.23,-0.43 2.3,1.38 0.83,-0.49 -1.24,-0.73 -1.43,-2.94 0.86,-4.61 0.12,-3.34 0.63,-1.92 4.11,-1.17 -3.35,-1.28 -0.4,-3.64 0.71,-1.77 2.65,-3.01 2.89,-2.09 -0.75,-0.8 2.63,-7.98 -1.75,3.22 -2.04,2.45 -11.93,5.78 -1.27,-0.6 -2.28,-4.57 0.88,-3.29 3.92,0.48 -3.89,-2.48 -1.04,0.38 -1.87,3.17 -1.49,-0.99 0.39,1.58 -0.98,4.03 1.02,4.34 -0.19,1.73 -1.85,0.79 -1.5,-1.42 -4.22,-7.06 -2.46,-2.6 -2.85,2.01 -2.64,-1.9 -2.4,-3.2 -5.16,3.96 -4.89,1.58 -0.93,1.23 -0.37,1.62 -4.49,1.26 -4.43,-0.7 3.28,-1.6 1.51,-1.69 -0.64,-2.27 -0.1,-2.63 1.65,-2.06 -1.71,0 -1.1,0.74 -1.02,-1.55 -0.49,-3.06 1.72,-3.22 0.5,-3.6 -3.52,-8.85 -1.19,-4.52 -2.03,-2.42 3.21,-7.62 2.19,-1.64 -2.18,-0.02 -3.76,6.73 -2.46,2.89 1.56,0.87 0.23,0.73 0.31,1.66 -0.8,3.12 -1.85,-0.09 -1.65,1.61 -3.88,1.75 -7.83,0.88 -2.68,-2.04 0.13,-2.21 -3.86,-3.54 -2.18,-3.54 -1.57,-0.08 -2.97,-2.42 0.4,-2.03 -3.73,-0.94 3.84,-4.61 1.33,-3.11 1.07,-0.44 5.54,2.82 0.6,1.08 -1.21,3.09 4.24,-4.05 1.19,0.49 1.88,3.6 2.29,-1.73 1.22,-2.16 -2.3,-1.51 -3.22,-0.74 3.63,-1.15 -1.84,-1.56 -2.79,2.46 -5.09,-0.13 -3.55,-1.43 -4.11,-0.04 -0.69,-0.77 3.49,-3.43 -2.37,0.41 -0.69,-0.84 0.11,-1.47 -0.86,0.93 -1.61,-1.06 1.15,-1.68 -0.34,-0.14 -0.68,0.21 -0.66,1.27 0.12,2.5 -2.1,0.09 -1.43,-4.66 -1.96,-0.85 -0.48,-1.62 1.24,-2.08 -0.55,-1.07 -1.32,-0.35 -1.51,1.05 -0.67,-0.94 -0.17,-2.5 4.08,-1.09 -2.4,-1.25 -0.67,-1.32 5.3,-1.6 -1.28,-2.17 -0.21,-1.27 0.42,-2.16 5.83,-9.12 2.22,-1.49 2.75,0.91 -0.98,-2.08 1.78,-0.67 1.12,-2.5 -2.31,2.13 -0.6,-4.41 0.52,-2.92 1.39,-2.56 3.33,-0.26 0.11,-0.59 -1.71,-1.85 1.32,-2.2 3.43,-1.18 1.87,0.37 2.36,1.37 1.36,1.7 -1.38,2.74 2.65,-2.25 2.47,1.49 3.87,-1.72 1.59,-2.31 2.12,-1.49 3.85,-6.7 1.94,-0.12 0.64,1.6 0.94,0.47 5.33,-0.39 2.72,-0.73 3.86,-4.19 1.14,-1.76 0.55,-2.31 -1.43,-5.49 -0.95,-5.74 -2.65,-3.82 -1.88,-1.14 -1.2,0.16 0.87,-2.45 2.52,0.27 2.97,-1.66 1.09,-2.73 -0.58,-3.03 -2.76,-3.48 -3.83,3.5 -3.33,-0.58 -1.24,1.97 -5.31,3.45 -3.42,4.29 -0.86,1.93 -1.09,0.09 -0.79,-3.75 -3.73,-3.6 -1.12,1.23 1.46,1.93 1.39,0.35 -1.05,2.53 -3.89,-3.33 -2.58,-1.01 -6.72,0.11 -4.42,2.02 -0.83,-0.58 -2.43,2.01 -13.25,-3.42 -2.07,-1.14 -1.78,-2.72 0.04,-1.86 0.79,-0.78 -0.08,-2.67 -1.54,-0.71 -4.29,-5.51 1.88,0.6 2.64,-0.53 0.9,-2.52 3.76,-0.36 -0.41,-0.68 -14.19,-3.72 -6.63,-4 -1.15,-2.48 1.79,-2.5 0.19,1.86 3.8,-2.14 1.99,-2.8 3.77,-0.49 3.71,-4.89 3.97,-2.6 2.1,-0.72 2.34,1.37 4.31,-0.28 0.79,-1 -3.18,-2.2 0.32,-1.23 4.12,-3.45 4.39,-0.79 6.86,-4.3 8.34,-0.8 1.02,1.19 -2.91,-0.03 1.35,1.28 -1.45,4.35 0.1,2.59 -1.59,2.02 3.85,3.71 9.2,-0.44 3.41,1.36 4.24,-0.57 3.19,0.79 1.34,-0.3 2.95,-5.54 1.16,-0.87 2.89,1.75 1.04,-0.57 0.86,1.43 -0.4,-2.99 -0.58,-1.12 -4.83,-2.06 -3.22,1.02 -1.01,-1.16 0.33,-2.31 -3.46,-5.73 -1.44,-1.17 -1.7,-0.06 -1.59,-4.59 2.8,-1.53 1.23,0.83 1.38,3.4 1.3,0.5 -0.38,3.36 1.61,3.09 3.62,2.85 4.96,-1.02 4.22,3.16 1.52,0.32 4.77,-1.34 0.05,-2.51 -0.4,-1.83 -1.12,-1.15 -3.22,0.22 -2.51,-1.89 -2.13,0.52 -3.94,2.89 -5.22,-4.26 -0.25,-2.99 2.92,-5.08 -1.11,-1.2 -2.8,-0.85 -4.84,0.87 -0.21,-2.46 -1.97,2.5 -4.77,-0.26 -6.03,-2.2 -2.15,-2.72 -2.52,-8.33 -2.08,-3.85 -14.35,-13.23 -6.52,-3.36 -3.15,-3.74 -6.26,-2.52 2.74,-2 -1.16,1.56 0.88,0.4 2.16,-1.98 2.26,-11.61 -0.31,-2.78 7.96,0.56 13.73,-2.18 4.95,-3.17 3.78,-4.26 3.76,-7.15 0.5,0.14 0.77,-7.23 1.61,-4.83 12.18,-19.13 1.37,2.5 -3.56,3.22 12.26,-4.8 4.12,-4.81 5.88,-4.94 1.75,0.79 -1.62,3.26 1.14,0.86 -1.02,3.87 2.14,0.06 0.47,1.78 0.58,-7.4 1.5,0.68 3.37,-1.62 -4.09,-0.2 -2.45,-3.55 -1.36,-0.02 4.56,-5.24 4.16,-3.17 1.4,0.65 0.1,0.96 -1.78,1.76 1.01,1.13 2.9,-1.84 4.27,0.09 1.55,-1.45 6.54,-0.67 6.65,-6.25 6.16,-9.85 3.57,-3.16 0.85,0.39 -1.96,1.96 1.11,1.78 9.38,3.85 0.75,2.17 -0.63,2.09 -1.93,2.31 -3.89,2.36 1.19,0.89 0.78,2.09 1.15,0.26 3.33,-2.07 4.7,-7.16 2.53,0.56 3.08,3.36 -1.27,3.24 6.71,3.23 3.15,-2.64 4.79,-0.48 3.01,-1.44 10.61,2.98 0.77,1.26 -2.33,2.66 -0.38,2.74 2.29,1.34 0.19,1.59 0.91,0.4 4.6,-0.12 -2,3.68 8.19,1.13 6.39,-3.1 4.43,2.57 4.59,-2.56 6.84,0.3 6.61,2.88 2.38,3.33 3.82,-1.27 3.11,1.76 1.87,2.9 7.31,1.57 3.62,-0.71 10.49,1.06 7.12,5.06 6.58,0.88 2.3,-1.89 13.63,-2.58 5.81,2.75 4.68,5.44 6.8,3.28 3.31,3.84 4.62,0.09 0,254.4 5.42,1.88 0.83,-1.86 5.46,2.67 3.37,-3.33 6.8,-0.36 0,1.48 -1.21,4.48 1.47,1.87ZM158.04,1032.11l-0.44,0.16 3.71,-3 -3.27,2.84ZM97.13,1101.66l0.17,0.62 6.53,0.56 2.3,-1.92 2.75,-0.77 3.51,2.09 1.19,3.21 4.47,1.56 0.8,1.45 9.54,1.59 -0.52,2.45 -1.03,1.07 -5.83,0.01 -2.22,2.84 -0.13,1.54 -1.2,1.02 -1.62,-4.17 -4.22,-1.87 -0.94,-2.22 -2.9,-2.41 -4.86,-1.87 -6.43,3.07 -3.09,-2.35 -0.31,-2.68 0.82,-4.44 1.13,-0.61 2.09,2.23ZM364.88,1170.44l-1.44,0.19 -0.76,-0.62 0.25,-1.68 0.73,-0.18 0.83,0.56 0.39,1.73ZM82.58,1179l2.46,1.51 1.57,-0.16 1.77,2.29 -4.59,-0.68 -4.99,-3.79 0.3,-1.74 1.41,-0.89 0.72,2.34 1.35,1.12ZM318.34,1181.2l-0.55,0.08 0.74,-1.13 0.51,-2.22 0.68,0.3 0.14,0.41 -1.52,2.56ZM367.98,1179.16l-0.36,1.18 0.34,1.07 -0.82,3 -0.96,0.84 0.12,-1.04 -0.75,0.02 -0.23,-1.6 1.11,-3.69 0.39,0.49 0.81,-1.22 0.35,0.95ZM382.36,1179.17l0.26,0.64 3.06,0.25 -5.61,3.28 -1.22,-2.92 1.62,-1.96 1.89,0.71ZM396.87,1181.77l-0.36,0.56 -1.52,-0.56 1.77,-1.48 0.3,0.3 -0.19,1.18ZM157.75,1180.7l1.04,1.14 2.31,-0.28 1.26,0.73 0.46,2.07 -0.26,3.54 0.93,0.93 0.44,2.62 -4.04,0.53 -1.74,0.91 -0.35,0.68 0.28,1 -0.48,0.26 -1.29,-1.15 -4.16,-1.13 -5.82,-3.27 -3.38,-4.52 2.1,-0.62 4.72,0.38 0.59,-1.82 3.52,-1.98 3.87,-0.02ZM367.09,1193.71l-1.25,0.33 -0.3,-0.67 1.19,-2.61 4.91,-5.51 1.77,-3.97 1.83,0.6 0.71,0.99 -4.11,4.89 -2.05,4.21 -2.7,1.74ZM363.84,1187.99l-0.59,0.7 -2.25,-0.43 0.46,-1.37 1.72,-0.87 1.89,1.35 -1.23,0.62ZM403.16,1193.6l-0.54,0.13 1.92,-3.13 2.38,-1.47 -0.15,0.75 -3.61,3.72ZM217.1,1221.18l-1.72,0.18 -0.7,-2.17 1.65,-1.49 3.09,-1.29 -2.32,4.77ZM313.05,1223.19l-1.72,-1.24 1.98,-1.67 1.08,0.16 0.07,0.88 -1.41,1.87ZM313.83,1225.9l0.42,0.18 0.73,-1.34 1.35,1.1 0.82,-0.24 0.53,1.34 1.19,0.05 -0.09,1.42 -1.44,1.8 -1.82,-1.96 -0.75,0.94 0.29,1.6 -2.6,0.71 -0.38,-1.45 -0.31,0.12 -0.96,2.14 -2.8,1.5 -5.15,-2.01 4.61,-4.53 2.33,0.4 0.03,-1.45 -0.82,-1.54 2.6,-0.64 2.22,1.86ZM515.64,1230.19l5.01,0.39 3.12,5.8 1.62,5.23 -1.16,-0.9 -2.9,-7.28 -0.8,-0.81 -0.64,0.32 0.45,3.21 3.75,6.46 0.19,1.9 -0.6,0.85 0.74,1.75 -0.19,0.67 -1.99,0.78 -1.82,3.22 -1.99,1.88 -1.36,-0.01 -0.67,-1.69 -0.07,-1.2 0.5,-0.77 1.01,-5.27 -1.97,-3.31 -1.38,-9.41 -1.44,-3.99 -0.18,-1.99 0.98,0.75 1.79,3.42ZM519.82,1228.74l-0.08,0.54 -1.55,-0.05 -2.34,-1.83 1.61,-0.9 2.36,2.24ZM503.69,1228.41l1.63,2.11 -0.32,1.92 -0.89,0.41 0.91,1 3.04,-2.85 2.09,0.61 2.37,1.73 0.3,1.35 -0.49,2.9 -1.5,0.5 -1.46,-0.47 -1.22,1 1.01,0.77 3.08,0.18 1.2,2.87 -0.66,2.29 -7.2,-3.93 -0.5,0.34 -0.11,3.61 -0.84,1.28 -2.49,-0.56 -1.89,-4.84 -4.36,-4.24 -1.24,-2.12 0.64,-2.66 1.63,-1.01 0.54,-1.64 2.03,2.6 0.01,-1.2 0.55,-0.95 1.67,-0.17 1.83,-1.35 0.64,0.52ZM308.36,1237.45l0.08,1.17 3.13,-1.71 2.13,0.5 0.11,0.92 -0.76,1.03 0.04,0.66 0.81,1.22 1.99,0.66 0.23,0.8 -2.23,2.59 -6.02,-0.91 -0.64,0.61 2.46,0.33 1.16,2.29 -2.27,0.51 -1.97,1.75 -2.53,0.24 -3.57,3.12 -1.65,0.53 0.98,0.47 0.04,1.44 -1.3,2.14 -2.45,1.74 -0.89,-0.29 -0.22,-0.67 3.16,-3.52 -2.35,-1.26 -1.18,0.6 0.77,-2.11 -2.37,-0.44 -1.56,0.97 1.61,0.2 0.62,1.71 -0.87,1.95 -0.88,-0.19 -1.82,-2.41 -0.81,-3.55 -1.55,-2.73 0.37,-2.33 1.57,-2.4 2.89,-1.67 1.88,-0.28 0.98,0.43 0.4,0.92 -0.15,0.66 0.69,0.56 1.62,3.63 1.34,1.12 -1.26,-2.91 -0.46,-4.09 1.69,-0.1 -0.04,-0.48 -2.42,-2.72 0.74,-1.54 1.66,-0.18 1.94,3 0.42,0 1.11,-1.44 1.97,0.06 0.55,-2.46 -0.65,-1.01 0.74,-0.3 3.53,1.61 -0.54,1.56ZM304.46,1236.89l-0.62,0.44 -2.56,-2.71 0.45,-0.32 1.52,0.82 1.21,1.77ZM512.34,1247.47l1.67,4.1 2.31,9.14 0.11,2.38 -0.53,1.66 0.31,4.54 -0.59,1.77 -1.42,-1.34 -1.98,-4.88 0.16,-1.6 0.95,-1.71 -1.53,0.39 -1.61,-1.35 -0.05,-2.05 -1.38,0.49 -0.52,-0.45 0.17,-2.29 1.32,-1.99 -1.61,-1.13 -0.39,-2.25 -0.91,-1.28 -0.53,0.12 -1.82,4.41 -1.71,0.5 0.51,-1.9 -0.63,-3.78 0.4,-0.78 1.85,-0.78 2.01,-3.8 1.16,0.02 4.28,3.84ZM111.95,1251l-1.18,0.99 -1.07,-0.37 -0.32,-1.02 3.08,-0.82 -0.51,1.22ZM307.12,1252.24l-1.7,0.65 -1.58,1.95 -0.9,-1.07 0.23,-1.68 0.78,-1.11 4.29,0.68 -1.12,0.58ZM530.59,1254.78l0.76,0.65 0.41,-0.68 2.19,0.64 1.33,1.96 -0.06,4.22 -0.51,1.1 -3.7,-4.28 1.96,4.54 0.14,1.71 -0.41,1.12 -4.8,0.21 -0.53,-1.09 -0.36,-5.81 -1.62,-2.64 -1.78,-1.78 0.2,-0.71 1.09,-0.53 5.69,1.37ZM523.5,1258.08l0.73,1.44 1.07,-0.11 1.05,2.71 -0.32,1.04 -1.01,0.37 -0.33,5.97 -0.74,3.36 -0.5,0.55 -0.84,-0.65 -0.63,1.13 -0.76,0.01 -0.63,-2.58 0.56,-4.31 1.27,-0.88 -2.34,-2.55 0.13,-0.77 -1.21,-2.21 0.13,-2.39 1.13,-1.65 1.49,-0.3 1.75,1.82ZM537.64,1264.7l-1.57,0.27 -0.53,-0.25 -0.19,-0.88 1.2,-4.71 2.12,2.28 1,2.25 -2.03,1.04ZM116.56,1262.44l2.33,0.14 0.87,0.71 -1.8,0.99 -1.52,-1.28 0.12,-0.56ZM293.45,1264.92l-1.41,-0.5 0.12,-0.65 1.2,-0.79 1.21,0.12 -0.07,1.22 -1.05,0.6ZM288.05,1266.55l-0.77,0.49 -0.3,-0.58 1.75,-2.5 1.2,-0.81 0.83,0.57 -2.71,2.83ZM544.86,1273.24l-0.24,3.38 -2.68,0.07 -0.59,-0.81 0.16,-1 -0.51,-0.56 -2.37,-0.45 -0.45,-2.45 1.14,-0.88 2.49,-5.29 0.72,0.24 2.84,4.99 -0.51,2.76ZM537.26,1270.42l-1.27,-0.25 -1.66,-2.16 1.54,-1.83 2.94,0.38 -0.03,2.51 -1.52,1.35ZM528.31,1268.53l4.14,0.4 1.38,2.58 -0.17,2.12 3.85,1.94 1.82,2.03 1.91,4.21 2.93,4.15 -3.85,-2.27 -1.37,2.42 2.43,-0.19 2.3,1.99 0.63,1.21 -0.53,1.97 2.3,-0.12 0.32,0.44 -0.27,3.47 0.22,4.54 -0.46,1.55 -1.91,-0.17 -1.73,-3.41 -2.37,-0.89 -0.5,-0.86 -0.33,-2.79 -0.9,0.11 0.21,1.13 -0.24,0.87 -0.89,-0.37 -1.48,-2.78 -2.34,-2.78 0.17,-0.65 1.64,-0.71 -1.4,-2.18 0.56,-1.72 -3.02,-0.34 -0.8,-1.66 -2.1,-0.04 -1.44,-1.9 1.09,-1.04 1.96,0.77 1.94,-2.48 -0.55,-1.99 -0.93,-0.35 -3.56,1.89 -0.66,-0.45 -0.15,-0.7 2.56,-2.98 -0.73,-1.45 -0.05,-2.04 0.37,-0.48ZM557.75,1285.79l-1.18,4.46 -1.2,1.2 -0.84,-0.27 -0.62,-0.97 -1.19,-0.15 -0.34,-0.8 0.33,-1.05 -0.29,-0.8 -0.85,1.35 -1.36,0.84 -1.37,2.66 -0.56,-1.14 -0.4,-3.86 2.26,-3.41 0.26,-4.97 4.05,-2.51 3.09,4.62 0.36,1.17 -0.15,3.63ZM278,1279.1l-0.44,0.64 -0.86,-0.05 -0.65,-0.77 1.64,-1.91 0.31,2.09ZM531.28,1284.7l0.27,0.92 -4.19,4.58 0.17,-2.89 -1.16,-1.67 1.17,-0.85 3.74,-0.09ZM219.76,1289.29l1.51,-1.32 -0.35,1.46 1.09,2.45 -1.38,0.52 -1.06,-0.38 -1.06,0.65 -0.35,-0.57 -0.16,-3.22 1.32,-1.39 0.59,0.5 -0.15,1.3ZM223.81,1288.83l-0.16,1.58 -1.98,-1.5 2.14,-0.08ZM536.32,1297.65l0.28,0.26 0.75,-0.89 1.76,0.67 -0.34,2.69 -0.67,1.42 -1.15,-0.49 -2.3,-2.88 -1.29,-2.28 -1.46,-4.08 -1.9,-0.7 -0.41,-1 0.28,-0.86 1.51,-0.44 2.27,2.23 1.15,2.06 0.16,1.54 1.36,2.75ZM229,1293l-4.03,4.09 0.84,-2.29 -0.21,-1.69 2.16,-1.49 0.7,-1.39 0.56,0.08 -0.31,0.84 0.67,0.78 -0.38,1.07ZM553.65,1293.97l1.22,3.49 -1.98,0.19 -0.45,-0.3 0.16,-1.72 -0.57,-0.77 -1.26,0.19 -0.03,-1.3 0.45,-0.92 -0.26,-2.22 0.75,-0.28 1.23,0.98 0.74,2.66ZM233.07,1292.54l-0.22,1.83 -1.3,-0.29 0.11,-0.99 0.47,-0.03 0.26,-1.83 0.34,-0.17 0.34,1.48ZM234.81,1296.1l-0.67,-0.11 -0.46,-1.6 0.81,0.35 0.32,1.36ZM188.01,1295.94l1.1,3.27 2.78,1.82 0.58,1.06 -3.12,-1.31 -2.56,2.17 -5.58,0.09 -1.84,0.97 -1.92,2.42 -2.13,0.86 -2.64,-0.29 -0.92,-2.46 0.18,-1.24 2.07,-1.66 2.59,-4.24 2.33,0.14 5.31,-2.96 2.27,-0.03 1.5,1.39ZM201.41,1298.58l-1.06,-0.51 -0.49,-1.16 1.93,-1.03 0.35,1.02 -0.73,1.68ZM198.49,1307.34l-0.98,0.43 -1.05,-0.45 -0.9,-0.82 -0.1,-0.98 2,0.64 1.03,1.18ZM164.28,1312.5l-0.61,-0.06 -0.45,-2.21 1.18,-0.61 0.72,1.22 0.91,0.49 -1.75,1.17ZM161.09,1313.78l-2.22,0.46 -0.79,-1.9 0.74,-0.9 1.69,-0.31 2.27,2.08 -1.69,0.57ZM152.29,1317.07l0.49,0.91 0.85,-0.58 1.42,-2.23 1.61,1.28 -2.93,2.84 -0.69,1.63 1.87,-0.38 0.86,0.44 -4.47,3.09 -0.78,1.16 -4.36,1.3 -5.4,2.83 -2.05,-1.22 7.65,-3.87 0.5,-2.1 0.87,-1.2 1.39,0.02 0.85,1.07 0.17,-0.84 0.71,-0.53 -3.75,-1.36 -0.53,-1.72 0.91,-1.34 4.15,-1.23 0.52,0.19 0.14,1.84ZM156.9,1320.49l-0.46,-0.86 1.55,-1.45 -1.09,2.31ZM136.94,1327.73l-3.49,2.04 -2.67,3.69 -6.64,3.99 3.34,-4.02 0.2,-1.97 1,-1.49 3.53,-1.07 -0.19,-2.39 1.24,-1.74 2.44,-1.09 2.79,0.94 0.27,0.44 -0.69,1.86 -1.13,0.81ZM117.28,1337.16l-0.35,1.04 -2.93,-0.26 -0.13,-0.45 1.95,-1.01 1.46,0.68ZM105.43,1342.15l-0.72,0.6 -0.34,-0.96 1.65,-1.81 1.11,0.56 -0.34,1.09 -1.36,0.52ZM60.56,1352.32l-6.1,0.76 -0.93,-0.52 11.25,-3.59 0.54,-0.99 -2.01,-0.89 3.03,-1.92 1.72,1.65 -0.42,1.59 -1.41,0.85 0.66,1.21 -6.33,1.85ZM85.73,1347.92l-1.76,-0.01 1.7,-2.14 1.78,1.09 -1.72,1.06ZM73.35,1350.45l6.03,1.06 -4.98,0.69 -4.27,-0.12 -1.78,-1.39 2.26,0.35 1.56,-0.73 1.18,0.14ZM45.27,1352.93l-0.27,0.54 -1.11,-0.58 -0.48,-0.96 0.33,-0.8 0.89,-0.01 1.16,1.32 -0.52,0.49ZM38.76,1355.43l0.06,0.62 1.71,0.24 -0.17,1.55 -0.66,-0.18 -2.96,2.12 -0.75,-0.84 -1.42,1.32 0.99,-3.43 1.57,-0.91 -0.1,-1 0.54,-1.69 1.15,0.08 0.53,0.69 -0.49,1.43ZM32.45,1358.19l-5.77,0.74 -0.17,-0.45 4.7,-1.91 1.03,-1.93 0.64,-0.35 0.54,0.49 -0.82,1.75 -0.15,1.66ZM24.13,1359.42l-0.53,0.59 -1.51,-1.01 -0.23,-0.34 0.9,-0.48 0.15,-0.86 -2.37,-2.18 0.89,-0.62 1.85,-0.04 1.76,1.44 1.76,0.25 -1.43,0.9 -1.24,2.35ZM45.41,1356.43l-0.96,0.4 -1.26,-0.81 0.12,-0.95 2.1,1.36ZM42.25,1356.81l-0.72,1.08 -0.53,-0.49 -0.2,-1.49 0.4,-0.38 1.05,1.28ZM1052.56,1684.94l-1.51,1.48 -4.36,0.45 2.45,-0.8 -0.76,-1.53 -0.76,-0.55 0.01,-1.48 -1,-1.75 -1.42,4.32 -3,-0.05 -0.99,-20.2 4.57,-41.48 -1.35,-1.27 29.35,0.32 4.81,28.06 2.12,5.82 0.47,1.57 -0.14,0.66 0.73,1.01 -1.29,1.86 -1.01,3.58 -0.01,1.39 0.79,2.73 -0.42,3.69 0.28,2.37 0.69,1.54 -29.43,0.01 -0.09,1.86 2.2,2.9 -0.24,2.16 -0.69,1.33ZM1045.94,1686.59l-2.78,0.16 2.35,-0.44 0.43,0.28ZM1027.36,1608.42l0.18,1.13 -0.85,0.45 -0.18,1.17 -1.31,0.77 -0.56,1 0.2,1.23 -0.47,1.23 -1.12,1.25 -0.48,1.39 0.17,1.55 -0.56,1.24 -1.29,0.94 -0.73,2.05 -1.09,0.66 -0.67,1.26 -0.74,0.45 -0.5,3.1 -0.59,1.24 -1.44,0.79 -0.63,1.44 -1.05,0.87 -0.35,0.83 0.29,1.1 -1.77,1.02 0.37,1 -0.17,1.01 -1.76,2.08 0.4,0.8 -0.48,0.46 0.84,1.97 -0.26,1.97 0.65,1.04 -0.49,2.74 -32.9,0.05 -0.07,-7.38 -1.64,-0.47 -1.89,0.38 -1.44,-1.19 0.51,-24.01 -2.04,-15.66 50.7,0 1,1.83 -0.01,1.06 -2.59,2.78 -0.89,1.5 7.7,-0.12ZM807.28,1672.34l-22.69,0.05 -43.17,-15.87 1.31,-2.92 1.58,-0.14 0.75,-0.51 0.44,-0.94 -0.15,-1.92 -1.79,-1.2 -0.64,-1.33 -0.17,-2.19 0.2,-1.18 1.13,-0.71 0.92,-1.88 0.14,-4.06 2.05,-3.27 2.31,-1.99 -0.37,-0.94 -2.42,-1.84 -0.31,-1.4 -2.42,-4.4 0.23,-6.19 -0.81,-2.69 0.19,-1.2 -0.47,-4.02 -0.62,-1.35 0.82,-1.52 1.86,-0.49 1.13,0.11 1.98,1.64 0.56,0.02 1.6,-2.13 0.03,-11.65 56.81,0.04 -0.01,78.07ZM743.99,1622.54l-0.01,1.16 0.61,1.57 1.81,2.83 0.31,1.4 2.8,2.36 -0.01,0.42 -3.33,3.24 -1.03,2.02 -0.14,4.06 -0.92,1.88 -1.13,0.71 -0.03,3.37 0.64,1.33 1.79,1.2 0.25,0.97 -0.54,1.89 -0.75,0.51 -2.92,0.41 -26.05,2.31 -0.1,-1.56 -0.53,-0.53 -0.68,0.33 -0.22,-3.72 -0.64,-2.19 -1.69,-2.66 -6.97,-5.82 -2.1,-0.5 -0.33,0.63 -1.33,-0.43 0.2,-1.56 -1.29,-2.19 -3.7,-0.09 -3.55,-1.21 -1.05,-0.71 -0.36,-1.29 -3.85,-2.21 -1.22,0.26 -3.87,-0.97 -4.87,-0.03 -1.86,-1.49 0.23,-3.21 -0.44,-1.91 0.34,-1.77 -0.29,-0.63 -2.26,-1.22 -0.31,-0.91 0.28,-1.26 -0.45,-0.83 -1.4,-0.78 -1.31,-1.77 -1.66,-0.97 -0.68,-1.62 -3.65,-5.09 -2.42,-2.5 -0.47,-3.41 1.46,-2.27 -0.2,-1.69 -0.83,-1.24 -3.23,-0.74 -2.62,-3.09 -0.16,-2.37 -1.03,-2.43 -0.17,-3.3 0.78,-0.37 0.7,0.13 0.16,1.91 0.83,0.92 1.49,1.3 1.09,0.33 -3.58,-6.94 0.81,-0.67 2.58,-0.61 6.39,-0.09 -1.14,-0.41 -2.9,0.13 -1.72,-0.7 -1.39,0.84 -2.72,-1.15 -1.03,0.52 -0.13,2.24 0.32,1.67 -0.62,0.17 -4.67,-3.31 -0.76,0.97 0.35,-1.57 -0.11,-1.88 1.14,1.5 -0.35,-1.06 -1.57,-1.57 -0.86,-2.09 -1.91,-1.26 -4.68,-5.42 -0.21,-2.98 -1.15,-3.78 0.48,-2.16 -0.62,-3.85 -3.14,-4.73 -2.45,-2.35 -0.37,-1.78 -0.17,-1.79 1,-3.29 0.34,-0.45 0.38,0.66 0.34,-1.13 -0.33,-0.28 0.98,-2.7 -0.08,-2.81 0.82,-3.45 -0.56,-3.61 -0.52,-1.48 -0.93,-1.05 0.41,-1.54 -0.22,-1.72 48.1,0.01 0.01,44.9 21.32,18.98 40,38.16ZM684,1635.13l2.32,0.7 1.25,-0.33 0.22,0.34 -2.96,0.82 -0.86,-0.37 -0.37,-1 0.4,-0.16ZM679.18,1635.88l-1.54,-0.11 0.84,-0.55 0.7,0.66ZM682.17,1637.34l-1.4,0.01 -0.97,-1.32 2.05,-0.17 1,0.73 -0.68,0.75ZM701.46,1644.62l0.58,1.01 -1.7,-0.07 -0.52,-1.31 -0.76,-0.26 -0.12,-0.44 2.52,1.07ZM689.06,1646.92l-1.2,-0.1 -0.36,-0.73 1.1,0.05 0.46,0.78ZM701.44,1652.2l-1.4,-0.15 -1.33,-2.33 0.37,-0.3 2.36,2.78ZM807.29,1594.27l0,-58.59 79.89,0.01 0.14,58.58 -80.03,0ZM1231.07,1520.32l0.05,7.51 -0.53,2.8 -4.81,0.66 -1.2,-0.31 -1.23,0.55 -5.07,-0.14 -1.13,1.04 -6.9,3.39 -1.05,-1.7 2.71,-1.73 -0.69,-1.16 0.73,-11.58 7.66,0.33 0.01,0.4 0.56,-0.4 10.89,0.34ZM1171.57,1567.03l-1.05,-0.8 0.91,-1 1.26,1.81 -1,1.19 -0.12,-1.2ZM1194.24,1573.35l-7.62,0 -0.88,-18.57 1.23,-1.56 1.89,-0.24 1.02,0.42 -1.9,2.58 0.16,2.42 1.83,2.88 0.23,2.77 0.93,1.85 1.43,2.15 1.1,0.61 -0.46,2.11 -0.66,0.6 1.3,0.19 0.4,1.79ZM1052.56,1684.94l0.69,-1.33 0.24,-2.16 -2.2,-2.9 0.09,-1.86 29.43,-0.01 1.4,3.72 30.08,2.05 0.52,2.28 0.93,0.29 0.94,-1.4 -0.09,-3.36 0.92,-1.09 3.23,0.98 1.93,0.11 0.53,1.2 2.36,11.15 1.65,4.41 2.33,5.31 4.27,7.32 -0.49,0.77 -0.2,2 1.46,4.79 -0.49,-0.44 -1.25,-3.13 0.03,-4.47 -0.29,0.07 -0.69,2.24 -0.44,-1.53 0.49,-1.5 -0.88,-0.7 -0.05,-1.29 -0.77,-0.33 1.02,4.88 5.95,15.1 1.56,2.72 0.54,5.42 -0.97,9.32 -0.37,-0.56 -1.61,3.28 -0.76,3.62 -1.34,1.28 -0.83,-0.04 -2.03,0.96 -1.43,-0.25 -2.83,0.48 -0.64,-1.14 0.35,-1.02 0.44,-0.12 1.5,1.2 0.29,-0.51 -0.46,-0.59 -1.51,-0.7 -2.64,-4.6 -0.22,-1.25 -2.32,-0.77 -1.67,-1.16 -1.09,-2.06 -0.63,-3.67 -1.05,-0.7 1.48,-2.5 -1.04,0.7 -0.57,1.01 -0.79,0 -0.43,-1.93 0.12,-2.39 0.61,-0.89 -1.91,0.31 0.01,1.24 -1.25,-0.4 -1.72,-2.41 -2.04,-4.37 -1.07,-1.26 0.9,-0.32 2.67,-3.99 -0.51,-0.87 -0.6,0.45 -1.56,-1.46 -0.45,0.22 0.89,1.17 -0.16,1.24 -0.57,0.75 -0.62,-0.19 -0.31,0.31 -1.15,-1.76 2.09,-8.26 0.1,-5.21 -1.34,-2.13 -5.93,-5.22 -4.6,-6.21 -3.98,-2.34 -3.02,0.52 -0.52,0.47 -0.31,1.59 -1.9,0.13 -2.85,1.64 -1.01,-0.06 -1.59,0.74 -3.3,0.53 -0.65,-0.19 -0.43,-0.95 0,-0.98 0.88,1.34 0.25,-0.24 0.09,-0.52 -0.53,-1.02 -3.67,-3.23 0.6,0.06 0.15,-0.41 -0.61,-0.54 0.68,-1.29 -1.56,0.56 -0.17,1.02 -4.77,-2.18 -3.18,-0.88 2.44,-0.39 1.32,0.31 -0.47,-0.78 -1.05,-0.38 -2.17,-0.03 -2.63,1.22 -5.94,0.84 0.89,-0.75 1.56,-0.45 0.24,-0.94 -0.37,-0.91 -0.85,0.93 -1.12,-0.51 -0.16,1.12 -1.09,1.51 -2.22,0.6 -0.28,-0.2 0.59,-1.12 -0.47,0.22ZM1081.94,1694.59l-1.15,0.48 -1.23,-0.35 1.32,0.08 3,-1.38 -1.94,1.17ZM1135.65,1725.2l0.19,0.94 -2.34,-5.62 -0.69,-2.67 2.84,7.35ZM1114.07,1734.46l-0.02,0.75 -0.95,-2.64 0.54,0.45 0.43,1.44ZM1114.6,1735.72l-0.41,0.33 -0.82,-0.25 -0.64,-1.29 0.97,1.11 0.9,0.1ZM1133.43,1752.29l-2.26,2.36 1.42,-2.45 1.15,-1.06 0.04,-0.8 1.07,-0.64 -1.42,2.59ZM1130.52,1755.29l-0.31,0.06 0.57,-0.5 -0.26,0.44ZM1125.9,1757.63l-0.52,0.29 -0.54,-0.21 2.35,-0.62 -1.29,0.54ZM1122.59,1758.46l-0.5,0.17 -0.47,-1.42 1.11,0.81 -0.14,0.44ZM1119.95,1759.09l-0.74,0.12 0.6,-0.49 0.19,-0.75 0.34,0.94 -0.39,0.18ZM1117.48,1759.78l-0.31,-0.16 0.83,-0.22 -0.52,0.38ZM1080.81,1676.68l-0.69,-1.54 -0.28,-2.37 0.42,-3.69 -0.79,-2.73 0.01,-1.39 1.01,-3.58 1.29,-1.86 -0.73,-1.01 0.14,-0.66 -0.47,-1.57 -2.12,-5.82 -4.81,-28.06 28.55,0 -2.3,2.71 -0.44,1.35 3.44,2.73 2.34,1.02 2.94,5.77 2.7,2.47 1.63,2.38 2.31,1.92 2.56,4.47 2.3,1.72 1.01,1.8 1.28,4.44 0.99,0.68 1.35,2.39 0.41,2.67 0.69,0.97 2.3,1.07 -0.58,1.14 -2.16,0.89 0.54,1.21 -1.5,1.12 0.32,1.26 -1.02,0.95 0.95,0.1 -1.36,2.14 -0.97,0.24 1.05,1.18 -0.87,1.23 -0.88,-0.37 -0.89,4.32 0.19,1.89 -1.93,-0.11 -3.23,-0.98 -0.92,1.09 0.09,3.36 -0.94,1.4 -0.93,-0.29 -0.52,-2.28 -30.08,-2.05 -1.4,-3.72ZM1121.63,1677.08l-0.5,3.23 -0.24,-2.25 0.74,-0.98ZM234.69,1792.13l-1,0.69 -1.68,-0.41 -2.06,-1.62 0.72,-1.21 1.67,-1.02 2.59,0.04 0.58,1.41 -0.82,2.12ZM225.51,1793.25l-0.23,0.54 -0.39,-0.08 0.15,-1.15 1.37,-1.45 0.59,0.13 -0.36,1.2 -1.13,0.81ZM252.59,1797.96l0.9,-0.02 0.17,0.98 0.8,0.86 -1.86,0.47 -1.17,-0.88 -0.65,0.17 -0.22,-0.63 -0.45,0.13 0.42,0.63 -1.47,-0.03 -1.47,-2.08 -0.39,-1.18 1.71,-0.18 1.17,-1.12 0.66,-0.12 1.85,3ZM259.26,1800.9l5.7,0.74 -0.4,0.63 -1.28,0.57 -1.83,-0.5 -3.06,-0.18 0.46,-1.43 0.41,0.17ZM267.53,1804.35l0.29,0.22 2.09,-0.45 3.27,2.37 -1.33,1.36 -3.43,0.49 -0.34,-0.16 -0.48,-2.23 -0.72,0.14 -0.82,-0.39 -0.93,-1.55 0.46,-0.92 0.82,-0.12 1.12,1.24ZM263.4,1806.3l-0.67,0.34 -0.74,-0.16 -0.88,-1.88 1.24,-0.22 0.7,0.31 0.81,0.9 -0.46,0.71ZM277.83,1827.6l-0.5,0.58 -0.63,-0.04 -2.28,-1.24 -0.28,-0.67 0.17,-3.09 -1.8,-4.44 2.6,-3.19 -0.82,-1.86 0.21,-1.12 0.48,-0.2 7.2,3.42 1.29,1.43 0.22,1.54 0.88,0.2 0.41,1.06 1.69,1.45 -0.52,0.85 -2.31,1.62 -2.92,0.71 -2.57,1.82 -0.52,1.17ZM1007.59,1545.01l-2.73,-2.58 -0.56,-1.09 -45.89,0.34 -1.07,-2.15 0.28,-2.17 -0.14,-2.87 -0.74,-2.5 0.32,-0.64 -0.75,-1.21 0.07,-1.42 -0.44,-0.19 -0.34,-0.98 -0.53,-0.12 -0.32,-4.19 -1.31,-3.29 -1.07,-1.48 -0.69,-1.96 -0.31,-2.42 -1.11,-1.44 -0.66,-2.28 -0.94,-1.1 1.82,-6.22 -0.32,-1.18 -0.84,-0.58 0.33,-1.49 -0.73,-2.5 60.91,-0.08 0.3,1.68 1.16,1.01 0.12,0.83 -0.62,2.74 1.04,4.88 4.34,2.76 1.12,2.55 1.19,0.95 1.58,2.59 2.03,1.76 0.18,1.82 -0.75,2.57 -0.66,0.66 -0.81,2.1 -1.02,1.09 -1.71,1 -4,1.05 -1.25,0.86 -0.38,1.34 0.18,1.13 1.16,1.86 0.12,1.01 -1.69,4 -1.29,1.51 -1.41,0.68 -0.62,1.01 0.04,2.08 -0.59,0.27ZM716.36,1406.78l11.27,0 -0.01,16.97 3.76,5.48 0.32,1.26 -0.23,0.91 0.47,0.93 -0.5,0.86 4.63,3.62 6.29,8.28 1.05,-0.18 0.42,1.12 0.7,0.45 2.57,-0.14 -1.25,7.59 -0.44,0.68 0.08,2.01 0.71,0.87 0.22,1.49 -1.43,1.24 0.3,2.11 -0.38,1.79 2.64,1.43 2.06,-1.48 1.42,-1.86 2.15,1.5 1.2,4.8 2.84,4.46 -0.15,2.01 1.39,1.54 1.19,-0.03 1.06,0.71 0.89,1.61 0.71,2.95 1.66,1.3 1.57,-1.58 3.88,0.44 0.63,-1 1.01,-0.44 8.32,0.25 0.59,-2.66 0.86,-0.56 0.78,0.37 1.63,2.67 1.24,0.91 0.01,39.03 -67.88,0.01 -0.04,-28.16 1.23,-6.11 -0.47,-0.73 -2.12,-0.72 -0.65,-0.85 -0.05,-1.47 3.93,-7.51 0.19,-1.28 3.3,-7.61 0.82,-3 -0.5,-1.32 -3.96,-3.86 -0.7,-1.6 -0.14,-2.89 -1.09,-2.71 0,-43.9ZM1007.59,1545.01l0.59,-0.27 -0.04,-2.08 0.62,-1.01 1.41,-0.68 1.29,-1.51 1.69,-4 -0.12,-1.01 -1.16,-1.86 -0.18,-1.13 0.38,-1.34 1.25,-0.86 4,-1.05 1.71,-1 1.02,-1.09 0.32,-1.18 1.62,-2.66 0.28,-1.49 -0.18,-1.82 -2.03,-1.76 -0.9,-1.7 -2.56,-2.89 41.09,0.31 -2.07,11.23 -3.42,0 -0.13,35.74 -0.89,1.23 -0.04,1.44 -0.37,0.36 1.33,3.81 0.01,2.43 -1.72,3.71 -0.62,0.26 -1.57,2.54 -0.55,-0.04 -0.67,0.7 0.25,1.52 -0.54,0.45 0.18,0.34 -0.62,1.1 0.02,1.11 -0.6,0.88 0.61,1.25 -0.99,1.28 -0.13,1.14 0.37,1.24 -0.94,1 -3.46,1.43 0.55,3.49 -0.29,0.46 -4.56,-1.39 -1.98,0.04 -1,1.15 -0.23,1.57 -1.34,-1.25 -0.32,0.96 -1.29,-1.28 -0.83,-1.58 -0.18,-1.25 0.46,-0.94 0,-0.98 -0.7,-3.02 -3.41,-3.44 -3.98,-2.67 -2.19,-2.68 -0.1,-0.81 0.66,-2.15 2.07,-5.66 -0.97,-0.75 -2.94,-0.73 -1.13,0.56 -0.98,-1.14 -0.84,-2.85 -2.07,-3.01 -5.23,-5.35 -1.4,-5.17 0.03,-1.91 0.65,-2.29ZM1046.28,1582.99l-0.61,-1.25 0.6,-0.88 -0.02,-1.11 0.62,-1.1 -0.18,-0.34 0.54,-0.45 -0.25,-1.52 0.67,-0.7 0.55,0.04 1.57,-2.54 0.62,-0.26 1.72,-3.71 0.13,-1.01 -0.14,-1.42 -1.33,-3.81 0.37,-0.36 0.04,-1.44 0.89,-1.23 0.13,-35.74 31.01,0.02 -0.29,39.88 -0.45,0.76 0.29,0.64 -0.32,0.92 0.84,0.95 -0.12,0.72 -4.2,1.88 -1.56,-0.68 -1.12,0.1 -0.45,0.69 0.23,1.26 -0.39,0.96 -1,0.67 -1.82,2.65 -0.93,0.24 -1.97,3.92 -0.68,0.43 -2.12,-0.75 -1.22,-1.84 -0.53,-0.22 -0.04,0.49 -1.05,0.36 0.1,0.49 -1.72,3.05 -3.07,-1.46 -1.14,0.55 -1.95,1.91 -2.63,-1.7 -1.67,0.03 -0.78,-0.5 -0.64,1.77 -0.81,-0.96 -1.82,-0.23 -0.35,0.2 -0.37,1.56 -1.18,0.07ZM887.32,1594.27l-0.13,-43.63 75.98,0 2.62,1.92 1.5,-0.28 0.62,0.44 0.35,1.78 -1.2,0.73 -0.81,1.39 0.2,1.31 1.2,1.21 1.99,3.42 1.77,1.02 0.05,30.69 -84.14,0ZM1033.62,1594.4l0.23,-1.57 1,-1.15 1.98,-0.04 4.56,1.39 0.29,-0.46 -0.55,-3.49 3.46,-1.43 0.94,-1 -0.37,-1.24 0.13,-1.14 1.22,-1.45 0.95,0.1 0.52,-1.72 2.02,0.19 0.81,0.96 0.64,-1.77 0.78,0.5 0.7,-0.24 3.6,1.91 1.95,-1.91 1.14,-0.55 3.07,1.46 1.72,-3.05 -0.1,-0.49 1.05,-0.36 0.04,-0.49 0.53,0.22 1.22,1.84 2.12,0.75 0.68,-0.43 1.97,-3.92 0.93,-0.24 1.82,-2.65 1,-0.67 0.39,-0.96 -0.23,-1.26 0.45,-0.69 1.12,-0.1 1.56,0.68 4.2,-1.88 0.12,-0.72 -0.84,-0.95 0.32,-0.92 -0.29,-0.64 1.08,-1.25 1.95,0.58 1.87,-0.08 1.59,1.71 0.72,1.6 1.3,0.97 3.24,0.98 1.58,1.19 1.72,-0.73 2.06,1.06 1.75,-0.17 2.31,-1.1 1.36,0.06 1.4,2.46 1.92,1.76 0.12,2.15 -0.45,1.77 2.55,4.64 1.29,2.03 2.02,1.68 1.57,0.44 -4.3,3.48 -3.85,2.27 -0.58,1.28 -1.85,2.02 -1.69,0.86 -1.21,1.19 -6.61,2.49 -31.59,-1.11 -15.15,0.3 -0.34,-0.44 -2.59,-0.26 0.42,2.74 -15.83,0 0.61,-1.25 0.76,-0.4 0.84,0.31 0.61,-0.44 0.83,-2.64 0.08,-1.42 -0.36,-1.15ZM1029.83,1601.34l-0.79,0.03 0.08,-0.73 0.35,-0.03 0.36,0.73ZM978.02,1649.7l32.9,-0.05 0.06,0.67 0.55,0.39 -0.45,2.47 0.49,0.4 -0.65,1.36 0.52,1.82 1.81,2.15 0.08,0.72 -1.56,1.97 -0.2,1.14 -0.73,1.01 -1.48,1.16 -0.98,1.48 -0.98,2.92 -0.53,0.49 -0.27,2.31 -0.33,0.77 -0.68,0.14 -0.14,0.79 0.39,1.43 -0.69,1.44 21.86,0.01 -1.14,3.58 0.18,1.58 1.53,1.97 1.07,3.15 0.8,0.4 -0.77,0.36 -4.16,-1.36 -1.03,-1.09 -2.05,-0.36 -1.22,1.34 -0.92,1.8 2.71,1.47 2.06,-0.4 1.14,-0.88 0.93,0.03 0.85,-0.63 0.79,0.36 0.03,0.36 -1.71,1.44 0.81,1.02 1.28,0.34 0.48,-0.15 0.3,-1.14 0.78,-0.74 1.07,0.16 -0.15,0.47 0.64,1.18 0.03,1.32 -2,0.63 -0.69,0.61 0.36,0.36 -1.4,0.3 -0.43,0.73 0.52,1.06 1.83,1.55 3.79,1.1 0.73,1.14 1.15,0.59 -0.07,0.78 -1,0.58 -0.52,1.06 -0.92,-0.83 -1.59,1.29 0.26,-1.15 -1.02,-1.62 -2.02,-1.41 -1.96,-0.4 -0.29,-1.08 -0.67,-0.55 -3.21,-1.03 0.2,0.75 1.01,0.63 0,1.23 -0.95,2.62 -0.87,0.41 -1.01,-1.97 -0.88,-0.51 -1.41,-0.06 -0.95,0.36 -1.04,1.58 -0.83,0.26 -6.14,-2.06 0.09,-0.42 0.51,-0.13 0.99,0.17 -1.06,-1.82 -0.06,-1.4 -0.93,0.66 -2.09,-0.54 -1.8,-2.5 -1.73,-0.06 -0.78,-1.12 -1.41,0.47 -1.35,1.32 0.87,1.08 -0.28,0.32 -2.01,0.47 -4.67,-0.53 -5.74,-2.38 -5.91,0.12 -1.5,0.58 -0.65,-1.11 0.85,-0.53 0.41,-0.83 -0.24,-0.83 0.95,-1.78 -0.45,-3.06 0.34,-2.82 1.61,-3.51 0.18,-2.4 0.37,-0.55 -0.31,-1.78 -1.23,-1.9 -0.82,-2.55 -0.78,-0.73 -0.44,-3 -2.25,-2.76 0.02,-13.67ZM1032.83,1688.8l0.04,0.61 -1.38,-0.33 1.79,-1.39 -0.45,1.11ZM1037.34,1692.43l-0.32,0.42 0.31,-2 -0.44,-1.69 0.62,1.62 -0.17,1.65ZM1036.64,1693.68l-0.62,0.68 0.81,-1.21 -0.19,0.53ZM1003.59,1696.45l-0.42,0.19 -1.88,-1.14 -0.12,-0.48 1.49,-0.4 1.38,0.97 -0.45,0.86ZM1231.07,1520.32l-10.89,-0.34 -0.56,0.4 -0.01,-0.4 -7.66,-0.33 -0.3,-0.37 2.89,-10.36 21.89,0.77 4.04,-2.62 1.91,-0.08 -0.26,0.8 0.55,1.61 0.52,0.8 1.27,-0.03 0.12,0.75 -2.48,1.09 -2.45,3.41 3.51,1.57 1.37,2.9 -0.44,0.81 1.22,0.74 0.39,2.07 1,0.7 1.49,0.44 3.35,-1.49 -1.24,-3.12 -0.71,-0.5 -0.27,0.43 -0.51,-0.86 1.51,0.2 1.49,1.79 0.5,3.83 -0.17,0.51 -5.19,0.76 -2.87,1.41 -0.11,-2.68 -0.39,-0.07 -3.11,2.53 -1.2,0.16 -1.01,0.74 -0.41,-2.31 0.64,-1.59 -0.97,0.6 -1.22,-1.4 0.04,-1.42 -0.48,-0.17 -0.09,-1.75 -4.7,0.07ZM1245.75,1530.01l-3.13,0.74 -0.5,-0.48 2.43,-1.49 1.03,0.64 0.17,0.59ZM1251.81,1531.68l-0.88,0.25 -2.03,-0.56 1.94,-0.64 0.25,-1.04 0.72,1.99ZM1171.57,1567.03l0.12,1.2 1,-1.19 -1.26,-1.81 -0.91,1 -2.03,-1.61 -2.05,-0.87 -0.29,-0.43 0.31,-1.15 -2.96,-1.96 -0.6,-1.29 0.14,-0.69 -1.05,-1.29 0.19,-0.35 -1.96,-0.47 -0.8,-0.69 -0.95,-0.11 -2.56,0.85 -1.01,1.4 -2.08,-0.24 -1.14,-1.14 -2.2,2.55 -1.18,-0.33 -2.48,2.42 -2.22,1.48 0.12,-7.54 42.02,0.01 0.88,18.57 7.62,0 -0.01,0.42 -0.41,0.88 0.01,-0.64 -0.49,0.05 -0.49,2.2 -0.75,0.18 -1.71,3.14 -2.78,0.38 -0.44,0.65 -2.18,-0.25 0.63,-1.67 -1.51,-1.19 0.73,-1.33 0.06,-1.47 -1.24,1.03 -0.21,-0.59 -0.74,0.76 -1.83,-1.19 -0.95,-1.93 0.35,-1.53 3,-0.03 -2.41,-2.28 -0.75,-0.21 -0.71,0.92 0.46,-1.59 1.51,-0.5 -0.26,-0.92 -0.57,-0.4 -1.02,0.5 0.01,-0.64 0.19,-0.83 1.45,0.27 0.57,-1.34 0.03,-0.6 -0.96,0.87 -0.21,-1.87 0.94,-1.82 0.89,-0.79 2.26,-0.1 -1.45,-0.52 1.48,-1.47 -1.1,0.09 0.13,-1.19 -1.19,0.36 -0.39,1.89 -0.5,0.44 -0.85,0.34 -0.36,-0.87 -0.33,1.71 -0.62,-1.19 -0.32,1.16 -0.53,0.31 -0.17,1.16 -1.7,-0.65 0.92,1.62 0.7,0.48 0.09,0.76 -0.6,0.64 -0.98,-0.51 0.74,1.76 -0.49,2.96 0.41,3.06 1.22,2.37 -0.51,0.11 -1.52,-1.08 -1.2,-2.56 0.1,1.08 0.3,1.21 2.66,2.7 0.86,1.85 -0.09,0.78 -1.29,-1.25 -3.58,-1.3 -1.13,-1.85 -0.24,1.43 -1.27,-2.22 -1.76,0.7 -0.87,-0.16 0.13,-1.94 2.3,-3.45 -0.13,-1.62ZM1192.1,1579.36l-0.31,0.04 1.76,-3.77 -1.45,3.73ZM1262.32,1435.74l0.58,0.98 1.98,0.55 5.14,-1.89 0.22,-0.48 1.39,-0.02 4.88,4.41 0.45,19.11 -0.4,3.25 2.35,1.74 1.86,0.29 0.09,1.18 -0.79,0.91 0.75,1.56 -0.51,1.65 1.79,1.98 0.75,-0.76 1.42,0.5 0.5,2.91 -0.38,0.72 0.08,0.95 1.06,0.28 0.31,0.64 -2.33,2.44 -1.96,-0.34 -2.19,0.83 -0.49,1.09 -0.61,0.23 -2.12,-0.22 -0.77,1.95 -0.63,-0.17 -1.07,1.28 -1.09,-1.88 -1.43,-0.08 -1.09,0.99 -0.88,-1 -0.8,2.03 -0.13,1.94 -0.9,-0.83 -2.28,-0.46 1.16,-1.64 -0.96,-0.19 0.36,-1.86 -0.96,1.37 -1.3,0.82 0.06,1.36 -1.22,2.8 -0.05,1.18 -1.8,1.76 -1.35,-0.23 -2,1.64 -0.41,-1.35 -0.38,1.52 -0.39,0.09 -0.32,-1.79 -0.53,0.62 -0.35,1.62 -0.75,-0.92 -0.14,2.18 -0.73,-0.74 -1.16,0.5 0.1,-1.06 -2.43,1.39 -1.03,1.49 0.76,0.72 -3.62,4.35 -1.38,3.35 -1.04,1 -0.9,-1.46 -0.19,-1.17 -1.03,-1.4 -0.54,-2.03 -1.33,-29.23 1.41,-0.63 0.71,1.14 0.37,-0.13 0.75,-2.17 1.25,-0.38 -0.14,-2 3.19,-3.04 0.15,-1.04 1.27,-1.7 -0.09,-2.48 0.64,-3.18 2.06,-3.13 0.68,-4.44 7.38,-10.71 1.32,-1.89 2.19,0.61 -0.04,2.22ZM1272.18,1484.11l-1.39,0.18 -0.06,1.14 -1.1,-0.71 0.02,-1.11 1.25,-1.47 0.7,0.29 0.58,1.68ZM1267.22,1486.28l-0.89,0.21 -0.02,-0.78 0.3,-0.39 0.61,0.96ZM1029.71,1423.86l2.56,-0.37 7.53,-4.16 2.65,-0.67 2.48,1.33 37.37,22.35 1.1,4.36 2.48,2.98 1.82,-0.96 2.87,-0.45 0.27,0.25 -0.29,1.37 0.71,3.59 1.26,2.33 4.12,-0.53 1.66,2.01 -1.4,2.9 11.85,7.64 4.7,28.32 -3.07,7.79 -0.91,5.18 -0.65,1.77 -3.67,3.7 -2.34,1.31 -0.41,0.76 -0.46,1.67 0.32,2.94 -3.9,3.22 -15.15,0.58 0,-0.89 -27.59,-0.02 2.07,-11.23 -1.32,-12.95 0.15,-5.2 1.24,-6.84 3.62,-12.03 2.03,-3.14 3.09,-2.99 -5.8,-3.65 -3.88,0 -1.47,2.63 -1.99,1.71 -0.46,1.87 -2.2,-0.87 -0.77,-1.95 0.65,-2.08 -2.02,0.17 -0.38,-0.4 0.91,-3.42 -0.16,-1.46 -1.29,-1.21 -2.21,-0.91 0.23,-1.02 -0.63,-1.1 -3.88,-1.11 -3.92,-0.38 -3.21,-1.85 -11.37,-3.16 -1.27,-2.78 -1.26,-0.8 -0.58,0.15 -0.23,-0.6 10.4,-23.7ZM941.79,1406.78l23.48,0.02 0.07,-6.58 2.46,0.36 0.97,0.78 0.58,5.25 1.12,3.36 0.95,1.14 6.44,1.44 2.32,0.89 0.54,1 1.09,0.41 2.78,-0.62 0.98,-0.95 4.34,0.08 5.64,3.03 0.98,2.72 0.75,0 0.57,-0.89 1.44,-0.16 1.9,0.62 1.67,1.78 3.87,2.38 1.49,-0.01 3.91,-2.3 1.45,-0.26 0.86,0.14 1.09,1.64 7.43,-0.23 1.11,1.75 1.06,0.34 4.58,-0.05 -5.23,12.01 -7.92,-0.37 -9.27,6.42 -5.65,3.25 -1.82,-0.55 -1.12,1.52 -0.77,0.17 -0.02,9.51 -4.56,2.87 -2.31,4.09 0.05,1.03 1.54,0.84 0.85,1.79 -0.81,2.52 -0.06,2.69 -0.39,0.63 0.34,2.21 -0.41,2.32 0.34,1.02 1.43,1.29 2.3,0.94 2.29,1.99 2.11,0.99 2.43,3.27 5.22,3.22 0.71,0.86 0.47,2.19 0.38,4.64 -59.26,0.02 0,-28.6 -0.86,-1.2 -1.9,-0.98 -1.76,-3.15 2.69,-2.84 0.66,-2.33 -0.05,-3.21 -0.64,-3.1 -1.29,-2.41 -0.64,-2.9 0.19,-4.51 -0.63,-1.65 -0.38,-9.56 -1.47,-3.92 -0.22,-1.79 -1.35,-4.21 -0.02,-8.71 -1.11,-5.39ZM1027.36,1608.42l-7.7,0.12 0.89,-1.5 2.59,-2.78 0.01,-1.06 -1,-1.83 -50.7,0 -0.04,-37.79 -1.77,-1.02 -1.99,-3.42 -1.2,-1.21 -0.2,-1.31 0.81,-1.39 1.2,-0.73 -0.35,-1.78 -0.62,-0.44 -1.5,0.28 -2.8,-2.05 -0.82,-1.28 -0.33,-1.52 -2.26,-2.45 -1.17,-3.58 45.89,-0.34 0.56,1.09 2.73,2.58 -0.65,2.29 -0.03,1.91 1.4,5.17 5.23,5.35 2.07,3.01 0.84,2.85 0.98,1.14 1.13,-0.56 2.94,0.73 0.97,0.75 -2.07,5.66 -0.66,2.15 0.1,0.81 2.19,2.68 3.98,2.67 3.41,3.44 0.7,3.02 0,0.98 -0.46,0.94 0.18,1.25 1.53,2.53 0.71,0.32 0.2,-0.95 1.34,1.25 0.36,1.15 -0.08,1.42 -0.83,2.64 -0.61,0.44 -0.84,-0.31 -0.76,0.4 -0.85,1.4 -0.54,-0.93 -0.35,0.03 0.11,1.78 -0.81,1.48 0.32,0.71 -1.04,0.72 0.46,0.75 -0.09,0.89 -0.71,1.45ZM1044.78,1622.43l1.01,0.92 -4.57,41.48 0.99,20.2 -3.33,0.2 -2.42,-0.79 -3.63,1.09 -1.1,-0.17 -1.4,1.61 -0.88,0.4 -0.8,-0.4 -1.07,-3.15 -1.53,-1.97 -0.18,-1.58 1.14,-3.58 -21.86,-0.01 0.69,-1.44 -0.39,-1.43 0.14,-0.79 0.68,-0.14 0.33,-0.77 0.27,-2.31 0.53,-0.49 0.98,-2.92 0.98,-1.48 1.48,-1.16 0.73,-1.01 0.2,-1.14 1.56,-1.97 -0.08,-0.72 -1.81,-2.15 -0.52,-1.82 0.63,-0.93 -0.48,-1.55 0.46,-1.75 -0.55,-0.39 -0.1,-1 0.53,-2.41 -0.65,-1.04 0.26,-1.97 -0.84,-1.97 0.48,-0.46 -0.4,-0.8 1.76,-2.08 -0.08,-2.22 1.65,-0.81 -0.29,-1.1 0.35,-0.83 1.05,-0.87 0.63,-1.44 1.44,-0.79 0.59,-1.24 0.5,-3.1 0.74,-0.45 0.67,-1.26 1.09,-0.66 0.43,-0.64 -0.13,-0.78 24.12,0.03ZM750.22,1406.78l114.11,0 0.32,66.64 -80.16,0 -0.01,8.04 -1.24,-0.91 -1.63,-2.67 -0.78,-0.37 -0.86,0.56 -0.59,2.66 -8.32,-0.25 -1.01,0.44 -0.63,1 -3.88,-0.44 -0.81,0.55 -0.5,1.06 -0.9,-0.36 -1.02,-0.97 -0.71,-2.95 -0.89,-1.61 -1.06,-0.71 -1.19,0.03 -1.39,-1.54 0.15,-2.01 -2.84,-4.46 -1.2,-4.8 -2.15,-1.5 -1.42,1.86 -2.06,1.48 -2.64,-1.43 0.38,-1.79 -0.3,-2.11 1.43,-1.24 -0.22,-1.49 -0.71,-0.87 -0.08,-2.01 0.44,-0.68 1.25,-7.59 -2.57,0.14 -0.7,-0.45 -0.42,-1.12 -1.05,0.18 -6.29,-8.28 -4.51,-3.47 0.38,-1.01 -0.47,-0.93 0.23,-0.91 -0.32,-1.26 -3.76,-5.48 0.01,-16.97 22.59,0ZM1102.34,1622.4l-13.77,0.18 0.73,-3.64 2.26,-0.5 0.66,-1.79 1.51,-1.41 4.1,-0.97 4.44,-2.66 1.49,-0.37 1.16,-2.12 0.85,0.06 1.29,-1.16 1.01,-0.25 0.66,1.08 2.94,-2.29 1.28,-0.28 0.93,0.66 0.56,-0.23 1.63,-2.59 1.98,-0.69 0.34,-2.52 0.51,-1.09 64.77,0.84 -0.14,1.73 1.28,2.28 0.53,2.18 -0.72,-0.88 -3.01,-1.46 -0.03,1.88 -1.37,-0.62 0.49,1.04 -1.78,-0.25 -1.08,1.48 -0.92,0.18 -1.36,-0.84 -0.62,-2.17 0.09,3.83 4.18,0.06 1.73,-0.54 1.56,0.3 -0.16,3.92 0.94,-0.44 0.25,-2.44 1.9,-0.84 0.76,2.67 -0.33,1.66 -3.75,3.73 -0.8,0.37 -3.59,-0.6 -0.49,-1.56 -0.51,-0.33 -0.38,0.04 -0.27,1.06 -1.22,0.31 -3.39,-1.34 0.74,0.96 4.31,1.8 0.94,0.82 -1.07,1.64 -0.24,1.11 -1.72,1.15 -0.93,-0.2 -2.38,-2.08 1.09,1.8 0.86,0.76 1.75,0.41 3.28,-0.68 1.08,0.74 -1.76,2.21 -2.17,0.34 -0.29,0.63 -4.56,-0.01 -1.85,1.45 -0.71,-0.24 -0.61,-1.53 -0.01,1.92 0.38,0.9 -4.22,3.34 -1.25,1.86 -0.77,2.88 -0.28,-3.15 -0.2,2.41 -0.49,1.12 -4.46,-0.08 -1.81,0.56 -12.39,-12.67 -12.86,-0.45 -0.1,-1.86 -1.61,-2.09 -1.26,0.66 -0.02,-0.91 -0.46,-0.34 -14.85,-0.77 -4,1.77 -4.22,1.15ZM1184.55,1600.67l0.36,0 1.13,4.54 2.55,5.77 -3.14,-6.36 -0.9,-3.95ZM1187.43,1610.47l-0.17,0.28 -0.75,-1.55 0.77,0.5 0.15,0.77ZM1188.48,1619.08l-1.67,0.26 1.75,-0.8 0.63,-4.1 -0.25,-2.76 0.53,2.87 -0.09,1.62 -0.9,2.91ZM1177.56,1627.37l-0.29,0.15 1.05,-1.72 2.61,-2.53 -3.37,4.1ZM894.67,1406.78l47.12,0 1.11,5.39 0.02,8.71 1.35,4.21 0.22,1.79 1.47,3.92 0.38,9.56 0.63,1.65 -0.19,4.51 0.64,2.9 1.5,3.32 0.43,2.19 0.05,3.21 -84.82,-0.01 -0.25,-51.35 30.34,0ZM887.19,1550.64l-0.01,-14.95 -22.72,-0.01 -0.08,-30.63 63.57,0.01 3.4,2.31 2.03,0.72 0.95,-0.68 2.08,-0.39 5.23,0.22 6.41,3.45 0.48,1.07 0.86,0.68 1.21,0.29 0.77,1.36 0.31,2.42 0.69,1.96 1.07,1.48 1.31,3.29 0.32,4.19 0.53,0.12 0.34,0.98 0.44,0.19 -0.07,1.42 0.65,0.78 -0.17,1.58 0.41,0.36 0.42,4.5 -0.28,2.17 1.98,4.18 0.26,1.55 0.62,1 0.98,0.46 0.66,0.99 0.33,1.52 1,1.41 -75.98,0ZM1234.29,1473.31l1.12,-3.11 1.04,-1.45 1.43,0.49 1.34,-0.55 1.33,29.23 0.54,2.03 1.03,1.4 0.19,1.17 0.9,1.46 -0.5,2.02 -0.33,0.99 -1.91,0.08 -4.04,2.62 -12.94,-0.43 -0.95,-2.43 0.87,-2.36 1.27,-8.57 2.81,-5.97 0.95,-5.31 2.35,-1.17 2.46,-2.23 0.46,-1.49 -0.59,-2.63 1.25,-2.19 -0.08,-1.6ZM1193.82,1550.91l3.86,-2.55 -2.74,-3.75 -0.66,-0.21 -0.72,-1.84 -1.04,-0.79 0.16,-2.69 1.13,-1.22 -0.54,-2.15 2.39,-2.36 1.14,-2.21 1.29,-0.84 8.98,5.51 -1.32,3.55 -1.83,1.63 -0.88,1.79 0.26,1.08 2.18,0.4 0.58,-0.34 0.3,0.78 0.17,1.07 -1.39,8.03 0.17,-3.04 -0.6,0.82 -0.67,3.13 -0.91,1.67 -0.85,1.15 -0.87,-0.19 0.2,0.91 -0.44,1.47 -0.52,0.66 -1.19,0.39 -2.45,4.61 -1.47,0.89 -0.35,-0.13 0.65,-2.87 -1.74,-0.96 -0.98,0.05 -2.47,-1.94 -1.95,-2.22 0.01,-1.64 1.16,-2.78 3.05,-1.2 0.9,-1.67ZM1204.53,1555.39l-1.34,2.24 1.64,-3.21 -0.3,0.97ZM807.28,1672.34l0.01,-78.07 68.79,0 0.01,7.1 -0.48,0.01 -0.27,61.94 -40.99,0.03 1.16,2.43 1.38,0.68 -20.1,-0.14 -0.03,6 -9.48,0.02ZM750.48,1594.23l-0.03,11.65 -1.6,2.13 -0.56,-0.02 -1.98,-1.64 -1.13,-0.11 -1.86,0.49 -0.82,1.52 0.62,1.35 0.47,4.02 -0.19,1.2 0.81,2.69 -0.22,5.03 -40,-38.16 -21.32,-18.98 -0.01,-44.9 67.79,-0.01 0.03,73.74ZM1140.49,1512.22l8.25,-4.08 1.11,-0.95 0.21,-1.11 -1.2,-1.28 -0.46,-1.38 0.08,-2.68 -1.28,-2.95 5.14,-2.49 21.62,-0.06 4.04,-6.77 3.18,-2.92 0.39,-0.98 3.13,-1.8 5.4,-5.68 2.53,-2.04 3.67,-1.68 17.12,-0.02 -0.23,6.54 0.71,2.2 -0.13,3.03 -1.2,3.08 0.59,4.28 -0.47,3.37 0.97,-0.58 0.95,1.16 -0.38,11.54 0.31,0.95 -2.89,10.36 0.3,0.37 -0.73,11.58 0.69,1.16 -2.71,1.73 1.05,1.7 -4.06,3.62 1.31,-4.57 -0.12,-1.75 -0.49,-0.72 -0.5,-0.48 0.59,1.73 0.09,2.16 -8.98,-5.51 -0.65,-1.01 -2.04,-0.77 -1.32,-2.04 -0.02,-2.38 -0.48,-1.02 -1.63,-0.93 -1.28,-1.62 -50.2,-0.04 0.02,-8.27ZM1223,1535.91l-0.81,0.97 0.73,0.1 3.79,-1.99 0.93,0.48 2.26,-0.69 -7.42,3.54 -7.27,2.58 -8.02,1.25 1.14,-1.06 -0.87,-0.15 -0.61,0.79 -0.98,0.26 -0.19,-0.86 1.74,-2.3 2.09,-1.18 0.49,0.49 0.11,-0.65 0.78,-0.58 10.8,-1.09 3.99,-2.43 -2.68,2.52ZM1203.9,1542.86l-0.54,0.07 0.54,-1.44 1.36,-0.52 -0.12,0.94 -1.24,0.95ZM1102.26,1521.27l1.04,1.79 3.87,2.41 2.86,0 13.21,-8.17 8.61,-1.77 0.02,25.48 -1.35,0.65 -0.24,0.6 0.62,1.77 0.03,1.21 -3.08,9.34 -0.02,1.05 -1.01,1.38 -3.41,2.72 -0.8,0.35 -1.21,-0.44 -1.9,1.74 -0.58,0.04 -1.65,2.73 0.25,2.03 -1.32,0.78 -0.61,-1.4 -0.58,-0.32 -0.81,0.71 -1.49,2.84 0.26,1.91 -2.35,2.96 -1.26,0.28 -1.41,-0.52 -2.54,-2.58 -0.41,-1.2 -1.36,-0.06 -2.31,1.1 -1.75,0.17 -2.06,-1.06 -1.72,0.73 -1.58,-1.19 -3.24,-0.98 -1.3,-0.97 -0.72,-1.6 -1.59,-1.71 -2.62,-0.05 -0.53,-0.5 -1.3,0.54 0.29,-38.99 15.15,-0.58 3.9,-3.22ZM971.45,1601.37l2.04,15.66 -0.51,24.01 -2.56,-0.7 -5.76,-3.56 -1.8,1.17 -1.71,-0.17 -0.8,-0.8 -2.16,1.1 -1.79,-0.25 -2.25,0.83 -2,1.52 -3.15,-1.89 -0.17,-0.77 -1.59,0.7 -1.15,-0.39 -0.98,-0.97 -1.48,1.33 -0.63,1.67 -0.83,-0.69 0.07,-1.17 -0.33,-0.37 -2.09,0.91 -1.96,-1.16 -0.8,-1.04 -2.29,1.59 -0.9,-0.04 -0.34,-1.27 -1.34,-0.95 -0.33,-1.44 -2.93,0.05 -1.11,0.87 -1.76,-1.14 -1.39,0.2 -4.86,-1.06 -1.09,-2.27 -1.22,-0.93 -0.51,0.88 -2.58,0.05 -2.67,-2.14 -1.51,-0.6 -0.04,-26.77 -34.1,0 -0.01,-7.1 95.38,0 -0.01,7.1ZM682.66,1520.5l-48.1,-0.01 -1.45,-1.87 -0.74,-3.97 0.16,-3.12 -1.51,-3.55 2.19,-8.24 1.7,-1.28 -1.03,0.22 1.58,-4.43 0.57,-10.16 0.59,-1.46 -0.14,-5.63 1.48,-12.9 -0.36,-4.33 0.16,-4.88 -0.48,-1.29 0.88,0.61 2.71,-0.01 1.73,-0.65 2.27,1.29 2.29,-0.57 0.89,0.31 1.14,0.74 1.13,2.24 1.33,4.97 0.87,0.75 5.09,0.59 1.33,-0.18 2.31,-1.42 2.5,-0.46 2.96,0.1 1.82,0.4 0.66,0.71 1.58,0.07 7.9,-1.4 4.74,-1.84 5.75,-1.57 2.87,-0.18 1.79,-0.91 24.16,-0.02 1.5,2.11 2.77,2.46 0.5,1.32 -0.82,3 -2.14,4.65 -1.35,4.24 -3.93,7.51 0.05,1.47 0.65,0.85 2.12,0.72 0.47,0.73 -1.23,6.11 0.04,28.16 -33.95,0ZM1131.85,1515.53l3.11,-0.64 5.53,-2.67 -0.02,8.27 50.2,0.04 1.28,1.62 1.63,0.93 0.48,1.02 0.02,2.38 0.8,1.53 2.56,1.28 0.65,1.01 -1.29,0.84 -1.14,2.21 -2.39,2.36 0.54,2.15 -1.13,1.22 -0.2,1.28 0.04,1.41 1.04,0.79 0.72,1.84 0.66,0.21 2.74,3.75 -3.28,2.04 -1.7,1.82 -2.82,1.18 -2.43,-0.36 -1.71,1.74 -53.87,-0.01 -0.02,-39.24ZM1230.59,1530.63l0.53,-2.8 -0.05,-7.51 4.7,-0.07 0.09,1.75 0.48,0.17 -0.04,1.42 1.22,1.4 -0.43,0.38 -1.35,-1.74 0.3,1.42 -0.72,1.05 -0.19,2.73 -0.9,1.14 -3.64,0.66ZM1237.43,1528.25l-1.19,0.35 0.75,-2.3 0.55,-0.52 -0.11,2.47ZM1236.02,1528.35l-0.31,0.29 0.1,-1.58 0.33,0.43 -0.12,0.86ZM1127.85,1662.96l-2.3,-1.07 -0.69,-0.97 -0.41,-2.67 -1.35,-2.39 -0.99,-0.68 -1.28,-4.44 -1.01,-1.8 -2.3,-1.72 -2.56,-4.47 -2.31,-1.92 -1.63,-2.38 -2.7,-2.47 -2.94,-5.77 -2.34,-1.02 -3.44,-2.73 0.44,-1.35 2.22,-2.7 4.3,-1.16 4,-1.77 14.85,0.77 0.46,0.34 0.02,0.91 1.26,-0.66 1.61,2.09 0.1,1.86 12.86,0.45 12.39,12.67 -4.05,2.99 -2.48,3.45 -0.63,2.2 -0.51,-0.92 0.14,-1.27 -0.63,1.22 0.6,1.77 -0.53,0.68 -1.64,1.26 -1.9,0.57 -0.32,1.24 -2.16,1.65 -1.46,-0.31 0.45,1.1 -0.54,0.83 -0.92,0.64 -2.37,0.59 -1.51,1.02 -2.38,-0.44 -0.71,0.29 1.82,1.2 -0.13,0.96 -1.06,0.87 -0.33,-0.08 -0.45,-1.39 -0.7,0.8 -1.06,-1.5 0.05,1.14 1.18,1.99 -0.73,0.99 -1.03,0.38 -0.27,1.13ZM950.57,1497.24l-1.65,0.06 0.73,2.5 -0.33,1.49 0.84,0.58 0.32,1.18 -1.88,5.8 1,1.52 0.66,2.28 -1.73,-0.89 -0.48,-1.07 -1.47,-0.98 -4.94,-2.47 -5.23,-0.22 -2.08,0.39 -0.95,0.68 -2.03,-0.72 -3.4,-2.31 -63.57,-0.01 -0.09,-31.63 0.37,-0.2 -0.08,-15.09 84.82,0.01 -0.66,2.33 -2.69,2.84 1.76,3.15 1.9,0.98 0.86,1.2 0,28.6ZM1073.79,1622.4l-29.2,-0.33 0.19,0.36 -24.12,-0.08 1.72,-1.52 0.56,-1.24 -0.17,-1.55 2.07,-3.87 -0.2,-1.23 0.56,-1 1.31,-0.77 0.18,-1.17 0.85,-0.45 -0.23,-0.87 0.85,-2.6 -0.46,-0.75 1.04,-0.72 -0.32,-0.71 0.64,-0.72 -0.02,-1.81 17.04,0.02 -0.42,-2.74 2.59,0.26 0.34,0.44 15.15,-0.3 31.59,1.11 23.57,-0.34 -0.51,1.09 -0.34,2.52 -1.98,0.69 -1.63,2.59 -0.56,0.23 -0.93,-0.66 -1.28,0.28 -2.94,2.29 -0.66,-1.08 -1.01,0.25 -1.29,1.16 -0.85,-0.06 -1.16,2.12 -1.49,0.37 -4.44,2.66 -4.1,0.97 -1.51,1.41 -0.66,1.79 -2.26,0.5 -0.73,3.64 -14.78,-0.18ZM972.98,1641.04l1.44,1.19 1.89,-0.38 1.64,0.47 0.05,21.05 2.25,2.76 0.44,3 0.78,0.73 0.82,2.55 1.23,1.9 0.31,1.78 -0.37,0.55 -0.18,2.4 -1.61,3.51 -0.34,2.82 0.45,3.06 -0.95,1.78 -0.54,-0.04 -1.19,2.17 0.64,1.64 -2.39,0.25 -7.5,3.74 0.1,-0.44 2.55,-1.7 -2.87,0 0.62,-1.4 -0.2,-1.24 -1.03,-0.04 -0.66,1 -1.51,-0.34 0.34,2.25 1.19,2.09 -2.85,2.65 -0.15,1.15 -1.38,1.5 -6.6,4.2 -4.34,1.96 2.55,-1.85 -4.13,-0.32 -0.85,0.81 -1.45,-1.58 -0.73,0.09 1.31,2.86 1.18,0.4 -1.6,1.17 -1.3,0.33 -1.11,-1.04 -0.38,2.61 -0.37,0.33 -0.59,0.48 -0.48,-0.87 -0.93,0.79 -1.6,0.25 0.17,1.07 1.21,-0.42 -0.44,1.39 -1.12,1.37 -0.91,0.32 -1.39,-0.2 -0.65,0.42 1.62,2.15 -1.71,4.39 -0.96,0.18 -2.79,-1.84 0.87,2.18 2.36,0.64 0.1,1.53 -0.9,1.92 1.37,6.14 2.51,5.3 0.72,0.03 0.12,0.45 -0.07,0.87 -1.54,0.25 -0.87,0.9 -2.61,-1.44 -2.43,-0.73 -5.39,-0.88 -1.17,-0.9 -3.57,-1.19 -0.84,-0.82 -3.9,-1.35 -1.39,-4.01 -2.57,-3.76 0.18,-1.45 -0.79,-2.18 0.27,-0.74 -0.22,-1.92 -2.83,-2.34 -4.07,-5.7 -2.1,-2 -0.4,-2.26 -2.48,-4.14 -1.24,-3.21 -1.09,-1.49 -2.98,-2.84 -0.26,-0.78 -3.01,-2.27 -0.87,-1.42 -1.87,-0.54 -0.02,-0.32 -5.06,0.16 -3.16,-0.99 -0.85,0.08 -0.48,0.77 -1.03,0.49 -1.58,0.22 -1.36,1.42 -1.13,2.61 -0.5,1.68 0.14,0.75 -2.56,2.82 -0.89,0.56 -1.01,-0.03 -1.88,-0.91 -4.9,-2.87 -1.55,-0.42 -4.68,-3.27 -2.52,-3.68 -0.67,-1.79 0,-1.89 -2.69,-5.92 -6.78,-5.26 -5.81,-5.55 -1.41,-0.71 -3.28,-4.19 -1.48,-0.73 -1.16,-2.43 40.99,-0.03 0.27,-61.94 34.58,-0.01 0.04,26.77 1.51,0.6 2.06,1.76 0.61,0.38 2.58,-0.05 0.51,-0.88 1.22,0.93 1.09,2.27 4.86,1.06 1.39,-0.2 1.76,1.14 1.11,-0.87 2.93,-0.05 0.33,1.44 1.34,0.95 0.34,1.27 0.9,0.04 2.29,-1.59 0.8,1.04 1.96,1.16 2.32,-0.82 -0.07,1.13 0.63,0.97 0.53,-0.18 0.4,-1.45 1.48,-1.33 0.98,0.97 1.15,0.39 1.59,-0.7 0.17,0.77 3.15,1.89 2,-1.52 2.25,-0.83 1.79,0.25 2.16,-1.1 0.8,0.8 1.71,0.17 1.8,-1.17 5.76,3.56 2.56,0.7ZM966.66,1701.08l-0.57,0.13 3,-2.68 0.67,0.03 -3.1,2.52ZM947.04,1713.96l-0.42,0.05 0.52,-0.69 4,-2.32 -0.11,0.57 -3.99,2.39ZM944.19,1717.19l-0.24,0.04 0.65,-1.48 1.38,-1.54 0.2,0.57 -1.99,2.41ZM940.33,1724.92l-0.35,0.73 1.02,-3.59 1.88,-3.29 0.79,-0.55 -2.17,3.61 -1.17,3.09ZM942.41,1739.45l-0.15,0.59 -2.48,-8.99 0.18,-4.81 0.4,5.05 2.05,8.16ZM807.29,1594.27l-56.81,-0.04 -0.03,-73.74 34.04,0 0.01,15.19 22.79,0 0,58.59ZM1170.52,1566.23l1.05,0.8 -0.18,1.65 -2.44,2.57 -0.61,2.95 0.93,0.82 2.11,-0.24 1.6,2.32 4.06,1.48 0.88,1.2 2.36,1.7 -0.47,2.48 -0.44,0.66 -1.68,-0.1 -3.83,-4.02 -1.27,-1.93 -1.94,-1.02 2.11,1.92 4.28,5.24 2.77,1.4 -0.7,0.6 1.12,0.5 0.06,1.98 -1.56,-0.42 0.09,1.23 -0.7,0.38 -0.96,-0.51 -2.49,-2.81 0.22,0.81 1.45,1.81 3.23,2.48 0.5,1.38 -1.34,0.87 -2.29,-2.16 -0.33,-1.13 -0.83,0.06 -3.45,-1.43 -2.77,-0.16 6.58,2.23 0.44,1.79 1.47,1.23 0.19,0.91 1,0.1 1.77,-0.89 2.79,0.57 1.61,5.14 -65.81,-0.63 -3,-0.33 -0.54,0.29 -19.51,-0.1 5.89,-2.23 1.21,-1.19 1.69,-0.86 1.85,-2.02 0.58,-1.28 3.85,-2.27 4.3,-3.48 -0.07,0.96 1.09,2.05 3.26,1.74 2.72,-1.8 1.95,1.01 2.99,-0.69 0.82,-1.58 1.41,0.3 2.41,-0.98 0.49,0.52 1.06,-0.57 1.43,-2.12 -0.45,-0.81 0.45,-1.07 3.12,-4.25 0.78,-1.95 2.14,-3.24 0.86,-2.44 0.96,0.19 0.57,0.99 1.24,0.53 1.77,-0.32 2.27,-4.56 0.56,-0.44 1.4,0.03 3.27,-2.65 1.66,-2.37 1.29,-4.28 5.53,4.51 1.24,-2.96 2.19,1.19 0.63,0.66 -0.31,1.15 0.29,0.43 2.05,0.87 2.03,1.61ZM1187.17,1580.61l0.44,-0.65 2.78,-0.38 -2.51,5.68 0.11,1.04 -1.27,0.6 -1.29,1.31 -1.39,3.91 -0.72,-1.6 0.25,-1.93 0.99,-3.16 1.92,-2.91 0.69,-1.91ZM1191.79,1579.4l0.31,-0.04 -1.22,2.2 -0.52,0.23 1.43,-2.39ZM1213.42,1473.35l20.87,-0.04 0.08,1.6 -1.25,2.19 0.59,2.63 -0.46,1.49 -2.46,2.23 -2.35,1.17 -0.95,5.31 -2.81,5.97 -1.27,8.57 -0.87,2.36 0.95,2.43 -8.95,-0.34 -0.31,-0.95 0.38,-11.54 -0.95,-1.16 -0.97,0.58 0.47,-3.37 -0.59,-4.28 1.2,-3.08 0.13,-3.03 -0.71,-2.2 0.23,-6.54ZM650.94,1406.78l65.42,0 0,43.9 1.09,2.71 0.24,1.13 -0.3,0.64 0.59,2.01 -24.16,0.02 -1.79,0.91 -2.87,0.18 -5.75,1.57 -4.74,1.84 -7.9,1.4 -1.58,-0.07 -0.66,-0.71 -1.82,-0.4 -2.96,-0.1 -2.5,0.46 -2.31,1.42 -1.33,0.18 -5.09,-0.59 -0.87,-0.75 -1.33,-4.97 -1.13,-2.24 -1.14,-0.74 -0.89,-0.31 -1.14,0.41 -2.78,-1.93 -2.11,0.05 -0.43,-0.52 -2.36,0.52 -0.73,-0.54 -1.28,0.35 0.32,-5.37 1.12,2.85 0.65,-3.77 -2.08,-1.4 -0.46,-1.96 3.06,-1.68 -3.06,-1.2 -0.31,1.35 -0.68,-4.25 -1.25,-3.29 -0.76,-4.28 -0.96,-2.12 -1.83,-2.03 -0.48,-1.19 -0.53,-6.93 8.35,3.62 7.75,0.83 1.51,-0.59 2.14,1.38 2.22,-1.09 1.39,4.36 -1.39,2.42 -0.26,0.05 -0.22,-0.98 -2.61,4.07 -1.01,2.8 0.4,0.63 2.07,-1 -1.65,0.14 0.08,-0.91 0.88,-1.78 1.92,-1.67 2.34,-3 0.26,-1.57 0.6,0.14 0.1,2.55 -1.21,1.3 0.19,1.3 -0.7,0.06 1.34,2.51 -0.23,2.86 -0.81,0.19 -0.67,-0.58 -0.68,1.64 -0.69,-1.98 -1.04,0.78 -1.23,2.53 2.45,-0.12 1.25,0.59 1.12,-0.94 0.7,-1.82 1.39,-0.61 0.76,-1 -0.17,-3.91 -0.48,-0.82 0.31,-1.08 -0.21,-1.15 1.82,-3.84 -1.98,-2.95 0.24,1.7 -1.39,-1.29 -0.04,-1.19 1.33,-0.68 -0.06,-0.42 -1.51,-2.01 -1.45,-0.93 0.47,-0.56 1.49,-0.13 -0.18,-2.82 -0.56,-1.87 -1.04,0.24 -0.37,-0.52 -1.17,-3.44ZM651.01,1412.31l0.15,0.38 -0.78,0.42 -0.74,-0.66 0.12,1.21 -1.26,-0.99 1.2,-1 1.31,0.64ZM648.38,1415.27l0.3,0.56 -1.74,-0.68 -0.25,-1.69 0.54,-0.12 1.15,1.93ZM650.57,1416.46l-1.14,-0.44 0.1,-1.39 0.49,-0.18 0.55,2.01ZM653.39,1421.16l0.56,2.24 0.24,-0.93 1.55,1.61 -0.19,1.05 -1.98,-1.17 -0.74,-2.71 -1.36,-1.26 1.29,-2.72 1.06,1.08 -0.08,0.47 -1.76,1.11 1.13,0.48 0.28,0.75ZM654.25,1430.7l-0.89,-0.42 0.3,-1.43 0.47,0.36 0.12,1.49ZM655.43,1434.05l-0.49,0.68 -0.36,-0.59 -0.47,0.54 0.27,-2.2 1.05,1.57ZM650.2,1437.25l-0.26,0.31 -0.36,-0.67 0.26,-0.81 0.36,1.17ZM1016.6,1512.62l-0.43,-1.5 -4.34,-2.76 -0.55,-1.45 -0.49,-3.43 0.62,-2.74 -0.12,-0.83 -0.7,-0.44 -0.68,-1.27 -0.93,-7.81 -0.71,-0.86 -5.22,-3.22 -2.43,-3.27 -2.11,-0.99 -2.29,-1.99 -2.3,-0.94 -1.43,-1.29 -0.34,-1.02 0.41,-2.32 -0.34,-2.21 0.39,-0.63 -0.08,-2.03 0.95,-3.18 -0.85,-1.79 -1.54,-0.84 -0.05,-1.03 2.31,-4.09 4.56,-2.87 0.02,-9.51 0.77,-0.17 1.12,-1.52 1.82,0.55 5.65,-3.25 9.27,-6.42 7.92,0.37 -5.17,11.69 0.23,0.6 0.58,-0.15 1.26,0.8 1.27,2.78 11.37,3.16 3.21,1.85 3.92,0.38 3.88,1.11 0.63,1.1 -0.23,1.02 2.21,0.91 1.29,1.21 0.16,1.46 -0.91,3.42 0.38,0.4 2.02,-0.17 -0.65,2.08 0.77,1.95 2.2,0.87 0.46,-1.87 1.99,-1.71 1.47,-2.63 3.88,0 5.8,3.65 -3.09,2.99 -2.03,3.14 -3.62,12.03 -1.24,6.84 -0.15,5.2 1.32,12.95 -41.09,-0.31ZM1115.42,1586.57l-1.57,-0.44 -2.02,-1.68 -3.51,-5.95 -0.33,-0.72 0.45,-1.77 -0.39,-2.56 1.31,0.49 2.04,-0.94 0.31,-1.06 1.26,-1.24 -0.26,-1.91 1.49,-2.84 0.81,-0.71 0.58,0.32 0.61,1.4 1.32,-0.78 -0.25,-2.03 1.65,-2.73 0.58,-0.04 1.9,-1.74 1.21,0.44 0.8,-0.35 3.41,-2.72 1.01,-1.38 0.02,-1.05 3.08,-9.34 -0.03,-1.21 -0.62,-1.77 0.24,-0.6 1.35,-0.65 0,13.76 11.85,0 -0.12,7.54 2.22,-1.48 2.48,-2.42 1.18,0.33 2.2,-2.55 1.14,1.14 2.08,0.24 1.01,-1.4 2.56,-0.85 0.95,0.11 0.8,0.69 1.96,0.47 -0.19,0.35 1.05,1.29 -0.14,0.69 0.74,1.4 -1.24,2.96 -5.53,-4.51 -1.29,4.28 -1.66,2.37 -3.27,2.65 -1.4,-0.03 -0.56,0.44 -2.27,4.56 -1.77,0.32 -1.24,-0.53 -0.57,-0.99 -0.96,-0.19 -0.86,2.44 -2.14,3.24 -0.78,1.95 -3.12,4.25 -0.45,1.07 0.45,0.81 -1.43,2.12 -1.06,0.57 -0.49,-0.52 -2.41,0.98 -1.41,-0.3 -0.82,1.58 -2.99,0.69 -1.95,-1.01 -2.72,1.8 -3.26,-1.74 -1.09,-2.05 0.07,-0.96ZM864.46,1535.68l-79.96,0 -0.01,-62.26 79.8,0 0.17,62.26ZM3705.84,1830.6l-0.35,0.45 -0.37,-0.98 0.7,0.2 0.02,0.33ZM3705.88,1859.53l-0.61,0.03 -0.31,-0.5 0.73,-0.02 0.19,0.49ZM3700.79,1885.25l-0.56,0.55 -0.72,-0.62 0.91,-0.3 0.37,0.37ZM3706.62,1838.8l-0.55,0.26 0.89,-1.38 0.32,0.43 -0.66,0.69ZM3706.33,1873.78l-0.03,0.31 -0.74,-0.21 0.33,-1.07 1.24,-0.59 -0.8,1.56ZM3705.31,1875.7l-0.47,0.6 -0.39,-1.31 0.44,-0.35 0.25,0.01 0.17,1.05ZM1310.21,1835.79l-0.86,0.11 -1.17,-0.56 1.53,-0.08 0.5,0.53ZM1312.32,1835.5l-1.46,0.16 0.4,-0.37 1.06,0.21ZM1311.11,1842.2l0.95,0.53 1.16,0 -1.21,0.53 -2.3,0.05 0.05,-0.84 1.35,-0.27ZM3694.84,1895.77l-0.48,0.02 -0.56,-0.65 -0.01,-1.35 1.6,-1.15 0.53,-1.11 0.44,0.09 0.74,0.52 -1.83,1.86 -0.43,1.77ZM105.51,2213.02l-0.48,0.1 -0.59,-0.56 1.5,-0.64 1.37,0.11 -0.82,0.18 -0.98,0.81ZM1295.59,1834.42l0.7,0.2 -0.28,-0.49 0.26,0 5.02,1.05 0.09,1.66 -3.98,3.21 -3.12,0.33 -6,-0.47 -1.45,0.46 -3.38,-0.55 0.28,-2.76 -1.05,-1.68 1.05,-0.85 0.15,-0.77 1.13,-0.27 9.91,0.56 0.67,0.37ZM1303.6,1838.48l-1.47,-0.02 -0.2,-0.36 1.09,-0.33 2.07,0.38 -1.49,0.33ZM1275.76,1839.03l-0.66,-0.32 0,-0.34 0.99,0.05 -0.33,0.61Z`,KWe=`M1102.45,1516.11l0.32,0.17 -0.35,3.14 3.11,1.13 2.15,-0.62 1.52,1.61 0.57,-1.92 0.57,-0.7 6.11,-3.25 -0.14,0.89 0.23,-0.02 1.55,-2.9 3.71,-2.83 4.15,-0.5 10.76,1.79 0.36,-0.12 -4.43,-0.91 2.63,-2.49 1.38,-0.44 8.11,-1.21 3.75,0.28 1.53,-0.95 -1.34,-1.52 -0.3,-1.32 1.95,0.75 -0.33,0.94 0.53,3.08 -3.78,3.78 -5.63,3.93 -7.17,3.98 -10.17,4.13 -5.63,3.95 -4.53,0.28 -4.08,1.44 -1.85,-1.05 -4.38,0.19 3.73,-1.01 -1.49,-0.89 -1.51,0.57 -5.61,-3.05 1.07,-2.1 2.12,-2.58 0.01,-1.5 0.8,-2.15Z(M1149.27,1505.2l0.33,0.06 0.51,-1.02 -1.12,0.03 0.28,0.93Z(M1107.76,1524.37l-0.18,-1.23 -0.35,1.4 0.53,-0.17Z(M1185.72,1481.69l0.12,0.41 -0.64,0.98 -5.92,4.63 0.53,0.99 1.51,-0.57 0.22,0.54 -0.44,0.66 1.39,0.08 -1.46,1.96 -0.43,0.06 0.04,-0.38 -0.59,0.4 0.76,1.76 0.17,2.88 -3.07,1.06 -2.84,2.58 -1.85,0.44 -0.89,0.79 -3.5,-0.48 -2.94,0.42 -3.52,-1.4 -3.83,-0.59 -5.85,0.52 -7.38,2.56 -4.44,-0.86 -0.51,-0.75 2.32,-4.35 3.03,-1.75 2.76,-2.29 15.18,-2.75 0.5,-0.56 1.51,0.31 -0.21,0.28 0.74,0.71 2.77,-0.02 -0.63,0.27 0.54,0.4 0.88,-0.42 -0.21,1.14 1.75,-0.12 2,-0.94 0.1,-0.35 -1.98,0.21 2.06,-2.35 -2.73,0.85 -0.16,-0.52 0.38,-1.09 -0.36,-0.39 -1.78,0.54 -0.28,0.65 -0.4,-0.1 -0.01,-0.78 -2.87,0.93 3.8,-1.49 2.18,-0.26 0.44,0.13 -0.15,0.64 0.27,0.06 1.29,-0.55 -1.89,1.52 0.81,0.27 3.45,-2.28 3.19,-0.7 5.3,-2.36 1.26,-1.27 0.51,0.09Z(M1175.47,1487.21l0.51,-0.98 -1.9,0.94 1.39,0.04Z(M1180.16,1489.25l0.15,0.29 0.36,-0.6 -0.51,0.31Z(M1180.59,1485.7l0.12,-0.34 -2.32,0.43 -0.6,0.77 -0.01,0.8 0.7,0.1 1.06,-1.37 1.05,-0.39Z(M1130.62,1730.2l-1.29,2.42 -0.47,0.08 -1.27,-0.78 -2.11,-2.6 2.4,-2.44 1.27,-0.45 1.18,1.64 0.29,2.13Z(M773.99,1535.66l0.15,0.92 -1.56,0.91 -1.05,1.68 -2.05,1.03 -1.23,-3.65 -0.78,1.57 -0.38,-0.14 -1.69,-2.57 -0.97,-3.09 -1.68,-2.33 -0.6,-3.34 1.93,-0.91 1.17,-0.03 0.39,0.86 -0.34,1 1.52,1.6 0.87,0.16 1.03,3.06 0.8,-0.45 -0.41,-2.78 0.33,-0.38 1.48,0.98 2.04,-0.11 -0.14,0.8 -1.87,0.03 -0.72,0.95 2.52,3.29 1.24,0.94Z(M771.74,1537.58l0.18,-1.21 -0.49,-1.52 -0.43,-0.2 -0.3,0.17 0.15,1.41 0.89,1.35Z(M1083.59,1460.59l-2.49,0.42 0.3,0.38 -0.25,0.6 -1.26,1.65 0,1.6 1.8,1.53 -3.34,0.92 -1.74,1.28 -0.15,3.94 -1.82,4.19 0.63,-3.58 -0.46,0.31 -0.67,2.56 -0.33,0.19 -0.29,-0.54 0.93,-5.94 -0.58,0.22 -2.74,3.73 -0.6,-0.24 -1.67,0.97 -0.78,2.7 -1.51,0.78 0.19,2.37 -0.62,3.51 -2.56,4.38 0.83,2.07 0.12,1.75 -1.19,2.77 2.43,6.47 1.22,5.04 -0.43,5.72 -1.68,4.73 -2.57,4.79 -1.88,1.88 -4.1,2.16 -2.25,0.05 -1.8,-1.18 -2.05,-5.56 -1.17,-1.95 -0.17,-5.1 0.35,-3.26 -1.21,-4.02 -0.16,-3.63 1.15,-4.59 1.15,-2.91 -0.34,-2.01 0.34,-1.98 1.1,-2.35 0.78,-0.78 0.25,-0.89 -0.17,-2.47 2.17,-6.24 -0.94,-1.44 -2.1,0.3 -2.09,3.13 -2.06,1.59 -0.57,-0.3 -0.11,-0.75 0.88,-2.33 1.38,-2.87 2.31,-1.45 0.39,-2.34 5.44,-8.35 1.5,-3.67 -0.11,2.09 0.62,1.46 2.1,-2.6 2.16,-0.38 0.05,1.25 -1.51,1.71 0.02,0.72 0.77,0.56 1.08,-2.13 2,-1.27 0.91,-1.72 1.69,-0.53 2.38,0.45 3.4,-1.29 1.55,-1.43 1.06,-0.02 4.71,1.96 2.44,2.06 -0.06,1.15Z(M1075.29,1461.12l-0.53,-0.25 -0.39,0.61 -0.45,2.1 1.18,-0.25 0.19,-2.21Z(M1068.91,1470.91l0.17,0.87 0.57,0.24 0.09,-0.71 -0.83,-0.4Z(M1058.97,1466.73l-0.46,0.76 0.23,0.36 0.97,-0.1 0,-0.91 -0.74,-0.11Z(M1057.57,1468.55l-2.38,2.66 -1.57,2.96 0.48,1.85 0.84,0.07 1.05,-1.4 0.54,-1.91 0.93,-1 -0.28,-0.83 0.31,0.06 0.03,-1.09 0.71,-0.37 0.06,-0.55 -0.72,-0.45Z(M1087.35,1448.61l1,-0.15 -2.09,1.57 -1.22,-0.76 -2.46,0.21 -2.08,-0.6 0.22,-2.99 0.53,-1.4 -0.53,-0.21 -6.84,1.54 -5.87,0.06 -3.08,1.64 -2.67,2.23 -1.09,-0.61 -2.05,0.11 -1.38,-0.99 -1.55,0.49 -2.13,-0.18 -3.18,-5.01 -1.59,-1.02 -5,-1.06 -1.89,1.28 -0.75,1.22 -0.31,-0.59 0.11,-2.93 -0.88,-1.82 -1.01,-0.76 -0.21,-1.09 -2.03,1.44 -1.35,1.72 -2.35,0.91 -2.28,1.78 -3.87,0.72 -5.22,3.06 -3.58,1.16 -3.05,-1.73 -0.38,0.72 -1.98,0.43 2,-4.8 -0.82,-0.9 -1.2,0.14 -2.07,1.44 -1.02,-0.3 -3.21,1.98 -3.83,1.07 -1.72,0.05 -1.36,-1.05 0.48,-0.94 4.77,-3.85 9.09,-8.99 2.83,-1.73 8.75,-3.61 5.5,-3.74 1.41,-3.24 0.23,-2.4 4.85,-2.27 -1.16,3.46 -0.64,0.79 2.26,-0.84 1.24,-3.68 0.86,-1.02 0.54,-3.02 1.22,-0.21 0.49,0.42 0.33,1.42 -2.77,3.62 -0.2,0.62 0.28,0.78 0.67,-0.35 0.65,-1.6 2.39,-0.63 1.08,-1.48 0.34,-1.61 -1.32,-1.57 -0.44,-1.85 2.2,-0.48 9.63,3.91 4.59,0.05 1.45,-0.61 1.27,0.95 1.69,-0.09 1.71,2.76 2.03,6.65 2.16,3.08 3.41,1.51 8.64,-0.16 -1.81,5.27 0.89,1.67 2.5,1.9 1.38,1.79 -1.42,2.99 -0.63,2.3 1.71,1.36 1.55,-0.36 1.18,0.64 0.03,0.87 -1.17,0.1 -0.78,0.7 0.15,1.8 0.59,-0.77 0.57,0.34 -1.48,2.98 0.77,0.99 0.78,-0.64Z(M1015.4,1441.26l-0.06,0.46 0.6,0.16 -0.54,-0.62Z(M1016.57,1443.54l0.65,-0.68 -2.23,1.6 1.58,-0.92Z(M1017.78,1442.02l0.05,-0.73 -1.23,0.43 1.18,0.3Z(M1019.33,1439.94l-0.42,-0.37 -0.28,0.81 0.7,-0.44Z(M1046.11,1409.48l-0.34,0.5 0.34,1.58 2.74,-0.89 0.58,-1.26 -1.71,-0.41 -1.61,0.48Z(M1036.39,1424.91l3.26,-1.8 0.49,-1.17 1.1,-0.96 -1.18,0.15 -6.35,3.5 -0.61,0.61 0.35,0 -0.29,1.1 2.56,-0.49 0.53,-0.4 -0.36,-0.36 0.5,-0.18Z(M1049.14,1433.78l0.56,-0.37 -1.56,-0.85 -2.64,0.19 -2.39,0.87 -2.75,2.5 -0.61,1.64 2.07,0.87 -0.23,-0.5 0.42,-0.66 0.09,1.01 -0.68,1.4 0.34,0.61 0.42,-0.14 1.88,-2.33 0.17,-0.87 2.81,-2.42 -0.52,-0.63 2.62,-0.32Z(M1050.28,1410.98l0.78,-0.12 -0.05,-0.4 -0.87,-1.06 -0.52,0.12 0.05,1.22 0.61,0.24Z(M1074,1428.2l-0.41,-0.67 -1.41,-0.42 -1.33,0.27 -0.78,0.73 1.05,0.48 2.88,-0.39Z(M1088.35,1448.46l2.03,-0.52 0.9,0.92 -0.06,2.41 7.2,2.03 4.93,0.93 3.49,-0.43 0.92,0.57 3.28,-0.34 1.75,0.97 4.86,0.49 0.04,0.76 1.71,-1.01 0.84,0.74 -1.12,0.56 0.48,0.47 -0.33,0.55 0.34,0.19 1.68,-0.46 2.42,0.33 0.71,-0.68 0.16,1 0.72,0.22 3.17,-0.16 3.5,5.9 0.75,0.09 0.35,-0.58 0.73,3.58 1.96,0.89 0.01,-0.85 1.36,0.36 0.08,1.19 -0.81,1.25 0.82,0.31 0.48,0.82 -0.9,0.71 2.09,2.46 0.84,0.33 0.65,1.88 0.86,-0.9 -0.15,1.35 0.35,0.35 -1.69,0.02 -1.12,-0.72 -0.05,-0.8 -2.03,0.9 1.26,2.47 -0.12,1.29 -0.88,1.31 -4.27,-1.41 -1.51,-0.97 -0.88,-1.41 -1.36,0.42 -1.36,1.33 0.16,-2.62 -0.77,-0.45 -1.9,0.63 1.41,-1.71 0.38,-1.5 -1.15,0.9 -0.68,-0.07 -0.05,-0.8 -1.38,-0.97 -0.61,-2.06 0.32,-1.38 -4.69,-0.16 -0.1,0.45 1.31,0.93 1.59,2.43 1.09,0.61 -0.04,1.06 0.91,1.95 0.01,2.34 -1.42,2.92 -1.85,1.61 -1.63,3.64 -0.27,1.11 0.22,9.24 -0.82,2.3 -4.51,3.78 -2.68,1.05 -0.51,-0.99 -2.29,-12.12 -0.61,-1.34 -1.84,-1.72 -1.32,-0.21 -4.42,2.17 0.34,0.7 -1.32,2.34 -1.19,0.53 -1.07,1.2 -2.05,-0.67 -1.03,-1.16 0.68,-3.55 3.01,-1.52 1.15,-3.37 0.57,0.1 1.5,-1.76 0.36,-6.55 -0.32,-1.34 -1.41,-1.98 0.29,-1.08 1.67,0.2 -0.59,-1.89 -0.74,-0.93 -0.02,-0.84 -0.92,-1.05 -5,-2.39 -1.76,-0.38 -1.93,-2.19 -2.27,-0.52 -3.65,-1.9 0.06,-1.15 0.5,-0.12 -0.13,-1.42 1.06,-1.56 1.26,0.95 6.17,0.54 0.88,-0.32 -0.18,-0.65 -1.41,-1.11 -0.16,-1.16 -2.19,-0.72 0.52,-1.32 -0.6,-2.05 -1.18,-1.6 0.16,-0.44Z(M1099.72,1457.32l-1.05,0.48 -0.49,0.93 1.07,0.62 0.62,-0.19 0.71,-1.09 -0.86,-0.75Z(M1097.63,1456.81l-0.91,-1.19 -0.86,-0.16 0.01,0.8 -0.36,0.33 -1.78,0.33 -0.04,0.42 0.59,0.59 2.67,0.23 1.08,-0.81 -0.4,-0.54Z(M1094.21,1454.78l0.39,-1.1 -0.31,-0.64 -1.69,-0.82 -1.44,0.26 1.35,2.93 0.82,0.2 0.35,-0.84 0.53,0.01Z(M1090.35,1451.87l-0.19,0.74 0.73,0.55 0.02,-0.64 -0.56,-0.65Z(M1090.76,1451.6l-0.35,-1.14 0.24,-2 -0.84,-0.08 -0.66,0.8 0.97,2.1 0.64,0.32Z(M1087.39,1460.36l-1.53,0.05 1.72,1.1 0.42,-0.48 -0.61,-0.67Z(M1104.07,1459.92l7.28,2.45 3.04,1.99 2.67,-2.12 0.7,-0.1 -1.2,1.42 -1.27,0.66 1.08,0.56 1.44,-0.91 1.84,-3.26 -1.04,-0.16 0.23,-1.15 -0.38,-0.36 -1.21,2.46 -0.39,-0.74 -0.02,-1.58 -0.44,-0.12 -0.68,-1.42 -1.32,0.4 -1,1.4 -2.16,-1.84 -2.22,0.7 -0.6,0.71 0.68,0.76 -0.12,0.71 -1.47,-0.88 -1.19,0.02 -0.66,-0.84 -0.25,-1.32 -2.87,0.9 -0.9,-0.55 -0.45,0.59 -0.07,0.5 0.7,0.44 2.25,0.68Z(M1118.29,1464.93l-1.42,0.68 0.56,0.3 0.86,-0.98Z(M1135.81,1476.71l0.02,-1.1 -0.74,0 0.72,1.1Z(M977.9,1400.16l0.05,1.84 -0.81,1.07 0.1,-0.99 -1.27,-2.28 -0.65,-0.24 0.28,-1.11 -4.47,0.46 -1.12,0.62 -0.51,0.98 1.7,-0.01 2.01,2.12 1.25,-0.59 1.3,1.48 1.89,0.45 -1.4,1.03 -1.28,-0.13 -0.16,0.57 -4.43,3.59 -1.2,-0.07 -2.1,-1.67 -2.01,1.17 -1.07,0.18 -0.45,-0.73 0.6,-3.62 3.16,-1.02 0.53,-0.77 -0.06,-1.42 -0.83,-0.82 4.2,-4.12 -1.14,-0.23 -4.12,2.68 -0.36,-0.15 0.26,-1.24 -0.41,-1.4 1.64,-0.22 0.53,0.25 -0.14,0.65 0.54,0.14 0.98,-0.64 -0.34,-0.88 0.54,-0.49 2.67,-0.59 0.32,-0.7 -0.18,-0.77 -1.17,-2.57 0.73,-0.7 0.86,1.08 0.1,1.39 0.9,2.03 1.19,0.23 0.39,0.69 -0.03,1.5 -0.61,0.64 0.76,0.85 1.46,0.32 0.33,1.21 1.05,0.95Z(M970.51,1403.35l-0.98,-0.04 0.64,1.75 0.84,0.04 0.73,0.93 0.74,-0.09 0.93,-2.4 -0.78,-0.62 -2.12,0.43Z(M296.15,1194.71l-6.4,3.19 -0.91,3.96 -12.85,2.61 -1.57,-0.94 -0.37,-1.79 0.77,-1.81 9.71,-3.78 7.56,-1.94 4.06,0.5Z(M683.32,1565.04l-0.26,0.99 -0.77,0.18 -0.54,-0.38 -0.67,-1.75 0.08,-0.77 0.83,-1.15 1.11,-0.48 0.5,0.7 -0.28,2.66Z(M1043.06,1488.32l-0.1,2.04 -1.11,2.06 -0.38,-0.09 -0.62,-3.4 0.39,-1.29 0.76,-1.34 0.68,-0.02 0.42,0.25 -0.04,1.79Z(M1213.18,1487.05l-0.37,1.48 0.43,4.69 -0.95,-5.15 0.08,-1.74 1.02,-1.4 -1.02,-5.68 1.11,-6.11 0.26,-0.17 0.44,1.87 0.92,-1.76 1.14,-0.9 -0.08,1.1 -0.93,0.85 0.23,0.6 -0.47,5.33 -0.56,0.72 0.4,1.54 -1.65,4.73Z(M732.6,1646.14l-0.05,0.7 -0.93,1.15 -1.04,-0.11 -3.1,-3.9 0.09,-0.94 1.19,-0.24 3.84,3.34Z(M749.16,1424.97l-0.49,-1.81 0.74,-0.89 0.99,1.3 0.26,1.38 0.22,2.53 -0.59,1.25 -1.06,-0.06 -0.15,-0.43 0.42,-0.74 -0.25,-0.49 -1.16,-0.41 1.07,-1.63Z(M755.08,1610.82l-1.81,-2.51 -2.21,-2.19 -0.57,0.02 -0.81,1.85 -1.12,0.37 -0.97,-0.34 -0.9,-0.99 -0.89,0.29 -0.6,-0.37 -1.55,0 -1.15,1.3 -0.8,-0.86 -0.05,-0.66 4.37,-1.63 0.51,-3.47 0.58,-0.52 -0.39,4.38 0.86,1.4 0.78,0.85 0.76,-0.38 1.47,-2.37 0.38,0.02 2.5,2.75 1.61,3.06Z(M885.79,1431.15l-1.02,-0.36 -2.19,0.45 1.48,-1.6 -0.42,-1.69 -2.56,-0.48 -0.62,-0.57 -0.42,-1.65 0.44,-1.29 -1.67,-1.56 -3.39,-0.71 -4.56,1.87 -0.69,-0.2 -0.71,-1.18 -1.9,1.35 -0.26,-0.17 0.16,-0.79 1.05,-1.16 1.04,-0.19 1.41,1.47 1.12,-0.15 2.67,-1.62 2.29,0 2.75,1.12 0.87,0.89 0.46,1.45 -0.2,2.1 0.55,0.36 1.35,0.29 0.27,-0.24 -0.35,-2.01 1.79,-0.67 -0.41,1.12 0.62,2.47 0.8,0.62 -0.49,0.88 0.59,0.9 3.15,1.06 7.75,-1.41 0.71,0.65 -2.95,1.69 -2.16,-0.15 -3.73,0.86 -2.62,-1.75Z(M755.08,1610.82l-1.81,-2.51 -2.21,-2.19 -0.57,0.02 -0.81,1.85 -1.12,0.37 -0.97,-0.34 -0.9,-0.99 -0.89,0.29 -0.6,-0.37 -1.55,0 -1.15,1.3 -0.8,-0.86 -0.05,-0.66 4.37,-1.63 0.51,-3.47 0.58,-0.52 -0.39,4.38 0.86,1.4 0.78,0.85 0.76,-0.38 1.47,-2.37 0.38,0.02 2.5,2.75 1.61,3.06Z(M792.26,1581.42l-0.75,2.69 -4.57,6.97 0.49,0.45 1.62,-0.22 -0.3,0.48 -3.63,0.87 -5.44,2.59 -0.64,-1.38 2.17,-0.47 0.95,-1.2 0.51,0.39 0.54,-0.66 2.28,0.21 1.19,-2.63 0.67,-0.25 0.72,-1.13 -0.22,-1.36 0.84,-0.07 1.44,-1.44 1.23,-1.98 0.13,-1.48 0.36,-0.5 0.41,0.12Z(M906.94,1473.16l-0.93,0.46 -0.25,1.49 -0.95,1.63 -1.82,0.71 0.46,2.38 1.22,0.44 -0.18,0.82 1.21,0.83 -0.16,0.82 -2.26,-0.82 -0.82,-3.9 -0.48,-0.28 -1.4,-0.51 -3.88,0.59 2.2,-0.8 0.41,-0.66 1.75,-0.26 0.44,-0.26 -0.13,-0.51 2.49,1.15 0.67,-0.96 0.49,-0.02 0.12,-2.06 1.14,-1.64 0.14,-0.9 0.2,-1.65 -0.33,-0.73 -0.7,-0.71 -2.33,-0.1 3.05,-0.58 -1.03,-1.84 -2.31,-2.58 2.16,0.29 0.65,-1.06 -0.27,-1.6 -2.79,-5.1 -0.1,-0.69 0.85,-2.5 -0.14,-2.89 -0.32,-1.51 -1.52,-1.53 -0.11,-0.69 0.72,0.14 1.47,1.46 0.65,3.82 -0.53,3.28 0.17,1.49 0.76,1.78 1.62,2.19 0.06,2.75 -0.72,1.98 1.44,2.22 0.3,2.99 -0.35,2.49 0.27,0.7 -0.3,0.44Z`.split(`(`),i9=4096,qWe=85.05112878;function a9(e,t){let n=Math.max(-85.05112878,Math.min(qWe,t))*Math.PI/180,r=(e+180)/360,i=.5-Math.log(Math.tan(Math.PI/4+n/2))/(2*Math.PI);return{x:r*i9,y:i*i9}}function JWe(e){let t=.5-e.y/i9,n=2*Math.atan(Math.exp(2*Math.PI*t))-Math.PI/2;return{lon:e.x/i9*360-180,lat:n*180/Math.PI}}function YWe(e,t){return{x:(e.x-t.tx)/t.k,y:(e.y-t.ty)/t.k}}function XWe(e){if(!Number.isFinite(e)||e<=0)return 4;let t=Math.log2(i9*1.08*e/256);return Math.max(0,Math.min(21,Math.round(t)))}function ZWe(e,t){return e!=null&&t!=null&&Number.isFinite(e)&&Number.isFinite(t)&&Math.abs(e)<=90&&Math.abs(t)<=180}function QWe(e,t,n){let r=`${e.toFixed(6)},${t.toFixed(6)}`;return n==null?`https://www.google.com/maps/search/?api=1&query=${r}`:`https://www.google.com/maps/@${r},${Math.round(n)}z`}function $We(e,t){return`https://www.google.com/maps/dir/?api=1&destination=${e.toFixed(6)},${t.toFixed(6)}`}function o9(e,t){return{x:t.tx+e.x*t.k,y:t.ty+e.y*t.k}}function eGe(e,t,n,r=40,i=i9/90){if(e.length===0)return null;let a=1/0,o=-1/0,s=1/0,c=-1/0;for(let t of e)a=Math.min(a,t.x),o=Math.max(o,t.x),s=Math.min(s,t.y),c=Math.max(c,t.y);let l=Math.max(o-a,i),u=Math.max(c-s,i),d=(a+o)/2,f=(s+c)/2;l*=1.16,u*=1.16;let p=Math.min((t-r*2)/l,(n-r*2)/u);return{k:p,tx:t/2-d*p,ty:n/2-f*p}}function tGe(e,t,n,r,i,a){let o=Math.max(i,Math.min(a,e.k*t));return o===e.k?e:{k:o,tx:n-(n-e.tx)*o/e.k,ty:r-(r-e.ty)*o/e.k}}function s9(e,t){return e/t}function nGe(e,t,n){return`${s9(e,n)} ${s9(t,n)}`}function rGe(e,t,n=1/0){let r=t/i9;return{kMin:Math.min(e,Math.max(r,e*.25)),kMax:Math.max(e,Math.min(e*60,n))}}function iGe(e){return Math.max(0,Math.min(1,(1.5-e)/.9))}function aGe(e,t,n,r,i,a,o=14,s=6){let c=t-r-o;return{x:Math.max(s,Math.min(i-n-s,e-n/2)),y:Math.max(s,Math.min(a-r-s,c>=s?c:t+o))}}var oGe=6371.0088,sGe=(e,t)=>{let n=Math.PI/180,r=(t.lat-e.lat)*n,i=(t.lon-e.lon)*n,a=Math.sin(r/2)**2+Math.cos(e.lat*n)*Math.cos(t.lat*n)*Math.sin(i/2)**2;return 2*oGe*Math.asin(Math.min(1,Math.sqrt(a)))};function cGe(e,t,n,r=!1){if(e.length<2)return 0;let i=0;for(let r=1;rn(t[e],t[r]);for(let e=0;e`${e.lat.toFixed(6)},${e.lon.toFixed(6)}`,i=Math.min(e.length,fGe(!!t.coarsePointer,n));for(;;){let t=e.slice(0,i),a=t[0],o=n?a:t[t.length-1],s=n?t.slice(1):t.slice(1,-1),c=`https://www.google.com/maps/dir/?api=1&origin=${r(a)}&destination=${r(o)}`+(s.length?`&waypoints=${s.map(r).join(`|`)}`:``)+`&travelmode=driving`;if(c.length<=2048||i<=2)return{url:c,used:i};--i}}function mGe(e,t,n,r){return{x0:Math.min(e,n),y0:Math.min(t,r),x1:Math.max(e,n),y1:Math.max(t,r)}}function hGe(e,t,n,r,i,a){if(e==null||!Number.isFinite(e))return a;if(!(n>t))return(r+i)/2;let o=Math.max(0,Math.min(1,(e-t)/(n-t)));return Math.sqrt(r*r+o*(i*i-r*r))}var c9=1e3,l9=620,gGe=3.2,_Ge=15,vGe=4.5,yGe=2.6,u9=[{fill:`#9DBFF2`,line:`#5F7FB0`},{fill:`#A5D8B4`,line:`#5E9C74`},{fill:`#F5D989`,line:`#B39A46`},{fill:`#F0A8A0`,line:`#B76D65`},{fill:`#7E99C2`,line:`#4A6790`},{fill:`#84AD91`,line:`#4C7A5C`},{fill:`#C4AE6E`,line:`#8C7838`},{fill:`#C0867F`,line:`#8A5049`}],d9={fill:`#D7DBE3`,line:`#8A909C`},f9={fill:`#9DBFF2`,line:`#4F6079`};function bGe(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:null}function xGe(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:null}function SGe({rows:e,field:t,colorField:n,sizeField:r,selectedPids:i,onSelectPids:a,onOpen:o}){let[s,c]=(0,L.useState)(null),[l,u]=(0,L.useState)(!1),[d,f]=(0,L.useState)(!1),[p,m]=(0,L.useState)(null),[h,g]=(0,L.useState)(null),[_,v]=(0,L.useState)(null),[y,b]=(0,L.useState)(null),x=(0,L.useRef)(null),S=(0,L.useRef)(!1),C=(0,L.useRef)(!1),w=(0,L.useMemo)(()=>{let i=[];for(let a of e){let e=bGe(a.lat),o=bGe(a.lon);e==null||o==null||Math.abs(e)>90||Math.abs(o)>180||i.push({pid:a.pid,title:String(a[t.key]??``),p:a9(o,e),lat:e,lon:o,colorKey:n?String(a[n.key]??``).trim():null,size:r?xGe(a[r.key]):null,colorVal:n?a[n.key]:null,sizeVal:r?a[r.key]:null})}return i},[e,t.key,n,r]),T=e.length-w.length,E=(0,L.useMemo)(()=>eGe(w.map(e=>e.p),c9,l9),[w]);(0,L.useEffect)(()=>{E&&(!C.current||h==null)&&g(E)},[E]);let{kMin:D,kMax:O}=(0,L.useMemo)(()=>E?rGe(E.k,l9,32):{kMin:1,kMax:1},[E]),k=(0,L.useMemo)(()=>{if(!n)return null;let e=[],t=new Map;for(let n of w){let r=n.colorKey??``;t.has(r)||(t.set(r,0),e.push(r)),t.set(r,(t.get(r)??0)+1)}let r=e.filter(e=>e!==``),i=new Map;return r.forEach((e,t)=>i.set(e,t{if(!r)return null;let e=1/0,t=-1/0,n=0;for(let r of w){if(r.size==null){n+=1;continue}e=Math.min(e,r.size),t=Math.max(t,r.size)}return Number.isFinite(e)?{min:e,max:t,missing:n,none:!1}:{min:0,max:0,missing:n,none:!0}},[r,w]),j=(0,L.useMemo)(()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches,[]),M=(0,L.useMemo)(()=>i.size<2?[]:w.filter(e=>i.has(e.pid)&&ZWe(e.lat,e.lon)).sort((e,t)=>e.pid-t.pid),[w,i]),ee=i.size-M.length,N=(0,L.useMemo)(()=>{if(!l||M.length<2)return null;let e=M.map(e=>({lat:e.lat,lon:e.lon})),t=0;for(let e=1;ee.pid===p);e>=0&&(t=e)}let{order:n,km:r}=dGe(e,sGe,{start:t,roundTrip:d});return{ordered:n.map(e=>M[e]),km:r,link:pGe(n.map(t=>e[t]),{roundTrip:d,coarsePointer:j})}},[l,M,d,p,j]),te=(0,L.useCallback)(e=>{if(!k)return f9;let t=e.colorKey??``;return t===``?d9:k.swatch.get(t)??d9},[k]),ne=(0,L.useCallback)(e=>!r||!A||A.none?vGe:hGe(e.size,A.min,A.max,gGe,_Ge,yGe),[r,A]),P=(0,L.useCallback)((e,t)=>{if(!y)return{x:0,y:0};let n=y.getBoundingClientRect();return{x:(e-n.left)/n.width*c9,y:(t-n.top)/n.height*l9}},[y]);(0,L.useEffect)(()=>{if(!y)return;let e=e=>{e.preventDefault();let{x:t,y:n}=P(e.clientX,e.clientY);C.current=!0,g(r=>r&&tGe(r,Math.exp(-e.deltaY*.0016),t,n,D,O))};return y.addEventListener(`wheel`,e,{passive:!1}),()=>y.removeEventListener(`wheel`,e)},[y,P,D,O]);let re=(0,L.useCallback)(e=>{C.current=!0,g(t=>t&&tGe(t,e,c9/2,l9/2,D,O))},[D,O]),F=(0,L.useCallback)(()=>{C.current=!1,g(E)},[E]),ie=(0,L.useCallback)((e,t)=>{C.current=!0,g(n=>n&&{...n,tx:n.tx+e,ty:n.ty+t})},[]),ae=(0,L.useCallback)(e=>{let t=e.shiftKey?160:60;switch(e.key){case`ArrowLeft`:ie(t,0);break;case`ArrowRight`:ie(-t,0);break;case`ArrowUp`:ie(0,t);break;case`ArrowDown`:ie(0,-t);break;case`+`:case`=`:re(1.6);break;case`-`:case`_`:re(1/1.6);break;case`0`:F();break;case`Escape`:if(!_)return;v(null);break;default:return}e.preventDefault()},[ie,re,F,_]),oe=(0,L.useCallback)(e=>{if(e.button!==0||!h)return;let{x:t,y:n}=P(e.clientX,e.clientY);S.current=!1,e.currentTarget.setPointerCapture(e.pointerId),e.shiftKey||e.ctrlKey||e.metaKey?v({x0:t,y0:n,x1:t,y1:n}):x.current={x:t,y:n,tx:h.tx,ty:h.ty}},[h,P]),se=(0,L.useCallback)(e=>{let{x:t,y:n}=P(e.clientX,e.clientY);if(_){S.current=!0,v(e=>e&&{...e,x1:t,y1:n});return}let r=x.current;r&&(Math.abs(t-r.x)+Math.abs(n-r.y)>2&&(S.current=!0),C.current=!0,g(e=>e&&{...e,tx:r.tx+(t-r.x),ty:r.ty+(n-r.y)}))},[_,P]),ce=(0,L.useCallback)(e=>{if(_&&h){let t=mGe(_.x0,_.y0,_.x1,_.y1);if(t.x1-t.x0>3&&t.y1-t.y0>3){let n=[];for(let e of w){let r=o9(e.p,h);r.x>=t.x0&&r.x<=t.x1&&r.y>=t.y0&&r.y<=t.y1&&n.push(e.pid)}a(n,e.altKey?`add`:`replace`)}v(null)}x.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},[_,h,w,a]);if(!h||!E)return(0,B.jsxs)(`div`,{className:`cg-mode-empty`,children:[`No records with a location to map yet.`,T>0&&` ${T.toLocaleString()} matching record${T===1?``:`s`} have no location.`]});let le=s==null?void 0:w.find(e=>e.pid===s),ue=_?mGe(_.x0,_.y0,_.x1,_.y1):null,de=`translate(${h.tx.toFixed(2)} ${h.ty.toFixed(2)}) scale(${h.k.toFixed(6)})`,fe=e=>s9(e,h.k),pe=iGe(h.k),me=JWe(YWe({x:c9/2,y:l9/2},h)),he=QWe(me.lat,me.lon,XWe(h.k)),ge=i.size===1?w.find(e=>i.has(e.pid)):void 0,_e=A&&!A.none&&A.max>A.min?[A.min,(A.min+A.max)/2,A.max]:null;return(0,B.jsxs)(`div`,{className:`cg-mapview`,children:[(0,B.jsxs)(`div`,{className:`cg-map-bar`,children:[(0,B.jsxs)(`span`,{className:`cg-cal-note cg-map-count`,children:[(0,B.jsx)(`strong`,{children:w.length.toLocaleString()}),` of`,` `,e.length.toLocaleString(),` mapped · pinned at each customer's address`]}),T>0&&(0,B.jsxs)(`span`,{className:`cg-cal-nodate`,title:`${T.toLocaleString()} matching record${T===1?``:`s`} have no geocoded location and are not on the map. They remain in the Grid and List views.`,children:[T.toLocaleString(),` matching record`,T===1?` has`:`s have`,` no location`]}),ge&&(0,B.jsxs)(`span`,{className:`cg-map-go`,children:[(0,B.jsxs)(`a`,{href:QWe(ge.lat,ge.lon),target:`_blank`,rel:`noopener noreferrer`,title:`Open ${ge.title} in Google Maps at ${ge.lat.toFixed(5)}, ${ge.lon.toFixed(5)} (new tab)`,children:[ge.title||`Selected pin`,` in Google Maps`]}),(0,B.jsx)(`a`,{href:$We(ge.lat,ge.lon),target:`_blank`,rel:`noopener noreferrer`,title:`Directions to ${ge.title} (new tab)`,children:`Directions`})]}),i.size>=2&&(0,B.jsxs)(`span`,{className:`cg-map-route`,children:[l?N&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`cg-map-route-sum`,children:[(0,B.jsx)(`strong`,{children:N.ordered.length.toLocaleString()}),` stops ·`,` `,Math.round(N.km).toLocaleString(),` km`,(0,B.jsx)(`span`,{className:`cg-map-route-note`,children:` straight-line, not driving distance`})]}),(0,B.jsxs)(`label`,{className:`cg-map-route-opt`,children:[`Start`,(0,B.jsx)(`select`,{className:`cg-map-route-start`,value:String(N.ordered[0].pid),onChange:e=>m(Number(e.target.value)),children:M.map(e=>(0,B.jsx)(`option`,{value:e.pid,children:e.title||`#${e.pid}`},e.pid))})]}),(0,B.jsxs)(`label`,{className:`cg-map-route-opt`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked)}),`Return to start`]}),N.link&&(0,B.jsxs)(`a`,{href:N.link.url,target:`_blank`,rel:`noopener noreferrer`,title:`Open this route in Google Maps for driving directions (new tab)`,children:[`Open route in Google Maps`,N.link.used{u(!1),m(null)},children:`Clear`})]}):(0,B.jsxs)(`button`,{type:`button`,className:`cg-map-route-go`,onClick:()=>u(!0),disabled:M.length<2,title:M.length<2?`At least two selected records need a location to plan a route`:`Order these stops into a route`,children:[`Plan route (`,M.length.toLocaleString(),` stops)`]}),ee>0&&(0,B.jsxs)(`span`,{className:`cg-cal-nodate`,children:[ee.toLocaleString(),` selected record`,ee===1?` has`:`s have`,` no location and cannot be routed`]})]}),(0,B.jsx)(`span`,{className:`cg-map-hint`,children:`Scroll to zoom · drag to pan · shift-drag to select`})]}),(0,B.jsxs)(`div`,{className:`cg-map-frame`,tabIndex:0,role:`group`,"aria-label":`Map canvas. Arrow keys pan, plus and minus zoom, zero fits to data.`,onKeyDown:ae,children:[(0,B.jsxs)(`svg`,{ref:b,viewBox:`0 0 ${c9} ${l9}`,preserveAspectRatio:`xMidYMid meet`,className:`cg-map-svg`+(_?` is-selecting`:``),role:`img`,"aria-label":`Map of ${w.length.toLocaleString()} customers`,onPointerDown:oe,onPointerMove:se,onPointerUp:ce,onPointerCancel:ce,children:[(0,B.jsx)(`rect`,{className:`cg-map-water`,x:0,y:0,width:c9,height:l9}),(0,B.jsxs)(`g`,{transform:de,children:[pe>.01&&(0,B.jsxs)(`g`,{className:`cg-map-grat`,strokeWidth:fe(.6),opacity:pe,children:[Array.from({length:17},(e,t)=>{let n=a9(0,-80+t*10).y;return(0,B.jsx)(`line`,{x1:0,y1:n,x2:4096,y2:n},`p${t}`)}),Array.from({length:19},(e,t)=>{let n=a9(-180+t*20,0).x;return(0,B.jsx)(`line`,{x1:n,y1:0,x2:n,y2:4096},`m${t}`)})]}),(0,B.jsx)(`path`,{className:`cg-map-land`,d:GWe,strokeWidth:fe(.9)}),KWe.map((e,t)=>(0,B.jsx)(`path`,{className:`cg-map-lake`,d:e,strokeWidth:fe(.8)},t)),N&&N.ordered.length>1&&(0,B.jsx)(`polyline`,{className:`cg-map-route-line`,strokeWidth:fe(1.8),strokeDasharray:nGe(5,4,h.k),points:N.ordered.map(e=>`${e.p.x},${e.p.y}`).join(` `)+(d?` ${N.ordered[0].p.x},${N.ordered[0].p.y}`:``)}),w.map(e=>{let t=te(e),n=i.has(e.pid),r=ne(e)/h.k;return(0,B.jsx)(`circle`,{className:`cg-map-pin`+(s===e.pid?` is-hover`:``)+(n?` is-selected`:``),cx:e.p.x,cy:e.p.y,r:s===e.pid?r*1.28:r,fill:t.fill,stroke:n?`#202433`:t.line,strokeWidth:fe(n?2:1),role:`button`,tabIndex:0,"aria-label":`Open ${e.title}`,onMouseEnter:()=>c(e.pid),onMouseLeave:()=>c(t=>t===e.pid?null:t),onFocus:()=>c(e.pid),onBlur:()=>c(t=>t===e.pid?null:t),onClick:()=>{S.current||o(e.pid)},onKeyDown:t=>{t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),o(e.pid))},children:(0,B.jsx)(`title`,{children:e.title})},e.pid)})]}),N&&N.ordered.map((e,t)=>{let n=o9(e.p,h);return(0,B.jsxs)(`g`,{className:`cg-map-stopno`,transform:`translate(${n.x.toFixed(2)} ${(n.y-13).toFixed(2)})`,children:[(0,B.jsx)(`circle`,{r:7.5}),(0,B.jsx)(`text`,{textAnchor:`middle`,dy:`3.4`,children:t+1})]},e.pid)}),le&&(()=>{let e=o9(le.p,h),t=[];n&&t.push(`${n.label}: ${yp(n,le.colorVal)||`—`}`),r&&t.push(`${r.label}: ${yp(r,le.sizeVal)||`—`}`);let i=le.title||`(untitled)`,a=Math.max(i.length,...t.map(e=>e.length))*6.2+20,o=21+t.length*14,s=aGe(e.x,e.y,a,o,c9,l9);return(0,B.jsxs)(`g`,{className:`cg-map-card`,"aria-hidden":`true`,children:[(0,B.jsx)(`rect`,{x:s.x,y:s.y,width:a,height:o,rx:5}),(0,B.jsx)(`text`,{className:`cg-map-card-t`,x:s.x+10,y:s.y+15,children:i}),t.map((e,t)=>(0,B.jsx)(`text`,{className:`cg-map-card-l`,x:s.x+10,y:s.y+15+14*(t+1),children:e},t))]})})(),ue&&(0,B.jsx)(`rect`,{className:`cg-map-marquee`,x:ue.x0,y:ue.y0,width:ue.x1-ue.x0,height:ue.y1-ue.y0})]}),(0,B.jsxs)(`div`,{className:`cg-map-ctl`,role:`group`,"aria-label":`Map camera`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-map-ctl-b`,title:h.k>=O*.999999999?`Zoom in — at the limit. The basemap's detail ends here; use Open in Google Maps for street level.`:`Zoom in (+)`,"aria-label":`Zoom in`,disabled:h.k>=O*.999999999,onClick:()=>re(1.6),children:(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M8 3.6v8.8M3.6 8h8.8`})})}),(0,B.jsx)(`button`,{type:`button`,className:`cg-map-ctl-b`,title:`Zoom out (−)`,"aria-label":`Zoom out`,disabled:h.k<=D*1.000000001,onClick:()=>re(1/1.6),children:(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M3.6 8h8.8`})})}),(0,B.jsx)(`button`,{type:`button`,className:`cg-map-ctl-b`,title:`Fit to data (0)`,"aria-label":`Fit to data`,onClick:F,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M2.6 5.8V2.6h3.2M10.2 2.6h3.2v3.2M13.4 10.2v3.2h-3.2M5.8 13.4H2.6v-3.2`}),(0,B.jsx)(`path`,{d:`M6.6 8h2.8M8 6.6v2.8`})]})}),(0,B.jsx)(`a`,{className:`cg-map-ctl-b`,href:he,target:`_blank`,rel:`noopener noreferrer`,title:`Open this area in Google Maps (new tab)`,"aria-label":`Open this area in Google Maps`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M7 3.8H4.3a.9.9 0 0 0-.9.9v6.9a.9.9 0 0 0 .9.9h6.9a.9.9 0 0 0 .9-.9V9.2`}),(0,B.jsx)(`path`,{d:`M8.6 3.4h4v4M12.6 3.4 7.4 8.6`})]})})]}),(k||_e)&&(0,B.jsxs)(`div`,{className:`cg-map-legends`,children:[n&&k&&(0,B.jsxs)(`div`,{className:`cg-map-legend`,children:[(0,B.jsx)(`div`,{className:`cg-map-legend-t`,children:n.label}),k.order.slice(0,u9.length+1).map(e=>{let t=e===``?d9:k.swatch.get(e)??d9;return(0,B.jsxs)(`div`,{className:`cg-map-legend-row`,children:[(0,B.jsx)(`span`,{className:`cg-map-swatch`,style:{background:t.fill,borderColor:t.line}}),(0,B.jsx)(`span`,{className:`cg-map-legend-k`,children:e===``?`(blank)`:e}),(0,B.jsx)(`span`,{className:`cg-map-legend-n`,children:(k.counts.get(e)??0).toLocaleString()})]},e||`(blank)`)}),k.overflow>0&&(0,B.jsxs)(`div`,{className:`cg-map-legend-note`,children:[k.overflow.toLocaleString(),` further value`,k.overflow===1?` is`:`s are`,` drawn grey — the palette holds `,u9.length,` colours and reusing one would make two values look like the same value.`]})]}),r&&A&&(0,B.jsxs)(`div`,{className:`cg-map-legend`,children:[(0,B.jsx)(`div`,{className:`cg-map-legend-t`,children:r.label}),_e?(0,B.jsx)(`div`,{className:`cg-map-sizerow`,children:_e.map((e,t)=>(0,B.jsxs)(`span`,{className:`cg-map-sizeitem`,children:[(0,B.jsx)(`svg`,{width:32,height:32,"aria-hidden":!0,children:(0,B.jsx)(`circle`,{cx:16,cy:16,r:hGe(e,A.min,A.max,gGe,_Ge,yGe),fill:f9.fill,stroke:f9.line})}),(0,B.jsx)(`span`,{className:`cg-map-legend-k`,children:yp(r,e)})]},t))}):(0,B.jsxs)(`div`,{className:`cg-map-legend-note`,children:[`Every mapped record has the same `,r.label.toLowerCase(),`, so the bubbles cannot differ in size.`]}),A.missing>0&&(0,B.jsxs)(`div`,{className:`cg-map-legend-note`,children:[A.missing.toLocaleString(),` mapped record`,A.missing===1?` has`:`s have`,` no value — drawn at the smallest dot, never removed from the map.`]})]})]})]})]})}function CGe(e,t){let n=e.trim().toLowerCase();return t.find(e=>e.trim().toLowerCase()===n)}function wGe(e){let t=e.trim().replace(/[$,%\s]/g,``);if(t===``)return``;let n=Number(t);return Number.isFinite(n)?String(n):void 0}function TGe(e,t,n=nd(e)){let r=t.replace(/\r/g,``),i=r.trim();switch(e.type){case`formula`:case`created_time`:case`status`:return;case`checkbox`:{if(i===``)return``;let e=i.toLowerCase();return[`1`,`true`,`yes`,`y`,`on`,`checked`,`x`].includes(e)?`1`:[`0`,`false`,`no`,`n`,`off`,`unchecked`].includes(e)?``:void 0}case`int`:case`currency`:case`pct`:return wGe(r);case`rating`:{if(i===``)return``;let t=Number(i);return Number.isInteger(t)&&t>=1&&t<=rd(e)?String(t):void 0}case`select`:case`user`:return i===``?``:CGe(i,n);case`multiselect`:{if(i===``)return``;let e=[],t=new Set;for(let i of r.split(/[,\n]/)){if(!i.trim())continue;let r=CGe(i,n);if(!r)return;let a=r.toLowerCase();t.has(a)||(t.add(a),e.push(r))}return e.length?e.join(`,`):``}case`date`:return i===``||!Number.isNaN(Date.parse(i))?i:void 0;default:return r}}function EGe(e){return e.length>0&&e.every(e=>e.length===1)}var p9={fieldKey:null,armedUntil:0};function DGe(e,t){return{fieldKey:e,armedUntil:t+1e3}}function OGe(e,t){return t<=e.armedUntil?{...e,armedUntil:0}:p9}function kGe(e,t,n){return e<=0?0:!t||t.width!==1||t.x!==n.col||t.y!==n.row?e:Math.max(e,t.height)}function AGe({field:e,sourceFieldKey:t,editable:n,values:r,targetPids:i,allowedChoices:a}){if(!n||!EGe(r)||t&&t!==e.key||i.lengthe==null))return null;let o=[];for(let t=0;te.trim()).filter(e=>e!==``)}function HGe(e,t){for(let n of e)if(yd(n)){if(HGe(n.children,t))return!0}else if(n.colId===t)return!0;return!1}function UGe(e,t){let n=[];for(let r of e)if(yd(r)){let e=UGe(r.children,t);e.length&&n.push({...r,children:e})}else r.colId!==t&&n.push(r);return n}function b9(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_|_$/g,``).slice(0,28)||`field`}function WGe(e,t,n,r){let i=`custom_${b9(e)}_${Math.random().toString(36).slice(2,7)}`;return t===`formula`||t===`created_time`?{key:i,label:e,type:t,source:`odoo`,derived:!0,filterable:!0,default:!0,custom:!0,...t===`formula`?{agg:`sum`,...r?.formula?{formula:r.formula}:{}}:{}}:{key:i,label:e,type:t,source:`overlay`,default:!0,custom:!0,agg:[`currency`,`int`].includes(t)?`sum`:void 0,...(t===`select`||t===`multiselect`)&&n?.length?{options:n}:{},...t===`select`||t===`multiselect`?{colorCodeOptions:r?.colorCodeOptions!==!1,...r?.optionColors&&Object.keys(r.optionColors).length?{optionColors:r.optionColors}:{}}:{},...t===`multiselect`?{multi:!0}:{},...t===`rating`?{max:r?.max??5}:{}}}function GGe({scope:e=`customer`}={}){let t=Sd(e),{fields:n,rawRows:r,payload:i,loading:a,overlayEdits:o,setOverlayEdits:s,patchOverlay:c}=dte(e),[l,u]=(0,L.useState)([]),[d,f]=(0,L.useState)([]),[p,m]=(0,L.useState)(h9),[h,g]=(0,L.useState)(()=>Hf([])),[_,v]=(0,L.useState)(!1),[y,b]=(0,L.useState)(`saved`),[x,S]=(0,L.useState)(``),[C,w]=(0,L.useState)(new Set),[T,E]=(0,L.useState)(void 0),[D,O]=(0,L.useState)(null),[k,A]=(0,L.useState)(null),[j,M]=(0,L.useState)(null),[ee,N]=(0,L.useState)(null),te=(0,L.useCallback)(()=>{N(null),requestAnimationFrame(()=>Ee.current?.focus())},[]),[ne,P]=(0,L.useState)(!1),[re,F]=(0,L.useState)(``),ie=(0,L.useRef)(null),[ae,oe]=(0,L.useState)(null),[se,ce]=(0,L.useState)(!1),[le,ue]=(0,L.useState)(``),[de,fe]=(0,L.useState)(new Set),pe=(0,L.useRef)(null),[me,he]=(0,L.useState)(null),[ge,_e]=(0,L.useState)(null),ve=(0,L.useRef)({edited:{},deleted:{}}),[ye,be]=(0,L.useState)(null),[xe,Se]=(0,L.useState)(null),Ce=(0,L.useRef)({}),we=(0,L.useRef)(null),Te=(0,L.useRef)(null),Ee=(0,L.useRef)(null),De=(0,L.useRef)(null),Oe=(0,L.useRef)(p9);(0,L.useEffect)(()=>{let e=()=>{Oe.current=OGe(Oe.current,Date.now())},t=()=>{Oe.current=p9};return document.addEventListener(`copy`,e,!0),window.addEventListener(`blur`,t),()=>{document.removeEventListener(`copy`,e,!0),window.removeEventListener(`blur`,t)}},[]);let[ke,Ae]=(0,L.useState)({width:800,height:600}),je=i?.workspace?.storageKey??`customer-grid-standalone`;(0,L.useEffect)(()=>{if(!i||n.length===0||we.current===je)return;let e=RGe(je),t=lf(e?.fieldStamps,Date.now());ve.current={edited:{...t.edited??{}},deleted:{...t.deleted??{}}};let r=ste(n,e?.fields??[],t,Date.now(),i.workspace!=null),a=i.workspace?.views??[],o=new Map;o.set(h9,LGe(r));for(let t of e?.views??[])o.set(t.id,t);let s=new Map;for(let t of a){let n=ote(t,o.get(t.id),e?.savedAt,Date.now()),r=ate(n,t,e?.reemitted?.[t.id]);r!==null&&s.set(t.id,r),o.set(t.id,n)}let c=[...o.values()].map(e=>({...e,config:y9(e.config,r)})),l=e?.activeViewId??i.workspace?.activeViewId??h9,d=c.find(e=>e.id===l)??c[0];if(u(r),f(c),m(d.id),g(d.config),v(!0),we.current=je,s.size>0){let t={...e?.reemitted??{}};for(let e of c){let n=s.get(e.id);n!==void 0&&(qd({id:Jd(`view`),type:`view_upsert`,view:e}),t[e.id]=n)}Ce.current=t}else Ce.current={...e?.reemitted??{}}},[i,n,je]),(0,L.useEffect)(()=>{_&&zGe(je,{fields:l,views:d,activeViewId:p,savedAt:Date.now(),fieldStamps:lf(ve.current,Date.now()),reemitted:Ce.current})},[_,je,l,d,p]);let Me=(0,L.useCallback)(e=>{let t=lf(ve.current,Date.now());ve.current={edited:{...t.edited??{},[e]:Date.now()},deleted:{...t.deleted??{}}}},[]),Ne=(0,L.useCallback)(e=>{let t=lf(ve.current,Date.now()),n={...t.edited??{}};delete n[e],ve.current={edited:n,deleted:{...t.deleted??{},[e]:Date.now()}}},[]),Pe=(0,L.useCallback)(e=>{e.groupBy!==h.groupBy&&w(new Set),g(e)},[h.groupBy]),{visibleCols:Fe,fieldByKey:Ie,order:Le,visible:Re,lockedKey:ze,onColumnResize:Be,onColumnMoved:Ve,onColumnProposeMove:He,setColumnVisible:Ue,insertColumn:We}=one(l,h,Pe);(0,L.useEffect)(()=>{if(!_)return;let e=d.find(e=>e.id===p);if(!e||v9(e.config,h)){b(`saved`);return}return b(`saving`),Te.current!==null&&window.clearTimeout(Te.current),Te.current=window.setTimeout(()=>{let t={...e,config:h};f(e=>e.map(e=>e.id===t.id?t:e)),qd({id:Jd(`view`),type:`view_upsert`,view:t}),b(`saved`),Te.current=null},420),()=>{Te.current!==null&&window.clearTimeout(Te.current)}},[_,p,h,d]),(0,L.useLayoutEffect)(()=>{let e=De.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&t.height>0&&Ae({width:Math.floor(t.width),height:Math.floor(t.height)})};t();let n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),()=>{n.disconnect(),window.removeEventListener(`resize`,t)}},[_]);let Ge=Hee(i?.counts)===`server-windowed`,Ke=i?.workspace?.hideViews===!0,qe=od(h.display),Je=Ge?`grid`:qe?.mode??`grid`,Ye=(0,L.useMemo)(()=>i?.measures??[],[i?.measures]),Xe=(0,L.useRef)({}),Ze=(0,L.useMemo)(()=>{let e=i?.measureSets;if(e){let t={};for(let[n,r]of Object.entries(e))t[n]=new Set(r);Xe.current=t}return Xe.current},[i?.measureSets]),Qe=(0,L.useMemo)(()=>$f(h.filters,Ze),[h.filters,Ze]),$e=(0,L.useMemo)(()=>ep(h.filters).join(`,`),[h.filters]),et=(0,L.useMemo)(()=>Object.keys(Ze).join(`,`),[Ze]),tt=(0,L.useMemo)(()=>i?.workspace?.lists??[],[i?.workspace?.lists]),nt=(0,L.useMemo)(()=>{let e={};for(let t of tt)t.pids&&(e[t.id]=new Set(t.pids));return e},[tt]),rt=i?.today,it=i?.viewer,at=(0,L.useCallback)(e=>See(e,it),[it]),ot=(0,L.useMemo)(()=>tp(h.filters,{cohortSets:nt,today:rt}),[h.filters,nt,rt]),st=(0,L.useMemo)(()=>{let e=new Map;for(let t of l){if(t.type!==`formula`)continue;let n=hee(t);n&&e.set(t.key,n)}let{order:t,cyclic:n}=YUe(e),r=[];for(let i of t){if(n.has(i))continue;let t=E7(e.get(i));t.ok&&r.push({key:i,ast:t.ast})}return r},[l]),ct=(0,L.useMemo)(()=>l.filter(e=>e.type===`created_time`).map(e=>e.key),[l]),lt=(0,L.useMemo)(()=>{if(st.length===0&&ct.length===0)return r;let e={today:i?.today};return r.map(t=>{let n=o[t.pid],r=n?{...t,...n}:{...t},i={...t};for(let e of ct)i[e]=t._created??null,r[e]=i[e];for(let{key:t,ast:n}of st){let a=JUe(n,e=>r[e],e);i[t]=a,r[t]=a}return i})},[r,o,st,ct,i?.today]),ut=i?.workspace?.cohortMode===!0;(0,L.useEffect)(()=>{ut&&(ae&&tt.some(e=>e.id===ae)||oe(tt[0]?.id??null))},[ut,tt,ae]);let dt=ut?tt.find(e=>e.id===ae)??null:null,ft=(0,L.useMemo)(()=>new Set(dt?.pids??[]),[dt]),{visibleRows:pt,pidToIndex:mt}=Cne((0,L.useMemo)(()=>ut?lt.filter(e=>ft.has(e.pid)):lt,[ut,lt,ft]),l,h.filters,x,h.sorts,Ge?null:h.groupBy,C,h.memberPids,h.filterConj,Ge,Ze,nt,rt,h.cohortLock),[ht,gt]=(0,L.useState)(FGe),_t=pt.length>ht,vt=(0,L.useMemo)(()=>_t?pt.slice(0,ht):pt,[_t,pt,ht]),yt=(0,L.useMemo)(()=>{if(!_t)return mt;let e=new Map;return vt.forEach((t,n)=>{t.kind===`data`&&!e.has(t.record.pid)&&e.set(t.record.pid,n)}),e},[_t,vt,mt]),[bt,xt]=(0,L.useState)(0);(0,L.useEffect)(()=>(Sp(()=>xt(e=>e+1)),()=>Sp(void 0)),[]);let St=i?.workspace?.userAvatars,Ct=Rne(vt,Fe,Ie,o,at,St,bt,(0,L.useMemo)(()=>{if(!h.groupBy)return null;let e=Math.min(MGe(h),Fe.length),t=0;for(let n=0;nLe.map(e=>Ie.get(e)).filter(e=>!!e),[Le,Ie]),Mt=wt.current?.cell[1],Nt=(0,L.useMemo)(()=>{let e={};for(let t of l){if(t.type===`select`||t.type===`multiselect`){e[t.key]=nd(t);continue}if(t.type===`user`){e[t.key]=i?.userOptions??[];continue}t.type===`status`&&(e[t.key]=[...new Set(r.map(e=>e[t.key]).filter(e=>e!=null&&e!==``).map(String))].sort())}return e},[l,r,i?.userOptions]),Pt=jGe[h.rowHeightMode],Ft=mt.size,It=yt.size,Lt=(0,L.useCallback)(e=>{let t=vt[e];if(!(!t||t.kind!==`data`))return e===T?h.colorBy?wte[String(t.record[h.colorBy]??``).toLowerCase()]??Ete:Ete:h.colorBy?Cte[String(t.record[h.colorBy]??``).toLowerCase()]:e===Mt?Dte:void 0},[vt,h.colorBy,T,Mt]),Rt=(0,L.useCallback)(e=>{let t=e.kind===`cell`?e.location[1]:void 0;E(e=>e===t?e:t);let n=t===void 0?void 0:vt[t];if(e.kind===`cell`&&n?.kind===`data`&&t!==void 0){let e=n.record.pid,r=Ee.current?.getBounds(0,t),i=r?Xte(r,De.current?.getBoundingClientRect()):null;O(t=>i?t&&t.pid===e&&t.x===i.x&&t.y===i.y?t:{pid:e,x:i.x,y:i.y,size:i.size}:null)}if(e.kind===`header`){let t=Fe[e.location[0]],n=t?Ie.get(t.id):void 0,r=n?n.note||n.description:void 0,i=n&&t&&t.title!==n.label&&n?r?`${n.label} — ${r}`:n.label:r,a=e.bounds;if(i&&a){be(e=>e&&e.text===i&&e.x===a.x?e:{text:i,x:a.x,y:a.y+a.height+4});return}}if(be(e=>e===null?e:null),e.kind===`cell`&&t!==void 0){let n=vt[t],r=Fe[e.location[0]];if(n?.kind===`data`&&r){let t=Ie.get(r.id),i=t?yp(t,n.record[t.key]):``,a=e.bounds,o=a?Hte(i,NGe(i),a.width):null;if(o&&a){let e=Ute(a.x,window.innerWidth,NGe(o)+20),t=a.y+a.height+4;Se(n=>n&&n.text===o&&n.x===e&&n.y===t?n:{text:o,x:e,y:t});return}}}Se(e=>e===null?e:null)},[Fe,Ie,vt]),zt=(0,L.useMemo)(()=>h.groupBy?e=>vt[e]?.kind===`group-header`?32:Pt:Pt,[h.groupBy,Pt,vt]),Bt=Je===`calendar`||Je===`kanban`||Je===`map`,Vt=Bt?pt:vt,Ht=k===null?void 0:(Bt?mt:yt).get(k);(0,L.useEffect)(()=>{k!==null&&Ht===void 0&&A(null)},[k,Ht]);let Ut=(0,L.useMemo)(()=>{if(Ht===void 0)return null;let e=Vt[Ht];return!e||e.kind!==`data`?null:o[e.record.pid]?{...e.record,...o[e.record.pid]}:e.record},[Ht,Vt,o]),Wt=(0,L.useMemo)(()=>Ht===void 0?0:Vt.slice(0,Ht+1).filter(e=>e.kind===`data`).length,[Ht,Vt]),Gt=(0,L.useCallback)(e=>{if(Ht===void 0)return!1;for(let t=Ht+e;t>=0&&t{if(Ht!==void 0)for(let t=Ht+e;t>=0&&t{let n=e.column.id?Ie.get(e.column.id):void 0;if(e.ctx.font=`${e.theme.headerFontStyle} ${e.theme.fontFamily}`,t(),!n)return;let r=!!(n.note||n.description),i=n.source===`overlay`,a=Kte(e.rect,e.menuBounds.width,qte(r,i));if(!a)return;let o=0;if(r){let t=a[o++];e.spriteManager.drawSprite(`aiosInfo`,`normal`,e.ctx,t.x,t.y,t.size,e.theme)}if(i){let t=a[o++],n=e.ctx;n.save(),n.beginPath(),n.arc(t.x+t.size/2,t.y+t.size/2,t.size/2,0,Math.PI*2),n.fillStyle=kte,n.fill(),n.restore()}},[Ie]),Jt=(0,L.useCallback)((e,t)=>{let n=vt[e[1]];if(!n)return;if(Vd(Bd),n.kind===`group-header`){t.preventDefault(),w(e=>{let t=new Set(e);return t.has(n.groupKey)?t.delete(n.groupKey):t.add(n.groupKey),t});return}let r=Fe[e[0]],i=r?Ie.get(r.id):void 0;if(n.kind===`data`&&i&&at(i)&&(ed(i.type)||i.type===`rating`)){t.preventDefault(),kt(e[0],e[1]);let r=t.bounds;N({pid:n.record.pid,fieldKey:i.key,anchor:{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height,width:r.width,height:r.height}});return}if(n.kind===`data`&&i?.type===`url`){let e=String(o[n.record.pid]?.[i.key]??n.record[i.key]??``).trim();if(e){let n=/^https?:\/\//i.test(e)?e:/^[\w-]+(\.[\w-]+)+/.test(e)?`https://${e}`:null;if(n){t.preventDefault(),window.open(n,`_blank`,`noopener`);return}}}n.kind===`data`&&i&&i.key===ze&&Ot(n.record.pid)},[vt,Fe,Ie,at,o,ze,Ot,kt]),Yt=(0,L.useCallback)(e=>{let t=vt[e[1]],n=Fe[e[0]],r=n?Ie.get(n.id):void 0;t?.kind===`data`&&r?.source!==`overlay`&&A(t.record.pid)},[vt,Fe,Ie]),Xt=(0,L.useCallback)((e,t)=>{let n=vt[e[1]],r=Fe[e[0]],i=r?Ie.get(r.id):void 0;if(!(!n||n.kind!==`data`||!i||!at(i))){if(t.kind===I.Boolean&&i.type===`checkbox`){c(n.record.pid,{[i.key]:t.data?`1`:``});return}if(t.kind===I.Uri){c(n.record.pid,{[i.key]:t.data??``});return}(t.kind===I.Text||t.kind===I.Number)&&c(n.record.pid,{[i.key]:t.data})}},[vt,Fe,Ie,c,at]),Zt=(0,L.useCallback)(e=>{let t=vt[e[1]],n=Fe[e[0]],r=n?Ie.get(n.id):void 0;return!!t&&t.kind===`data`&&!!r&&at(r)&&!ed(r.type)&&r.type!==`rating`&&r.type!==`status`},[vt,Fe,Ie,at]),Qt=(0,L.useCallback)((e,t)=>{let n=Fe[e[0]],r=n?Ie.get(n.id):void 0;if(!r)return!1;let i=kGe(t.length,wt.current?.range,{col:e[0],row:e[1]}),a=Array.from({length:i},(t,n)=>{let r=vt[e[1]+n];return r?.kind===`data`?r.record.pid:null}),o=AGe({field:r,sourceFieldKey:Oe.current.fieldKey,editable:at(r),values:t,targetPids:a,allowedChoices:Nt[r.key]??nd(r)});if(!o)return!1;for(let e of o)c(e.pid,{[r.key]:e.value});return!1},[Fe,Ie,at,Nt,vt,c,wt.current]),$t=(0,L.useCallback)((e,t)=>{let n=Fe[e];n?.id&&M({fieldKey:n.id,anchor:{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height,width:t.width,height:t.height}})},[Fe]),en=(0,L.useCallback)((e,t)=>{t.isEdge||(t.preventDefault(),$t(e,t.bounds))},[$t]),tn=(0,L.useCallback)(e=>{if(e.key.toLowerCase()===`c`&&(e.ctrlKey||e.metaKey)&&!e.altKey){let e=wt.current?.range,t=e?.width===1?Fe[e.x]:void 0;Oe.current=DGe(t?.id??null,Date.now());return}if(e.key===`Enter`&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=wt.current?.cell;if(t){e.preventDefault(),e.stopPropagation(),e.cancel();let n=vt[t[1]],r=Fe[t[0]],i=r?Ie.get(r.id):void 0;if(!e.shiftKey&&n?.kind===`data`&&i&&at(i)&&(ed(i.type)||i.type===`rating`)){let e=Ee.current?.getBounds(t[0],t[1]);if(e){N({pid:n.record.pid,fieldKey:i.key,anchor:{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height,width:e.width,height:e.height}});return}}let a=e.shiftKey?-1:1,o=t[1]+a;for(;o>=0&&o=0&&o0?e.location[0]-1:void 0,r=wt.current?.cell[0]??n;if(!t||r===void 0||!e.bounds)return;let i=De.current?.getBoundingClientRect()?.top??e.bounds.y;e.preventDefault(),e.stopPropagation(),e.cancel(),$t(r,{x:e.bounds.x,y:i,width:e.bounds.width,height:36})},[wt.current,$t,vt,kt,Fe,Ie,at]),nn=(0,L.useCallback)(e=>{f(t=>t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e]),qd({id:Jd(`view`),type:`view_upsert`,view:e})},[]),rn=(0,L.useCallback)((e,t)=>{let n=d.find(t=>t.id===e);if(!n)return;let r={...n.config};t?r.cohortLock=t:delete r.cohortLock,nn({...n,config:r}),e===p&&g(e=>{let n={...e};return t?n.cohortLock=t:delete n.cohortLock,n})},[d,p,nn]),an=(0,L.useCallback)(e=>{let t=d.find(e=>e.id===p);t&&!v9(t.config,h)&&nn({...t,config:h});let n=d.find(t=>t.id===e);n&&(m(e),g(y9(n.config,l)),w(new Set),S(``),A(null),gt(FGe),qd({id:Jd(`view`),type:`view_select`,viewId:e}),Vd(Bd))},[d,p,h,nn,l]),R=(0,L.useCallback)((e,t,n)=>{let r=td(e,d.map(e=>e.name)),i={...h,display:od({...h.display??{},mode:t})},a={id:BGe(),name:r,kind:`custom`,config:i,permissions:n};nn(a),m(a.id),g(i),b(`saved`)},[h,nn,d]),on=(0,L.useCallback)((e,t)=>{let n=d.find(t=>t.id===e);if(n){let r=td(t,d.filter(t=>t.id!==e).map(e=>e.name));nn({...n,name:r})}},[d,nn]),sn=(0,L.useCallback)((e,t)=>{let n=d.find(t=>t.id===e);!n||!Ed(n,it)||nn({...n,locked:t})},[d,nn,it]),cn=(0,L.useCallback)((e,t)=>{let n=d.find(t=>t.id===e);n&&nn({...n,note:t.slice(0,2e3)})},[d,nn]),ln=(0,L.useCallback)(e=>{let t=d.find(t=>t.id===e);if(!t)return;let n={...t,id:BGe(),name:td(`${t.name} copy`,d.map(e=>e.name)),kind:`custom`,locked:!1,permissions:{edit:`personal`},createdBy:void 0,config:{...t.config}};nn(n),m(n.id),g(n.config)},[d,nn]),un=(0,L.useCallback)(e=>{let t=d.find(t=>t.id===e);if(!(!t||Cd(t)||!Od(t,it))&&(f(t=>t.filter(t=>t.id!==e)),qd({id:Jd(`view-delete`),type:`view_delete`,viewId:e}),p===e)){let e=d.find(e=>e.id===h9)??LGe(l);m(e.id),g(e.config)}},[d,p,l,it]);(0,L.useEffect)(()=>{if(!ut||!_||!ae)return;let e=`cohort:${ae}`;if(p===e)return;let t=d.find(e=>e.id===p);t&&!v9(t.config,h)&&nn({...t,config:h});let n=d.find(t=>t.id===e),r=n??{id:e,name:tt.find(e=>e.id===ae)?.name??`Cohort`,kind:`custom`,config:Hf(l)};n||f(e=>[...e,r]),m(e),g(y9(r.config,l)),w(new Set),S(``)},[ut,_,ae,p,d,h,l,tt,nn]);let dn=(0,L.useCallback)((e,t,n)=>{if(Ge)return;let r=d.find(t=>t.id===e);if(!r||$f(r.config.filters,Ze)>0)return;let{visibleRows:i}=rp({rawRows:lt,fields:l,filters:r.config.filters,search:``,sorts:r.config.sorts,groupBy:null,collapsed:new Set,memberPids:r.config.memberPids,filterConj:r.config.filterConj??`and`,measureSets:Ze,cohortSets:nt,today:rt}),a=i.filter(e=>e.kind===`data`).map(e=>e.record.pid);qd({id:Jd(`addlist`),type:`add_to_list`,viewId:e,cohortId:t,name:n,pids:a})},[d,lt,l,Ge,Ze,nt,rt]),[fn,pn]=(0,L.useState)({}),[z,mn]=(0,L.useState)([]),hn=i?.workspace?.folders,gn=(0,L.useMemo)(()=>MUe(hn,z,fn,Date.now()),[hn,z,fn]),_n=(0,L.useCallback)(e=>NUe(e,d.find(t=>t.id===e)?.folderId??null,gn,fn,Date.now()),[d,gn,fn]),vn=(0,L.useCallback)(e=>{pn(t=>jUe(e(t),Date.now()))},[]),yn=(0,L.useCallback)(e=>{let t=new Set,n=[],r=0;for(let i of d){if(_n(i.id)!==e)continue;if(Ge){n.push({name:i.name,why:`this table loads one page at a time`});continue}if($f(i.config.filters,Ze)>0){n.push({name:i.name,why:`a metric condition has no answer yet`});continue}r+=1;let{visibleRows:a}=rp({rawRows:lt,fields:l,filters:i.config.filters,search:``,sorts:i.config.sorts,groupBy:null,collapsed:new Set,memberPids:i.config.memberPids,filterConj:i.config.filterConj??`and`,measureSets:Ze,cohortSets:nt,today:rt});for(let e of a)e.kind===`data`&&t.add(e.record.pid)}return{pids:[...t],counted:r,skipped:n}},[d,_n,Ge,lt,l,Ze,nt,rt]),bn=(0,L.useCallback)((e,t,n)=>{let{pids:r}=yn(e);r.length&&qd({id:Jd(`addlist`),type:`add_to_list`,viewId:``,cohortId:t,name:n,pids:r})},[yn]),xn=(0,L.useCallback)((e,t,n,r)=>{if(Ge||$f(t.filters,Ze)>0)return;let{visibleRows:i}=rp({rawRows:n,fields:l,filters:t.filters,search:``,sorts:t.sorts,groupBy:null,collapsed:new Set,memberPids:t.memberPids,filterConj:t.filterConj??`and`,measureSets:Ze,cohortSets:nt,today:rt}),a=i.filter(e=>e.kind===`data`).map(e=>o[e.record.pid]?{...e.record,...o[e.record.pid]}:e.record),s=new Set(t.order),c=[...t.order,...l.map(e=>e.key).filter(e=>!s.has(e))],u=new Set(t.visible),d=c.filter(e=>u.has(e)).map(e=>Ie.get(e)).filter(e=>!!e);Jre(r,e,rt,d,a)},[Ge,l,Ie,Ze,nt,rt,o]),Sn=(0,L.useCallback)((e,t)=>{let n=d.find(t=>t.id===e);n&&xn(n.name,y9(n.config,l),lt,t)},[d,l,lt,xn]),Cn=(0,L.useCallback)((e,t)=>{let n=[...Tt];!n.length||Ge||(qd({id:Jd(`addlist`),type:`add_to_list`,viewId:p,cohortId:e,name:t,pids:n}),P(!1),F(``),At())},[Tt,Ge,p,At]),wn=i?.workspace?.scopeChoice===!0,Tn=h.cohortLock,En=(0,L.useMemo)(()=>{let e=Tn;if(!e)return;let t=tt.find(t=>t.id===e);return t?{name:t.name,count:t.pids?.length??0}:{}},[Tn,tt]),Dn=i?.workspace?.recordLayout?.order,On=(0,L.useCallback)(e=>{qd({id:Jd(`rlayout`),type:`record_layout`,order:e})},[]),kn=(0,L.useCallback)((e,t)=>{let n=Jd(`field`),r={...e,label:td(e.label,l.filter(t=>t.key!==e.key).map(e=>e.label)),editRequestId:n};delete r.labelCorrectedFrom,delete r.labelCorrectionId,Me(r.key),u(e=>e.some(e=>e.key===r.key)?e.map(e=>e.key===r.key?r:e):[...e,r]),qd({id:n,type:`field_upsert`,field:r,...t?{scope:t}:{}})},[Me,l]),An=(0,L.useCallback)((e,t,n,r,i,a,o)=>{let s=wn?o?.scope:void 0,c=s===`cohort`?{scope:`cohort`}:{};if(a){let i={key:`measure_${b9(e)}_${Math.random().toString(36).slice(2,7)}`,label:e,type:t,source:`odoo`,default:!0,custom:!0,derived:!0,filterable:!1,agg:[`currency`,`int`].includes(t)?`sum`:void 0,measure:a,...c};kn(i,s),We(i.key,n,r);return}let l={...WGe(e,t,i,o),...c};kn(l,s),We(l.key,n,r)},[We,kn,wn]),jn=(0,L.useCallback)((e,t)=>{if(e===ze||e===t||!Ie.has(t))return;let n=Le.filter(e=>e!==t),r=n.indexOf(e);if(r<0)return;n.splice(r,0,t);let i=new Set(Re);i.delete(e),i.add(t),Pe({...h,order:n,visible:[...i]})},[h,Pe,Le,Re,Ie,ze]),Mn=(0,L.useCallback)(e=>{if(!Ie.get(e)?.custom||e===ze)return;u(t=>t.filter(t=>t.key!==e));let t={...h.widths??{}};delete t[e],Pe({...h,order:Le.filter(t=>t!==e),visible:[...Re].filter(t=>t!==e),widths:t,sorts:(h.sorts??[]).filter(t=>t.colId!==e),groupBy:h.groupBy===e?null:h.groupBy,colorBy:h.colorBy===e?null:h.colorBy}),Ne(e),qd({id:Jd(`fielddel`),type:`field_delete`,key:e})},[h,Pe,Le,Re,Ie,ze,Ne]),Nn=(0,L.useCallback)((e,t,n,r,i)=>{let a=wn?i?.scope:void 0,o={...WGe(t,n,r,i),...a===`cohort`?{scope:`cohort`}:{}};kn(o,a),jn(e,o.key)},[kn,jn,wn]),Pn=(0,L.useCallback)((e,t,n,r)=>{let i=Ie.get(e);if(!i?.custom||i.source!==`overlay`||t===`formula`||t===`created_time`)return;let a=e=>e===`int`||e===`currency`,o=i.format&&(a(i.type)&&a(t)||i.type===t),s={key:e,label:r?.label?.trim()||i.label,type:t,source:`overlay`,default:i.default,custom:!0,agg:[`currency`,`int`].includes(t)?`sum`:void 0,...i.note?{note:i.note}:{},...i.description?{description:i.description}:{},...i.scope?{scope:i.scope}:{},...i.createdBy?{createdBy:i.createdBy}:{},...i.permissions?{permissions:i.permissions}:{},...o?{format:i.format}:{},...(t===`select`||t===`multiselect`)&&n?.length?{options:n}:{},...t===`select`||t===`multiselect`?{colorCodeOptions:r?.colorCodeOptions!==!1,...r?.optionColors&&Object.keys(r.optionColors).length?{optionColors:r.optionColors}:{}}:{},...t===`multiselect`?{multi:!0}:{},...t===`rating`?{max:r?.max??5}:{}};kn(s)},[Ie,kn]),Fn=(0,L.useCallback)(e=>{let t=e.key.startsWith(`measure_`)?`measure_`:`custom_`,n=td(`${e.label} copy`,l.map(e=>e.label)),r=`${t}${b9(n)}_${Math.random().toString(36).slice(2,7)}`,i=Jd(`fielddup`),a={...e,key:r,label:n,editRequestId:i};delete a.createdBy,delete a.permissions,delete a.labelCorrectedFrom,delete a.labelCorrectionId,Me(r),u(e=>[...e,a]),qd({id:i,type:`field_duplicate`,sourceKey:e.key,key:r,label:n,...wn&&e.scope===`cohort`?{scope:`cohort`}:{}}),We(r,e.key,`right`)},[We,wn,Me,l]),In=(0,L.useCallback)((e,t)=>{let n=Ie.get(e);if(!n?.measure)return;let r=Ye.find(e=>e.key===n.measure?.key),i=r?`${r.label} · ${Zu(n.measure.window)}`:null,a=r&&i&&n.label===i?`${r.label} · ${Zu(t)}`:n.label;kn({...n,label:a,measure:{...n.measure,window:t}})},[Ie,Ye,kn]),Ln=(0,L.useCallback)(()=>{if(!ae)return;let e=[...Tt].filter(e=>ft.has(e));e.length&&(qd({id:Jd(`cohortrm`),type:`cohort_remove`,cohortId:ae,pids:e}),At())},[ae,Tt,ft,At]),Rn=(0,L.useCallback)(()=>{!ae||de.size===0||(qd({id:Jd(`cohortadd`),type:`cohort_add`,cohortId:ae,pids:[...de]}),fe(new Set),ue(``),ce(!1))},[ae,de]),zn=(0,L.useMemo)(()=>{if(!se)return[];let e=le.trim().toLowerCase(),t=[];for(let n of r){if(ft.has(n.pid))continue;let r=String(n[ze]??``);e&&!r.toLowerCase().includes(e)||t.push({pid:n.pid,name:r})}return t},[se,le,r,ft,ze]),Bn=(0,L.useMemo)(()=>Le.filter(e=>Re.has(e)),[Le,Re]),Vn=MGe(h),Hn=(0,L.useCallback)(e=>{let t=Bn.indexOf(e);if(t<0)return;if(t<8){Pe({...h,frozenCount:sd(t+1)});return}let n=Bn.filter(t=>t!==e);n.splice(7,0,e);let r=0,i=Le.map(e=>Re.has(e)?n[r++]:e);Pe({...h,order:i,frozenCount:8})},[Bn,Le,Re,h,Pe]),Un=(0,L.useCallback)(()=>Pe({...h,frozenCount:void 0}),[h,Pe]),Wn=(0,L.useCallback)(e=>{let t=d.find(e=>e.id===p);if(t&&Td(t))return;let n=od(h.display);if(e===`grid`){Pe({...h,display:n?od({...n,mode:`grid`}):void 0});return}Pe({...h,display:{...n??{},mode:e}})},[h,Pe,d,p]),Gn=(0,L.useCallback)((e,t)=>{let n=od(h.display);if(!n)return;let r={...n,[e]:t};t||delete r[e],Pe({...h,display:r})},[h,Pe]),Kn=(0,L.useCallback)(e=>{let t=od(h.display);if(!t)return;let n={...t};e===!1?n.kanbanClamp=!1:delete n.kanbanClamp,Pe({...h,display:n})},[h,Pe]),qn=(0,L.useCallback)(e=>{let t=od(h.display);if(!t)return;let n={...t},r=e.slice(0,4);r.length?n.calendarMetrics=r:delete n.calendarMetrics,Pe({...h,display:n})},[h,Pe]),Jn=(0,L.useCallback)(e=>{let t=od(h.display);if(!t)return;let n={...t};e===`summary`?n.calendarMode=`summary`:delete n.calendarMode,Pe({...h,display:n})},[h,Pe]),Yn=(0,L.useMemo)(()=>l.filter(e=>ld(e.type)),[l]),Xn=(0,L.useMemo)(()=>l.filter(e=>e.type===`status`||e.type===`select`),[l]),Zn=(e,t,n)=>(e?t.find(t=>t.key===e):void 0)||((n?t.find(e=>e.key===n):void 0)??t[0]),Qn=(0,L.useMemo)(()=>_We(qe?.charts)??[],[qe?.charts]),$n=(0,L.useCallback)(e=>{let t=od(h.display);if(!t)return;let n={...t,charts:e};e.length||delete n.charts,Pe({...h,display:n})},[h,Pe]),er=(0,L.useMemo)(()=>l.filter(e=>e.type===`status`||e.type===`select`),[l]),tr=(0,L.useMemo)(()=>l.filter(e=>cd(e.type)),[l]),nr=qe?.colorField?er.find(e=>e.key===qe.colorField):void 0,rr=qe?.sizeField?tr.find(e=>e.key===qe.sizeField):void 0,ir=Zn(qe?.dateField,Yn,`last_order`),ar=Zn(qe?.stackField,Xn),or=(0,L.useMemo)(()=>{if(Je!==`calendar`&&Je!==`kanban`&&Je!==`map`&&Je!==`chart`&&Je!==`timeseries`)return[];let e=new Set,t=[];for(let n of pt){if(n.kind!==`data`||e.has(n.record.pid))continue;e.add(n.record.pid);let r=o[n.record.pid];t.push(r?{...n.record,...r}:n.record)}return t},[Je,pt,o]),sr=(0,L.useMemo)(()=>ar?Bn.filter(e=>e!==ze&&e!==ar.key).slice(0,3):[],[Bn,ze,ar]),cr=(0,L.useCallback)((e,t)=>{ar&&c(e,{[ar.key]:t})},[ar,c]),lr=(0,L.useCallback)(e=>{w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ur=(0,L.useMemo)(()=>Je===`timeseries`?or.map(e=>e.pid):[],[Je,or]),dr=(0,L.useCallback)(e=>{let t=od(h.display)??{mode:`timeseries`};Pe({...h,display:{...t,...e}})},[h,Pe]),fr=!!ar&&ar.type===`select`&&at(ar),pr=ar?ar.type===`status`?`Stacked by ${ar.label} — read-only, computed from the source system.`:at(ar)?null:`You do not have permission to edit this field, so cards cannot be moved.`:null;if(a||!_)return(0,B.jsx)(`div`,{className:`cg-loading`,children:(0,B.jsx)(`span`,{className:`lp-spin lp-spin--lg`,role:`status`,"aria-label":`Loading`})});let mr=d.find(e=>e.id===p),hr=ut?(0,B.jsx)(`button`,{type:`button`,className:`cg-tb-btn cg-tb-addcust`,ref:pe,disabled:!ae,onClick:()=>ce(e=>!e),"aria-expanded":se,"aria-haspopup":`dialog`,children:`+ Add customers`}):void 0,gr=new Set(l.filter(e=>e.custom&&e.key!==ze).map(e=>e.key)),_r=j?Ie.get(j.fieldKey):void 0,vr=_r?h.sorts.find(e=>e.colId===_r.key)?.dir??null:null,yr=_r?HGe(h.filters,_r.key):!1,br=_r?Bn.indexOf(_r.key):-1,xr=br>=0&&Vn>1&&br+1===Vn,Sr=Ge?void 0:(0,B.jsx)(bWe,{mode:Je,onMode:Wn,locked:!!mr&&Td(mr),dateField:ir,dateChoices:Yn,stackField:ar,stackChoices:Xn,colorField:nr,colorChoices:er,sizeField:rr,sizeChoices:tr,onPickField:Gn,clamped:qe?.kanbanClamp!==!1,onClamp:Kn,calendarMode:qe?.calendarMode??`records`,onCalendarMode:Jn,calendarMetrics:qe?.calendarMetrics,metricChoices:tr,onCalendarMetrics:qn}),Cr=ee?Ie.get(ee.fieldKey):void 0,wr=Cr?Cr.type===`user`?i?.userOptions??[]:nd(Cr):[],Tr=ee?r.find(e=>e.pid===ee.pid):void 0,Er=String((ee&&o[ee.pid]?.[ee.fieldKey])??(Cr&&Tr?Tr[Cr.key]:``)??``),Dr=Cr?.type===`multiselect`,Or=Dr?VGe(Er):[],kr=wr.length?Dr?Or.find(e=>wr.includes(e))??wr[0]:wr.includes(Er)?Er:wr[0]:null;return(0,B.jsxs)(`div`,{className:`cg-shell`,"data-today":rt??``,"data-measure-rules":$e,"data-measure-sets":et,children:[!Ke&&(0,B.jsx)(IUe,{onCohortLock:rn,views:d,activeViewId:p,saveState:y,onSelect:an,onCreate:R,onRename:on,onNote:cn,onDuplicate:ln,onDelete:un,lists:tt,onAddToList:Ge?void 0:dn,today:rt,onExport:Ge?void 0:Sn,folders:gn,folderIdOf:_n,onFolderCreate:(e,t)=>{let n=FUe();mn(r=>[...r.slice(-31),{id:n,name:e,order:9999,icon:t}]),vn(e=>({...e,created:{...e.created,[n]:Date.now()}})),qd({id:Jd(`foldnew`),type:`folder_create`,surface:`views`,folderId:n,name:e,icon:t})},onFolderRename:(e,t)=>{vn(n=>({...n,renamed:{...n.renamed,[e]:{at:Date.now(),name:t}}})),qd({id:Jd(`foldren`),type:`folder_rename`,surface:`views`,folderId:e,name:t})},onFolderDelete:e=>{vn(t=>({...t,deleted:{...t.deleted,[e]:Date.now()}})),qd({id:Jd(`folddel`),type:`folder_delete`,surface:`views`,folderId:e})},onFolderDuplicate:e=>{let t=FUe(),n=gn.find(t=>t.id===e);mn(e=>[...e.slice(-31),{id:t,name:`${n?.name??`Folder`} copy`,order:9999}]),vn(e=>({...e,created:{...e.created,[t]:Date.now()}})),qd({id:Jd(`folddup`),type:`folder_duplicate`,surface:`views`,folderId:e,newId:t})},onItemMove:(e,t)=>{vn(n=>({...n,moved:{...n.moved,[e]:{at:Date.now(),folderId:t}}})),qd({id:Jd(`itemmove`),type:`item_move`,surface:`views`,itemId:e,folderId:t})},folderAddPreview:Ge?void 0:yn,onFolderAddToList:Ge?void 0:bn,viewer:it,onToggleLock:sn,userOptions:i?.userOptions}),(0,B.jsxs)(`main`,{className:`cg-main`,children:[(0,B.jsx)(Tre,{nouns:t.nouns,cohortLock:En,copyViews:d.filter(e=>e.id!==p),onCopyConfig:e=>Pe({...h,...e}),fields:l,visible:Re,lockedKey:ze,onColumnVisible:Ue,onColumnsVisible:e=>Pe({...h,visible:[...new Set([ze,...e])]}),orderedFields:jt,onFieldOrder:e=>Pe({...h,order:e}),deletableKeys:gr,onDeleteField:Mn,colorOn:h.colorBy!==null,onToggleColor:e=>Pe({...h,colorBy:e?l.find(e=>e.type===`status`)?.key??null:null}),rowHeightMode:h.rowHeightMode,onRowHeightMode:e=>Pe({...h,rowHeightMode:e}),filters:h.filters,onFilters:e=>Pe({...h,filters:e}),filterConj:h.filterConj??`and`,onFilterConj:e=>Pe({...h,filterConj:e}),sorts:h.sorts,onSorts:e=>Pe({...h,sorts:e}),groupBy:Ge?null:h.groupBy,onGroupBy:e=>Pe({...h,groupBy:e}),statusValues:Nt,measures:Ye,unresolvedCount:ot,lists:tt,pendingMeasureCount:Qe,search:x,onSearch:S,recordCount:Ft,scopeCounts:i?.counts,pool:i?.workspace?.pool,serverWindowed:Ge,cohortAction:hr,filterSeed:me,modeControl:Sr}),(0,B.jsxs)(`div`,{className:`cg-grid-box`,ref:De,onMouseLeave:()=>O(e=>e===null?e:null),children:[Je===`grid`&&(0,B.jsx)(lee,{ref:Ee,columns:Fe,getCellContent:Ct,rows:vt.length,theme:jf,freezeColumns:Vn,rowHeight:zt,headerHeight:36,rowMarkers:`both`,gridSelection:wt,onGridSelectionChange:Et,getRowThemeOverride:Lt,onItemHovered:Rt,onCellClicked:Jt,onCellActivated:Yt,onCellEdited:Xt,onPaste:Qt,validateCell:Zt,onColumnResize:Be,onColumnMoved:Ve,onColumnProposeMove:He,drawHeader:qt,onHeaderMenuClick:(e,t)=>$t(e,t),onHeaderClicked:en,onHeaderContextMenu:en,onKeyDown:tn,maxColumnWidth:600,getCellsForSelection:!0,rowSelectionMode:`multi`,smoothScrollX:!0,smoothScrollY:!0,width:ke.width,height:ke.height,customRenderers:[Pne,Nne],headerIcons:Vte,rightElement:(0,B.jsx)(`button`,{type:`button`,className:`cg-add-field-btn`,"aria-label":`Add field`,title:`Add a field`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();_e({left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height})},children:`+`}),rightElementProps:{sticky:!0,fill:!1}}),Je===`list`&&(0,B.jsx)(xWe,{rows:vt,fieldByKey:Ie,visibleKeys:Bn,titleKey:ze,onOpen:A,onToggleGroup:lr}),Je===`calendar`&&(ir?(0,B.jsx)(wWe,{rows:or,field:ir,today:rt,titleKey:ze,mode:qe?.calendarMode??`records`,metrics:qe?.calendarMetrics,fieldByKey:Ie,scope:e,onOpen:A}):(0,B.jsx)(`div`,{className:`cg-mode-empty`,children:`This table has no date field to place records by.`})),Je===`kanban`&&(ar?(0,B.jsx)(TWe,{rows:or,field:ar,fieldByKey:Ie,cardKeys:sr,titleKey:ze,canMove:fr,readOnlyReason:pr,clamped:qe?.kanbanClamp!==!1,onMove:cr,onOpen:A}):(0,B.jsx)(`div`,{className:`cg-mode-empty`,children:`This table has no status or single-select field to stack by.`})),Je===`chart`&&(0,B.jsx)(WWe,{rows:or,fields:l,fieldByKey:Ie,charts:Qn,onCharts:$n}),Je===`timeseries`&&(0,B.jsx)(oUe,{scope:e,pids:ur,fields:l,rows:or,display:qe,onDisplay:dr}),Je===`map`&&Ie.get(ze)&&(0,B.jsx)(SGe,{rows:or,field:Ie.get(ze),colorField:nr,sizeField:rr,selectedPids:Tt,onSelectPids:Dt,onOpen:A}),Je===`grid`&&D&&(0,B.jsx)(`button`,{type:`button`,className:`cg-row-expand`,style:{left:D.x,top:D.y,width:D.size,height:D.size},title:`Expand record`,"aria-label":`Expand record`,onMouseDown:e=>e.preventDefault(),onClick:()=>A(D.pid),children:(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`13`,height:`13`,"aria-hidden":!0,focusable:`false`,children:(0,B.jsx)(`path`,{d:`M9.5 2.5H13.5V6.5M6.5 13.5H2.5V9.5M13.5 2.5L9 7M2.5 13.5L7 9`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),ye&&(0,B.jsx)(`div`,{className:`cg-header-tip`,style:{left:ye.x,top:ye.y},"aria-hidden":!0,children:ye.text}),xe&&(0,B.jsx)(`div`,{className:`cg-header-tip cg-cell-tip`,style:{left:xe.x,top:xe.y},"aria-hidden":!0,children:xe.text}),Tt.size>0&&!Ge&&(Je===`grid`||Je===`map`)&&(0,B.jsxs)(`div`,{className:`cg-selbar`,children:[(0,B.jsxs)(`span`,{className:`cg-selbar-count`,children:[Tt.size.toLocaleString(),` selected`]}),ut?(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--danger cg-selbar-remove`,style:m9,onClick:Ln,children:`Remove from cohort`}):(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary cg-selbar-add`,style:m9,ref:ie,onClick:()=>{if(!ne){let e=mr?.name??`Customers`;F(rt?`${e} · ${rt}`:e)}P(!ne)},"aria-expanded":ne,"aria-haspopup":`dialog`,children:`Add to cohort`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,style:m9,onClick:At,children:`Clear`})]})]}),_t&&(Je===`grid`||Je===`list`)&&(0,B.jsxs)(`div`,{className:`cg-more`,children:[(0,B.jsxs)(`span`,{className:`cg-more-note`,children:[`Showing first `,It.toLocaleString(),` of`,` `,Ft.toLocaleString()]}),(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>gt(e=>e+IGe),children:`See more`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-link-btn`,onClick:()=>gt(pt.length),children:`Show all`})]})]}),_r&&j&&(0,B.jsx)(iWe,{state:j,field:_r,fields:l,locked:_r.key===ze,viewer:it,sortedDir:vr,isFiltered:yr,isGrouped:h.groupBy===_r.key,groupable:Cee(_r,ze),onClose:()=>M(null),onNote:e=>kn({..._r,note:e}),onHide:()=>{Ue(_r.key,!1),M(null)},onCreate:An,onChangeField:e=>jn(_r.key,e),onCreateAndSwap:(e,t,n,r)=>Nn(_r.key,e,t,n,r),onRetype:_r.custom&&_r.source===`overlay`?(e,t,n)=>Pn(_r.key,e,t,n):void 0,onRename:_r.custom?e=>kn({..._r,label:e}):void 0,onFormula:_r.custom&&_r.type===`formula`?(e,t)=>kn({..._r,formula:e,...t?{label:t}:{}}):void 0,onPeriod:_r.measure?e=>In(_r.key,e):void 0,onDelete:_r.custom&&_r.key!==ze?()=>{Mn(_r.key),M(null)}:void 0,onDuplicate:_r.custom?()=>Fn(_r):void 0,onPermissions:_r.custom?e=>kn({..._r,permissions:{edit:e}}):void 0,onFormat:e=>kn({..._r,format:e}),onSort:e=>Pe({...h,sorts:[{colId:_r.key,dir:e}]}),onClearSort:()=>Pe({...h,sorts:h.sorts.filter(e=>e.colId!==_r.key)}),onFilterBy:()=>he(e=>({n:(e?.n??0)+1,..._r.measure?{measure:{key:_r.measure.key,window:_r.measure.window}}:{key:_r.key}})),pinnedTo:xr,onPinTo:br>0&&!xr?()=>Hn(_r.key):void 0,onUnpin:Vn>1?Un:void 0,scopeChoice:wn,onClearFilter:()=>Pe({...h,filters:UGe(h.filters,_r.key)}),onGroupByField:()=>Pe({...h,groupBy:_r.key}),onClearGroup:()=>Pe({...h,groupBy:null}),userOptions:i?.userOptions??[],measures:Ye},_r.key),ge&&Ie.get(ze)&&(0,B.jsx)(iWe,{state:{fieldKey:ze,anchor:ge},field:Ie.get(ze),fields:l,locked:!0,viewer:it,sortedDir:null,isFiltered:!1,isGrouped:!1,groupable:!1,initialPosition:`end`,onClose:()=>_e(null),onNote:()=>void 0,onHide:()=>void 0,onCreate:An,onChangeField:()=>void 0,onCreateAndSwap:()=>void 0,onSort:()=>void 0,onClearSort:()=>void 0,onFilterBy:()=>void 0,onClearFilter:()=>void 0,onGroupByField:()=>void 0,onClearGroup:()=>void 0,scopeChoice:wn,userOptions:i?.userOptions??[],measures:Ye},`__add-at-end__`),ne&&ie.current&&Tt.size>0&&(0,B.jsxs)(Np,{anchor:ie.current,className:`cg-pop cg-add-list-pop`,placement:`bottom-start`,role:`dialog`,ariaLabel:`Add selected customers to a locked view`,onDismiss:()=>P(!1),dataKind:`selection-add-to-list`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Add to locked view`}),(0,B.jsxs)(`div`,{className:`cg-pop-note`,children:[`Adds the `,Tt.size.toLocaleString(),` checked customer`,Tt.size===1?``:`s`,`. The cohort stays fixed as the data changes.`]}),tt.map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-pick-row`,onClick:()=>Cn(e.id,e.name),children:e.name},e.id)),(0,B.jsxs)(`div`,{className:`cg-view-create`,children:[(0,B.jsx)(`label`,{htmlFor:`cg-sel-new-list`,children:`Lock records into a new view`}),(0,B.jsx)(`input`,{id:`cg-sel-new-list`,className:`cg-input`,"data-overlay-autofocus":!0,value:re,placeholder:`e.g. Q3 call plan`,onChange:e=>F(e.target.value),onKeyDown:e=>{e.key===`Enter`&&re.trim()&&Cn(``,re.trim())}}),(0,B.jsx)(`div`,{className:`cg-form-actions`,children:(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,style:m9,disabled:!re.trim(),onClick:()=>Cn(``,re.trim()),children:`Create and add`})})]})]}),ut&&se&&pe.current&&ae&&(0,B.jsxs)(Np,{anchor:pe.current,className:`cg-pop cg-addcust-pop`,placement:`bottom-start`,role:`dialog`,ariaLabel:`Add customers to this locked view`,onDismiss:()=>ce(!1),dataKind:`cohort-add-customers`,children:[(0,B.jsx)(`div`,{className:`cg-pop-title`,children:`Add customers`}),(0,B.jsxs)(`div`,{className:`cg-pop-note`,children:[`Search your customer pool and tick who to add to`,` `,(0,B.jsx)(`strong`,{children:dt?.name??`this locked view`}),`.`]}),(0,B.jsx)(`input`,{type:`text`,className:`cg-input cg-addcust-search`,"data-overlay-autofocus":!0,placeholder:`Search customers…`,"aria-label":`Search customers`,value:le,onChange:e=>ue(e.target.value)}),(0,B.jsxs)(`div`,{className:`cg-pick-list cg-addcust-list`,children:[zn.slice(0,50).map(e=>(0,B.jsxs)(`label`,{className:`cg-check-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:de.has(e.pid),onChange:()=>fe(t=>{let n=new Set(t);return n.has(e.pid)?n.delete(e.pid):n.add(e.pid),n})}),(0,B.jsx)(`span`,{className:`cg-check-label`,children:e.name})]},e.pid)),zn.length===0&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:le.trim()?`No customer outside this locked view matches your search.`:`Every customer in your pool is already in this locked view.`})]}),zn.length>50&&(0,B.jsxs)(`div`,{className:`cg-field-hint`,children:[`Showing the first 50 of `,zn.length.toLocaleString(),` matches — keep typing to narrow.`]}),(0,B.jsxs)(`div`,{className:`cg-form-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`cg-btn cg-btn--primary`,style:m9,disabled:de.size===0,onClick:Rn,children:de.size===0?`Add customers`:`Add ${de.size.toLocaleString()} customer${de.size===1?``:`s`}`}),(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,style:m9,onClick:()=>ce(!1),children:`Cancel`})]})]}),Cr&&ee&&(0,B.jsxs)(Np,{anchor:ee.anchor,className:`cg-pop cg-pick-pop`,placement:`bottom-start`,role:`listbox`,ariaLabel:`Choose ${Cr.label}`,onDismiss:te,dataKind:`cell-picker`,initialFocus:`[data-overlay-autofocus]`,onKeyDown:e=>{let t=e.key===`ArrowDown`||e.key===`ArrowRight`,n=e.key===`ArrowUp`||e.key===`ArrowLeft`;if(!t&&!n)return;let r=Array.from(e.currentTarget.querySelectorAll(`.cg-pick-row, .cg-star-btn`));if(!r.length)return;e.preventDefault();let i=r.indexOf(document.activeElement);r[t?(i+1)%r.length:(i-1+r.length)%r.length]?.focus()},children:[Cr.type===`rating`&&(0,B.jsx)(`div`,{className:`cg-stars`,role:`radiogroup`,"aria-label":`Set ${Cr.label}`,children:Array.from({length:rd(Cr)},(e,t)=>t+1).map(e=>(0,B.jsx)(`button`,{type:`button`,className:`cg-star-btn`,role:`radio`,"aria-checked":Number(Er)===e,"data-overlay-autofocus":Number(Er)===e||!Er&&e===1||void 0,"aria-label":`${e} star${e===1?``:`s`}`,onClick:()=>{c(ee.pid,{[Cr.key]:String(e)}),te()},children:(0,B.jsx)(bm,{on:Number(Er)>=e})},e))}),Cr.type!==`rating`&&wr.length===0&&(0,B.jsx)(`div`,{className:`cg-pop-note`,children:Cr.type===`user`?`No assignable people were supplied for this workspace.`:`This field has no choices yet. Add them from the column menu.`}),(0,B.jsx)(`div`,{className:`cg-pick-list`,"aria-multiselectable":Dr||void 0,children:wr.map(e=>{let t=fp(Cr,e),n=Dr?Or.includes(e):Er===e;return(0,B.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n,"data-overlay-autofocus":e===kr||void 0,className:`cg-pick-row`+(n?` is-on`:``),onClick:()=>{if(Dr){let t=n?Or.filter(t=>t!==e):[...Or,e];c(ee.pid,{[Cr.key]:t.join(`,`)});return}c(ee.pid,{[Cr.key]:e}),te()},children:[Cr.type===`user`&&(0,B.jsxs)(`span`,{className:`cg-pick-avatar`,"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flex:`0 0 auto`,width:20,height:20,borderRadius:`50%`,overflow:`hidden`,marginRight:8,fontSize:9,fontWeight:600,lineHeight:1,position:`relative`,background:lp(e).bg,color:lp(e).fg},children:[mp(e),St?.[e]&&(0,B.jsx)(`img`,{src:St[e],alt:``,onError:e=>{e.currentTarget.style.visibility=`hidden`},style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,objectFit:`cover`}})]}),(0,B.jsx)(`span`,{className:`cg-pick-pill`,style:t?{background:t.bg,color:t.fg}:void 0,children:e})]},e)})}),Dr&&(0,B.jsx)(`div`,{className:`cg-form-actions`,children:(0,B.jsx)(`button`,{type:`button`,className:`cg-btn`,style:m9,onClick:te,children:`Done`})}),Er!==``&&(0,B.jsx)(`button`,{type:`button`,className:`cg-pick-row cg-pick-clear`,"data-overlay-autofocus":wr.length===0||void 0,onClick:()=>{c(ee.pid,{[Cr.key]:``}),te()},children:`Clear`})]}),Ut&&k!==null&&(0,B.jsx)(AUe,{fields:l,record:Ut,titleKey:ze,positionLabel:`Record ${Wt.toLocaleString()} of ${Ft.toLocaleString()}`,canPrev:Gt(-1),canNext:Gt(1),onPrev:()=>Kt(-1),onNext:()=>Kt(1),onClose:()=>A(null),recordLayout:Dn,onRecordLayout:On,scope:e,docs:i?.docs?.[String(k)]??[],docPayload:i?.docPayload,onDocAdd:i?.docs?e=>qd({id:Jd(`docadd`),type:`doc_add`,pid:k,docId:`doc_${Jd(`d`).slice(2,14).replace(/[^a-z0-9]/gi,``)}`,...e}):void 0,onDocFetch:i?.docs?e=>qd({id:Jd(`docget`),type:`doc_fetch`,pid:k,docId:e}):void 0,onDocDelete:i?.docs?e=>qd({id:Jd(`docdel`),type:`doc_delete`,pid:k,docId:e}):void 0,onNotesChange:(e,t)=>s(n=>({...n,[k]:{...n[k],[e]:t}})),onNotesCommit:(e,t)=>c(k,{[e]:t}),viewer:it,userOptions:i?.userOptions??[],userAvatars:St})]})}var KGe=(0,L.memo)(GGe);function x9(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:null}function S9(e,t){let n=x9(e);if(n==null)return`—`;let r=t??+(Math.abs(n)<10&&!Number.isInteger(n));return n.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:r})}function qGe(e,t){let n=x9(e);return n==null?`—`:n<0?`-$${S9(Math.abs(n),t)}`:`$${S9(n,t)}`}function C9(e){let t=x9(e);return t==null?`—`:Math.round(t).toLocaleString()}function JGe(e,t={}){let n=x9(e);return n==null?`—`:n>=999?`+${(1+n/100).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}×`:`${t.signed&&n>=0?`+`:``}${S9(n,t.dp)}%`}var YGe=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function XGe(e){if(e==null||e===``)return`—`;let t=String(e),n=/^(\d{4})-(\d{2})$/.exec(t);if(n){let e=Number(n[2]);if(e>=1&&e<=12)return`${YGe[e-1]} ${n[1].slice(2)}`}let r=t.includes(` `)?t.replace(` `,`T`):t,i=/T\d{2}:\d{2}/.test(r)&&!/(?:[zZ]|[+-]\d{2}:?\d{2})$/.test(r)?`${r}Z`:r,a=new Date(i);return Number.isNaN(a.getTime())?t:a.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`,timeZone:`UTC`})}var w9={money:qGe,num:S9,pct:JGe,int:C9,date:XGe};function T9(e,t,n){if(t==null||t===``)return e==null||e===``?`—`:String(e);switch(t){case`money`:return qGe(e);case`num`:return S9(e);case`pct`:return JGe(e,n);case`int`:return C9(e);case`date`:return XGe(e);default:return e==null||e===``?`—`:String(e)}}function ZGe(e){return!!e&&e.kind===`decomp`}function QGe(e,t){return typeof e!=`number`||typeof t!=`number`||!Number.isFinite(e)||!Number.isFinite(t)?null:{text:`Showing ${C9(e)} of ${C9(t)}`,capped:t>e}}function $Ge(e,t){if(!t)return;if(ZGe(t)){let n=e[t.row_key];if(!n||typeof n!=`object`)return;let r=n;return r.kind!==`decomp`||!r.date_from||!r.date_to?void 0:r}let n=e[t.id_key];if(n==null||n===``)return;let r=t.label_key?e[t.label_key]:void 0;return{kind:t.kind,id:n,label:String(r??n)}}function eKe(e){return(e??``).trim()||`Nothing matched this scope.`}function E9({d:e,size:t,className:n}){return(0,B.jsx)(`svg`,{className:n,width:t,height:t,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,B.jsx)(`path`,{d:e,fill:`currentColor`})})}function tKe({size:e=15}){return(0,B.jsx)(E9,{className:`pg-icon`,size:e,d:`M12 15.6 6.8 10.4l1.4-1.4 2.8 2.8V3h2v8.8l2.8-2.8 1.4 1.4zM5 20a2 2 0 0 1-2-2v-3h2v3h14v-3h2v3a2 2 0 0 1-2 2z`})}function nKe({size:e=14}){return(0,B.jsx)(E9,{className:`pg-icon`,size:e,d:`M9.6 17.6 4 12l1.4-1.4 4.2 4.2 9-9L20 7.2z`})}function rKe({size:e=14}){return(0,B.jsx)(E9,{className:`pg-icon`,size:e,d:`M11 15h2v2h-2zm0-10h2v8h-2z`})}function iKe({title:e,asOf:t,subtitle:n,controls:r,onControl:i,busy:a}){return(0,B.jsxs)(`header`,{className:`pg-header`,children:[(0,B.jsxs)(`div`,{className:`pg-title-row`,children:[(0,B.jsx)(`h1`,{className:`pg-title`,children:e}),r&&r.length>0?(0,B.jsx)(`div`,{className:`pg-controls`,children:r.map(e=>(0,B.jsxs)(`label`,{className:`pg-control`,children:[(0,B.jsx)(`span`,{className:`pg-control-label`,children:e.label}),(0,B.jsx)(`select`,{className:`pg-select`,value:String(e.value),disabled:a||!i,onChange:t=>i?.(e.key,t.target.value),children:e.options.map(e=>(0,B.jsx)(`option`,{value:String(e.value),children:e.label},String(e.value)))})]},e.key))}):null]}),(0,B.jsx)(`div`,{className:`pg-rule`}),n?(0,B.jsx)(`p`,{className:`pg-subtitle`,children:n}):null,t?(0,B.jsxs)(`p`,{className:`pg-asof`,children:[`Data pulled `,(0,B.jsx)(`time`,{dateTime:t,children:w9.date(t)})]}):null]})}function aKe({label:e,note:t,children:n}){return(0,B.jsxs)(`section`,{className:`pg-section`,children:[(0,B.jsx)(`h2`,{className:`pg-section-label`,children:e}),t?(0,B.jsx)(`p`,{className:`pg-section-note`,children:t}):null,n]})}function oKe({items:e,onOpen:t}){return e.length?(0,B.jsx)(`div`,{className:`pg-kpis`,children:e.map((e,n)=>{let r=T9(e.value,e.fmt),i=e.delta!=null,a=i?T9(e.delta,e.delta_fmt??`pct`,{signed:!0}):``,o=e.delta_dir??(i?`flat`:`off`),s=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`pg-kpi-label`,children:e.label}),(0,B.jsx)(`span`,{className:`pg-kpi-value`,children:r}),a||e.delta_label?(0,B.jsxs)(`span`,{className:`pg-kpi-delta is-${o}`,children:[a,a&&e.delta_label?` `:``,e.delta_label??``]}):null]}),c=e.key??`${e.label}-${n}`;return e.drill&&t?(0,B.jsx)(`button`,{type:`button`,className:`pg-kpi is-clickable`,onClick:()=>t(e.drill),children:s},c):(0,B.jsx)(`div`,{className:`pg-kpi`,children:s},c)})}):null}function sKe({rows:e,columns:t,filename:n,note:r}){return(0,B.jsxs)(`a`,{className:`pg-download`,href:(0,L.useMemo)(()=>{let n=e=>/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e,r=``+[t.map(e=>n(e.label)).join(`,`),...e.map(e=>t.map(t=>n(T9(e[t.key],t.fmt))).join(`,`))].join(`\r -`);return URL.createObjectURL(new Blob([r],{type:`text/csv;charset=utf-8`}))},[e,t]),download:`${n}.csv`,children:[(0,B.jsx)(tKe,{}),(0,B.jsx)(`span`,{children:`Download CSV`}),r?(0,B.jsx)(`span`,{className:`pg-download-note`,children:r}):null]})}function cKe({columns:e,rows:t,drill:n,shown:r,total:i,onOpen:a,empty:o,download:s}){let c=QGe(r,i),l=c?.capped??!1;return t.length?(0,B.jsxs)(`div`,{className:`pg-table-wrap`,children:[(0,B.jsxs)(`table`,{className:`pg-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:e.map(e=>(0,B.jsx)(`th`,{className:e.align===`right`?`is-right`:e.align===`center`?`is-center`:``,scope:`col`,children:e.label},e.key))})}),(0,B.jsx)(`tbody`,{children:t.map((t,r)=>{let i=$Ge(t,n);return(0,B.jsx)(`tr`,{className:i&&a?`is-clickable`:``,children:e.map((e,n)=>{let r=T9(t[e.key],e.fmt);return(0,B.jsx)(`td`,{className:e.align===`right`?`is-right`:e.align===`center`?`is-center`:``,children:n===0&&i&&a?(0,B.jsx)(`button`,{type:`button`,className:`pg-cell-link`,onClick:()=>a(i),children:r}):r},e.key)})},String(t[e[0]?.key]??r))})})]}),(0,B.jsxs)(`div`,{className:`pg-table-foot`,children:[c?(0,B.jsx)(`span`,{className:c.capped?`pg-shown is-capped`:`pg-shown`,children:c.text}):null,s?(0,B.jsx)(sKe,{rows:t,columns:e,filename:s.filename,note:l?`the rows shown`:void 0}):null]})]}):(0,B.jsx)(`p`,{className:`pg-empty`,children:eKe(o)})}function lKe({checks:e}){if(!e.length)return null;let t=e.filter(e=>!e.ok).length;return(0,B.jsxs)(`details`,{className:`pg-validation`,open:t>0,children:[(0,B.jsxs)(`summary`,{className:t?`is-failed`:`is-ok`,children:[t?(0,B.jsx)(rKe,{}):(0,B.jsx)(nKe,{}),(0,B.jsx)(`span`,{children:t?`${w9.int(t)} of ${w9.int(e.length)} reconciliation checks did not tie`:`All ${w9.int(e.length)} reconciliation checks tie to Odoo`})]}),(0,B.jsxs)(`table`,{className:`pg-table pg-validation-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{scope:`col`,children:`Check`}),(0,B.jsx)(`th`,{scope:`col`,className:`is-right`,children:`Expected`}),(0,B.jsx)(`th`,{scope:`col`,className:`is-right`,children:`Actual`}),(0,B.jsx)(`th`,{scope:`col`,children:`Note`})]})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsxs)(`tr`,{className:e.ok?``:`is-failed`,children:[(0,B.jsx)(`td`,{children:e.name}),(0,B.jsx)(`td`,{className:`is-right`,children:T9(e.expected,e.fmt)}),(0,B.jsx)(`td`,{className:`is-right`,children:T9(e.actual,e.fmt)}),(0,B.jsx)(`td`,{children:e.note??``})]},e.name))})]})]})}var uKe={customer:`Customer`,sku:`Product`,rep:`Salesperson`,bu:`Business Unit`};function D9({label:e,value:t}){return(0,B.jsxs)(`div`,{className:`pg-drill-row`,children:[(0,B.jsx)(`span`,{className:`pg-drill-key`,children:e}),(0,B.jsx)(`span`,{className:`pg-drill-val`,children:t})]})}function dKe({drill:e,onClose:t}){let n=e.kind===`decomp`,r=e,i=e;return(0,B.jsxs)(`aside`,{className:`pg-drill`,role:`dialog`,"aria-label":e.label,children:[(0,B.jsxs)(`header`,{className:`pg-drill-head`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`pg-drill-kind`,children:n?`Period`:uKe[e.kind]??e.kind}),(0,B.jsx)(`h2`,{className:`pg-drill-title`,children:e.label})]}),(0,B.jsx)(`button`,{type:`button`,className:`pg-drill-close`,onClick:t,"aria-label":`Close`,children:`×`})]}),(0,B.jsxs)(`div`,{className:`pg-drill-body`,children:[n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(D9,{label:`Window`,value:`${w9.date(r.date_from)} – ${w9.date(r.date_to)}`}),r.cmp_from&&r.cmp_to?(0,B.jsx)(D9,{label:`Compared with`,value:`${w9.date(r.cmp_from)} – ${w9.date(r.cmp_to)}`}):null,(0,B.jsx)(D9,{label:`Scope`,value:r.scope_value==null?r.scope_type:`${r.scope_type} · ${r.scope_value}`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(D9,{label:uKe[e.kind]??`Record`,value:i.label}),(0,B.jsx)(D9,{label:`Identifier`,value:String(i.id)})]}),(0,B.jsxs)(`p`,{className:`pg-drill-note`,children:[`This wave ships the drill as a complete `,(0,B.jsx)(`em`,{children:`declaration`}),`: the exact scope above is what the number was computed over, and you can check it. The row-level breakdown behind it opens in the next release — until then, use the same view in the current application.`]})]})]})}var fKe=new Set([`text`,`status`,`currency`,`int`,`date`,`pct`,`select`,`user`,`multiselect`,`checkbox`,`phone`,`email`,`url`,`rating`,`created_time`,`formula`]);function pKe(e){return e.map(e=>({key:e.key,label:e.label,type:fKe.has(e.type)?e.type:`text`,source:e.source===`overlay`?`overlay`:`odoo`}))}function mKe(e,t){if(!t||t.length===0)return e;let n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>(n.get(e.key)??2**53-1)-(n.get(t.key)??2**53-1))}var O9=720,k9=230,A9=52,j9=10,M9=12,hKe=34;function N9(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e9?(e/1e9).toFixed(1)+`B`:t>=1e6?(e/1e6).toFixed(1)+`M`:t>=1e3?(e/1e3).toFixed(1)+`k`:Number.isInteger(e)?e.toLocaleString():e.toFixed(2)}function gKe(e){let t=e>0?`+`:e<0?`−`:``,n=Math.abs(e);return n>=999?`${t}${Math.round(n/100)}×`:`${t}${n.toFixed(+(n<10))}%`}function _Ke({spec:e,series:t,fields:n,rows:r,xOrder:i,deltaByKey:a,onPick:o,pickable:s}){let c=(0,L.useMemo)(()=>pKe(n),[n]),l=(0,L.useMemo)(()=>new Map(c.map(e=>[e.key,e])),[c]),u=(0,L.useMemo)(()=>t.map(t=>({def:t,data:X7({...e,y:t.y},r,l)})),[t,e,r,l]),d=(0,L.useMemo)(()=>{let e=new Map;for(let t of u)for(let n of t.data.buckets)e.has(n.key)||e.set(n.key,n.label);return mKe([...e].map(([e,t])=>({key:e,label:t,value:0,n:0})),i)},[u,i]),f=u.find(e=>e.data.problem)?.data.problem;if(f)return(0,B.jsx)(`p`,{className:`pg-empty`,children:f});if(!d.length)return(0,B.jsx)(`p`,{className:`pg-empty`,children:`No periods in this scope yet, so there is nothing to plot.`});let p=u.map(e=>({def:e.def,data:e.data,lookup:new Map(e.data.buckets.map(e=>[e.key,e]))})),m=Math.max(0,...p.flatMap(e=>e.data.buckets.map(e=>e.value))),h=m>0?(k9-M9-hKe)/m:0,g=(O9-A9-j9)/d.length,_=Math.max(2,g*.72/Math.max(1,p.length)),v=Math.max(1,Math.ceil(d.length/12)),y=k9-hKe,b=p[0]?.data.rows??0,x=p.reduce((e,t)=>e+t.data.missingY,0),S=p[0]?.data.omitted??0,C=p[0]?.data.omittedValue??0;return(0,B.jsxs)(`div`,{className:`pg-charts`,children:[(0,B.jsx)(`div`,{className:`pg-legend`,children:p.map((e,t)=>(0,B.jsxs)(`span`,{className:`pg-legend-key`,children:[(0,B.jsx)(`span`,{className:`pg-legend-swatch pg-ser-${t%4}`}),e.def.label]},e.def.y))}),(0,B.jsxs)(`svg`,{className:`pg-chart-svg`,viewBox:`0 0 ${O9} ${k9}`,role:`img`,"aria-label":e.title??`Chart`,children:[(0,B.jsx)(`line`,{className:`pg-ax`,x1:A9,y1:y,x2:O9-j9,y2:y}),(0,B.jsx)(`line`,{className:`pg-ax pg-ax-soft`,x1:A9,y1:M9,x2:O9-j9,y2:M9}),(0,B.jsx)(`text`,{className:`pg-ax-lab`,x:A9-6,y:16,textAnchor:`end`,children:N9(m)}),(0,B.jsx)(`text`,{className:`pg-ax-lab`,x:A9-6,y,textAnchor:`end`,children:`0`}),d.map((e,t)=>{let n=A9+t*g,r=_*p.length,i=n+(g-r)/2;return(0,B.jsxs)(`g`,{children:[s&&o?(0,B.jsx)(`rect`,{className:`pg-slot`,x:n,y:M9,width:g,height:y-M9,onClick:()=>o(e.key),children:(0,B.jsx)(`title`,{children:`Open ${e.label}`})}):null,p.map((t,n)=>{let r=t.lookup.get(e.key)?.value??0,a=Math.max(+(r>0),r*h);return(0,B.jsx)(`rect`,{className:`pg-bar pg-ser-${n%4}`,x:i+n*_,y:y-a,width:Math.max(1,_-1.5),height:a,children:(0,B.jsx)(`title`,{children:`${e.label} · ${t.def.label}: ${N9(r)}`})},t.def.y)}),(()=>{let t=a?.get(e.key);if(t==null)return null;let r=Math.max(0,...p.map(t=>{let n=t.lookup.get(e.key)?.value??0;return Math.max(+(n>0),n*h)}));return(0,B.jsx)(`text`,{className:`pg-bar-delta ${t>0?`is-up`:t<0?`is-down`:``}`,x:n+g/2,y:Math.max(8,y-r-4),textAnchor:`middle`,children:gKe(t)})})(),t%v===0?(0,B.jsx)(`text`,{className:`pg-ax-lab`,x:n+g/2,y:210,textAnchor:`middle`,children:e.label}):null]},e.key||`(blank)-${t}`)})]}),(0,B.jsxs)(`p`,{className:`pg-chart-note`,children:[`${b.toLocaleString()} period${b===1?``:`s`} plotted`,S>0?` · ${S} more not drawn, worth ${N9(C)}`:``,x>0?` · ${x} value${x===1?``:`s`} the measure could not use`:``,s?` · click a period to decompose it`:``]})]})}function vKe(e){let t=[],n={body:[]};for(let r of e)r.type===`section`?((n.head||n.body.length)&&t.push(n),n={head:r,body:[]}):n.body.push(r);return(n.head||n.body.length)&&t.push(n),t}function yKe({block:e,onOpen:t}){let n=e.drill,r=new Map;if(ZGe(n)){let t=e.spec.x;for(let i of e.rows){let e=i[n.row_key],a=t?i[t]:void 0;a!=null&&e&&typeof e==`object`&&e.kind===`decomp`&&r.set(String(a),e)}}let i=new Map;if(e.delta_key){let t=e.spec.x;for(let n of e.rows){let r=t?n[t]:void 0,a=n[e.delta_key];r!=null&&typeof a==`number`&&Number.isFinite(a)&&i.set(String(r),a)}}let a=!!t&&r.size>0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_Ke,{spec:e.spec,series:e.series??[],fields:e.fields,rows:e.rows,xOrder:e.x_order,deltaByKey:i.size?i:void 0,pickable:a,onPick:e=>{let n=r.get(e);n&&t&&t(n)}}),e.shown!=null&&e.total!=null&&e.total>e.shown?(0,B.jsxs)(`p`,{className:`pg-shown is-capped`,children:[`Showing `,e.shown,` of `,e.total,` periods`]}):null]})}function bKe({block:e,onOpen:t}){switch(e.type){case`kpis`:return(0,B.jsx)(oKe,{items:e.items,onOpen:t});case`table`:{let n=e;return(0,B.jsx)(cKe,{columns:n.columns,rows:n.rows,drill:n.drill,shown:n.shown,total:n.total,empty:n.empty,download:n.download,onOpen:t})}case`chart`:return(0,B.jsx)(yKe,{block:e,onOpen:t});case`validation`:return(0,B.jsx)(lKe,{checks:e.checks});default:return null}}function xKe({page:e,onControl:t,onOpen:n,busy:r}){let i=vKe(e.blocks);return(0,B.jsxs)(`div`,{className:`pg-page`,children:[(0,B.jsx)(iKe,{title:e.title,asOf:e.as_of,subtitle:e.subtitle,controls:e.controls,onControl:t,busy:r}),i.map((e,t)=>e.head?(0,B.jsx)(aKe,{label:e.head.label,note:e.head.note,children:e.body.map((e,t)=>(0,B.jsx)(bKe,{block:e,onOpen:n},e.key??`b${t}`))},e.head.key??`s${t}`):(0,B.jsx)(`div`,{children:e.body.map((e,t)=>(0,B.jsx)(bKe,{block:e,onOpen:n},e.key??`b${t}`))},`g${t}`))]})}async function SKe(e){let t=``,n=``;try{let r=await e.json();t=String(r?.error?.code??``),n=String(r?.error?.message??``)}catch{}if(e.status>=500)return{ok:!1,status:e.status,code:t||`server_error`,message:`Something went wrong on our side. Try again in a moment.`};let r=e.status===401?`Your session has ended. Sign in again.`:e.status===403?`This account does not have access to that.`:e.status===404?`That page does not exist.`:`That request could not be completed.`;return{ok:!1,status:e.status,code:t||String(e.status),message:n||r}}async function CKe(e,t={}){let n=new URLSearchParams(t).toString(),r=`${Pd}/pages/${encodeURIComponent(e)}${n?`?${n}`:``}`;try{let e=await fetch(r,{credentials:Fd});if(!e.ok)return SKe(e);let t=await e.json();return!t||typeof t!=`object`||!Array.isArray(t.blocks)?{ok:!1,status:200,code:`bad_envelope`,message:`The server sent a page this client could not read.`}:{ok:!0,page:t}}catch{return{ok:!1,status:0,code:`offline`,message:`The server could not be reached.`}}}function wKe({pageKey:e,label:t}){let[n,r]=(0,L.useState)({phase:`loading`}),[i,a]=(0,L.useState)({}),[o,s]=(0,L.useState)(!1),[c,l]=(0,L.useState)(null),u=JSON.stringify(i);(0,L.useEffect)(()=>{let t=!1;return s(!0),CKe(e,JSON.parse(u)).then(e=>{if(!t){if(s(!1),e.ok){r({phase:`ready`,page:e.page});return}if(e.status===401){Vd(Id);return}r({phase:`error`,message:e.message})}}),()=>{t=!0}},[e,u]);let d=(0,L.useCallback)((e,t)=>{l(null),a(n=>({...n,[e]:t}))},[]);return n.phase===`loading`?(0,B.jsxs)(`div`,{className:`pg-state`,children:[(0,B.jsx)(`h1`,{children:t}),(0,B.jsx)(`span`,{className:`lp-spin lp-spin--lg`,role:`status`,"aria-label":`Loading`})]}):n.phase===`error`?(0,B.jsxs)(`div`,{className:`pg-state pg-error`,children:[(0,B.jsx)(`h1`,{children:t}),(0,B.jsx)(`p`,{children:n.message}),(0,B.jsx)(`button`,{className:`login-submit shell-retry`,type:`button`,onClick:()=>a(e=>({...e})),children:`Try again`})]}):(0,B.jsxs)(`div`,{className:o?`pg-host is-busy`:`pg-host`,children:[(0,B.jsx)(xKe,{page:n.page,onControl:d,onOpen:l,busy:o}),c?(0,B.jsx)(dKe,{drill:c,onClose:()=>l(null)}):null]})}function P9(e){return e?.role===`admin`}function TKe(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=typeof t.username==`string`?t.username.trim():``;return n?{username:n,name:typeof t.name==`string`&&t.name.trim()!==``?t.name.trim():n,role:typeof t.role==`string`?t.role:``,bus:Array.isArray(t.bus)?t.bus.filter(e=>typeof e==`string`):[],modules:t.modules===`all`?`all`:Array.isArray(t.modules)?t.modules.filter(e=>typeof e==`string`):[],avatar:typeof t.avatar==`string`&&t.avatar.startsWith(`data:image/`)?t.avatar:null}:null}function F9(e){return!e||typeof e!=`object`?null:TKe(e.user)}var EKe=`Incorrect username or password.`,I9=`Sign-in is unavailable right now. Try again in a moment.`,DKe=`Cannot reach the server. Check your connection and try again.`;function OKe(e,t){if(e===0)return DKe;if(e>=500)return I9;let n=t?.error;return(typeof n?.message==`string`?n.message.trim():``)||(e===401?EKe:I9)}async function kKe(e){try{return await e.json()}catch{return null}}async function AKe(e,t){let n;try{n=await fetch(`${Pd}/auth/login`,{method:`POST`,credentials:Fd,headers:{"Content-Type":`application/json`},body:JSON.stringify({username:e,password:t})})}catch{return{ok:!1,message:OKe(0,null)}}let r=await kKe(n);if(!n.ok)return{ok:!1,message:OKe(n.status,r)};let i=F9(r);return i?{ok:!0,user:i}:{ok:!1,message:I9}}async function jKe(){try{let e=await fetch(`${Pd}/auth/me`,{credentials:Fd});return e.ok?F9(await kKe(e)):null}catch{return null}}async function MKe(){try{await fetch(`${Pd}/auth/logout`,{method:`POST`,credentials:Fd})}catch{}}async function L9(e,t){try{let n=await fetch(`${Pd}${e}`,{credentials:Fd,headers:t?.body?{"Content-Type":`application/json`}:void 0,...t});if(n.status===204)return{ok:!0,data:void 0};let r=null;try{r=await n.json()}catch{}if(!n.ok){let e=r?.error,t=n.status>=500?`Something went wrong on our side. Try again in a moment.`:e?.message||(n.status===403?`Administrators only.`:n.status===409?`That username already exists. Edit the existing account instead.`:`That change could not be saved.`);return{ok:!1,status:n.status,message:t}}return{ok:!0,data:r}}catch{return{ok:!1,status:0,message:`The server could not be reached.`}}}function NKe(){return L9(`/settings`)}function PKe(){return L9(`/admin/users`)}function FKe(e){return L9(`/admin/users`,{method:`POST`,body:JSON.stringify(e)})}function IKe(e,t){return L9(`/admin/users/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)})}function LKe(e,t){return L9(`/admin/users/${encodeURIComponent(e)}/password`,{method:`POST`,body:JSON.stringify({password:t})})}function RKe(e){return L9(`/admin/users/${encodeURIComponent(e)}/perms`)}function zKe(e,t){return L9(`/admin/users/${encodeURIComponent(e)}/perms`,{method:`PUT`,body:JSON.stringify(t)})}function BKe(e){return L9(`/auth/me/avatar`,{method:`POST`,body:JSON.stringify({dataUrl:e})})}function VKe(){return L9(`/auth/me/avatar`,{method:`DELETE`})}function HKe(e,t){return e===`users`&&!t?`account`:e}var UKe=new Set(Object.keys({text:!0,status:!0,currency:!0,int:!0,date:!0,pct:!0,select:!0,user:!0,multiselect:!0,checkbox:!0,phone:!0,email:!0,url:!0,rating:!0,created_time:!0,formula:!0}));function WKe(e){return typeof e==`string`&&UKe.has(e)?e:`text`}function GKe(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function KKe(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.key!=`string`||t.key===``)return null;let n=typeof t.label==`string`&&t.label!==``?t.label:t.key,r=GKe(t.options);return{key:t.key,label:n,type:WKe(t.type),source:t.source===`overlay`?`overlay`:`odoo`,...t.pinned===!0?{pinned:!0}:{},...r.length?{options:r}:{},...typeof t.note==`string`?{note:t.note}:{},...typeof t.description==`string`&&t.description!==``?{note:t.description}:{}}}function qKe(e,t,n){let r=[];for(let e of Array.isArray(n)?n:[]){let t=KKe(e);t&&r.push(t)}return{key:e,label:t||e,fields:r}}function JKe(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(!Array.isArray(t.nodes))return null;let n=t.conj===`or`?`or`:t.conj===`and`?`and`:void 0;return{...n?{conj:n}:{},nodes:t.nodes}}function YKe(e){if(!e||typeof e!=`object`||Array.isArray(e))return{access:!1,filter:null,hiddenFields:[]};let t=e;return{access:t.access===!0,filter:JKe(t.filter),hiddenFields:R9(GKe(t.hiddenFields))}}function R9(e){return[...new Set(e)].sort()}function z9(e){return e.find(e=>e.pinned)?.key??e[0]?.key??``}function XKe(e){let t=z9(e);return e.filter(e=>e.key!==t).map(e=>e.key)}function ZKe(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.fields_by_module&&typeof t.fields_by_module==`object`?t.fields_by_module:{},r=t.perms&&typeof t.perms==`object`&&!Array.isArray(t.perms)?t.perms:{},i=(Array.isArray(t.modules)?t.modules.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return typeof t.key==`string`&&t.key?[{key:t.key,label:typeof t.label==`string`?t.label:t.key}]:[]}):Object.keys(n).map(e=>({key:e,label:e}))).map(e=>qKe(e.key,e.label,n[e.key])),a={};for(let e of i)a[e.key]=YKe(r[e.key]);return{modules:i,entries:a,orphanModules:Object.keys(r).filter(e=>!(e in a)).sort(),migrated:typeof t.perms_v==`number`&&t.perms_v>=1,isAdmin:t.is_admin===!0}}function B9(e,t,n){let r=e[t]??{access:!1,filter:null,hiddenFields:[]};return{...e,[t]:{...r,...n}}}function QKe(e,t,n){return B9(e,t,{access:n})}function $Ke(e,t,n){return B9(e,t,{filter:!n||n.nodes.length===0?null:n})}function V9(e,t,n){return B9(e,t,{hiddenFields:R9(n)})}function eqe(e,t,n){let r=e[t]?.hiddenFields??[];return V9(e,t,r.includes(n)?r.filter(e=>e!==n):[...r,n])}function tqe(e,t){return new Set(e[t]?.hiddenFields??[])}function nqe(e,t){return e[t]?.filter??{nodes:[]}}function H9(e,t){let n={};for(let r of e.modules){let e=t[r.key]??{access:!1,filter:null,hiddenFields:[]},i=z9(r.fields);n[r.key]=r.fields.length?{access:e.access,filter:e.filter,hiddenFields:R9(e.hiddenFields.filter(e=>e!==i))}:{access:e.access,filter:null,hiddenFields:[]}}return{perms:n}}function rqe(e,t,n){if(n.kind===`all`){let n={};for(let r of e.modules)n[r.key]=t[r.key]??{access:!1,filter:null,hiddenFields:[]};return n}return{...e.entries,[n.key]:t[n.key]??{access:!1,filter:null,hiddenFields:[]}}}function iqe(e,t,n){let r=new Set(e.modules.map(e=>e.key));return(n.kind===`all`?Object.keys(t):[n.key]).filter(e=>!r.has(e)).sort()}function aqe(e,t,n){return JSON.stringify(H9(e,t))!==JSON.stringify(H9(e,n))}function oqe(e){if(!e)return 0;let t=0,n=e=>{for(let r of e)r&&typeof r==`object`&&Array.isArray(r.children)?n(r.children):t+=1};return n(e.nodes),t}function U9(e,t=!1){if(!e||!e.access)return`No access`;if(t)return`Full access`;let n=oqe(e.filter),r=e.hiddenFields.length;if(!n&&!r)return`Full access`;let i=[];return n&&i.push(`${n} condition${n===1?``:`s`}`),r&&i.push(`${r} field${r===1?``:`s`} hidden`),i.join(`, `)}function W9(e,t){if(!e||e.modules.length===0)return``;let n=e.modules.filter(e=>t[e.key]?.access);if(n.length===0)return`No access`;let r=n.filter(e=>e.fields.length>0&&((t[e.key]?.filter?.nodes.length??0)>0||(t[e.key]?.hiddenFields.length??0)>0)).length,i=n.length===e.modules.length?`All ${n.length} module${n.length===1?``:`s`}`:`${n.length} of ${e.modules.length} modules`;return r?`${i}, ${r} restricted`:i}function G9(e){return e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function K9(e){return e.kind===`all`?`this account's whole access`:`${e.label} access`}function sqe({user:e,userOptions:t,copyTargets:n,onBack:r,onSaved:i}){let a=e.name||e.username,o=e.username,[s,c]=(0,L.useState)({phase:`loading`}),[l,u]=(0,L.useState)({}),[d,f]=(0,L.useState)({}),[p,m]=(0,L.useState)(null),[h,g]=(0,L.useState)(null),[_,v]=(0,L.useState)(!1),[y,b]=(0,L.useState)(``),[x,S]=(0,L.useState)(``),[C,w]=(0,L.useState)(e.name??``),[T,E]=(0,L.useState)(e.role??`user`),[D,O]=(0,L.useState)(``);(0,L.useEffect)(()=>{let e=!1;return c({phase:`loading`}),RKe(o).then(t=>{if(e)return;if(!t.ok){c({phase:`error`,message:t.message});return}let n=ZKe(t.data);if(!n){c({phase:`error`,message:`The permission record could not be read. Close and try again.`});return}u(n.entries),f(n.entries),c({phase:`ready`,payload:n})}),()=>{e=!0}},[o]);let k=s.phase===`ready`?s.payload:null,A=k?aqe(k,l,d):!1,j=e.role===`admin`||k?.isAdmin===!0,M=C.trim()!==(e.name??``).trim()||T!==(e.role??`user`),ee=A||M,N=(0,L.useCallback)(()=>{ee?m({kind:`discard`}):r()},[ee,r]),te=(0,L.useRef)(ee);te.current=ee;let ne=(0,L.useRef)(p);ne.current=p;let P=(0,L.useRef)(h);P.current=h,(0,L.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(P.current){e.stopPropagation(),P.current.phase!==`writing`&&g(null);return}if(ne.current){e.stopPropagation(),m(null);return}te.current&&(e.stopPropagation(),m({kind:`discard`}))}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]);let re=(0,L.useRef)(null);(0,L.useEffect)(()=>{!p&&!h||(re.current?.scrollIntoView({block:`center`}),re.current?.querySelector(`button`)?.focus())},[p,h]);let F=(0,L.useCallback)(()=>{if(!k)return;v(!0),b(``);let e=H9(k,d);zKe(o,e).then(t=>{v(!1),m(null),t.ok?(u(e.perms),S(`Saved access for ${o}.`),i(`Saved access for ${o}.`)):b(t.message)})},[k,d,o,i]),ie=(0,L.useCallback)((e,t)=>{v(!0),b(``),IKe(o,e).then(e=>{v(!1),e.ok?(S(t),i(t)):b(e.message)})},[o,i]),ae=(0,L.useCallback)(async(e,t)=>{g({phase:`preparing`,scope:e});let r=[],i=[];for(let a of n??[]){if(!t.includes(a.username))continue;let n=await RKe(a.username);if(!n.ok){i.push({username:a.username,why:n.message});continue}let o=ZKe(n.data);if(!o){i.push({username:a.username,why:`its permission record could not be read`});continue}let s=[];o.isAdmin&&s.push(`is an administrator — the rules will be stored but stay inert until the account is changed to Member`),o.migrated||s.push(`still uses the previous access model — this write moves it to the per-module model`),o.orphanModules.length&&s.push(`has rules for ${o.orphanModules.join(`, `)}, which this deployment no longer offers — those are removed`);let c=iqe(o,l,e);if(c.length){let e=c.map(e=>k?.modules.find(t=>t.key===e)?.label??e);s.push(`does not offer ${e.join(`, `)}, so that part of this copy cannot be written at all`)}r.push({user:a,payload:o,before:e.kind===`all`?W9(o,o.entries)||`No access`:U9(o.entries[e.key],(o.modules.find(t=>t.key===e.key)?.fields.length??0)===0),notes:s})}g({phase:`confirm`,scope:e,plans:r,refused:i})},[n,l,k]),oe=(0,L.useCallback)(async(e,t)=>{g({phase:`writing`,scope:e}),b(``);let n=[],r=[],a=new Set;for(let i of t){let t=rqe(i.payload,l,e);for(let t of iqe(i.payload,l,e))a.add(t);let o=await zKe(i.user.username,H9(i.payload,t));o.ok?n.push(i.user.username):r.push(`${i.user.username} (${o.message})`)}if(g(null),n.length){let t=`Copied ${K9(e)} to ${G9(n)}.`;S(t),i(t)}let o=[];if(r.length&&o.push(`Not copied to ${G9(r)}.`),a.size){let e=G9([...a].sort());o.push(`${e} could not be copied — the accounts you picked do not offer ${a.size===1?`it`:`them`}.`)}o.length&&b(o.join(` `))},[l,i]),se=(n?.length??0)>0&&!!k&&!A,ce=(0,L.useCallback)(e=>{m(null),b(``),S(``),g({phase:`pick`,scope:e,picked:new Set})},[]);return(0,B.jsxs)(`div`,{className:`set-pane set-perms`,children:[(0,B.jsxs)(`div`,{className:`set-perm-head`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,onClick:N,children:`Back to accounts`}),(0,B.jsxs)(`div`,{className:`set-perm-who`,children:[(0,B.jsx)(`h3`,{className:`set-h set-perm-title`,children:a}),(0,B.jsx)(`span`,{className:`set-username`,children:o})]}),(0,B.jsx)(`span`,{className:T===`admin`?`set-chip set-chip--admin`:`set-chip`,children:T===`admin`?`Admin`:`Member`}),e.active?null:(0,B.jsx)(`span`,{className:`set-chip set-chip--off`,children:`Deactivated`})]}),y?(0,B.jsx)(`p`,{className:`set-error`,children:y}):null,x?(0,B.jsx)(`p`,{className:`set-notice`,children:x}):null,(0,B.jsxs)(`section`,{className:`set-card`,children:[(0,B.jsx)(`h4`,{className:`set-h4`,children:`Account`}),(0,B.jsxs)(`div`,{className:`set-grid2`,children:[(0,B.jsxs)(`div`,{className:`set-field`,children:[(0,B.jsx)(`label`,{className:`set-label`,htmlFor:`set-name`,children:`Display name`}),(0,B.jsx)(`input`,{id:`set-name`,className:`set-input`,value:C,onChange:e=>w(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`set-field`,children:[(0,B.jsx)(`label`,{className:`set-label`,htmlFor:`set-role`,children:`Role`}),(0,B.jsxs)(`select`,{id:`set-role`,className:`pg-select`,value:T,onChange:e=>E(e.target.value),children:[(0,B.jsx)(`option`,{value:`user`,children:`Member`}),(0,B.jsx)(`option`,{value:`admin`,children:`Admin`})]})]})]}),T===`admin`&&(e.role??`user`)!==`admin`?(0,B.jsx)(`p`,{className:`set-help`,children:`Saving this makes the account an administrator, which bypasses every access rule set below.`}):null,(0,B.jsxs)(`div`,{className:`set-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-primary`,disabled:_||!M,onClick:()=>ie({name:C,role:T},`Saved ${o}.`),children:`Save account`}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,disabled:_,onClick:()=>ie({active:!e.active},`${e.active?`Deactivated`:`Reactivated`} ${o}.`),children:e.active?`Deactivate account`:`Reactivate account`})]}),(0,B.jsxs)(`div`,{className:`set-danger set-grid2`,children:[(0,B.jsxs)(`div`,{className:`set-field`,children:[(0,B.jsx)(`label`,{className:`set-label`,htmlFor:`set-pw`,children:`Set a new password`}),(0,B.jsx)(`input`,{id:`set-pw`,className:`set-input`,type:`password`,value:D,autoComplete:`new-password`,onChange:e=>O(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`set-pw-side`,children:[(0,B.jsxs)(`p`,{className:`set-help`,children:[`This signs `,o,` out everywhere immediately.`]}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,disabled:_||D.length===0,onClick:()=>{b(``),LKe(o,D).then(e=>{e.ok?(O(``),S(`Password reset; ${o} was signed out.`)):b(e.message)})},children:`Reset password`})]})]})]}),s.phase===`loading`?(0,B.jsx)(`div`,{className:`set-loading`,children:(0,B.jsx)(`span`,{className:`lp-spin lp-spin--lg`,role:`status`,"aria-label":`Loading`})}):null,s.phase===`error`?(0,B.jsx)(`p`,{className:`set-error`,children:s.message}):null,k?(0,B.jsxs)(B.Fragment,{children:[j?(0,B.jsx)(`p`,{className:`set-notice set-perm-banner`,children:`This is an administrator account. Administrators see everything, so nothing set here applies to them — these rules take effect only if the account is changed to Member.`}):null,!k.migrated&&!j?(0,B.jsx)(`p`,{className:`set-notice set-perm-banner`,children:`This account still uses the previous access model, so the rules below are not in force yet. Saving moves it to the per-module model — set every module deliberately before you do.`}):null,k.orphanModules.length?(0,B.jsxs)(`p`,{className:`set-error set-perm-banner`,children:[`This account has rules for `,k.orphanModules.join(`, `),`, which this deployment no longer offers. Saving removes them.`]}):null,(0,B.jsxs)(`div`,{className:`set-perm-sect`,children:[(0,B.jsx)(`h4`,{className:`set-h4`,children:`Access`}),n?.length?(0,B.jsx)(`button`,{type:`button`,className:`set-secondary set-copy-door`,disabled:!se||_,title:A?`Save this account's access first — a copy sends what is stored, not what is on screen.`:void 0,onClick:()=>ce({kind:`all`}),children:`Apply this access to…`}):null]}),(0,B.jsxs)(`p`,{className:`set-help set-perm-intro`,children:[W9(k,d),`. Each module can be turned off entirely, narrowed to the records a condition describes, or shown with fields hidden. Restrictions apply everywhere the account looks — the tables, the exports and every number computed from them.`]}),A&&n?.length?(0,B.jsx)(`p`,{className:`set-help set-copy-why`,children:`Copying is unavailable while there are unsaved changes — a copy sends what is stored, not what is on screen.`}):null,k.modules.length===0?(0,B.jsx)(`p`,{className:`pg-empty`,children:`This deployment declares no modules that can be restricted.`}):null,k.modules.map(e=>{let r=d[e.key],i=r?.access===!0,a=e.fields.length===0;return(0,B.jsxs)(`section`,{className:`set-card set-perm-mod`,children:[(0,B.jsxs)(`div`,{className:`set-perm-modhead`,children:[(0,B.jsxs)(`label`,{className:`set-check set-perm-toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:i,onChange:t=>f(n=>QKe(n,e.key,t.target.checked))}),(0,B.jsx)(`span`,{className:`set-perm-modname`,children:e.label})]}),(0,B.jsx)(`span`,{className:`set-perm-sum`,children:U9(r,a)}),n?.length?(0,B.jsx)(`button`,{type:`button`,className:`set-secondary set-copy-door`,disabled:!se||_,onClick:()=>ce({kind:`module`,key:e.key,label:e.label}),children:`Copy to…`}):null]}),i&&a?(0,B.jsx)(`p`,{className:`set-help`,children:`No field list is available for this module, so access is all this editor can set for it. Conditions and hidden fields need a schema.`}):null,i&&!a?(0,B.jsxs)(`div`,{className:`set-perm-panels`,children:[(0,B.jsx)(`div`,{className:`cg-pop set-perm-pop`,children:(0,B.jsx)(dm,{fields:e.fields,filters:nqe(d,e.key),onChange:t=>f(n=>$Ke(n,e.key,t)),userOptions:t})}),(0,B.jsx)(`div`,{className:`cg-pop set-perm-pop`,children:(0,B.jsx)(fm,{fields:e.fields,hidden:tqe(d,e.key),onToggle:t=>f(n=>eqe(n,e.key,t)),lockedKey:z9(e.fields),onHideAll:()=>f(t=>V9(t,e.key,XKe(e.fields))),onShowAll:()=>f(t=>V9(t,e.key,[]))})})]}):null]},e.key)}),(0,B.jsxs)(`div`,{className:`set-actions set-perm-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-primary`,disabled:_||!A,onClick:()=>m({kind:`save`}),children:`Save access`}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,disabled:_,onClick:N,children:`Cancel`}),A?(0,B.jsx)(`span`,{className:`set-help set-perm-dirty`,children:`Unsaved changes`}):null]})]}):null,p?(0,B.jsx)(`div`,{className:`set-confirm-wrap`,children:(0,B.jsxs)(`div`,{ref:re,className:`set-confirm`,role:`alertdialog`,"aria-modal":`true`,"aria-label":p.kind===`save`?`Confirm access change`:`Discard changes`,children:[p.kind===`save`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h4`,{className:`set-h4`,children:[`Change what `,a,` can see?`]}),(0,B.jsxs)(`p`,{className:`set-help`,children:[`This takes effect the next time they load a page. `,cqe(k,d)]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{className:`set-h4`,children:`Discard these changes?`}),(0,B.jsxs)(`p`,{className:`set-help`,children:[lqe(A,M),` for `,a,` stay as they were.`]})]}),(0,B.jsxs)(`div`,{className:`set-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-primary`,disabled:_,onClick:()=>p.kind===`save`?F():(m(null),r()),children:p.kind===`save`?`Save access`:`Discard`}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,disabled:_,onClick:()=>m(null),children:`Keep editing`})]})]})}):null,h?(0,B.jsx)(`div`,{className:`set-confirm-wrap`,children:(0,B.jsxs)(`div`,{ref:re,className:`set-confirm set-copy`,role:`alertdialog`,"aria-modal":`true`,"aria-label":`Copy ${K9(h.scope)}`,children:[h.phase===`pick`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h4`,{className:`set-h4`,children:[`Copy `,K9(h.scope),` to…`]}),(0,B.jsx)(`p`,{className:`set-help`,children:h.scope.kind===`all`?`Every account you pick has its whole access record replaced with ${a}'s.`:`Every account you pick has its ${h.scope.label} access replaced with ${a}'s. Their other modules are left alone.`}),(0,B.jsx)(`div`,{className:`set-copy-list`,children:(n??[]).map(e=>(0,B.jsxs)(`label`,{className:`set-check set-copy-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:h.picked.has(e.username),onChange:t=>{let n=new Set(h.picked);t.target.checked?n.add(e.username):n.delete(e.username),g({...h,picked:n})}}),(0,B.jsx)(`span`,{className:`set-copy-name`,children:e.name||e.username}),(0,B.jsx)(`span`,{className:`set-username set-copy-user`,children:e.username}),e.role===`admin`?(0,B.jsx)(`span`,{className:`set-chip set-chip--admin`,children:`Admin`}):null,e.active?null:(0,B.jsx)(`span`,{className:`set-chip set-chip--off`,children:`Deactivated`})]},e.username))}),(0,B.jsxs)(`div`,{className:`set-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-primary`,disabled:h.picked.size===0,onClick:()=>void ae(h.scope,[...h.picked]),children:`Continue`}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,onClick:()=>g(null),children:`Cancel`})]})]}):null,h.phase===`preparing`||h.phase===`writing`?(0,B.jsx)(`div`,{className:`set-loading`,children:(0,B.jsx)(`span`,{className:`lp-spin lp-spin--lg`,role:`status`,"aria-label":`Loading`})}):null,h.phase===`confirm`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h4`,{className:`set-h4`,children:[`Replace `,K9(h.scope),` for `,h.plans.length,` account`,h.plans.length===1?``:`s`,`?`]}),h.plans.length===0?(0,B.jsx)(`p`,{className:`set-help`,children:`None of the accounts picked could be read, so there is nothing to write.`}):(0,B.jsx)(`ul`,{className:`set-copy-plans`,children:h.plans.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{className:`set-copy-name`,children:e.user.name||e.user.username}),` `,(0,B.jsxs)(`span`,{className:`set-copy-before`,children:[`now: `,e.before]}),e.notes.map(t=>(0,B.jsxs)(`span`,{className:`set-copy-note`,children:[e.user.username,` `,t]},t))]},e.user.username))}),h.refused.length?(0,B.jsxs)(`p`,{className:`set-error`,children:[G9(h.refused.map(e=>`${e.username} (${e.why.replace(/\.\s*$/,``)})`)),` `,`could not be read and will not be changed.`]}):null,(0,B.jsxs)(`div`,{className:`set-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-primary`,disabled:h.plans.length===0,onClick:()=>void oe(h.scope,h.plans),children:`Replace access`}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,onClick:()=>g(null),children:`Cancel`})]})]}):null]})}):null]})}function cqe(e,t){let n=W9(e,t);return n?`${n} after this change.`:``}function lqe(e,t){return e&&t?`The account details and access rules`:t?`The account details`:`The access rules`}function uqe(e){return e===`all`||!Array.isArray(e)||e.length===0?`All modules`:`${e.length} module${e.length===1?``:`s`}: ${e.join(`, `)}`}function dqe(){return(0,B.jsx)(`svg`,{className:`set-acct-chev`,viewBox:`0 0 12 12`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M4.4 2.4 8 6l-3.6 3.6`})})}function fqe(){let[e,t]=(0,L.useState)(null),[n,r]=(0,L.useState)(``),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(null),c=(0,L.useCallback)(()=>{PKe().then(e=>{e.ok?(t(e.data.users??[]),r(``)):(t([]),r(e.message))})},[]);if((0,L.useEffect)(c,[c]),e===null)return(0,B.jsx)(`div`,{className:`set-loading`,children:(0,B.jsx)(`span`,{className:`lp-spin lp-spin--lg`,role:`status`,"aria-label":`Loading`})});if(o){let t=e.find(e=>e.username===o);return t?(0,B.jsx)(sqe,{user:t,userOptions:e.map(e=>e.name||e.username),copyTargets:e.filter(e=>e.username!==t.username),onBack:()=>s(null),onSaved:e=>{a(e),r(``),c()}},t.username):(0,B.jsx)(`div`,{className:`set-pane`,children:(0,B.jsxs)(`section`,{className:`set-card`,children:[(0,B.jsx)(`h4`,{className:`set-h4`,children:`That account is no longer listed`}),(0,B.jsx)(`p`,{className:`set-help`,children:`It may have been removed since this list was loaded.`}),(0,B.jsx)(`div`,{className:`set-actions`,children:(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,onClick:()=>s(null),children:`Back to accounts`})})]})})}return(0,B.jsxs)(`div`,{className:`set-pane`,children:[(0,B.jsx)(`h3`,{className:`set-h`,children:`Accounts`}),n?(0,B.jsx)(`p`,{className:`set-error`,children:n}):null,i?(0,B.jsx)(`p`,{className:`set-notice`,children:i}):null,e.length===0&&!n?(0,B.jsx)(`p`,{className:`pg-empty`,children:`No accounts are configured on this deployment yet.`}):(0,B.jsx)(`ul`,{className:`set-acctlist`,children:e.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,className:`set-acct`+(e.active?``:` is-inactive`),onClick:()=>s(e.username),children:[(0,B.jsx)(_qe,{name:e.name||e.username}),(0,B.jsxs)(`span`,{className:`set-acct-body`,children:[(0,B.jsxs)(`span`,{className:`set-acct-top`,children:[(0,B.jsx)(`span`,{className:`set-acct-name`,children:e.name||e.username}),(0,B.jsx)(vqe,{admin:e.role===`admin`}),e.active?null:(0,B.jsx)(`span`,{className:`set-chip set-chip--off`,children:`Deactivated`})]}),(0,B.jsx)(`span`,{className:`set-acct-sub`,children:e.username}),(0,B.jsx)(`span`,{className:`set-acct-access`,children:e.role===`admin`?`Everything (admin)`:e.accessSummary??uqe(e.modules)})]}),(0,B.jsxs)(`span`,{className:`set-acct-go`,children:[`Edit`,(0,B.jsx)(dqe,{})]})]})},e.username))}),(0,B.jsx)(pqe,{onCreated:e=>{a(e),r(``),c()},onError:r})]})}function pqe({onCreated:e,onError:t}){let[n,r]=(0,L.useState)(!1),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(``),[c,l]=(0,L.useState)(`user`),[u,d]=(0,L.useState)(``),[f,p]=(0,L.useState)(!1);if(!n)return(0,B.jsx)(`button`,{type:`button`,className:`set-primary set-add`,onClick:()=>r(!0),children:`Add an account`});let m=i.trim().length>0&&u.length>0;return(0,B.jsxs)(`section`,{className:`set-card`,children:[(0,B.jsx)(`h4`,{className:`set-h4`,children:`New account`}),(0,B.jsxs)(`div`,{className:`set-field`,children:[(0,B.jsx)(`label`,{className:`set-label`,htmlFor:`set-new-user`,children:`Username`}),(0,B.jsx)(`input`,{id:`set-new-user`,className:`set-input`,value:i,autoComplete:`off`,onChange:e=>a(e.target.value)}),(0,B.jsx)(`p`,{className:`set-help`,children:`Must be new. To change an existing account, edit it above — re-creating one would revive sessions that were revoked.`})]}),(0,B.jsxs)(`div`,{className:`set-field`,children:[(0,B.jsx)(`label`,{className:`set-label`,htmlFor:`set-new-name`,children:`Display name`}),(0,B.jsx)(`input`,{id:`set-new-name`,className:`set-input`,value:o,onChange:e=>s(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`set-field`,children:[(0,B.jsx)(`label`,{className:`set-label`,htmlFor:`set-new-role`,children:`Role`}),(0,B.jsxs)(`select`,{id:`set-new-role`,className:`pg-select`,value:c,onChange:e=>l(e.target.value),children:[(0,B.jsx)(`option`,{value:`user`,children:`Member`}),(0,B.jsx)(`option`,{value:`admin`,children:`Admin`})]})]}),(0,B.jsxs)(`div`,{className:`set-field`,children:[(0,B.jsx)(`label`,{className:`set-label`,htmlFor:`set-new-pw`,children:`Password`}),(0,B.jsx)(`input`,{id:`set-new-pw`,className:`set-input`,type:`password`,value:u,autoComplete:`new-password`,onChange:e=>d(e.target.value)}),(0,B.jsx)(`p`,{className:`set-help`,children:`A new account starts with access to everything this deployment shows. Open it from the list afterwards to set what they may see.`})]}),(0,B.jsxs)(`div`,{className:`set-actions`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-primary`,disabled:f||!m,onClick:()=>{p(!0),FKe({username:i.trim().toLowerCase(),name:o||i.trim(),role:c,modules:`all`,password:u}).then(n=>{p(!1),n.ok?(e(`Created ${i.trim().toLowerCase()}.`),r(!1),a(``),s(``),d(``)):t(n.message)})},children:`Create account`}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,onClick:()=>r(!1),children:`Cancel`})]})]})}async function mqe(e){let t=URL.createObjectURL(e);try{let e=new Image;if(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(`unreadable image`)),e.src=t}),!e.width||!e.height)return null;let n=Math.min(128,Math.max(e.width,e.height)),r=document.createElement(`canvas`);r.width=n,r.height=n;let i=r.getContext(`2d`);if(!i)return null;let a=Math.min(e.width,e.height);return i.drawImage(e,(e.width-a)/2,(e.height-a)/2,a,a,0,0,n,n),r.toDataURL(`image/jpeg`,.85)}catch{return null}finally{URL.revokeObjectURL(t)}}function hqe(e){return(e.match(/[\p{L}\p{N}]/u)?.[0]??`?`).toUpperCase()}function gqe({user:e,large:t}){let n=t?`set-avatar set-avatar--lg`:`set-avatar`;return e.avatar?(0,B.jsx)(`img`,{className:n,src:e.avatar,alt:``,"aria-hidden":`true`}):(0,B.jsx)(`span`,{className:n,"aria-hidden":`true`,children:hqe(e.name)})}function _qe({name:e}){return(0,B.jsx)(`span`,{className:`set-avatar`,"aria-hidden":`true`,children:hqe(e)})}function vqe({admin:e}){return(0,B.jsx)(`span`,{className:e?`set-chip set-chip--admin`:`set-chip`,children:e?`Admin`:`Member`})}function yqe({user:e,admin:t,onUser:n}){let[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(``),s=(0,L.useRef)(null),c=(0,L.useCallback)(async e=>{i(!0),o(``);let t=await mqe(e);if(!t){i(!1),o(`That file could not be read as an image.`);return}let r=await BKe(t);if(i(!1),r.ok){let e=F9(r.data);e&&n?.(e)}else o(r.message)},[n]),l=(0,L.useCallback)(async()=>{i(!0),o(``);let e=await VKe();if(i(!1),e.ok){let t=F9(e.data);t&&n?.(t)}else o(e.message)},[n]);return(0,B.jsxs)(`div`,{className:`set-identity`,children:[(0,B.jsx)(gqe,{user:e,large:!0}),(0,B.jsxs)(`div`,{className:`set-identity-body`,children:[(0,B.jsxs)(`div`,{className:`set-identity-head`,children:[(0,B.jsx)(`span`,{className:`set-identity-name`,children:e.name}),(0,B.jsx)(vqe,{admin:t})]}),(0,B.jsx)(`div`,{className:`set-identity-sub`,children:e.username}),(0,B.jsxs)(`div`,{className:`set-identity-acts`,children:[(0,B.jsx)(`input`,{ref:s,type:`file`,accept:`image/png,image/jpeg`,className:`set-filepick`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&c(t)}}),(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,disabled:r,onClick:()=>s.current?.click(),children:e.avatar?`Change photo`:`Upload photo`}),e.avatar?(0,B.jsx)(`button`,{type:`button`,className:`set-secondary`,disabled:r,onClick:l,children:`Remove`}):null]}),a?(0,B.jsx)(`p`,{className:`set-error set-identity-err`,children:a}):null]})]})}function bqe({user:e,section:t,onSection:n,onClose:r,onUser:i,moduleLabels:a}){let[o,s]=(0,L.useState)(null),c=P9(e);(0,L.useEffect)(()=>{NKe().then(e=>{e.ok&&s(e.data)})},[]),(0,L.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let l=[[`account`,`Account`],[`scope`,`Your access`],...c?[[`users`,`Manage users`]]:[]],u=HKe(t,c);return(0,B.jsx)(`div`,{className:`set-backdrop`,onMouseDown:e=>{e.target===e.currentTarget&&r()},children:(0,B.jsxs)(`div`,{className:`set-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Profile`,children:[(0,B.jsxs)(`nav`,{className:`set-rail`,children:[(0,B.jsx)(`span`,{className:`set-rail-cap`,children:`Profile`}),l.map(([e,t])=>(0,B.jsx)(`button`,{type:`button`,className:`set-rail-item`+(u===e?` is-active`:``),onClick:()=>n(e),children:t},e))]}),(0,B.jsxs)(`div`,{className:`set-body`,children:[(0,B.jsx)(`button`,{type:`button`,className:`set-close`,onClick:r,"aria-label":`Close profile`,children:`×`}),u===`account`?(0,B.jsxs)(`div`,{className:`set-pane`,children:[(0,B.jsx)(`h3`,{className:`set-h`,children:`Account`}),(0,B.jsx)(yqe,{user:e,admin:c,onUser:i})]}):null,u===`scope`?(0,B.jsxs)(`div`,{className:`set-pane`,children:[(0,B.jsx)(`h3`,{className:`set-h`,children:`Your access`}),(0,B.jsx)(`p`,{className:`set-help set-pane-intro`,children:`What this account may open, and anything that narrows it. Only an administrator can change this.`}),(0,B.jsxs)(`section`,{className:`set-card set-card--rows`,children:[(0,B.jsxs)(`div`,{className:`pg-drill-row`,children:[(0,B.jsx)(`span`,{className:`pg-drill-key`,children:`Modules`}),(0,B.jsx)(`span`,{className:`pg-drill-val`,children:uqe(o?.scope.modules??e.modules)})]}),c?(0,B.jsxs)(`div`,{className:`pg-drill-row`,children:[(0,B.jsx)(`span`,{className:`pg-drill-key`,children:`Restrictions`}),(0,B.jsx)(`span`,{className:`pg-drill-val`,children:`None apply — administrators bypass every rule`})]}):null,c?null:Object.entries(o?.scope.perms??{}).map(([e,t])=>{let n=U9(YKe(t));return n===`Full access`?null:(0,B.jsxs)(`div`,{className:`pg-drill-row`,children:[(0,B.jsx)(`span`,{className:`pg-drill-key`,children:a?.[e]??e}),(0,B.jsx)(`span`,{className:`pg-drill-val`,children:n})]},e)})]})]}):null,u===`users`?(0,B.jsx)(fqe,{}):null]})]})})}var xqe=`./favicon.svg`;function Sqe({size:e}){return(0,B.jsx)(`img`,{className:`lp-mark`,src:xqe,width:e,height:e,alt:``,"aria-hidden":`true`,draggable:!1})}function q9({size:e,className:t}){return(0,B.jsxs)(`div`,{className:t,children:[(0,B.jsx)(Sqe,{size:e}),(0,B.jsx)(`span`,{className:`lp-wordmark`,children:`Loopable`})]})}function Cqe({off:e}){return(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M2.2 10s2.8-4.6 7.8-4.6S17.8 10 17.8 10 15 14.6 10 14.6 2.2 10 2.2 10z`}),(0,B.jsx)(`circle`,{cx:`10`,cy:`10`,r:`2.3`}),e?(0,B.jsx)(`path`,{d:`M4 16 16 4`}):null]})}function wqe({onSignedIn:e}){let[t,n]=(0,L.useState)(``),[r,i]=(0,L.useState)(``),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(!1),[l,u]=(0,L.useState)(!1);async function d(n){if(n.preventDefault(),s)return;c(!0),o(``);let a=await AKe(t,r);if(a.ok){e(a.user);return}c(!1),o(a.message),i(``)}function f(e){return t=>{a&&o(``),e(t.target.value)}}return(0,B.jsx)(`div`,{className:`login-root`,children:(0,B.jsxs)(`div`,{className:`login-card`,children:[(0,B.jsx)(q9,{size:44,className:`login-brand`}),(0,B.jsxs)(`form`,{className:`login-form`,onSubmit:d,noValidate:!0,children:[(0,B.jsx)(`label`,{className:`lp-sr-only`,htmlFor:`login-username`,children:`Username`}),(0,B.jsx)(`input`,{id:`login-username`,className:`login-input`,name:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:t,onChange:f(n),disabled:s,"aria-invalid":a?!0:void 0}),(0,B.jsx)(`label`,{className:`lp-sr-only`,htmlFor:`login-password`,children:`Password`}),(0,B.jsxs)(`div`,{className:`login-field`,children:[(0,B.jsx)(`input`,{id:`login-password`,className:`login-input`,name:`password`,type:l?`text`:`password`,autoComplete:`current-password`,placeholder:`Password`,value:r,onChange:f(i),disabled:s,"aria-invalid":a?!0:void 0}),(0,B.jsx)(`button`,{type:`button`,className:`login-eye`,"aria-label":l?`Hide password`:`Show password`,onClick:()=>u(e=>!e),disabled:s,tabIndex:-1,children:(0,B.jsx)(Cqe,{off:l})})]}),(0,B.jsx)(`button`,{className:`login-submit`,type:`submit`,disabled:s,children:s?`Signing in…`:`Log in`})]}),(0,B.jsx)(`p`,{className:`login-msg`,role:`status`,"aria-live":`polite`,children:a})]})})}function Tqe(e){let t=e?.pages;if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e,r=typeof t.key==`string`?t.key.trim():``,i=typeof t.label==`string`?t.label.trim():``;!r||!i||n.push({key:r,label:i,...typeof t.source==`string`&&t.source?{source:t.source}:{},...typeof t.parent==`string`&&t.parent?{parent:t.parent}:{},...t.group_only===!0?{group_only:!0}:{},...t.chrome===`main`||t.chrome===`utility`?{chrome:t.chrome}:{}})}return n}function Eqe(e){let t=[],n=[];for(let r of e)(r.chrome===`utility`?n:t).push(r);return{main:t,utility:n}}async function Dqe(){try{let e=await fetch(`${Pd}/nav`,{credentials:Fd});return e.ok?{ok:!0,pages:Tqe(await e.json())}:{ok:!1,status:e.status}}catch{return{ok:!1,status:0}}}var J9={folders:[],placement:{}};function Oqe(e){let t=e?.prefs??e;if(!t||typeof t!=`object`)return J9;let n=t,r=[],i=new Set;if(Array.isArray(n.folders))for(let e of n.folders.slice(0,16)){if(!e||typeof e!=`object`)continue;let t=String(e.id??``).trim().slice(0,40),n=String(e.name??``).trim().replace(/\s+/g,` `).slice(0,40);!t||i.has(t)||!n||(i.add(t),r.push({id:t,name:n}))}let a={};if(n.placement&&typeof n.placement==`object`)for(let[e,t]of Object.entries(n.placement)){let n=String(t??``).slice(0,40);e&&i.has(n)&&(a[e.slice(0,60)]=n)}return{folders:r,placement:a}}async function kqe(){try{let e=await fetch(`${Pd}/nav/prefs`,{credentials:Fd});return e.ok?Oqe(await e.json()):J9}catch{return J9}}async function Aqe(e){try{return(await fetch(`${Pd}/nav/prefs`,{method:`POST`,credentials:Fd,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).ok}catch{return!1}}function jqe(e,t,n){let r=[];for(let t of e)t.depth>0&&r.length>0?r[r.length-1].children.push(t):r.push({head:t,children:[]});let i=new Map,a=[],o=new Set(t.folders.map(e=>e.id));for(let e of r){let n=t.placement[e.head.key];if(n&&o.has(n)){let t=i.get(n);t?t.push(e):i.set(n,[e])}else a.push(e)}let s=[],c=(e,t)=>{s.push({kind:`entry`,entry:e.head,...t?{folderId:t}:{}});for(let n of e.children)s.push({kind:`entry`,entry:n,...t?{folderId:t}:{}})};for(let e of t.folders){let t=i.get(e.id)??[],r=!n.has(e.id);if(s.push({kind:`folder`,folder:e,count:t.length,open:r}),r)for(let n of t)c(n,e.id)}for(let e of a)c(e);return s}function Mqe(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.key!=`string`||typeof t.label!=`string`)return null;let n=[];if(Array.isArray(t.fields))for(let e of t.fields){if(!e||typeof e!=`object`)continue;let t=e;typeof t.key!=`string`||typeof t.label!=`string`||n.push({key:t.key,label:t.label,type:String(t.type??``),source:String(t.source??``),description:String(t.description??``),...Array.isArray(t.options)?{options:t.options.map(String)}:{}})}let r=[];if(Array.isArray(t.measures))for(let e of t.measures){if(!e||typeof e!=`object`)continue;let t=e;typeof t.key!=`string`||!t.key||r.push({key:t.key,label:String(t.label??t.key),type:String(t.type??``)})}return{key:t.key,label:t.label,source:String(t.source??``),fields:n,measures:r,...typeof t.note==`string`&&t.note?{note:t.note}:{}}}async function Nqe(e){try{let t=await fetch(`${Pd}/nav/schema/${encodeURIComponent(e)}`,{credentials:Fd});return t.ok?Mqe(await t.json()):null}catch{return null}}var Pqe=new Set([`customer_data`,`product_data`]),Fqe=new Set([]);function Y9(e,t){return`${e}/?page=${encodeURIComponent(t)}`}function Iqe(e,t){let n=new Set(e.map(e=>e.key)),r=new Map;for(let t of e){if(!t.parent||!n.has(t.parent))continue;let e=r.get(t.parent);e?e.push(t):r.set(t.parent,[t])}let i=(e,n)=>{let i=Pqe.has(e.key),a=i?`native`:e.group_only||r.has(e.key)?`group`:`handoff`;return{key:e.key,label:e.label,...e.source?{source:e.source}:{},kind:a,depth:n,...a===`group`?{}:{href:i?`#/${e.key}`:Y9(t,e.key)}}},a=[];for(let t of e){if(t.parent&&n.has(t.parent))continue;let e=i(t,0),o=r.get(t.key)??[];if(!(e.kind===`group`&&o.length===0)){a.push(e);for(let e of o)a.push(i(e,1))}}return a}var Lqe=[`customer_data`];function Rqe(e){for(let t of Lqe){let n=e.find(e=>e.key===t&&e.kind===`native`);if(n)return n.key}return e.find(e=>e.kind===`native`)?.key??e.find(e=>e.kind!==`group`)?.key??``}function zqe(e,t){let n=e.findIndex(e=>e.key===t);if(n>=0){let t=e[n];if(t.kind!==`group`)return t;for(let r of e.slice(n+1)){if(r.depth<=t.depth)break;if(r.kind!==`group`)return r}}let r=Rqe(e);return e.find(e=>e.key===r)}function Bqe(){return(0,B.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`shell-dots-icon`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`3.2`,r:`1.35`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.35`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`12.8`,r:`1.35`})]})}function Vqe(){return(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`shell-nav-icon`,children:(0,B.jsx)(`path`,{d:`M2.2 4.4c0-.66.54-1.2 1.2-1.2h3l1.4 1.6h4.8c.66 0 1.2.54 1.2 1.2v6c0 .66-.54 1.2-1.2 1.2H3.4c-.66 0-1.2-.54-1.2-1.2z`})})}function Hqe(){let[e,t]=(0,L.useState)(null),n=(0,L.useRef)(null);return(0,L.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&!n.current.contains(e.target)&&t(null)},i=e=>{e.key===`Escape`&&t(null)};return document.addEventListener(`mousedown`,r,!0),document.addEventListener(`keydown`,i,!0),()=>{document.removeEventListener(`mousedown`,r,!0),document.removeEventListener(`keydown`,i,!0)}},[e]),{at:e,ref:n,openFrom:e=>{let n=e.getBoundingClientRect();t({x:Math.round(n.right+4),y:Math.round(n.top)})},close:()=>t(null)}}function Uqe({at:e,menuRef:t,children:n}){return(0,B.jsx)(`div`,{className:`shell-navmenu`,style:{left:Math.min(e.x,Math.max(8,window.innerWidth-248)),top:Math.min(e.y,Math.max(8,window.innerHeight-260))},ref:t,role:`menu`,children:n})}function Wqe({entryLabel:e,canSchema:t,onSchema:n}){let{at:r,ref:i,openFrom:a,close:o}=Hqe();return t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,className:`shell-dots`,"aria-label":`Options for ${e}`,"aria-haspopup":`menu`,onClick:e=>{e.preventDefault(),e.stopPropagation(),a(e.currentTarget)},children:(0,B.jsx)(Bqe,{})}),r&&(0,B.jsx)(Uqe,{at:r,menuRef:i,children:(0,B.jsx)(`button`,{type:`button`,className:`shell-navmenu-item`,onClick:()=>{o(),n()},children:`View schema`})})]}):null}function Gqe({onCreate:e}){let[t,n]=(0,L.useState)(!1),[r,i]=(0,L.useState)(``),a=()=>{let t=r.trim().replace(/\s+/g,` `);t&&(e(t),i(``),n(!1))};return t?(0,B.jsxs)(`form`,{className:`shell-navmenu-form shell-newfolder-form`,onSubmit:e=>{e.preventDefault(),a()},children:[(0,B.jsx)(`input`,{className:`shell-navmenu-input`,autoFocus:!0,maxLength:40,placeholder:`Folder name`,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(i(``),n(!1))}}),(0,B.jsx)(`button`,{type:`submit`,className:`shell-navmenu-go`,disabled:!r.trim(),children:`Add`})]}):(0,B.jsx)(`button`,{type:`button`,className:`shell-newfolder`,onClick:()=>n(!0),children:`+ New folder`})}function Kqe({folder:e,count:t,open:n,collapsed:r,onToggle:i,onRename:a,onDelete:o,isDrop:s,dropProps:c}){let{at:l,ref:u,openFrom:d,close:f}=Hqe(),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(e.name),_=()=>{let t=h.trim().replace(/\s+/g,` `);t&&t!==e.name&&a(t),m(!1),f()};return r?null:(0,B.jsxs)(`div`,{className:`shell-nav-folder`+(s?` is-drop`:``),...c??{},children:[(0,B.jsxs)(`button`,{type:`button`,className:`shell-nav-folderbtn`,"aria-expanded":n,onClick:i,children:[(0,B.jsx)(Vqe,{}),(0,B.jsx)(`span`,{className:`shell-nav-label`,children:e.name}),(0,B.jsx)(`span`,{className:`shell-nav-foldercount`,children:t})]}),(0,B.jsx)(`button`,{type:`button`,className:`shell-dots`,"aria-label":`Options for folder ${e.name}`,"aria-haspopup":`menu`,onClick:t=>{t.stopPropagation(),g(e.name),m(!1),d(t.currentTarget)},children:(0,B.jsx)(Bqe,{})}),l&&(0,B.jsxs)(Uqe,{at:l,menuRef:u,children:[p?(0,B.jsxs)(`form`,{className:`shell-navmenu-form`,onSubmit:e=>{e.preventDefault(),_()},children:[(0,B.jsx)(`input`,{className:`shell-navmenu-input`,autoFocus:!0,maxLength:40,value:h,onChange:e=>g(e.target.value)}),(0,B.jsx)(`button`,{type:`submit`,className:`shell-navmenu-go`,disabled:!h.trim(),children:`Save`})]}):(0,B.jsx)(`button`,{type:`button`,className:`shell-navmenu-item`,onClick:()=>m(!0),children:`Rename folder`}),(0,B.jsx)(`button`,{type:`button`,className:`shell-navmenu-item is-danger`,onClick:()=>{f(),o()},children:`Delete folder`})]})]})}function qqe({schemaKey:e,onClose:t}){let[n,r]=(0,L.useState)({phase:`loading`});return(0,L.useEffect)(()=>{let t=!1;return r({phase:`loading`}),Nqe(e).then(e=>{t||r(e?{phase:`ready`,schema:e}:{phase:`error`})}),()=>{t=!0}},[e]),(0,L.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[t]),(0,B.jsx)(`div`,{className:`shell-schema-backdrop`,onMouseDown:t,children:(0,B.jsxs)(`aside`,{className:`shell-schema`,role:`dialog`,"aria-label":`Database schema`,onMouseDown:e=>e.stopPropagation(),children:[n.phase===`loading`&&(0,B.jsx)(`div`,{className:`shell-schema-empty is-spin`,children:(0,B.jsx)(`span`,{className:`lp-spin lp-spin--lg`,role:`status`,"aria-label":`Loading`})}),n.phase===`error`&&(0,B.jsx)(`div`,{className:`shell-schema-empty`,children:`The schema could not be loaded. Close this panel and try again.`}),n.phase===`ready`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`header`,{className:`shell-schema-head`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`shell-schema-title`,children:n.schema.label}),n.schema.source&&(0,B.jsxs)(`div`,{className:`shell-schema-sub`,children:[`Source · `,n.schema.source]})]}),(0,B.jsx)(`button`,{type:`button`,className:`shell-schema-close`,"aria-label":`Close schema`,onClick:t,children:`×`})]}),(0,B.jsxs)(`div`,{className:`shell-schema-body`,children:[n.schema.note&&(0,B.jsx)(`div`,{className:`shell-schema-note`,children:n.schema.note}),n.schema.fields.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`shell-schema-kicker`,children:[`Fields · `,n.schema.fields.length]}),(0,B.jsxs)(`table`,{className:`shell-schema-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Field`}),(0,B.jsx)(`th`,{children:`Type`}),(0,B.jsx)(`th`,{children:`Source`})]})}),(0,B.jsx)(`tbody`,{children:n.schema.fields.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`div`,{className:`shell-schema-fname`,children:e.label}),e.description&&(0,B.jsx)(`div`,{className:`shell-schema-fdesc`,children:e.description}),e.options&&(0,B.jsxs)(`div`,{className:`shell-schema-fdesc`,children:[`Choices: `,e.options.join(` · `)]})]}),(0,B.jsx)(`td`,{className:`shell-schema-type`,children:e.type}),(0,B.jsx)(`td`,{className:`shell-schema-type`,children:e.source})]},e.key))})]})]}),n.schema.measures.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`shell-schema-kicker`,children:[`Semantic measures · `,n.schema.measures.length]}),(0,B.jsx)(`div`,{className:`shell-schema-measures`,children:n.schema.measures.map(e=>(0,B.jsxs)(`div`,{className:`shell-schema-measure`,children:[(0,B.jsx)(`span`,{className:`shell-schema-fname`,children:e.label}),(0,B.jsx)(`span`,{className:`shell-schema-type`,children:e.type})]},e.key))})]})]})]})]})})}var X9=`https://royal-imports-cfo-os.hf.space`,Z9=`login`,Q9=`application/x-loopable-nav`,Jqe=[],Yqe=[];function Xqe(){let e=()=>window.location.hash.replace(/^#\/?/,``),[t,n]=(0,L.useState)(e);return(0,L.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),t}function Zqe({entry:e}){return(0,B.jsxs)(`div`,{className:`shell-placeholder`,children:[(0,B.jsx)(`h1`,{children:e.label}),(0,B.jsx)(`p`,{children:`This surface runs in the current application.`}),(0,B.jsxs)(`a`,{className:`shell-link`,href:e.href,target:`_blank`,rel:`noreferrer`,children:[`Open `,e.label]})]})}function Qqe(){return(0,B.jsxs)(`svg`,{className:`shell-nav-icon`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,B.jsx)(`ellipse`,{cx:`8`,cy:`3.6`,rx:`5.3`,ry:`2.1`}),(0,B.jsx)(`path`,{d:`M2.7 3.6v8.8c0 1.16 2.37 2.1 5.3 2.1s5.3-.94 5.3-2.1V3.6`}),(0,B.jsx)(`path`,{d:`M2.7 8c0 1.16 2.37 2.1 5.3 2.1S13.3 9.16 13.3 8`})]})}function $qe(){return(0,B.jsxs)(`svg`,{className:`shell-nav-icon is-spark`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M6.2 2.2 7.5 5.5l3.3 1.3-3.3 1.3-1.3 3.3-1.3-3.3-3.3-1.3 3.3-1.3z`}),(0,B.jsx)(`path`,{d:`M12.2 9.4l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8z`})]})}function $9(){return(0,B.jsx)(`svg`,{className:`shell-nav-open`,viewBox:`0 0 12 12`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M4.6 3h4.4v4.4M8.8 3.2 3.2 8.8`})})}function eJe(){return(0,B.jsxs)(`svg`,{className:`shell-account-dots`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`3.5`,cy:`8`,r:`1.25`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.25`}),(0,B.jsx)(`circle`,{cx:`12.5`,cy:`8`,r:`1.25`})]})}function tJe(){return(0,B.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M2.5 4.4h11M2.5 8h11M2.5 11.6h11`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`})})}function nJe({user:e,utility:t,onSignOut:n,onSettings:r}){let[i,a]=(0,L.useState)(!1),o=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let s=(e.name.match(/[\p{L}\p{N}]/u)?.[0]??``).toUpperCase(),c=t.filter(e=>e.key!==`analyst`);return(0,B.jsxs)(`div`,{className:`shell-account-wrap`,ref:o,children:[i?(0,B.jsxs)(`div`,{className:`shell-menu`,role:`menu`,children:[(0,B.jsx)(`button`,{type:`button`,className:`shell-menu-item`,role:`menuitem`,onClick:()=>{a(!1),r(`account`)},children:`Profile`}),P9(e)?(0,B.jsx)(`button`,{type:`button`,className:`shell-menu-item`,role:`menuitem`,onClick:()=>{a(!1),r(`users`)},children:`Manage users`}):null,c.length?(0,B.jsx)(`div`,{className:`shell-menu-rule`,role:`separator`}):null,c.map(e=>(0,B.jsxs)(`a`,{className:`shell-menu-item`,role:`menuitem`,href:Y9(X9,e.key),target:`_blank`,rel:`noreferrer`,onClick:()=>a(!1),children:[e.label,(0,B.jsx)($9,{})]},e.key)),(0,B.jsx)(`div`,{className:`shell-menu-rule`,role:`separator`}),(0,B.jsx)(`button`,{type:`button`,className:`shell-menu-item is-signout`,role:`menuitem`,onClick:()=>{a(!1),n()},children:`Sign out`})]}):null,(0,B.jsxs)(`button`,{type:`button`,className:`shell-account`,"aria-haspopup":`menu`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[e.avatar?(0,B.jsx)(`img`,{className:`shell-avatar`,src:e.avatar,alt:``,"aria-hidden":`true`,style:{objectFit:`cover`,padding:0}}):(0,B.jsx)(`span`,{className:`shell-avatar`,"aria-hidden":`true`,children:s}),(0,B.jsxs)(`span`,{className:`shell-account-who`,children:[(0,B.jsx)(`span`,{className:`shell-account-name`,children:e.name}),(0,B.jsx)(`span`,{className:`shell-account-role`,children:P9(e)?`Admin`:`Member`})]}),(0,B.jsx)(eJe,{})]})]})}function rJe(){let[e,t]=(0,L.useState)({phase:`checking`}),[n,r]=(0,L.useState)({phase:`idle`}),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(``),[c,l]=(0,L.useState)(null),u=Xqe(),[d,f]=(0,L.useState)(()=>{try{return localStorage.getItem(`aios-nav-collapsed`)===`1`}catch{return!1}});(0,L.useEffect)(()=>{try{localStorage.setItem(`aios-nav-collapsed`,d?`1`:`0`)}catch{}},[d]);let[p,m]=(0,L.useState)(null);(0,L.useEffect)(()=>{d||m(null)},[d]);let h=(0,L.useCallback)(e=>t=>{let n=t.currentTarget.getBoundingClientRect();m({label:e,y:n.top+n.height/2})},[]),g=(0,L.useCallback)(()=>m(null),[]);(0,L.useEffect)(()=>{let e=()=>t({phase:`anon`}),n=e=>a(String(e.detail??``)||`The data could not be loaded.`),r=e=>s(String(e.detail??``)),i=()=>f(!0);return window.addEventListener(Id,e),window.addEventListener(Ld,n),window.addEventListener(Rd,r),window.addEventListener(Bd,i),()=>{window.removeEventListener(Id,e),window.removeEventListener(Ld,n),window.removeEventListener(Rd,r),window.removeEventListener(Bd,i)}},[]),(0,L.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>s(``),6e3);return()=>clearTimeout(e)},[o]),(0,L.useEffect)(()=>{let e=!1;return jKe().then(n=>{e||t(n?{phase:`authed`,user:n}:{phase:`anon`})}),()=>{e=!0}},[]);let _=e.phase===`authed`?e.user.username:null;(0,L.useEffect)(()=>{if(_===null){r({phase:`idle`});return}let e=!1;return r({phase:`loading`}),a(``),s(``),Dqe().then(n=>{if(!e)if(n.ok){let{main:e,utility:t}=Eqe(n.pages);r({phase:`ready`,entries:Iqe(e,X9),utility:t})}else n.status===401?t({phase:`anon`}):r({phase:`error`})}),()=>{e=!0}},[_]);let v=n.phase===`ready`?n.entries:Jqe,[y,b]=(0,L.useState)(J9),x=(0,L.useRef)(y);x.current=y;let[S,C]=(0,L.useState)(new Set),[w,T]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(_===null){b(J9),T(null);return}let e=!1;return kqe().then(t=>{e||b(t)}),()=>{e=!0}},[_]);let E=(0,L.useCallback)(e=>{let t=x.current;b(e),Aqe(e).then(e=>{e||(b(t),s(`The folder change was not saved — the store refused the write.`))})},[]),D=(0,L.useCallback)((e,t)=>{let n=x.current,r={...n.placement};t?r[e]=t:delete r[e],E({folders:n.folders,placement:r})},[E]),O=(0,L.useCallback)((e,t)=>{let n=x.current;E({folders:n.folders.map(n=>n.id===e?{...n,name:t}:n),placement:n.placement})},[E]),k=(0,L.useCallback)(e=>{let t=x.current;E({folders:t.folders.filter(t=>t.id!==e),placement:Object.fromEntries(Object.entries(t.placement).filter(([,t])=>t!==e))})},[E]),A=(0,L.useCallback)(e=>{C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[j,M]=(0,L.useState)(null),[ee,N]=(0,L.useState)(null),te=(0,L.useCallback)(e=>{let t=x.current;if(t.folders.length>=16){s(`At most 16 folders.`);return}let n=`nf_${Date.now().toString(36)}${Math.floor(Math.random()*1e6).toString(36)}`;E({folders:[...t.folders,{id:n,name:e}],placement:t.placement})},[E]);(0,L.useEffect)(()=>{e.phase===`anon`&&u!==Z9?window.location.hash=`#/${Z9}`:e.phase===`authed`&&u===Z9&&v.length&&(window.location.hash=`#/${Rqe(v)}`)},[e.phase,u,v]);let ne=(0,L.useCallback)(()=>{$d(),MKe().then(()=>t({phase:`anon`}))},[]);if(e.phase===`checking`)return(0,B.jsx)(`div`,{className:`shell-boot`,children:(0,B.jsx)(q9,{size:44,className:`login-brand`})});if(e.phase===`anon`)return(0,B.jsx)(wqe,{onSignedIn:e=>{$d(),t({phase:`authed`,user:e})}});let P=zqe(v,u),re=n.phase===`ready`?n.utility:Yqe,F=re.find(e=>e.key===`analyst`);return(0,B.jsxs)(`div`,{className:`shell-root`,children:[(0,B.jsxs)(`aside`,{className:`shell-side`+(d?` is-collapsed`:``),children:[(0,B.jsxs)(`div`,{className:`shell-side-head`,children:[(0,B.jsx)(`button`,{type:`button`,className:`shell-brand-btn`,disabled:!d,"aria-label":d?`Expand navigation`:void 0,onMouseEnter:d?h(`Expand navigation`):void 0,onMouseLeave:d?g:void 0,onClick:()=>f(!1),children:(0,B.jsx)(q9,{size:26,className:`shell-brand`})}),(0,B.jsx)(`button`,{type:`button`,className:`shell-rail-toggle`,"aria-label":`Minimize navigation`,"aria-expanded":!d,title:`Minimize navigation`,onClick:()=>f(!0),children:(0,B.jsx)(tJe,{})})]}),(0,B.jsxs)(`nav`,{className:`shell-nav`,children:[F?(0,B.jsxs)(`a`,{className:`shell-nav-item shell-nav-assist`,href:Y9(X9,`analyst`),target:`_blank`,rel:`noreferrer`,onMouseEnter:d?h(`AI assistant`):void 0,onMouseLeave:d?g:void 0,children:[(0,B.jsx)($qe,{}),(0,B.jsx)(`span`,{className:`shell-nav-label`,children:`AI assistant`}),(0,B.jsx)($9,{})]}):null,(0,B.jsxs)(`div`,{className:`shell-nav-list`+(ee===`__root__`?` is-drop-root`:``),onDragOver:e=>{e.dataTransfer.types.includes(Q9)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,N(`__root__`))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||N(null)},onDrop:e=>{let t=e.dataTransfer.getData(Q9);N(null),M(null),t&&(e.preventDefault(),D(t,null))},children:[jqe(v,d?J9:y,S).map(e=>{if(e.kind===`folder`)return(0,B.jsx)(Kqe,{folder:e.folder,count:e.count,open:e.open,collapsed:d,onToggle:()=>A(e.folder.id),onRename:t=>O(e.folder.id,t),onDelete:()=>k(e.folder.id),isDrop:ee===e.folder.id,dropProps:{onDragOver:t=>{t.dataTransfer.types.includes(Q9)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=`move`,N(e.folder.id))},onDrop:t=>{let n=t.dataTransfer.getData(Q9);N(null),M(null),n&&(t.preventDefault(),t.stopPropagation(),D(n,e.folder.id))}}},`folder:${e.folder.id}`);let t=e.entry,n=!!P&&P.key===t.key,r=`shell-nav-item`+(t.depth>0?` is-child`:``)+(n?` is-active`:``),i=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Qqe,{}),(0,B.jsx)(`span`,{className:`shell-nav-label`,children:t.label}),t.kind===`handoff`?(0,B.jsx)($9,{}):null]});if(t.kind===`group`)return(0,B.jsx)(`div`,{className:`shell-nav-group`,children:i},t.key);let a=d?{onMouseEnter:h(t.label),onMouseLeave:g}:{},o=t.kind===`native`?(0,B.jsx)(`a`,{className:r,href:t.href,...a,children:i}):(0,B.jsx)(`a`,{className:r,href:t.href,target:`_blank`,rel:`noreferrer`,...a,children:i});return(0,B.jsxs)(`div`,{className:`shell-nav-row`+(n?` is-active`:``)+(e.folderId?` is-foldered`:``)+(j===t.key?` is-dragging`:``),draggable:!d&&t.depth===0,onDragStart:e=>{e.dataTransfer.setData(Q9,t.key),e.dataTransfer.effectAllowed=`move`,M(t.key)},onDragEnd:()=>{M(null),N(null)},children:[o,!d&&t.depth===0&&(0,B.jsx)(Wqe,{entryLabel:t.label,canSchema:!0,onSchema:()=>T(t.key)})]},t.key)}),!d&&n.phase===`ready`&&v.length>0?(0,B.jsx)(Gqe,{onCreate:te}):null]}),n.phase===`loading`?(0,B.jsx)(`div`,{className:`shell-nav-note is-spin`,children:(0,B.jsx)(`span`,{className:`lp-spin`,role:`status`,"aria-label":`Loading`})}):null,n.phase===`error`?(0,B.jsx)(`div`,{className:`shell-nav-note`,children:`Navigation unavailable. Reload to retry.`}):null,n.phase===`ready`&&v.length===0?(0,B.jsx)(`div`,{className:`shell-nav-note`,children:`No surfaces are available to this account.`}):null]}),(0,B.jsx)(`div`,{className:`shell-side-bottom`,onClickCapture:d?e=>{e.preventDefault(),e.stopPropagation(),f(!1)}:void 0,onMouseEnter:d?h(e.user.name):void 0,onMouseLeave:d?g:void 0,children:(0,B.jsx)(nJe,{user:e.user,utility:re,onSignOut:ne,onSettings:l})})]}),p?(0,B.jsx)(`div`,{className:`shell-nav-tip`,style:{top:p.y},role:`tooltip`,"aria-hidden":`true`,children:p.label}):null,(0,B.jsx)(`main`,{className:`shell-main`,children:i&&P?.kind===`native`?(0,B.jsxs)(`div`,{className:`shell-placeholder`,children:[(0,B.jsx)(`h1`,{children:P.label}),(0,B.jsx)(`p`,{children:i}),(0,B.jsx)(`button`,{className:`login-submit shell-retry`,type:`button`,onClick:()=>window.location.reload(),children:`Retry`})]}):P?.kind===`native`&&Fqe.has(P.key)?(0,B.jsx)(wKe,{pageKey:P.key,label:P.label},P.key):P?.kind===`native`?(0,B.jsx)(`div`,{className:`shell-grid-host`,children:(0,B.jsx)(Ap,{children:(0,B.jsx)(KGe,{scope:P.key===`product_data`?`product`:`customer`},P.key)})}):P?(0,B.jsx)(Zqe,{entry:P}):n.phase===`ready`||n.phase===`error`?(0,B.jsxs)(`div`,{className:`shell-placeholder`,children:[(0,B.jsx)(`h1`,{children:`Nothing to show`}),(0,B.jsx)(`p`,{children:n.phase===`error`?`The navigation service did not answer. Reload to retry.`:`This account has access to no surfaces yet.`})]}):(0,B.jsx)(`div`,{className:`shell-loading`,children:(0,B.jsx)(`span`,{className:`lp-spin lp-spin--lg`,role:`status`,"aria-label":`Loading`})})}),c?(0,B.jsx)(bqe,{user:e.user,section:c,onSection:l,onClose:()=>l(null),onUser:e=>t({phase:`authed`,user:e}),moduleLabels:Object.fromEntries(v.map(e=>[e.key,e.label]))}):null,w?(0,B.jsx)(qqe,{schemaKey:w,onClose:()=>T(null)}):null,o?(0,B.jsx)(`div`,{className:`shell-toast`,role:`status`,"aria-live":`polite`,children:o}):null]})}var iJe=Wd()||window.__AIOS_GRID__!==void 0;function aJe(){return iJe?(0,B.jsx)(`div`,{style:{width:`100%`,height:`100%`,overflow:`hidden`},children:(0,B.jsx)(Ap,{children:(0,B.jsx)(KGe,{})})}):(0,B.jsx)(rJe,{})}qee(),iJe||ite(),(0,y.createRoot)(document.getElementById(`root`)).render((0,B.jsx)(L.StrictMode,{children:(0,B.jsx)(aJe,{})})); -