var gK=Object.defineProperty;var vK=(e,t,n)=>t in e?gK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ln=(e,t,n)=>(vK(e,typeof t!="symbol"?t+"":t,n),n);function xF(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Fl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E={exports:{}},cr={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Kg=Symbol.for("react.element"),yK=Symbol.for("react.portal"),xK=Symbol.for("react.fragment"),bK=Symbol.for("react.strict_mode"),_K=Symbol.for("react.profiler"),wK=Symbol.for("react.provider"),CK=Symbol.for("react.context"),SK=Symbol.for("react.forward_ref"),EK=Symbol.for("react.suspense"),PK=Symbol.for("react.memo"),TK=Symbol.for("react.lazy"),D3=Symbol.iterator;function IK(e){return e===null||typeof e!="object"?null:(e=D3&&e[D3]||e["@@iterator"],typeof e=="function"?e:null)}var bF={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_F=Object.assign,wF={};function Dh(e,t,n){this.props=e,this.context=t,this.refs=wF,this.updater=n||bF}Dh.prototype.isReactComponent={};Dh.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Dh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function CF(){}CF.prototype=Dh.prototype;function UE(e,t,n){this.props=e,this.context=t,this.refs=wF,this.updater=n||bF}var jE=UE.prototype=new CF;jE.constructor=UE;_F(jE,Dh.prototype);jE.isPureReactComponent=!0;var O3=Array.isArray,SF=Object.prototype.hasOwnProperty,HE={current:null},EF={key:!0,ref:!0,__self:!0,__source:!0};function PF(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)SF.call(t,r)&&!EF.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,be=oe[Se];if(0>>1;Sei(Me,Ce))Aei(Fe,Me)?(oe[Se]=Fe,oe[Ae]=Ce,Se=Ae):(oe[Se]=Me,oe[Ie]=Ce,Se=Ie);else if(Aei(Fe,Ce))oe[Se]=Fe,oe[Ae]=Ce,Se=Ae;else break e}}return he}function i(oe,he){var Ce=oe.sortIndex-he.sortIndex;return Ce!==0?Ce:oe.id-he.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],f=[],p=1,g=null,v=3,b=!1,_=!1,T=!1,I=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(oe){for(var he=n(f);he!==null;){if(he.callback===null)r(f);else if(he.startTime<=oe)r(f),he.sortIndex=he.expirationTime,t(c,he);else break;he=n(f)}}function N(oe){if(T=!1,O(oe),!_)if(n(c)!==null)_=!0,re(F);else{var he=n(f);he!==null&&se(N,he.startTime-oe)}}function F(oe,he){_=!1,T&&(T=!1,P(U),U=-1),b=!0;var Ce=v;try{for(O(he),g=n(c);g!==null&&(!(g.expirationTime>he)||oe&&!te());){var Se=g.callback;if(typeof Se=="function"){g.callback=null,v=g.priorityLevel;var be=Se(g.expirationTime<=he);he=e.unstable_now(),typeof be=="function"?g.callback=be:g===n(c)&&r(c),O(he)}else r(c);g=n(c)}if(g!==null)var Re=!0;else{var Ie=n(f);Ie!==null&&se(N,Ie.startTime-he),Re=!1}return Re}finally{g=null,v=Ce,b=!1}}var $=!1,j=null,U=-1,q=5,Y=-1;function te(){return!(e.unstable_now()-Yoe||125Se?(oe.sortIndex=Ce,t(f,oe),n(c)===null&&oe===n(f)&&(T?(P(U),U=-1):T=!0,se(N,Ce-Se))):(oe.sortIndex=be,t(c,oe),_||b||(_=!0,re(F))),oe},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(oe){var he=v;return function(){var Ce=v;v=he;try{return oe.apply(this,arguments)}finally{v=Ce}}}})(IF);(function(e){e.exports=IF})(TF);/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var kF=E.exports,Pa=TF.exports;function Yt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),YS=Object.prototype.hasOwnProperty,OK=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,N3={},L3={};function AK(e){return YS.call(L3,e)?!0:YS.call(N3,e)?!1:OK.test(e)?L3[e]=!0:(N3[e]=!0,!1)}function NK(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function LK(e,t,n,r){if(t===null||typeof t>"u"||NK(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function jo(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var mo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mo[e]=new jo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mo[t]=new jo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mo[e]=new jo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mo[e]=new jo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mo[e]=new jo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mo[e]=new jo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mo[e]=new jo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mo[e]=new jo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mo[e]=new jo(e,5,!1,e.toLowerCase(),null,!1,!1)});var WE=/[\-:]([a-z])/g;function GE(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(WE,GE);mo[t]=new jo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(WE,GE);mo[t]=new jo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(WE,GE);mo[t]=new jo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mo[e]=new jo(e,1,!1,e.toLowerCase(),null,!1,!1)});mo.xlinkHref=new jo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mo[e]=new jo(e,1,!1,e.toLowerCase(),null,!0,!0)});function qE(e,t,n,r){var i=mo.hasOwnProperty(t)?mo[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var c=` `+i[s].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=s&&0<=a);break}}}finally{Hw=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?xm(e):""}function FK(e){switch(e.tag){case 5:return xm(e.type);case 16:return xm("Lazy");case 13:return xm("Suspense");case 19:return xm("SuspenseList");case 0:case 2:case 15:return e=Kw(e.type,!1),e;case 11:return e=Kw(e.type.render,!1),e;case 1:return e=Kw(e.type,!0),e;default:return""}}function t2(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 Of:return"Fragment";case Df:return"Portal";case QS:return"Profiler";case ZE:return"StrictMode";case JS:return"Suspense";case e2:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case DF:return(e.displayName||"Context")+".Consumer";case RF:return(e._context.displayName||"Context")+".Provider";case XE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case YE:return t=e.displayName||null,t!==null?t:t2(e.type)||"Memo";case Pu:t=e._payload,e=e._init;try{return t2(e(t))}catch{}}return null}function zK(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("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return t2(t);case 8:return t===ZE?"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 nc(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function AF(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $K(e){var t=AF(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $y(e){e._valueTracker||(e._valueTracker=$K(e))}function NF(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=AF(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ix(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function n2(e,t){var n=t.checked;return fi({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function z3(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=nc(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function LF(e,t){t=t.checked,t!=null&&qE(e,"checked",t,!1)}function r2(e,t){LF(e,t);var n=nc(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")?i2(e,t.type,n):t.hasOwnProperty("defaultValue")&&i2(e,t.type,nc(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $3(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 i2(e,t,n){(t!=="number"||Ix(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bm=Array.isArray;function qf(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=By.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rg(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Dm={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},BK=["Webkit","ms","Moz","O"];Object.keys(Dm).forEach(function(e){BK.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Dm[t]=Dm[e]})});function BF(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Dm.hasOwnProperty(e)&&Dm[e]?(""+t).trim():t+"px"}function VF(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=BF(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var VK=fi({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 s2(e,t){if(t){if(VK[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Yt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Yt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Yt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Yt(62))}}function l2(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 u2=null;function QE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var c2=null,Zf=null,Xf=null;function U3(e){if(e=qg(e)){if(typeof c2!="function")throw Error(Yt(280));var t=e.stateNode;t&&(t=a_(t),c2(e.stateNode,e.type,t))}}function UF(e){Zf?Xf?Xf.push(e):Xf=[e]:Zf=e}function jF(){if(Zf){var e=Zf,t=Xf;if(Xf=Zf=null,U3(e),t)for(e=0;e>>=0,e===0?32:31-(QK(e)/JK|0)|0}var Vy=64,Uy=4194304;function _m(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 Dx(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=_m(a):(o&=s,o!==0&&(r=_m(o)))}else s=n&~i,s!==0?r=_m(s):o!==0&&(r=_m(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Wg(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ts(t),e[t]=n}function rW(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=Am),Y3=String.fromCharCode(32),Q3=!1;function uz(e,t){switch(e){case"keyup":return RW.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Af=!1;function OW(e,t){switch(e){case"compositionend":return cz(t);case"keypress":return t.which!==32?null:(Q3=!0,Y3);case"textInput":return e=t.data,e===Y3&&Q3?null:e;default:return null}}function AW(e,t){if(Af)return e==="compositionend"||!aP&&uz(e,t)?(e=sz(),q0=rP=Ru=null,Af=!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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nM(n)}}function pz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mz(){for(var e=window,t=Ix();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ix(e.document)}return t}function sP(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 jW(e){var t=mz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pz(n.ownerDocument.documentElement,n)){if(r!==null&&sP(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,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=rM(n,o);var s=rM(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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,Nf=null,g2=null,Lm=null,v2=!1;function iM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;v2||Nf==null||Nf!==Ix(r)||(r=Nf,"selectionStart"in r&&sP(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}),Lm&&ug(Lm,r)||(Lm=r,r=Nx(g2,"onSelect"),0zf||(e.current=C2[zf],C2[zf]=null,zf--)}function Xr(e,t){zf++,C2[zf]=e.current,e.current=t}var rc={},Eo=uc(rc),ta=uc(!1),wd=rc;function lh(e,t){var n=e.type.contextTypes;if(!n)return rc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function na(e){return e=e.childContextTypes,e!=null}function Fx(){ei(ta),ei(Eo)}function dM(e,t,n){if(Eo.current!==rc)throw Error(Yt(168));Xr(Eo,t),Xr(ta,n)}function Sz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Yt(108,zK(e)||"Unknown",i));return fi({},n,r)}function zx(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rc,wd=Eo.current,Xr(Eo,e),Xr(ta,ta.current),!0}function fM(e,t,n){var r=e.stateNode;if(!r)throw Error(Yt(169));n?(e=Sz(e,t,wd),r.__reactInternalMemoizedMergedChildContext=e,ei(ta),ei(Eo),Xr(Eo,e)):ei(ta),Xr(ta,n)}var Dl=null,s_=!1,oC=!1;function Ez(e){Dl===null?Dl=[e]:Dl.push(e)}function tG(e){s_=!0,Ez(e)}function cc(){if(!oC&&Dl!==null){oC=!0;var e=0,t=Rr;try{var n=Dl;for(Rr=1;e>=s,i-=s,zl=1<<32-Ts(t)+i|n<U?(q=j,j=null):q=j.sibling;var Y=v(P,j,O[U],N);if(Y===null){j===null&&(j=q);break}e&&j&&Y.alternate===null&&t(P,j),M=o(Y,M,U),$===null?F=Y:$.sibling=Y,$=Y,j=q}if(U===O.length)return n(P,j),oi&&Zc(P,U),F;if(j===null){for(;UU?(q=j,j=null):q=j.sibling;var te=v(P,j,Y.value,N);if(te===null){j===null&&(j=q);break}e&&j&&te.alternate===null&&t(P,j),M=o(te,M,U),$===null?F=te:$.sibling=te,$=te,j=q}if(Y.done)return n(P,j),oi&&Zc(P,U),F;if(j===null){for(;!Y.done;U++,Y=O.next())Y=g(P,Y.value,N),Y!==null&&(M=o(Y,M,U),$===null?F=Y:$.sibling=Y,$=Y);return oi&&Zc(P,U),F}for(j=r(P,j);!Y.done;U++,Y=O.next())Y=b(j,P,U,Y.value,N),Y!==null&&(e&&Y.alternate!==null&&j.delete(Y.key===null?U:Y.key),M=o(Y,M,U),$===null?F=Y:$.sibling=Y,$=Y);return e&&j.forEach(function(Z){return t(P,Z)}),oi&&Zc(P,U),F}function I(P,M,O,N){if(typeof O=="object"&&O!==null&&O.type===Of&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case zy:e:{for(var F=O.key,$=M;$!==null;){if($.key===F){if(F=O.type,F===Of){if($.tag===7){n(P,$.sibling),M=i($,O.props.children),M.return=P,P=M;break e}}else if($.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===Pu&&xM(F)===$.type){n(P,$.sibling),M=i($,O.props),M.ref=Yp(P,$,O),M.return=P,P=M;break e}n(P,$);break}else t(P,$);$=$.sibling}O.type===Of?(M=vd(O.props.children,P.mode,N,O.key),M.return=P,P=M):(N=nx(O.type,O.key,O.props,null,P.mode,N),N.ref=Yp(P,M,O),N.return=P,P=N)}return s(P);case Df:e:{for($=O.key;M!==null;){if(M.key===$)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){n(P,M.sibling),M=i(M,O.children||[]),M.return=P,P=M;break e}else{n(P,M);break}else t(P,M);M=M.sibling}M=hC(O,P.mode,N),M.return=P,P=M}return s(P);case Pu:return $=O._init,I(P,M,$(O._payload),N)}if(bm(O))return _(P,M,O,N);if(Wp(O))return T(P,M,O,N);Zy(P,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(n(P,M.sibling),M=i(M,O),M.return=P,P=M):(n(P,M),M=fC(O,P.mode,N),M.return=P,P=M),s(P)):n(P,M)}return I}var ch=Oz(!0),Az=Oz(!1),Zg={},tl=uc(Zg),hg=uc(Zg),pg=uc(Zg);function ud(e){if(e===Zg)throw Error(Yt(174));return e}function gP(e,t){switch(Xr(pg,t),Xr(hg,e),Xr(tl,Zg),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:a2(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=a2(t,e)}ei(tl),Xr(tl,t)}function dh(){ei(tl),ei(hg),ei(pg)}function Nz(e){ud(pg.current);var t=ud(tl.current),n=a2(t,e.type);t!==n&&(Xr(hg,e),Xr(tl,n))}function vP(e){hg.current===e&&(ei(tl),ei(hg))}var ci=uc(0);function Hx(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var aC=[];function yP(){for(var e=0;en?n:4,e(!0);var r=sC.transition;sC.transition={};try{e(!1),t()}finally{Rr=n,sC.transition=r}}function Yz(){return os().memoizedState}function oG(e,t,n){var r=qu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qz(e))Jz(t,n);else if(n=kz(e,t,n,r),n!==null){var i=Vo();Is(n,e,r,i),e5(n,t,r)}}function aG(e,t,n){var r=qu(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qz(e))Jz(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,ks(a,s)){var c=t.interleaved;c===null?(i.next=i,pP(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=kz(e,t,i,r),n!==null&&(i=Vo(),Is(n,e,r,i),e5(n,t,r))}}function Qz(e){var t=e.alternate;return e===di||t!==null&&t===di}function Jz(e,t){Fm=Kx=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function e5(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eP(e,n)}}var Wx={readContext:is,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useInsertionEffect:_o,useLayoutEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useMutableSource:_o,useSyncExternalStore:_o,useId:_o,unstable_isNewReconciler:!1},sG={readContext:is,useCallback:function(e,t){return Gs().memoizedState=[e,t===void 0?null:t],e},useContext:is,useEffect:_M,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Q0(4194308,4,Wz.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Q0(4194308,4,e,t)},useInsertionEffect:function(e,t){return Q0(4,2,e,t)},useMemo:function(e,t){var n=Gs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gs();return t=n!==void 0?n(t):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=oG.bind(null,di,e),[r.memoizedState,e]},useRef:function(e){var t=Gs();return e={current:e},t.memoizedState=e},useState:bM,useDebugValue:CP,useDeferredValue:function(e){return Gs().memoizedState=e},useTransition:function(){var e=bM(!1),t=e[0];return e=iG.bind(null,e[1]),Gs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=di,i=Gs();if(oi){if(n===void 0)throw Error(Yt(407));n=n()}else{if(n=t(),no===null)throw Error(Yt(349));(Sd&30)!==0||zz(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,_M(Bz.bind(null,r,o,e),[e]),r.flags|=2048,vg(9,$z.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Gs(),t=no.identifierPrefix;if(oi){var n=$l,r=zl;n=(r&~(1<<32-Ts(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mg++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Xs]=t,e[fg]=r,u5(e,t,!1,!1),t.stateNode=e;e:{switch(s=l2(n,r),n){case"dialog":Qr("cancel",e),Qr("close",e),i=r;break;case"iframe":case"object":case"embed":Qr("load",e),i=r;break;case"video":case"audio":for(i=0;ihh&&(t.flags|=128,r=!0,Qp(o,!1),t.lanes=4194304)}else{if(!r)if(e=Hx(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Qp(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!oi)return wo(t),null}else 2*wi()-o.renderingStartTime>hh&&n!==1073741824&&(t.flags|=128,r=!0,Qp(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=wi(),t.sibling=null,n=ci.current,Xr(ci,r?n&1|2:n&1),t):(wo(t),null);case 22:case 23:return kP(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(va&1073741824)!==0&&(wo(t),t.subtreeFlags&6&&(t.flags|=8192)):wo(t),null;case 24:return null;case 25:return null}throw Error(Yt(156,t.tag))}function mG(e,t){switch(uP(t),t.tag){case 1:return na(t.type)&&Fx(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dh(),ei(ta),ei(Eo),yP(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return vP(t),null;case 13:if(ei(ci),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Yt(340));uh()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ei(ci),null;case 4:return dh(),null;case 10:return hP(t.type._context),null;case 22:case 23:return kP(),null;case 24:return null;default:return null}}var Yy=!1,So=!1,gG=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function Uf(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){gi(e,t,r)}else n.current=null}function N2(e,t,n){try{n()}catch(r){gi(e,t,r)}}var MM=!1;function vG(e,t){if(y2=Ox,e=mz(),sP(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,c=-1,f=0,p=0,g=e,v=null;t:for(;;){for(var b;g!==n||i!==0&&g.nodeType!==3||(a=s+i),g!==o||r!==0&&g.nodeType!==3||(c=s+r),g.nodeType===3&&(s+=g.nodeValue.length),(b=g.firstChild)!==null;)v=g,g=b;for(;;){if(g===e)break t;if(v===n&&++f===i&&(a=s),v===o&&++p===r&&(c=s),(b=g.nextSibling)!==null)break;g=v,v=g.parentNode}g=b}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(x2={focusedElem:e,selectionRange:n},Ox=!1,Sn=t;Sn!==null;)if(t=Sn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Sn=e;else for(;Sn!==null;){t=Sn;try{var _=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var T=_.memoizedProps,I=_.memoizedState,P=t.stateNode,M=P.getSnapshotBeforeUpdate(t.elementType===t.type?T:_s(t.type,T),I);P.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Yt(163))}}catch(N){gi(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,Sn=e;break}Sn=t.return}return _=MM,MM=!1,_}function zm(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&N2(t,n,o)}i=i.next}while(i!==r)}}function c_(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,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 L2(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 f5(e){var t=e.alternate;t!==null&&(e.alternate=null,f5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xs],delete t[fg],delete t[w2],delete t[JW],delete t[eG])),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 h5(e){return e.tag===5||e.tag===3||e.tag===4}function RM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||h5(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 e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function F2(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=Lx));else if(r!==4&&(e=e.child,e!==null))for(F2(e,t,n),e=e.sibling;e!==null;)F2(e,t,n),e=e.sibling}function z2(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(z2(e,t,n),e=e.sibling;e!==null;)z2(e,t,n),e=e.sibling}var co=null,ws=!1;function xu(e,t,n){for(n=n.child;n!==null;)p5(e,t,n),n=n.sibling}function p5(e,t,n){if(el&&typeof el.onCommitFiberUnmount=="function")try{el.onCommitFiberUnmount(n_,n)}catch{}switch(n.tag){case 5:So||Uf(n,t);case 6:var r=co,i=ws;co=null,xu(e,t,n),co=r,ws=i,co!==null&&(ws?(e=co,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):co.removeChild(n.stateNode));break;case 18:co!==null&&(ws?(e=co,n=n.stateNode,e.nodeType===8?iC(e.parentNode,n):e.nodeType===1&&iC(e,n),sg(e)):iC(co,n.stateNode));break;case 4:r=co,i=ws,co=n.stateNode.containerInfo,ws=!0,xu(e,t,n),co=r,ws=i;break;case 0:case 11:case 14:case 15:if(!So&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&N2(n,t,s),i=i.next}while(i!==r)}xu(e,t,n);break;case 1:if(!So&&(Uf(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){gi(n,t,a)}xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:n.mode&1?(So=(r=So)||n.memoizedState!==null,xu(e,t,n),So=r):xu(e,t,n);break;default:xu(e,t,n)}}function DM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gG),t.forEach(function(r){var i=PG.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ys(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=wi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*xG(r/1960))-r,10e?16:e,Du===null)var r=!1;else{if(e=Du,Du=null,Zx=0,(xr&6)!==0)throw Error(Yt(331));var i=xr;for(xr|=4,Sn=e.current;Sn!==null;){var o=Sn,s=o.child;if((Sn.flags&16)!==0){var a=o.deletions;if(a!==null){for(var c=0;cwi()-TP?gd(e,0):PP|=n),ra(e,t)}function w5(e,t){t===0&&((e.mode&1)===0?t=1:(t=Uy,Uy<<=1,(Uy&130023424)===0&&(Uy=4194304)));var n=Vo();e=Gl(e,t),e!==null&&(Wg(e,t,n),ra(e,n))}function EG(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),w5(e,n)}function PG(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Yt(314))}r!==null&&r.delete(t),w5(e,n)}var C5;C5=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ta.current)ea=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ea=!1,hG(e,t,n);ea=(e.flags&131072)!==0}else ea=!1,oi&&(t.flags&1048576)!==0&&Pz(t,Bx,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;J0(e,t),e=t.pendingProps;var i=lh(t,Eo.current);Qf(t,n),i=bP(null,t,r,e,i,n);var o=_P();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,na(r)?(o=!0,zx(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mP(t),i.updater=l_,t.stateNode=i,i._reactInternals=t,I2(t,r,e,n),t=R2(null,t,r,!0,o,n)):(t.tag=0,oi&&o&&lP(t),$o(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(J0(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=IG(r),e=_s(r,e),i){case 0:t=M2(null,t,r,e,n);break e;case 1:t=TM(null,t,r,e,n);break e;case 11:t=EM(null,t,r,e,n);break e;case 14:t=PM(null,t,r,_s(r.type,e),n);break e}throw Error(Yt(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_s(r,i),M2(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_s(r,i),TM(e,t,r,i,n);case 3:e:{if(a5(t),e===null)throw Error(Yt(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Mz(e,t),jx(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=fh(Error(Yt(423)),t),t=IM(e,t,r,n,i);break e}else if(r!==i){i=fh(Error(Yt(424)),t),t=IM(e,t,r,n,i);break e}else for(ya=Ku(t.stateNode.containerInfo.firstChild),Ca=t,oi=!0,Ss=null,n=Az(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(uh(),r===i){t=ql(e,t,n);break e}$o(e,t,r,n)}t=t.child}return t;case 5:return Nz(t),e===null&&E2(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,b2(r,i)?s=null:o!==null&&b2(r,o)&&(t.flags|=32),o5(e,t),$o(e,t,s,n),t.child;case 6:return e===null&&E2(t),null;case 13:return s5(e,t,n);case 4:return gP(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ch(t,null,r,n):$o(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_s(r,i),EM(e,t,r,i,n);case 7:return $o(e,t,t.pendingProps,n),t.child;case 8:return $o(e,t,t.pendingProps.children,n),t.child;case 12:return $o(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Xr(Vx,r._currentValue),r._currentValue=s,o!==null)if(ks(o.value,s)){if(o.children===i.children&&!ta.current){t=ql(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=Vl(-1,n&-n),c.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var p=f.pending;p===null?c.next=c:(c.next=p.next,p.next=c),f.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),P2(o.return,n,t),a.lanes|=n;break}c=c.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(Yt(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),P2(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}$o(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Qf(t,n),i=is(i),r=r(i),t.flags|=1,$o(e,t,r,n),t.child;case 14:return r=t.type,i=_s(r,t.pendingProps),i=_s(r.type,i),PM(e,t,r,i,n);case 15:return r5(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_s(r,i),J0(e,t),t.tag=1,na(r)?(e=!0,zx(t)):e=!1,Qf(t,n),Dz(t,r,i),I2(t,r,i,n),R2(null,t,r,!0,e,n);case 19:return l5(e,t,n);case 22:return i5(e,t,n)}throw Error(Yt(156,t.tag))};function S5(e,t){return XF(e,t)}function TG(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 Qa(e,t,n,r){return new TG(e,t,n,r)}function RP(e){return e=e.prototype,!(!e||!e.isReactComponent)}function IG(e){if(typeof e=="function")return RP(e)?1:0;if(e!=null){if(e=e.$$typeof,e===XE)return 11;if(e===YE)return 14}return 2}function Zu(e,t){var n=e.alternate;return n===null?(n=Qa(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 nx(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")RP(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Of:return vd(n.children,i,o,t);case ZE:s=8,i|=8;break;case QS:return e=Qa(12,n,t,i|2),e.elementType=QS,e.lanes=o,e;case JS:return e=Qa(13,n,t,i),e.elementType=JS,e.lanes=o,e;case e2:return e=Qa(19,n,t,i),e.elementType=e2,e.lanes=o,e;case OF:return f_(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case RF:s=10;break e;case DF:s=9;break e;case XE:s=11;break e;case YE:s=14;break e;case Pu:s=16,r=null;break e}throw Error(Yt(130,e==null?e:typeof e,""))}return t=Qa(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function vd(e,t,n,r){return e=Qa(7,e,r,t),e.lanes=n,e}function f_(e,t,n,r){return e=Qa(22,e,r,t),e.elementType=OF,e.lanes=n,e.stateNode={isHidden:!1},e}function fC(e,t,n){return e=Qa(6,e,null,t),e.lanes=n,e}function hC(e,t,n){return t=Qa(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kG(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=Gw(0),this.expirationTimes=Gw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gw(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function DP(e,t,n,r,i,o,s,a,c){return e=new kG(e,t,n,a,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Qa(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},mP(o),e}function MG(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Ra})(al);const ic=VE(al.exports),NG=xF({__proto__:null,default:ic},[al.exports]);var BM=al.exports;XS.createRoot=BM.createRoot,XS.hydrateRoot=BM.hydrateRoot;/** * @remix-run/router v1.3.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Qx(){return Qx=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function FG(){return Math.random().toString(36).substr(2,8)}function UM(e,t){return{usr:e.state,key:e.key,idx:t}}function j2(e,t,n,r){return n===void 0&&(n=null),Qx({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?v_(t):t,{state:n,key:t&&t.key||r||FG()})}function I5(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function v_(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function zG(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=Ou.Pop,c=null,f=p();f==null&&(f=0,s.replaceState(Qx({},s.state,{idx:f}),""));function p(){return(s.state||{idx:null}).idx}function g(){a=Ou.Pop;let I=p(),P=I==null?null:I-f;f=I,c&&c({action:a,location:T.location,delta:P})}function v(I,P){a=Ou.Push;let M=j2(T.location,I,P);n&&n(M,I),f=p()+1;let O=UM(M,f),N=T.createHref(M);try{s.pushState(O,"",N)}catch{i.location.assign(N)}o&&c&&c({action:a,location:T.location,delta:1})}function b(I,P){a=Ou.Replace;let M=j2(T.location,I,P);n&&n(M,I),f=p();let O=UM(M,f),N=T.createHref(M);s.replaceState(O,"",N),o&&c&&c({action:a,location:T.location,delta:0})}function _(I){let P=i.location.origin!=="null"?i.location.origin:i.location.href,M=typeof I=="string"?I:I5(I);return ia(P,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,P)}let T={get action(){return a},get location(){return e(i,s)},listen(I){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(VM,g),c=I,()=>{i.removeEventListener(VM,g),c=null}},createHref(I){return t(i,I)},createURL:_,encodeLocation(I){let P=_(I);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:v,replace:b,go(I){return s.go(I)}};return T}var jM;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(jM||(jM={}));function $G(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?v_(t):t,i=R5(r.pathname||"/",n);if(i==null)return null;let o=k5(e);BG(o);let s=null;for(let a=0;s==null&&a{let c={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};c.relativePath.startsWith("/")&&(ia(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let f=eh([r,c.relativePath]),p=n.concat(c);o.children&&o.children.length>0&&(ia(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),k5(o.children,t,p,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:GG(f,o.index),routesMeta:p})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let c of M5(o.path))i(o,s,c)}),t}function M5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=M5(r.join("/")),a=[];return a.push(...s.map(c=>c===""?o:[o,c].join("/"))),i&&a.push(...s),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function BG(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:qG(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const VG=/^:\w+$/,UG=3,jG=2,HG=1,KG=10,WG=-2,HM=e=>e==="*";function GG(e,t){let n=e.split("/"),r=n.length;return n.some(HM)&&(r+=WG),t&&(r+=jG),n.filter(i=>!HM(i)).reduce((i,o)=>i+(VG.test(o)?UG:o===""?HG:KG),r)}function qG(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function ZG(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let s=0;s{if(p==="*"){let v=a[g]||"";s=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}return f[p]=JG(a[g]||"",p),f},{}),pathname:o,pathnameBase:s,pattern:e}}function YG(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),LP(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function QG(e){try{return decodeURI(e)}catch(t){return LP(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function JG(e,t){try{return decodeURIComponent(e)}catch(n){return LP(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function R5(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function LP(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}const eh=e=>e.join("/").replace(/\/\/+/g,"/"),eq=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");function tq(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const nq=["post","put","patch","delete"];[...nq];var y_={exports:{}},x_={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var rq=E.exports,iq=Symbol.for("react.element"),oq=Symbol.for("react.fragment"),aq=Object.prototype.hasOwnProperty,sq=rq.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lq={key:!0,ref:!0,__self:!0,__source:!0};function D5(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)aq.call(t,r)&&!lq.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:iq,type:e,key:o,ref:s,props:i,_owner:sq.current}}x_.Fragment=oq;x_.jsx=D5;x_.jsxs=D5;(function(e){e.exports=x_})(y_);const nr=y_.exports.Fragment,A=y_.exports.jsx,it=y_.exports.jsxs;/** * React Router v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function H2(){return H2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{i.value=r,i.getSnapshot=t,pC(i)&&o({inst:i})},[e,r,t]),fq(()=>(pC(i)&&o({inst:i}),e(()=>{pC(i)&&o({inst:i})})),[e]),pq(r),r}function pC(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!cq(n,r)}catch{return!0}}function gq(e,t,n){return t()}const vq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yq=!vq,xq=yq?gq:mq;"useSyncExternalStore"in Tx&&(e=>e.useSyncExternalStore)(Tx);const O5=E.exports.createContext(null),A5=E.exports.createContext(null),N5=E.exports.createContext(null),b_=E.exports.createContext(null),__=E.exports.createContext({outlet:null,matches:[]}),L5=E.exports.createContext(null);function FP(){return E.exports.useContext(b_)!=null}function bq(){return FP()||ia(!1),E.exports.useContext(b_).location}function _q(e,t){FP()||ia(!1);let{navigator:n}=E.exports.useContext(N5),r=E.exports.useContext(A5),{matches:i}=E.exports.useContext(__),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let c=bq(),f;if(t){var p;let T=typeof t=="string"?v_(t):t;a==="/"||((p=T.pathname)==null?void 0:p.startsWith(a))||ia(!1),f=T}else f=c;let g=f.pathname||"/",v=a==="/"?g:g.slice(a.length)||"/",b=$G(e,{pathname:v}),_=Eq(b&&b.map(T=>Object.assign({},T,{params:Object.assign({},s,T.params),pathname:eh([a,n.encodeLocation?n.encodeLocation(T.pathname).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?a:eh([a,n.encodeLocation?n.encodeLocation(T.pathnameBase).pathname:T.pathnameBase])})),i,r||void 0);return t&&_?A(b_.Provider,{value:{location:H2({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ou.Pop},children:_}):_}function wq(){let e=kq(),t=tq(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return it(nr,{children:[A("h2",{children:"Unexpected Application Error!"}),A("h3",{style:{fontStyle:"italic"},children:t}),n?A("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},children:n}):null,null]})}class Cq extends E.exports.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?A(__.Provider,{value:this.props.routeContext,children:A(L5.Provider,{value:this.state.error,children:this.props.component})}):this.props.children}}function Sq(e){let{routeContext:t,match:n,children:r}=e,i=E.exports.useContext(O5);return i&&i.static&&i.staticContext&&n.route.errorElement&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),A(__.Provider,{value:t,children:r})}function Eq(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let o=r.findIndex(s=>s.route.id&&(i==null?void 0:i[s.route.id]));o>=0||ia(!1),r=r.slice(0,Math.min(r.length,o+1))}return r.reduceRight((o,s,a)=>{let c=s.route.id?i==null?void 0:i[s.route.id]:null,f=n?s.route.errorElement||A(wq,{}):null,p=t.concat(r.slice(0,a+1)),g=()=>A(Sq,{match:s,routeContext:{outlet:o,matches:p},children:c?f:s.route.element!==void 0?s.route.element:o});return n&&(s.route.errorElement||a===0)?A(Cq,{location:n.location,component:f,error:c,children:g(),routeContext:{outlet:null,matches:p}}):g()},null)}var KM;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(KM||(KM={}));var Jx;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(Jx||(Jx={}));function Pq(e){let t=E.exports.useContext(A5);return t||ia(!1),t}function Tq(e){let t=E.exports.useContext(__);return t||ia(!1),t}function Iq(e){let t=Tq(),n=t.matches[t.matches.length-1];return n.route.id||ia(!1),n.route.id}function kq(){var e;let t=E.exports.useContext(L5),n=Pq(Jx.UseRouteError),r=Iq(Jx.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function F5(e){ia(!1)}function Mq(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ou.Pop,navigator:o,static:s=!1}=e;FP()&&ia(!1);let a=t.replace(/^\/*/,"/"),c=E.exports.useMemo(()=>({basename:a,navigator:o,static:s}),[a,o,s]);typeof r=="string"&&(r=v_(r));let{pathname:f="/",search:p="",hash:g="",state:v=null,key:b="default"}=r,_=E.exports.useMemo(()=>{let T=R5(f,a);return T==null?null:{pathname:T,search:p,hash:g,state:v,key:b}},[a,f,p,g,v,b]);return _==null?null:A(N5.Provider,{value:c,children:A(b_.Provider,{children:n,value:{location:_,navigationType:i}})})}function Rq(e){let{children:t,location:n}=e,r=E.exports.useContext(O5),i=r&&!t?r.router.routes:K2(t);return _q(i,n)}var WM;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(WM||(WM={}));new Promise(()=>{});function K2(e,t){t===void 0&&(t=[]);let n=[];return E.exports.Children.forEach(e,(r,i)=>{if(!E.exports.isValidElement(r))return;if(r.type===E.exports.Fragment){n.push.apply(n,K2(r.props.children,t));return}r.type!==F5&&ia(!1),!r.props.index||!r.props.children||ia(!1);let o=[...t,i],s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,hasErrorBoundary:r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle};r.props.children&&(s.children=K2(r.props.children,o)),n.push(s)}),n}/** * React Router DOM v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Dq(e){let{basename:t,children:n,window:r}=e,i=E.exports.useRef();i.current==null&&(i.current=LG({window:r,v5Compat:!0}));let o=i.current,[s,a]=E.exports.useState({action:o.action,location:o.location});return E.exports.useLayoutEffect(()=>o.listen(a),[o]),A(Mq,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o})}var GM;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(GM||(GM={}));var qM;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qM||(qM={}));var z5={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Fl,function(){var n,r,i;function o(a,c){if(!n)n=c;else if(!r)r=c;else{var f="var sharedChunk = {}; ("+n+")(sharedChunk); ("+r+")(sharedChunk);",p={};n(p),i=c(p),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([f],{type:"text/javascript"})))}}o(["exports"],function(a){var c=f;function f(d,l,h,y){this.cx=3*d,this.bx=3*(h-d)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(y-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=d,this.p1y=l,this.p2x=h,this.p2y=y}function p(d,l,h,y){const C=new c(d,l,h,y);return function(k){return C.solve(k)}}f.prototype={sampleCurveX:function(d){return((this.ax*d+this.bx)*d+this.cx)*d},sampleCurveY:function(d){return((this.ay*d+this.by)*d+this.cy)*d},sampleCurveDerivativeX:function(d){return(3*this.ax*d+2*this.bx)*d+this.cx},solveCurveX:function(d,l){if(l===void 0&&(l=1e-6),d<0)return 0;if(d>1)return 1;for(var h=d,y=0;y<8;y++){var C=this.sampleCurveX(h)-d;if(Math.abs(C)C?D=h:z=h,h=.5*(z-D)+D;return h},solve:function(d,l){return this.sampleCurveY(this.solveCurveX(d,l))}};const g=p(.25,.1,.25,1);function v(d,l,h){return Math.min(h,Math.max(l,d))}function b(d,l,h){const y=h-l,C=((d-l)%y+y)%y+l;return C===l?h:C}function _(d,...l){for(const h of l)for(const y in h)d[y]=h[y];return d}let T=1;function I(d,l){d.forEach(h=>{l[h]&&(l[h]=l[h].bind(l))})}function P(d,l,h){const y={};for(const C in d)y[C]=l.call(h||this,d[C],C,d);return y}function M(d,l,h){const y={};for(const C in d)l.call(h||this,d[C],C,d)&&(y[C]=d[C]);return y}function O(d){return Array.isArray(d)?d.map(O):typeof d=="object"&&d?P(d,O):d}const N={};function F(d){N[d]||(typeof console<"u"&&console.warn(d),N[d]=!0)}function $(d,l,h){return(h.y-d.y)*(l.x-d.x)>(l.y-d.y)*(h.x-d.x)}function j(d){let l=0;for(let h,y,C=0,k=d.length,D=k-1;C@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(h,y,C,k)=>{const D=C||k;return l[y]=!D||D.toLowerCase(),""}),l["max-age"]){const h=parseInt(l["max-age"],10);isNaN(h)?delete l["max-age"]:l["max-age"]=h}return l}let Y,te,Z=null;function X(d){if(Z==null){const l=d.navigator?d.navigator.userAgent:null;Z=!!d.safari||!(!l||!(/\b(iPad|iPhone|iPod)\b/.test(l)||l.match("Safari")&&!l.match("Chrome")))}return Z}function J(d){return typeof ImageBitmap<"u"&&d instanceof ImageBitmap}const ce={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(d){const l=requestAnimationFrame(d);return{cancel:()=>cancelAnimationFrame(l)}},getImageData(d,l=0){const h=window.document.createElement("canvas"),y=h.getContext("2d");if(!y)throw new Error("failed to create canvas 2d context");return h.width=d.width,h.height=d.height,y.drawImage(d,0,0,d.width,d.height),y.getImageData(-l,-l,d.width+2*l,d.height+2*l)},resolveURL:d=>(Y||(Y=document.createElement("a")),Y.href=d,Y.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(te==null&&(te=matchMedia("(prefers-reduced-motion: reduce)")),te.matches)}};var re=se;function se(d,l){this.x=d,this.y=l}se.prototype={clone:function(){return new se(this.x,this.y)},add:function(d){return this.clone()._add(d)},sub:function(d){return this.clone()._sub(d)},multByPoint:function(d){return this.clone()._multByPoint(d)},divByPoint:function(d){return this.clone()._divByPoint(d)},mult:function(d){return this.clone()._mult(d)},div:function(d){return this.clone()._div(d)},rotate:function(d){return this.clone()._rotate(d)},rotateAround:function(d,l){return this.clone()._rotateAround(d,l)},matMult:function(d){return this.clone()._matMult(d)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(d){return this.x===d.x&&this.y===d.y},dist:function(d){return Math.sqrt(this.distSqr(d))},distSqr:function(d){var l=d.x-this.x,h=d.y-this.y;return l*l+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(d){return Math.atan2(this.y-d.y,this.x-d.x)},angleWith:function(d){return this.angleWithSep(d.x,d.y)},angleWithSep:function(d,l){return Math.atan2(this.x*l-this.y*d,this.x*d+this.y*l)},_matMult:function(d){var l=d[2]*this.x+d[3]*this.y;return this.x=d[0]*this.x+d[1]*this.y,this.y=l,this},_add:function(d){return this.x+=d.x,this.y+=d.y,this},_sub:function(d){return this.x-=d.x,this.y-=d.y,this},_mult:function(d){return this.x*=d,this.y*=d,this},_div:function(d){return this.x/=d,this.y/=d,this},_multByPoint:function(d){return this.x*=d.x,this.y*=d.y,this},_divByPoint:function(d){return this.x/=d.x,this.y/=d.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var d=this.y;return this.y=this.x,this.x=-d,this},_rotate:function(d){var l=Math.cos(d),h=Math.sin(d),y=h*this.x+l*this.y;return this.x=l*this.x-h*this.y,this.y=y,this},_rotateAround:function(d,l){var h=Math.cos(d),y=Math.sin(d),C=l.y+y*(this.x-l.x)+h*(this.y-l.y);return this.x=l.x+h*(this.x-l.x)-y*(this.y-l.y),this.y=C,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},se.convert=function(d){return d instanceof se?d:Array.isArray(d)?new se(d[0],d[1]):d};const oe={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},he="mapbox-tiles";let Ce,Se,be=500,Re=50;function Ie(){typeof caches>"u"||Ce||(Ce=caches.open(he))}let Me=1/0;const Ae={supported:!1,testSupport:function(d){!Ue&&Ke&&(pt?gt(d):Fe=d)}};let Fe,Ke,Ue=!1,pt=!1;function gt(d){const l=d.createTexture();d.bindTexture(d.TEXTURE_2D,l);try{if(d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,Ke),d.isContextLost())return;Ae.supported=!0}catch{}d.deleteTexture(l),Ue=!0}typeof document<"u"&&(Ke=document.createElement("img"),Ke.onload=function(){Fe&>(Fe),Fe=null,pt=!0},Ke.onerror=function(){Ue=!0,Fe=null},Ke.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Dt);class qe extends Error{constructor(l,h,y,C){super(`AJAXError: ${h} (${l}): ${y}`),this.status=l,this.statusText=h,this.url=y,this.body=C}}const Ct=U()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function ot(d,l){const h=new AbortController,y=new Request(d.url,{method:d.method||"GET",body:d.body,credentials:d.credentials,headers:d.headers,referrer:Ct(),signal:h.signal});let C=!1,k=!1;return d.type==="json"&&y.headers.set("Accept","application/json"),((D,z,B)=>{if(k)return;const K=Date.now();fetch(y).then(ee=>ee.ok?((ie,de,ge)=>{(d.type==="arrayBuffer"?ie.arrayBuffer():d.type==="json"?ie.json():ie.text()).then(ve=>{k||(de&&ge&&function(Ne,Oe,Qe){if(Ie(),!Ce)return;const ht={status:Oe.status,statusText:Oe.statusText,headers:new Headers};Oe.headers.forEach((lt,Rt)=>ht.headers.set(Rt,lt));const Ge=q(Oe.headers.get("Cache-Control")||"");Ge["no-store"]||(Ge["max-age"]&&ht.headers.set("Expires",new Date(Qe+1e3*Ge["max-age"]).toUTCString()),new Date(ht.headers.get("Expires")).getTime()-Qe<42e4||function(lt,Rt){if(Se===void 0)try{new Response(new ReadableStream),Se=!0}catch{Se=!1}Se?Rt(lt.body):lt.blob().then(Rt)}(Oe,lt=>{const Rt=new Response(lt,ht);Ie(),Ce&&Ce.then(kt=>kt.put(function(hn){const vn=hn.indexOf("?");return vn<0?hn:hn.slice(0,vn)}(Ne.url),Rt)).catch(kt=>F(kt.message))}))}(y,de,ge),C=!0,l(null,ve,ie.headers.get("Cache-Control"),ie.headers.get("Expires")))}).catch(ve=>{k||l(new Error(ve.message))})})(ee,null,K):ee.blob().then(ie=>l(new qe(ee.status,ee.statusText,d.url,ie)))).catch(ee=>{ee.code!==20&&l(new Error(ee.message))})})(),{cancel:()=>{k=!0,C||h.abort()}}}const vt=function(d,l){if(/:\/\//.test(d.url)&&!/^https?:|^file:/.test(d.url)){if(U()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",d,l);if(!U()){const y=d.url.substring(0,d.url.indexOf("://"));return(oe.REGISTERED_PROTOCOLS[y]||ot)(d,l)}}if(!(/^file:/.test(h=d.url)||/^file:/.test(Ct())&&!/^\w+:/.test(h))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return ot(d,l);if(U()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",d,l,void 0,!0)}var h;return function(y,C){const k=new XMLHttpRequest;k.open(y.method||"GET",y.url,!0),y.type==="arrayBuffer"&&(k.responseType="arraybuffer");for(const D in y.headers)k.setRequestHeader(D,y.headers[D]);return y.type==="json"&&(k.responseType="text",k.setRequestHeader("Accept","application/json")),k.withCredentials=y.credentials==="include",k.onerror=()=>{C(new Error(k.statusText))},k.onload=()=>{if((k.status>=200&&k.status<300||k.status===0)&&k.response!==null){let D=k.response;if(y.type==="json")try{D=JSON.parse(k.response)}catch(z){return C(z)}C(null,D,k.getResponseHeader("Cache-Control"),k.getResponseHeader("Expires"))}else{const D=new Blob([k.response],{type:k.getResponseHeader("Content-Type")});C(new qe(k.status,k.statusText,y.url,D))}},k.send(y.body),{cancel:()=>k.abort()}}(d,l)},yt=function(d,l){return vt(_(d,{type:"arrayBuffer"}),l)};function Tt(d){const l=window.document.createElement("a");return l.href=d,l.protocol===window.document.location.protocol&&l.host===window.document.location.host}const et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ut,at;ut=[],at=0;const He=function(d,l){if(Ae.supported&&(d.headers||(d.headers={}),d.headers.accept="image/webp,*/*"),at>=oe.MAX_PARALLEL_IMAGE_REQUESTS){const k={requestParameters:d,callback:l,cancelled:!1,cancel(){this.cancelled=!0}};return ut.push(k),k}at++;let h=!1;const y=()=>{if(!h)for(h=!0,at--;ut.length&&at{y(),k?l(k):D&&function(K,ee){typeof createImageBitmap=="function"?function(ie,de){const ge=new Blob([new Uint8Array(ie)],{type:"image/png"});createImageBitmap(ge).then(ve=>{de(null,ve)}).catch(ve=>{de(new Error(`Could not load image because of ${ve.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(K,ee):function(ie,de){const ge=new Image;ge.onload=()=>{de(null,ge),URL.revokeObjectURL(ge.src),ge.onload=null,window.requestAnimationFrame(()=>{ge.src=et})},ge.onerror=()=>de(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const ve=new Blob([new Uint8Array(ie)],{type:"image/png"});ge.src=ie.byteLength?URL.createObjectURL(ve):et}(K,ee)}(D,(K,ee)=>{K!=null?l(K):ee!=null&&l(null,ee,{cacheControl:z,expires:B})})});return{cancel:()=>{C.cancel(),y()}}};function ct(d,l,h){h[d]&&h[d].indexOf(l)!==-1||(h[d]=h[d]||[],h[d].push(l))}function bt(d,l,h){if(h&&h[d]){const y=h[d].indexOf(l);y!==-1&&h[d].splice(y,1)}}class Ot{constructor(l,h={}){_(this,h),this.type=l}}class Lt extends Ot{constructor(l,h={}){super("error",_({error:l},h))}}class Ht{on(l,h){return this._listeners=this._listeners||{},ct(l,h,this._listeners),this}off(l,h){return bt(l,h,this._listeners),bt(l,h,this._oneTimeListeners),this}once(l,h){return this._oneTimeListeners=this._oneTimeListeners||{},ct(l,h,this._oneTimeListeners),this}fire(l,h){typeof l=="string"&&(l=new Ot(l,h||{}));const y=l.type;if(this.listens(y)){l.target=this;const C=this._listeners&&this._listeners[y]?this._listeners[y].slice():[];for(const z of C)z.call(this,l);const k=this._oneTimeListeners&&this._oneTimeListeners[y]?this._oneTimeListeners[y].slice():[];for(const z of k)bt(y,z,this._oneTimeListeners),z.call(this,l);const D=this._eventedParent;D&&(_(l,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),D.fire(l))}else l instanceof Lt&&console.error(l.error);return this}listens(l){return this._listeners&&this._listeners[l]&&this._listeners[l].length>0||this._oneTimeListeners&&this._oneTimeListeners[l]&&this._oneTimeListeners[l].length>0||this._eventedParent&&this._eventedParent.listens(l)}setEventedParent(l,h){return this._eventedParent=l,this._eventedParentData=h,this}}var ze={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Ye{constructor(l,h,y,C){this.message=(l?`${l}: `:"")+y,C&&(this.identifier=C),h!=null&&h.__line__&&(this.line=h.__line__)}}function Zt(d){const l=d.value;return l?[new Ye(d.key,l,"constants have been deprecated as of v8")]:[]}function an(d,...l){for(const h of l)for(const y in h)d[y]=h[y];return d}function Kt(d){return d instanceof Number||d instanceof String||d instanceof Boolean?d.valueOf():d}function Vt(d){if(Array.isArray(d))return d.map(Vt);if(d instanceof Object&&!(d instanceof Number||d instanceof String||d instanceof Boolean)){const l={};for(const h in d)l[h]=Vt(d[h]);return l}return Kt(d)}class It extends Error{constructor(l,h){super(h),this.message=h,this.key=l}}class Xt{constructor(l,h=[]){this.parent=l,this.bindings={};for(const[y,C]of h)this.bindings[y]=C}concat(l){return new Xt(this,l)}get(l){if(this.bindings[l])return this.bindings[l];if(this.parent)return this.parent.get(l);throw new Error(`${l} not found in scope.`)}has(l){return!!this.bindings[l]||!!this.parent&&this.parent.has(l)}}const pn={kind:"null"},tt={kind:"number"},At={kind:"string"},qt={kind:"boolean"},En={kind:"color"},yn={kind:"object"},St={kind:"value"},Pn={kind:"collator"},_n={kind:"formatted"},tn={kind:"padding"},zt={kind:"resolvedImage"};function dt(d,l){return{kind:"array",itemType:d,N:l}}function mt(d){if(d.kind==="array"){const l=mt(d.itemType);return typeof d.N=="number"?`array<${l}, ${d.N}>`:d.itemType.kind==="value"?"array":`array<${l}>`}return d.kind}const $t=[pn,tt,At,qt,En,_n,yn,dt(St),tn,zt];function Wt(d,l){if(l.kind==="error")return null;if(d.kind==="array"){if(l.kind==="array"&&(l.N===0&&l.itemType.kind==="value"||!Wt(d.itemType,l.itemType))&&(typeof d.N!="number"||d.N===l.N))return null}else{if(d.kind===l.kind)return null;if(d.kind==="value"){for(const h of $t)if(!Wt(h,l))return null}}return`Expected ${mt(d)} but found ${mt(l)} instead.`}function mn(d,l){return l.some(h=>h.kind===d.kind)}function An(d,l){return l.some(h=>h==="null"?d===null:h==="array"?Array.isArray(d):h==="object"?d&&!Array.isArray(d)&&typeof d=="object":h===typeof d)}var Qn,Jn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ye(d){return(d=Math.round(d))<0?0:d>255?255:d}function W(d){return ye(d[d.length-1]==="%"?parseFloat(d)/100*255:parseInt(d))}function Q(d){return(l=d[d.length-1]==="%"?parseFloat(d)/100:parseFloat(d))<0?0:l>1?1:l;var l}function fe(d,l,h){return h<0?h+=1:h>1&&(h-=1),6*h<1?d+(l-d)*h*6:2*h<1?l:3*h<2?d+(l-d)*(2/3-h)*6:d}try{Qn={}.parseCSSColor=function(d){var l,h=d.replace(/ /g,"").toLowerCase();if(h in Jn)return Jn[h].slice();if(h[0]==="#")return h.length===4?(l=parseInt(h.substr(1),16))>=0&&l<=4095?[(3840&l)>>4|(3840&l)>>8,240&l|(240&l)>>4,15&l|(15&l)<<4,1]:null:h.length===7&&(l=parseInt(h.substr(1),16))>=0&&l<=16777215?[(16711680&l)>>16,(65280&l)>>8,255&l,1]:null;var y=h.indexOf("("),C=h.indexOf(")");if(y!==-1&&C+1===h.length){var k=h.substr(0,y),D=h.substr(y+1,C-(y+1)).split(","),z=1;switch(k){case"rgba":if(D.length!==4)return null;z=Q(D.pop());case"rgb":return D.length!==3?null:[W(D[0]),W(D[1]),W(D[2]),z];case"hsla":if(D.length!==4)return null;z=Q(D.pop());case"hsl":if(D.length!==3)return null;var B=(parseFloat(D[0])%360+360)%360/360,K=Q(D[1]),ee=Q(D[2]),ie=ee<=.5?ee*(K+1):ee+K-ee*K,de=2*ee-ie;return[ye(255*fe(de,ie,B+1/3)),ye(255*fe(de,ie,B)),ye(255*fe(de,ie,B-1/3)),z];default:return null}}return null}}catch{}class ue{constructor(l,h,y,C=1){this.r=l,this.g=h,this.b=y,this.a=C}static parse(l){if(!l)return;if(l instanceof ue)return l;if(typeof l!="string")return;const h=Qn(l);return h?new ue(h[0]/255*h[3],h[1]/255*h[3],h[2]/255*h[3],h[3]):void 0}toString(){const[l,h,y,C]=this.toArray();return`rgba(${Math.round(l)},${Math.round(h)},${Math.round(y)},${C})`}toArray(){const{r:l,g:h,b:y,a:C}=this;return C===0?[0,0,0,0]:[255*l/C,255*h/C,255*y/C,C]}}ue.black=new ue(0,0,0,1),ue.white=new ue(1,1,1,1),ue.transparent=new ue(0,0,0,0),ue.red=new ue(1,0,0,1);class xe{constructor(l,h,y){this.sensitivity=l?h?"variant":"case":h?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(l,h){return this.collator.compare(l,h)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ke{constructor(l,h,y,C,k){this.text=l,this.image=h,this.scale=y,this.fontStack=C,this.textColor=k}}class we{constructor(l){this.sections=l}static fromString(l){return new we([new ke(l,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(l=>l.text.length!==0||l.image&&l.image.name.length!==0)}static factory(l){return l instanceof we?l:we.fromString(l)}toString(){return this.sections.length===0?"":this.sections.map(l=>l.text).join("")}}class Pe{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof Pe)return l;if(typeof l=="number")return new Pe([l,l,l,l]);if(Array.isArray(l)&&!(l.length<1||l.length>4)){for(const h of l)if(typeof h!="number")return;switch(l.length){case 1:l=[l[0],l[0],l[0],l[0]];break;case 2:l=[l[0],l[1],l[0],l[1]];break;case 3:l=[l[0],l[1],l[2],l[1]]}return new Pe(l)}}toString(){return JSON.stringify(this.values)}}class Le{constructor(l){this.name=l.name,this.available=l.available}toString(){return this.name}static fromString(l){return l?new Le({name:l,available:!1}):null}}function Ze(d,l,h,y){return typeof d=="number"&&d>=0&&d<=255&&typeof l=="number"&&l>=0&&l<=255&&typeof h=="number"&&h>=0&&h<=255?y===void 0||typeof y=="number"&&y>=0&&y<=1?null:`Invalid rgba value [${[d,l,h,y].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof y=="number"?[d,l,h,y]:[d,l,h]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Xe(d){if(d===null||typeof d=="string"||typeof d=="boolean"||typeof d=="number"||d instanceof ue||d instanceof xe||d instanceof we||d instanceof Pe||d instanceof Le)return!0;if(Array.isArray(d)){for(const l of d)if(!Xe(l))return!1;return!0}if(typeof d=="object"){for(const l in d)if(!Xe(d[l]))return!1;return!0}return!1}function Ve(d){if(d===null)return pn;if(typeof d=="string")return At;if(typeof d=="boolean")return qt;if(typeof d=="number")return tt;if(d instanceof ue)return En;if(d instanceof xe)return Pn;if(d instanceof we)return _n;if(d instanceof Pe)return tn;if(d instanceof Le)return zt;if(Array.isArray(d)){const l=d.length;let h;for(const y of d){const C=Ve(y);if(h){if(h===C)continue;h=St;break}h=C}return dt(h||St,l)}return yn}function Bt(d){const l=typeof d;return d===null?"":l==="string"||l==="number"||l==="boolean"?String(d):d instanceof ue||d instanceof we||d instanceof Pe||d instanceof Le?d.toString():JSON.stringify(d)}class Et{constructor(l,h){this.type=l,this.value=h}static parse(l,h){if(l.length!==2)return h.error(`'literal' expression requires exactly one argument, but found ${l.length-1} instead.`);if(!Xe(l[1]))return h.error("invalid value");const y=l[1];let C=Ve(y);const k=h.expectedType;return C.kind!=="array"||C.N!==0||!k||k.kind!=="array"||typeof k.N=="number"&&k.N!==0||(C=k),new Et(C,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class nt{constructor(l){this.name="ExpressionEvaluationError",this.message=l}toJSON(){return this.message}}const Ft={string:At,number:tt,boolean:qt,object:yn};class Gt{constructor(l,h){this.type=l,this.args=h}static parse(l,h){if(l.length<2)return h.error("Expected at least one argument.");let y,C=1;const k=l[0];if(k==="array"){let z,B;if(l.length>2){const K=l[1];if(typeof K!="string"||!(K in Ft)||K==="object")return h.error('The item type argument of "array" must be one of string, number, boolean',1);z=Ft[K],C++}else z=St;if(l.length>3){if(l[2]!==null&&(typeof l[2]!="number"||l[2]<0||l[2]!==Math.floor(l[2])))return h.error('The length argument to "array" must be a positive integer literal',2);B=l[2],C++}y=dt(z,B)}else{if(!Ft[k])throw new Error(`Types doesn't contain name = ${k}`);y=Ft[k]}const D=[];for(;Cl.outputDefined())}}const wn={"to-boolean":qt,"to-color":En,"to-number":tt,"to-string":At};class dn{constructor(l,h){this.type=l,this.args=h}static parse(l,h){if(l.length<2)return h.error("Expected at least one argument.");const y=l[0];if(!wn[y])throw new Error(`Can't parse ${y} as it is not part of the known types`);if((y==="to-boolean"||y==="to-string")&&l.length!==2)return h.error("Expected one argument.");const C=wn[y],k=[];for(let D=1;D4?`Invalid rbga value ${JSON.stringify(h)}: expected an array containing either three or four numeric values.`:Ze(h[0],h[1],h[2],h[3]),!y))return new ue(h[0]/255,h[1]/255,h[2]/255,h[3])}throw new nt(y||`Could not parse color from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}if(this.type.kind==="padding"){let h;for(const y of this.args){h=y.evaluate(l);const C=Pe.parse(h);if(C)return C}throw new nt(`Could not parse padding from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}if(this.type.kind==="number"){let h=null;for(const y of this.args){if(h=y.evaluate(l),h===null)return 0;const C=Number(h);if(!isNaN(C))return C}throw new nt(`Could not convert ${JSON.stringify(h)} to number.`)}return this.type.kind==="formatted"?we.fromString(Bt(this.args[0].evaluate(l))):this.type.kind==="resolvedImage"?Le.fromString(Bt(this.args[0].evaluate(l))):Bt(this.args[0].evaluate(l))}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every(l=>l.outputDefined())}}const Cn=["Unknown","Point","LineString","Polygon"];class jn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Cn[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(l){let h=this._parseColorCache[l];return h||(h=this._parseColorCache[l]=ue.parse(l)),h}}class or{constructor(l,h,y,C){this.name=l,this.type=h,this._evaluate=y,this.args=C}evaluate(l){return this._evaluate(l,this.args)}eachChild(l){this.args.forEach(l)}outputDefined(){return!1}static parse(l,h){const y=l[0],C=or.definitions[y];if(!C)return h.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);const k=Array.isArray(C)?C[0]:C.type,D=Array.isArray(C)?[[C[1],C[2]]]:C.overloads,z=D.filter(([K])=>!Array.isArray(K)||K.length===l.length-1);let B=null;for(const[K,ee]of z){B=new As(h.registry,h.path,null,h.scope);const ie=[];let de=!1;for(let ge=1;ge{return de=ie,Array.isArray(de)?`(${de.map(mt).join(", ")})`:`(${mt(de.type)}...)`;var de}).join(" | "),ee=[];for(let ie=1;ie=l[2]||d[1]<=l[1]||d[3]>=l[3])}function Mn(d,l){const h=(180+d[0])/360,y=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d[1]*Math.PI/360)))/360,C=Math.pow(2,l.z);return[Math.round(h*C*dr),Math.round(y*C*dr)]}function Nn(d,l,h){const y=d[0]-l[0],C=d[1]-l[1],k=d[0]-h[0],D=d[1]-h[1];return y*D-k*C==0&&y*k<=0&&C*D<=0}function ti(d,l){let h=!1;for(let D=0,z=l.length;D(y=d)[1]!=(k=B[K+1])[1]>y[1]&&y[0]<(k[0]-C[0])*(y[1]-C[1])/(k[1]-C[1])+C[0]&&(h=!h)}}var y,C,k;return h}function wr(d,l){for(let h=0;h0&&z<0||D<0&&z>0}function Bn(d,l,h){for(const K of h)for(let ee=0;eeh[2]){const C=.5*y;let k=d[0]-h[0]>C?-y:h[0]-d[0]>C?y:0;k===0&&(k=d[0]-h[2]>C?-y:h[2]-d[0]>C?y:0),d[0]+=k}Fr(l,d)}function ru(d,l,h,y){const C=Math.pow(2,y.z)*dr,k=[y.x*dr,y.y*dr],D=[];for(const z of d)for(const B of z){const K=[B.x+k[0],B.y+k[1]];ko(K,l,h,C),D.push(K)}return D}function Gd(d,l,h,y){const C=Math.pow(2,y.z)*dr,k=[y.x*dr,y.y*dr],D=[];for(const B of d){const K=[];for(const ee of B){const ie=[ee.x+k[0],ee.y+k[1]];Fr(l,ie),K.push(ie)}D.push(K)}if(l[2]-l[0]<=C/2){(z=l)[0]=z[1]=1/0,z[2]=z[3]=-1/0;for(const B of D)for(const K of B)ko(K,l,h,C)}var z;return D}class ls{constructor(l,h){this.type=qt,this.geojson=l,this.geometries=h}static parse(l,h){if(l.length!==2)return h.error(`'within' expression requires exactly one argument, but found ${l.length-1} instead.`);if(Xe(l[1])){const y=l[1];if(y.type==="FeatureCollection")for(let C=0;C{l&&!Vn(h)&&(l=!1)}),l}function er(d){if(d instanceof or&&d.name==="feature-state")return!1;let l=!0;return d.eachChild(h=>{l&&!er(h)&&(l=!1)}),l}function zr(d,l){if(d instanceof or&&l.indexOf(d.name)>=0)return!1;let h=!0;return d.eachChild(y=>{h&&!zr(y,l)&&(h=!1)}),h}class Fi{constructor(l,h){this.type=h.type,this.name=l,this.boundExpression=h}static parse(l,h){if(l.length!==2||typeof l[1]!="string")return h.error("'var' expression requires exactly one string literal argument.");const y=l[1];return h.scope.has(y)?new Fi(y,h.scope.get(y)):h.error(`Unknown variable "${y}". Make sure "${y}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(l){return this.boundExpression.evaluate(l)}eachChild(){}outputDefined(){return!1}}class As{constructor(l,h=[],y,C=new Xt,k=[]){this.registry=l,this.path=h,this.key=h.map(D=>`[${D}]`).join(""),this.scope=C,this.errors=k,this.expectedType=y}parse(l,h,y,C,k={}){return h?this.concat(h,y,C)._parse(l,k):this._parse(l,k)}_parse(l,h){function y(C,k,D){return D==="assert"?new Gt(k,[C]):D==="coerce"?new dn(k,[C]):C}if(l!==null&&typeof l!="string"&&typeof l!="boolean"&&typeof l!="number"||(l=["literal",l]),Array.isArray(l)){if(l.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const C=l[0];if(typeof C!="string")return this.error(`Expression name must be a string, but found ${typeof C} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const k=this.registry[C];if(k){let D=k.parse(l,this);if(!D)return null;if(this.expectedType){const z=this.expectedType,B=D.type;if(z.kind!=="string"&&z.kind!=="number"&&z.kind!=="boolean"&&z.kind!=="object"&&z.kind!=="array"||B.kind!=="value")if(z.kind!=="color"&&z.kind!=="formatted"&&z.kind!=="resolvedImage"||B.kind!=="value"&&B.kind!=="string")if(z.kind!=="padding"||B.kind!=="value"&&B.kind!=="number"&&B.kind!=="array"){if(this.checkSubtype(z,B))return null}else D=y(D,z,h.typeAnnotation||"coerce");else D=y(D,z,h.typeAnnotation||"coerce");else D=y(D,z,h.typeAnnotation||"assert")}if(!(D instanceof Et)&&D.type.kind!=="resolvedImage"&&Ho(D)){const z=new jn;try{D=new Et(D.type,D.evaluate(z))}catch(B){return this.error(B.message),null}}return D}return this.error(`Unknown expression "${C}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(l===void 0?"'undefined' value invalid. Use null instead.":typeof l=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof l} instead.`)}concat(l,h,y){const C=typeof l=="number"?this.path.concat(l):this.path,k=y?this.scope.concat(y):this.scope;return new As(this.registry,C,h||null,k,this.errors)}error(l,...h){const y=`${this.key}${h.map(C=>`[${C}]`).join("")}`;this.errors.push(new It(y,l))}checkSubtype(l,h){const y=Wt(l,h);return y&&this.error(y),y}}function Ho(d){if(d instanceof Fi)return Ho(d.boundExpression);if(d instanceof or&&d.name==="error"||d instanceof Wr||d instanceof ls)return!1;const l=d instanceof dn||d instanceof Gt;let h=!0;return d.eachChild(y=>{h=l?h&&Ho(y):h&&y instanceof Et}),!!h&&Vn(d)&&zr(d,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function dl(d,l){const h=d.length-1;let y,C,k=0,D=h,z=0;for(;k<=D;)if(z=Math.floor((k+D)/2),y=d[z],C=d[z+1],y<=l){if(z===h||ll))throw new nt("Input is not a number.");D=z-1}return 0}class us{constructor(l,h,y){this.type=l,this.input=h,this.labels=[],this.outputs=[];for(const[C,k]of y)this.labels.push(C),this.outputs.push(k)}static parse(l,h){if(l.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return h.error("Expected an even number of arguments.");const y=h.parse(l[1],1,tt);if(!y)return null;const C=[];let k=null;h.expectedType&&h.expectedType.kind!=="value"&&(k=h.expectedType);for(let D=1;D=z)return h.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',K);const ie=h.parse(B,ee,k);if(!ie)return null;k=k||ie.type,C.push([z,ie])}return new us(k,y,C)}evaluate(l){const h=this.labels,y=this.outputs;if(h.length===1)return y[0].evaluate(l);const C=this.input.evaluate(l);if(C<=h[0])return y[0].evaluate(l);const k=h.length;return C>=h[k-1]?y[k-1].evaluate(l):y[dl(h,C)].evaluate(l)}eachChild(l){l(this.input);for(const h of this.outputs)l(h)}outputDefined(){return this.outputs.every(l=>l.outputDefined())}}function Cr(d,l,h){return d*(1-h)+l*h}var cs=Object.freeze({__proto__:null,number:Cr,color:function(d,l,h){return new ue(Cr(d.r,l.r,h),Cr(d.g,l.g,h),Cr(d.b,l.b,h),Cr(d.a,l.a,h))},array:function(d,l,h){return d.map((y,C)=>Cr(y,l[C],h))},padding:function(d,l,h){const y=d.values,C=l.values;return new Pe([Cr(y[0],C[0],h),Cr(y[1],C[1],h),Cr(y[2],C[2],h),Cr(y[3],C[3],h)])}});const Nv=.95047,Lv=1.08883,ep=4/29,qd=6/29,Fv=3*qd*qd,$1=Math.PI/180,B1=180/Math.PI;function tp(d){return d>.008856451679035631?Math.pow(d,1/3):d/Fv+ep}function np(d){return d>qd?d*d*d:Fv*(d-ep)}function rp(d){return 255*(d<=.0031308?12.92*d:1.055*Math.pow(d,1/2.4)-.055)}function ip(d){return(d/=255)<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4)}function fr(d){const l=ip(d.r),h=ip(d.g),y=ip(d.b),C=tp((.4124564*l+.3575761*h+.1804375*y)/Nv),k=tp((.2126729*l+.7151522*h+.072175*y)/1);return{l:116*k-16,a:500*(C-k),b:200*(k-tp((.0193339*l+.119192*h+.9503041*y)/Lv)),alpha:d.a}}function zv(d){let l=(d.l+16)/116,h=isNaN(d.a)?l:l+d.a/500,y=isNaN(d.b)?l:l-d.b/200;return l=1*np(l),h=Nv*np(h),y=Lv*np(y),new ue(rp(3.2404542*h-1.5371385*l-.4985314*y),rp(-.969266*h+1.8760108*l+.041556*y),rp(.0556434*h-.2040259*l+1.0572252*y),d.alpha)}function V1(d,l,h){const y=l-d;return d+h*(y>180||y<-180?y-360*Math.round(y/360):y)}const vc={forward:fr,reverse:zv,interpolate:function(d,l,h){return{l:Cr(d.l,l.l,h),a:Cr(d.a,l.a,h),b:Cr(d.b,l.b,h),alpha:Cr(d.alpha,l.alpha,h)}}},yc={forward:function(d){const{l,a:h,b:y}=fr(d),C=Math.atan2(y,h)*B1;return{h:C<0?C+360:C,c:Math.sqrt(h*h+y*y),l,alpha:d.a}},reverse:function(d){const l=d.h*$1,h=d.c;return zv({l:d.l,a:Math.cos(l)*h,b:Math.sin(l)*h,alpha:d.alpha})},interpolate:function(d,l,h){return{h:V1(d.h,l.h,h),c:Cr(d.c,l.c,h),l:Cr(d.l,l.l,h),alpha:Cr(d.alpha,l.alpha,h)}}};var $v=Object.freeze({__proto__:null,lab:vc,hcl:yc});class Mo{constructor(l,h,y,C,k){this.type=l,this.operator=h,this.interpolation=y,this.input=C,this.labels=[],this.outputs=[];for(const[D,z]of k)this.labels.push(D),this.outputs.push(z)}static interpolationFactor(l,h,y,C){let k=0;if(l.name==="exponential")k=op(h,l.base,y,C);else if(l.name==="linear")k=op(h,1,y,C);else if(l.name==="cubic-bezier"){const D=l.controlPoints;k=new c(D[0],D[1],D[2],D[3]).solve(op(h,1,y,C))}return k}static parse(l,h){let[y,C,k,...D]=l;if(!Array.isArray(C)||C.length===0)return h.error("Expected an interpolation type expression.",1);if(C[0]==="linear")C={name:"linear"};else if(C[0]==="exponential"){const K=C[1];if(typeof K!="number")return h.error("Exponential interpolation requires a numeric base.",1,1);C={name:"exponential",base:K}}else{if(C[0]!=="cubic-bezier")return h.error(`Unknown interpolation type ${String(C[0])}`,1,0);{const K=C.slice(1);if(K.length!==4||K.some(ee=>typeof ee!="number"||ee<0||ee>1))return h.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);C={name:"cubic-bezier",controlPoints:K}}}if(l.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return h.error("Expected an even number of arguments.");if(k=h.parse(k,2,tt),!k)return null;const z=[];let B=null;y==="interpolate-hcl"||y==="interpolate-lab"?B=En:h.expectedType&&h.expectedType.kind!=="value"&&(B=h.expectedType);for(let K=0;K=ee)return h.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',de);const ve=h.parse(ie,ge,B);if(!ve)return null;B=B||ve.type,z.push([ee,ve])}return B.kind==="number"||B.kind==="color"||B.kind==="padding"||B.kind==="array"&&B.itemType.kind==="number"&&typeof B.N=="number"?new Mo(B,y,C,k,z):h.error(`Type ${mt(B)} is not interpolatable.`)}evaluate(l){const h=this.labels,y=this.outputs;if(h.length===1)return y[0].evaluate(l);const C=this.input.evaluate(l);if(C<=h[0])return y[0].evaluate(l);const k=h.length;if(C>=h[k-1])return y[k-1].evaluate(l);const D=dl(h,C),z=Mo.interpolationFactor(this.interpolation,C,h[D],h[D+1]),B=y[D].evaluate(l),K=y[D+1].evaluate(l);return this.operator==="interpolate"?cs[this.type.kind.toLowerCase()](B,K,z):this.operator==="interpolate-hcl"?yc.reverse(yc.interpolate(yc.forward(B),yc.forward(K),z)):vc.reverse(vc.interpolate(vc.forward(B),vc.forward(K),z))}eachChild(l){l(this.input);for(const h of this.outputs)l(h)}outputDefined(){return this.outputs.every(l=>l.outputDefined())}}function op(d,l,h,y){const C=y-h,k=d-h;return C===0?0:l===1?k/C:(Math.pow(l,k)-1)/(Math.pow(l,C)-1)}class Zd{constructor(l,h){this.type=l,this.args=h}static parse(l,h){if(l.length<2)return h.error("Expectected at least one argument.");let y=null;const C=h.expectedType;C&&C.kind!=="value"&&(y=C);const k=[];for(const z of l.slice(1)){const B=h.parse(z,1+k.length,y,void 0,{typeAnnotation:"omit"});if(!B)return null;y=y||B.type,k.push(B)}if(!y)throw new Error("No output type");const D=C&&k.some(z=>Wt(C,z.type));return new Zd(D?St:y,k)}evaluate(l){let h,y=null,C=0;for(const k of this.args)if(C++,y=k.evaluate(l),y&&y instanceof Le&&!y.available&&(h||(h=y.name),y=null,C===this.args.length&&(y=h)),y!==null)break;return y}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every(l=>l.outputDefined())}}class Xd{constructor(l,h){this.type=h.type,this.bindings=[].concat(l),this.result=h}evaluate(l){return this.result.evaluate(l)}eachChild(l){for(const h of this.bindings)l(h[1]);l(this.result)}static parse(l,h){if(l.length<4)return h.error(`Expected at least 3 arguments, but found ${l.length-1} instead.`);const y=[];for(let k=1;k=y.length)throw new nt(`Array index out of bounds: ${h} > ${y.length-1}.`);if(h!==Math.floor(h))throw new nt(`Array index must be an integer, but found ${h} instead.`);return y[h]}eachChild(l){l(this.index),l(this.input)}outputDefined(){return!1}}class sp{constructor(l,h){this.type=qt,this.needle=l,this.haystack=h}static parse(l,h){if(l.length!==3)return h.error(`Expected 2 arguments, but found ${l.length-1} instead.`);const y=h.parse(l[1],1,St),C=h.parse(l[2],2,St);return y&&C?mn(y.type,[qt,At,tt,pn,St])?new sp(y,C):h.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(y.type)} instead`):null}evaluate(l){const h=this.needle.evaluate(l),y=this.haystack.evaluate(l);if(!y)return!1;if(!An(h,["boolean","string","number","null"]))throw new nt(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Ve(h))} instead.`);if(!An(y,["string","array"]))throw new nt(`Expected second argument to be of type array or string, but found ${mt(Ve(y))} instead.`);return y.indexOf(h)>=0}eachChild(l){l(this.needle),l(this.haystack)}outputDefined(){return!0}}class Yd{constructor(l,h,y){this.type=tt,this.needle=l,this.haystack=h,this.fromIndex=y}static parse(l,h){if(l.length<=2||l.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${l.length-1} instead.`);const y=h.parse(l[1],1,St),C=h.parse(l[2],2,St);if(!y||!C)return null;if(!mn(y.type,[qt,At,tt,pn,St]))return h.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(y.type)} instead`);if(l.length===4){const k=h.parse(l[3],3,tt);return k?new Yd(y,C,k):null}return new Yd(y,C)}evaluate(l){const h=this.needle.evaluate(l),y=this.haystack.evaluate(l);if(!An(h,["boolean","string","number","null"]))throw new nt(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Ve(h))} instead.`);if(!An(y,["string","array"]))throw new nt(`Expected second argument to be of type array or string, but found ${mt(Ve(y))} instead.`);if(this.fromIndex){const C=this.fromIndex.evaluate(l);return y.indexOf(h,C)}return y.indexOf(h)}eachChild(l){l(this.needle),l(this.haystack),this.fromIndex&&l(this.fromIndex)}outputDefined(){return!1}}class lp{constructor(l,h,y,C,k,D){this.inputType=l,this.type=h,this.input=y,this.cases=C,this.outputs=k,this.otherwise=D}static parse(l,h){if(l.length<5)return h.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if(l.length%2!=1)return h.error("Expected an even number of arguments.");let y,C;h.expectedType&&h.expectedType.kind!=="value"&&(C=h.expectedType);const k={},D=[];for(let K=2;KNumber.MAX_SAFE_INTEGER)return de.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ve=="number"&&Math.floor(ve)!==ve)return de.error("Numeric branch labels must be integer values.");if(y){if(de.checkSubtype(y,Ve(ve)))return null}else y=Ve(ve);if(k[String(ve)]!==void 0)return de.error("Branch labels must be unique.");k[String(ve)]=D.length}const ge=h.parse(ie,K,C);if(!ge)return null;C=C||ge.type,D.push(ge)}const z=h.parse(l[1],1,St);if(!z)return null;const B=h.parse(l[l.length-1],l.length-1,C);return B?z.type.kind!=="value"&&h.concat(1).checkSubtype(y,z.type)?null:new lp(y,C,z,k,D,B):null}evaluate(l){const h=this.input.evaluate(l);return(Ve(h)===this.inputType&&this.outputs[this.cases[h]]||this.otherwise).evaluate(l)}eachChild(l){l(this.input),this.outputs.forEach(l),l(this.otherwise)}outputDefined(){return this.outputs.every(l=>l.outputDefined())&&this.otherwise.outputDefined()}}class up{constructor(l,h,y){this.type=l,this.branches=h,this.otherwise=y}static parse(l,h){if(l.length<4)return h.error(`Expected at least 3 arguments, but found only ${l.length-1}.`);if(l.length%2!=0)return h.error("Expected an odd number of arguments.");let y;h.expectedType&&h.expectedType.kind!=="value"&&(y=h.expectedType);const C=[];for(let D=1;Dh.outputDefined())&&this.otherwise.outputDefined()}}class Qd{constructor(l,h,y,C){this.type=l,this.input=h,this.beginIndex=y,this.endIndex=C}static parse(l,h){if(l.length<=2||l.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${l.length-1} instead.`);const y=h.parse(l[1],1,St),C=h.parse(l[2],2,tt);if(!y||!C)return null;if(!mn(y.type,[dt(St),At,St]))return h.error(`Expected first argument to be of type array or string, but found ${mt(y.type)} instead`);if(l.length===4){const k=h.parse(l[3],3,tt);return k?new Qd(y.type,y,C,k):null}return new Qd(y.type,y,C)}evaluate(l){const h=this.input.evaluate(l),y=this.beginIndex.evaluate(l);if(!An(h,["string","array"]))throw new nt(`Expected first argument to be of type array or string, but found ${mt(Ve(h))} instead.`);if(this.endIndex){const C=this.endIndex.evaluate(l);return h.slice(y,C)}return h.slice(y)}eachChild(l){l(this.input),l(this.beginIndex),this.endIndex&&l(this.endIndex)}outputDefined(){return!1}}function Bv(d,l){return d==="=="||d==="!="?l.kind==="boolean"||l.kind==="string"||l.kind==="number"||l.kind==="null"||l.kind==="value":l.kind==="string"||l.kind==="number"||l.kind==="value"}function Vv(d,l,h,y){return y.compare(l,h)===0}function iu(d,l,h){const y=d!=="=="&&d!=="!=";return class $5{constructor(k,D,z){this.type=qt,this.lhs=k,this.rhs=D,this.collator=z,this.hasUntypedArgument=k.type.kind==="value"||D.type.kind==="value"}static parse(k,D){if(k.length!==3&&k.length!==4)return D.error("Expected two or three arguments.");const z=k[0];let B=D.parse(k[1],1,St);if(!B)return null;if(!Bv(z,B.type))return D.concat(1).error(`"${z}" comparisons are not supported for type '${mt(B.type)}'.`);let K=D.parse(k[2],2,St);if(!K)return null;if(!Bv(z,K.type))return D.concat(2).error(`"${z}" comparisons are not supported for type '${mt(K.type)}'.`);if(B.type.kind!==K.type.kind&&B.type.kind!=="value"&&K.type.kind!=="value")return D.error(`Cannot compare types '${mt(B.type)}' and '${mt(K.type)}'.`);y&&(B.type.kind==="value"&&K.type.kind!=="value"?B=new Gt(K.type,[B]):B.type.kind!=="value"&&K.type.kind==="value"&&(K=new Gt(B.type,[K])));let ee=null;if(k.length===4){if(B.type.kind!=="string"&&K.type.kind!=="string"&&B.type.kind!=="value"&&K.type.kind!=="value")return D.error("Cannot use collator to compare non-string types.");if(ee=D.parse(k[3],3,Pn),!ee)return null}return new $5(B,K,ee)}evaluate(k){const D=this.lhs.evaluate(k),z=this.rhs.evaluate(k);if(y&&this.hasUntypedArgument){const B=Ve(D),K=Ve(z);if(B.kind!==K.kind||B.kind!=="string"&&B.kind!=="number")throw new nt(`Expected arguments for "${d}" to be (string, string) or (number, number), but found (${B.kind}, ${K.kind}) instead.`)}if(this.collator&&!y&&this.hasUntypedArgument){const B=Ve(D),K=Ve(z);if(B.kind!=="string"||K.kind!=="string")return l(k,D,z)}return this.collator?h(k,D,z,this.collator.evaluate(k)):l(k,D,z)}eachChild(k){k(this.lhs),k(this.rhs),this.collator&&k(this.collator)}outputDefined(){return!0}}}const U1=iu("==",function(d,l,h){return l===h},Vv),j1=iu("!=",function(d,l,h){return l!==h},function(d,l,h,y){return!Vv(0,l,h,y)}),H1=iu("<",function(d,l,h){return l",function(d,l,h){return l>h},function(d,l,h,y){return y.compare(l,h)>0}),W1=iu("<=",function(d,l,h){return l<=h},function(d,l,h,y){return y.compare(l,h)<=0}),G1=iu(">=",function(d,l,h){return l>=h},function(d,l,h,y){return y.compare(l,h)>=0});class cp{constructor(l,h,y,C,k){this.type=At,this.number=l,this.locale=h,this.currency=y,this.minFractionDigits=C,this.maxFractionDigits=k}static parse(l,h){if(l.length!==3)return h.error("Expected two arguments.");const y=h.parse(l[1],1,tt);if(!y)return null;const C=l[2];if(typeof C!="object"||Array.isArray(C))return h.error("NumberFormat options argument must be an object.");let k=null;if(C.locale&&(k=h.parse(C.locale,1,At),!k))return null;let D=null;if(C.currency&&(D=h.parse(C.currency,1,At),!D))return null;let z=null;if(C["min-fraction-digits"]&&(z=h.parse(C["min-fraction-digits"],1,tt),!z))return null;let B=null;return C["max-fraction-digits"]&&(B=h.parse(C["max-fraction-digits"],1,tt),!B)?null:new cp(y,k,D,z,B)}evaluate(l){return new Intl.NumberFormat(this.locale?this.locale.evaluate(l):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(l):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(l):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(l):void 0}).format(this.number.evaluate(l))}eachChild(l){l(this.number),this.locale&&l(this.locale),this.currency&&l(this.currency),this.minFractionDigits&&l(this.minFractionDigits),this.maxFractionDigits&&l(this.maxFractionDigits)}outputDefined(){return!1}}class Jd{constructor(l){this.type=_n,this.sections=l}static parse(l,h){if(l.length<2)return h.error("Expected at least one argument.");const y=l[1];if(!Array.isArray(y)&&typeof y=="object")return h.error("First argument must be an image or text section.");const C=[];let k=!1;for(let D=1;D<=l.length-1;++D){const z=l[D];if(k&&typeof z=="object"&&!Array.isArray(z)){k=!1;let B=null;if(z["font-scale"]&&(B=h.parse(z["font-scale"],1,tt),!B))return null;let K=null;if(z["text-font"]&&(K=h.parse(z["text-font"],1,dt(At)),!K))return null;let ee=null;if(z["text-color"]&&(ee=h.parse(z["text-color"],1,En),!ee))return null;const ie=C[C.length-1];ie.scale=B,ie.font=K,ie.textColor=ee}else{const B=h.parse(l[D],1,St);if(!B)return null;const K=B.type.kind;if(K!=="string"&&K!=="value"&&K!=="null"&&K!=="resolvedImage")return h.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");k=!0,C.push({content:B,scale:null,font:null,textColor:null})}}return new Jd(C)}evaluate(l){return new we(this.sections.map(h=>{const y=h.content.evaluate(l);return Ve(y)===zt?new ke("",y,null,null,null):new ke(Bt(y),null,h.scale?h.scale.evaluate(l):null,h.font?h.font.evaluate(l).join(","):null,h.textColor?h.textColor.evaluate(l):null)}))}eachChild(l){for(const h of this.sections)l(h.content),h.scale&&l(h.scale),h.font&&l(h.font),h.textColor&&l(h.textColor)}outputDefined(){return!1}}class dp{constructor(l){this.type=zt,this.input=l}static parse(l,h){if(l.length!==2)return h.error("Expected two arguments.");const y=h.parse(l[1],1,At);return y?new dp(y):h.error("No image name provided.")}evaluate(l){const h=this.input.evaluate(l),y=Le.fromString(h);return y&&l.availableImages&&(y.available=l.availableImages.indexOf(h)>-1),y}eachChild(l){l(this.input)}outputDefined(){return!1}}class fp{constructor(l){this.type=tt,this.input=l}static parse(l,h){if(l.length!==2)return h.error(`Expected 1 argument, but found ${l.length-1} instead.`);const y=h.parse(l[1],1);return y?y.type.kind!=="array"&&y.type.kind!=="string"&&y.type.kind!=="value"?h.error(`Expected argument of type string or array, but found ${mt(y.type)} instead.`):new fp(y):null}evaluate(l){const h=this.input.evaluate(l);if(typeof h=="string"||Array.isArray(h))return h.length;throw new nt(`Expected value to be of type string or array, but found ${mt(Ve(h))} instead.`)}eachChild(l){l(this.input)}outputDefined(){return!1}}const ou={"==":U1,"!=":j1,">":K1,"<":H1,">=":G1,"<=":W1,array:Gt,at:ap,boolean:Gt,case:up,coalesce:Zd,collator:Wr,format:Jd,image:dp,in:sp,"index-of":Yd,interpolate:Mo,"interpolate-hcl":Mo,"interpolate-lab":Mo,length:fp,let:Xd,literal:Et,match:lp,number:Gt,"number-format":cp,object:Gt,slice:Qd,step:us,string:Gt,"to-boolean":dn,"to-color":dn,"to-number":dn,"to-string":dn,var:Fi,within:ls};function Uv(d,[l,h,y,C]){l=l.evaluate(d),h=h.evaluate(d),y=y.evaluate(d);const k=C?C.evaluate(d):1,D=Ze(l,h,y,k);if(D)throw new nt(D);return new ue(l/255*k,h/255*k,y/255*k,k)}function jv(d,l){return d in l}function ef(d,l){const h=l[d];return h===void 0?null:h}function fl(d){return{type:d}}function Hv(d){return{result:"success",value:d}}function au(d){return{result:"error",value:d}}function Or(d){return d["property-type"]==="data-driven"||d["property-type"]==="cross-faded-data-driven"}function Kv(d){return!!d.expression&&d.expression.parameters.indexOf("zoom")>-1}function tr(d){return!!d.expression&&d.expression.interpolated}function hr(d){return d instanceof Number?"number":d instanceof String?"string":d instanceof Boolean?"boolean":Array.isArray(d)?"array":d===null?"null":typeof d}function Ir(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)}function $r(d){return d}function xc(d,l){const h=l.type==="color",y=d.stops&&typeof d.stops[0][0]=="object",C=y||!(y||d.property!==void 0),k=d.type||(tr(l)?"exponential":"interval");if(h||l.type==="padding"){const K=h?ue.parse:Pe.parse;(d=an({},d)).stops&&(d.stops=d.stops.map(ee=>[ee[0],K(ee[1])])),d.default=K(d.default?d.default:l.default)}if(d.colorSpace&&d.colorSpace!=="rgb"&&!$v[d.colorSpace])throw new Error(`Unknown color space: ${d.colorSpace}`);let D,z,B;if(k==="exponential")D=Wv;else if(k==="interval")D=Z1;else if(k==="categorical"){D=q1,z=Object.create(null);for(const K of d.stops)z[K[0]]=K[1];B=typeof d.stops[0][0]}else{if(k!=="identity")throw new Error(`Unknown function type "${k}"`);D=X1}if(y){const K={},ee=[];for(let ge=0;gege[0]),evaluate:({zoom:ge},ve)=>Wv({stops:ie,base:d.base},l,ge).evaluate(ge,ve)}}if(C){const K=k==="exponential"?{name:"exponential",base:d.base!==void 0?d.base:1}:null;return{kind:"camera",interpolationType:K,interpolationFactor:Mo.interpolationFactor.bind(void 0,K),zoomStops:d.stops.map(ee=>ee[0]),evaluate:({zoom:ee})=>D(d,l,ee,z,B)}}return{kind:"source",evaluate(K,ee){const ie=ee&&ee.properties?ee.properties[d.property]:void 0;return ie===void 0?su(d.default,l.default):D(d,l,ie,z,B)}}}function su(d,l,h){return d!==void 0?d:l!==void 0?l:h!==void 0?h:void 0}function q1(d,l,h,y,C){return su(typeof h===C?y[h]:void 0,d.default,l.default)}function Z1(d,l,h){if(hr(h)!=="number")return su(d.default,l.default);const y=d.stops.length;if(y===1||h<=d.stops[0][0])return d.stops[0][1];if(h>=d.stops[y-1][0])return d.stops[y-1][1];const C=dl(d.stops.map(k=>k[0]),h);return d.stops[C][1]}function Wv(d,l,h){const y=d.base!==void 0?d.base:1;if(hr(h)!=="number")return su(d.default,l.default);const C=d.stops.length;if(C===1||h<=d.stops[0][0])return d.stops[0][1];if(h>=d.stops[C-1][0])return d.stops[C-1][1];const k=dl(d.stops.map(ee=>ee[0]),h),D=function(ee,ie,de,ge){const ve=ge-de,Ne=ee-de;return ve===0?0:ie===1?Ne/ve:(Math.pow(ie,Ne)-1)/(Math.pow(ie,ve)-1)}(h,y,d.stops[k][0],d.stops[k+1][0]),z=d.stops[k][1],B=d.stops[k+1][1];let K=cs[l.type]||$r;if(d.colorSpace&&d.colorSpace!=="rgb"){const ee=$v[d.colorSpace];K=(ie,de)=>ee.reverse(ee.interpolate(ee.forward(ie),ee.forward(de),D))}return typeof z.evaluate=="function"?{evaluate(...ee){const ie=z.evaluate.apply(void 0,ee),de=B.evaluate.apply(void 0,ee);if(ie!==void 0&&de!==void 0)return K(ie,de,D)}}:K(z,B,D)}function X1(d,l,h){switch(l.type){case"color":h=ue.parse(h);break;case"formatted":h=we.fromString(h.toString());break;case"resolvedImage":h=Le.fromString(h.toString());break;case"padding":h=Pe.parse(h);break;default:hr(h)===l.type||l.type==="enum"&&l.values[h]||(h=void 0)}return su(h,d.default,l.default)}or.register(ou,{error:[{kind:"error"},[At],(d,[l])=>{throw new nt(l.evaluate(d))}],typeof:[At,[St],(d,[l])=>mt(Ve(l.evaluate(d)))],"to-rgba":[dt(tt,4),[En],(d,[l])=>l.evaluate(d).toArray()],rgb:[En,[tt,tt,tt],Uv],rgba:[En,[tt,tt,tt,tt],Uv],has:{type:qt,overloads:[[[At],(d,[l])=>jv(l.evaluate(d),d.properties())],[[At,yn],(d,[l,h])=>jv(l.evaluate(d),h.evaluate(d))]]},get:{type:St,overloads:[[[At],(d,[l])=>ef(l.evaluate(d),d.properties())],[[At,yn],(d,[l,h])=>ef(l.evaluate(d),h.evaluate(d))]]},"feature-state":[St,[At],(d,[l])=>ef(l.evaluate(d),d.featureState||{})],properties:[yn,[],d=>d.properties()],"geometry-type":[At,[],d=>d.geometryType()],id:[St,[],d=>d.id()],zoom:[tt,[],d=>d.globals.zoom],"heatmap-density":[tt,[],d=>d.globals.heatmapDensity||0],"line-progress":[tt,[],d=>d.globals.lineProgress||0],accumulated:[St,[],d=>d.globals.accumulated===void 0?null:d.globals.accumulated],"+":[tt,fl(tt),(d,l)=>{let h=0;for(const y of l)h+=y.evaluate(d);return h}],"*":[tt,fl(tt),(d,l)=>{let h=1;for(const y of l)h*=y.evaluate(d);return h}],"-":{type:tt,overloads:[[[tt,tt],(d,[l,h])=>l.evaluate(d)-h.evaluate(d)],[[tt],(d,[l])=>-l.evaluate(d)]]},"/":[tt,[tt,tt],(d,[l,h])=>l.evaluate(d)/h.evaluate(d)],"%":[tt,[tt,tt],(d,[l,h])=>l.evaluate(d)%h.evaluate(d)],ln2:[tt,[],()=>Math.LN2],pi:[tt,[],()=>Math.PI],e:[tt,[],()=>Math.E],"^":[tt,[tt,tt],(d,[l,h])=>Math.pow(l.evaluate(d),h.evaluate(d))],sqrt:[tt,[tt],(d,[l])=>Math.sqrt(l.evaluate(d))],log10:[tt,[tt],(d,[l])=>Math.log(l.evaluate(d))/Math.LN10],ln:[tt,[tt],(d,[l])=>Math.log(l.evaluate(d))],log2:[tt,[tt],(d,[l])=>Math.log(l.evaluate(d))/Math.LN2],sin:[tt,[tt],(d,[l])=>Math.sin(l.evaluate(d))],cos:[tt,[tt],(d,[l])=>Math.cos(l.evaluate(d))],tan:[tt,[tt],(d,[l])=>Math.tan(l.evaluate(d))],asin:[tt,[tt],(d,[l])=>Math.asin(l.evaluate(d))],acos:[tt,[tt],(d,[l])=>Math.acos(l.evaluate(d))],atan:[tt,[tt],(d,[l])=>Math.atan(l.evaluate(d))],min:[tt,fl(tt),(d,l)=>Math.min(...l.map(h=>h.evaluate(d)))],max:[tt,fl(tt),(d,l)=>Math.max(...l.map(h=>h.evaluate(d)))],abs:[tt,[tt],(d,[l])=>Math.abs(l.evaluate(d))],round:[tt,[tt],(d,[l])=>{const h=l.evaluate(d);return h<0?-Math.round(-h):Math.round(h)}],floor:[tt,[tt],(d,[l])=>Math.floor(l.evaluate(d))],ceil:[tt,[tt],(d,[l])=>Math.ceil(l.evaluate(d))],"filter-==":[qt,[At,St],(d,[l,h])=>d.properties()[l.value]===h.value],"filter-id-==":[qt,[St],(d,[l])=>d.id()===l.value],"filter-type-==":[qt,[At],(d,[l])=>d.geometryType()===l.value],"filter-<":[qt,[At,St],(d,[l,h])=>{const y=d.properties()[l.value],C=h.value;return typeof y==typeof C&&y{const h=d.id(),y=l.value;return typeof h==typeof y&&h":[qt,[At,St],(d,[l,h])=>{const y=d.properties()[l.value],C=h.value;return typeof y==typeof C&&y>C}],"filter-id->":[qt,[St],(d,[l])=>{const h=d.id(),y=l.value;return typeof h==typeof y&&h>y}],"filter-<=":[qt,[At,St],(d,[l,h])=>{const y=d.properties()[l.value],C=h.value;return typeof y==typeof C&&y<=C}],"filter-id-<=":[qt,[St],(d,[l])=>{const h=d.id(),y=l.value;return typeof h==typeof y&&h<=y}],"filter->=":[qt,[At,St],(d,[l,h])=>{const y=d.properties()[l.value],C=h.value;return typeof y==typeof C&&y>=C}],"filter-id->=":[qt,[St],(d,[l])=>{const h=d.id(),y=l.value;return typeof h==typeof y&&h>=y}],"filter-has":[qt,[St],(d,[l])=>l.value in d.properties()],"filter-has-id":[qt,[],d=>d.id()!==null&&d.id()!==void 0],"filter-type-in":[qt,[dt(At)],(d,[l])=>l.value.indexOf(d.geometryType())>=0],"filter-id-in":[qt,[dt(St)],(d,[l])=>l.value.indexOf(d.id())>=0],"filter-in-small":[qt,[At,dt(St)],(d,[l,h])=>h.value.indexOf(d.properties()[l.value])>=0],"filter-in-large":[qt,[At,dt(St)],(d,[l,h])=>function(y,C,k,D){for(;k<=D;){const z=k+D>>1;if(C[z]===y)return!0;C[z]>y?D=z-1:k=z+1}return!1}(d.properties()[l.value],h.value,0,h.value.length-1)],all:{type:qt,overloads:[[[qt,qt],(d,[l,h])=>l.evaluate(d)&&h.evaluate(d)],[fl(qt),(d,l)=>{for(const h of l)if(!h.evaluate(d))return!1;return!0}]]},any:{type:qt,overloads:[[[qt,qt],(d,[l,h])=>l.evaluate(d)||h.evaluate(d)],[fl(qt),(d,l)=>{for(const h of l)if(h.evaluate(d))return!0;return!1}]]},"!":[qt,[qt],(d,[l])=>!l.evaluate(d)],"is-supported-script":[qt,[At],(d,[l])=>{const h=d.globals&&d.globals.isSupportedScript;return!h||h(l.evaluate(d))}],upcase:[At,[At],(d,[l])=>l.evaluate(d).toUpperCase()],downcase:[At,[At],(d,[l])=>l.evaluate(d).toLowerCase()],concat:[At,fl(St),(d,l)=>l.map(h=>Bt(h.evaluate(d))).join("")],"resolved-locale":[At,[Pn],(d,[l])=>l.evaluate(d).resolvedLocale()]});class tf{constructor(l,h){this.expression=l,this._warningHistory={},this._evaluator=new jn,this._defaultValue=h?function(y){return y.type==="color"&&Ir(y.default)?new ue(0,0,0,0):y.type==="color"?ue.parse(y.default)||null:y.type==="padding"?Pe.parse(y.default)||null:y.default===void 0?null:y.default}(h):null,this._enumValues=h&&h.type==="enum"?h.values:null}evaluateWithoutErrorHandling(l,h,y,C,k,D){return this._evaluator.globals=l,this._evaluator.feature=h,this._evaluator.featureState=y,this._evaluator.canonical=C,this._evaluator.availableImages=k||null,this._evaluator.formattedSection=D,this.expression.evaluate(this._evaluator)}evaluate(l,h,y,C,k,D){this._evaluator.globals=l,this._evaluator.feature=h||null,this._evaluator.featureState=y||null,this._evaluator.canonical=C,this._evaluator.availableImages=k||null,this._evaluator.formattedSection=D||null;try{const z=this.expression.evaluate(this._evaluator);if(z==null||typeof z=="number"&&z!=z)return this._defaultValue;if(this._enumValues&&!(z in this._enumValues))throw new nt(`Expected value to be one of ${Object.keys(this._enumValues).map(B=>JSON.stringify(B)).join(", ")}, but found ${JSON.stringify(z)} instead.`);return z}catch(z){return this._warningHistory[z.message]||(this._warningHistory[z.message]=!0,typeof console<"u"&&console.warn(z.message)),this._defaultValue}}}function bc(d){return Array.isArray(d)&&d.length>0&&typeof d[0]=="string"&&d[0]in ou}function _c(d,l){const h=new As(ou,[],l?function(C){const k={color:En,string:At,number:tt,enum:At,boolean:qt,formatted:_n,padding:tn,resolvedImage:zt};return C.type==="array"?dt(k[C.value]||St,C.length):k[C.type]}(l):void 0),y=h.parse(d,void 0,void 0,void 0,l&&l.type==="string"?{typeAnnotation:"coerce"}:void 0);return y?Hv(new tf(y,l)):au(h.errors)}class wc{constructor(l,h){this.kind=l,this._styleExpression=h,this.isStateDependent=l!=="constant"&&!er(h.expression)}evaluateWithoutErrorHandling(l,h,y,C,k,D){return this._styleExpression.evaluateWithoutErrorHandling(l,h,y,C,k,D)}evaluate(l,h,y,C,k,D){return this._styleExpression.evaluate(l,h,y,C,k,D)}}class hp{constructor(l,h,y,C){this.kind=l,this.zoomStops=y,this._styleExpression=h,this.isStateDependent=l!=="camera"&&!er(h.expression),this.interpolationType=C}evaluateWithoutErrorHandling(l,h,y,C,k,D){return this._styleExpression.evaluateWithoutErrorHandling(l,h,y,C,k,D)}evaluate(l,h,y,C,k,D){return this._styleExpression.evaluate(l,h,y,C,k,D)}interpolationFactor(l,h,y){return this.interpolationType?Mo.interpolationFactor(this.interpolationType,l,h,y):0}}function Gv(d,l){const h=_c(d,l);if(h.result==="error")return h;const y=h.value.expression,C=Vn(y);if(!C&&!Or(l))return au([new It("","data expressions not supported")]);const k=zr(y,["zoom"]);if(!k&&!Kv(l))return au([new It("","zoom expressions not supported")]);const D=rf(y);return D||k?D instanceof It?au([D]):D instanceof Mo&&!tr(l)?au([new It("",'"interpolate" expressions cannot be used with this property')]):Hv(D?new hp(C?"camera":"composite",h.value,D.labels,D instanceof Mo?D.interpolation:void 0):new wc(C?"constant":"source",h.value)):au([new It("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class nf{constructor(l,h){this._parameters=l,this._specification=h,an(this,xc(this._parameters,this._specification))}static deserialize(l){return new nf(l._parameters,l._specification)}static serialize(l){return{_parameters:l._parameters,_specification:l._specification}}}function rf(d){let l=null;if(d instanceof Xd)l=rf(d.result);else if(d instanceof Zd){for(const h of d.args)if(l=rf(h),l)break}else(d instanceof us||d instanceof Mo)&&d.input instanceof or&&d.input.name==="zoom"&&(l=d);return l instanceof It||d.eachChild(h=>{const y=rf(h);y instanceof It?l=y:!l&&y?l=new It("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):l&&y&&l!==y&&(l=new It("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),l}function sa(d){const l=d.key,h=d.value,y=d.valueSpec||{},C=d.objectElementValidators||{},k=d.style,D=d.styleSpec;let z=[];const B=hr(h);if(B!=="object")return[new Ye(l,h,`object expected, ${B} found`)];for(const K in h){const ee=K.split(".")[0],ie=y[ee]||y["*"];let de;if(C[ee])de=C[ee];else if(y[ee])de=Do;else if(C["*"])de=C["*"];else{if(!y["*"]){z.push(new Ye(l,h[K],`unknown property "${K}"`));continue}de=Do}z=z.concat(de({key:(l&&`${l}.`)+K,value:h[K],valueSpec:ie,style:k,styleSpec:D,object:h,objectKey:K},h))}for(const K in y)C[K]||y[K].required&&y[K].default===void 0&&h[K]===void 0&&z.push(new Ye(l,h,`missing required property "${K}"`));return z}function qv(d){const l=d.value,h=d.valueSpec,y=d.style,C=d.styleSpec,k=d.key,D=d.arrayElementValidator||Do;if(hr(l)!=="array")return[new Ye(k,l,`array expected, ${hr(l)} found`)];if(h.length&&l.length!==h.length)return[new Ye(k,l,`array length ${h.length} expected, length ${l.length} found`)];if(h["min-length"]&&l.lengthy.maximum?[new Ye(l,h,`${h} is greater than the maximum value ${y.maximum}`)]:[]}function Zv(d){const l=d.valueSpec,h=Kt(d.value.type);let y,C,k,D={};const z=h!=="categorical"&&d.value.property===void 0,B=!z,K=hr(d.value.stops)==="array"&&hr(d.value.stops[0])==="array"&&hr(d.value.stops[0][0])==="object",ee=sa({key:d.key,value:d.value,valueSpec:d.styleSpec.function,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{stops:function(ge){if(h==="identity")return[new Ye(ge.key,ge.value,'identity function may not have a "stops" property')];let ve=[];const Ne=ge.value;return ve=ve.concat(qv({key:ge.key,value:Ne,valueSpec:ge.valueSpec,style:ge.style,styleSpec:ge.styleSpec,arrayElementValidator:ie})),hr(Ne)==="array"&&Ne.length===0&&ve.push(new Ye(ge.key,Ne,"array must have at least one stop")),ve},default:function(ge){return Do({key:ge.key,value:ge.value,valueSpec:l,style:ge.style,styleSpec:ge.styleSpec})}}});return h==="identity"&&z&&ee.push(new Ye(d.key,d.value,'missing required property "property"')),h==="identity"||d.value.stops||ee.push(new Ye(d.key,d.value,'missing required property "stops"')),h==="exponential"&&d.valueSpec.expression&&!tr(d.valueSpec)&&ee.push(new Ye(d.key,d.value,"exponential functions not supported")),d.styleSpec.$version>=8&&(B&&!Or(d.valueSpec)?ee.push(new Ye(d.key,d.value,"property functions not supported")):z&&!Kv(d.valueSpec)&&ee.push(new Ye(d.key,d.value,"zoom functions not supported"))),h!=="categorical"&&!K||d.value.property!==void 0||ee.push(new Ye(d.key,d.value,'"property" property is required')),ee;function ie(ge){let ve=[];const Ne=ge.value,Oe=ge.key;if(hr(Ne)!=="array")return[new Ye(Oe,Ne,`array expected, ${hr(Ne)} found`)];if(Ne.length!==2)return[new Ye(Oe,Ne,`array length 2 expected, length ${Ne.length} found`)];if(K){if(hr(Ne[0])!=="object")return[new Ye(Oe,Ne,`object expected, ${hr(Ne[0])} found`)];if(Ne[0].zoom===void 0)return[new Ye(Oe,Ne,"object stop key must have zoom")];if(Ne[0].value===void 0)return[new Ye(Oe,Ne,"object stop key must have value")];if(k&&k>Kt(Ne[0].zoom))return[new Ye(Oe,Ne[0].zoom,"stop zoom values must appear in ascending order")];Kt(Ne[0].zoom)!==k&&(k=Kt(Ne[0].zoom),C=void 0,D={}),ve=ve.concat(sa({key:`${Oe}[0]`,value:Ne[0],valueSpec:{zoom:{}},style:ge.style,styleSpec:ge.styleSpec,objectElementValidators:{zoom:pp,value:de}}))}else ve=ve.concat(de({key:`${Oe}[0]`,value:Ne[0],valueSpec:{},style:ge.style,styleSpec:ge.styleSpec},Ne));return bc(Vt(Ne[1]))?ve.concat([new Ye(`${Oe}[1]`,Ne[1],"expressions are not allowed in function stops.")]):ve.concat(Do({key:`${Oe}[1]`,value:Ne[1],valueSpec:l,style:ge.style,styleSpec:ge.styleSpec}))}function de(ge,ve){const Ne=hr(ge.value),Oe=Kt(ge.value),Qe=ge.value!==null?ge.value:ve;if(y){if(Ne!==y)return[new Ye(ge.key,Qe,`${Ne} stop domain type must match previous stop domain type ${y}`)]}else y=Ne;if(Ne!=="number"&&Ne!=="string"&&Ne!=="boolean")return[new Ye(ge.key,Qe,"stop domain value must be a number, string, or boolean")];if(Ne!=="number"&&h!=="categorical"){let ht=`number expected, ${Ne} found`;return Or(l)&&h===void 0&&(ht+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ye(ge.key,Qe,ht)]}return h!=="categorical"||Ne!=="number"||isFinite(Oe)&&Math.floor(Oe)===Oe?h!=="categorical"&&Ne==="number"&&C!==void 0&&Oenew Ye(`${d.key}${y.key}`,d.value,y.message));const h=l.value.expression||l.value._styleExpression.expression;if(d.expressionContext==="property"&&d.propertyKey==="text-font"&&!h.outputDefined())return[new Ye(d.key,d.value,`Invalid data expression for "${d.propertyKey}". Output values must be contained as literals within the expression.`)];if(d.expressionContext==="property"&&d.propertyType==="layout"&&!er(h))return[new Ye(d.key,d.value,'"feature-state" data expressions are not supported with layout properties.')];if(d.expressionContext==="filter"&&!er(h))return[new Ye(d.key,d.value,'"feature-state" data expressions are not supported with filters.')];if(d.expressionContext&&d.expressionContext.indexOf("cluster")===0){if(!zr(h,["zoom","feature-state"]))return[new Ye(d.key,d.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(d.expressionContext==="cluster-initial"&&!Vn(h))return[new Ye(d.key,d.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Cc(d){const l=d.key,h=d.value,y=d.valueSpec,C=[];return Array.isArray(y.values)?y.values.indexOf(Kt(h))===-1&&C.push(new Ye(l,h,`expected one of [${y.values.join(", ")}], ${JSON.stringify(h)} found`)):Object.keys(y.values).indexOf(Kt(h))===-1&&C.push(new Ye(l,h,`expected one of [${Object.keys(y.values).join(", ")}], ${JSON.stringify(h)} found`)),C}function lu(d){if(d===!0||d===!1)return!0;if(!Array.isArray(d)||d.length===0)return!1;switch(d[0]){case"has":return d.length>=2&&d[1]!=="$id"&&d[1]!=="$type";case"in":return d.length>=3&&(typeof d[1]!="string"||Array.isArray(d[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return d.length!==3||Array.isArray(d[1])||Array.isArray(d[2]);case"any":case"all":for(const l of d.slice(1))if(!lu(l)&&typeof l!="boolean")return!1;return!0;default:return!0}}const Y1={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function of(d){if(d==null)return{filter:()=>!0,needGeometry:!1};lu(d)||(d=Sc(d));const l=_c(d,Y1);if(l.result==="error")throw new Error(l.value.map(h=>`${h.key}: ${h.message}`).join(", "));return{filter:(h,y,C)=>l.value.evaluate(h,y,{},C),needGeometry:Yv(d)}}function Xv(d,l){return dl?1:0}function Yv(d){if(!Array.isArray(d))return!1;if(d[0]==="within")return!0;for(let l=1;l"||l==="<="||l===">="?mp(d[1],d[2],l):l==="any"?(h=d.slice(1),["any"].concat(h.map(Sc))):l==="all"?["all"].concat(d.slice(1).map(Sc)):l==="none"?["all"].concat(d.slice(1).map(Sc).map(uu)):l==="in"?af(d[1],d.slice(2)):l==="!in"?uu(af(d[1],d.slice(2))):l==="has"?Ec(d[1]):l==="!has"?uu(Ec(d[1])):l!=="within"||d;var h}function mp(d,l,h){switch(d){case"$type":return[`filter-type-${h}`,l];case"$id":return[`filter-id-${h}`,l];default:return[`filter-${h}`,d,l]}}function af(d,l){if(l.length===0)return!1;switch(d){case"$type":return["filter-type-in",["literal",l]];case"$id":return["filter-id-in",["literal",l]];default:return l.length>200&&!l.some(h=>typeof h!=typeof l[0])?["filter-in-large",d,["literal",l.sort(Xv)]]:["filter-in-small",d,["literal",l]]}}function Ec(d){switch(d){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",d]}}function uu(d){return["!",d]}function Pc(d){return lu(Vt(d.value))?hl(an({},d,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Qv(d)}function Qv(d){const l=d.value,h=d.key;if(hr(l)!=="array")return[new Ye(h,l,`array expected, ${hr(l)} found`)];const y=d.styleSpec;let C,k=[];if(l.length<1)return[new Ye(h,l,"filter array must have at least 1 element")];switch(k=k.concat(Cc({key:`${h}[0]`,value:l[0],valueSpec:y.filter_operator,style:d.style,styleSpec:d.styleSpec})),Kt(l[0])){case"<":case"<=":case">":case">=":l.length>=2&&Kt(l[1])==="$type"&&k.push(new Ye(h,l,`"$type" cannot be use with operator "${l[0]}"`));case"==":case"!=":l.length!==3&&k.push(new Ye(h,l,`filter array for operator "${l[0]}" must have 3 elements`));case"in":case"!in":l.length>=2&&(C=hr(l[1]),C!=="string"&&k.push(new Ye(`${h}[1]`,l[1],`string expected, ${C} found`)));for(let D=2;D{K in h&&l.push(new Ye(y,h[K],`"${K}" is prohibited for ref layers`))}),C.layers.forEach(K=>{Kt(K.id)===z&&(B=K)}),B?B.ref?l.push(new Ye(y,h.ref,"ref cannot reference another ref layer")):D=Kt(B.type):l.push(new Ye(y,h.ref,`ref layer "${z}" not found`))}else if(D!=="background")if(h.source){const B=C.sources&&C.sources[h.source],K=B&&Kt(B.type);B?K==="vector"&&D==="raster"?l.push(new Ye(y,h.source,`layer "${h.id}" requires a raster source`)):K==="raster"&&D!=="raster"?l.push(new Ye(y,h.source,`layer "${h.id}" requires a vector source`)):K!=="vector"||h["source-layer"]?K==="raster-dem"&&D!=="hillshade"?l.push(new Ye(y,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):D!=="line"||!h.paint||!h.paint["line-gradient"]||K==="geojson"&&B.lineMetrics||l.push(new Ye(y,h,`layer "${h.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):l.push(new Ye(y,h,`layer "${h.id}" must specify a "source-layer"`)):l.push(new Ye(y,h.source,`source "${h.source}" not found`))}else l.push(new Ye(y,h,'missing required property "source"'));return l=l.concat(sa({key:y,value:h,valueSpec:k.layer,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Do({key:`${y}.type`,value:h.type,valueSpec:k.layer.type,style:d.style,styleSpec:d.styleSpec,object:h,objectKey:"type"}),filter:Pc,layout:B=>sa({layer:h,key:B.key,value:B.value,style:B.style,styleSpec:B.styleSpec,objectElementValidators:{"*":K=>ey(an({layerType:D},K))}}),paint:B=>sa({layer:h,key:B.key,value:B.value,style:B.style,styleSpec:B.styleSpec,objectElementValidators:{"*":K=>Jv(an({layerType:D},K))}})}})),l}function cu(d){const l=d.value,h=d.key,y=hr(l);return y!=="string"?[new Ye(h,l,`string expected, ${y} found`)]:[]}const ny={promoteId:function({key:d,value:l}){if(hr(l)==="string")return cu({key:d,value:l});{const h=[];for(const y in l)h.push(...cu({key:`${d}.${y}`,value:l[y]}));return h}}};function Ic(d){const l=d.value,h=d.key,y=d.styleSpec,C=d.style;if(!l.type)return[new Ye(h,l,'"type" is required')];const k=Kt(l.type);let D;switch(k){case"vector":case"raster":case"raster-dem":return D=sa({key:h,value:l,valueSpec:y[`source_${k.replace("-","_")}`],style:d.style,styleSpec:y,objectElementValidators:ny}),D;case"geojson":if(D=sa({key:h,value:l,valueSpec:y.source_geojson,style:C,styleSpec:y,objectElementValidators:ny}),l.cluster)for(const z in l.clusterProperties){const[B,K]=l.clusterProperties[z],ee=typeof B=="string"?[B,["accumulated"],["get",z]]:B;D.push(...hl({key:`${h}.${z}.map`,value:K,expressionContext:"cluster-map"})),D.push(...hl({key:`${h}.${z}.reduce`,value:ee,expressionContext:"cluster-reduce"}))}return D;case"video":return sa({key:h,value:l,valueSpec:y.source_video,style:C,styleSpec:y});case"image":return sa({key:h,value:l,valueSpec:y.source_image,style:C,styleSpec:y});case"canvas":return[new Ye(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Cc({key:`${h}.type`,value:l.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:C,styleSpec:y})}}function kc(d){const l=d.value,h=d.styleSpec,y=h.light,C=d.style;let k=[];const D=hr(l);if(l===void 0)return k;if(D!=="object")return k=k.concat([new Ye("light",l,`object expected, ${D} found`)]),k;for(const z in l){const B=z.match(/^(.*)-transition$/);k=k.concat(B&&y[B[1]]&&y[B[1]].transition?Do({key:z,value:l[z],valueSpec:h.transition,style:C,styleSpec:h}):y[z]?Do({key:z,value:l[z],valueSpec:y[z],style:C,styleSpec:h}):[new Ye(z,l[z],`unknown property "${z}"`)])}return k}function Ro(d){const l=d.value,h=d.styleSpec,y=h.terrain,C=d.style;let k=[];const D=hr(l);if(l===void 0)return k;if(D!=="object")return k=k.concat([new Ye("terrain",l,`object expected, ${D} found`)]),k;for(const z in l)k=k.concat(y[z]?Do({key:z,value:l[z],valueSpec:y[z],style:C,styleSpec:h}):[new Ye(z,l[z],`unknown property "${z}"`)]);return k}const Mc={"*":()=>[],array:qv,boolean:function(d){const l=d.value,h=d.key,y=hr(l);return y!=="boolean"?[new Ye(h,l,`boolean expected, ${y} found`)]:[]},number:pp,color:function(d){const l=d.key,h=d.value,y=hr(h);return y!=="string"?[new Ye(l,h,`color expected, ${y} found`)]:Qn(h)===null?[new Ye(l,h,`color expected, "${h}" found`)]:[]},constants:Zt,enum:Cc,filter:Pc,function:Zv,layer:ty,object:sa,source:Ic,light:kc,terrain:Ro,string:cu,formatted:function(d){return cu(d).length===0?[]:hl(d)},resolvedImage:function(d){return cu(d).length===0?[]:hl(d)},padding:function(d){const l=d.key,h=d.value;if(hr(h)==="array"){if(h.length<1||h.length>4)return[new Ye(l,h,`padding requires 1 to 4 values; ${h.length} values found`)];const y={type:"number"};let C=[];for(let k=0;k[]}})),d.constants&&(h=h.concat(Zt({key:"constants",value:d.constants,style:d,styleSpec:l}))),ry(h)}function ry(d){return[].concat(d).sort((l,h)=>l.line-h.line)}function ds(d){return function(...l){return ry(d.apply(this,l))}}Ns.source=ds(Ic),Ns.light=ds(kc),Ns.terrain=ds(Ro),Ns.layer=ds(ty),Ns.filter=ds(Pc),Ns.paintProperty=ds(Jv),Ns.layoutProperty=ds(ey);const Rc=Ns,gp=Rc.light,J1=Rc.paintProperty,ew=Rc.layoutProperty;function sf(d,l){let h=!1;if(l&&l.length)for(const y of l)d.fire(new Lt(new Error(y.message))),h=!0;return h}class Dc{constructor(l,h,y){const C=this.cells=[];if(l instanceof ArrayBuffer){this.arrayBuffer=l;const D=new Int32Array(this.arrayBuffer);l=D[0],this.d=(h=D[1])+2*(y=D[2]);for(let B=0;B=ie[ve+0]&&C>=ie[ve+1])?(z[ge]=!0,D.push(ee[ge])):z[ge]=!1}}}}_forEachCell(l,h,y,C,k,D,z,B){const K=this._convertToCellCoord(l),ee=this._convertToCellCoord(h),ie=this._convertToCellCoord(y),de=this._convertToCellCoord(C);for(let ge=K;ge<=ie;ge++)for(let ve=ee;ve<=de;ve++){const Ne=this.d*ve+ge;if((!B||B(this._convertFromCellCoord(ge),this._convertFromCellCoord(ve),this._convertFromCellCoord(ge+1),this._convertFromCellCoord(ve+1)))&&k.call(this,l,h,y,C,Ne,D,z,B))return}}_convertFromCellCoord(l){return(l-this.padding)/this.scale}_convertToCellCoord(l){return Math.max(0,Math.min(this.d-1,Math.floor(l*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const l=this.cells,h=3+this.cells.length+1+1;let y=0;for(let D=0;D=0)continue;const D=d[k];C[k]=fs[y].shallow.indexOf(k)>=0?D:pl(D,l)}d instanceof Error&&(C.message=d.message)}if(C.$name)throw new Error("$name property is reserved for worker serialization logic.");return y!=="Object"&&(C.$name=y),C}throw new Error("can't serialize object of type "+typeof d)}function Ls(d){if(d==null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"||d instanceof Boolean||d instanceof Number||d instanceof String||d instanceof Date||d instanceof RegExp||d instanceof Blob||iy(d)||J(d)||ArrayBuffer.isView(d)||d instanceof ImageData)return d;if(Array.isArray(d))return d.map(Ls);if(typeof d=="object"){const l=d.$name||"Object";if(!fs[l])throw new Error(`can't deserialize unregistered class ${l}`);const{klass:h}=fs[l];if(!h)throw new Error(`can't deserialize unregistered class ${l}`);if(h.deserialize)return h.deserialize(d);const y=Object.create(h.prototype);for(const C of Object.keys(d)){if(C==="$name")continue;const k=d[C];y[C]=fs[l].shallow.indexOf(C)>=0?k:Ls(k)}return y}throw new Error("can't deserialize object of type "+typeof d)}class vp{constructor(){this.first=!0}update(l,h){const y=Math.floor(l);return this.first?(this.first=!1,this.lastIntegerZoom=y,this.lastIntegerZoomTime=0,this.lastZoom=l,this.lastFloorZoom=y,!0):(this.lastFloorZoom>y?(this.lastIntegerZoom=y+1,this.lastIntegerZoomTime=h):this.lastFloorZoomd>=128&&d<=255,Arabic:d=>d>=1536&&d<=1791,"Arabic Supplement":d=>d>=1872&&d<=1919,"Arabic Extended-A":d=>d>=2208&&d<=2303,"Hangul Jamo":d=>d>=4352&&d<=4607,"Unified Canadian Aboriginal Syllabics":d=>d>=5120&&d<=5759,Khmer:d=>d>=6016&&d<=6143,"Unified Canadian Aboriginal Syllabics Extended":d=>d>=6320&&d<=6399,"General Punctuation":d=>d>=8192&&d<=8303,"Letterlike Symbols":d=>d>=8448&&d<=8527,"Number Forms":d=>d>=8528&&d<=8591,"Miscellaneous Technical":d=>d>=8960&&d<=9215,"Control Pictures":d=>d>=9216&&d<=9279,"Optical Character Recognition":d=>d>=9280&&d<=9311,"Enclosed Alphanumerics":d=>d>=9312&&d<=9471,"Geometric Shapes":d=>d>=9632&&d<=9727,"Miscellaneous Symbols":d=>d>=9728&&d<=9983,"Miscellaneous Symbols and Arrows":d=>d>=11008&&d<=11263,"CJK Radicals Supplement":d=>d>=11904&&d<=12031,"Kangxi Radicals":d=>d>=12032&&d<=12255,"Ideographic Description Characters":d=>d>=12272&&d<=12287,"CJK Symbols and Punctuation":d=>d>=12288&&d<=12351,Hiragana:d=>d>=12352&&d<=12447,Katakana:d=>d>=12448&&d<=12543,Bopomofo:d=>d>=12544&&d<=12591,"Hangul Compatibility Jamo":d=>d>=12592&&d<=12687,Kanbun:d=>d>=12688&&d<=12703,"Bopomofo Extended":d=>d>=12704&&d<=12735,"CJK Strokes":d=>d>=12736&&d<=12783,"Katakana Phonetic Extensions":d=>d>=12784&&d<=12799,"Enclosed CJK Letters and Months":d=>d>=12800&&d<=13055,"CJK Compatibility":d=>d>=13056&&d<=13311,"CJK Unified Ideographs Extension A":d=>d>=13312&&d<=19903,"Yijing Hexagram Symbols":d=>d>=19904&&d<=19967,"CJK Unified Ideographs":d=>d>=19968&&d<=40959,"Yi Syllables":d=>d>=40960&&d<=42127,"Yi Radicals":d=>d>=42128&&d<=42191,"Hangul Jamo Extended-A":d=>d>=43360&&d<=43391,"Hangul Syllables":d=>d>=44032&&d<=55215,"Hangul Jamo Extended-B":d=>d>=55216&&d<=55295,"Private Use Area":d=>d>=57344&&d<=63743,"CJK Compatibility Ideographs":d=>d>=63744&&d<=64255,"Arabic Presentation Forms-A":d=>d>=64336&&d<=65023,"Vertical Forms":d=>d>=65040&&d<=65055,"CJK Compatibility Forms":d=>d>=65072&&d<=65103,"Small Form Variants":d=>d>=65104&&d<=65135,"Arabic Presentation Forms-B":d=>d>=65136&&d<=65279,"Halfwidth and Fullwidth Forms":d=>d>=65280&&d<=65519};function lf(d){for(const l of d)if(xp(l.charCodeAt(0)))return!0;return!1}function tw(d){for(const l of d)if(!yp(l.charCodeAt(0)))return!1;return!0}function yp(d){return!(sn.Arabic(d)||sn["Arabic Supplement"](d)||sn["Arabic Extended-A"](d)||sn["Arabic Presentation Forms-A"](d)||sn["Arabic Presentation Forms-B"](d))}function xp(d){return!(d!==746&&d!==747&&(d<4352||!(sn["Bopomofo Extended"](d)||sn.Bopomofo(d)||sn["CJK Compatibility Forms"](d)&&!(d>=65097&&d<=65103)||sn["CJK Compatibility Ideographs"](d)||sn["CJK Compatibility"](d)||sn["CJK Radicals Supplement"](d)||sn["CJK Strokes"](d)||!(!sn["CJK Symbols and Punctuation"](d)||d>=12296&&d<=12305||d>=12308&&d<=12319||d===12336)||sn["CJK Unified Ideographs Extension A"](d)||sn["CJK Unified Ideographs"](d)||sn["Enclosed CJK Letters and Months"](d)||sn["Hangul Compatibility Jamo"](d)||sn["Hangul Jamo Extended-A"](d)||sn["Hangul Jamo Extended-B"](d)||sn["Hangul Jamo"](d)||sn["Hangul Syllables"](d)||sn.Hiragana(d)||sn["Ideographic Description Characters"](d)||sn.Kanbun(d)||sn["Kangxi Radicals"](d)||sn["Katakana Phonetic Extensions"](d)||sn.Katakana(d)&&d!==12540||!(!sn["Halfwidth and Fullwidth Forms"](d)||d===65288||d===65289||d===65293||d>=65306&&d<=65310||d===65339||d===65341||d===65343||d>=65371&&d<=65503||d===65507||d>=65512&&d<=65519)||!(!sn["Small Form Variants"](d)||d>=65112&&d<=65118||d>=65123&&d<=65126)||sn["Unified Canadian Aboriginal Syllabics"](d)||sn["Unified Canadian Aboriginal Syllabics Extended"](d)||sn["Vertical Forms"](d)||sn["Yijing Hexagram Symbols"](d)||sn["Yi Syllables"](d)||sn["Yi Radicals"](d))))}function oy(d){return!(xp(d)||function(l){return!!(sn["Latin-1 Supplement"](l)&&(l===167||l===169||l===174||l===177||l===188||l===189||l===190||l===215||l===247)||sn["General Punctuation"](l)&&(l===8214||l===8224||l===8225||l===8240||l===8241||l===8251||l===8252||l===8258||l===8263||l===8264||l===8265||l===8273)||sn["Letterlike Symbols"](l)||sn["Number Forms"](l)||sn["Miscellaneous Technical"](l)&&(l>=8960&&l<=8967||l>=8972&&l<=8991||l>=8996&&l<=9e3||l===9003||l>=9085&&l<=9114||l>=9150&&l<=9165||l===9167||l>=9169&&l<=9179||l>=9186&&l<=9215)||sn["Control Pictures"](l)&&l!==9251||sn["Optical Character Recognition"](l)||sn["Enclosed Alphanumerics"](l)||sn["Geometric Shapes"](l)||sn["Miscellaneous Symbols"](l)&&!(l>=9754&&l<=9759)||sn["Miscellaneous Symbols and Arrows"](l)&&(l>=11026&&l<=11055||l>=11088&&l<=11097||l>=11192&&l<=11243)||sn["CJK Symbols and Punctuation"](l)||sn.Katakana(l)||sn["Private Use Area"](l)||sn["CJK Compatibility Forms"](l)||sn["Small Form Variants"](l)||sn["Halfwidth and Fullwidth Forms"](l)||l===8734||l===8756||l===8757||l>=9984&&l<=10087||l>=10102&&l<=10131||l===65532||l===65533)}(d))}function ay(d){return d>=1424&&d<=2303||sn["Arabic Presentation Forms-A"](d)||sn["Arabic Presentation Forms-B"](d)}function nw(d,l){return!(!l&&ay(d)||d>=2304&&d<=3583||d>=3840&&d<=4255||sn.Khmer(d))}function sy(d){for(const l of d)if(ay(l.charCodeAt(0)))return!0;return!1}const bp="deferred",_p="loading",wp="loaded";let Cp=null,go="unavailable",Fs=null;const ly=function(d){d&&typeof d=="string"&&d.indexOf("NetworkError")>-1&&(go="error"),Cp&&Cp(d)};function du(){Sp.fire(new Ot("pluginStateChange",{pluginStatus:go,pluginURL:Fs}))}const Sp=new Ht,Oc=function(){return go},uy=function(){if(go!==bp||!Fs)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");go=_p,du(),Fs&&yt({url:Fs},d=>{d?ly(d):(go=wp,du())})},Ko={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>go===wp||Ko.applyArabicShaping!=null,isLoading:()=>go===_p,setState(d){if(!U())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");go=d.pluginStatus,Fs=d.pluginURL},isParsed(){if(!U())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ko.applyArabicShaping!=null&&Ko.processBidirectionalText!=null&&Ko.processStyledBidirectionalText!=null},getPluginURL(){if(!U())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Fs}};class Br{constructor(l,h){this.zoom=l,h?(this.now=h.now,this.fadeDuration=h.fadeDuration,this.zoomHistory=h.zoomHistory,this.transition=h.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new vp,this.transition={})}isSupportedScript(l){return function(h,y){for(const C of h)if(!nw(C.charCodeAt(0),y))return!1;return!0}(l,Ko.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const l=this.zoom,h=l-Math.floor(l),y=this.crossFadingFactor();return l>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:h+(1-h)*y}:{fromScale:.5,toScale:1,t:1-(1-y)*h}}}class Ac{constructor(l,h){this.property=l,this.value=h,this.expression=function(y,C){if(Ir(y))return new nf(y,C);if(bc(y)){const k=Gv(y,C);if(k.result==="error")throw new Error(k.value.map(D=>`${D.key}: ${D.message}`).join(", "));return k.value}{let k=y;return C.type==="color"&&typeof y=="string"?k=ue.parse(y):C.type!=="padding"||typeof y!="number"&&!Array.isArray(y)||(k=Pe.parse(y)),{kind:"constant",evaluate:()=>k}}}(h===void 0?l.specification.default:h,l.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(l,h,y){return this.property.possiblyEvaluate(this,l,h,y)}}class uf{constructor(l){this.property=l,this.value=new Ac(l,void 0)}transitioned(l,h){return new dy(this.property,this.value,h,_({},l.transition,this.transition),l.now)}untransitioned(){return new dy(this.property,this.value,null,{},0)}}class cy{constructor(l){this._properties=l,this._values=Object.create(l.defaultTransitionablePropertyValues)}getValue(l){return O(this._values[l].value.value)}setValue(l,h){Object.prototype.hasOwnProperty.call(this._values,l)||(this._values[l]=new uf(this._values[l].property)),this._values[l].value=new Ac(this._values[l].property,h===null?void 0:O(h))}getTransition(l){return O(this._values[l].transition)}setTransition(l,h){Object.prototype.hasOwnProperty.call(this._values,l)||(this._values[l]=new uf(this._values[l].property)),this._values[l].transition=O(h)||void 0}serialize(){const l={};for(const h of Object.keys(this._values)){const y=this.getValue(h);y!==void 0&&(l[h]=y);const C=this.getTransition(h);C!==void 0&&(l[`${h}-transition`]=C)}return l}transitioned(l,h){const y=new fy(this._properties);for(const C of Object.keys(this._values))y._values[C]=this._values[C].transitioned(l,h._values[C]);return y}untransitioned(){const l=new fy(this._properties);for(const h of Object.keys(this._values))l._values[h]=this._values[h].untransitioned();return l}}class dy{constructor(l,h,y,C,k){this.property=l,this.value=h,this.begin=k+C.delay||0,this.end=this.begin+C.duration||0,l.specification.transition&&(C.delay||C.duration)&&(this.prior=y)}possiblyEvaluate(l,h,y){const C=l.now||0,k=this.value.possiblyEvaluate(l,h,y),D=this.prior;if(D){if(C>this.end)return this.prior=null,k;if(this.value.isDataDriven())return this.prior=null,k;if(C=1)return 1;const K=B*B,ee=K*B;return 4*(B<.5?ee:3*(B-K)+ee-.75)}(z))}}return k}}class fy{constructor(l){this._properties=l,this._values=Object.create(l.defaultTransitioningPropertyValues)}possiblyEvaluate(l,h,y){const C=new Nc(this._properties);for(const k of Object.keys(this._values))C._values[k]=this._values[k].possiblyEvaluate(l,h,y);return C}hasTransition(){for(const l of Object.keys(this._values))if(this._values[l].prior)return!0;return!1}}class rw{constructor(l){this._properties=l,this._values=Object.create(l.defaultPropertyValues)}getValue(l){return O(this._values[l].value)}setValue(l,h){this._values[l]=new Ac(this._values[l].property,h===null?void 0:O(h))}serialize(){const l={};for(const h of Object.keys(this._values)){const y=this.getValue(h);y!==void 0&&(l[h]=y)}return l}possiblyEvaluate(l,h,y){const C=new Nc(this._properties);for(const k of Object.keys(this._values))C._values[k]=this._values[k].possiblyEvaluate(l,h,y);return C}}class Na{constructor(l,h,y){this.property=l,this.value=h,this.parameters=y}isConstant(){return this.value.kind==="constant"}constantOr(l){return this.value.kind==="constant"?this.value.value:l}evaluate(l,h,y,C){return this.property.evaluate(this.value,this.parameters,l,h,y,C)}}class Nc{constructor(l){this._properties=l,this._values=Object.create(l.defaultPossiblyEvaluatedValues)}get(l){return this._values[l]}}class xn{constructor(l){this.specification=l}possiblyEvaluate(l,h){if(l.isDataDriven())throw new Error("Value should not be data driven");return l.expression.evaluate(h)}interpolate(l,h,y){const C=cs[this.specification.type];return C?C(l,h,y):l}}class Rn{constructor(l,h){this.specification=l,this.overrides=h}possiblyEvaluate(l,h,y,C){return new Na(this,l.expression.kind==="constant"||l.expression.kind==="camera"?{kind:"constant",value:l.expression.evaluate(h,null,{},y,C)}:l.expression,h)}interpolate(l,h,y){if(l.value.kind!=="constant"||h.value.kind!=="constant")return l;if(l.value.value===void 0||h.value.value===void 0)return new Na(this,{kind:"constant",value:void 0},l.parameters);const C=cs[this.specification.type];return C?new Na(this,{kind:"constant",value:C(l.value.value,h.value.value,y)},l.parameters):l}evaluate(l,h,y,C,k,D){return l.kind==="constant"?l.value:l.evaluate(h,y,C,k,D)}}class fu extends Rn{possiblyEvaluate(l,h,y,C){if(l.value===void 0)return new Na(this,{kind:"constant",value:void 0},h);if(l.expression.kind==="constant"){const k=l.expression.evaluate(h,null,{},y,C),D=l.property.specification.type==="resolvedImage"&&typeof k!="string"?k.name:k,z=this._calculate(D,D,D,h);return new Na(this,{kind:"constant",value:z},h)}if(l.expression.kind==="camera"){const k=this._calculate(l.expression.evaluate({zoom:h.zoom-1}),l.expression.evaluate({zoom:h.zoom}),l.expression.evaluate({zoom:h.zoom+1}),h);return new Na(this,{kind:"constant",value:k},h)}return new Na(this,l.expression,h)}evaluate(l,h,y,C,k,D){if(l.kind==="source"){const z=l.evaluate(h,y,C,k,D);return this._calculate(z,z,z,h)}return l.kind==="composite"?this._calculate(l.evaluate({zoom:Math.floor(h.zoom)-1},y,C),l.evaluate({zoom:Math.floor(h.zoom)},y,C),l.evaluate({zoom:Math.floor(h.zoom)+1},y,C),h):l.value}_calculate(l,h,y,C){return C.zoom>C.zoomHistory.lastIntegerZoom?{from:l,to:h}:{from:y,to:h}}interpolate(l){return l}}class Ep{constructor(l){this.specification=l}possiblyEvaluate(l,h,y,C){if(l.value!==void 0){if(l.expression.kind==="constant"){const k=l.expression.evaluate(h,null,{},y,C);return this._calculate(k,k,k,h)}return this._calculate(l.expression.evaluate(new Br(Math.floor(h.zoom-1),h)),l.expression.evaluate(new Br(Math.floor(h.zoom),h)),l.expression.evaluate(new Br(Math.floor(h.zoom+1),h)),h)}}_calculate(l,h,y,C){return C.zoom>C.zoomHistory.lastIntegerZoom?{from:l,to:h}:{from:y,to:h}}interpolate(l){return l}}class zs{constructor(l){this.specification=l}possiblyEvaluate(l,h,y,C){return!!l.expression.evaluate(h,null,{},y,C)}interpolate(){return!1}}class zi{constructor(l){this.properties=l,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const h in l){const y=l[h];y.specification.overridable&&this.overridableProperties.push(h);const C=this.defaultPropertyValues[h]=new Ac(y,void 0),k=this.defaultTransitionablePropertyValues[h]=new uf(y);this.defaultTransitioningPropertyValues[h]=k.untransitioned(),this.defaultPossiblyEvaluatedValues[h]=C.possiblyEvaluate({})}}}gn("DataDrivenProperty",Rn),gn("DataConstantProperty",xn),gn("CrossFadedDataDrivenProperty",fu),gn("CrossFadedProperty",Ep),gn("ColorRampProperty",zs);const $s="-transition";class La extends Ht{constructor(l,h){if(super(),this.id=l.id,this.type=l.type,this._featureFilter={filter:()=>!0,needGeometry:!1},l.type!=="custom"&&(this.metadata=l.metadata,this.minzoom=l.minzoom,this.maxzoom=l.maxzoom,l.type!=="background"&&(this.source=l.source,this.sourceLayer=l["source-layer"],this.filter=l.filter),h.layout&&(this._unevaluatedLayout=new rw(h.layout)),h.paint)){this._transitionablePaint=new cy(h.paint);for(const y in l.paint)this.setPaintProperty(y,l.paint[y],{validate:!1});for(const y in l.layout)this.setLayoutProperty(y,l.layout[y],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Nc(h.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(l){return l==="visibility"?this.visibility:this._unevaluatedLayout.getValue(l)}setLayoutProperty(l,h,y={}){h!=null&&this._validate(ew,`layers.${this.id}.layout.${l}`,l,h,y)||(l!=="visibility"?this._unevaluatedLayout.setValue(l,h):this.visibility=h)}getPaintProperty(l){return l.endsWith($s)?this._transitionablePaint.getTransition(l.slice(0,-$s.length)):this._transitionablePaint.getValue(l)}setPaintProperty(l,h,y={}){if(h!=null&&this._validate(J1,`layers.${this.id}.paint.${l}`,l,h,y))return!1;if(l.endsWith($s))return this._transitionablePaint.setTransition(l.slice(0,-$s.length),h||void 0),!1;{const C=this._transitionablePaint._values[l],k=C.property.specification["property-type"]==="cross-faded-data-driven",D=C.value.isDataDriven(),z=C.value;this._transitionablePaint.setValue(l,h),this._handleSpecialPaintPropertyUpdate(l);const B=this._transitionablePaint._values[l].value;return B.isDataDriven()||D||k||this._handleOverridablePaintPropertyUpdate(l,z,B)}}_handleSpecialPaintPropertyUpdate(l){}_handleOverridablePaintPropertyUpdate(l,h,y){return!1}isHidden(l){return!!(this.minzoom&&l=this.maxzoom)||this.visibility==="none"}updateTransitions(l){this._transitioningPaint=this._transitionablePaint.transitioned(l,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(l,h){l.getCrossfadeParameters&&(this._crossfadeParameters=l.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(l,void 0,h)),this.paint=this._transitioningPaint.possiblyEvaluate(l,void 0,h)}serialize(){const l={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(l.layout=l.layout||{},l.layout.visibility=this.visibility),M(l,(h,y)=>!(h===void 0||y==="layout"&&!Object.keys(h).length||y==="paint"&&!Object.keys(h).length))}_validate(l,h,y,C,k={}){return(!k||k.validate!==!1)&&sf(this,l.call(Rc,{key:h,layerType:this.type,objectKey:y,value:C,styleSpec:ze,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const l in this.paint._values){const h=this.paint.get(l);if(h instanceof Na&&Or(h.property.specification)&&(h.value.kind==="source"||h.value.kind==="composite")&&h.value.isStateDependent)return!0}return!1}}const hy={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Bs{constructor(l,h){this._structArray=l,this._pos1=h*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ni{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(l,h){return l._trim(),h&&(l.isTransferred=!0,h.push(l.arrayBuffer)),{length:l.length,arrayBuffer:l.arrayBuffer}}static deserialize(l){const h=Object.create(this.prototype);return h.arrayBuffer=l.arrayBuffer,h.length=l.length,h.capacity=l.arrayBuffer.byteLength/h.bytesPerElement,h._refreshViews(),h}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(l){this.reserve(l),this.length=l}reserve(l){if(l>this.capacity){this.capacity=Math.max(l,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const h=this.uint8;this._refreshViews(),h&&this.uint8.set(h)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function hi(d,l=1){let h=0,y=0;return{members:d.map(C=>{const k=hy[C.type].BYTES_PER_ELEMENT,D=h=Pp(h,Math.max(l,k)),z=C.components||1;return y=Math.max(y,k),h+=k*z,{name:C.name,type:C.type,components:z,offset:D}}),size:Pp(h,Math.max(y,l)),alignment:l}}function Pp(d,l){return Math.ceil(d/l)*l}class ml extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h){const y=this.length;return this.resize(y+1),this.emplace(y,l,h)}emplace(l,h,y){const C=2*l;return this.int16[C+0]=h,this.int16[C+1]=y,l}}ml.prototype.bytesPerElement=4,gn("StructArrayLayout2i4",ml);class w extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,C){const k=this.length;return this.resize(k+1),this.emplace(k,l,h,y,C)}emplace(l,h,y,C,k){const D=4*l;return this.int16[D+0]=h,this.int16[D+1]=y,this.int16[D+2]=C,this.int16[D+3]=k,l}}w.prototype.bytesPerElement=8,gn("StructArrayLayout4i8",w);class u extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D){const z=this.length;return this.resize(z+1),this.emplace(z,l,h,y,C,k,D)}emplace(l,h,y,C,k,D,z){const B=6*l;return this.int16[B+0]=h,this.int16[B+1]=y,this.int16[B+2]=C,this.int16[B+3]=k,this.int16[B+4]=D,this.int16[B+5]=z,l}}u.prototype.bytesPerElement=12,gn("StructArrayLayout2i4i12",u);class m extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D){const z=this.length;return this.resize(z+1),this.emplace(z,l,h,y,C,k,D)}emplace(l,h,y,C,k,D,z){const B=4*l,K=8*l;return this.int16[B+0]=h,this.int16[B+1]=y,this.uint8[K+4]=C,this.uint8[K+5]=k,this.uint8[K+6]=D,this.uint8[K+7]=z,l}}m.prototype.bytesPerElement=8,gn("StructArrayLayout2i4ub8",m);class x extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h){const y=this.length;return this.resize(y+1),this.emplace(y,l,h)}emplace(l,h,y){const C=2*l;return this.float32[C+0]=h,this.float32[C+1]=y,l}}x.prototype.bytesPerElement=8,gn("StructArrayLayout2f8",x);class S extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D,z,B,K,ee){const ie=this.length;return this.resize(ie+1),this.emplace(ie,l,h,y,C,k,D,z,B,K,ee)}emplace(l,h,y,C,k,D,z,B,K,ee,ie){const de=10*l;return this.uint16[de+0]=h,this.uint16[de+1]=y,this.uint16[de+2]=C,this.uint16[de+3]=k,this.uint16[de+4]=D,this.uint16[de+5]=z,this.uint16[de+6]=B,this.uint16[de+7]=K,this.uint16[de+8]=ee,this.uint16[de+9]=ie,l}}S.prototype.bytesPerElement=20,gn("StructArrayLayout10ui20",S);class R extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D,z,B,K,ee,ie,de){const ge=this.length;return this.resize(ge+1),this.emplace(ge,l,h,y,C,k,D,z,B,K,ee,ie,de)}emplace(l,h,y,C,k,D,z,B,K,ee,ie,de,ge){const ve=12*l;return this.int16[ve+0]=h,this.int16[ve+1]=y,this.int16[ve+2]=C,this.int16[ve+3]=k,this.uint16[ve+4]=D,this.uint16[ve+5]=z,this.uint16[ve+6]=B,this.uint16[ve+7]=K,this.int16[ve+8]=ee,this.int16[ve+9]=ie,this.int16[ve+10]=de,this.int16[ve+11]=ge,l}}R.prototype.bytesPerElement=24,gn("StructArrayLayout4i4ui4i24",R);class L extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y){const C=this.length;return this.resize(C+1),this.emplace(C,l,h,y)}emplace(l,h,y,C){const k=3*l;return this.float32[k+0]=h,this.float32[k+1]=y,this.float32[k+2]=C,l}}L.prototype.bytesPerElement=12,gn("StructArrayLayout3f12",L);class V extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(l){const h=this.length;return this.resize(h+1),this.emplace(h,l)}emplace(l,h){return this.uint32[1*l+0]=h,l}}V.prototype.bytesPerElement=4,gn("StructArrayLayout1ul4",V);class H extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D,z,B,K){const ee=this.length;return this.resize(ee+1),this.emplace(ee,l,h,y,C,k,D,z,B,K)}emplace(l,h,y,C,k,D,z,B,K,ee){const ie=10*l,de=5*l;return this.int16[ie+0]=h,this.int16[ie+1]=y,this.int16[ie+2]=C,this.int16[ie+3]=k,this.int16[ie+4]=D,this.int16[ie+5]=z,this.uint32[de+3]=B,this.uint16[ie+8]=K,this.uint16[ie+9]=ee,l}}H.prototype.bytesPerElement=20,gn("StructArrayLayout6i1ul2ui20",H);class G extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D){const z=this.length;return this.resize(z+1),this.emplace(z,l,h,y,C,k,D)}emplace(l,h,y,C,k,D,z){const B=6*l;return this.int16[B+0]=h,this.int16[B+1]=y,this.int16[B+2]=C,this.int16[B+3]=k,this.int16[B+4]=D,this.int16[B+5]=z,l}}G.prototype.bytesPerElement=12,gn("StructArrayLayout2i2i2i12",G);class ne extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k){const D=this.length;return this.resize(D+1),this.emplace(D,l,h,y,C,k)}emplace(l,h,y,C,k,D){const z=4*l,B=8*l;return this.float32[z+0]=h,this.float32[z+1]=y,this.float32[z+2]=C,this.int16[B+6]=k,this.int16[B+7]=D,l}}ne.prototype.bytesPerElement=16,gn("StructArrayLayout2f1f2i16",ne);class le extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y,C){const k=this.length;return this.resize(k+1),this.emplace(k,l,h,y,C)}emplace(l,h,y,C,k){const D=12*l,z=3*l;return this.uint8[D+0]=h,this.uint8[D+1]=y,this.float32[z+1]=C,this.float32[z+2]=k,l}}le.prototype.bytesPerElement=12,gn("StructArrayLayout2ub2f12",le);class pe extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y){const C=this.length;return this.resize(C+1),this.emplace(C,l,h,y)}emplace(l,h,y,C){const k=3*l;return this.uint16[k+0]=h,this.uint16[k+1]=y,this.uint16[k+2]=C,l}}pe.prototype.bytesPerElement=6,gn("StructArrayLayout3ui6",pe);class Te extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve,Ne,Oe,Qe){const ht=this.length;return this.resize(ht+1),this.emplace(ht,l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve,Ne,Oe,Qe)}emplace(l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve,Ne,Oe,Qe,ht){const Ge=24*l,lt=12*l,Rt=48*l;return this.int16[Ge+0]=h,this.int16[Ge+1]=y,this.uint16[Ge+2]=C,this.uint16[Ge+3]=k,this.uint32[lt+2]=D,this.uint32[lt+3]=z,this.uint32[lt+4]=B,this.uint16[Ge+10]=K,this.uint16[Ge+11]=ee,this.uint16[Ge+12]=ie,this.float32[lt+7]=de,this.float32[lt+8]=ge,this.uint8[Rt+36]=ve,this.uint8[Rt+37]=Ne,this.uint8[Rt+38]=Oe,this.uint32[lt+10]=Qe,this.int16[Ge+22]=ht,l}}Te.prototype.bytesPerElement=48,gn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Te);class _e extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve,Ne,Oe,Qe,ht,Ge,lt,Rt,kt,hn,vn,ln,en,Qt,un){const nn=this.length;return this.resize(nn+1),this.emplace(nn,l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve,Ne,Oe,Qe,ht,Ge,lt,Rt,kt,hn,vn,ln,en,Qt,un)}emplace(l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve,Ne,Oe,Qe,ht,Ge,lt,Rt,kt,hn,vn,ln,en,Qt,un,nn){const jt=34*l,In=17*l;return this.int16[jt+0]=h,this.int16[jt+1]=y,this.int16[jt+2]=C,this.int16[jt+3]=k,this.int16[jt+4]=D,this.int16[jt+5]=z,this.int16[jt+6]=B,this.int16[jt+7]=K,this.uint16[jt+8]=ee,this.uint16[jt+9]=ie,this.uint16[jt+10]=de,this.uint16[jt+11]=ge,this.uint16[jt+12]=ve,this.uint16[jt+13]=Ne,this.uint16[jt+14]=Oe,this.uint16[jt+15]=Qe,this.uint16[jt+16]=ht,this.uint16[jt+17]=Ge,this.uint16[jt+18]=lt,this.uint16[jt+19]=Rt,this.uint16[jt+20]=kt,this.uint16[jt+21]=hn,this.uint16[jt+22]=vn,this.uint32[In+12]=ln,this.float32[In+13]=en,this.float32[In+14]=Qt,this.float32[In+15]=un,this.float32[In+16]=nn,l}}_e.prototype.bytesPerElement=68,gn("StructArrayLayout8i15ui1ul4f68",_e);class Ee extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l){const h=this.length;return this.resize(h+1),this.emplace(h,l)}emplace(l,h){return this.float32[1*l+0]=h,l}}Ee.prototype.bytesPerElement=4,gn("StructArrayLayout1f4",Ee);class Be extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y){const C=this.length;return this.resize(C+1),this.emplace(C,l,h,y)}emplace(l,h,y,C){const k=3*l;return this.int16[k+0]=h,this.int16[k+1]=y,this.int16[k+2]=C,l}}Be.prototype.bytesPerElement=6,gn("StructArrayLayout3i6",Be);class We extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y){const C=this.length;return this.resize(C+1),this.emplace(C,l,h,y)}emplace(l,h,y,C){const k=4*l;return this.uint32[2*l+0]=h,this.uint16[k+2]=y,this.uint16[k+3]=C,l}}We.prototype.bytesPerElement=8,gn("StructArrayLayout1ul2ui8",We);class rt extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h){const y=this.length;return this.resize(y+1),this.emplace(y,l,h)}emplace(l,h,y){const C=2*l;return this.uint16[C+0]=h,this.uint16[C+1]=y,l}}rt.prototype.bytesPerElement=4,gn("StructArrayLayout2ui4",rt);class De extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l){const h=this.length;return this.resize(h+1),this.emplace(h,l)}emplace(l,h){return this.uint16[1*l+0]=h,l}}De.prototype.bytesPerElement=2,gn("StructArrayLayout1ui2",De);class ft extends ni{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y,C){const k=this.length;return this.resize(k+1),this.emplace(k,l,h,y,C)}emplace(l,h,y,C,k){const D=4*l;return this.float32[D+0]=h,this.float32[D+1]=y,this.float32[D+2]=C,this.float32[D+3]=k,l}}ft.prototype.bytesPerElement=16,gn("StructArrayLayout4f16",ft);class st extends Bs{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new re(this.anchorPointX,this.anchorPointY)}}st.prototype.size=20;class _t extends H{get(l){return new st(this,l)}}gn("CollisionBoxArray",_t);class wt extends Bs{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(l){this._structArray.uint8[this._pos1+37]=l}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(l){this._structArray.uint8[this._pos1+38]=l}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(l){this._structArray.uint32[this._pos4+10]=l}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}wt.prototype.size=48;class Ut extends Te{get(l){return new wt(this,l)}}gn("PlacedSymbolArray",Ut);class xt extends Bs{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(l){this._structArray.uint32[this._pos4+12]=l}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}xt.prototype.size=68;class cn extends _e{get(l){return new xt(this,l)}}gn("SymbolInstanceArray",cn);class Jt extends Ee{getoffsetX(l){return this.float32[1*l+0]}}gn("GlyphOffsetArray",Jt);class fn extends Be{getx(l){return this.int16[3*l+0]}gety(l){return this.int16[3*l+1]}gettileUnitDistanceFromAnchor(l){return this.int16[3*l+2]}}gn("SymbolLineVertexArray",fn);class $n extends Bs{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}$n.prototype.size=8;class Hn extends We{get(l){return new $n(this,l)}}gn("FeatureIndexArray",Hn);class Tn extends ml{}class mr extends ml{}class gr extends ml{}class ir extends u{}class ar extends m{}class br extends x{}class Ti extends S{}class Fa extends R{}class la extends L{}class za extends V{}class Vs extends G{}class Wo extends le{}class vo extends pe{}class hs extends rt{}const cf=hi([{name:"a_pos",components:2,type:"Int16"}],4),{members:yi}=cf;class Zn{constructor(l=[]){this.segments=l}prepareSegment(l,h,y,C){let k=this.segments[this.segments.length-1];return l>Zn.MAX_VERTEX_ARRAY_LENGTH&&F(`Max vertices per segment is ${Zn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${l}`),(!k||k.vertexLength+l>Zn.MAX_VERTEX_ARRAY_LENGTH||k.sortKey!==C)&&(k={vertexOffset:h.length,primitiveOffset:y.length,vertexLength:0,primitiveLength:0},C!==void 0&&(k.sortKey=C),this.segments.push(k)),k}get(){return this.segments}destroy(){for(const l of this.segments)for(const h in l.vaos)l.vaos[h].destroy()}static simpleSegment(l,h,y,C){return new Zn([{vertexOffset:l,primitiveOffset:h,vertexLength:y,primitiveLength:C,vaos:{},sortKey:0}])}}function pr(d,l){return 256*(d=v(Math.floor(d),0,255))+v(Math.floor(l),0,255)}Zn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,gn("SegmentVector",Zn);const Ii=hi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ki={exports:{}},Vr={exports:{}};Vr.exports=function(d,l){var h,y,C,k,D,z,B,K;for(y=d.length-(h=3&d.length),C=l,D=3432918353,z=461845907,K=0;K>>16)*D&65535)<<16)&4294967295)<<15|B>>>17))*z+(((B>>>16)*z&65535)<<16)&4294967295)<<13|C>>>19))+((5*(C>>>16)&65535)<<16)&4294967295))+((58964+(k>>>16)&65535)<<16);switch(B=0,h){case 3:B^=(255&d.charCodeAt(K+2))<<16;case 2:B^=(255&d.charCodeAt(K+1))<<8;case 1:C^=B=(65535&(B=(B=(65535&(B^=255&d.charCodeAt(K)))*D+(((B>>>16)*D&65535)<<16)&4294967295)<<15|B>>>17))*z+(((B>>>16)*z&65535)<<16)&4294967295}return C^=d.length,C=2246822507*(65535&(C^=C>>>16))+((2246822507*(C>>>16)&65535)<<16)&4294967295,C=3266489909*(65535&(C^=C>>>13))+((3266489909*(C>>>16)&65535)<<16)&4294967295,(C^=C>>>16)>>>0};var Go={exports:{}};Go.exports=function(d,l){for(var h,y=d.length,C=l^y,k=0;y>=4;)h=1540483477*(65535&(h=255&d.charCodeAt(k)|(255&d.charCodeAt(++k))<<8|(255&d.charCodeAt(++k))<<16|(255&d.charCodeAt(++k))<<24))+((1540483477*(h>>>16)&65535)<<16),C=1540483477*(65535&C)+((1540483477*(C>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),y-=4,++k;switch(y){case 3:C^=(255&d.charCodeAt(k+2))<<16;case 2:C^=(255&d.charCodeAt(k+1))<<8;case 1:C=1540483477*(65535&(C^=255&d.charCodeAt(k)))+((1540483477*(C>>>16)&65535)<<16)}return C=1540483477*(65535&(C^=C>>>13))+((1540483477*(C>>>16)&65535)<<16),(C^=C>>>15)>>>0};var gl=Vr.exports,Tp=Go.exports;ki.exports=gl,ki.exports.murmur3=gl,ki.exports.murmur2=Tp;class hu{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(l,h,y,C){this.ids.push(py(l)),this.positions.push(h,y,C)}getPositions(l){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const h=py(l);let y=0,C=this.ids.length-1;for(;y>1;this.ids[D]>=h?C=D:y=D+1}const k=[];for(;this.ids[y]===h;)k.push({index:this.positions[3*y],start:this.positions[3*y+1],end:this.positions[3*y+2]}),y++;return k}static serialize(l,h){const y=new Float64Array(l.ids),C=new Uint32Array(l.positions);return Ip(y,C,0,y.length-1),h&&h.push(y.buffer,C.buffer),{ids:y,positions:C}}static deserialize(l){const h=new hu;return h.ids=l.ids,h.positions=l.positions,h.indexed=!0,h}}function py(d){const l=+d;return!isNaN(l)&&l<=Number.MAX_SAFE_INTEGER?l:ki.exports(String(d))}function Ip(d,l,h,y){for(;h>1];let k=h-1,D=y+1;for(;;){do k++;while(d[k]C);if(k>=D)break;Us(d,k,D),Us(l,3*k,3*D),Us(l,3*k+1,3*D+1),Us(l,3*k+2,3*D+2)}D-h`u_${C}`),this.type=y}setUniform(l,h,y){l.set(y.constantOr(this.value))}getBinding(l,h,y){return this.type==="color"?new ck(l,h):new yl(l,h)}}class ff{constructor(l,h){this.uniformNames=h.map(y=>`u_${y}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(l,h){this.pixelRatioFrom=h.pixelRatio,this.pixelRatioTo=l.pixelRatio,this.patternFrom=h.tlbr,this.patternTo=l.tlbr}setUniform(l,h,y,C){const k=C==="u_pattern_to"?this.patternTo:C==="u_pattern_from"?this.patternFrom:C==="u_pixel_ratio_to"?this.pixelRatioTo:C==="u_pixel_ratio_from"?this.pixelRatioFrom:null;k&&l.set(k)}getBinding(l,h,y){return y.substr(0,9)==="u_pattern"?new df(l,h):new yl(l,h)}}class xl{constructor(l,h,y,C){this.expression=l,this.type=y,this.maxValue=0,this.paintVertexAttributes=h.map(k=>({name:`a_${k}`,type:"Float32",components:y==="color"?2:1,offset:0})),this.paintVertexArray=new C}populatePaintArray(l,h,y,C,k){const D=this.paintVertexArray.length,z=this.expression.evaluate(new Br(0),h,{},C,[],k);this.paintVertexArray.resize(l),this._setPaintValue(D,l,z)}updatePaintArray(l,h,y,C){const k=this.expression.evaluate({zoom:0},y,C);this._setPaintValue(l,h,k)}_setPaintValue(l,h,y){if(this.type==="color"){const C=iw(y);for(let k=l;k`u_${z}_t`),this.type=y,this.useIntegerZoom=C,this.zoom=k,this.maxValue=0,this.paintVertexAttributes=h.map(z=>({name:`a_${z}`,type:"Float32",components:y==="color"?4:2,offset:0})),this.paintVertexArray=new D}populatePaintArray(l,h,y,C,k){const D=this.expression.evaluate(new Br(this.zoom),h,{},C,[],k),z=this.expression.evaluate(new Br(this.zoom+1),h,{},C,[],k),B=this.paintVertexArray.length;this.paintVertexArray.resize(l),this._setPaintValue(B,l,D,z)}updatePaintArray(l,h,y,C){const k=this.expression.evaluate({zoom:this.zoom},y,C),D=this.expression.evaluate({zoom:this.zoom+1},y,C);this._setPaintValue(l,h,k,D)}_setPaintValue(l,h,y,C){if(this.type==="color"){const k=iw(y),D=iw(C);for(let z=l;z`#define HAS_UNIFORM_${C}`))}return l}getBinderAttributes(){const l=[];for(const h in this.binders){const y=this.binders[h];if(y instanceof xl||y instanceof ps)for(let C=0;C!0){this.programConfigurations={};for(const C of l)this.programConfigurations[C.id]=new dk(C,h,y);this.needsUpload=!1,this._featureMap=new hu,this._bufferOffset=0}populatePaintArrays(l,h,y,C,k,D){for(const z in this.programConfigurations)this.programConfigurations[z].populatePaintArrays(l,h,C,k,D);h.id!==void 0&&this._featureMap.add(h.id,y,this._bufferOffset,l),this._bufferOffset=l,this.needsUpload=!0}updatePaintArrays(l,h,y,C){for(const k of y)this.needsUpload=this.programConfigurations[k.id].updatePaintArrays(l,this._featureMap,h,k,C)||this.needsUpload}get(l){return this.programConfigurations[l]}upload(l){if(this.needsUpload){for(const h in this.programConfigurations)this.programConfigurations[h].upload(l);this.needsUpload=!1}}destroy(){for(const l in this.programConfigurations)this.programConfigurations[l].destroy()}}function kj(d,l){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[d]||[d.replace(`${l}-`,"").replace(/-/g,"_")]}function fk(d,l,h){const y={color:{source:x,composite:ft},number:{source:Ee,composite:x}},C=function(k){return{"line-pattern":{source:Ti,composite:Ti},"fill-pattern":{source:Ti,composite:Ti},"fill-extrusion-pattern":{source:Ti,composite:Ti}}[k]}(d);return C&&C[h]||y[l][h]}gn("ConstantBinder",kp),gn("CrossFadedConstantBinder",ff),gn("SourceExpressionBinder",xl),gn("CrossFadedCompositeBinder",pu),gn("CompositeExpressionBinder",ps),gn("ProgramConfiguration",dk,{omit:["_buffers"]}),gn("ProgramConfigurationSet",Lc);var xi=8192;const ow=Math.pow(2,14)-1,hk=-ow-1;function Fc(d){const l=xi/d.extent,h=d.loadGeometry();for(let y=0;yD.x+1||BD.y+1)&&F("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return h}function zc(d,l){return{type:d.type,id:d.id,properties:d.properties,geometry:l?Fc(d):[]}}function my(d,l,h,y,C){d.emplaceBack(2*l+(y+1)/2,2*h+(C+1)/2)}class aw{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map(h=>h.id),this.index=l.index,this.hasPattern=!1,this.layoutVertexArray=new mr,this.indexArray=new vo,this.segments=new Zn,this.programConfigurations=new Lc(l.layers,l.zoom),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){const C=this.layers[0],k=[];let D=null,z=!1;C.type==="circle"&&(D=C.layout.get("circle-sort-key"),z=!D.isConstant());for(const{feature:B,id:K,index:ee,sourceLayerIndex:ie}of l){const de=this.layers[0]._featureFilter.needGeometry,ge=zc(B,de);if(!this.layers[0]._featureFilter.filter(new Br(this.zoom),ge,y))continue;const ve=z?D.evaluate(ge,{},y):void 0,Ne={id:K,properties:B.properties,type:B.type,sourceLayerIndex:ie,index:ee,geometry:de?ge.geometry:Fc(B),patterns:{},sortKey:ve};k.push(Ne)}z&&k.sort((B,K)=>B.sortKey-K.sortKey);for(const B of k){const{geometry:K,index:ee,sourceLayerIndex:ie}=B,de=l[ee].feature;this.addFeature(B,K,ee,y),h.featureIndex.insert(de,K,ee,ie,this.index)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,yi),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(l,h,y,C){for(const k of h)for(const D of k){const z=D.x,B=D.y;if(z<0||z>=xi||B<0||B>=xi)continue;const K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,l.sortKey),ee=K.vertexLength;my(this.layoutVertexArray,z,B,-1,-1),my(this.layoutVertexArray,z,B,1,-1),my(this.layoutVertexArray,z,B,1,1),my(this.layoutVertexArray,z,B,-1,1),this.indexArray.emplaceBack(ee,ee+1,ee+2),this.indexArray.emplaceBack(ee,ee+3,ee+2),K.vertexLength+=4,K.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,y,{},C)}}function pk(d,l){for(let h=0;h1){if(sw(d,l))return!0;for(let y=0;y1?h:h.sub(l)._mult(C)._add(l))}function vk(d,l){let h,y,C,k=!1;for(let D=0;Dl.y!=C.y>l.y&&l.x<(C.x-y.x)*(l.y-y.y)/(C.y-y.y)+y.x&&(k=!k)}return k}function hf(d,l){let h=!1;for(let y=0,C=d.length-1;yl.y!=D.y>l.y&&l.x<(D.x-k.x)*(l.y-k.y)/(D.y-k.y)+k.x&&(h=!h)}return h}function Oj(d,l,h){const y=h[0],C=h[2];if(d.xC.x&&l.x>C.x||d.yC.y&&l.y>C.y)return!1;const k=$(d,l,h[0]);return k!==$(d,l,h[1])||k!==$(d,l,h[2])||k!==$(d,l,h[3])}function Mp(d,l,h){const y=l.paint.get(d).value;return y.kind==="constant"?y.value:h.programConfigurations.get(l.id).getMaxValue(d)}function gy(d){return Math.sqrt(d[0]*d[0]+d[1]*d[1])}function vy(d,l,h,y,C){if(!l[0]&&!l[1])return d;const k=re.convert(l)._mult(C);h==="viewport"&&k._rotate(-y);const D=[];for(let z=0;zd.width||C.height>d.height||h.x>d.width-C.width||h.y>d.height-C.height)throw new RangeError("out of range source coordinates for image copy");if(C.width>l.width||C.height>l.height||y.x>l.width-C.width||y.y>l.height-C.height)throw new RangeError("out of range destination coordinates for image copy");const D=d.data,z=l.data;if(D===z)throw new Error("srcData equals dstData, so image is already copied");for(let B=0;B{l[d.evaluationKey]=B;const K=d.expression.evaluate(l);C.data[D+z+0]=Math.floor(255*K.r/K.a),C.data[D+z+1]=Math.floor(255*K.g/K.a),C.data[D+z+2]=Math.floor(255*K.b/K.a),C.data[D+z+3]=Math.floor(255*K.a)};if(d.clips)for(let D=0,z=0;D80*h){y=k=d[0],C=D=d[1];for(var ve=h;vek&&(k=z),B>D&&(D=B);K=(K=Math.max(k-y,D-C))!==0?32767/K:0}return Op(de,ge,h,y,C,K,0),ge}function Tk(d,l,h,y,C){var k,D;if(C===pw(d,l,h,y)>0)for(k=l;k=l;k-=y)D=Mk(k,d[k],d[k+1],D);return D&&_y(D,D.next)&&(Np(D),D=D.next),D}function $c(d,l){if(!d)return d;l||(l=d);var h,y=d;do if(h=!1,y.steiner||!_y(y,y.next)&&ui(y.prev,y,y.next)!==0)y=y.next;else{if(Np(y),(y=l=y.prev)===y.next)break;h=!0}while(h||y!==l);return l}function Op(d,l,h,y,C,k,D){if(d){!D&&k&&function(ee,ie,de,ge){var ve=ee;do ve.z===0&&(ve.z=fw(ve.x,ve.y,ie,de,ge)),ve.prevZ=ve.prev,ve.nextZ=ve.next,ve=ve.next;while(ve!==ee);ve.prevZ.nextZ=null,ve.prevZ=null,function(Ne){var Oe,Qe,ht,Ge,lt,Rt,kt,hn,vn=1;do{for(Qe=Ne,Ne=null,lt=null,Rt=0;Qe;){for(Rt++,ht=Qe,kt=0,Oe=0;Oe0||hn>0&&ht;)kt!==0&&(hn===0||!ht||Qe.z<=ht.z)?(Ge=Qe,Qe=Qe.nextZ,kt--):(Ge=ht,ht=ht.nextZ,hn--),lt?lt.nextZ=Ge:Ne=Ge,Ge.prevZ=lt,lt=Ge;Qe=ht}lt.nextZ=null,vn*=2}while(Rt>1)}(ve)}(d,y,C,k);for(var z,B,K=d;d.prev!==d.next;)if(z=d.prev,B=d.next,k?Uj(d,y,C,k):Vj(d))l.push(z.i/h|0),l.push(d.i/h|0),l.push(B.i/h|0),Np(d),d=B.next,K=B.next;else if((d=B)===K){D?D===1?Op(d=jj($c(d),l,h),l,h,y,C,k,2):D===2&&Hj(d,l,h,y,C,k):Op($c(d),l,h,y,C,k,1);break}}}function Vj(d){var l=d.prev,h=d,y=d.next;if(ui(l,h,y)>=0)return!1;for(var C=l.x,k=h.x,D=y.x,z=l.y,B=h.y,K=y.y,ee=Ck?C>D?C:D:k>D?k:D,ge=z>B?z>K?z:K:B>K?B:K,ve=y.next;ve!==l;){if(ve.x>=ee&&ve.x<=de&&ve.y>=ie&&ve.y<=ge&&pf(C,z,k,B,D,K,ve.x,ve.y)&&ui(ve.prev,ve,ve.next)>=0)return!1;ve=ve.next}return!0}function Uj(d,l,h,y){var C=d.prev,k=d,D=d.next;if(ui(C,k,D)>=0)return!1;for(var z=C.x,B=k.x,K=D.x,ee=C.y,ie=k.y,de=D.y,ge=zB?z>K?z:K:B>K?B:K,Oe=ee>ie?ee>de?ee:de:ie>de?ie:de,Qe=fw(ge,ve,l,h,y),ht=fw(Ne,Oe,l,h,y),Ge=d.prevZ,lt=d.nextZ;Ge&&Ge.z>=Qe&<&<.z<=ht;){if(Ge.x>=ge&&Ge.x<=Ne&&Ge.y>=ve&&Ge.y<=Oe&&Ge!==C&&Ge!==D&&pf(z,ee,B,ie,K,de,Ge.x,Ge.y)&&ui(Ge.prev,Ge,Ge.next)>=0||(Ge=Ge.prevZ,lt.x>=ge&<.x<=Ne&<.y>=ve&<.y<=Oe&<!==C&<!==D&&pf(z,ee,B,ie,K,de,lt.x,lt.y)&&ui(lt.prev,lt,lt.next)>=0))return!1;lt=lt.nextZ}for(;Ge&&Ge.z>=Qe;){if(Ge.x>=ge&&Ge.x<=Ne&&Ge.y>=ve&&Ge.y<=Oe&&Ge!==C&&Ge!==D&&pf(z,ee,B,ie,K,de,Ge.x,Ge.y)&&ui(Ge.prev,Ge,Ge.next)>=0)return!1;Ge=Ge.prevZ}for(;lt&<.z<=ht;){if(lt.x>=ge&<.x<=Ne&<.y>=ve&<.y<=Oe&<!==C&<!==D&&pf(z,ee,B,ie,K,de,lt.x,lt.y)&&ui(lt.prev,lt,lt.next)>=0)return!1;lt=lt.nextZ}return!0}function jj(d,l,h){var y=d;do{var C=y.prev,k=y.next.next;!_y(C,k)&&Ik(C,y,y.next,k)&&Ap(C,k)&&Ap(k,C)&&(l.push(C.i/h|0),l.push(y.i/h|0),l.push(k.i/h|0),Np(y),Np(y.next),y=d=k),y=y.next}while(y!==d);return $c(y)}function Hj(d,l,h,y,C,k){var D=d;do{for(var z=D.next.next;z!==D.prev;){if(D.i!==z.i&&Zj(D,z)){var B=kk(D,z);return D=$c(D,D.next),B=$c(B,B.next),Op(D,l,h,y,C,k,0),void Op(B,l,h,y,C,k,0)}z=z.next}D=D.next}while(D!==d)}function Kj(d,l){return d.x-l.x}function Wj(d,l){var h=function(C,k){var D,z=k,B=C.x,K=C.y,ee=-1/0;do{if(K<=z.y&&K>=z.next.y&&z.next.y!==z.y){var ie=z.x+(K-z.y)*(z.next.x-z.x)/(z.next.y-z.y);if(ie<=B&&ie>ee&&(ee=ie,D=z.x=z.x&&z.x>=ve&&B!==z.x&&pf(KD.x||z.x===D.x&&Gj(D,z)))&&(D=z,Oe=de)),z=z.next;while(z!==ge);return D}(d,l);if(!h)return l;var y=kk(h,d);return $c(y,y.next),$c(h,h.next)}function Gj(d,l){return ui(d.prev,d,l.prev)<0&&ui(l.next,d,d.next)<0}function fw(d,l,h,y,C){return(d=1431655765&((d=858993459&((d=252645135&((d=16711935&((d=(d-h)*C|0)|d<<8))|d<<4))|d<<2))|d<<1))|(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-y)*C|0)|l<<8))|l<<4))|l<<2))|l<<1))<<1}function qj(d){var l=d,h=d;do(l.x=(d-D)*(k-z)&&(d-D)*(y-z)>=(h-D)*(l-z)&&(h-D)*(k-z)>=(C-D)*(y-z)}function Zj(d,l){return d.next.i!==l.i&&d.prev.i!==l.i&&!function(h,y){var C=h;do{if(C.i!==h.i&&C.next.i!==h.i&&C.i!==y.i&&C.next.i!==y.i&&Ik(C,C.next,h,y))return!0;C=C.next}while(C!==h);return!1}(d,l)&&(Ap(d,l)&&Ap(l,d)&&function(h,y){var C=h,k=!1,D=(h.x+y.x)/2,z=(h.y+y.y)/2;do C.y>z!=C.next.y>z&&C.next.y!==C.y&&D<(C.next.x-C.x)*(z-C.y)/(C.next.y-C.y)+C.x&&(k=!k),C=C.next;while(C!==h);return k}(d,l)&&(ui(d.prev,d,l.prev)||ui(d,l.prev,l))||_y(d,l)&&ui(d.prev,d,d.next)>0&&ui(l.prev,l,l.next)>0)}function ui(d,l,h){return(l.y-d.y)*(h.x-l.x)-(l.x-d.x)*(h.y-l.y)}function _y(d,l){return d.x===l.x&&d.y===l.y}function Ik(d,l,h,y){var C=Cy(ui(d,l,h)),k=Cy(ui(d,l,y)),D=Cy(ui(h,y,d)),z=Cy(ui(h,y,l));return C!==k&&D!==z||!(C!==0||!wy(d,h,l))||!(k!==0||!wy(d,y,l))||!(D!==0||!wy(h,d,y))||!(z!==0||!wy(h,l,y))}function wy(d,l,h){return l.x<=Math.max(d.x,h.x)&&l.x>=Math.min(d.x,h.x)&&l.y<=Math.max(d.y,h.y)&&l.y>=Math.min(d.y,h.y)}function Cy(d){return d>0?1:d<0?-1:0}function Ap(d,l){return ui(d.prev,d,d.next)<0?ui(d,l,d.next)>=0&&ui(d,d.prev,l)>=0:ui(d,l,d.prev)<0||ui(d,d.next,l)<0}function kk(d,l){var h=new hw(d.i,d.x,d.y),y=new hw(l.i,l.x,l.y),C=d.next,k=l.prev;return d.next=l,l.prev=d,h.next=C,C.prev=h,y.next=h,h.prev=y,k.next=y,y.prev=k,y}function Mk(d,l,h,y){var C=new hw(d,l,h);return y?(C.next=y.next,C.prev=y,y.next.prev=C,y.next=C):(C.prev=C,C.next=C),C}function Np(d){d.next.prev=d.prev,d.prev.next=d.next,d.prevZ&&(d.prevZ.nextZ=d.nextZ),d.nextZ&&(d.nextZ.prevZ=d.prevZ)}function hw(d,l,h){this.i=d,this.x=l,this.y=h,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function pw(d,l,h,y){for(var C=0,k=l,D=h-y;kh;){if(y-h>600){var k=y-h+1,D=l-h+1,z=Math.log(k),B=.5*Math.exp(2*z/3),K=.5*Math.sqrt(z*B*(k-B)/k)*(D-k/2<0?-1:1);Rk(d,l,Math.max(h,Math.floor(l-D*B/k+K)),Math.min(y,Math.floor(l+(k-D)*B/k+K)),C)}var ee=d[l],ie=h,de=y;for(Lp(d,h,l),C(d[y],ee)>0&&Lp(d,h,y);ie0;)de--}C(d[h],ee)===0?Lp(d,h,de):Lp(d,++de,y),de<=l&&(h=de+1),l<=de&&(y=de-1)}}function Lp(d,l,h){var y=d[l];d[l]=d[h],d[h]=y}function Yj(d,l){return dl?1:0}function mw(d,l){const h=d.length;if(h<=1)return[d];const y=[];let C,k;for(let D=0;D1)for(let D=0;D0&&h.holes.push(y+=d[C-1].length)}return h};class yw{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map(h=>h.id),this.index=l.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new gr,this.indexArray=new vo,this.indexArray2=new hs,this.programConfigurations=new Lc(l.layers,l.zoom),this.segments=new Zn,this.segments2=new Zn,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){this.hasPattern=gw("fill",this.layers,h);const C=this.layers[0].layout.get("fill-sort-key"),k=!C.isConstant(),D=[];for(const{feature:z,id:B,index:K,sourceLayerIndex:ee}of l){const ie=this.layers[0]._featureFilter.needGeometry,de=zc(z,ie);if(!this.layers[0]._featureFilter.filter(new Br(this.zoom),de,y))continue;const ge=k?C.evaluate(de,{},y,h.availableImages):void 0,ve={id:B,properties:z.properties,type:z.type,sourceLayerIndex:ee,index:K,geometry:ie?de.geometry:Fc(z),patterns:{},sortKey:ge};D.push(ve)}k&&D.sort((z,B)=>z.sortKey-B.sortKey);for(const z of D){const{geometry:B,index:K,sourceLayerIndex:ee}=z;if(this.hasPattern){const ie=vw("fill",this.layers,z,this.zoom,h);this.patternFeatures.push(ie)}else this.addFeature(z,B,K,y,{});h.featureIndex.insert(l[K].feature,B,K,ee,this.index)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}addFeatures(l,h,y){for(const C of this.patternFeatures)this.addFeature(C,C.geometry,C.index,h,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,Bj),this.indexBuffer=l.createIndexBuffer(this.indexArray),this.indexBuffer2=l.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(l,h,y,C,k){for(const D of mw(h,500)){let z=0;for(const ge of D)z+=ge.length;const B=this.segments.prepareSegment(z,this.layoutVertexArray,this.indexArray),K=B.vertexLength,ee=[],ie=[];for(const ge of D){if(ge.length===0)continue;ge!==D[0]&&ie.push(ee.length/2);const ve=this.segments2.prepareSegment(ge.length,this.layoutVertexArray,this.indexArray2),Ne=ve.vertexLength;this.layoutVertexArray.emplaceBack(ge[0].x,ge[0].y),this.indexArray2.emplaceBack(Ne+ge.length-1,Ne),ee.push(ge[0].x),ee.push(ge[0].y);for(let Oe=1;Oe>3}if(C--,y===1||y===2)k+=d.readSVarint(),D+=d.readSVarint(),y===1&&(l&&z.push(l),l=[]),l.push(new iH(k,D));else{if(y!==7)throw new Error("unknown command "+y);l&&l.push(l[0].clone())}}return l&&z.push(l),z},mf.prototype.bbox=function(){var d=this._pbf;d.pos=this._geometry;for(var l=d.readVarint()+d.pos,h=1,y=0,C=0,k=0,D=1/0,z=-1/0,B=1/0,K=-1/0;d.pos>3}if(y--,h===1||h===2)(C+=d.readSVarint())z&&(z=C),(k+=d.readSVarint())K&&(K=k);else if(h!==7)throw new Error("unknown command "+h)}return[D,B,z,K]},mf.prototype.toGeoJSON=function(d,l,h){var y,C,k=this.extent*Math.pow(2,h),D=this.extent*d,z=this.extent*l,B=this.loadGeometry(),K=mf.types[this.type];function ee(ge){for(var ve=0;ve>3;C=D===1?y.readString():D===2?y.readFloat():D===3?y.readDouble():D===4?y.readVarint64():D===5?y.readVarint():D===6?y.readSVarint():D===7?y.readBoolean():null}return C}(h))}Ak.prototype.feature=function(d){if(d<0||d>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[d];var l=this._pbf.readVarint()+this._pbf.pos;return new sH(this._pbf,l,this.extent,this._keys,this._values)};var uH=Ok;function cH(d,l,h){if(d===3){var y=new uH(h,h.readVarint()+h.pos);y.length&&(l[y.name]=y)}}mu.VectorTile=function(d,l){this.layers=d.readFields(cH,{},l)},mu.VectorTileFeature=Dk,mu.VectorTileLayer=Ok;const dH=mu.VectorTileFeature.types,xw=Math.pow(2,13);function Fp(d,l,h,y,C,k,D,z){d.emplaceBack(l,h,2*Math.floor(y*xw)+D,C*xw*2,k*xw*2,Math.round(z))}class bw{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map(h=>h.id),this.index=l.index,this.hasPattern=!1,this.layoutVertexArray=new ir,this.centroidVertexArray=new Tn,this.indexArray=new vo,this.programConfigurations=new Lc(l.layers,l.zoom),this.segments=new Zn,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){this.features=[],this.hasPattern=gw("fill-extrusion",this.layers,h);for(const{feature:C,id:k,index:D,sourceLayerIndex:z}of l){const B=this.layers[0]._featureFilter.needGeometry,K=zc(C,B);if(!this.layers[0]._featureFilter.filter(new Br(this.zoom),K,y))continue;const ee={id:k,sourceLayerIndex:z,index:D,geometry:B?K.geometry:Fc(C),properties:C.properties,type:C.type,patterns:{}};this.hasPattern?this.features.push(vw("fill-extrusion",this.layers,ee,this.zoom,h)):this.addFeature(ee,ee.geometry,D,y,{}),h.featureIndex.insert(C,ee.geometry,D,z,this.index,!0)}}addFeatures(l,h,y){for(const C of this.features){const{geometry:k}=C;this.addFeature(C,k,C.index,h,y)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,rH),this.centroidVertexBuffer=l.createVertexBuffer(this.centroidVertexArray,nH.members,!0),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(l,h,y,C,k){const D={x:0,y:0,vertexCount:0};for(const z of mw(h,500)){let B=0;for(const ve of z)B+=ve.length;let K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const ve of z){if(ve.length===0||hH(ve))continue;let Ne=0;for(let Oe=0;Oe=1){const ht=ve[Oe-1];if(!fH(Qe,ht)){K.vertexLength+4>Zn.MAX_VERTEX_ARRAY_LENGTH&&(K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ge=Qe.sub(ht)._perp()._unit(),lt=ht.dist(Qe);Ne+lt>32768&&(Ne=0),Fp(this.layoutVertexArray,Qe.x,Qe.y,Ge.x,Ge.y,0,0,Ne),Fp(this.layoutVertexArray,Qe.x,Qe.y,Ge.x,Ge.y,0,1,Ne),D.x+=2*Qe.x,D.y+=2*Qe.y,D.vertexCount+=2,Ne+=lt,Fp(this.layoutVertexArray,ht.x,ht.y,Ge.x,Ge.y,0,0,Ne),Fp(this.layoutVertexArray,ht.x,ht.y,Ge.x,Ge.y,0,1,Ne),D.x+=2*ht.x,D.y+=2*ht.y,D.vertexCount+=2;const Rt=K.vertexLength;this.indexArray.emplaceBack(Rt,Rt+2,Rt+1),this.indexArray.emplaceBack(Rt+1,Rt+2,Rt+3),K.vertexLength+=4,K.primitiveLength+=2}}}}if(K.vertexLength+B>Zn.MAX_VERTEX_ARRAY_LENGTH&&(K=this.segments.prepareSegment(B,this.layoutVertexArray,this.indexArray)),dH[l.type]!=="Polygon")continue;const ee=[],ie=[],de=K.vertexLength;for(const ve of z)if(ve.length!==0){ve!==z[0]&&ie.push(ee.length/2);for(let Ne=0;Nexi)||d.y===l.y&&(d.y<0||d.y>xi)}function hH(d){return d.every(l=>l.x<0)||d.every(l=>l.x>xi)||d.every(l=>l.y<0)||d.every(l=>l.y>xi)}gn("FillExtrusionBucket",bw,{omit:["layers","features"]});var pH={paint:new zi({"fill-extrusion-opacity":new xn(ze["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Rn(ze["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new xn(ze["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new xn(ze["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new fu(ze["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Rn(ze["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Rn(ze["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new xn(ze["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function zp(d,l){return d.x*l.x+d.y*l.y}function Nk(d,l){if(d.length===1){let h=0;const y=l[h++];let C;for(;!C||y.equals(C);)if(C=l[h++],!C)return 1/0;for(;hh.id),this.index=l.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(h=>{this.gradients[h.id]={}}),this.layoutVertexArray=new ar,this.layoutVertexArray2=new br,this.indexArray=new vo,this.programConfigurations=new Lc(l.layers,l.zoom),this.segments=new Zn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){this.hasPattern=gw("line",this.layers,h);const C=this.layers[0].layout.get("line-sort-key"),k=!C.isConstant(),D=[];for(const{feature:z,id:B,index:K,sourceLayerIndex:ee}of l){const ie=this.layers[0]._featureFilter.needGeometry,de=zc(z,ie);if(!this.layers[0]._featureFilter.filter(new Br(this.zoom),de,y))continue;const ge=k?C.evaluate(de,{},y):void 0,ve={id:B,properties:z.properties,type:z.type,sourceLayerIndex:ee,index:K,geometry:ie?de.geometry:Fc(z),patterns:{},sortKey:ge};D.push(ve)}k&&D.sort((z,B)=>z.sortKey-B.sortKey);for(const z of D){const{geometry:B,index:K,sourceLayerIndex:ee}=z;if(this.hasPattern){const ie=vw("line",this.layers,z,this.zoom,h);this.patternFeatures.push(ie)}else this.addFeature(z,B,K,y,{});h.featureIndex.insert(l[K].feature,B,K,ee,this.index)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}addFeatures(l,h,y){for(const C of this.patternFeatures)this.addFeature(C,C.geometry,C.index,h,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=l.createVertexBuffer(this.layoutVertexArray2,yH)),this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,gH),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(l){if(l.properties&&Object.prototype.hasOwnProperty.call(l.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(l.properties,"mapbox_clip_end"))return{start:+l.properties.mapbox_clip_start,end:+l.properties.mapbox_clip_end}}addFeature(l,h,y,C,k){const D=this.layers[0].layout,z=D.get("line-join").evaluate(l,{}),B=D.get("line-cap"),K=D.get("line-miter-limit"),ee=D.get("line-round-limit");this.lineClips=this.lineFeatureClips(l);for(const ie of h)this.addLine(ie,l,z,B,K,ee);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,y,k,C)}addLine(l,h,y,C,k,D){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Qe=0;Qe=2&&l[B-1].equals(l[B-2]);)B--;let K=0;for(;K0;if(hn&&Qe>K){const Qt=de.dist(ge);if(Qt>2*ee){const un=de.sub(de.sub(ge)._mult(ee/Qt)._round());this.updateDistance(ge,un),this.addCurrentVertex(un,Ne,0,0,ie),ge=un}}const ln=ge&&ve;let en=ln?y:z?"butt":C;if(ln&&en==="round"&&(Rtk&&(en="bevel"),en==="bevel"&&(Rt>2&&(en="flipbevel"),Rt100)ht=Oe.mult(-1);else{const Qt=Rt*Ne.add(Oe).mag()/Ne.sub(Oe).mag();ht._perp()._mult(Qt*(vn?-1:1))}this.addCurrentVertex(de,ht,0,0,ie),this.addCurrentVertex(de,ht.mult(-1),0,0,ie)}else if(en==="bevel"||en==="fakeround"){const Qt=-Math.sqrt(Rt*Rt-1),un=vn?Qt:0,nn=vn?0:Qt;if(ge&&this.addCurrentVertex(de,Ne,un,nn,ie),en==="fakeround"){const jt=Math.round(180*kt/Math.PI/20);for(let In=1;In2*ee){const un=de.add(ve.sub(de)._mult(ee/Qt)._round());this.updateDistance(de,un),this.addCurrentVertex(un,Oe,0,0,ie),de=un}}}}addCurrentVertex(l,h,y,C,k,D=!1){const z=h.y*C-h.x,B=-h.y-h.x*C;this.addHalfVertex(l,h.x+h.y*y,h.y-h.x*y,D,!1,y,k),this.addHalfVertex(l,z,B,D,!0,-C,k),this.distance>Lk/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(l,h,y,C,k,D))}addHalfVertex({x:l,y:h},y,C,k,D,z,B){const K=.5*(this.lineClips?this.scaledDistance*(Lk-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((l<<1)+(k?1:0),(h<<1)+(D?1:0),Math.round(63*y)+128,Math.round(63*C)+128,1+(z===0?0:z<0?-1:1)|(63&K)<<2,K>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const ee=B.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ee),B.primitiveLength++),D?this.e2=ee:this.e1=ee}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(l,h){this.distance+=l.dist(h),this.updateScaledDistance()}}gn("LineBucket",_w,{omit:["layers","patternFeatures"]});const _H=new zi({"line-cap":new xn(ze.layout_line["line-cap"]),"line-join":new Rn(ze.layout_line["line-join"]),"line-miter-limit":new xn(ze.layout_line["line-miter-limit"]),"line-round-limit":new xn(ze.layout_line["line-round-limit"]),"line-sort-key":new Rn(ze.layout_line["line-sort-key"])});var Fk={paint:new zi({"line-opacity":new Rn(ze.paint_line["line-opacity"]),"line-color":new Rn(ze.paint_line["line-color"]),"line-translate":new xn(ze.paint_line["line-translate"]),"line-translate-anchor":new xn(ze.paint_line["line-translate-anchor"]),"line-width":new Rn(ze.paint_line["line-width"]),"line-gap-width":new Rn(ze.paint_line["line-gap-width"]),"line-offset":new Rn(ze.paint_line["line-offset"]),"line-blur":new Rn(ze.paint_line["line-blur"]),"line-dasharray":new Ep(ze.paint_line["line-dasharray"]),"line-pattern":new fu(ze.paint_line["line-pattern"]),"line-gradient":new zs(ze.paint_line["line-gradient"])}),layout:_H};const zk=new class extends Rn{possiblyEvaluate(d,l){return l=new Br(Math.floor(l.zoom),{now:l.now,fadeDuration:l.fadeDuration,zoomHistory:l.zoomHistory,transition:l.transition}),super.possiblyEvaluate(d,l)}evaluate(d,l,h,y){return l=_({},l,{zoom:Math.floor(l.zoom)}),super.evaluate(d,l,h,y)}}(Fk.paint.properties["line-width"].specification);function $k(d,l){return l>0?l+2*d:d}zk.useIntegerZoom=!0;const wH=hi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),CH=hi([{name:"a_projected_pos",components:3,type:"Float32"}],4);hi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const SH=hi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);hi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Bk=hi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),EH=hi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function PH(d,l,h){return d.sections.forEach(y=>{y.text=function(C,k,D){const z=k.layout.get("text-transform").evaluate(D,{});return z==="uppercase"?C=C.toLocaleUpperCase():z==="lowercase"&&(C=C.toLocaleLowerCase()),Ko.applyArabicShaping&&(C=Ko.applyArabicShaping(C)),C}(y.text,l,h)}),d}hi([{name:"triangle",components:3,type:"Uint16"}]),hi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),hi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),hi([{type:"Float32",name:"offsetX"}]),hi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const $p={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var $i=24,ww=Sr,Vk=function(d,l,h,y,C){var k,D,z=8*C-y-1,B=(1<>1,ee=-7,ie=h?C-1:0,de=h?-1:1,ge=d[l+ie];for(ie+=de,k=ge&(1<<-ee)-1,ge>>=-ee,ee+=z;ee>0;k=256*k+d[l+ie],ie+=de,ee-=8);for(D=k&(1<<-ee)-1,k>>=-ee,ee+=y;ee>0;D=256*D+d[l+ie],ie+=de,ee-=8);if(k===0)k=1-K;else{if(k===B)return D?NaN:1/0*(ge?-1:1);D+=Math.pow(2,y),k-=K}return(ge?-1:1)*D*Math.pow(2,k-y)},Uk=function(d,l,h,y,C,k){var D,z,B,K=8*k-C-1,ee=(1<>1,de=C===23?Math.pow(2,-24)-Math.pow(2,-77):0,ge=y?0:k-1,ve=y?1:-1,Ne=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(z=isNaN(l)?1:0,D=ee):(D=Math.floor(Math.log(l)/Math.LN2),l*(B=Math.pow(2,-D))<1&&(D--,B*=2),(l+=D+ie>=1?de/B:de*Math.pow(2,1-ie))*B>=2&&(D++,B/=2),D+ie>=ee?(z=0,D=ee):D+ie>=1?(z=(l*B-1)*Math.pow(2,C),D+=ie):(z=l*Math.pow(2,ie-1)*Math.pow(2,C),D=0));C>=8;d[h+ge]=255&z,ge+=ve,z/=256,C-=8);for(D=D<0;d[h+ge]=255&D,ge+=ve,D/=256,K-=8);d[h+ge-ve]|=128*Ne};function Sr(d){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(d)?d:new Uint8Array(d||0),this.pos=0,this.type=0,this.length=this.buf.length}Sr.Varint=0,Sr.Fixed64=1,Sr.Bytes=2,Sr.Fixed32=5;var gu,Cw=4294967296,jk=1/Cw,Hk=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function bl(d){return d.type===Sr.Bytes?d.readVarint()+d.pos:d.pos+1}function gf(d,l,h){return h?4294967296*l+(d>>>0):4294967296*(l>>>0)+(d>>>0)}function Kk(d,l,h){var y=l<=16383?1:l<=2097151?2:l<=268435455?3:Math.floor(Math.log(l)/(7*Math.LN2));h.realloc(y);for(var C=h.pos-1;C>=d;C--)h.buf[C+y]=h.buf[C]}function TH(d,l){for(var h=0;h>>8,d[h+2]=l>>>16,d[h+3]=l>>>24}function Wk(d,l){return(d[l]|d[l+1]<<8|d[l+2]<<16)+(d[l+3]<<24)}function LH(d,l,h){d===1&&h.readMessage(FH,l)}function FH(d,l,h){if(d===3){const{id:y,bitmap:C,width:k,height:D,left:z,top:B,advance:K}=h.readMessage(zH,{});l.push({id:y,bitmap:new Dp({width:k+6,height:D+6},C),metrics:{width:k,height:D,left:z,top:B,advance:K}})}}function zH(d,l,h){d===1?l.id=h.readVarint():d===2?l.bitmap=h.readBytes():d===3?l.width=h.readVarint():d===4?l.height=h.readVarint():d===5?l.left=h.readSVarint():d===6?l.top=h.readSVarint():d===7&&(l.advance=h.readVarint())}function Gk(d){let l=0,h=0;for(const D of d)l+=D.w*D.h,h=Math.max(h,D.w);d.sort((D,z)=>z.h-D.h);const y=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(l/.95)),h),h:1/0}];let C=0,k=0;for(const D of d)for(let z=y.length-1;z>=0;z--){const B=y[z];if(!(D.w>B.w||D.h>B.h)){if(D.x=B.x,D.y=B.y,k=Math.max(k,D.y+D.h),C=Math.max(C,D.x+D.w),D.w===B.w&&D.h===B.h){const K=y.pop();z>3,k=this.pos;this.type=7&y,d(C,l,this),this.pos===k&&this.skip(y)}return l},readMessage:function(d,l){return this.readFields(d,l,this.readVarint()+this.pos)},readFixed32:function(){var d=Sy(this.buf,this.pos);return this.pos+=4,d},readSFixed32:function(){var d=Wk(this.buf,this.pos);return this.pos+=4,d},readFixed64:function(){var d=Sy(this.buf,this.pos)+Sy(this.buf,this.pos+4)*Cw;return this.pos+=8,d},readSFixed64:function(){var d=Sy(this.buf,this.pos)+Wk(this.buf,this.pos+4)*Cw;return this.pos+=8,d},readFloat:function(){var d=Vk(this.buf,this.pos,!0,23,4);return this.pos+=4,d},readDouble:function(){var d=Vk(this.buf,this.pos,!0,52,8);return this.pos+=8,d},readVarint:function(d){var l,h,y=this.buf;return l=127&(h=y[this.pos++]),h<128?l:(l|=(127&(h=y[this.pos++]))<<7,h<128?l:(l|=(127&(h=y[this.pos++]))<<14,h<128?l:(l|=(127&(h=y[this.pos++]))<<21,h<128?l:function(C,k,D){var z,B,K=D.buf;if(z=(112&(B=K[D.pos++]))>>4,B<128||(z|=(127&(B=K[D.pos++]))<<3,B<128)||(z|=(127&(B=K[D.pos++]))<<10,B<128)||(z|=(127&(B=K[D.pos++]))<<17,B<128)||(z|=(127&(B=K[D.pos++]))<<24,B<128)||(z|=(1&(B=K[D.pos++]))<<31,B<128))return gf(C,z,k);throw new Error("Expected varint not more than 10 bytes")}(l|=(15&(h=y[this.pos]))<<28,d,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var d=this.readVarint();return d%2==1?(d+1)/-2:d/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var d=this.readVarint()+this.pos,l=this.pos;return this.pos=d,d-l>=12&&Hk?function(h,y,C){return Hk.decode(h.subarray(y,C))}(this.buf,l,d):function(h,y,C){for(var k="",D=y;D239?4:ee>223?3:ee>191?2:1;if(D+de>C)break;de===1?ee<128&&(ie=ee):de===2?(192&(z=h[D+1]))==128&&(ie=(31&ee)<<6|63&z)<=127&&(ie=null):de===3?(B=h[D+2],(192&(z=h[D+1]))==128&&(192&B)==128&&((ie=(15&ee)<<12|(63&z)<<6|63&B)<=2047||ie>=55296&&ie<=57343)&&(ie=null)):de===4&&(B=h[D+2],K=h[D+3],(192&(z=h[D+1]))==128&&(192&B)==128&&(192&K)==128&&((ie=(15&ee)<<18|(63&z)<<12|(63&B)<<6|63&K)<=65535||ie>=1114112)&&(ie=null)),ie===null?(ie=65533,de=1):ie>65535&&(ie-=65536,k+=String.fromCharCode(ie>>>10&1023|55296),ie=56320|1023&ie),k+=String.fromCharCode(ie),D+=de}return k}(this.buf,l,d)},readBytes:function(){var d=this.readVarint()+this.pos,l=this.buf.subarray(this.pos,d);return this.pos=d,l},readPackedVarint:function(d,l){if(this.type!==Sr.Bytes)return d.push(this.readVarint(l));var h=bl(this);for(d=d||[];this.pos127;);else if(l===Sr.Bytes)this.pos=this.readVarint()+this.pos;else if(l===Sr.Fixed32)this.pos+=4;else{if(l!==Sr.Fixed64)throw new Error("Unimplemented type: "+l);this.pos+=8}},writeTag:function(d,l){this.writeVarint(d<<3|l)},realloc:function(d){for(var l=this.length||16;l268435455||d<0?function(l,h){var y,C;if(l>=0?(y=l%4294967296|0,C=l/4294967296|0):(C=~(-l/4294967296),4294967295^(y=~(-l%4294967296))?y=y+1|0:(y=0,C=C+1|0)),l>=18446744073709552e3||l<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(k,D,z){z.buf[z.pos++]=127&k|128,k>>>=7,z.buf[z.pos++]=127&k|128,k>>>=7,z.buf[z.pos++]=127&k|128,k>>>=7,z.buf[z.pos++]=127&k|128,z.buf[z.pos]=127&(k>>>=7)}(y,0,h),function(k,D){var z=(7&k)<<4;D.buf[D.pos++]|=z|((k>>>=3)?128:0),k&&(D.buf[D.pos++]=127&k|((k>>>=7)?128:0),k&&(D.buf[D.pos++]=127&k|((k>>>=7)?128:0),k&&(D.buf[D.pos++]=127&k|((k>>>=7)?128:0),k&&(D.buf[D.pos++]=127&k|((k>>>=7)?128:0),k&&(D.buf[D.pos++]=127&k)))))}(C,h)}(d,this):(this.realloc(4),this.buf[this.pos++]=127&d|(d>127?128:0),d<=127||(this.buf[this.pos++]=127&(d>>>=7)|(d>127?128:0),d<=127||(this.buf[this.pos++]=127&(d>>>=7)|(d>127?128:0),d<=127||(this.buf[this.pos++]=d>>>7&127))))},writeSVarint:function(d){this.writeVarint(d<0?2*-d-1:2*d)},writeBoolean:function(d){this.writeVarint(Boolean(d))},writeString:function(d){d=String(d),this.realloc(4*d.length),this.pos++;var l=this.pos;this.pos=function(y,C,k){for(var D,z,B=0;B55295&&D<57344){if(!z){D>56319||B+1===C.length?(y[k++]=239,y[k++]=191,y[k++]=189):z=D;continue}if(D<56320){y[k++]=239,y[k++]=191,y[k++]=189,z=D;continue}D=z-55296<<10|D-56320|65536,z=null}else z&&(y[k++]=239,y[k++]=191,y[k++]=189,z=null);D<128?y[k++]=D:(D<2048?y[k++]=D>>6|192:(D<65536?y[k++]=D>>12|224:(y[k++]=D>>18|240,y[k++]=D>>12&63|128),y[k++]=D>>6&63|128),y[k++]=63&D|128)}return k}(this.buf,d,this.pos);var h=this.pos-l;h>=128&&Kk(l,h,this),this.pos=l-1,this.writeVarint(h),this.pos+=h},writeFloat:function(d){this.realloc(4),Uk(this.buf,d,this.pos,!0,23,4),this.pos+=4},writeDouble:function(d){this.realloc(8),Uk(this.buf,d,this.pos,!0,52,8),this.pos+=8},writeBytes:function(d){var l=d.length;this.writeVarint(l),this.realloc(l);for(var h=0;h=128&&Kk(h,y,this),this.pos=h-1,this.writeVarint(y),this.pos+=y},writeMessage:function(d,l,h){this.writeTag(d,Sr.Bytes),this.writeRawMessage(l,h)},writePackedVarint:function(d,l){l.length&&this.writeMessage(d,TH,l)},writePackedSVarint:function(d,l){l.length&&this.writeMessage(d,IH,l)},writePackedBoolean:function(d,l){l.length&&this.writeMessage(d,RH,l)},writePackedFloat:function(d,l){l.length&&this.writeMessage(d,kH,l)},writePackedDouble:function(d,l){l.length&&this.writeMessage(d,MH,l)},writePackedFixed32:function(d,l){l.length&&this.writeMessage(d,DH,l)},writePackedSFixed32:function(d,l){l.length&&this.writeMessage(d,OH,l)},writePackedFixed64:function(d,l){l.length&&this.writeMessage(d,AH,l)},writePackedSFixed64:function(d,l){l.length&&this.writeMessage(d,NH,l)},writeBytesField:function(d,l){this.writeTag(d,Sr.Bytes),this.writeBytes(l)},writeFixed32Field:function(d,l){this.writeTag(d,Sr.Fixed32),this.writeFixed32(l)},writeSFixed32Field:function(d,l){this.writeTag(d,Sr.Fixed32),this.writeSFixed32(l)},writeFixed64Field:function(d,l){this.writeTag(d,Sr.Fixed64),this.writeFixed64(l)},writeSFixed64Field:function(d,l){this.writeTag(d,Sr.Fixed64),this.writeSFixed64(l)},writeVarintField:function(d,l){this.writeTag(d,Sr.Varint),this.writeVarint(l)},writeSVarintField:function(d,l){this.writeTag(d,Sr.Varint),this.writeSVarint(l)},writeStringField:function(d,l){this.writeTag(d,Sr.Bytes),this.writeString(l)},writeFloatField:function(d,l){this.writeTag(d,Sr.Fixed32),this.writeFloat(l)},writeDoubleField:function(d,l){this.writeTag(d,Sr.Fixed64),this.writeDouble(l)},writeBooleanField:function(d,l){this.writeVarintField(d,Boolean(l))}};class Sw{constructor(l,{pixelRatio:h,version:y,stretchX:C,stretchY:k,content:D}){this.paddedRect=l,this.pixelRatio=h,this.stretchX=C,this.stretchY=k,this.content=D,this.version=y}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class qk{constructor(l,h){const y={},C={};this.haveRenderCallbacks=[];const k=[];this.addImages(l,y,k),this.addImages(h,C,k);const{w:D,h:z}=Gk(k),B=new ua({width:D||1,height:z||1});for(const K in l){const ee=l[K],ie=y[K].paddedRect;ua.copy(ee.data,B,{x:0,y:0},{x:ie.x+1,y:ie.y+1},ee.data)}for(const K in h){const ee=h[K],ie=C[K].paddedRect,de=ie.x+1,ge=ie.y+1,ve=ee.data.width,Ne=ee.data.height;ua.copy(ee.data,B,{x:0,y:0},{x:de,y:ge},ee.data),ua.copy(ee.data,B,{x:0,y:Ne-1},{x:de,y:ge-1},{width:ve,height:1}),ua.copy(ee.data,B,{x:0,y:0},{x:de,y:ge+Ne},{width:ve,height:1}),ua.copy(ee.data,B,{x:ve-1,y:0},{x:de-1,y:ge},{width:1,height:Ne}),ua.copy(ee.data,B,{x:0,y:0},{x:de+ve,y:ge},{width:1,height:Ne})}this.image=B,this.iconPositions=y,this.patternPositions=C}addImages(l,h,y){for(const C in l){const k=l[C],D={x:0,y:0,w:k.data.width+2,h:k.data.height+2};y.push(D),h[C]=new Sw(D,k),k.hasRenderCallback&&this.haveRenderCallbacks.push(C)}}patchUpdatedImages(l,h){l.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const y in l.updatedImages)this.patchUpdatedImage(this.iconPositions[y],l.getImage(y),h),this.patchUpdatedImage(this.patternPositions[y],l.getImage(y),h)}patchUpdatedImage(l,h,y){if(!l||!h||l.version===h.version)return;l.version=h.version;const[C,k]=l.tl;y.update(h.data,void 0,{x:C,y:k})}}gn("ImagePosition",Sw),gn("ImageAtlas",qk),a.WritingMode=void 0,(gu=a.WritingMode||(a.WritingMode={}))[gu.none=0]="none",gu[gu.horizontal=1]="horizontal",gu[gu.vertical=2]="vertical",gu[gu.horizontalOnly=3]="horizontalOnly";const Ey=-17;class Bp{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(l,h){const y=new Bp;return y.scale=l||1,y.fontStack=h,y}static forImage(l){const h=new Bp;return h.imageName=l,h}}class yf{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(l,h){const y=new yf;for(let C=0;C=0&&y>=l&&Ty[this.text.charCodeAt(y)];y--)h--;this.text=this.text.substring(l,h),this.sectionIndex=this.sectionIndex.slice(l,h)}substring(l,h){const y=new yf;return y.text=this.text.substring(l,h),y.sectionIndex=this.sectionIndex.slice(l,h),y.sections=this.sections,y}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((l,h)=>Math.max(l,this.sections[h].scale),0)}addTextSection(l,h){this.text+=l.text,this.sections.push(Bp.forText(l.scale,l.fontStack||h));const y=this.sections.length-1;for(let C=0;C=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Py(d,l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve,Ne){const Oe=yf.fromFeature(d,C);let Qe;ie===a.WritingMode.vertical&&Oe.verticalizePunctuation();const{processBidirectionalText:ht,processStyledBidirectionalText:Ge}=Ko;if(ht&&Oe.sections.length===1){Qe=[];const kt=ht(Oe.toString(),Ew(Oe,K,k,l,y,ge,ve));for(const hn of kt){const vn=new yf;vn.text=hn,vn.sections=Oe.sections;for(let ln=0;ln0&&Cl>No&&(No=Cl)}else{const fa=vn[Xn.fontStack],Lo=fa&&fa[Qi];if(Lo&&Lo.rect)ms=Lo.rect,$a=Lo.metrics;else{const Cl=hn[Xn.fontStack],jp=Cl&&Cl[Qi];if(!jp)continue;$a=jp.metrics}lo=(Yi-Xn.scale)*$i}Ba?(kt.verticalizable=!0,Ao.push({glyph:Qi,imageName:gs,x:Ar,y:Ur+lo,vertical:Ba,scale:Xn.scale,fontStack:Xn.fontStack,sectionIndex:qo,metrics:$a,rect:ms}),Ar+=wl*Xn.scale+In):(Ao.push({glyph:Qi,imageName:gs,x:Ar,y:Ur+lo,vertical:Ba,scale:Xn.scale,fontStack:Xn.fontStack,sectionIndex:qo,metrics:$a,rect:ms}),Ar+=$a.advance*Xn.scale+In)}Ao.length!==0&&(bi=Math.max(Ar-In,bi),VH(Ao,0,Ao.length-1,Zi,No)),Ar=0;const qr=Qt*Yi+No;bo.lineOffset=Math.max(No,so),Ur+=qr,da=Math.max(qr,da),++pi}var Mi;const Xi=Ur-Ey,{horizontalAlign:ao,verticalAlign:Oo}=Pw(un);(function(mi,Yi,so,bo,Ao,No,qr,Ri,Xn){const qo=(Yi-so)*Ao;let Qi=0;Qi=No!==qr?-Ri*bo-Ey:(-bo*Xn+.5)*qr;for(const lo of mi)for(const $a of lo.positionedGlyphs)$a.x+=qo,$a.y+=Qi})(kt.positionedLines,Zi,ao,Oo,bi,da,Qt,Xi,en.length),kt.top+=-Oo*Xi,kt.bottom=kt.top+Xi,kt.left+=-ao*bi,kt.right=kt.left+bi}(Rt,l,h,y,Qe,D,z,B,ie,K,de,Ne),!function(kt){for(const hn of kt)if(hn.positionedGlyphs.length!==0)return!1;return!0}(lt)&&Rt}const Ty={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},$H={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Zk(d,l,h,y,C,k){if(l.imageName){const D=y[l.imageName];return D?D.displaySize[0]*l.scale*$i/k+C:0}{const D=h[l.fontStack],z=D&&D[d];return z?z.metrics.advance*l.scale+C:0}}function Xk(d,l,h,y){const C=Math.pow(d-l,2);return y?d=0;let ee=0;for(let de=0;de-h/2;){if(D--,D<0)return!1;z-=d[D].dist(k),k=d[D]}z+=d[D].dist(d[D+1]),D++;const B=[];let K=0;for(;zy;)K-=B.shift().angleDelta;if(K>C)return!1;D++,z+=ee.dist(ie)}return!0}function n3(d){let l=0;for(let h=0;hK){const ve=(K-B)/ge,Ne=Cr(ie.x,de.x,ve),Oe=Cr(ie.y,de.y,ve),Qe=new vu(Ne,Oe,de.angleTo(ie),ee);return Qe._round(),!D||t3(d,Qe,z,D,l)?Qe:void 0}B+=ge}}function HH(d,l,h,y,C,k,D,z,B){const K=r3(y,k,D),ee=i3(y,C),ie=ee*D,de=d[0].x===0||d[0].x===B||d[0].y===0||d[0].y===B;return l-ie=0&<=0&&Rt=0&&de+K<=ee){const kt=new vu(lt,Rt,ht,ve);kt._round(),y&&!t3(d,kt,k,y,C)||ge.push(kt)}}ie+=Qe}return z||ge.length||D||(ge=o3(d,ie/2,h,y,C,k,D,!0,B)),ge}function a3(d,l,h,y,C){const k=[];for(let D=0;D=y&&ie.x>=y||(ee.x>=y?ee=new re(y,ee.y+(y-ee.x)/(ie.x-ee.x)*(ie.y-ee.y))._round():ie.x>=y&&(ie=new re(y,ee.y+(y-ee.x)/(ie.x-ee.x)*(ie.y-ee.y))._round()),ee.y>=C&&ie.y>=C||(ee.y>=C?ee=new re(ee.x+(C-ee.y)/(ie.y-ee.y)*(ie.x-ee.x),C)._round():ie.y>=C&&(ie=new re(ee.x+(C-ee.y)/(ie.y-ee.y)*(ie.x-ee.x),C)._round()),B&&ee.equals(B[B.length-1])||(B=[ee],k.push(B)),B.push(ie)))))}}return k}function s3(d,l,h,y){const C=[],k=d.image,D=k.pixelRatio,z=k.paddedRect.w-2,B=k.paddedRect.h-2,K=d.right-d.left,ee=d.bottom-d.top,ie=k.stretchX||[[0,z]],de=k.stretchY||[[0,B]],ge=(Qt,un)=>Qt+un[1]-un[0],ve=ie.reduce(ge,0),Ne=de.reduce(ge,0),Oe=z-ve,Qe=B-Ne;let ht=0,Ge=ve,lt=0,Rt=Ne,kt=0,hn=Oe,vn=0,ln=Qe;if(k.content&&y){const Qt=k.content;ht=Iy(ie,0,Qt[0]),lt=Iy(de,0,Qt[1]),Ge=Iy(ie,Qt[0],Qt[2]),Rt=Iy(de,Qt[1],Qt[3]),kt=Qt[0]-ht,vn=Qt[1]-lt,hn=Qt[2]-Qt[0]-Ge,ln=Qt[3]-Qt[1]-Rt}const en=(Qt,un,nn,jt)=>{const In=ky(Qt.stretch-ht,Ge,K,d.left),bn=My(Qt.fixed-kt,hn,Qt.stretch,ve),Kn=ky(un.stretch-lt,Rt,ee,d.top),Ar=My(un.fixed-vn,ln,un.stretch,Ne),Ur=ky(nn.stretch-ht,Ge,K,d.left),bi=My(nn.fixed-kt,hn,nn.stretch,ve),da=ky(jt.stretch-lt,Rt,ee,d.top),Zi=My(jt.fixed-vn,ln,jt.stretch,Ne),pi=new re(In,Kn),Mi=new re(Ur,Kn),Xi=new re(Ur,da),ao=new re(In,da),Oo=new re(bn/D,Ar/D),mi=new re(bi/D,Zi/D),Yi=l*Math.PI/180;if(Yi){const Ao=Math.sin(Yi),No=Math.cos(Yi),qr=[No,-Ao,Ao,No];pi._matMult(qr),Mi._matMult(qr),ao._matMult(qr),Xi._matMult(qr)}const so=Qt.stretch+Qt.fixed,bo=un.stretch+un.fixed;return{tl:pi,tr:Mi,bl:ao,br:Xi,tex:{x:k.paddedRect.x+1+so,y:k.paddedRect.y+1+bo,w:nn.stretch+nn.fixed-so,h:jt.stretch+jt.fixed-bo},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Oo,pixelOffsetBR:mi,minFontScaleX:hn/D/K,minFontScaleY:ln/D/ee,isSDF:h}};if(y&&(k.stretchX||k.stretchY)){const Qt=l3(ie,Oe,ve),un=l3(de,Qe,Ne);for(let nn=0;nn0&&(ve=Math.max(10,ve),this.circleDiameter=ve)}else{let ie=D.top*z-B[0],de=D.bottom*z+B[2],ge=D.left*z-B[3],ve=D.right*z+B[1];const Ne=D.collisionPadding;if(Ne&&(ge-=Ne[0]*z,ie-=Ne[1]*z,ve+=Ne[2]*z,de+=Ne[3]*z),ee){const Oe=new re(ge,ie),Qe=new re(ve,ie),ht=new re(ge,de),Ge=new re(ve,de),lt=ee*Math.PI/180;Oe._rotate(lt),Qe._rotate(lt),ht._rotate(lt),Ge._rotate(lt),ge=Math.min(Oe.x,Qe.x,ht.x,Ge.x),ve=Math.max(Oe.x,Qe.x,ht.x,Ge.x),ie=Math.min(Oe.y,Qe.y,ht.y,Ge.y),de=Math.max(Oe.y,Qe.y,ht.y,Ge.y)}l.emplaceBack(h.x,h.y,ge,ie,ve,de,y,C,k)}this.boxEndIndex=l.length}}class KH{constructor(l=[],h=WH){if(this.data=l,this.length=this.data.length,this.compare=h,this.length>0)for(let y=(this.length>>1)-1;y>=0;y--)this._down(y)}push(l){this.data.push(l),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const l=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),l}peek(){return this.data[0]}_up(l){const{data:h,compare:y}=this,C=h[l];for(;l>0;){const k=l-1>>1,D=h[k];if(y(C,D)>=0)break;h[l]=D,l=k}h[l]=C}_down(l){const{data:h,compare:y}=this,C=this.length>>1,k=h[l];for(;l=0)break;h[l]=z,l=D}h[l]=k}}function WH(d,l){return dl?1:0}function GH(d,l=1,h=!1){let y=1/0,C=1/0,k=-1/0,D=-1/0;const z=d[0];for(let ge=0;gek)&&(k=ve.x),(!ge||ve.y>D)&&(D=ve.y)}const B=Math.min(k-y,D-C);let K=B/2;const ee=new KH([],qH);if(B===0)return new re(y,C);for(let ge=y;geie.d||!ie.d)&&(ie=ge,h&&console.log("found best %d after %d probes",Math.round(1e4*ge.d)/1e4,de)),ge.max-ie.d<=l||(K=ge.h/2,ee.push(new xf(ge.p.x-K,ge.p.y-K,K,d)),ee.push(new xf(ge.p.x+K,ge.p.y-K,K,d)),ee.push(new xf(ge.p.x-K,ge.p.y+K,K,d)),ee.push(new xf(ge.p.x+K,ge.p.y+K,K,d)),de+=4)}return h&&(console.log(`num probes: ${de}`),console.log(`best distance: ${ie.d}`)),ie.p}function qH(d,l){return l.max-d.max}function xf(d,l,h,y){this.p=new re(d,l),this.h=h,this.d=function(C,k){let D=!1,z=1/0;for(let B=0;BC.y!=ve.y>C.y&&C.x<(ve.x-ge.x)*(C.y-ge.y)/(ve.y-ge.y)+ge.x&&(D=!D),z=Math.min(z,gk(C,ge,ve))}}return(D?1:-1)*Math.sqrt(z)}(this.p,y),this.max=this.d+this.h*Math.SQRT2}const Tw=Number.POSITIVE_INFINITY;function u3(d,l){return l[1]!==Tw?function(h,y,C){let k=0,D=0;switch(y=Math.abs(y),C=Math.abs(C),h){case"top-right":case"top-left":case"top":D=C-7;break;case"bottom-right":case"bottom-left":case"bottom":D=7-C}switch(h){case"top-right":case"bottom-right":case"right":k=-y;break;case"top-left":case"bottom-left":case"left":k=y}return[k,D]}(d,l[0],l[1]):function(h,y){let C=0,k=0;y<0&&(y=0);const D=y/Math.sqrt(2);switch(h){case"top-right":case"top-left":k=D-7;break;case"bottom-right":case"bottom-left":k=7-D;break;case"bottom":k=7-y;break;case"top":k=y-7}switch(h){case"top-right":case"bottom-right":C=-D;break;case"top-left":case"bottom-left":C=D;break;case"left":C=y;break;case"right":C=-y}return[C,k]}(d,l[0])}function Iw(d){switch(d){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ZH(d,l,h,y,C,k,D,z,B,K,ee){let ie=k.textMaxSize.evaluate(l,{});ie===void 0&&(ie=D);const de=d.layers[0].layout,ge=de.get("icon-offset").evaluate(l,{},ee),ve=d3(h.horizontal),Ne=D/24,Oe=d.tilePixelRatio*Ne,Qe=d.tilePixelRatio*ie/24,ht=d.tilePixelRatio*z,Ge=d.tilePixelRatio*de.get("symbol-spacing"),lt=de.get("text-padding")*d.tilePixelRatio,Rt=function(jt,In,bn,Kn=1){const Ar=jt.get("icon-padding").evaluate(In,{},bn),Ur=Ar&&Ar.values;return[Ur[0]*Kn,Ur[1]*Kn,Ur[2]*Kn,Ur[3]*Kn]}(de,l,ee,d.tilePixelRatio),kt=de.get("text-max-angle")/180*Math.PI,hn=de.get("text-rotation-alignment")!=="viewport"&&de.get("symbol-placement")!=="point",vn=de.get("icon-rotation-alignment")==="map"&&de.get("symbol-placement")!=="point",ln=de.get("symbol-placement"),en=Ge/2,Qt=de.get("icon-text-fit");let un;y&&Qt!=="none"&&(d.allowVerticalPlacement&&h.vertical&&(un=Jk(y,h.vertical,Qt,de.get("icon-text-fit-padding"),ge,Ne)),ve&&(y=Jk(y,ve,Qt,de.get("icon-text-fit-padding"),ge,Ne)));const nn=(jt,In)=>{In.x<0||In.x>=xi||In.y<0||In.y>=xi||function(bn,Kn,Ar,Ur,bi,da,Zi,pi,Mi,Xi,ao,Oo,mi,Yi,so,bo,Ao,No,qr,Ri,Xn,qo,Qi,lo,$a){const ms=bn.addToLineVertexArray(Kn,Ar);let gs,wl,Ba,fa,Lo=0,Cl=0,jp=0,T3=0,zw=-1,$w=-1;const Sl={};let I3=ki.exports(""),Bw=0,Vw=0;if(pi._unevaluatedLayout.getValue("text-radial-offset")===void 0?[Bw,Vw]=pi.layout.get("text-offset").evaluate(Xn,{},lo).map(Fo=>Fo*$i):(Bw=pi.layout.get("text-radial-offset").evaluate(Xn,{},lo)*$i,Vw=Tw),bn.allowVerticalPlacement&&Ur.vertical){const Fo=pi.layout.get("text-rotate").evaluate(Xn,{},lo)+90;Ba=new Ry(Mi,Kn,Xi,ao,Oo,Ur.vertical,mi,Yi,so,Fo),Zi&&(fa=new Ry(Mi,Kn,Xi,ao,Oo,Zi,Ao,No,so,Fo))}if(bi){const Fo=pi.layout.get("icon-rotate").evaluate(Xn,{}),js=pi.layout.get("icon-text-fit")!=="none",Hp=s3(bi,Fo,Qi,js),Kp=Zi?s3(Zi,Fo,Qi,js):void 0;wl=new Ry(Mi,Kn,Xi,ao,Oo,bi,Ao,No,!1,Fo),Lo=4*Hp.length;const R3=bn.iconSizeData;let Vc=null;R3.kind==="source"?(Vc=[_l*pi.layout.get("icon-size").evaluate(Xn,{})],Vc[0]>yu&&F(`${bn.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):R3.kind==="composite"&&(Vc=[_l*qo.compositeIconSizes[0].evaluate(Xn,{},lo),_l*qo.compositeIconSizes[1].evaluate(Xn,{},lo)],(Vc[0]>yu||Vc[1]>yu)&&F(`${bn.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),bn.addSymbols(bn.icon,Hp,Vc,Ri,qr,Xn,a.WritingMode.none,Kn,ms.lineStartIndex,ms.lineLength,-1,lo),zw=bn.icon.placedSymbolArray.length-1,Kp&&(Cl=4*Kp.length,bn.addSymbols(bn.icon,Kp,Vc,Ri,qr,Xn,a.WritingMode.vertical,Kn,ms.lineStartIndex,ms.lineLength,-1,lo),$w=bn.icon.placedSymbolArray.length-1)}const k3=Object.keys(Ur.horizontal);for(const Fo of k3){const js=Ur.horizontal[Fo];if(!gs){I3=ki.exports(js.text);const Kp=pi.layout.get("text-rotate").evaluate(Xn,{},lo);gs=new Ry(Mi,Kn,Xi,ao,Oo,js,mi,Yi,so,Kp)}const Hp=js.positionedLines.length===1;if(jp+=c3(bn,Kn,js,da,pi,so,Xn,bo,ms,Ur.vertical?a.WritingMode.horizontal:a.WritingMode.horizontalOnly,Hp?k3:[Fo],Sl,zw,qo,lo),Hp)break}Ur.vertical&&(T3+=c3(bn,Kn,Ur.vertical,da,pi,so,Xn,bo,ms,a.WritingMode.vertical,["vertical"],Sl,$w,qo,lo));const lK=gs?gs.boxStartIndex:bn.collisionBoxArray.length,uK=gs?gs.boxEndIndex:bn.collisionBoxArray.length,cK=Ba?Ba.boxStartIndex:bn.collisionBoxArray.length,dK=Ba?Ba.boxEndIndex:bn.collisionBoxArray.length,fK=wl?wl.boxStartIndex:bn.collisionBoxArray.length,hK=wl?wl.boxEndIndex:bn.collisionBoxArray.length,pK=fa?fa.boxStartIndex:bn.collisionBoxArray.length,mK=fa?fa.boxEndIndex:bn.collisionBoxArray.length;let vs=-1;const Ly=(Fo,js)=>Fo&&Fo.circleDiameter?Math.max(Fo.circleDiameter,js):js;vs=Ly(gs,vs),vs=Ly(Ba,vs),vs=Ly(wl,vs),vs=Ly(fa,vs);const M3=vs>-1?1:0;M3&&(vs*=$a/$i),bn.glyphOffsetArray.length>=bf.MAX_GLYPHS&&F("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Xn.sortKey!==void 0&&bn.addToSortKeyRanges(bn.symbolInstances.length,Xn.sortKey),bn.symbolInstances.emplaceBack(Kn.x,Kn.y,Sl.right>=0?Sl.right:-1,Sl.center>=0?Sl.center:-1,Sl.left>=0?Sl.left:-1,Sl.vertical||-1,zw,$w,I3,lK,uK,cK,dK,fK,hK,pK,mK,Xi,jp,T3,Lo,Cl,M3,0,mi,Bw,Vw,vs)}(d,In,jt,h,y,C,un,d.layers[0],d.collisionBoxArray,l.index,l.sourceLayerIndex,d.index,Oe,[lt,lt,lt,lt],hn,B,ht,Rt,vn,ge,l,k,K,ee,D)};if(ln==="line")for(const jt of a3(l.geometry,0,0,xi,xi)){const In=HH(jt,Ge,kt,h.vertical||ve,y,24,Qe,d.overscaling,xi);for(const bn of In){const Kn=ve;Kn&&XH(d,Kn.text,en,bn)||nn(jt,bn)}}else if(ln==="line-center"){for(const jt of l.geometry)if(jt.length>1){const In=jH(jt,kt,h.vertical||ve,y,24,Qe);In&&nn(jt,In)}}else if(l.type==="Polygon")for(const jt of mw(l.geometry,0)){const In=GH(jt,16);nn(jt[0],new vu(In.x,In.y,0))}else if(l.type==="LineString")for(const jt of l.geometry)nn(jt,new vu(jt[0].x,jt[0].y,0));else if(l.type==="Point")for(const jt of l.geometry)for(const In of jt)nn([In],new vu(In.x,In.y,0))}const yu=32640;function c3(d,l,h,y,C,k,D,z,B,K,ee,ie,de,ge,ve){const Ne=function(ht,Ge,lt,Rt,kt,hn,vn,ln){const en=Rt.layout.get("text-rotate").evaluate(hn,{})*Math.PI/180,Qt=[];for(const un of Ge.positionedLines)for(const nn of un.positionedGlyphs){if(!nn.rect)continue;const jt=nn.rect||{};let In=4,bn=!0,Kn=1,Ar=0;const Ur=(kt||ln)&&nn.vertical,bi=nn.metrics.advance*nn.scale/2;if(ln&&Ge.verticalizable){const qr=(nn.scale-1)*$i,Ri=($i-nn.metrics.width*nn.scale)/2;Ar=un.lineOffset/2-(nn.imageName?-Ri:qr)}if(nn.imageName){const qr=vn[nn.imageName];bn=qr.sdf,Kn=qr.pixelRatio,In=1/Kn}const da=kt?[nn.x+bi,nn.y]:[0,0];let Zi=kt?[0,0]:[nn.x+bi+lt[0],nn.y+lt[1]-Ar],pi=[0,0];Ur&&(pi=Zi,Zi=[0,0]);const Mi=(nn.metrics.left-In)*nn.scale-bi+Zi[0],Xi=(-nn.metrics.top-In)*nn.scale+Zi[1],ao=Mi+jt.w*nn.scale/Kn,Oo=Xi+jt.h*nn.scale/Kn,mi=new re(Mi,Xi),Yi=new re(ao,Xi),so=new re(Mi,Oo),bo=new re(ao,Oo);if(Ur){const qr=new re(-bi,bi-Ey),Ri=-Math.PI/2,Xn=12-bi,qo=new re(22-Xn,-(nn.imageName?Xn:0)),Qi=new re(...pi);mi._rotateAround(Ri,qr)._add(qo)._add(Qi),Yi._rotateAround(Ri,qr)._add(qo)._add(Qi),so._rotateAround(Ri,qr)._add(qo)._add(Qi),bo._rotateAround(Ri,qr)._add(qo)._add(Qi)}if(en){const qr=Math.sin(en),Ri=Math.cos(en),Xn=[Ri,-qr,qr,Ri];mi._matMult(Xn),Yi._matMult(Xn),so._matMult(Xn),bo._matMult(Xn)}const Ao=new re(0,0),No=new re(0,0);Qt.push({tl:mi,tr:Yi,bl:so,br:bo,tex:jt,writingMode:Ge.writingMode,glyphOffset:da,sectionIndex:nn.sectionIndex,isSDF:bn,pixelOffsetTL:Ao,pixelOffsetBR:No,minFontScaleX:0,minFontScaleY:0})}return Qt}(0,h,z,C,k,D,y,d.allowVerticalPlacement),Oe=d.textSizeData;let Qe=null;Oe.kind==="source"?(Qe=[_l*C.layout.get("text-size").evaluate(D,{})],Qe[0]>yu&&F(`${d.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):Oe.kind==="composite"&&(Qe=[_l*ge.compositeTextSizes[0].evaluate(D,{},ve),_l*ge.compositeTextSizes[1].evaluate(D,{},ve)],(Qe[0]>yu||Qe[1]>yu)&&F(`${d.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),d.addSymbols(d.text,Ne,Qe,z,k,D,K,l,B.lineStartIndex,B.lineLength,de,ve);for(const ht of ee)ie[ht]=d.text.placedSymbolArray.length-1;return 4*Ne.length}function d3(d){for(const l in d)return d[l];return null}function XH(d,l,h,y){const C=d.compareText;if(l in C){const k=C[l];for(let D=k.length-1;D>=0;D--)if(y.dist(k[D])D.id),this.index=l.index,this.pixelRatio=l.pixelRatio,this.sourceLayerIndex=l.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=uw([]),this.placementViewportMatrix=uw([]);const h=this.layers[0]._unevaluatedLayout._values;this.textSizeData=e3(this.zoom,h["text-size"]),this.iconSizeData=e3(this.zoom,h["icon-size"]);const y=this.layers[0].layout,C=y.get("symbol-sort-key"),k=y.get("symbol-z-order");this.canOverlap=Ow(y,"text-overlap","text-allow-overlap")!=="never"||Ow(y,"icon-overlap","icon-allow-overlap")!=="never"||y.get("text-ignore-placement")||y.get("icon-ignore-placement"),this.sortFeaturesByKey=k!=="viewport-y"&&!C.isConstant(),this.sortFeaturesByY=(k==="viewport-y"||k==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,y.get("symbol-placement")==="point"&&(this.writingModes=y.get("text-writing-mode").map(D=>a.WritingMode[D])),this.stateDependentLayerIds=this.layers.filter(D=>D.isStateDependent()).map(D=>D.id),this.sourceID=l.sourceID}createArrays(){this.text=new Mw(new Lc(this.layers,this.zoom,l=>/^text/.test(l))),this.icon=new Mw(new Lc(this.layers,this.zoom,l=>/^icon/.test(l))),this.glyphOffsetArray=new Jt,this.lineVertexArray=new fn,this.symbolInstances=new cn}calculateGlyphDependencies(l,h,y,C,k){for(let D=0;D0)&&(D.value.kind!=="constant"||D.value.value.length>0),ee=B.value.kind!=="constant"||!!B.value.value||Object.keys(B.parameters).length>0,ie=k.get("symbol-sort-key");if(this.features=[],!K&&!ee)return;const de=h.iconDependencies,ge=h.glyphDependencies,ve=h.availableImages,Ne=new Br(this.zoom);for(const{feature:Oe,id:Qe,index:ht,sourceLayerIndex:Ge}of l){const lt=C._featureFilter.needGeometry,Rt=zc(Oe,lt);if(!C._featureFilter.filter(Ne,Rt,y))continue;let kt,hn;if(lt||(Rt.geometry=Fc(Oe)),K){const ln=C.getValueAndResolveTokens("text-field",Rt,y,ve),en=we.factory(ln);JH(en)&&(this.hasRTLText=!0),(!this.hasRTLText||Oc()==="unavailable"||this.hasRTLText&&Ko.isParsed())&&(kt=PH(en,C,Rt))}if(ee){const ln=C.getValueAndResolveTokens("icon-image",Rt,y,ve);hn=ln instanceof Le?ln:Le.fromString(ln)}if(!kt&&!hn)continue;const vn=this.sortFeaturesByKey?ie.evaluate(Rt,{},y):void 0;if(this.features.push({id:Qe,text:kt,icon:hn,index:ht,sourceLayerIndex:Ge,geometry:Rt.geometry,properties:Oe.properties,type:YH[Oe.type],sortKey:vn}),hn&&(de[hn.name]=!0),kt){const ln=D.evaluate(Rt,{},y).join(","),en=k.get("text-rotation-alignment")!=="viewport"&&k.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(a.WritingMode.vertical)>=0;for(const Qt of kt.sections)if(Qt.image)de[Qt.image.name]=!0;else{const un=lf(kt.toString()),nn=Qt.fontStack||ln,jt=ge[nn]=ge[nn]||{};this.calculateGlyphDependencies(Qt.text,jt,en,this.allowVerticalPlacement,un)}}}k.get("symbol-placement")==="line"&&(this.features=function(Oe){const Qe={},ht={},Ge=[];let lt=0;function Rt(ln){Ge.push(Oe[ln]),lt++}function kt(ln,en,Qt){const un=ht[ln];return delete ht[ln],ht[en]=un,Ge[un].geometry[0].pop(),Ge[un].geometry[0]=Ge[un].geometry[0].concat(Qt[0]),un}function hn(ln,en,Qt){const un=Qe[en];return delete Qe[en],Qe[ln]=un,Ge[un].geometry[0].shift(),Ge[un].geometry[0]=Qt[0].concat(Ge[un].geometry[0]),un}function vn(ln,en,Qt){const un=Qt?en[0][en[0].length-1]:en[0][0];return`${ln}:${un.x}:${un.y}`}for(let ln=0;lnln.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Oe,Qe)=>Oe.sortKey-Qe.sortKey)}update(l,h,y){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(l,h,this.layers,y),this.icon.programConfigurations.updatePaintArrays(l,h,this.layers,y))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(l){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(l),this.iconCollisionBox.upload(l)),this.text.upload(l,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(l,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(l,h){const y=this.lineVertexArray.length;if(l.segment!==void 0){let C=l.dist(h[l.segment+1]),k=l.dist(h[l.segment]);const D={};for(let z=l.segment+1;z=0;z--)D[z]={x:h[z].x,y:h[z].y,tileUnitDistanceFromAnchor:k},z>0&&(k+=h[z-1].dist(h[z]));for(let z=0;z0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(l,h){const y=l.placedSymbolArray.get(h),C=y.vertexStartIndex+4*y.numGlyphs;for(let k=y.vertexStartIndex;kC[z]-C[B]||k[B]-k[z]),D}addToSortKeyRanges(l,h){const y=this.sortKeyRanges[this.sortKeyRanges.length-1];y&&y.sortKey===h?y.symbolInstanceEnd=l+1:this.sortKeyRanges.push({sortKey:h,symbolInstanceStart:l,symbolInstanceEnd:l+1})}sortFeatures(l){if(this.sortFeaturesByY&&this.sortedAngle!==l&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(l),this.sortedAngle=l,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const h of this.symbolInstanceIndexes){const y=this.symbolInstances.get(h);this.featureSortOrder.push(y.featureIndex),[y.rightJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.leftJustifiedTextSymbolIndex].forEach((C,k,D)=>{C>=0&&D.indexOf(C)===k&&this.addIndicesForPlacedSymbol(this.text,C)}),y.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,y.verticalPlacedTextSymbolIndex),y.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.placedIconSymbolIndex),y.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}gn("SymbolBucket",bf,{omit:["layers","collisionBoxArray","features","compareText"]}),bf.MAX_GLYPHS=65535,bf.addDynamicAttributes=kw;const eK=new zi({"symbol-placement":new xn(ze.layout_symbol["symbol-placement"]),"symbol-spacing":new xn(ze.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new xn(ze.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Rn(ze.layout_symbol["symbol-sort-key"]),"symbol-z-order":new xn(ze.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new xn(ze.layout_symbol["icon-allow-overlap"]),"icon-overlap":new xn(ze.layout_symbol["icon-overlap"]),"icon-ignore-placement":new xn(ze.layout_symbol["icon-ignore-placement"]),"icon-optional":new xn(ze.layout_symbol["icon-optional"]),"icon-rotation-alignment":new xn(ze.layout_symbol["icon-rotation-alignment"]),"icon-size":new Rn(ze.layout_symbol["icon-size"]),"icon-text-fit":new xn(ze.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new xn(ze.layout_symbol["icon-text-fit-padding"]),"icon-image":new Rn(ze.layout_symbol["icon-image"]),"icon-rotate":new Rn(ze.layout_symbol["icon-rotate"]),"icon-padding":new Rn(ze.layout_symbol["icon-padding"]),"icon-keep-upright":new xn(ze.layout_symbol["icon-keep-upright"]),"icon-offset":new Rn(ze.layout_symbol["icon-offset"]),"icon-anchor":new Rn(ze.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new xn(ze.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new xn(ze.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new xn(ze.layout_symbol["text-rotation-alignment"]),"text-field":new Rn(ze.layout_symbol["text-field"]),"text-font":new Rn(ze.layout_symbol["text-font"]),"text-size":new Rn(ze.layout_symbol["text-size"]),"text-max-width":new Rn(ze.layout_symbol["text-max-width"]),"text-line-height":new xn(ze.layout_symbol["text-line-height"]),"text-letter-spacing":new Rn(ze.layout_symbol["text-letter-spacing"]),"text-justify":new Rn(ze.layout_symbol["text-justify"]),"text-radial-offset":new Rn(ze.layout_symbol["text-radial-offset"]),"text-variable-anchor":new xn(ze.layout_symbol["text-variable-anchor"]),"text-anchor":new Rn(ze.layout_symbol["text-anchor"]),"text-max-angle":new xn(ze.layout_symbol["text-max-angle"]),"text-writing-mode":new xn(ze.layout_symbol["text-writing-mode"]),"text-rotate":new Rn(ze.layout_symbol["text-rotate"]),"text-padding":new xn(ze.layout_symbol["text-padding"]),"text-keep-upright":new xn(ze.layout_symbol["text-keep-upright"]),"text-transform":new Rn(ze.layout_symbol["text-transform"]),"text-offset":new Rn(ze.layout_symbol["text-offset"]),"text-allow-overlap":new xn(ze.layout_symbol["text-allow-overlap"]),"text-overlap":new xn(ze.layout_symbol["text-overlap"]),"text-ignore-placement":new xn(ze.layout_symbol["text-ignore-placement"]),"text-optional":new xn(ze.layout_symbol["text-optional"])});var Dw={paint:new zi({"icon-opacity":new Rn(ze.paint_symbol["icon-opacity"]),"icon-color":new Rn(ze.paint_symbol["icon-color"]),"icon-halo-color":new Rn(ze.paint_symbol["icon-halo-color"]),"icon-halo-width":new Rn(ze.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Rn(ze.paint_symbol["icon-halo-blur"]),"icon-translate":new xn(ze.paint_symbol["icon-translate"]),"icon-translate-anchor":new xn(ze.paint_symbol["icon-translate-anchor"]),"text-opacity":new Rn(ze.paint_symbol["text-opacity"]),"text-color":new Rn(ze.paint_symbol["text-color"],{runtimeType:En,getOverride:d=>d.textColor,hasOverride:d=>!!d.textColor}),"text-halo-color":new Rn(ze.paint_symbol["text-halo-color"]),"text-halo-width":new Rn(ze.paint_symbol["text-halo-width"]),"text-halo-blur":new Rn(ze.paint_symbol["text-halo-blur"]),"text-translate":new xn(ze.paint_symbol["text-translate"]),"text-translate-anchor":new xn(ze.paint_symbol["text-translate-anchor"])}),layout:eK};class f3{constructor(l){if(l.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=l.property.overrides?l.property.overrides.runtimeType:pn,this.defaultValue=l}evaluate(l){if(l.formattedSection){const h=this.defaultValue.property.overrides;if(h&&h.hasOverride(l.formattedSection))return h.getOverride(l.formattedSection)}return l.feature&&l.featureState?this.defaultValue.evaluate(l.feature,l.featureState):this.defaultValue.property.specification.default}eachChild(l){this.defaultValue.isConstant()||l(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}gn("FormatSectionOverride",f3,{omit:["defaultValue"]});class Oy extends La{constructor(l){super(l,Dw)}recalculate(l,h){if(super.recalculate(l,h),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const y=this.layout.get("text-writing-mode");if(y){const C=[];for(const k of y)C.indexOf(k)<0&&C.push(k);this.layout._values["text-writing-mode"]=C}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(l,h,y,C){const k=this.layout.get(l).evaluate(h,{},y,C),D=this._unevaluatedLayout._values[l];return D.isDataDriven()||bc(D.value)||!k?k:function(z,B){return B.replace(/{([^{}]+)}/g,(K,ee)=>ee in z?String(z[ee]):"")}(h.properties,k)}createBucket(l){return new bf(l)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const l of Dw.paint.overridableProperties){if(!Oy.hasPaintOverride(this.layout,l))continue;const h=this.paint.get(l),y=new f3(h),C=new tf(y,h.property.specification);let k=null;k=h.value.kind==="constant"||h.value.kind==="source"?new wc("source",C):new hp("composite",C,h.value.zoomStops),this.paint._values[l]=new Na(h.property,k,h.parameters)}}_handleOverridablePaintPropertyUpdate(l,h,y){return!(!this.layout||h.isDataDriven()||y.isDataDriven())&&Oy.hasPaintOverride(this.layout,l)}static hasPaintOverride(l,h){const y=l.get("text-field"),C=Dw.paint.properties[h];let k=!1;const D=z=>{for(const B of z)if(C.overrides&&C.overrides.hasOverride(B))return void(k=!0)};if(y.value.kind==="constant"&&y.value.value instanceof we)D(y.value.value.sections);else if(y.value.kind==="source"){const z=K=>{k||(K instanceof Et&&Ve(K.value)===_n?D(K.value.sections):K instanceof Jd?D(K.sections):K.eachChild(z))},B=y.value;B._styleExpression&&z(B._styleExpression.expression)}return k}}function Ow(d,l,h){let y="never";const C=d.get(l);return C?y=C:d.get(h)&&(y="always"),y}var tK={paint:new zi({"background-color":new xn(ze.paint_background["background-color"]),"background-pattern":new Ep(ze.paint_background["background-pattern"]),"background-opacity":new xn(ze.paint_background["background-opacity"])})},nK={paint:new zi({"raster-opacity":new xn(ze.paint_raster["raster-opacity"]),"raster-hue-rotate":new xn(ze.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new xn(ze.paint_raster["raster-brightness-min"]),"raster-brightness-max":new xn(ze.paint_raster["raster-brightness-max"]),"raster-saturation":new xn(ze.paint_raster["raster-saturation"]),"raster-contrast":new xn(ze.paint_raster["raster-contrast"]),"raster-resampling":new xn(ze.paint_raster["raster-resampling"]),"raster-fade-duration":new xn(ze.paint_raster["raster-fade-duration"])})};class rK extends La{constructor(l){super(l,{}),this.onAdd=h=>{this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},this.onRemove=h=>{this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},this.implementation=l}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const iK={circle:class extends La{constructor(d){super(d,Nj)}createBucket(d){return new aw(d)}queryRadius(d){const l=d;return Mp("circle-radius",this,l)+Mp("circle-stroke-width",this,l)+gy(this.paint.get("circle-translate"))}queryIntersectsFeature(d,l,h,y,C,k,D,z){const B=vy(d,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),k.angle,D),K=this.paint.get("circle-radius").evaluate(l,h)+this.paint.get("circle-stroke-width").evaluate(l,h),ee=this.paint.get("circle-pitch-alignment")==="map",ie=ee?B:function(ge,ve){return ge.map(Ne=>Ck(Ne,ve))}(B,z),de=ee?K*D:K;for(const ge of y)for(const ve of ge){const Ne=ee?ve:Ck(ve,z);let Oe=de;const Qe=yy([],[ve.x,ve.y,0,1],z);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Oe*=Qe[3]/k.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Oe*=k.cameraToCenterDistance/Qe[3]),Mj(ie,Ne,Oe))return!0}return!1}},heatmap:class extends La{constructor(d){super(d,Fj),this._updateColorRamp()}createBucket(d){return new Sk(d)}_handleSpecialPaintPropertyUpdate(d){d==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Pk({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends La{constructor(d){super(d,zj)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends La{constructor(d){super(d,eH)}recalculate(d,l){super.recalculate(d,l);const h=this.paint._values["fill-outline-color"];h.value.kind==="constant"&&h.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(d){return new yw(d)}queryRadius(){return gy(this.paint.get("fill-translate"))}queryIntersectsFeature(d,l,h,y,C,k,D){return mk(vy(d,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),k.angle,D),y)}isTileClipped(){return!0}},"fill-extrusion":class extends La{constructor(d){super(d,pH)}createBucket(d){return new bw(d)}queryRadius(){return gy(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(d,l,h,y,C,k,D,z){const B=vy(d,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),k.angle,D),K=this.paint.get("fill-extrusion-height").evaluate(l,h),ee=this.paint.get("fill-extrusion-base").evaluate(l,h),ie=function(ge,ve,Ne,Oe){const Qe=[];for(const ht of ge){const Ge=[ht.x,ht.y,0,1];yy(Ge,Ge,ve),Qe.push(new re(Ge[0]/Ge[3],Ge[1]/Ge[3]))}return Qe}(B,z),de=function(ge,ve,Ne,Oe){const Qe=[],ht=[],Ge=Oe[8]*ve,lt=Oe[9]*ve,Rt=Oe[10]*ve,kt=Oe[11]*ve,hn=Oe[8]*Ne,vn=Oe[9]*Ne,ln=Oe[10]*Ne,en=Oe[11]*Ne;for(const Qt of ge){const un=[],nn=[];for(const jt of Qt){const In=jt.x,bn=jt.y,Kn=Oe[0]*In+Oe[4]*bn+Oe[12],Ar=Oe[1]*In+Oe[5]*bn+Oe[13],Ur=Oe[2]*In+Oe[6]*bn+Oe[14],bi=Oe[3]*In+Oe[7]*bn+Oe[15],da=Ur+Rt,Zi=bi+kt,pi=Kn+hn,Mi=Ar+vn,Xi=Ur+ln,ao=bi+en,Oo=new re((Kn+Ge)/Zi,(Ar+lt)/Zi);Oo.z=da/Zi,un.push(Oo);const mi=new re(pi/ao,Mi/ao);mi.z=Xi/ao,nn.push(mi)}Qe.push(un),ht.push(nn)}return[Qe,ht]}(y,ee,K,z);return function(ge,ve,Ne){let Oe=1/0;mk(Ne,ve)&&(Oe=Nk(Ne,ve[0]));for(let Qe=0;Qe=3){for(let Ne=0;Ne{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const h3=63710088e-1;class ri{constructor(l,h){if(isNaN(l)||isNaN(h))throw new Error(`Invalid LngLat object: (${l}, ${h})`);if(this.lng=+l,this.lat=+h,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ri(b(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(l){const h=Math.PI/180,y=this.lat*h,C=l.lat*h,k=Math.sin(y)*Math.sin(C)+Math.cos(y)*Math.cos(C)*Math.cos((l.lng-this.lng)*h);return h3*Math.acos(Math.min(k,1))}toBounds(l=0){const h=360*l/40075017,y=h/Math.cos(Math.PI/180*this.lat);return new Bc(new ri(this.lng-y,this.lat-h),new ri(this.lng+y,this.lat+h))}static convert(l){if(l instanceof ri)return l;if(Array.isArray(l)&&(l.length===2||l.length===3))return new ri(Number(l[0]),Number(l[1]));if(!Array.isArray(l)&&typeof l=="object"&&l!==null)return new ri(Number("lng"in l?l.lng:l.lon),Number(l.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class Bc{constructor(l,h){l&&(h?this.setSouthWest(l).setNorthEast(h):l.length===4?this.setSouthWest([l[0],l[1]]).setNorthEast([l[2],l[3]]):this.setSouthWest(l[0]).setNorthEast(l[1]))}setNorthEast(l){return this._ne=l instanceof ri?new ri(l.lng,l.lat):ri.convert(l),this}setSouthWest(l){return this._sw=l instanceof ri?new ri(l.lng,l.lat):ri.convert(l),this}extend(l){const h=this._sw,y=this._ne;let C,k;if(l instanceof ri)C=l,k=l;else{if(!(l instanceof Bc))return Array.isArray(l)?l.length===4||l.every(Array.isArray)?this.extend(Bc.convert(l)):this.extend(ri.convert(l)):this;if(C=l._sw,k=l._ne,!C||!k)return this}return h||y?(h.lng=Math.min(C.lng,h.lng),h.lat=Math.min(C.lat,h.lat),y.lng=Math.max(k.lng,y.lng),y.lat=Math.max(k.lat,y.lat)):(this._sw=new ri(C.lng,C.lat),this._ne=new ri(k.lng,k.lat)),this}getCenter(){return new ri((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new ri(this.getWest(),this.getNorth())}getSouthEast(){return new ri(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(l){const{lng:h,lat:y}=ri.convert(l);let C=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(C=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=y&&y<=this._ne.lat&&C}static convert(l){return l instanceof Bc?l:l&&new Bc(l)}}const p3=2*Math.PI*h3;function m3(d){return p3*Math.cos(d*Math.PI/180)}function g3(d){return(180+d)/360}function v3(d){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d*Math.PI/360)))/360}function y3(d,l){return d/m3(l)}function Aw(d){return 360/Math.PI*Math.atan(Math.exp((180-360*d)*Math.PI/180))-90}class Ay{constructor(l,h,y=0){this.x=+l,this.y=+h,this.z=+y}static fromLngLat(l,h=0){const y=ri.convert(l);return new Ay(g3(y.lng),v3(y.lat),y3(h,y.lat))}toLngLat(){return new ri(360*this.x-180,Aw(this.y))}toAltitude(){return this.z*m3(Aw(this.y))}meterInMercatorCoordinateUnits(){return 1/p3*(l=Aw(this.y),1/Math.cos(l*Math.PI/180));var l}}function x3(d,l,h){var y=2*Math.PI*6378137/256/Math.pow(2,h);return[d*y-2*Math.PI*6378137/2,l*y-2*Math.PI*6378137/2]}class Nw{constructor(l,h,y){if(l<0||l>25||y<0||y>=Math.pow(2,l)||h<0||h>=Math.pow(2,l))throw new Error(`x=${h}, y=${y}, z=${l} outside of bounds. 0<=x<${Math.pow(2,l)}, 0<=y<${Math.pow(2,l)} 0<=z<=25 `);this.z=l,this.x=h,this.y=y,this.key=Vp(0,l,l,h,y)}equals(l){return this.z===l.z&&this.x===l.x&&this.y===l.y}url(l,h,y){const C=(D=this.y,z=this.z,B=x3(256*(k=this.x),256*(D=Math.pow(2,z)-D-1),z),K=x3(256*(k+1),256*(D+1),z),B[0]+","+B[1]+","+K[0]+","+K[1]);var k,D,z,B,K;const ee=function(ie,de,ge){let ve,Ne="";for(let Oe=ie;Oe>0;Oe--)ve=1<1?"@2x":"").replace(/{quadkey}/g,ee).replace(/{bbox-epsg-3857}/g,C)}isChildOf(l){const h=this.z-l.z;return h>0&&l.x===this.x>>h&&l.y===this.y>>h}getTilePoint(l){const h=Math.pow(2,this.z);return new re((l.x*h-this.x)*xi,(l.y*h-this.y)*xi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class b3{constructor(l,h){this.wrap=l,this.canonical=h,this.key=Vp(l,h.z,h.z,h.x,h.y)}}class ca{constructor(l,h,y,C,k){if(l= z; overscaledZ = ${l}; z = ${y}`);this.overscaledZ=l,this.wrap=h,this.canonical=new Nw(y,+C,+k),this.key=Vp(h,l,y,C,k)}clone(){return new ca(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(l){return this.overscaledZ===l.overscaledZ&&this.wrap===l.wrap&&this.canonical.equals(l.canonical)}scaledTo(l){if(l>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);const h=this.canonical.z-l;return l>this.canonical.z?new ca(l,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ca(l,this.wrap,l,this.canonical.x>>h,this.canonical.y>>h)}calculateScaledKey(l,h){if(l>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);const y=this.canonical.z-l;return l>this.canonical.z?Vp(this.wrap*+h,l,this.canonical.z,this.canonical.x,this.canonical.y):Vp(this.wrap*+h,l,l,this.canonical.x>>y,this.canonical.y>>y)}isChildOf(l){if(l.wrap!==this.wrap)return!1;const h=this.canonical.z-l.canonical.z;return l.overscaledZ===0||l.overscaledZ>h&&l.canonical.y===this.canonical.y>>h}children(l){if(this.overscaledZ>=l)return[new ca(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const h=this.canonical.z+1,y=2*this.canonical.x,C=2*this.canonical.y;return[new ca(h,this.wrap,h,y,C),new ca(h,this.wrap,h,y+1,C),new ca(h,this.wrap,h,y,C+1),new ca(h,this.wrap,h,y+1,C+1)]}isLessThan(l){return this.wrapl.wrap)&&(this.overscaledZl.overscaledZ)&&(this.canonical.xl.canonical.x)&&this.canonical.ythis.max&&(this.max=z),z=this.dim+1||h<-1||h>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(h+1)*this.stride+(l+1)}_unpackMapbox(l,h,y){return(256*l*256+256*h+y)/10-1e4}_unpackTerrarium(l,h,y){return 256*l+h+y/256-32768}getPixels(){return new ua({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(l,h,y){if(this.dim!==l.dim)throw new Error("dem dimension mismatch");let C=h*this.dim,k=h*this.dim+this.dim,D=y*this.dim,z=y*this.dim+this.dim;switch(h){case-1:C=k-1;break;case 1:k=C+1}switch(y){case-1:D=z-1;break;case 1:z=D+1}const B=-h*this.dim,K=-y*this.dim;for(let ee=D;ee=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${l} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[l]}}class C3{constructor(l,h,y,C,k){this.type="Feature",this._vectorTileFeature=l,l._z=h,l._x=y,l._y=C,this.properties=l.properties,this.id=k}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(l){this._geometry=l}toJSON(){const l={geometry:this.geometry};for(const h in this)h!=="_geometry"&&h!=="_vectorTileFeature"&&(l[h]=this[h]);return l}}class S3{constructor(l,h){this.tileID=l,this.x=l.canonical.x,this.y=l.canonical.y,this.z=l.canonical.z,this.grid=new Dc(xi,16,0),this.grid3D=new Dc(xi,16,0),this.featureIndexArray=new Hn,this.promoteId=h}insert(l,h,y,C,k,D){const z=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(y,C,k);const B=D?this.grid3D:this.grid;for(let K=0;K=0&&ie[3]>=0&&B.insert(z,ie[0],ie[1],ie[2],ie[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new mu.VectorTile(new ww(this.rawTileData)).layers,this.sourceLayerCoder=new w3(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(l,h,y,C){this.loadVTLayers();const k=l.params||{},D=xi/l.tileSize/l.scale,z=of(k.filter),B=l.queryGeometry,K=l.queryPadding*D,ee=P3(B),ie=this.grid.query(ee.minX-K,ee.minY-K,ee.maxX+K,ee.maxY+K),de=P3(l.cameraQueryGeometry),ge=this.grid3D.query(de.minX-K,de.minY-K,de.maxX+K,de.maxY+K,(Oe,Qe,ht,Ge)=>function(lt,Rt,kt,hn,vn){for(const en of lt)if(Rt<=en.x&&kt<=en.y&&hn>=en.x&&vn>=en.y)return!0;const ln=[new re(Rt,kt),new re(Rt,vn),new re(hn,vn),new re(hn,kt)];if(lt.length>2){for(const en of ln)if(hf(lt,en))return!0}for(let en=0;en(Ge||(Ge=Fc(lt)),Rt.queryIntersectsFeature(B,lt,kt,Ge,this.z,l.transform,D,l.pixelPosMatrix)))}return ve}loadMatchingFeature(l,h,y,C,k,D,z,B,K,ee,ie){const de=this.bucketLayerIDs[h];if(D&&!function(Oe,Qe){for(let ht=0;ht=0)return!0;return!1}(D,de))return;const ge=this.sourceLayerCoder.decode(y),ve=this.vtLayers[ge].feature(C);if(k.needGeometry){const Oe=zc(ve,!0);if(!k.filter(new Br(this.tileID.overscaledZ),Oe,this.tileID.canonical))return}else if(!k.filter(new Br(this.tileID.overscaledZ),ve))return;const Ne=this.getId(ve,ge);for(let Oe=0;Oe{const z=l instanceof Nc?l.get(D):null;return z&&z.evaluate?z.evaluate(h,y,C):z})}function P3(d){let l=1/0,h=1/0,y=-1/0,C=-1/0;for(const k of d)l=Math.min(l,k.x),h=Math.min(h,k.y),y=Math.max(y,k.x),C=Math.max(C,k.y);return{minX:l,minY:h,maxX:y,maxY:C}}function aK(d,l){return l-d}var Lw;gn("FeatureIndex",S3,{omit:["rawTileData","sourceLayerCoder"]}),a.PerformanceMarkers=void 0,(Lw=a.PerformanceMarkers||(a.PerformanceMarkers={})).create="create",Lw.load="load",Lw.fullLoad="fullLoad";let Ny=null,Up=[];const Fw=1e3/30,sK={mark(d){performance.mark(d)},frame(d){const l=d;Ny!=null&&Up.push(l-Ny),Ny=l},clearMetrics(){Ny=null,Up=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const d in a.PerformanceMarkers)performance.clearMarks(a.PerformanceMarkers[d])},getPerformanceMetrics(){performance.measure("loadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.load),performance.measure("fullLoadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.fullLoad);const d=performance.getEntriesByName("loadTime")[0].duration,l=performance.getEntriesByName("fullLoadTime")[0].duration,h=Up.length,y=1/(Up.reduce((k,D)=>k+D,0)/h/1e3),C=Up.filter(k=>k>Fw).reduce((k,D)=>k+(D-Fw)/Fw,0);return{loadTime:d,fullLoadTime:l,fps:y,percentDroppedFrames:C/(h+C)*100}}};a.AJAXError=qe,a.ARRAY_TYPE=xo,a.Actor=class{constructor(d,l,h){this.target=d,this.parent=l,this.mapId=h,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},I(["receive","process"],this),this.invoker=new oK(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=U()?d:window}send(d,l,h,y,C=!1){const k=Math.round(1e18*Math.random()).toString(36).substring(0,10);h&&(this.callbacks[k]=h);const D=X(this.globalScope)?void 0:[];return this.target.postMessage({id:k,type:d,hasCallback:!!h,targetMapId:y,mustQueue:C,sourceMapId:this.mapId,data:pl(l,D)},D),{cancel:()=>{h&&delete this.callbacks[k],this.target.postMessage({id:k,type:"",targetMapId:y,sourceMapId:this.mapId})}}}receive(d){const l=d.data,h=l.id;if(h&&(!l.targetMapId||this.mapId===l.targetMapId))if(l.type===""){delete this.tasks[h];const y=this.cancelCallbacks[h];delete this.cancelCallbacks[h],y&&y()}else U()||l.mustQueue?(this.tasks[h]=l,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,l)}process(){if(!this.taskQueue.length)return;const d=this.taskQueue.shift(),l=this.tasks[d];delete this.tasks[d],this.taskQueue.length&&this.invoker.trigger(),l&&this.processTask(d,l)}processTask(d,l){if(l.type===""){const h=this.callbacks[d];delete this.callbacks[d],h&&(l.error?h(Ls(l.error)):h(null,Ls(l.data)))}else{let h=!1;const y=X(this.globalScope)?void 0:[],C=l.hasCallback?(z,B)=>{h=!0,delete this.cancelCallbacks[d],this.target.postMessage({id:d,type:"",sourceMapId:this.mapId,error:z?pl(z):null,data:pl(B,y)},y)}:z=>{h=!0};let k=null;const D=Ls(l.data);if(this.parent[l.type])k=this.parent[l.type](l.sourceMapId,D,C);else if(this.parent.getWorkerSource){const z=l.type.split(".");k=this.parent.getWorkerSource(l.sourceMapId,z[0],D.source)[z[1]](D,C)}else C(new Error(`Could not find function ${l.type}`));!h&&k&&k.cancel&&(this.cancelCallbacks[d]=k.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.AlphaImage=Dp,a.CanonicalTileID=Nw,a.CollisionBoxArray=_t,a.CollisionCircleLayoutArray=class extends ne{},a.Color=ue,a.DEMData=_3,a.DataConstantProperty=xn,a.DictionaryCoder=w3,a.EXTENT=xi,a.ErrorEvent=Lt,a.EvaluationParameters=Br,a.Event=Ot,a.Evented=Ht,a.FeatureIndex=S3,a.FillBucket=yw,a.FillExtrusionBucket=bw,a.GeoJSONFeature=C3,a.ImageAtlas=qk,a.ImagePosition=Sw,a.LineBucket=_w,a.LineStripIndexArray=class extends De{},a.LngLat=ri,a.LngLatBounds=Bc,a.MercatorCoordinate=Ay,a.ONE_EM=$i,a.OverscaledTileID=ca,a.PerformanceUtils=sK,a.PosArray=Tn,a.Properties=zi,a.QuadTriangleArray=class extends pe{},a.RGBAImage=ua,a.RasterBoundsArray=class extends w{},a.RequestPerformance=class{constructor(d){this._marks={start:[d.url,"start"].join("#"),end:[d.url,"end"].join("#"),measure:d.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let d=performance.getEntriesByName(this._marks.measure);return d.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),d=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),d}},a.ResourceType=Dt,a.SegmentVector=Zn,a.SymbolBucket=bf,a.Transitionable=cy,a.TriangleIndexArray=vo,a.Uniform1f=yl,a.Uniform1i=class extends vl{constructor(d,l){super(d,l),this.current=0}set(d){this.current!==d&&(this.current=d,this.gl.uniform1i(this.location,d))}},a.Uniform2f=class extends vl{constructor(d,l){super(d,l),this.current=[0,0]}set(d){d[0]===this.current[0]&&d[1]===this.current[1]||(this.current=d,this.gl.uniform2f(this.location,d[0],d[1]))}},a.Uniform3f=class extends vl{constructor(d,l){super(d,l),this.current=[0,0,0]}set(d){d[0]===this.current[0]&&d[1]===this.current[1]&&d[2]===this.current[2]||(this.current=d,this.gl.uniform3f(this.location,d[0],d[1],d[2]))}},a.Uniform4f=df,a.UniformColor=ck,a.UniformMatrix4f=class extends vl{constructor(d,l){super(d,l),this.current=Ij}set(d){if(d[12]!==this.current[12]||d[0]!==this.current[0])return this.current=d,void this.gl.uniformMatrix4fv(this.location,!1,d);for(let l=1;l<16;l++)if(d[l]!==this.current[l]){this.current=d,this.gl.uniformMatrix4fv(this.location,!1,d);break}}},a.UnwrappedTileID=b3,a.ValidationError=Ye,a.ZoomHistory=vp,a.add=function(d,l,h){return d[0]=l[0]+h[0],d[1]=l[1]+h[1],d[2]=l[2]+h[2],d},a.addDynamicAttributes=kw,a.asyncAll=function(d,l,h){if(!d.length)return h(null,[]);let y=d.length;const C=new Array(d.length);let k=null;d.forEach((D,z)=>{l(D,(B,K)=>{B&&(k=B),C[z]=K,--y==0&&h(k,C)})})},a.bezier=p,a.bindAll=I,a.cacheEntryPossiblyAdded=function(d){Me++,Me>Re&&(d.getActor().send("enforceCacheSizeLimit",be),Me=0)},a.clamp=v,a.clearTileCache=function(d){const l=caches.delete(he);d&&l.catch(d).then(()=>d())},a.clipLine=a3,a.clone=function(d){var l=new xo(16);return l[0]=d[0],l[1]=d[1],l[2]=d[2],l[3]=d[3],l[4]=d[4],l[5]=d[5],l[6]=d[6],l[7]=d[7],l[8]=d[8],l[9]=d[9],l[10]=d[10],l[11]=d[11],l[12]=d[12],l[13]=d[13],l[14]=d[14],l[15]=d[15],l},a.clone$1=O,a.clone$2=function(d){var l=new xo(3);return l[0]=d[0],l[1]=d[1],l[2]=d[2],l},a.collisionCircleLayout=EH,a.config=oe,a.copy=function(d,l){return d[0]=l[0],d[1]=l[1],d[2]=l[2],d[3]=l[3],d[4]=l[4],d[5]=l[5],d[6]=l[6],d[7]=l[7],d[8]=l[8],d[9]=l[9],d[10]=l[10],d[11]=l[11],d[12]=l[12],d[13]=l[13],d[14]=l[14],d[15]=l[15],d},a.create=function(){var d=new xo(16);return xo!=Float32Array&&(d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0),d[0]=1,d[5]=1,d[10]=1,d[15]=1,d},a.create$1=yk,a.createExpression=_c,a.createFilter=of,a.createLayout=hi,a.createStyleLayer=function(d){return d.type==="custom"?new rK(d):new iK[d.type](d)},a.cross=function(d,l,h){var y=l[0],C=l[1],k=l[2],D=h[0],z=h[1],B=h[2];return d[0]=C*B-k*z,d[1]=k*D-y*B,d[2]=y*z-C*D,d},a.dot=function(d,l){return d[0]*l[0]+d[1]*l[1]+d[2]*l[2]},a.dot$1=function(d,l){return d[0]*l[0]+d[1]*l[1]+d[2]*l[2]+d[3]*l[3]},a.ease=g,a.emitValidationErrors=sf,a.enforceCacheSizeLimit=function(d){Ie(),Ce&&Ce.then(l=>{l.keys().then(h=>{for(let y=0;y{}}},a.identity=uw,a.invert=function(d,l){var h=l[0],y=l[1],C=l[2],k=l[3],D=l[4],z=l[5],B=l[6],K=l[7],ee=l[8],ie=l[9],de=l[10],ge=l[11],ve=l[12],Ne=l[13],Oe=l[14],Qe=l[15],ht=h*z-y*D,Ge=h*B-C*D,lt=h*K-k*D,Rt=y*B-C*z,kt=y*K-k*z,hn=C*K-k*B,vn=ee*Ne-ie*ve,ln=ee*Oe-de*ve,en=ee*Qe-ge*ve,Qt=ie*Oe-de*Ne,un=ie*Qe-ge*Ne,nn=de*Qe-ge*Oe,jt=ht*nn-Ge*un+lt*Qt+Rt*en-kt*ln+hn*vn;return jt?(d[0]=(z*nn-B*un+K*Qt)*(jt=1/jt),d[1]=(C*un-y*nn-k*Qt)*jt,d[2]=(Ne*hn-Oe*kt+Qe*Rt)*jt,d[3]=(de*kt-ie*hn-ge*Rt)*jt,d[4]=(B*en-D*nn-K*ln)*jt,d[5]=(h*nn-C*en+k*ln)*jt,d[6]=(Oe*lt-ve*hn-Qe*Ge)*jt,d[7]=(ee*hn-de*lt+ge*Ge)*jt,d[8]=(D*un-z*en+K*vn)*jt,d[9]=(y*en-h*un-k*vn)*jt,d[10]=(ve*kt-Ne*lt+Qe*ht)*jt,d[11]=(ie*lt-ee*kt-ge*ht)*jt,d[12]=(z*ln-D*Qt-B*vn)*jt,d[13]=(h*Qt-y*ln+C*vn)*jt,d[14]=(Ne*Ge-ve*Rt-Oe*ht)*jt,d[15]=(ee*Rt-ie*Ge+de*ht)*jt,d):null},a.isImageBitmap=J,a.isSafari=X,a.isWorker=U,a.keysDifference=function(d,l){const h=[];for(const y in d)y in l||h.push(y);return h},a.lazyLoadRTLTextPlugin=function(){Ko.isLoading()||Ko.isLoaded()||Oc()!=="deferred"||uy()},a.makeRequest=vt,a.mapObject=P,a.mercatorXfromLng=g3,a.mercatorYfromLat=v3,a.mercatorZfromAltitude=y3,a.mul=Lj,a.mul$1=function(d,l,h){return d[0]=l[0]*h[0],d[1]=l[1]*h[1],d[2]=l[2]*h[2],d[3]=l[3]*h[3],d},a.multiply=xk,a.nextPowerOfTwo=function(d){return d<=1?1:Math.pow(2,Math.ceil(Math.log(d)/Math.LN2))},a.normalize=function(d,l){var h=l[0],y=l[1],C=l[2],k=h*h+y*y+C*C;return k>0&&(k=1/Math.sqrt(k)),d[0]=l[0]*k,d[1]=l[1]*k,d[2]=l[2]*k,d},a.number=Cr,a.ortho=function(d,l,h,y,C,k,D){var z=1/(l-h),B=1/(y-C),K=1/(k-D);return d[0]=-2*z,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=-2*B,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=2*K,d[11]=0,d[12]=(l+h)*z,d[13]=(C+y)*B,d[14]=(D+k)*K,d[15]=1,d},a.parseCacheControl=q,a.parseGlyphPbf=function(d){return new ww(d).readFields(LH,[])},a.pbf=ww,a.performSymbolLayout=function(d){d.bucket.createArrays(),d.bucket.tilePixelRatio=xi/(512*d.bucket.overscaling),d.bucket.compareText={},d.bucket.iconsNeedLinear=!1;const l=d.bucket.layers[0].layout,h=d.bucket.layers[0]._unevaluatedLayout._values,y={layoutIconSize:h["icon-size"].possiblyEvaluate(new Br(d.bucket.zoom+1),d.canonical),layoutTextSize:h["text-size"].possiblyEvaluate(new Br(d.bucket.zoom+1),d.canonical),textMaxSize:h["text-size"].possiblyEvaluate(new Br(18))};if(d.bucket.textSizeData.kind==="composite"){const{minZoom:B,maxZoom:K}=d.bucket.textSizeData;y.compositeTextSizes=[h["text-size"].possiblyEvaluate(new Br(B),d.canonical),h["text-size"].possiblyEvaluate(new Br(K),d.canonical)]}if(d.bucket.iconSizeData.kind==="composite"){const{minZoom:B,maxZoom:K}=d.bucket.iconSizeData;y.compositeIconSizes=[h["icon-size"].possiblyEvaluate(new Br(B),d.canonical),h["icon-size"].possiblyEvaluate(new Br(K),d.canonical)]}const C=l.get("text-line-height")*$i,k=l.get("text-rotation-alignment")!=="viewport"&&l.get("symbol-placement")!=="point",D=l.get("text-keep-upright"),z=l.get("text-size");for(const B of d.bucket.features){const K=l.get("text-font").evaluate(B,{},d.canonical).join(","),ee=z.evaluate(B,{},d.canonical),ie=y.layoutTextSize.evaluate(B,{},d.canonical),de=y.layoutIconSize.evaluate(B,{},d.canonical),ge={horizontal:{},vertical:void 0},ve=B.text;let Ne,Oe=[0,0];if(ve){const Ge=ve.toString(),lt=l.get("text-letter-spacing").evaluate(B,{},d.canonical)*$i,Rt=tw(Ge)?lt:0,kt=l.get("text-anchor").evaluate(B,{},d.canonical),hn=l.get("text-variable-anchor");if(!hn){const un=l.get("text-radial-offset").evaluate(B,{},d.canonical);Oe=un?u3(kt,[un*$i,Tw]):l.get("text-offset").evaluate(B,{},d.canonical).map(nn=>nn*$i)}let vn=k?"center":l.get("text-justify").evaluate(B,{},d.canonical);const ln=l.get("symbol-placement"),en=ln==="point"?l.get("text-max-width").evaluate(B,{},d.canonical)*$i:0,Qt=()=>{d.bucket.allowVerticalPlacement&&lf(Ge)&&(ge.vertical=Py(ve,d.glyphMap,d.glyphPositions,d.imagePositions,K,en,C,kt,"left",Rt,Oe,a.WritingMode.vertical,!0,ln,ie,ee))};if(!k&&hn){const un=vn==="auto"?hn.map(jt=>Iw(jt)):[vn];let nn=!1;for(let jt=0;jtthis._layers[Xe.id]),ke=xe[0];if(ke.visibility==="none")continue;const we=ke.source||"";let Pe=this.familiesBySource[we];Pe||(Pe=this.familiesBySource[we]={});const Le=ke.sourceLayer||"_geojsonTileLayer";let Ze=Pe[Le];Ze||(Ze=Pe[Le]=[]),Ze.push(xe)}}}class g{constructor(W){const Q={},fe=[];for(const we in W){const Pe=W[we],Le=Q[we]={};for(const Ze in Pe){const Xe=Pe[+Ze];if(!Xe||Xe.bitmap.width===0||Xe.bitmap.height===0)continue;const Ve={x:0,y:0,w:Xe.bitmap.width+2,h:Xe.bitmap.height+2};fe.push(Ve),Le[Ze]={rect:Ve,metrics:Xe.metrics}}}const{w:ue,h:xe}=a.potpack(fe),ke=new a.AlphaImage({width:ue||1,height:xe||1});for(const we in W){const Pe=W[we];for(const Le in Pe){const Ze=Pe[+Le];if(!Ze||Ze.bitmap.width===0||Ze.bitmap.height===0)continue;const Xe=Q[we][Le].rect;a.AlphaImage.copy(Ze.bitmap,ke,{x:0,y:0},{x:Xe.x+1,y:Xe.y+1},Ze.bitmap)}}this.image=ke,this.positions=Q}}a.register("GlyphAtlas",g);class v{constructor(W){this.tileID=new a.OverscaledTileID(W.tileID.overscaledZ,W.tileID.wrap,W.tileID.canonical.z,W.tileID.canonical.x,W.tileID.canonical.y),this.uid=W.uid,this.zoom=W.zoom,this.pixelRatio=W.pixelRatio,this.tileSize=W.tileSize,this.source=W.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=W.showCollisionBoxes,this.collectResourceTiming=!!W.collectResourceTiming,this.returnDependencies=!!W.returnDependencies,this.promoteId=W.promoteId}parse(W,Q,fe,ue,xe){this.status="parsing",this.data=W,this.collisionBoxArray=new a.CollisionBoxArray;const ke=new a.DictionaryCoder(Object.keys(W.layers).sort()),we=new a.FeatureIndex(this.tileID,this.promoteId);we.bucketLayerIDs=[];const Pe={},Le={featureIndex:we,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:fe},Ze=Q.familiesBySource[this.source];for(const dn in Ze){const Cn=W.layers[dn];if(!Cn)continue;Cn.version===1&&a.warnOnce(`Vector tile source "${this.source}" layer "${dn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const jn=ke.encode(dn),or=[];for(let Wr=0;Wr=dr.maxzoom||dr.visibility!=="none"&&(b(Wr,this.zoom,fe),(Pe[dr.id]=dr.createBucket({index:we.bucketLayerIDs.length,layers:Wr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:jn,sourceID:this.source})).populate(or,Le,this.tileID.canonical),we.bucketLayerIDs.push(Wr.map(Fr=>Fr.id)))}}let Xe,Ve,Bt,Et;const nt=a.mapObject(Le.glyphDependencies,dn=>Object.keys(dn).map(Number));Object.keys(nt).length?ue.send("getGlyphs",{uid:this.uid,stacks:nt},(dn,Cn)=>{Xe||(Xe=dn,Ve=Cn,wn.call(this))}):Ve={};const Ft=Object.keys(Le.iconDependencies);Ft.length?ue.send("getImages",{icons:Ft,source:this.source,tileID:this.tileID,type:"icons"},(dn,Cn)=>{Xe||(Xe=dn,Bt=Cn,wn.call(this))}):Bt={};const Gt=Object.keys(Le.patternDependencies);function wn(){if(Xe)return xe(Xe);if(Ve&&Bt&&Et){const dn=new g(Ve),Cn=new a.ImageAtlas(Bt,Et);for(const jn in Pe){const or=Pe[jn];or instanceof a.SymbolBucket?(b(or.layers,this.zoom,fe),a.performSymbolLayout({bucket:or,glyphMap:Ve,glyphPositions:dn.positions,imageMap:Bt,imagePositions:Cn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):or.hasPattern&&(or instanceof a.LineBucket||or instanceof a.FillBucket||or instanceof a.FillExtrusionBucket)&&(b(or.layers,this.zoom,fe),or.addFeatures(Le,this.tileID.canonical,Cn.patternPositions))}this.status="done",xe(null,{buckets:Object.values(Pe).filter(jn=>!jn.isEmpty()),featureIndex:we,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:dn.image,imageAtlas:Cn,glyphMap:this.returnDependencies?Ve:null,iconMap:this.returnDependencies?Bt:null,glyphPositions:this.returnDependencies?dn.positions:null})}}Gt.length?ue.send("getImages",{icons:Gt,source:this.source,tileID:this.tileID,type:"patterns"},(dn,Cn)=>{Xe||(Xe=dn,Et=Cn,wn.call(this))}):Et={},wn.call(this)}}function b(ye,W,Q){const fe=new a.EvaluationParameters(W);for(const ue of ye)ue.recalculate(fe,Q)}function _(ye,W){const Q=a.getArrayBuffer(ye.request,(fe,ue,xe,ke)=>{fe?W(fe):ue&&W(null,{vectorTile:new a.vectorTile.VectorTile(new a.pbf(ue)),rawData:ue,cacheControl:xe,expires:ke})});return()=>{Q.cancel(),W()}}class T{constructor(W,Q,fe,ue){this.actor=W,this.layerIndex=Q,this.availableImages=fe,this.loadVectorData=ue||_,this.loading={},this.loaded={}}loadTile(W,Q){const fe=W.uid;this.loading||(this.loading={});const ue=!!(W&&W.request&&W.request.collectResourceTiming)&&new a.RequestPerformance(W.request),xe=this.loading[fe]=new v(W);xe.abort=this.loadVectorData(W,(ke,we)=>{if(delete this.loading[fe],ke||!we)return xe.status="done",this.loaded[fe]=xe,Q(ke);const Pe=we.rawData,Le={};we.expires&&(Le.expires=we.expires),we.cacheControl&&(Le.cacheControl=we.cacheControl);const Ze={};if(ue){const Xe=ue.finish();Xe&&(Ze.resourceTiming=JSON.parse(JSON.stringify(Xe)))}xe.vectorTile=we.vectorTile,xe.parse(we.vectorTile,this.layerIndex,this.availableImages,this.actor,(Xe,Ve)=>{if(Xe||!Ve)return Q(Xe);Q(null,a.extend({rawTileData:Pe.slice(0)},Ve,Le,Ze))}),this.loaded=this.loaded||{},this.loaded[fe]=xe})}reloadTile(W,Q){const fe=this.loaded,ue=W.uid,xe=this;if(fe&&fe[ue]){const ke=fe[ue];ke.showCollisionBoxes=W.showCollisionBoxes;const we=(Pe,Le)=>{const Ze=ke.reloadCallback;Ze&&(delete ke.reloadCallback,ke.parse(ke.vectorTile,xe.layerIndex,this.availableImages,xe.actor,Ze)),Q(Pe,Le)};ke.status==="parsing"?ke.reloadCallback=we:ke.status==="done"&&(ke.vectorTile?ke.parse(ke.vectorTile,this.layerIndex,this.availableImages,this.actor,we):we())}}abortTile(W,Q){const fe=this.loading,ue=W.uid;fe&&fe[ue]&&fe[ue].abort&&(fe[ue].abort(),delete fe[ue]),Q()}removeTile(W,Q){const fe=this.loaded,ue=W.uid;fe&&fe[ue]&&delete fe[ue],Q()}}class I{constructor(){this.loaded={}}loadTile(W,Q){const{uid:fe,encoding:ue,rawImageData:xe}=W,ke=a.isImageBitmap(xe)?this.getImageData(xe):xe,we=new a.DEMData(fe,ke,ue);this.loaded=this.loaded||{},this.loaded[fe]=we,Q(null,we)}getImageData(W){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(W.width,W.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=W.width,this.offscreenCanvas.height=W.height,this.offscreenCanvasContext.drawImage(W,0,0,W.width,W.height);const Q=this.offscreenCanvasContext.getImageData(-1,-1,W.width+2,W.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new a.RGBAImage({width:Q.width,height:Q.height},Q.data)}removeTile(W){const Q=this.loaded,fe=W.uid;Q&&Q[fe]&&delete Q[fe]}}var P=function ye(W,Q){var fe,ue=W&&W.type;if(ue==="FeatureCollection")for(fe=0;fe=Math.abs(we)?Q-Pe+we:we-Pe+Q,Q=Pe}Q+fe>=0!=!!W&&ye.reverse()}const N=a.vectorTile.VectorTileFeature.prototype.toGeoJSON;class F{constructor(W){this._feature=W,this.extent=a.EXTENT,this.type=W.type,this.properties=W.tags,"id"in W&&!isNaN(W.id)&&(this.id=parseInt(W.id,10))}loadGeometry(){if(this._feature.type===1){const W=[];for(const Q of this._feature.geometry)W.push([new a.pointGeometry(Q[0],Q[1])]);return W}{const W=[];for(const Q of this._feature.geometry){const fe=[];for(const ue of Q)fe.push(new a.pointGeometry(ue[0],ue[1]));W.push(fe)}return W}}toGeoJSON(W,Q,fe){return N.call(this,W,Q,fe)}}class ${constructor(W){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=a.EXTENT,this.length=W.length,this._features=W}feature(W){return new F(this._features[W])}}var j={exports:{}},U=a.pointGeometry,q=a.vectorTile.VectorTileFeature,Y=te;function te(ye,W){this.options=W||{},this.features=ye,this.length=ye.length}function Z(ye,W){this.id=typeof ye.id=="number"?ye.id:void 0,this.type=ye.type,this.rawGeometry=ye.type===1?[ye.geometry]:ye.geometry,this.properties=ye.tags,this.extent=W||4096}te.prototype.feature=function(ye){return new Z(this.features[ye],this.options.extent)},Z.prototype.loadGeometry=function(){var ye=this.rawGeometry;this.geometry=[];for(var W=0;W>31}function Se(ye,W){for(var Q=ye.loadGeometry(),fe=ye.type,ue=0,xe=0,ke=Q.length,we=0;we>1;Ie(ye,W,ke,fe,ue,xe%2),Re(ye,W,Q,fe,ke-1,xe+1),Re(ye,W,Q,ke+1,ue,xe+1)}function Ie(ye,W,Q,fe,ue,xe){for(;ue>fe;){if(ue-fe>600){const Le=ue-fe+1,Ze=Q-fe+1,Xe=Math.log(Le),Ve=.5*Math.exp(2*Xe/3),Bt=.5*Math.sqrt(Xe*Ve*(Le-Ve)/Le)*(Ze-Le/2<0?-1:1);Ie(ye,W,Q,Math.max(fe,Math.floor(Q-Ze*Ve/Le+Bt)),Math.min(ue,Math.floor(Q+(Le-Ze)*Ve/Le+Bt)),xe)}const ke=W[2*Q+xe];let we=fe,Pe=ue;for(Me(ye,W,fe,Q),W[2*ue+xe]>ke&&Me(ye,W,fe,ue);weke;)Pe--}W[2*fe+xe]===ke?Me(ye,W,fe,Pe):(Pe++,Me(ye,W,Pe,ue)),Pe<=Q&&(fe=Pe+1),Q<=Pe&&(ue=Pe-1)}}function Me(ye,W,Q,fe){Ae(ye,Q,fe),Ae(W,2*Q,2*fe),Ae(W,2*Q+1,2*fe+1)}function Ae(ye,W,Q){const fe=ye[W];ye[W]=ye[Q],ye[Q]=fe}function Fe(ye,W,Q,fe){const ue=ye-Q,xe=W-fe;return ue*ue+xe*xe}j.exports=ce,j.exports.fromVectorTileJs=ce,j.exports.fromGeojsonVt=function(ye,W){W=W||{};var Q={};for(var fe in ye)Q[fe]=new J(ye[fe].features,W),Q[fe].name=fe,Q[fe].version=W.version,Q[fe].extent=W.extent;return ce({layers:Q})},j.exports.GeoJSONWrapper=J;const Ke=ye=>ye[0],Ue=ye=>ye[1];class pt{constructor(W,Q=Ke,fe=Ue,ue=64,xe=Float64Array){this.nodeSize=ue,this.points=W;const ke=W.length<65536?Uint16Array:Uint32Array,we=this.ids=new ke(W.length),Pe=this.coords=new xe(2*W.length);for(let Le=0;Le=we&&Et<=Le&&nt>=Pe&&nt<=Ze&&Bt.push(xe[jn]);continue}const dn=Math.floor((wn+Gt)/2);Et=ke[2*dn],nt=ke[2*dn+1],Et>=we&&Et<=Le&&nt>=Pe&&nt<=Ze&&Bt.push(xe[dn]);const Cn=(Ft+1)%2;(Ft===0?we<=Et:Pe<=nt)&&(Ve.push(wn),Ve.push(dn-1),Ve.push(Cn)),(Ft===0?Le>=Et:Ze>=nt)&&(Ve.push(dn+1),Ve.push(Gt),Ve.push(Cn))}return Bt}(this.ids,this.coords,W,Q,fe,ue,this.nodeSize)}within(W,Q,fe){return function(ue,xe,ke,we,Pe,Le){const Ze=[0,ue.length-1,0],Xe=[],Ve=Pe*Pe;for(;Ze.length;){const Bt=Ze.pop(),Et=Ze.pop(),nt=Ze.pop();if(Et-nt<=Le){for(let Cn=nt;Cn<=Et;Cn++)Fe(xe[2*Cn],xe[2*Cn+1],ke,we)<=Ve&&Xe.push(ue[Cn]);continue}const Ft=Math.floor((nt+Et)/2),Gt=xe[2*Ft],wn=xe[2*Ft+1];Fe(Gt,wn,ke,we)<=Ve&&Xe.push(ue[Ft]);const dn=(Bt+1)%2;(Bt===0?ke-Pe<=Gt:we-Pe<=wn)&&(Ze.push(nt),Ze.push(Ft-1),Ze.push(dn)),(Bt===0?ke+Pe>=Gt:we+Pe>=wn)&&(Ze.push(Ft+1),Ze.push(Et),Ze.push(dn))}return Xe}(this.ids,this.coords,W,Q,fe,this.nodeSize)}}const gt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:ye=>ye},Dt=Math.fround||(qe=new Float32Array(1),ye=>(qe[0]=+ye,qe[0]));var qe;class Ct{constructor(W){this.options=He(Object.create(gt),W),this.trees=new Array(this.options.maxZoom+1)}load(W){const{log:Q,minZoom:fe,maxZoom:ue,nodeSize:xe}=this.options;Q&&console.time("total time");const ke=`prepare ${W.length} points`;Q&&console.time(ke),this.points=W;let we=[];for(let Pe=0;Pe=fe;Pe--){const Le=+Date.now();we=this._cluster(we,Pe),this.trees[Pe]=new pt(we,ct,bt,xe,Float32Array),Q&&console.log("z%d: %d clusters in %dms",Pe,we.length,+Date.now()-Le)}return Q&&console.timeEnd("total time"),this}getClusters(W,Q){let fe=((W[0]+180)%360+360)%360-180;const ue=Math.max(-90,Math.min(90,W[1]));let xe=W[2]===180?180:((W[2]+180)%360+360)%360-180;const ke=Math.max(-90,Math.min(90,W[3]));if(W[2]-W[0]>=360)fe=-180,xe=180;else if(fe>xe){const Ze=this.getClusters([fe,ue,180,ke],Q),Xe=this.getClusters([-180,ue,xe,ke],Q);return Ze.concat(Xe)}const we=this.trees[this._limitZoom(Q)],Pe=we.range(et(fe),ut(ke),et(xe),ut(ue)),Le=[];for(const Ze of Pe){const Xe=we.points[Ze];Le.push(Xe.numPoints?yt(Xe):this.points[Xe.index])}return Le}getChildren(W){const Q=this._getOriginId(W),fe=this._getOriginZoom(W),ue="No cluster with the specified id.",xe=this.trees[fe];if(!xe)throw new Error(ue);const ke=xe.points[Q];if(!ke)throw new Error(ue);const we=this.options.radius/(this.options.extent*Math.pow(2,fe-1)),Pe=xe.within(ke.x,ke.y,we),Le=[];for(const Ze of Pe){const Xe=xe.points[Ze];Xe.parentId===W&&Le.push(Xe.numPoints?yt(Xe):this.points[Xe.index])}if(Le.length===0)throw new Error(ue);return Le}getLeaves(W,Q,fe){const ue=[];return this._appendLeaves(ue,W,Q=Q||10,fe=fe||0,0),ue}getTile(W,Q,fe){const ue=this.trees[this._limitZoom(W)],xe=Math.pow(2,W),{extent:ke,radius:we}=this.options,Pe=we/ke,Le=(fe-Pe)/xe,Ze=(fe+1+Pe)/xe,Xe={features:[]};return this._addTileFeatures(ue.range((Q-Pe)/xe,Le,(Q+1+Pe)/xe,Ze),ue.points,Q,fe,xe,Xe),Q===0&&this._addTileFeatures(ue.range(1-Pe/xe,Le,1,Ze),ue.points,xe,fe,xe,Xe),Q===xe-1&&this._addTileFeatures(ue.range(0,Le,Pe/xe,Ze),ue.points,-1,fe,xe,Xe),Xe.features.length?Xe:null}getClusterExpansionZoom(W){let Q=this._getOriginZoom(W)-1;for(;Q<=this.options.maxZoom;){const fe=this.getChildren(W);if(Q++,fe.length!==1)break;W=fe[0].properties.cluster_id}return Q}_appendLeaves(W,Q,fe,ue,xe){const ke=this.getChildren(Q);for(const we of ke){const Pe=we.properties;if(Pe&&Pe.cluster?xe+Pe.point_count<=ue?xe+=Pe.point_count:xe=this._appendLeaves(W,Pe.cluster_id,fe,ue,xe):xeQ&&(Et+=Ft.numPoints||1)}if(Et>Bt&&Et>=we){let nt=Ze.x*Bt,Ft=Ze.y*Bt,Gt=ke&&Bt>1?this._map(Ze,!0):null;const wn=(Le<<5)+(Q+1)+this.points.length;for(const dn of Ve){const Cn=Xe.points[dn];if(Cn.zoom<=Q)continue;Cn.zoom=Q;const jn=Cn.numPoints||1;nt+=Cn.x*jn,Ft+=Cn.y*jn,Cn.parentId=wn,ke&&(Gt||(Gt=this._map(Ze,!0)),ke(Gt,this._map(Cn)))}Ze.parentId=wn,fe.push(ot(nt/Et,Ft/Et,wn,Et,Gt))}else if(fe.push(Ze),Et>1)for(const nt of Ve){const Ft=Xe.points[nt];Ft.zoom<=Q||(Ft.zoom=Q,fe.push(Ft))}}return fe}_getOriginId(W){return W-this.points.length>>5}_getOriginZoom(W){return(W-this.points.length)%32}_map(W,Q){if(W.numPoints)return Q?He({},W.properties):W.properties;const fe=this.points[W.index].properties,ue=this.options.map(fe);return Q&&ue===fe?He({},ue):ue}}function ot(ye,W,Q,fe,ue){return{x:Dt(ye),y:Dt(W),zoom:1/0,id:Q,parentId:-1,numPoints:fe,properties:ue}}function vt(ye,W){const[Q,fe]=ye.geometry.coordinates;return{x:Dt(et(Q)),y:Dt(ut(fe)),zoom:1/0,index:W,parentId:-1}}function yt(ye){return{type:"Feature",id:ye.id,properties:Tt(ye),geometry:{type:"Point",coordinates:[(W=ye.x,360*(W-.5)),at(ye.y)]}};var W}function Tt(ye){const W=ye.numPoints,Q=W>=1e4?`${Math.round(W/1e3)}k`:W>=1e3?Math.round(W/100)/10+"k":W;return He(He({},ye.properties),{cluster:!0,cluster_id:ye.id,point_count:W,point_count_abbreviated:Q})}function et(ye){return ye/360+.5}function ut(ye){const W=Math.sin(ye*Math.PI/180),Q=.5-.25*Math.log((1+W)/(1-W))/Math.PI;return Q<0?0:Q>1?1:Q}function at(ye){const W=(180-360*ye)*Math.PI/180;return 360*Math.atan(Math.exp(W))/Math.PI-90}function He(ye,W){for(const Q in W)ye[Q]=W[Q];return ye}function ct(ye){return ye.x}function bt(ye){return ye.y}function Ot(ye,W,Q,fe){for(var ue,xe=fe,ke=Q-W>>1,we=Q-W,Pe=ye[W],Le=ye[W+1],Ze=ye[Q],Xe=ye[Q+1],Ve=W+3;Vexe)ue=Ve,xe=Bt;else if(Bt===xe){var Et=Math.abs(Ve-ke);Etfe&&(ue-W>3&&Ot(ye,W,ue,fe),ye[ue+2]=xe,Q-ue>3&&Ot(ye,ue,Q,fe))}function Lt(ye,W,Q,fe,ue,xe){var ke=ue-Q,we=xe-fe;if(ke!==0||we!==0){var Pe=((ye-Q)*ke+(W-fe)*we)/(ke*ke+we*we);Pe>1?(Q=ue,fe=xe):Pe>0&&(Q+=ke*Pe,fe+=we*Pe)}return(ke=ye-Q)*ke+(we=W-fe)*we}function Ht(ye,W,Q,fe){var ue={id:ye===void 0?null:ye,type:W,geometry:Q,tags:fe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(xe){var ke=xe.geometry,we=xe.type;if(we==="Point"||we==="MultiPoint"||we==="LineString")ze(xe,ke);else if(we==="Polygon"||we==="MultiLineString")for(var Pe=0;Pe0&&(ke+=fe?(ue*Le-Pe*xe)/2:Math.sqrt(Math.pow(Pe-ue,2)+Math.pow(Le-xe,2))),ue=Pe,xe=Le}var Ze=W.length-3;W[2]=1,Ot(W,0,Ze,Q),W[Ze+2]=1,W.size=Math.abs(ke),W.start=0,W.end=W.size}function Kt(ye,W,Q,fe){for(var ue=0;ue1?1:Q}function Xt(ye,W,Q,fe,ue,xe,ke,we){if(fe/=W,xe>=(Q/=W)&&ke=fe)return null;for(var Pe=[],Le=0;Le=Q&&Et=fe)){var nt=[];if(Ve==="Point"||Ve==="MultiPoint")pn(Xe,nt,Q,fe,ue);else if(Ve==="LineString")tt(Xe,nt,Q,fe,ue,!1,we.lineMetrics);else if(Ve==="MultiLineString")qt(Xe,nt,Q,fe,ue,!1);else if(Ve==="Polygon")qt(Xe,nt,Q,fe,ue,!0);else if(Ve==="MultiPolygon")for(var Ft=0;Ft=Q&&ke<=fe&&(W.push(ye[xe]),W.push(ye[xe+1]),W.push(ye[xe+2]))}}function tt(ye,W,Q,fe,ue,xe,ke){for(var we,Pe,Le=At(ye),Ze=ue===0?yn:St,Xe=ye.start,Ve=0;VeQ&&(Pe=Ze(Le,Bt,Et,Ft,Gt,Q),ke&&(Le.start=Xe+we*Pe)):wn>fe?dn=Q&&(Pe=Ze(Le,Bt,Et,Ft,Gt,Q),Cn=!0),dn>fe&&wn<=fe&&(Pe=Ze(Le,Bt,Et,Ft,Gt,fe),Cn=!0),!xe&&Cn&&(ke&&(Le.end=Xe+we*Pe),W.push(Le),Le=At(ye)),ke&&(Xe+=we)}var jn=ye.length-3;Bt=ye[jn],Et=ye[jn+1],nt=ye[jn+2],(wn=ue===0?Bt:Et)>=Q&&wn<=fe&&En(Le,Bt,Et,nt),jn=Le.length-3,xe&&jn>=3&&(Le[jn]!==Le[0]||Le[jn+1]!==Le[1])&&En(Le,Le[0],Le[1],Le[2]),Le.length&&W.push(Le)}function At(ye){var W=[];return W.size=ye.size,W.start=ye.start,W.end=ye.end,W}function qt(ye,W,Q,fe,ue,xe){for(var ke=0;keke.maxX&&(ke.maxX=Ze),Xe>ke.maxY&&(ke.maxY=Xe)}return ke}function mt(ye,W,Q,fe){var ue=W.geometry,xe=W.type,ke=[];if(xe==="Point"||xe==="MultiPoint")for(var we=0;we0&&W.size<(ue?ke:fe))Q.numPoints+=W.length/3;else{for(var we=[],Pe=0;Peke)&&(Q.numSimplified++,we.push(W[Pe]),we.push(W[Pe+1])),Q.numPoints++;ue&&function(Le,Ze){for(var Xe=0,Ve=0,Bt=Le.length,Et=Bt-2;Ve0===Ze)for(Ve=0,Bt=Le.length;Ve24)throw new Error("maxZoom should be in the 0-24 range");if(W.promoteId&&W.generateId)throw new Error("promoteId and generateId cannot be used together.");var fe=function(ue,xe){var ke=[];if(ue.type==="FeatureCollection")for(var we=0;we1&&console.time("creation"),Ve=this.tiles[Xe]=dt(ye,W,Q,fe,Pe),this.tileCoords.push({z:W,x:Q,y:fe}),Le)){Le>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",W,Q,fe,Ve.numFeatures,Ve.numPoints,Ve.numSimplified),console.timeEnd("creation"));var Bt="z"+W;this.stats[Bt]=(this.stats[Bt]||0)+1,this.total++}if(Ve.source=ye,ue){if(W===Pe.maxZoom||W===ue)continue;var Et=1<1&&console.time("clipping");var nt,Ft,Gt,wn,dn,Cn,jn=.5*Pe.buffer/Pe.extent,or=.5-jn,Wr=.5+jn,dr=1+jn;nt=Ft=Gt=wn=null,dn=Xt(ye,Ze,Q-jn,Q+Wr,0,Ve.minX,Ve.maxX,Pe),Cn=Xt(ye,Ze,Q+or,Q+dr,0,Ve.minX,Ve.maxX,Pe),ye=null,dn&&(nt=Xt(dn,Ze,fe-jn,fe+Wr,1,Ve.minY,Ve.maxY,Pe),Ft=Xt(dn,Ze,fe+or,fe+dr,1,Ve.minY,Ve.maxY,Pe),dn=null),Cn&&(Gt=Xt(Cn,Ze,fe-jn,fe+Wr,1,Ve.minY,Ve.maxY,Pe),wn=Xt(Cn,Ze,fe+or,fe+dr,1,Ve.minY,Ve.maxY,Pe),Cn=null),Le>1&&console.timeEnd("clipping"),we.push(nt||[],W+1,2*Q,2*fe),we.push(Ft||[],W+1,2*Q,2*fe+1),we.push(Gt||[],W+1,2*Q+1,2*fe),we.push(wn||[],W+1,2*Q+1,2*fe+1)}}},Wt.prototype.getTile=function(ye,W,Q){var fe=this.options,ue=fe.extent,xe=fe.debug;if(ye<0||ye>24)return null;var ke=1<1&&console.log("drilling down to z%d-%d-%d",ye,W,Q);for(var Pe,Le=ye,Ze=W,Xe=Q;!Pe&&Le>0;)Le--,Ze=Math.floor(Ze/2),Xe=Math.floor(Xe/2),Pe=this.tiles[mn(Le,Ze,Xe)];return Pe&&Pe.source?(xe>1&&console.log("found parent tile z%d-%d-%d",Le,Ze,Xe),xe>1&&console.time("drilling down"),this.splitTile(Pe.source,Le,Ze,Xe,ye,W,Q),xe>1&&console.timeEnd("drilling down"),this.tiles[we]?tn(this.tiles[we],ue):null):null};class Qn extends T{constructor(W,Q,fe,ue){super(W,Q,fe,An),ue&&(this.loadGeoJSON=ue)}loadData(W,Q){var fe;(fe=this._pendingRequest)===null||fe===void 0||fe.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ue=!!(W&&W.request&&W.request.collectResourceTiming)&&new a.RequestPerformance(W.request);this._pendingCallback=Q,this._pendingRequest=this.loadGeoJSON(W,(xe,ke)=>{if(delete this._pendingCallback,delete this._pendingRequest,xe||!ke)return Q(xe);if(typeof ke!="object")return Q(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`));{P(ke,!0);try{if(W.filter){const Pe=a.createExpression(W.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Pe.result==="error")throw new Error(Pe.value.map(Ze=>`${Ze.key}: ${Ze.message}`).join(", "));ke={type:"FeatureCollection",features:ke.features.filter(Ze=>Pe.value.evaluate({zoom:0},Ze))}}this._geoJSONIndex=W.cluster?new Ct(function({superclusterOptions:Pe,clusterProperties:Le}){if(!Le||!Pe)return Pe;const Ze={},Xe={},Ve={accumulated:null,zoom:0},Bt={properties:null},Et=Object.keys(Le);for(const nt of Et){const[Ft,Gt]=Le[nt],wn=a.createExpression(Gt),dn=a.createExpression(typeof Ft=="string"?[Ft,["accumulated"],["get",nt]]:Ft);Ze[nt]=wn.value,Xe[nt]=dn.value}return Pe.map=nt=>{Bt.properties=nt;const Ft={};for(const Gt of Et)Ft[Gt]=Ze[Gt].evaluate(Ve,Bt);return Ft},Pe.reduce=(nt,Ft)=>{Bt.properties=Ft;for(const Gt of Et)Ve.accumulated=nt[Gt],nt[Gt]=Xe[Gt].evaluate(Ve,Bt)},Pe}(W)).load(ke.features):function(Pe,Le){return new Wt(Pe,Le)}(ke,W.geojsonVtOptions)}catch(Pe){return Q(Pe)}this.loaded={};const we={};if(ue){const Pe=ue.finish();Pe&&(we.resourceTiming={},we.resourceTiming[W.source]=JSON.parse(JSON.stringify(Pe)))}Q(null,we)}})}reloadTile(W,Q){const fe=this.loaded;return fe&&fe[W.uid]?super.reloadTile(W,Q):this.loadTile(W,Q)}loadGeoJSON(W,Q){if(W.request)return a.getJSON(W.request,Q);if(typeof W.data=="string")try{Q(null,JSON.parse(W.data))}catch{Q(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`))}else Q(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(W,Q){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),Q()}getClusterExpansionZoom(W,Q){try{Q(null,this._geoJSONIndex.getClusterExpansionZoom(W.clusterId))}catch(fe){Q(fe)}}getClusterChildren(W,Q){try{Q(null,this._geoJSONIndex.getChildren(W.clusterId))}catch(fe){Q(fe)}}getClusterLeaves(W,Q){try{Q(null,this._geoJSONIndex.getLeaves(W.clusterId,W.limit,W.offset))}catch(fe){Q(fe)}}}class Jn{constructor(W){this.self=W,this.actor=new a.Actor(W,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:T,geojson:Qn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(Q,fe)=>{if(this.workerSourceTypes[Q])throw new Error(`Worker source with name "${Q}" already registered.`);this.workerSourceTypes[Q]=fe},this.self.registerRTLTextPlugin=Q=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=Q.applyArabicShaping,a.plugin.processBidirectionalText=Q.processBidirectionalText,a.plugin.processStyledBidirectionalText=Q.processStyledBidirectionalText}}setReferrer(W,Q){this.referrer=Q}setImages(W,Q,fe){this.availableImages[W]=Q;for(const ue in this.workerSources[W]){const xe=this.workerSources[W][ue];for(const ke in xe)xe[ke].availableImages=Q}fe()}setLayers(W,Q,fe){this.getLayerIndex(W).replace(Q),fe()}updateLayers(W,Q,fe){this.getLayerIndex(W).update(Q.layers,Q.removedIds),fe()}loadTile(W,Q,fe){this.getWorkerSource(W,Q.type,Q.source).loadTile(Q,fe)}loadDEMTile(W,Q,fe){this.getDEMWorkerSource(W,Q.source).loadTile(Q,fe)}reloadTile(W,Q,fe){this.getWorkerSource(W,Q.type,Q.source).reloadTile(Q,fe)}abortTile(W,Q,fe){this.getWorkerSource(W,Q.type,Q.source).abortTile(Q,fe)}removeTile(W,Q,fe){this.getWorkerSource(W,Q.type,Q.source).removeTile(Q,fe)}removeDEMTile(W,Q){this.getDEMWorkerSource(W,Q.source).removeTile(Q)}removeSource(W,Q,fe){if(!this.workerSources[W]||!this.workerSources[W][Q.type]||!this.workerSources[W][Q.type][Q.source])return;const ue=this.workerSources[W][Q.type][Q.source];delete this.workerSources[W][Q.type][Q.source],ue.removeSource!==void 0?ue.removeSource(Q,fe):fe()}loadWorkerSource(W,Q,fe){try{this.self.importScripts(Q.url),fe()}catch(ue){fe(ue.toString())}}syncRTLPluginState(W,Q,fe){try{a.plugin.setState(Q);const ue=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&ue!=null){this.self.importScripts(ue);const xe=a.plugin.isParsed();fe(xe?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ue}`),xe)}}catch(ue){fe(ue.toString())}}getAvailableImages(W){let Q=this.availableImages[W];return Q||(Q=[]),Q}getLayerIndex(W){let Q=this.layerIndexes[W];return Q||(Q=this.layerIndexes[W]=new p),Q}getWorkerSource(W,Q,fe){if(this.workerSources[W]||(this.workerSources[W]={}),this.workerSources[W][Q]||(this.workerSources[W][Q]={}),!this.workerSources[W][Q][fe]){const ue={send:(xe,ke,we)=>{this.actor.send(xe,ke,we,W)}};this.workerSources[W][Q][fe]=new this.workerSourceTypes[Q](ue,this.getLayerIndex(W),this.getAvailableImages(W))}return this.workerSources[W][Q][fe]}getDEMWorkerSource(W,Q){return this.demWorkerSources[W]||(this.demWorkerSources[W]={}),this.demWorkerSources[W][Q]||(this.demWorkerSources[W][Q]=new I),this.demWorkerSources[W][Q]}enforceCacheSizeLimit(W,Q){a.enforceCacheSizeLimit(Q)}}return a.isWorker()&&(self.worker=new Jn(self)),Jn}),o(["./shared"],function(a){var c=f;function f(w){return!function(u){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var x,S,R=new Blob([""],{type:"text/javascript"}),L=URL.createObjectURL(R);try{S=new Worker(L),x=!0}catch{x=!1}return S&&S.terminate(),URL.revokeObjectURL(L),x}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var x=document.createElement("canvas");x.width=x.height=1;var S=x.getContext("2d");if(!S)return!1;var R=S.getImageData(0,0,1,1);return R&&R.width===x.width}()?(p[m=u&&u.failIfMajorPerformanceCaveat]===void 0&&(p[m]=function(x){var S,R=function(L){var V=document.createElement("canvas"),H=Object.create(f.webGLContextAttributes);return H.failIfMajorPerformanceCaveat=L,V.getContext("webgl",H)||V.getContext("experimental-webgl",H)}(x);if(!R)return!1;try{S=R.createShader(R.VERTEX_SHADER)}catch{return!1}return!(!S||R.isContextLost())&&(R.shaderSource(S,"void main() {}"),R.compileShader(S),R.getShaderParameter(S,R.COMPILE_STATUS)===!0)}(m)),p[m]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var m}(w)}var p={};function g(w,u){if(Array.isArray(w)){if(!Array.isArray(u)||w.length!==u.length)return!1;for(let m=0;m{window.removeEventListener("click",v.suppressClickInternal,!0)},0)}static mousePos(u,m){const x=u.getBoundingClientRect();return new a.pointGeometry(m.clientX-x.left-u.clientLeft,m.clientY-x.top-u.clientTop)}static touchPos(u,m){const x=u.getBoundingClientRect(),S=[];for(let R=0;R-1);H++,R[H]=V,L[H]=G,L[H+1]=M}for(let V=0,H=0;V{let V=this.entries[S];V||(V=this.entries[S]={glyphs:{},requests:{},ranges:{}});let H=V.glyphs[R];if(H!==void 0)return void L(null,{stack:S,id:R,glyph:H});if(H=this._tinySDF(V,S,R),H)return V.glyphs[R]=H,void L(null,{stack:S,id:R,glyph:H});const G=Math.floor(R/256);if(256*G>65535)return void L(new Error("glyphs > 65535 not supported"));if(V.ranges[G])return void L(null,{stack:S,id:R,glyph:H});let ne=V.requests[G];ne||(ne=V.requests[G]=[],F.loadGlyphRange(S,G,this.url,this.requestManager,(le,pe)=>{if(pe){for(const Te in pe)this._doesCharSupportLocalGlyph(+Te)||(V.glyphs[+Te]=pe[+Te]);V.ranges[G]=!0}for(const Te of ne)Te(le,pe);delete V.requests[G]})),ne.push((le,pe)=>{le?L(le):pe&&L(null,{stack:S,id:R,glyph:pe[R]||null})})},(S,R)=>{if(S)m(S);else if(R){const L={};for(const{stack:V,id:H,glyph:G}of R)(L[V]||(L[V]={}))[H]=G&&{id:G.id,bitmap:G.bitmap.clone(),metrics:G.metrics};m(null,L)}})}_doesCharSupportLocalGlyph(u){return!!this.localIdeographFontFamily&&(a.unicodeBlockLookup["CJK Unified Ideographs"](u)||a.unicodeBlockLookup["Hangul Syllables"](u)||a.unicodeBlockLookup.Hiragana(u)||a.unicodeBlockLookup.Katakana(u))}_tinySDF(u,m,x){const S=this.localIdeographFontFamily;if(!S||!this._doesCharSupportLocalGlyph(x))return;let R=u.tinySDF;if(!R){let V="400";/bold/i.test(m)?V="900":/medium/i.test(m)?V="500":/light/i.test(m)&&(V="200"),R=u.tinySDF=new F.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:S,fontWeight:V})}const L=R.draw(String.fromCharCode(x));return{id:x,bitmap:new a.AlphaImage({width:L.width||30,height:L.height||30},L.data),metrics:{width:L.glyphWidth||24,height:L.glyphHeight||24,left:L.glyphLeft||0,top:L.glyphTop-27||-8,advance:L.glyphAdvance||24}}}}F.loadGlyphRange=function(w,u,m,x,S){const R=256*u,L=R+255,V=x.transformRequest(m.replace("{fontstack}",w).replace("{range}",`${R}-${L}`),a.ResourceType.Glyphs);a.getArrayBuffer(V,(H,G)=>{if(H)S(H);else if(G){const ne={};for(const le of a.parseGlyphPbf(G))ne[le.id]=le;S(null,ne)}})},F.TinySDF=class{constructor({fontSize:w=24,buffer:u=3,radius:m=8,cutoff:x=.25,fontFamily:S="sans-serif",fontWeight:R="normal",fontStyle:L="normal"}={}){this.buffer=u,this.cutoff=x,this.radius=m;const V=this.size=w+4*u,H=this._createCanvas(V),G=this.ctx=H.getContext("2d",{willReadFrequently:!0});G.font=`${L} ${R} ${w}px ${S}`,G.textBaseline="alphabetic",G.textAlign="left",G.fillStyle="black",this.gridOuter=new Float64Array(V*V),this.gridInner=new Float64Array(V*V),this.f=new Float64Array(V),this.z=new Float64Array(V+1),this.v=new Uint16Array(V)}_createCanvas(w){const u=document.createElement("canvas");return u.width=u.height=w,u}draw(w){const{width:u,actualBoundingBoxAscent:m,actualBoundingBoxDescent:x,actualBoundingBoxLeft:S,actualBoundingBoxRight:R}=this.ctx.measureText(w),L=Math.ceil(m),V=Math.min(this.size-this.buffer,Math.ceil(R-S)),H=Math.min(this.size-this.buffer,L+Math.ceil(x)),G=V+2*this.buffer,ne=H+2*this.buffer,le=Math.max(G*ne,0),pe=new Uint8ClampedArray(le),Te={data:pe,width:G,height:ne,glyphWidth:V,glyphHeight:H,glyphTop:L,glyphLeft:0,glyphAdvance:u};if(V===0||H===0)return Te;const{ctx:_e,buffer:Ee,gridInner:Be,gridOuter:We}=this;_e.clearRect(Ee,Ee,V,H),_e.fillText(w,Ee,Ee+L);const rt=_e.getImageData(Ee,Ee,V,H);We.fill(M,0,le),Be.fill(0,0,le);for(let De=0;De0?wt*wt:0,Be[_t]=wt<0?wt*wt:0}}O(We,0,0,G,ne,G,this.f,this.v,this.z),O(Be,Ee,Ee,V,H,G,this.f,this.v,this.z);for(let De=0;De1&&(H=u[++V]);const ne=Math.abs(G-H.left),le=Math.abs(G-H.right),pe=Math.min(ne,le);let Te;const _e=R/x*(S+1);if(H.isDash){const Ee=S-Math.abs(_e);Te=Math.sqrt(pe*pe+Ee*Ee)}else Te=S-Math.sqrt(pe*pe+_e*_e);this.data[L+G]=Math.max(0,Math.min(255,Te+128))}}}addRegularDash(u){for(let V=u.length-1;V>=0;--V){const H=u[V],G=u[V+1];H.zeroLength?u.splice(V,1):G&&G.isDash===H.isDash&&(G.left=H.left,u.splice(V,1))}const m=u[0],x=u[u.length-1];m.isDash===x.isDash&&(m.left=x.left-this.width,x.right=m.right+this.width);const S=this.width*this.nextRow;let R=0,L=u[R];for(let V=0;V1&&(L=u[++R]);const H=Math.abs(V-L.left),G=Math.abs(V-L.right),ne=Math.min(H,G);this.data[S+V]=Math.max(0,Math.min(255,(L.isDash?ne:-ne)+128))}}addDash(u,m){const x=m?7:0,S=2*x+1;if(this.nextRow+S>this.height)return a.warnOnce("LineAtlas out of space"),null;let R=0;for(let V=0;V{S.send(u,m,R)},x=x||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(u=>{u.remove()}),this.actors=[],this.workerPool.release(this.id)}}function te(w,u,m){const x=function(S,R){if(S)return m(S);if(R){const L=a.pick(a.extend(R,w),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);R.vector_layers&&(L.vectorLayers=R.vector_layers,L.vectorLayerIds=L.vectorLayers.map(V=>V.id)),m(null,L)}};return w.url?a.getJSON(u.transformRequest(w.url,a.ResourceType.Source),x):a.exported.frame(()=>x(null,w))}Y.Actor=a.Actor;class Z{constructor(u,m,x){this.bounds=a.LngLatBounds.convert(this.validateBounds(u)),this.minzoom=m||0,this.maxzoom=x||24}validateBounds(u){return Array.isArray(u)&&u.length===4?[Math.max(-180,u[0]),Math.max(-90,u[1]),Math.min(180,u[2]),Math.min(90,u[3])]:[-180,-90,180,90]}contains(u){const m=Math.pow(2,u.z),x=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*m),S=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*m),R=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*m),L=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*m);return u.x>=x&&u.x=S&&u.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),u?this.fire(new a.ErrorEvent(u)):m&&(a.extend(this,m),m.bounds&&(this.tileBounds=new Z(m.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(u){return!this.tileBounds||this.tileBounds.contains(u.canonical)}onAdd(u){this.map=u,this.load()}setSourceProperty(u){this._tileJSONRequest&&this._tileJSONRequest.cancel(),u(),this.load()}setTiles(u){return this.setSourceProperty(()=>{this._options.tiles=u}),this}setUrl(u){return this.setSourceProperty(()=>{this.url=u,this._options.url=u}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}loadTile(u,m){const x=u.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),S={request:this.map._requestManager.transformRequest(x,a.ResourceType.Tile),uid:u.uid,tileID:u.tileID,zoom:u.tileID.overscaledZ,tileSize:this.tileSize*u.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function R(L,V){return delete u.request,u.aborted?m(null):L&&L.status!==404?m(L):(V&&V.resourceTiming&&(u.resourceTiming=V.resourceTiming),this.map._refreshExpiredTiles&&V&&u.setExpiryData(V),u.loadVectorData(V,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),m(null),void(u.reloadCallback&&(this.loadTile(u,u.reloadCallback),u.reloadCallback=null)))}S.request.collectResourceTiming=this._collectResourceTiming,u.actor&&u.state!=="expired"?u.state==="loading"?u.reloadCallback=m:u.request=u.actor.send("reloadTile",S,R.bind(this)):(u.actor=this.dispatcher.getActor(),u.request=u.actor.send("loadTile",S,R.bind(this)))}abortTile(u){u.request&&(u.request.cancel(),delete u.request),u.actor&&u.actor.send("abortTile",{uid:u.uid,type:this.type,source:this.id},void 0)}unloadTile(u){u.unloadVectorData(),u.actor&&u.actor.send("removeTile",{uid:u.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class J extends a.Evented{constructor(u,m,x,S){super(),this.id=u,this.dispatcher=x,this.setEventedParent(S),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},m),a.extend(this,a.pick(m,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=te(this._options,this.map._requestManager,(u,m)=>{this._tileJSONRequest=null,this._loaded=!0,u?this.fire(new a.ErrorEvent(u)):m&&(a.extend(this,m),m.bounds&&(this.tileBounds=new Z(m.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(u){this.map=u,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}hasTile(u){return!this.tileBounds||this.tileBounds.contains(u.canonical)}loadTile(u,m){const x=u.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);u.request=a.getImage(this.map._requestManager.transformRequest(x,a.ResourceType.Tile),(S,R,L)=>{if(delete u.request,u.aborted)u.state="unloaded",m(null);else if(S)u.state="errored",m(S);else if(R){this.map._refreshExpiredTiles&&u.setExpiryData(L);const V=this.map.painter.context,H=V.gl;u.texture=this.map.painter.getTileTexture(R.width),u.texture?u.texture.update(R,{useMipmap:!0}):(u.texture=new T(V,R,H.RGBA,{useMipmap:!0}),u.texture.bind(H.LINEAR,H.CLAMP_TO_EDGE,H.LINEAR_MIPMAP_NEAREST),V.extTextureFilterAnisotropic&&H.texParameterf(H.TEXTURE_2D,V.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,V.extTextureFilterAnisotropicMax)),u.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),m(null)}})}abortTile(u,m){u.request&&(u.request.cancel(),delete u.request),m()}unloadTile(u,m){u.texture&&this.map.painter.saveTileTexture(u.texture),m()}hasTransition(){return!1}}let ce;class re extends J{constructor(u,m,x,S){super(u,m,x,S),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},m),this.encoding=m.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(u,m){const x=u.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function S(R,L){R&&(u.state="errored",m(R)),L&&(u.dem=L,u.needsHillshadePrepare=!0,u.needsTerrainPrepare=!0,u.state="loaded",m(null))}u.request=a.getImage(this.map._requestManager.transformRequest(x,a.ResourceType.Tile),function(R,L){if(delete u.request,u.aborted)u.state="unloaded",m(null);else if(R)u.state="errored",m(R);else if(L){this.map._refreshExpiredTiles&&u.setExpiryData(L),delete L.cacheControl,delete L.expires;const V=a.isImageBitmap(L)&&(ce==null&&(ce=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ce)?L:a.exported.getImageData(L,1),H={uid:u.uid,coord:u.tileID,source:this.id,rawImageData:V,encoding:this.encoding};u.actor&&u.state!=="expired"||(u.actor=this.dispatcher.getActor(),u.actor.send("loadDEMTile",H,S.bind(this)))}}.bind(this)),u.neighboringTiles=this._getNeighboringTiles(u.tileID)}_getNeighboringTiles(u){const m=u.canonical,x=Math.pow(2,m.z),S=(m.x-1+x)%x,R=m.x===0?u.wrap-1:u.wrap,L=(m.x+1+x)%x,V=m.x+1===x?u.wrap+1:u.wrap,H={};return H[new a.OverscaledTileID(u.overscaledZ,R,m.z,S,m.y).key]={backfilled:!1},H[new a.OverscaledTileID(u.overscaledZ,V,m.z,L,m.y).key]={backfilled:!1},m.y>0&&(H[new a.OverscaledTileID(u.overscaledZ,R,m.z,S,m.y-1).key]={backfilled:!1},H[new a.OverscaledTileID(u.overscaledZ,u.wrap,m.z,m.x,m.y-1).key]={backfilled:!1},H[new a.OverscaledTileID(u.overscaledZ,V,m.z,L,m.y-1).key]={backfilled:!1}),m.y+1{if(this._pendingLoads--,this._removed||R&&R.abandoned)return void this.fire(new a.Event("dataabort",{dataType:"source",sourceDataType:u}));let L=null;if(R&&R.resourceTiming&&R.resourceTiming[this.id]&&(L=R.resourceTiming[this.id].slice(0)),S)return void this.fire(new a.ErrorEvent(S));const V={dataType:"source",sourceDataType:u};this._collectResourceTiming&&L&&L.length>0&&a.extend(V,{resourceTiming:L}),this.fire(new a.Event("data",V))})}loaded(){return this._pendingLoads===0}loadTile(u,m){const x=u.actor?"reloadTile":"loadTile";u.actor=this.actor;const S={type:this.type,uid:u.uid,tileID:u.tileID,zoom:u.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};u.request=this.actor.send(x,S,(R,L)=>(delete u.request,u.unloadVectorData(),u.aborted?m(null):R?m(R):(u.loadVectorData(L,this.map.painter,x==="reloadTile"),m(null))))}abortTile(u){u.request&&(u.request.cancel(),delete u.request),u.aborted=!0}unloadTile(u){u.unloadVectorData(),this.actor.send("removeTile",{uid:u.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var oe=a.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class he extends a.Evented{constructor(u,m,x,S){super(),this.id=u,this.dispatcher=x,this.coordinates=m.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(S),this.options=m}load(u,m){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(x,S)=>{this._loaded=!0,x?this.fire(new a.ErrorEvent(x)):S&&(this.image=S,u&&(this.coordinates=u),m&&m(),this._finishLoading())})}loaded(){return this._loaded}updateImage(u){return this.image&&u.url?(this.options.url=u.url,this.load(u.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(u){this.map=u,this.load()}setCoordinates(u){this.coordinates=u;const m=u.map(a.MercatorCoordinate.fromLngLat);this.tileID=function(S){let R=1/0,L=1/0,V=-1/0,H=-1/0;for(const pe of S)R=Math.min(R,pe.x),L=Math.min(L,pe.y),V=Math.max(V,pe.x),H=Math.max(H,pe.y);const G=Math.max(V-R,H-L),ne=Math.max(0,Math.floor(-Math.log(G)/Math.LN2)),le=Math.pow(2,ne);return new a.CanonicalTileID(ne,Math.floor((R+V)/2*le),Math.floor((L+H)/2*le))}(m),this.minzoom=this.maxzoom=this.tileID.z;const x=m.map(S=>this.tileID.getTilePoint(S)._round());return this._boundsArray=new a.RasterBoundsArray,this._boundsArray.emplaceBack(x[0].x,x[0].y,0,0),this._boundsArray.emplaceBack(x[1].x,x[1].y,a.EXTENT,0),this._boundsArray.emplaceBack(x[3].x,x[3].y,0,a.EXTENT),this._boundsArray.emplaceBack(x[2].x,x[2].y,a.EXTENT,a.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const u=this.map.painter.context,m=u.gl;this.boundsBuffer||(this.boundsBuffer=u.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new T(u,this.image,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));for(const x in this.tiles){const S=this.tiles[x];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture)}}loadTile(u,m){this.tileID&&this.tileID.equals(u.tileID.canonical)?(this.tiles[String(u.tileID.wrap)]=u,u.buckets={},m(null)):(u.state="errored",m(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Ce extends he{constructor(u,m,x,S){super(u,m,x,S),this.roundZoom=!0,this.type="video",this.options=m}load(){this._loaded=!1;const u=this.options;this.urls=[];for(const m of u.urls)this.urls.push(this.map._requestManager.transformRequest(m,a.ResourceType.Source).url);a.getVideo(this.urls,(m,x)=>{this._loaded=!0,m?this.fire(new a.ErrorEvent(m)):x&&(this.video=x,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(u){if(this.video){const m=this.video.seekable;um.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${m.start(0)} and ${m.end(0)}-second mark.`))):this.video.currentTime=u}}getVideo(){return this.video}onAdd(u){this.map||(this.map=u,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const u=this.map.painter.context,m=u.gl;this.boundsBuffer||(this.boundsBuffer=u.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE),m.texSubImage2D(m.TEXTURE_2D,0,0,0,m.RGBA,m.UNSIGNED_BYTE,this.video)):(this.texture=new T(u,this.video,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));for(const x in this.tiles){const S=this.tiles[x];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Se extends he{constructor(u,m,x,S){super(u,m,x,S),m.coordinates?Array.isArray(m.coordinates)&&m.coordinates.length===4&&!m.coordinates.some(R=>!Array.isArray(R)||R.length!==2||R.some(L=>typeof L!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${u}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${u}`,null,'missing required property "coordinates"'))),m.animate&&typeof m.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${u}`,null,'optional "animate" property must be a boolean value'))),m.canvas?typeof m.canvas=="string"||m.canvas instanceof HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${u}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${u}`,null,'missing required property "canvas"'))),this.options=m,this.animate=m.animate===void 0||m.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(u){this.map=u,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let u=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,u=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,u=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const m=this.map.painter.context,x=m.gl;this.boundsBuffer||(this.boundsBuffer=m.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(u||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new T(m,this.canvas,x.RGBA,{premultiply:!0});for(const S in this.tiles){const R=this.tiles[S];R.state!=="loaded"&&(R.state="loaded",R.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const u of[this.canvas.width,this.canvas.height])if(isNaN(u)||u<=0)return!0;return!1}}const be={vector:X,raster:J,"raster-dem":re,geojson:se,video:Ce,image:he,canvas:Se};function Re(w,u){const m=a.create();return a.translate(m,m,[1,1,0]),a.scale(m,m,[.5*w.width,.5*w.height,1]),a.multiply(m,m,w.calculatePosMatrix(u.toUnwrapped()))}function Ie(w,u,m,x,S,R){const L=function(le,pe,Te){if(le)for(const _e of le){const Ee=pe[_e];if(Ee&&Ee.source===Te&&Ee.type==="fill-extrusion")return!0}else for(const _e in pe){const Ee=pe[_e];if(Ee.source===Te&&Ee.type==="fill-extrusion")return!0}return!1}(S&&S.layers,u,w.id),V=R.maxPitchScaleFactor(),H=w.tilesIn(x,V,L);H.sort(Me);const G=[];for(const le of H)G.push({wrappedTileID:le.tileID.wrapped().key,queryResults:le.tile.queryRenderedFeatures(u,m,w._state,le.queryGeometry,le.cameraQueryGeometry,le.scale,S,R,V,Re(w.transform,le.tileID))});const ne=function(le){const pe={},Te={};for(const _e of le){const Ee=_e.queryResults,Be=_e.wrappedTileID,We=Te[Be]=Te[Be]||{};for(const rt in Ee){const De=Ee[rt],ft=We[rt]=We[rt]||{},st=pe[rt]=pe[rt]||[];for(const _t of De)ft[_t.featureIndex]||(ft[_t.featureIndex]=!0,st.push(_t))}}return pe}(G);for(const le in ne)ne[le].forEach(pe=>{const Te=pe.feature,_e=w.getFeatureState(Te.layer["source-layer"],Te.id);Te.source=Te.layer.source,Te.layer["source-layer"]&&(Te.sourceLayer=Te.layer["source-layer"]),Te.state=_e});return ne}function Me(w,u){const m=w.tileID,x=u.tileID;return m.overscaledZ-x.overscaledZ||m.canonical.y-x.canonical.y||m.wrap-x.wrap||m.canonical.x-x.canonical.x}class Ae{constructor(u,m){this.tileID=u,this.uid=a.uniqueId(),this.uses=0,this.tileSize=m,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(u){const m=u+this.timeAdded;mu.saveTileTexture(m)),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(u,m,x){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",u){u.featureIndex&&(this.latestFeatureIndex=u.featureIndex,u.rawTileData?(this.latestRawTileData=u.rawTileData,this.latestFeatureIndex.rawTileData=u.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=u.collisionBoxArray,this.buckets=function(S,R){const L={};if(!R)return L;for(const V of S){const H=V.layerIds.map(G=>R.getLayer(G)).filter(Boolean);if(H.length!==0){V.layers=H,V.stateDependentLayerIds&&(V.stateDependentLayers=V.stateDependentLayerIds.map(G=>H.filter(ne=>ne.id===G)[0]));for(const G of H)L[G.id]=V}}return L}(u.buckets,m.style),this.hasSymbolBuckets=!1;for(const S in this.buckets){const R=this.buckets[S];if(R instanceof a.SymbolBucket){if(this.hasSymbolBuckets=!0,!x)break;R.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const S in this.buckets){const R=this.buckets[S];if(R instanceof a.SymbolBucket&&R.hasRTLText){this.hasRTLText=!0,a.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const S in this.buckets){const R=this.buckets[S];this.queryPadding=Math.max(this.queryPadding,m.style.getLayer(S).queryRadius(R))}u.imageAtlas&&(this.imageAtlas=u.imageAtlas),u.glyphAtlasImage&&(this.glyphAtlasImage=u.glyphAtlasImage)}else this.collisionBoxArray=new a.CollisionBoxArray}unloadVectorData(){for(const u in this.buckets)this.buckets[u].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(u){return this.buckets[u.id]}upload(u){for(const x in this.buckets){const S=this.buckets[x];S.uploadPending()&&S.upload(u)}const m=u.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new T(u,this.imageAtlas.image,m.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new T(u,this.glyphAtlasImage,m.ALPHA),this.glyphAtlasImage=null)}prepare(u){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(u,this.imageAtlasTexture)}queryRenderedFeatures(u,m,x,S,R,L,V,H,G,ne){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:S,cameraQueryGeometry:R,scale:L,tileSize:this.tileSize,pixelPosMatrix:ne,transform:H,params:V,queryPadding:this.queryPadding*G},u,m,x):{}}querySourceFeatures(u,m){const x=this.latestFeatureIndex;if(!x||!x.rawTileData)return;const S=x.loadVTLayers(),R=m?m.sourceLayer:"",L=S._geojsonTileLayer||S[R];if(!L)return;const V=a.createFilter(m&&m.filter),{z:H,x:G,y:ne}=this.tileID.canonical,le={z:H,x:G,y:ne};for(let pe=0;pex)S=!1;else if(m)if(this.expirationTime{this.remove(u,R)},x)),this.data[S].push(R),this.order.push(S),this.order.length>this.max){const L=this._getAndRemoveByKey(this.order[0]);L&&this.onRemove(L)}return this}has(u){return u.wrapped().key in this.data}getAndRemove(u){return this.has(u)?this._getAndRemoveByKey(u.wrapped().key):null}_getAndRemoveByKey(u){const m=this.data[u].shift();return m.timeout&&clearTimeout(m.timeout),this.data[u].length===0&&delete this.data[u],this.order.splice(this.order.indexOf(u),1),m.value}getByKey(u){const m=this.data[u];return m?m[0].value:null}get(u){return this.has(u)?this.data[u.wrapped().key][0].value:null}remove(u,m){if(!this.has(u))return this;const x=u.wrapped().key,S=m===void 0?0:this.data[x].indexOf(m),R=this.data[x][S];return this.data[x].splice(S,1),R.timeout&&clearTimeout(R.timeout),this.data[x].length===0&&delete this.data[x],this.onRemove(R.value),this.order.splice(this.order.indexOf(x),1),this}setMaxSize(u){for(this.max=u;this.order.length>this.max;){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}filter(u){const m=[];for(const x in this.data)for(const S of this.data[x])u(S.value)||m.push(S);for(const x of m)this.remove(x.value.tileID,x)}}class Ke{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(u,m,x){const S=String(m);if(this.stateChanges[u]=this.stateChanges[u]||{},this.stateChanges[u][S]=this.stateChanges[u][S]||{},a.extend(this.stateChanges[u][S],x),this.deletedStates[u]===null){this.deletedStates[u]={};for(const R in this.state[u])R!==S&&(this.deletedStates[u][R]=null)}else if(this.deletedStates[u]&&this.deletedStates[u][S]===null){this.deletedStates[u][S]={};for(const R in this.state[u][S])x[R]||(this.deletedStates[u][S][R]=null)}else for(const R in x)this.deletedStates[u]&&this.deletedStates[u][S]&&this.deletedStates[u][S][R]===null&&delete this.deletedStates[u][S][R]}removeFeatureState(u,m,x){if(this.deletedStates[u]===null)return;const S=String(m);if(this.deletedStates[u]=this.deletedStates[u]||{},x&&m!==void 0)this.deletedStates[u][S]!==null&&(this.deletedStates[u][S]=this.deletedStates[u][S]||{},this.deletedStates[u][S][x]=null);else if(m!==void 0)if(this.stateChanges[u]&&this.stateChanges[u][S])for(x in this.deletedStates[u][S]={},this.stateChanges[u][S])this.deletedStates[u][S][x]=null;else this.deletedStates[u][S]=null;else this.deletedStates[u]=null}getState(u,m){const x=String(m),S=a.extend({},(this.state[u]||{})[x],(this.stateChanges[u]||{})[x]);if(this.deletedStates[u]===null)return{};if(this.deletedStates[u]){const R=this.deletedStates[u][m];if(R===null)return{};for(const L in R)delete S[L]}return S}initializeTileState(u,m){u.setFeatureState(this.state,m)}coalesceChanges(u,m){const x={};for(const S in this.stateChanges){this.state[S]=this.state[S]||{};const R={};for(const L in this.stateChanges[S])this.state[S][L]||(this.state[S][L]={}),a.extend(this.state[S][L],this.stateChanges[S][L]),R[L]=this.state[S][L];x[S]=R}for(const S in this.deletedStates){this.state[S]=this.state[S]||{};const R={};if(this.deletedStates[S]===null)for(const L in this.state[S])R[L]={},this.state[S][L]={};else for(const L in this.deletedStates[S]){if(this.deletedStates[S][L]===null)this.state[S][L]={};else for(const V of Object.keys(this.deletedStates[S][L]))delete this.state[S][L][V];R[L]=this.state[S][L]}x[S]=x[S]||{},a.extend(x[S],R)}if(this.stateChanges={},this.deletedStates={},Object.keys(x).length!==0)for(const S in u)u[S].setFeatureState(x,m)}}class Ue extends a.Evented{constructor(u,m,x){super(),this.id=u,this.dispatcher=x,this.on("data",S=>{S.dataType==="source"&&S.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&S.dataType==="source"&&S.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(S,R,L,V){const H=new be[R.type](S,R,L,V);if(H.id!==S)throw new Error(`Expected Source id to be ${S} instead of ${H.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],H),H}(u,m,x,this),this._tiles={},this._cache=new Fe(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ke}onAdd(u){this.map=u,this._maxTileCacheSize=u?u._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(u)}onRemove(u){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(u)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const u in this._tiles){const m=this._tiles[u];if(m.state!=="loaded"&&m.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const u=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,u&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(u,m){return this._source.loadTile(u,m)}_unloadTile(u){if(this._source.unloadTile)return this._source.unloadTile(u,()=>{})}_abortTile(u){this._source.abortTile&&this._source.abortTile(u,()=>{}),this._source.fire(new a.Event("dataabort",{tile:u,coord:u.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(u){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const m in this._tiles){const x=this._tiles[m];x.upload(u),x.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(u=>u.tileID).sort(pt).map(u=>u.key)}getRenderableIds(u){const m=[];for(const x in this._tiles)this._isIdRenderable(x,u)&&m.push(this._tiles[x]);return u?m.sort((x,S)=>{const R=x.tileID,L=S.tileID,V=new a.pointGeometry(R.canonical.x,R.canonical.y)._rotate(this.transform.angle),H=new a.pointGeometry(L.canonical.x,L.canonical.y)._rotate(this.transform.angle);return R.overscaledZ-L.overscaledZ||H.y-V.y||H.x-V.x}).map(x=>x.tileID.key):m.map(x=>x.tileID).sort(pt).map(x=>x.key)}hasRenderableParent(u){const m=this.findLoadedParent(u,0);return!!m&&this._isIdRenderable(m.tileID.key)}_isIdRenderable(u,m){return this._tiles[u]&&this._tiles[u].hasData()&&!this._coveredTiles[u]&&(m||!this._tiles[u].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const u in this._tiles)this._tiles[u].state!=="errored"&&this._reloadTile(u,"reloading")}}_reloadTile(u,m){const x=this._tiles[u];x&&(x.state!=="loading"&&(x.state=m),this._loadTile(x,this._tileLoaded.bind(this,x,u,m)))}_tileLoaded(u,m,x,S){if(S)return u.state="errored",void(S.status!==404?this._source.fire(new a.ErrorEvent(S,{tile:u})):this.update(this.transform,this.terrain));u.timeAdded=a.exported.now(),x==="expired"&&(u.refreshedUponExpiration=!0),this._setTileReloadTimer(m,u),this.getSource().type==="raster-dem"&&u.dem&&this._backfillDEM(u),this._state.initializeTileState(u,this.map?this.map.painter:null),u.aborted||this._source.fire(new a.Event("data",{dataType:"source",tile:u,coord:u.tileID}))}_backfillDEM(u){const m=this.getRenderableIds();for(let S=0;S1||(Math.abs(L)>1&&(Math.abs(L+H)===1?L+=H:Math.abs(L-H)===1&&(L-=H)),R.dem&&S.dem&&(S.dem.backfillBorder(R.dem,L,V),S.neighboringTiles&&S.neighboringTiles[G]&&(S.neighboringTiles[G].backfilled=!0)))}}getTile(u){return this.getTileByID(u.key)}getTileByID(u){return this._tiles[u]}_retainLoadedChildren(u,m,x,S){for(const R in this._tiles){let L=this._tiles[R];if(S[R]||!L.hasData()||L.tileID.overscaledZ<=m||L.tileID.overscaledZ>x)continue;let V=L.tileID;for(;L&&L.tileID.overscaledZ>m+1;){const G=L.tileID.scaledTo(L.tileID.overscaledZ-1);L=this._tiles[G.key],L&&L.hasData()&&(V=G)}let H=V;for(;H.overscaledZ>m;)if(H=H.scaledTo(H.overscaledZ-1),u[H.key]){S[V.key]=V;break}}}findLoadedParent(u,m){if(u.key in this._loadedParentTiles){const x=this._loadedParentTiles[u.key];return x&&x.tileID.overscaledZ>=m?x:null}for(let x=u.overscaledZ-1;x>=m;x--){const S=u.scaledTo(x),R=this._getLoadedTile(S);if(R)return R}}_getLoadedTile(u){const m=this._tiles[u.key];return m&&m.hasData()?m:this._cache.getByKey(u.wrapped().key)}updateCacheSize(u){const m=Math.ceil(u.width/this._source.tileSize)+1,x=Math.ceil(u.height/this._source.tileSize)+1,S=Math.floor(m*x*5),R=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,S):S;this._cache.setMaxSize(R)}handleWrapJump(u){const m=Math.round((u-(this._prevLng===void 0?u:this._prevLng))/360);if(this._prevLng=u,m){const x={};for(const S in this._tiles){const R=this._tiles[S];R.tileID=R.tileID.unwrapTo(R.tileID.wrap+m),x[R.tileID.key]=R}this._tiles=x;for(const S in this._timers)clearTimeout(this._timers[S]),delete this._timers[S];for(const S in this._tiles)this._setTileReloadTimer(S,this._tiles[S])}}update(u,m){if(this.transform=u,this.terrain=m,!this._sourceLoaded||this._paused)return;let x;this.updateCacheSize(u),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?x=u.getVisibleUnwrappedCoordinates(this._source.tileID).map(G=>new a.OverscaledTileID(G.canonical.z,G.wrap,G.canonical.z,G.canonical.x,G.canonical.y)):(x=u.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:m}),this._source.hasTile&&(x=x.filter(G=>this._source.hasTile(G)))):x=[];const S=u.coveringZoomLevel(this._source),R=Math.max(S-Ue.maxOverzooming,this._source.minzoom),L=Math.max(S+Ue.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const G={};for(const ne of x)if(ne.canonical.z>this._source.minzoom){const le=ne.scaledTo(ne.canonical.z-1);G[le.key]=le;const pe=ne.scaledTo(Math.max(this._source.minzoom,Math.min(ne.canonical.z,5)));G[pe.key]=pe}x=x.concat(Object.values(G))}const V=this._updateRetainedTiles(x,S);if(gt(this._source.type)){const G={},ne={},le=Object.keys(V);for(const pe of le){const Te=V[pe],_e=this._tiles[pe];if(!_e||_e.fadeEndTime&&_e.fadeEndTime<=a.exported.now())continue;const Ee=this.findLoadedParent(Te,R);Ee&&(this._addTile(Ee.tileID),G[Ee.tileID.key]=Ee.tileID),ne[pe]=Te}this._retainLoadedChildren(ne,S,L,V);for(const pe in G)V[pe]||(this._coveredTiles[pe]=!0,V[pe]=G[pe]);if(m){const pe={},Te={};for(const _e of x)this._tiles[_e.key].hasData()?pe[_e.key]=_e:Te[_e.key]=_e;for(const _e in Te){const Ee=Te[_e].children(this._source.maxzoom);this._tiles[Ee[0].key]&&this._tiles[Ee[1].key]&&this._tiles[Ee[2].key]&&this._tiles[Ee[3].key]&&(pe[Ee[0].key]=V[Ee[0].key]=Ee[0],pe[Ee[1].key]=V[Ee[1].key]=Ee[1],pe[Ee[2].key]=V[Ee[2].key]=Ee[2],pe[Ee[3].key]=V[Ee[3].key]=Ee[3],delete Te[_e])}for(const _e in Te){const Ee=this.findLoadedParent(Te[_e],this._source.minzoom);if(Ee){pe[Ee.tileID.key]=V[Ee.tileID.key]=Ee.tileID;for(const Be in pe)pe[Be].isChildOf(Ee.tileID)&&delete pe[Be]}}for(const _e in this._tiles)pe[_e]||(this._coveredTiles[_e]=!0)}}for(const G in V)this._tiles[G].clearFadeHold();const H=a.keysDifference(this._tiles,V);for(const G of H){const ne=this._tiles[G];ne.hasSymbolBuckets&&!ne.holdingForFade()?ne.setHoldDuration(this.map._fadeDuration):ne.hasSymbolBuckets&&!ne.symbolFadeFinished()||this._removeTile(G)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const u in this._tiles)this._tiles[u].holdingForFade()&&this._removeTile(u)}_updateRetainedTiles(u,m){const x={},S={},R=Math.max(m-Ue.maxOverzooming,this._source.minzoom),L=Math.max(m+Ue.maxUnderzooming,this._source.minzoom),V={};for(const H of u){const G=this._addTile(H);x[H.key]=H,G.hasData()||mthis._source.maxzoom){const le=H.children(this._source.maxzoom)[0],pe=this.getTile(le);if(pe&&pe.hasData()){x[le.key]=le;continue}}else{const le=H.children(this._source.maxzoom);if(x[le[0].key]&&x[le[1].key]&&x[le[2].key]&&x[le[3].key])continue}let ne=G.wasRequested();for(let le=H.overscaledZ-1;le>=R;--le){const pe=H.scaledTo(le);if(S[pe.key]||(S[pe.key]=!0,G=this.getTile(pe),!G&&ne&&(G=this._addTile(pe)),G&&(x[pe.key]=pe,ne=G.wasRequested(),G.hasData())))break}}return x}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const u in this._tiles){const m=[];let x,S=this._tiles[u].tileID;for(;S.overscaledZ>0;){if(S.key in this._loadedParentTiles){x=this._loadedParentTiles[S.key];break}m.push(S.key);const R=S.scaledTo(S.overscaledZ-1);if(x=this._getLoadedTile(R),x)break;S=R}for(const R of m)this._loadedParentTiles[R]=x}}_addTile(u){let m=this._tiles[u.key];if(m)return m;m=this._cache.getAndRemove(u),m&&(this._setTileReloadTimer(u.key,m),m.tileID=u,this._state.initializeTileState(m,this.map?this.map.painter:null),this._cacheTimers[u.key]&&(clearTimeout(this._cacheTimers[u.key]),delete this._cacheTimers[u.key],this._setTileReloadTimer(u.key,m)));const x=m;return m||(m=new Ae(u,this._source.tileSize*u.overscaleFactor()),this._loadTile(m,this._tileLoaded.bind(this,m,u.key,m.state))),m.uses++,this._tiles[u.key]=m,x||this._source.fire(new a.Event("dataloading",{tile:m,coord:m.tileID,dataType:"source"})),m}_setTileReloadTimer(u,m){u in this._timers&&(clearTimeout(this._timers[u]),delete this._timers[u]);const x=m.getExpiryTimeout();x&&(this._timers[u]=setTimeout(()=>{this._reloadTile(u,"expired"),delete this._timers[u]},x))}_removeTile(u){const m=this._tiles[u];m&&(m.uses--,delete this._tiles[u],this._timers[u]&&(clearTimeout(this._timers[u]),delete this._timers[u]),m.uses>0||(m.hasData()&&m.state!=="reloading"?this._cache.add(m.tileID,m,m.getExpiryTimeout()):(m.aborted=!0,this._abortTile(m),this._unloadTile(m))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const u in this._tiles)this._removeTile(u);this._cache.reset()}tilesIn(u,m,x){const S=[],R=this.transform;if(!R)return S;const L=x?R.getCameraQueryGeometry(u):u,V=u.map(_e=>R.pointCoordinate(_e,this.terrain)),H=L.map(_e=>R.pointCoordinate(_e,this.terrain)),G=this.getIds();let ne=1/0,le=1/0,pe=-1/0,Te=-1/0;for(const _e of H)ne=Math.min(ne,_e.x),le=Math.min(le,_e.y),pe=Math.max(pe,_e.x),Te=Math.max(Te,_e.y);for(let _e=0;_e=0&&De[1].y+rt>=0){const ft=V.map(_t=>Be.getTilePoint(_t)),st=H.map(_t=>Be.getTilePoint(_t));S.push({tile:Ee,tileID:Be,queryGeometry:ft,cameraQueryGeometry:st,scale:We})}}return S}getVisibleCoordinates(u){const m=this.getRenderableIds(u).map(x=>this._tiles[x].tileID);for(const x of m)x.posMatrix=this.transform.calculatePosMatrix(x.toUnwrapped());return m}hasTransition(){if(this._source.hasTransition())return!0;if(gt(this._source.type))for(const u in this._tiles){const m=this._tiles[u];if(m.fadeEndTime!==void 0&&m.fadeEndTime>=a.exported.now())return!0}return!1}setFeatureState(u,m,x){this._state.updateState(u=u||"_geojsonTileLayer",m,x)}removeFeatureState(u,m,x){this._state.removeFeatureState(u=u||"_geojsonTileLayer",m,x)}getFeatureState(u,m){return this._state.getState(u=u||"_geojsonTileLayer",m)}setDependencies(u,m,x){const S=this._tiles[u];S&&S.setDependencies(m,x)}reloadTilesForDependencies(u,m){for(const x in this._tiles)this._tiles[x].hasDependency(u,m)&&this._reloadTile(x,"reloading");this._cache.filter(x=>!x.hasDependency(u,m))}}function pt(w,u){const m=Math.abs(2*w.wrap)-+(w.wrap<0),x=Math.abs(2*u.wrap)-+(u.wrap<0);return w.overscaledZ-u.overscaledZ||x-m||u.canonical.y-w.canonical.y||u.canonical.x-w.canonical.x}function gt(w){return w==="raster"||w==="image"||w==="video"}Ue.maxOverzooming=10,Ue.maxUnderzooming=3;const Dt="mapboxgl_preloaded_worker_pool";class qe{constructor(){this.active={}}acquire(u){if(!this.workers)for(this.workers=[];this.workers.length{m.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Dt]}numActive(){return Object.keys(this.active).length}}const Ct=Math.floor(a.exported.hardwareConcurrency/2);let ot;function vt(){return ot||(ot=new qe),ot}function yt(w,u){const m={};for(const x in w)x!=="ref"&&(m[x]=w[x]);return a.refProperties.forEach(x=>{x in u&&(m[x]=u[x])}),m}function Tt(w){w=w.slice();const u=Object.create(null);for(let m=0;m0?(S-L)/V:0;return this.points[R].mult(1-H).add(this.points[m].mult(H))}}function ze(w,u){let m=!0;return w==="always"||w!=="never"&&u!=="never"||(m=!1),m}class Ye{constructor(u,m,x){const S=this.boxCells=[],R=this.circleCells=[];this.xCellCount=Math.ceil(u/x),this.yCellCount=Math.ceil(m/x);for(let L=0;Lthis.width||S<0||m>this.height)return[];const H=[];if(u<=0&&m<=0&&this.width<=x&&this.height<=S){if(R)return[{key:null,x1:u,y1:m,x2:x,y2:S}];for(let G=0;G0}hitTestCircle(u,m,x,S,R){const L=u-x,V=u+x,H=m-x,G=m+x;if(V<0||L>this.width||G<0||H>this.height)return!1;const ne=[];return this._forEachCell(L,H,V,G,this._queryCellCircle,ne,{hitTest:!0,overlapMode:S,circle:{x:u,y:m,radius:x},seenUids:{box:{},circle:{}}},R),ne.length>0}_queryCell(u,m,x,S,R,L,V,H){const{seenUids:G,hitTest:ne,overlapMode:le}=V,pe=this.boxCells[R];if(pe!==null){const _e=this.bboxes;for(const Ee of pe)if(!G.box[Ee]){G.box[Ee]=!0;const Be=4*Ee,We=this.boxKeys[Ee];if(u<=_e[Be+2]&&m<=_e[Be+3]&&x>=_e[Be+0]&&S>=_e[Be+1]&&(!H||H(We))&&(!ne||!ze(le,We.overlapMode))&&(L.push({key:We,x1:_e[Be],y1:_e[Be+1],x2:_e[Be+2],y2:_e[Be+3]}),ne))return!0}}const Te=this.circleCells[R];if(Te!==null){const _e=this.circles;for(const Ee of Te)if(!G.circle[Ee]){G.circle[Ee]=!0;const Be=3*Ee,We=this.circleKeys[Ee];if(this._circleAndRectCollide(_e[Be],_e[Be+1],_e[Be+2],u,m,x,S)&&(!H||H(We))&&(!ne||!ze(le,We.overlapMode))){const rt=_e[Be],De=_e[Be+1],ft=_e[Be+2];if(L.push({key:We,x1:rt-ft,y1:De-ft,x2:rt+ft,y2:De+ft}),ne)return!0}}}return!1}_queryCellCircle(u,m,x,S,R,L,V,H){const{circle:G,seenUids:ne,overlapMode:le}=V,pe=this.boxCells[R];if(pe!==null){const _e=this.bboxes;for(const Ee of pe)if(!ne.box[Ee]){ne.box[Ee]=!0;const Be=4*Ee,We=this.boxKeys[Ee];if(this._circleAndRectCollide(G.x,G.y,G.radius,_e[Be+0],_e[Be+1],_e[Be+2],_e[Be+3])&&(!H||H(We))&&!ze(le,We.overlapMode))return L.push(!0),!0}}const Te=this.circleCells[R];if(Te!==null){const _e=this.circles;for(const Ee of Te)if(!ne.circle[Ee]){ne.circle[Ee]=!0;const Be=3*Ee,We=this.circleKeys[Ee];if(this._circlesCollide(_e[Be],_e[Be+1],_e[Be+2],G.x,G.y,G.radius)&&(!H||H(We))&&!ze(le,We.overlapMode))return L.push(!0),!0}}}_forEachCell(u,m,x,S,R,L,V,H){const G=this._convertToXCellCoord(u),ne=this._convertToYCellCoord(m),le=this._convertToXCellCoord(x),pe=this._convertToYCellCoord(S);for(let Te=G;Te<=le;Te++)for(let _e=ne;_e<=pe;_e++)if(R.call(this,u,m,x,S,this.xCellCount*_e+Te,L,V,H))return}_convertToXCellCoord(u){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(u*this.xScale)))}_convertToYCellCoord(u){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(u*this.yScale)))}_circlesCollide(u,m,x,S,R,L){const V=S-u,H=R-m,G=x+L;return G*G>V*V+H*H}_circleAndRectCollide(u,m,x,S,R,L,V){const H=(L-S)/2,G=Math.abs(u-(S+H));if(G>H+x)return!1;const ne=(V-R)/2,le=Math.abs(m-(R+ne));if(le>ne+x)return!1;if(G<=H||le<=ne)return!0;const pe=G-H,Te=le-ne;return pe*pe+Te*Te<=x*x}}function Zt(w,u,m,x,S){const R=a.create();return u?(a.scale(R,R,[1/S,1/S,1]),m||a.rotateZ(R,R,x.angle)):a.multiply(R,x.labelPlaneMatrix,w),R}function an(w,u,m,x,S){if(u){const R=a.clone(w);return a.scale(R,R,[S,S,1]),m||a.rotateZ(R,R,-x.angle),R}return x.glCoordMatrix}function Kt(w,u,m){let x;m?(x=[w.x,w.y,m(w.x,w.y),1],a.transformMat4(x,x,u)):(x=[w.x,w.y,0,1],Pn(x,x,u));const S=x[3];return{point:new a.pointGeometry(x[0]/S,x[1]/S),signedDistanceFromCamera:S}}function Vt(w,u){return .5+w/u*.5}function It(w,u){const m=w[0]/w[3],x=w[1]/w[3];return m>=-u[0]&&m<=u[0]&&x>=-u[1]&&x<=u[1]}function Xt(w,u,m,x,S,R,L,V,H,G){const ne=x?w.textSizeData:w.iconSizeData,le=a.evaluateSizeForZoom(ne,m.transform.zoom),pe=[256/m.width*2+1,256/m.height*2+1],Te=x?w.text.dynamicLayoutVertexArray:w.icon.dynamicLayoutVertexArray;Te.clear();const _e=w.lineVertexArray,Ee=x?w.text.placedSymbolArray:w.icon.placedSymbolArray,Be=m.transform.width/m.transform.height;let We=!1;for(let rt=0;rtMath.abs(m.x-u.x)*x?{useVertical:!0}:(w===a.WritingMode.vertical?u.ym.x)?{needsFlipping:!0}:null}function At(w,u,m,x,S,R,L,V,H,G,ne,le,pe,Te,_e,Ee){const Be=u/24,We=w.lineOffsetX*Be,rt=w.lineOffsetY*Be;let De;if(w.numGlyphs>1){const ft=w.glyphStartIndex+w.numGlyphs,st=w.lineStartIndex,_t=w.lineStartIndex+w.lineLength,wt=pn(Be,V,We,rt,m,ne,le,w,H,R,pe,_e,Ee);if(!wt)return{notEnoughRoom:!0};const Ut=Kt(wt.first.point,L,Ee).point,xt=Kt(wt.last.point,L,Ee).point;if(x&&!m){const cn=tt(w.writingMode,Ut,xt,Te);if(cn)return cn}De=[wt.first];for(let cn=w.glyphStartIndex+1;cn0?Ut.point:qt(le,wt,st,1,S,Ee),cn=tt(w.writingMode,st,xt,Te);if(cn)return cn}const ft=En(Be*V.getoffsetX(w.glyphStartIndex),We,rt,m,ne,le,w.segment,w.lineStartIndex,w.lineStartIndex+w.lineLength,H,R,pe,_e,Ee);if(!ft)return{notEnoughRoom:!0};De=[ft]}for(const ft of De)a.addDynamicAttributes(G,ft.point,ft.angle);return{}}function qt(w,u,m,x,S,R){const L=Kt(w.add(w.sub(u)._unit()),S,R).point,V=m.sub(L);return m.add(V._mult(x/V.mag()))}function En(w,u,m,x,S,R,L,V,H,G,ne,le,pe,Te){const _e=x?w-u:w+u;let Ee=_e>0?1:-1,Be=0;x&&(Ee*=-1,Be=Math.PI),Ee<0&&(Be+=Math.PI);let We=Ee>0?V+L:V+L+1,rt=S,De=S,ft=0,st=0;const _t=Math.abs(_e),wt=[];for(;ft+st<=_t;){if(We+=Ee,We=H)return null;if(De=rt,wt.push(rt),rt=le[We],rt===void 0){const fn=new a.pointGeometry(G.getx(We),G.gety(We)),$n=Kt(fn,ne,Te);if($n.signedDistanceFromCamera>0)rt=le[We]=$n.point;else{const Hn=We-Ee;rt=qt(ft===0?R:new a.pointGeometry(G.getx(Hn),G.gety(Hn)),fn,De,_t-ft+1,ne,Te)}}ft+=st,st=De.dist(rt)}const Ut=(_t-ft)/st,xt=rt.sub(De),cn=xt.mult(Ut)._add(De);cn._add(xt._unit()._perp()._mult(m*Ee));const Jt=Be+Math.atan2(rt.y-De.y,rt.x-De.x);return wt.push(cn),{point:cn,angle:pe?Jt:0,path:wt}}const yn=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function St(w,u){for(let m=0;m=1;ir--)Tn.push($n.path[ir]);for(let ir=1;irKt(ar,H,_e));Tn=ir.some(ar=>ar.signedDistanceFromCamera<=0)?[]:ir.map(ar=>ar.point)}let gr=[];if(Tn.length>0){const ir=Tn[0].clone(),ar=Tn[0].clone();for(let br=1;br=cn.x&&ar.x<=Jt.x&&ir.y>=cn.y&&ar.y<=Jt.y?[Tn]:ar.xJt.x||ar.yJt.y?[]:a.clipLine([Tn],cn.x,cn.y,Jt.x,Jt.y)}for(const ir of gr){fn.reset(ir,.25*xt);let ar=0;ar=fn.length<=.5*xt?1:Math.ceil(fn.paddedLength/mr)+1;for(let br=0;br=this.screenRightBoundary||S<_n||m>this.screenBottomBoundary}isInsideGrid(u,m,x,S){return x>=0&&u=0&&mx.collisionGroupID===m}}return this.collisionGroups[u]}}function Qn(w,u,m,x,S){const{horizontalAlign:R,verticalAlign:L}=a.getAnchorAlignment(w),V=-(R-.5)*u,H=-(L-.5)*m,G=a.evaluateVariableOffset(w,x);return new a.pointGeometry(V+G[0]*S,H+G[1]*S)}function Jn(w,u,m,x,S,R){const{x1:L,x2:V,y1:H,y2:G,anchorPointX:ne,anchorPointY:le}=w,pe=new a.pointGeometry(u,m);return x&&pe._rotate(S?R:-R),{x1:L+pe.x,y1:H+pe.y,x2:V+pe.x,y2:G+pe.y,anchorPointX:ne,anchorPointY:le}}class ye{constructor(u,m,x,S,R){this.transform=u.clone(),this.terrain=m,this.collisionIndex=new tn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=x,this.retainedQueryData={},this.collisionGroups=new An(S),this.collisionCircleArrays={},this.prevPlacement=R,R&&(R.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(u,m,x,S){const R=x.getBucket(m),L=x.latestFeatureIndex;if(!R||!L||m.id!==R.layerIds[0])return;const V=x.collisionBoxArray,H=R.layers[0].layout,G=Math.pow(2,this.transform.zoom-x.tileID.overscaledZ),ne=x.tileSize/a.EXTENT,le=this.transform.calculatePosMatrix(x.tileID.toUnwrapped()),pe=H.get("text-pitch-alignment")==="map",Te=H.get("text-rotation-alignment")==="map",_e=zt(x,1,this.transform.zoom),Ee=Zt(le,pe,Te,this.transform,_e);let Be=null;if(pe){const rt=an(le,pe,Te,this.transform,_e);Be=a.multiply([],this.transform.labelPlaneMatrix,rt)}this.retainedQueryData[R.bucketInstanceId]=new mn(R.bucketInstanceId,L,R.sourceLayerIndex,R.index,x.tileID);const We={bucket:R,layout:H,posMatrix:le,textLabelPlaneMatrix:Ee,labelToScreenMatrix:Be,scale:G,textPixelRatio:ne,holdingForFade:x.holdingForFade(),collisionBoxArray:V,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(R.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(R.sourceID)};if(S)for(const rt of R.sortKeyRanges){const{sortKey:De,symbolInstanceStart:ft,symbolInstanceEnd:st}=rt;u.push({sortKey:De,symbolInstanceStart:ft,symbolInstanceEnd:st,parameters:We})}else u.push({symbolInstanceStart:0,symbolInstanceEnd:R.symbolInstances.length,parameters:We})}attemptAnchorPlacement(u,m,x,S,R,L,V,H,G,ne,le,pe,Te,_e,Ee,Be){const We=[pe.textOffset0,pe.textOffset1],rt=Qn(u,x,S,We,R),De=this.collisionIndex.placeCollisionBox(Jn(m,rt.x,rt.y,L,V,this.transform.angle),le,H,G,ne.predicate,Be);if((!Ee||this.collisionIndex.placeCollisionBox(Jn(Ee,rt.x,rt.y,L,V,this.transform.angle),le,H,G,ne.predicate,Be).box.length!==0)&&De.box.length>0){let ft;if(this.prevPlacement&&this.prevPlacement.variableOffsets[pe.crossTileID]&&this.prevPlacement.placements[pe.crossTileID]&&this.prevPlacement.placements[pe.crossTileID].text&&(ft=this.prevPlacement.variableOffsets[pe.crossTileID].anchor),pe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[pe.crossTileID]={textOffset:We,width:x,height:S,anchor:u,textBoxScale:R,prevAnchor:ft},this.markUsedJustification(Te,u,pe,_e),Te.allowVerticalPlacement&&(this.markUsedOrientation(Te,_e,pe),this.placedOrientations[pe.crossTileID]=_e),{shift:rt,placedGlyphBoxes:De}}}placeLayerBucketPart(u,m,x){const{bucket:S,layout:R,posMatrix:L,textLabelPlaneMatrix:V,labelToScreenMatrix:H,textPixelRatio:G,holdingForFade:ne,collisionBoxArray:le,partiallyEvaluatedTextSize:pe,collisionGroup:Te}=u.parameters,_e=R.get("text-optional"),Ee=R.get("icon-optional"),Be=a.getOverlapMode(R,"text-overlap","text-allow-overlap"),We=Be==="always",rt=a.getOverlapMode(R,"icon-overlap","icon-allow-overlap"),De=rt==="always",ft=R.get("text-rotation-alignment")==="map",st=R.get("text-pitch-alignment")==="map",_t=R.get("icon-text-fit")!=="none",wt=R.get("symbol-z-order")==="viewport-y",Ut=We&&(De||!S.hasIconData()||Ee),xt=De&&(We||!S.hasTextData()||_e);!S.collisionArrays&&le&&S.deserializeCollisionBoxes(le);const cn=(Jt,fn)=>{if(m[Jt.crossTileID])return;if(ne)return void(this.placements[Jt.crossTileID]=new $t(!1,!1,!1));let $n=!1,Hn=!1,Tn=!0,mr=null,gr={box:null,offscreen:null},ir={box:null,offscreen:null},ar=null,br=null,Ti=null,Fa=0,la=0,za=0;fn.textFeatureIndex?Fa=fn.textFeatureIndex:Jt.useRuntimeCollisionCircles&&(Fa=Jt.featureIndex),fn.verticalTextFeatureIndex&&(la=fn.verticalTextFeatureIndex);const Vs=this.retainedQueryData[S.bucketInstanceId].tileID,Wo=this.terrain?(yi,Zn)=>this.terrain.getElevation(Vs,yi,Zn):null;for(const yi of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const Zn=fn[yi];Zn&&(Zn.elevation=Wo?Wo(Zn.anchorPointX,Zn.anchorPointY):0)}const vo=fn.textBox;if(vo){const yi=pr=>{let Ii=a.WritingMode.horizontal;if(S.allowVerticalPlacement&&!pr&&this.prevPlacement){const ki=this.prevPlacement.placedOrientations[Jt.crossTileID];ki&&(this.placedOrientations[Jt.crossTileID]=ki,Ii=ki,this.markUsedOrientation(S,Ii,Jt))}return Ii},Zn=(pr,Ii)=>{if(S.allowVerticalPlacement&&Jt.numVerticalGlyphVertices>0&&fn.verticalTextBox){for(const ki of S.writingModes)if(ki===a.WritingMode.vertical?(gr=Ii(),ir=gr):gr=pr(),gr&&gr.box&&gr.box.length)break}else gr=pr()};if(R.get("text-variable-anchor")){let pr=R.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Jt.crossTileID]){const Vr=this.prevPlacement.variableOffsets[Jt.crossTileID];pr.indexOf(Vr.anchor)>0&&(pr=pr.filter(Go=>Go!==Vr.anchor),pr.unshift(Vr.anchor))}const Ii=(Vr,Go,gl)=>{const Tp=Vr.x2-Vr.x1,hu=Vr.y2-Vr.y1,py=Jt.textBoxScale,Ip=_t&&rt==="never"?Go:null;let Us={box:[],offscreen:!1};const vl=Be!=="never"?2*pr.length:pr.length;for(let yl=0;yl=pr.length?Be:"never",Jt,S,gl,Ip,Wo);if(df&&(Us=df.placedGlyphBoxes,Us&&Us.box&&Us.box.length)){$n=!0,mr=df.shift;break}}return Us};Zn(()=>Ii(vo,fn.iconBox,a.WritingMode.horizontal),()=>{const Vr=fn.verticalTextBox;return S.allowVerticalPlacement&&!(gr&&gr.box&&gr.box.length)&&Jt.numVerticalGlyphVertices>0&&Vr?Ii(Vr,fn.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null}}),gr&&($n=gr.box,Tn=gr.offscreen);const ki=yi(gr&&gr.box);if(!$n&&this.prevPlacement){const Vr=this.prevPlacement.variableOffsets[Jt.crossTileID];Vr&&(this.variableOffsets[Jt.crossTileID]=Vr,this.markUsedJustification(S,Vr.anchor,Jt,ki))}}else{const pr=(Ii,ki)=>{const Vr=this.collisionIndex.placeCollisionBox(Ii,Be,G,L,Te.predicate,Wo);return Vr&&Vr.box&&Vr.box.length&&(this.markUsedOrientation(S,ki,Jt),this.placedOrientations[Jt.crossTileID]=ki),Vr};Zn(()=>pr(vo,a.WritingMode.horizontal),()=>{const Ii=fn.verticalTextBox;return S.allowVerticalPlacement&&Jt.numVerticalGlyphVertices>0&&Ii?pr(Ii,a.WritingMode.vertical):{box:null,offscreen:null}}),yi(gr&&gr.box&&gr.box.length)}}if(ar=gr,$n=ar&&ar.box&&ar.box.length>0,Tn=ar&&ar.offscreen,Jt.useRuntimeCollisionCircles){const yi=S.text.placedSymbolArray.get(Jt.centerJustifiedTextSymbolIndex),Zn=a.evaluateSizeForFeature(S.textSizeData,pe,yi),pr=R.get("text-padding");br=this.collisionIndex.placeCollisionCircles(Be,yi,S.lineVertexArray,S.glyphOffsetArray,Zn,L,V,H,x,st,Te.predicate,Jt.collisionCircleDiameter,pr,Wo),br.circles.length&&br.collisionDetected&&!x&&a.warnOnce("Collisions detected, but collision boxes are not shown"),$n=We||br.circles.length>0&&!br.collisionDetected,Tn=Tn&&br.offscreen}if(fn.iconFeatureIndex&&(za=fn.iconFeatureIndex),fn.iconBox){const yi=Zn=>{const pr=_t&&mr?Jn(Zn,mr.x,mr.y,ft,st,this.transform.angle):Zn;return this.collisionIndex.placeCollisionBox(pr,rt,G,L,Te.predicate,Wo)};ir&&ir.box&&ir.box.length&&fn.verticalIconBox?(Ti=yi(fn.verticalIconBox),Hn=Ti.box.length>0):(Ti=yi(fn.iconBox),Hn=Ti.box.length>0),Tn=Tn&&Ti.offscreen}const hs=_e||Jt.numHorizontalGlyphVertices===0&&Jt.numVerticalGlyphVertices===0,cf=Ee||Jt.numIconVertices===0;if(hs||cf?cf?hs||(Hn=Hn&&$n):$n=Hn&&$n:Hn=$n=Hn&&$n,$n&&ar&&ar.box&&this.collisionIndex.insertCollisionBox(ar.box,Be,R.get("text-ignore-placement"),S.bucketInstanceId,ir&&ir.box&&la?la:Fa,Te.ID),Hn&&Ti&&this.collisionIndex.insertCollisionBox(Ti.box,rt,R.get("icon-ignore-placement"),S.bucketInstanceId,za,Te.ID),br&&($n&&this.collisionIndex.insertCollisionCircles(br.circles,Be,R.get("text-ignore-placement"),S.bucketInstanceId,Fa,Te.ID),x)){const yi=S.bucketInstanceId;let Zn=this.collisionCircleArrays[yi];Zn===void 0&&(Zn=this.collisionCircleArrays[yi]=new Wt);for(let pr=0;pr=0;--fn){const $n=Jt[fn];cn(S.symbolInstances.get($n),S.collisionArrays[$n])}}else for(let Jt=u.symbolInstanceStart;Jt=0&&(u.text.placedSymbolArray.get(V).crossTileID=R>=0&&V!==R?0:x.crossTileID)}markUsedOrientation(u,m,x){const S=m===a.WritingMode.horizontal||m===a.WritingMode.horizontalOnly?m:0,R=m===a.WritingMode.vertical?m:0,L=[x.leftJustifiedTextSymbolIndex,x.centerJustifiedTextSymbolIndex,x.rightJustifiedTextSymbolIndex];for(const V of L)u.text.placedSymbolArray.get(V).placedOrientation=S;x.verticalPlacedTextSymbolIndex&&(u.text.placedSymbolArray.get(x.verticalPlacedTextSymbolIndex).placedOrientation=R)}commit(u){this.commitTime=u,this.zoomAtLastRecencyCheck=this.transform.zoom;const m=this.prevPlacement;let x=!1;this.prevZoomAdjustment=m?m.zoomAdjustment(this.transform.zoom):0;const S=m?m.symbolFadeChange(u):1,R=m?m.opacities:{},L=m?m.variableOffsets:{},V=m?m.placedOrientations:{};for(const H in this.placements){const G=this.placements[H],ne=R[H];ne?(this.opacities[H]=new mt(ne,S,G.text,G.icon),x=x||G.text!==ne.text.placed||G.icon!==ne.icon.placed):(this.opacities[H]=new mt(null,S,G.text,G.icon,G.skipFade),x=x||G.text||G.icon)}for(const H in R){const G=R[H];if(!this.opacities[H]){const ne=new mt(G,S,!1,!1);ne.isHidden()||(this.opacities[H]=ne,x=x||G.text.placed||G.icon.placed)}}for(const H in L)this.variableOffsets[H]||!this.opacities[H]||this.opacities[H].isHidden()||(this.variableOffsets[H]=L[H]);for(const H in V)this.placedOrientations[H]||!this.opacities[H]||this.opacities[H].isHidden()||(this.placedOrientations[H]=V[H]);if(m&&m.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");x?this.lastPlacementChangeTime=u:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=m?m.lastPlacementChangeTime:u)}updateLayerOpacities(u,m){const x={};for(const S of m){const R=S.getBucket(u);R&&S.latestFeatureIndex&&u.id===R.layerIds[0]&&this.updateBucketOpacities(R,x,S.collisionBoxArray)}}updateBucketOpacities(u,m,x){u.hasTextData()&&u.text.opacityVertexArray.clear(),u.hasIconData()&&u.icon.opacityVertexArray.clear(),u.hasIconCollisionBoxData()&&u.iconCollisionBox.collisionVertexArray.clear(),u.hasTextCollisionBoxData()&&u.textCollisionBox.collisionVertexArray.clear();const S=u.layers[0].layout,R=new mt(null,0,!1,!1,!0),L=S.get("text-allow-overlap"),V=S.get("icon-allow-overlap"),H=S.get("text-variable-anchor"),G=S.get("text-rotation-alignment")==="map",ne=S.get("text-pitch-alignment")==="map",le=S.get("icon-text-fit")!=="none",pe=new mt(null,0,L&&(V||!u.hasIconData()||S.get("icon-optional")),V&&(L||!u.hasTextData()||S.get("text-optional")),!0);!u.collisionArrays&&x&&(u.hasIconCollisionBoxData()||u.hasTextCollisionBoxData())&&u.deserializeCollisionBoxes(x);const Te=(_e,Ee,Be)=>{for(let We=0;We0,st=this.placedOrientations[Ee.crossTileID],_t=st===a.WritingMode.vertical,wt=st===a.WritingMode.horizontal||st===a.WritingMode.horizontalOnly;if(Be>0||We>0){const Ut=Le(De.text);Te(u.text,Be,_t?Ze:Ut),Te(u.text,We,wt?Ze:Ut);const xt=De.text.isHidden();[Ee.rightJustifiedTextSymbolIndex,Ee.centerJustifiedTextSymbolIndex,Ee.leftJustifiedTextSymbolIndex].forEach(fn=>{fn>=0&&(u.text.placedSymbolArray.get(fn).hidden=xt||_t?1:0)}),Ee.verticalPlacedTextSymbolIndex>=0&&(u.text.placedSymbolArray.get(Ee.verticalPlacedTextSymbolIndex).hidden=xt||wt?1:0);const cn=this.variableOffsets[Ee.crossTileID];cn&&this.markUsedJustification(u,cn.anchor,Ee,st);const Jt=this.placedOrientations[Ee.crossTileID];Jt&&(this.markUsedJustification(u,"left",Ee,Jt),this.markUsedOrientation(u,Jt,Ee))}if(ft){const Ut=Le(De.icon),xt=!(le&&Ee.verticalPlacedIconSymbolIndex&&_t);Ee.placedIconSymbolIndex>=0&&(Te(u.icon,Ee.numIconVertices,xt?Ut:Ze),u.icon.placedSymbolArray.get(Ee.placedIconSymbolIndex).hidden=De.icon.isHidden()),Ee.verticalPlacedIconSymbolIndex>=0&&(Te(u.icon,Ee.numVerticalIconVertices,xt?Ze:Ut),u.icon.placedSymbolArray.get(Ee.verticalPlacedIconSymbolIndex).hidden=De.icon.isHidden())}if(u.hasIconCollisionBoxData()||u.hasTextCollisionBoxData()){const Ut=u.collisionArrays[_e];if(Ut){let xt=new a.pointGeometry(0,0);if(Ut.textBox||Ut.verticalTextBox){let Jt=!0;if(H){const fn=this.variableOffsets[rt];fn?(xt=Qn(fn.anchor,fn.width,fn.height,fn.textOffset,fn.textBoxScale),G&&xt._rotate(ne?this.transform.angle:-this.transform.angle)):Jt=!1}Ut.textBox&&W(u.textCollisionBox.collisionVertexArray,De.text.placed,!Jt||_t,xt.x,xt.y),Ut.verticalTextBox&&W(u.textCollisionBox.collisionVertexArray,De.text.placed,!Jt||wt,xt.x,xt.y)}const cn=Boolean(!wt&&Ut.verticalIconBox);Ut.iconBox&&W(u.iconCollisionBox.collisionVertexArray,De.icon.placed,cn,le?xt.x:0,le?xt.y:0),Ut.verticalIconBox&&W(u.iconCollisionBox.collisionVertexArray,De.icon.placed,!cn,le?xt.x:0,le?xt.y:0)}}}if(u.sortFeatures(this.transform.angle),this.retainedQueryData[u.bucketInstanceId]&&(this.retainedQueryData[u.bucketInstanceId].featureSortOrder=u.featureSortOrder),u.hasTextData()&&u.text.opacityVertexBuffer&&u.text.opacityVertexBuffer.updateData(u.text.opacityVertexArray),u.hasIconData()&&u.icon.opacityVertexBuffer&&u.icon.opacityVertexBuffer.updateData(u.icon.opacityVertexArray),u.hasIconCollisionBoxData()&&u.iconCollisionBox.collisionVertexBuffer&&u.iconCollisionBox.collisionVertexBuffer.updateData(u.iconCollisionBox.collisionVertexArray),u.hasTextCollisionBoxData()&&u.textCollisionBox.collisionVertexBuffer&&u.textCollisionBox.collisionVertexBuffer.updateData(u.textCollisionBox.collisionVertexArray),u.text.opacityVertexArray.length!==u.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${u.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${u.text.layoutVertexArray.length}) / 4`);if(u.icon.opacityVertexArray.length!==u.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${u.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${u.icon.layoutVertexArray.length}) / 4`);if(u.bucketInstanceId in this.collisionCircleArrays){const _e=this.collisionCircleArrays[u.bucketInstanceId];u.placementInvProjMatrix=_e.invProjMatrix,u.placementViewportMatrix=_e.viewportMatrix,u.collisionCircleArray=_e.circles,delete this.collisionCircleArrays[u.bucketInstanceId]}}symbolFadeChange(u){return this.fadeDuration===0?1:(u-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(u){return Math.max(0,(this.transform.zoom-u)/1.5)}hasTransitions(u){return this.stale||u-this.lastPlacementChangeTimeu}setStale(){this.stale=!0}}function W(w,u,m,x,S){w.emplaceBack(u?1:0,m?1:0,x||0,S||0),w.emplaceBack(u?1:0,m?1:0,x||0,S||0),w.emplaceBack(u?1:0,m?1:0,x||0,S||0),w.emplaceBack(u?1:0,m?1:0,x||0,S||0)}const Q=Math.pow(2,25),fe=Math.pow(2,24),ue=Math.pow(2,17),xe=Math.pow(2,16),ke=Math.pow(2,9),we=Math.pow(2,8),Pe=Math.pow(2,1);function Le(w){if(w.opacity===0&&!w.placed)return 0;if(w.opacity===1&&w.placed)return 4294967295;const u=w.placed?1:0,m=Math.floor(127*w.opacity);return m*Q+u*fe+m*ue+u*xe+m*ke+u*we+m*Pe+u}const Ze=0;class Xe{constructor(u){this._sortAcrossTiles=u.layout.get("symbol-z-order")!=="viewport-y"&&!u.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(u,m,x,S,R){const L=this._bucketParts;for(;this._currentTileIndexV.sortKey-H.sortKey));this._currentPartIndex{const L=a.exported.now()-S;return!this._forceFullPlacement&&L>2};for(;this._currentPlacementIndex>=0;){const L=m[u[this._currentPlacementIndex]],V=this.placement.collisionIndex.transform.zoom;if(L.type==="symbol"&&(!L.minzoom||L.minzoom<=V)&&(!L.maxzoom||L.maxzoom>V)){if(this._inProgressLayer||(this._inProgressLayer=new Xe(L)),this._inProgressLayer.continuePlacement(x[L.source],this.placement,this._showCollisionBoxes,L,R))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(u){return this.placement.commit(u),this.placement}}const Bt=512/a.EXTENT/2;class Et{constructor(u,m,x){this.tileID=u,this.indexedSymbolInstances={},this.bucketInstanceId=x;for(let S=0;Su.overscaledZ)for(const V in L){const H=L[V];H.tileID.isChildOf(u)&&H.findMatches(m.symbolInstances,u,S)}else{const V=L[u.scaledTo(Number(R)).key];V&&V.findMatches(m.symbolInstances,u,S)}}for(let R=0;R{m[x]=!0});for(const x in this.layerIndexes)m[x]||delete this.layerIndexes[x]}}var wn=a.createLayout([{name:"a_pos",type:"Int16",components:2}]);class dn extends a.Evented{constructor(u){super(),this.sourceCache=u,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=u._cache.max,u.usedForTerrain=!0,u.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(const u in this._tiles){const m=this._tiles[u];m.textures.forEach(x=>x.destroy()),m.textures=[]}}update(u,m){this.sourceCache.update(u,m),this._renderableTilesKeys=[];for(const x of u.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:m}))this._renderableTilesKeys.push(x.key),this._tiles[x.key]||(x.posMatrix=new Float64Array(16),a.ortho(x.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),this._tiles[x.key]=new Ae(x,this.tileSize))}removeOutdated(u){const m={};this.renderHistory=this.renderHistory.filter((x,S)=>this.renderHistory.indexOf(x)===S).slice(0,this.renderHistorySize);for(const x of this._renderableTilesKeys)m[x]=!0;for(const x of this.renderHistory)m[x]=!0;for(const x in this._tiles)m[x]||(this._tiles[x].clearTextures(u),delete this._tiles[x])}getRenderableTiles(){return this._renderableTilesKeys.map(u=>this.getTileByID(u))}getTileByID(u){return this._tiles[u]}getTerrainCoords(u){const m={};for(const x of this._renderableTilesKeys){const S=this._tiles[x].tileID;if(S.canonical.equals(u.canonical)){const R=u.clone();R.posMatrix=new Float64Array(16),a.ortho(R.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),m[x]=R}else if(S.canonical.isChildOf(u.canonical)){const R=u.clone();R.posMatrix=new Float64Array(16);const L=S.canonical.z-u.canonical.z,V=S.canonical.x-(S.canonical.x>>L<>L<>L;a.ortho(R.posMatrix,0,G,0,G,0,1),a.translate(R.posMatrix,R.posMatrix,[-V*G,-H*G,0]),m[x]=R}else if(u.canonical.isChildOf(S.canonical)){const R=u.clone();R.posMatrix=new Float64Array(16);const L=u.canonical.z-S.canonical.z,V=u.canonical.x-(u.canonical.x>>L<>L<>L;a.ortho(R.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),a.translate(R.posMatrix,R.posMatrix,[V*G,H*G,0]),a.scale(R.posMatrix,R.posMatrix,[1/2**L,1/2**L,0]),m[x]=R}}return m}getSourceTile(u,m){const x=this.sourceCache._source;let S=u.overscaledZ-this.deltaZoom;if(S>x.maxzoom&&(S=x.maxzoom),S=x.minzoom&&(!R||!R.dem);)R=this.sourceCache.getTileByID(u.scaledTo(S--).key);return R}tilesAfterTime(u=Date.now()){return Object.values(this._tiles).filter(m=>m.timeLoaded>=u)}}class Cn{constructor(u,m,x){this.style=u,this.sourceCache=new dn(m),this.options=x,this.exaggeration=typeof x.exaggeration=="number"?x.exaggeration:1,this.elevationOffset=typeof x.elevationOffset=="number"?x.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(u,m,x,S=a.EXTENT){if(!(m>=0&&m=0&&xu.canonical.z&&(u.canonical.z>=S?R=u.canonical.z-S:a.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const L=u.canonical.x-(u.canonical.x>>R<>R<>8<<4|R>>8,m[L+3]=0;const x=new a.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(m.buffer)),S=new T(u,x,u.gl.RGBA,{premultiply:!1});return S.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),this._coordsTexture=S,S}pointCoordinate(u){const m=new Uint8Array(4),x=this.style.map.painter,S=x.context,R=S.gl;S.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),R.readPixels(u.x,x.height/devicePixelRatio-u.y-1,1,1,R.RGBA,R.UNSIGNED_BYTE,m),S.bindFramebuffer.set(null);const L=m[0]+(m[2]>>4<<8),V=m[1]+((15&m[2])<<8),H=this.coordsIndex[255-m[3]],G=H&&this.sourceCache.getTileByID(H);if(!G)return null;const ne=this._coordsTextureSize,le=(1<a.emitValidationErrors(w,u&&u.filter(m=>m.identifier!=="source.canvas")),or=a.pick(et,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Wr=a.pick(et,["setCenter","setZoom","setBearing","setPitch"]),dr=function(){const w={},u=a.spec.$version;for(const m in a.spec.$root){const x=a.spec.$root[m];if(x.required){let S=null;S=m==="version"?u:x.type==="array"?[]:{},S!=null&&(w[m]=S)}}return w}();class Fr extends a.Evented{constructor(u,m={}){super(),this.map=u,this.dispatcher=new Y(vt(),this),this.imageManager=new P,this.imageManager.setEventedParent(this),this.glyphManager=new F(u._requestManager,m.localIdeographFontFamily),this.lineAtlas=new q(256,512),this.crossTileSymbolIndex=new Gt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new a.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());const x=this;this._rtlTextPluginCallback=Fr.registerForPluginStateChange(S=>{x.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:S.pluginStatus,pluginURL:S.pluginURL},(R,L)=>{if(a.triggerPluginCompletionEvent(R),L&&L.every(V=>V))for(const V in x.sourceCaches)x.sourceCaches[V].reload()})}),this.on("data",S=>{if(S.dataType!=="source"||S.sourceDataType!=="metadata")return;const R=this.sourceCaches[S.sourceId];if(!R)return;const L=R.getSource();if(L&&L.vectorLayerIds)for(const V in this._layers){const H=this._layers[V];H.source===L.id&&this._validateLayer(H)}})}loadURL(u,m={}){this.fire(new a.Event("dataloading",{dataType:"style"}));const x=typeof m.validate!="boolean"||m.validate,S=this.map._requestManager.transformRequest(u,a.ResourceType.Style);this._request=a.getJSON(S,(R,L)=>{this._request=null,R?this.fire(new a.ErrorEvent(R)):L&&this._load(L,x)})}loadJSON(u,m={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(u,m.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(dr,!1)}_load(u,m){if(m&&jn(this,a.validateStyle(u)))return;this._loaded=!0,this.stylesheet=u;for(const S in u.sources)this.addSource(S,u.sources[S],{validate:!1});u.sprite?this._loadSprite(u.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(u.glyphs);const x=Tt(this.stylesheet.layers);this._order=x.map(S=>S.id),this._layers={},this._serializedLayers={};for(let S of x)S=a.createStyleLayer(S),S.setEventedParent(this,{layer:{id:S.id}}),this._layers[S.id]=S,this._serializedLayers[S.id]=S.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new U(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}_loadSprite(u){this._spriteRequest=function(m,x,S,R){let L,V,H;const G=S>1?"@2x":"";let ne=a.getJSON(x.transformRequest(x.normalizeSpriteURL(m,G,".json"),a.ResourceType.SpriteJSON),(Te,_e)=>{ne=null,H||(H=Te,L=_e,pe())}),le=a.getImage(x.transformRequest(x.normalizeSpriteURL(m,G,".png"),a.ResourceType.SpriteImage),(Te,_e)=>{le=null,H||(H=Te,V=_e,pe())});function pe(){if(H)R(H);else if(L&&V){const Te=a.exported.getImageData(V),_e={};for(const Ee in L){const{width:Be,height:We,x:rt,y:De,sdf:ft,pixelRatio:st,stretchX:_t,stretchY:wt,content:Ut}=L[Ee],xt=new a.RGBAImage({width:Be,height:We});a.RGBAImage.copy(Te,xt,{x:rt,y:De},{x:0,y:0},{width:Be,height:We}),_e[Ee]={data:xt,pixelRatio:st,sdf:ft,stretchX:_t,stretchY:wt,content:Ut}}R(null,_e)}}return{cancel(){ne&&(ne.cancel(),ne=null),le&&(le.cancel(),le=null)}}}(u,this.map._requestManager,this.map.getPixelRatio(),(m,x)=>{if(this._spriteRequest=null,m)this.fire(new a.ErrorEvent(m));else if(x)for(const S in x)this.imageManager.addImage(S,x[S]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(u){const m=this.sourceCaches[u.source];if(!m)return;const x=u.sourceLayer;if(!x)return;const S=m.getSource();(S.type==="geojson"||S.vectorLayerIds&&S.vectorLayerIds.indexOf(x)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${x}" does not exist on source "${S.id}" as specified by style layer "${u.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const u in this.sourceCaches)if(!this.sourceCaches[u].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(u){const m=[];for(const x of u){const S=this._layers[x];S.type!=="custom"&&m.push(S.serialize())}return m}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const u in this.sourceCaches)if(this.sourceCaches[u].hasTransition())return!0;for(const u in this._layers)if(this._layers[u].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(u){if(!this._loaded)return;const m=this._changed;if(this._changed){const S=Object.keys(this._updatedLayers),R=Object.keys(this._removedLayers);(S.length||R.length)&&this._updateWorkerLayers(S,R);for(const L in this._updatedSources){const V=this._updatedSources[L];if(V==="reload")this._reloadSource(L);else{if(V!=="clear")throw new Error(`Invalid action ${V}`);this._clearSource(L)}}this._updateTilesForChangedImages();for(const L in this._updatedPaintProps)this._layers[L].updateTransitions(u);this.light.updateTransitions(u),this._resetUpdates()}const x={};for(const S in this.sourceCaches){const R=this.sourceCaches[S];x[S]=R.used,R.used=!1}for(const S of this._order){const R=this._layers[S];R.recalculate(u,this._availableImages),!R.isHidden(u.zoom)&&R.source&&(this.sourceCaches[R.source].used=!0)}for(const S in x){const R=this.sourceCaches[S];x[S]!==R.used&&R.fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:S}))}this.light.recalculate(u),this.z=u.zoom,m&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const u=Object.keys(this._changedImages);if(u.length){for(const m in this.sourceCaches)this.sourceCaches[m].reloadTilesForDependencies(["icons","patterns"],u);this._changedImages={}}}_updateWorkerLayers(u,m){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(u),removedIds:m})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(u){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),u){const m=this.sourceCaches[u.source];if(!m)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);this.terrain=new Cn(this,m,u),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=x=>{x.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=x=>{x.tile&&(x.sourceId===u.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(x.sourceId,x.tile.tileID)):x.source.type==="geojson"&&this.terrain.rememberForRerender(x.sourceId,x.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new a.Event("terrain",{terrain:u}))}setState(u){if(this._checkLoaded(),jn(this,a.validateStyle(u)))return!1;(u=a.clone$1(u)).layers=Tt(u.layers);const m=function(S,R){if(!S)return[{command:et.setStyle,args:[R]}];let L=[];try{if(!g(S.version,R.version))return[{command:et.setStyle,args:[R]}];g(S.center,R.center)||L.push({command:et.setCenter,args:[R.center]}),g(S.zoom,R.zoom)||L.push({command:et.setZoom,args:[R.zoom]}),g(S.bearing,R.bearing)||L.push({command:et.setBearing,args:[R.bearing]}),g(S.pitch,R.pitch)||L.push({command:et.setPitch,args:[R.pitch]}),g(S.sprite,R.sprite)||L.push({command:et.setSprite,args:[R.sprite]}),g(S.glyphs,R.glyphs)||L.push({command:et.setGlyphs,args:[R.glyphs]}),g(S.transition,R.transition)||L.push({command:et.setTransition,args:[R.transition]}),g(S.light,R.light)||L.push({command:et.setLight,args:[R.light]});const V={},H=[];(function(ne,le,pe,Te){let _e;for(_e in le=le||{},ne=ne||{})Object.prototype.hasOwnProperty.call(ne,_e)&&(Object.prototype.hasOwnProperty.call(le,_e)||at(_e,pe,Te));for(_e in le)Object.prototype.hasOwnProperty.call(le,_e)&&(Object.prototype.hasOwnProperty.call(ne,_e)?g(ne[_e],le[_e])||(ne[_e].type==="geojson"&&le[_e].type==="geojson"&&ct(ne,le,_e)?pe.push({command:et.setGeoJSONSourceData,args:[_e,le[_e].data]}):He(_e,le,pe,Te)):ut(_e,le,pe))})(S.sources,R.sources,H,V);const G=[];S.layers&&S.layers.forEach(ne=>{V[ne.source]?L.push({command:et.removeLayer,args:[ne.id]}):G.push(ne)}),L=L.concat(H),function(ne,le,pe){le=le||[];const Te=(ne=ne||[]).map(Ot),_e=le.map(Ot),Ee=ne.reduce(Lt,{}),Be=le.reduce(Lt,{}),We=Te.slice(),rt=Object.create(null);let De,ft,st,_t,wt,Ut,xt;for(De=0,ft=0;De!(S.command in Wr));if(m.length===0)return!1;const x=m.filter(S=>!(S.command in or));if(x.length>0)throw new Error(`Unimplemented: ${x.map(S=>S.command).join(", ")}.`);return m.forEach(S=>{S.command!=="setTransition"&&this[S.command].apply(this,S.args)}),this.stylesheet=u,!0}addImage(u,m){if(this.getImage(u))return this.fire(new a.ErrorEvent(new Error(`An image named "${u}" already exists.`)));this.imageManager.addImage(u,m),this._afterImageUpdated(u)}updateImage(u,m){this.imageManager.updateImage(u,m)}getImage(u){return this.imageManager.getImage(u)}removeImage(u){if(!this.getImage(u))return this.fire(new a.ErrorEvent(new Error(`An image named "${u}" does not exist.`)));this.imageManager.removeImage(u),this._afterImageUpdated(u)}_afterImageUpdated(u){this._availableImages=this.imageManager.listImages(),this._changedImages[u]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(u,m,x={}){if(this._checkLoaded(),this.sourceCaches[u]!==void 0)throw new Error(`Source "${u}" already exists.`);if(!m.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(m).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(m.type)>=0&&this._validate(a.validateStyle.source,`sources.${u}`,m,null,x))return;this.map&&this.map._collectResourceTiming&&(m.collectResourceTiming=!0);const S=this.sourceCaches[u]=new Ue(u,m,this.dispatcher);S.style=this,S.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:S.serialize(),sourceId:u})),S.onAdd(this.map),this._changed=!0}removeSource(u){if(this._checkLoaded(),this.sourceCaches[u]===void 0)throw new Error("There is no source with this ID");for(const x in this._layers)if(this._layers[x].source===u)return this.fire(new a.ErrorEvent(new Error(`Source "${u}" cannot be removed while layer "${x}" is using it.`)));const m=this.sourceCaches[u];delete this.sourceCaches[u],delete this._updatedSources[u],m.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:u})),m.setEventedParent(null),m.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(u,m){if(this._checkLoaded(),this.sourceCaches[u]===void 0)throw new Error(`There is no source with this ID=${u}`);const x=this.sourceCaches[u].getSource();if(x.type!=="geojson")throw new Error(`geojsonSource.type is ${x.type}, which is !== 'geojson`);x.setData(m),this._changed=!0}getSource(u){return this.sourceCaches[u]&&this.sourceCaches[u].getSource()}addLayer(u,m,x={}){this._checkLoaded();const S=u.id;if(this.getLayer(S))return void this.fire(new a.ErrorEvent(new Error(`Layer "${S}" already exists on this map.`)));let R;if(u.type==="custom"){if(jn(this,a.validateCustomStyleLayer(u)))return;R=a.createStyleLayer(u)}else{if(typeof u.source=="object"&&(this.addSource(S,u.source),u=a.clone$1(u),u=a.extend(u,{source:S})),this._validate(a.validateStyle.layer,`layers.${S}`,u,{arrayIndex:-1},x))return;R=a.createStyleLayer(u),this._validateLayer(R),R.setEventedParent(this,{layer:{id:S}}),this._serializedLayers[R.id]=R.serialize()}const L=m?this._order.indexOf(m):this._order.length;if(m&&L===-1)this.fire(new a.ErrorEvent(new Error(`Cannot add layer "${S}" before non-existing layer "${m}".`)));else{if(this._order.splice(L,0,S),this._layerOrderChanged=!0,this._layers[S]=R,this._removedLayers[S]&&R.source&&R.type!=="custom"){const V=this._removedLayers[S];delete this._removedLayers[S],V.type!==R.type?this._updatedSources[R.source]="clear":(this._updatedSources[R.source]="reload",this.sourceCaches[R.source].pause())}this._updateLayer(R),R.onAdd&&R.onAdd(this.map)}}moveLayer(u,m){if(this._checkLoaded(),this._changed=!0,!this._layers[u])return void this.fire(new a.ErrorEvent(new Error(`The layer '${u}' does not exist in the map's style and cannot be moved.`)));if(u===m)return;const x=this._order.indexOf(u);this._order.splice(x,1);const S=m?this._order.indexOf(m):this._order.length;m&&S===-1?this.fire(new a.ErrorEvent(new Error(`Cannot move layer "${u}" before non-existing layer "${m}".`))):(this._order.splice(S,0,u),this._layerOrderChanged=!0)}removeLayer(u){this._checkLoaded();const m=this._layers[u];if(!m)return void this.fire(new a.ErrorEvent(new Error(`Cannot remove non-existing layer "${u}".`)));m.setEventedParent(null);const x=this._order.indexOf(u);this._order.splice(x,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[u]=m,delete this._layers[u],delete this._serializedLayers[u],delete this._updatedLayers[u],delete this._updatedPaintProps[u],m.onRemove&&m.onRemove(this.map)}getLayer(u){return this._layers[u]}hasLayer(u){return u in this._layers}setLayerZoomRange(u,m,x){this._checkLoaded();const S=this.getLayer(u);S?S.minzoom===m&&S.maxzoom===x||(m!=null&&(S.minzoom=m),x!=null&&(S.maxzoom=x),this._updateLayer(S)):this.fire(new a.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${u}".`)))}setFilter(u,m,x={}){this._checkLoaded();const S=this.getLayer(u);if(S){if(!g(S.filter,m))return m==null?(S.filter=void 0,void this._updateLayer(S)):void(this._validate(a.validateStyle.filter,`layers.${S.id}.filter`,m,null,x)||(S.filter=a.clone$1(m),this._updateLayer(S)))}else this.fire(new a.ErrorEvent(new Error(`Cannot filter non-existing layer "${u}".`)))}getFilter(u){return a.clone$1(this.getLayer(u).filter)}setLayoutProperty(u,m,x,S={}){this._checkLoaded();const R=this.getLayer(u);R?g(R.getLayoutProperty(m),x)||(R.setLayoutProperty(m,x,S),this._updateLayer(R)):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${u}".`)))}getLayoutProperty(u,m){const x=this.getLayer(u);if(x)return x.getLayoutProperty(m);this.fire(new a.ErrorEvent(new Error(`Cannot get style of non-existing layer "${u}".`)))}setPaintProperty(u,m,x,S={}){this._checkLoaded();const R=this.getLayer(u);R?g(R.getPaintProperty(m),x)||(R.setPaintProperty(m,x,S)&&this._updateLayer(R),this._changed=!0,this._updatedPaintProps[u]=!0):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${u}".`)))}getPaintProperty(u,m){return this.getLayer(u).getPaintProperty(m)}setFeatureState(u,m){this._checkLoaded();const x=u.source,S=u.sourceLayer,R=this.sourceCaches[x];if(R===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${x}' does not exist in the map's style.`)));const L=R.getSource().type;L==="geojson"&&S?this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):L!=="vector"||S?(u.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),R.setFeatureState(S,u.id,m)):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(u,m){this._checkLoaded();const x=u.source,S=this.sourceCaches[x];if(S===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${x}' does not exist in the map's style.`)));const R=S.getSource().type,L=R==="vector"?u.sourceLayer:void 0;R!=="vector"||L?m&&typeof u.id!="string"&&typeof u.id!="number"?this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):S.removeFeatureState(L,u.id,m):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(u){this._checkLoaded();const m=u.source,x=u.sourceLayer,S=this.sourceCaches[m];if(S!==void 0)return S.getSource().type!=="vector"||x?(u.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),S.getFeatureState(x,u.id)):void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new a.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:a.mapObject(this.sourceCaches,u=>u.serialize()),layers:this._serializeLayers(this._order)},u=>u!==void 0)}_updateLayer(u){this._updatedLayers[u.id]=!0,u.source&&!this._updatedSources[u.source]&&this.sourceCaches[u.source].getSource().type!=="raster"&&(this._updatedSources[u.source]="reload",this.sourceCaches[u.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(u){const m=L=>this._layers[L].type==="fill-extrusion",x={},S=[];for(let L=this._order.length-1;L>=0;L--){const V=this._order[L];if(m(V)){x[V]=L;for(const H of u){const G=H[V];if(G)for(const ne of G)S.push(ne)}}}S.sort((L,V)=>V.intersectionZ-L.intersectionZ);const R=[];for(let L=this._order.length-1;L>=0;L--){const V=this._order[L];if(m(V))for(let H=S.length-1;H>=0;H--){const G=S[H].feature;if(x[G.layer.id]{const wt=Be.featureSortOrder;if(wt){const Ut=wt.indexOf(st.featureIndex);return wt.indexOf(_t.featureIndex)-Ut}return _t.featureIndex-st.featureIndex});for(const st of ft)De.push(st)}}for(const Be in Te)Te[Be].forEach(We=>{const rt=We.feature,De=H[L[Be].source].getFeatureState(rt.layer["source-layer"],rt.id);rt.source=rt.layer.source,rt.layer["source-layer"]&&(rt.sourceLayer=rt.layer["source-layer"]),rt.state=De});return Te}(this._layers,this._serializedLayers,this.sourceCaches,u,m,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(R)}querySourceFeatures(u,m){m&&m.filter&&this._validate(a.validateStyle.filter,"querySourceFeatures.filter",m.filter,null,m);const x=this.sourceCaches[u];return x?function(S,R){const L=S.getRenderableIds().map(G=>S.getTileByID(G)),V=[],H={};for(let G=0;Gpe.getTileByID(Te)).sort((Te,_e)=>_e.tileID.overscaledZ-Te.tileID.overscaledZ||(Te.tileID.isLessThan(_e.tileID)?-1:1))}const le=this.crossTileSymbolIndex.addLayer(ne,H[ne.source],u.center.lng);L=L||le}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((R=R||this._layerOrderChanged||x===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),u.zoom))&&(this.pauseablePlacement=new Ve(u,this.terrain,this._order,R,m,x,S,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,H),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),V=!0),L&&this.pauseablePlacement.placement.setStale()),V||L)for(const G of this._order){const ne=this._layers[G];ne.type==="symbol"&&this.placement.updateLayerOpacities(ne,H[ne.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(const u in this.sourceCaches)this.sourceCaches[u].releaseSymbolFadeTiles()}getImages(u,m,x){this.imageManager.getImages(m.icons,x),this._updateTilesForChangedImages();const S=this.sourceCaches[m.source];S&&S.setDependencies(m.tileID.key,m.type,m.icons)}getGlyphs(u,m,x){this.glyphManager.getGlyphs(m.stacks,x)}getResource(u,m,x){return a.makeRequest(m,x)}}Fr.getSourceType=function(w){return be[w]},Fr.setSourceType=function(w,u){be[w]=u},Fr.registerForPluginStateChange=a.registerForPluginStateChange;var Dn="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}";const Mn={prelude:Nn(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif`,`#ifdef GL_ES precision highp float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 );}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} #ifdef TERRAIN3D uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; #endif const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { #ifdef TERRAIN3D highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); #else return 1.0; #endif }float calculate_visibility(vec4 pos) { #ifdef TERRAIN3D vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; #else return 1.0; #endif }float ele(vec2 pos) { #ifdef TERRAIN3D vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; #else return 0.0; #endif }float get_elevation(vec2 pos) { #ifdef TERRAIN3D vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration; #else return 0.0; #endif }`),background:Nn(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Nn(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Nn(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main(void) { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Nn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Nn(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { #pragma mapbox: initialize highp float weight float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; #pragma mapbox: define highp float weight #pragma mapbox: define mediump float radius const highp float ZERO=1.0/255.0/16.0; #define GAUSS_COEF 0.3989422804014327 void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Nn(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Nn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Nn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Nn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Nn(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_FragColor=color*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Nn(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Nn(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Nn(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Nn(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec4 v_color; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color vec3 normal=a_normal_ed.xyz; #ifdef TERRAIN3D float baseDelta=10.0;float ele=get_elevation(a_centroid); #else float baseDelta=0.0;float ele=0.0; #endif base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Nn(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; #ifdef TERRAIN3D float baseDelta=10.0;float ele=get_elevation(a_centroid); #else float baseDelta=0.0;float ele=0.0; #endif base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Nn(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Nn(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Nn(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),lineGradient:Nn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),linePattern:Nn(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Nn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Nn(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Nn(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Nn(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Nn(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Nn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Dn),terrainDepth:Nn("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Dn),terrainCoords:Nn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Dn)};function Nn(w,u){const m=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,x=u.match(/attribute ([\w]+) ([\w]+)/g),S=w.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),R=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),L=R?R.concat(S):S,V={};return{fragmentSource:w=w.replace(m,(H,G,ne,le,pe)=>(V[pe]=!0,G==="define"?` #ifndef HAS_UNIFORM_u_${pe} varying ${ne} ${le} ${pe}; #else uniform ${ne} ${le} u_${pe}; #endif `:` #ifdef HAS_UNIFORM_u_${pe} ${ne} ${le} ${pe} = u_${pe}; #endif `)),vertexSource:u=u.replace(m,(H,G,ne,le,pe)=>{const Te=le==="float"?"vec2":"vec4",_e=pe.match(/color/)?"color":Te;return V[pe]?G==="define"?` #ifndef HAS_UNIFORM_u_${pe} uniform lowp float u_${pe}_t; attribute ${ne} ${Te} a_${pe}; varying ${ne} ${le} ${pe}; #else uniform ${ne} ${le} u_${pe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${pe} ${pe} = a_${pe}; #else ${ne} ${le} ${pe} = u_${pe}; #endif `:` #ifndef HAS_UNIFORM_u_${pe} ${pe} = unpack_mix_${_e}(a_${pe}, u_${pe}_t); #else ${ne} ${le} ${pe} = u_${pe}; #endif `:G==="define"?` #ifndef HAS_UNIFORM_u_${pe} uniform lowp float u_${pe}_t; attribute ${ne} ${Te} a_${pe}; #else uniform ${ne} ${le} u_${pe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${pe} ${ne} ${le} ${pe} = a_${pe}; #else ${ne} ${le} ${pe} = u_${pe}; #endif `:` #ifndef HAS_UNIFORM_u_${pe} ${ne} ${le} ${pe} = unpack_mix_${_e}(a_${pe}, u_${pe}_t); #else ${ne} ${le} ${pe} = u_${pe}; #endif `}),staticAttributes:x,staticUniforms:L}}class ti{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(u,m,x,S,R,L,V,H,G){this.context=u;let ne=this.boundPaintVertexBuffers.length!==S.length;for(let le=0;!ne&&le({u_depth:new a.Uniform1i(wt,Ut.u_depth),u_terrain:new a.Uniform1i(wt,Ut.u_terrain),u_terrain_dim:new a.Uniform1f(wt,Ut.u_terrain_dim),u_terrain_matrix:new a.UniformMatrix4f(wt,Ut.u_terrain_matrix),u_terrain_unpack:new a.Uniform4f(wt,Ut.u_terrain_unpack),u_terrain_offset:new a.Uniform1f(wt,Ut.u_terrain_offset),u_terrain_exaggeration:new a.Uniform1f(wt,Ut.u_terrain_exaggeration)}))(u,_t),this.binderUniforms=S?S.getUniforms(u,_t):[]}draw(u,m,x,S,R,L,V,H,G,ne,le,pe,Te,_e,Ee,Be,We,rt){const De=u.gl;if(this.failedToCreate)return;if(u.program.set(this.program),u.setDepthMode(x),u.setStencilMode(S),u.setColorMode(R),u.setCullFace(L),H){u.activeTexture.set(De.TEXTURE2),De.bindTexture(De.TEXTURE_2D,H.depthTexture),u.activeTexture.set(De.TEXTURE3),De.bindTexture(De.TEXTURE_2D,H.texture);for(const st in this.terrainUniforms)this.terrainUniforms[st].set(H[st])}for(const st in this.fixedUniforms)this.fixedUniforms[st].set(V[st]);Ee&&Ee.setUniforms(u,this.binderUniforms,Te,{zoom:_e});let ft=0;switch(m){case De.LINES:ft=2;break;case De.TRIANGLES:ft=3;break;case De.LINE_STRIP:ft=1}for(const st of pe.get()){const _t=st.vaos||(st.vaos={});(_t[G]||(_t[G]=new ti)).bind(u,this,ne,Ee?Ee.getPaintVertexBuffers():[],le,st.vertexOffset,Be,We,rt),De.drawElements(m,st.primitiveLength*ft,De.UNSIGNED_SHORT,st.primitiveOffset*ft*2)}}}function Bn(w,u,m){const x=1/zt(m,1,u.transform.tileZoom),S=Math.pow(2,m.tileID.overscaledZ),R=m.tileSize*Math.pow(2,u.transform.tileZoom)/S,L=R*(m.tileID.canonical.x+m.tileID.wrap*S),V=R*m.tileID.canonical.y;return{u_image:0,u_texsize:m.imageAtlasTexture.size,u_scale:[x,w.fromScale,w.toScale],u_fade:w.t,u_pixel_coord_upper:[L>>16,V>>16],u_pixel_coord_lower:[65535&L,65535&V]}}const rr=(w,u,m,x)=>{const S=u.style.light,R=S.properties.get("position"),L=[R.x,R.y,R.z],V=a.create$1();S.properties.get("anchor")==="viewport"&&a.fromRotation(V,-u.transform.angle),a.transformMat3(L,L,V);const H=S.properties.get("color");return{u_matrix:w,u_lightpos:L,u_lightintensity:S.properties.get("intensity"),u_lightcolor:[H.r,H.g,H.b],u_vertical_gradient:+m,u_opacity:x}},Er=(w,u,m,x,S,R,L)=>a.extend(rr(w,u,m,x),Bn(R,u,L),{u_height_factor:-Math.pow(2,S.overscaledZ)/L.tileSize/8}),Tr=w=>({u_matrix:w}),Gr=(w,u,m,x)=>a.extend(Tr(w),Bn(m,u,x)),ko=(w,u)=>({u_matrix:w,u_world:u}),ru=(w,u,m,x,S)=>a.extend(Gr(w,u,m,x),{u_world:S}),Gd=(w,u,m,x)=>{const S=w.transform;let R,L;if(x.paint.get("circle-pitch-alignment")==="map"){const V=zt(m,1,S.zoom);R=!0,L=[V,V]}else R=!1,L=S.pixelsToGLUnits;return{u_camera_to_center_distance:S.cameraToCenterDistance,u_scale_with_map:+(x.paint.get("circle-pitch-scale")==="map"),u_matrix:w.translatePosMatrix(u.posMatrix,m,x.paint.get("circle-translate"),x.paint.get("circle-translate-anchor")),u_pitch_with_map:+R,u_device_pixel_ratio:w.pixelRatio,u_extrude_scale:L}},ls=(w,u,m)=>{const x=zt(m,1,u.zoom),S=Math.pow(2,u.zoom-m.tileID.overscaledZ),R=m.tileID.overscaleFactor();return{u_matrix:w,u_camera_to_center_distance:u.cameraToCenterDistance,u_pixels_to_tile_units:x,u_extrude_scale:[u.pixelsToGLUnits[0]/(x*S),u.pixelsToGLUnits[1]/(x*S)],u_overscale_factor:R}},Vn=(w,u,m=1)=>({u_matrix:w,u_color:u,u_overlay:0,u_overlay_scale:m}),er=w=>({u_matrix:w}),zr=(w,u,m,x)=>({u_matrix:w,u_extrude_scale:zt(u,1,m),u_intensity:x});function Fi(w,u){const m=Math.pow(2,u.canonical.z),x=u.canonical.y;return[new a.MercatorCoordinate(0,x/m).toLngLat().lat,new a.MercatorCoordinate(0,(x+1)/m).toLngLat().lat]}const As=(w,u,m,x)=>{const S=w.transform;return{u_matrix:cs(w,u,m,x),u_ratio:1/zt(u,1,S.zoom),u_device_pixel_ratio:w.pixelRatio,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]]}},Ho=(w,u,m,x,S)=>a.extend(As(w,u,m,S),{u_image:0,u_image_height:x}),dl=(w,u,m,x,S)=>{const R=w.transform,L=Cr(u,R);return{u_matrix:cs(w,u,m,S),u_texsize:u.imageAtlasTexture.size,u_ratio:1/zt(u,1,R.zoom),u_device_pixel_ratio:w.pixelRatio,u_image:0,u_scale:[L,x.fromScale,x.toScale],u_fade:x.t,u_units_to_pixels:[1/R.pixelsToGLUnits[0],1/R.pixelsToGLUnits[1]]}},us=(w,u,m,x,S,R)=>{const L=w.lineAtlas,V=Cr(u,w.transform),H=m.layout.get("line-cap")==="round",G=L.getDash(x.from,H),ne=L.getDash(x.to,H),le=G.width*S.fromScale,pe=ne.width*S.toScale;return a.extend(As(w,u,m,R),{u_patternscale_a:[V/le,-G.height/2],u_patternscale_b:[V/pe,-ne.height/2],u_sdfgamma:L.width/(256*Math.min(le,pe)*w.pixelRatio)/2,u_image:0,u_tex_y_a:G.y,u_tex_y_b:ne.y,u_mix:S.t})};function Cr(w,u){return 1/zt(w,1,u.tileZoom)}function cs(w,u,m,x){return w.translatePosMatrix(x?x.posMatrix:u.tileID.posMatrix,u,m.paint.get("line-translate"),m.paint.get("line-translate-anchor"))}const Nv=(w,u,m,x,S)=>{return{u_matrix:w,u_tl_parent:u,u_scale_parent:m,u_buffer_scale:1,u_fade_t:x.mix,u_opacity:x.opacity*S.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:S.paint.get("raster-brightness-min"),u_brightness_high:S.paint.get("raster-brightness-max"),u_saturation_factor:(L=S.paint.get("raster-saturation"),L>0?1-1/(1.001-L):-L),u_contrast_factor:(R=S.paint.get("raster-contrast"),R>0?1/(1-R):1+R),u_spin_weights:Lv(S.paint.get("raster-hue-rotate"))};var R,L};function Lv(w){w*=Math.PI/180;const u=Math.sin(w),m=Math.cos(w);return[(2*m+1)/3,(-Math.sqrt(3)*u-m+1)/3,(Math.sqrt(3)*u-m+1)/3]}const ep=(w,u,m,x,S,R,L,V,H,G)=>{const ne=S.transform;return{u_is_size_zoom_constant:+(w==="constant"||w==="source"),u_is_size_feature_constant:+(w==="constant"||w==="camera"),u_size_t:u?u.uSizeT:0,u_size:u?u.uSize:0,u_camera_to_center_distance:ne.cameraToCenterDistance,u_pitch:ne.pitch/360*2*Math.PI,u_rotate_symbol:+m,u_aspect_ratio:ne.width/ne.height,u_fade_change:S.options.fadeDuration?S.symbolFadeChange:1,u_matrix:R,u_label_plane_matrix:L,u_coord_matrix:V,u_is_text:+H,u_pitch_with_map:+x,u_texsize:G,u_texture:0}},qd=(w,u,m,x,S,R,L,V,H,G,ne)=>{const le=S.transform;return a.extend(ep(w,u,m,x,S,R,L,V,H,G),{u_gamma_scale:x?Math.cos(le._pitch)*le.cameraToCenterDistance:1,u_device_pixel_ratio:S.pixelRatio,u_is_halo:+ne})},Fv=(w,u,m,x,S,R,L,V,H,G)=>a.extend(qd(w,u,m,x,S,R,L,V,!0,H,!0),{u_texsize_icon:G,u_texture_icon:1}),$1=(w,u,m)=>({u_matrix:w,u_opacity:u,u_color:m}),B1=(w,u,m,x,S,R)=>a.extend(function(L,V,H,G){const ne=H.imageManager.getPattern(L.from.toString()),le=H.imageManager.getPattern(L.to.toString()),{width:pe,height:Te}=H.imageManager.getPixelSize(),_e=Math.pow(2,G.tileID.overscaledZ),Ee=G.tileSize*Math.pow(2,H.transform.tileZoom)/_e,Be=Ee*(G.tileID.canonical.x+G.tileID.wrap*_e),We=Ee*G.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ne.tl,u_pattern_br_a:ne.br,u_pattern_tl_b:le.tl,u_pattern_br_b:le.br,u_texsize:[pe,Te],u_mix:V.t,u_pattern_size_a:ne.displaySize,u_pattern_size_b:le.displaySize,u_scale_a:V.fromScale,u_scale_b:V.toScale,u_tile_units_to_pixels:1/zt(G,1,H.transform.tileZoom),u_pixel_coord_upper:[Be>>16,We>>16],u_pixel_coord_lower:[65535&Be,65535&We]}}(x,R,m,S),{u_matrix:w,u_opacity:u}),tp={fillExtrusion:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_lightpos:new a.Uniform3f(w,u.u_lightpos),u_lightintensity:new a.Uniform1f(w,u.u_lightintensity),u_lightcolor:new a.Uniform3f(w,u.u_lightcolor),u_vertical_gradient:new a.Uniform1f(w,u.u_vertical_gradient),u_opacity:new a.Uniform1f(w,u.u_opacity)}),fillExtrusionPattern:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_lightpos:new a.Uniform3f(w,u.u_lightpos),u_lightintensity:new a.Uniform1f(w,u.u_lightintensity),u_lightcolor:new a.Uniform3f(w,u.u_lightcolor),u_vertical_gradient:new a.Uniform1f(w,u.u_vertical_gradient),u_height_factor:new a.Uniform1f(w,u.u_height_factor),u_image:new a.Uniform1i(w,u.u_image),u_texsize:new a.Uniform2f(w,u.u_texsize),u_pixel_coord_upper:new a.Uniform2f(w,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(w,u.u_pixel_coord_lower),u_scale:new a.Uniform3f(w,u.u_scale),u_fade:new a.Uniform1f(w,u.u_fade),u_opacity:new a.Uniform1f(w,u.u_opacity)}),fill:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix)}),fillPattern:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_image:new a.Uniform1i(w,u.u_image),u_texsize:new a.Uniform2f(w,u.u_texsize),u_pixel_coord_upper:new a.Uniform2f(w,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(w,u.u_pixel_coord_lower),u_scale:new a.Uniform3f(w,u.u_scale),u_fade:new a.Uniform1f(w,u.u_fade)}),fillOutline:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_world:new a.Uniform2f(w,u.u_world)}),fillOutlinePattern:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_world:new a.Uniform2f(w,u.u_world),u_image:new a.Uniform1i(w,u.u_image),u_texsize:new a.Uniform2f(w,u.u_texsize),u_pixel_coord_upper:new a.Uniform2f(w,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(w,u.u_pixel_coord_lower),u_scale:new a.Uniform3f(w,u.u_scale),u_fade:new a.Uniform1f(w,u.u_fade)}),circle:(w,u)=>({u_camera_to_center_distance:new a.Uniform1f(w,u.u_camera_to_center_distance),u_scale_with_map:new a.Uniform1i(w,u.u_scale_with_map),u_pitch_with_map:new a.Uniform1i(w,u.u_pitch_with_map),u_extrude_scale:new a.Uniform2f(w,u.u_extrude_scale),u_device_pixel_ratio:new a.Uniform1f(w,u.u_device_pixel_ratio),u_matrix:new a.UniformMatrix4f(w,u.u_matrix)}),collisionBox:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_camera_to_center_distance:new a.Uniform1f(w,u.u_camera_to_center_distance),u_pixels_to_tile_units:new a.Uniform1f(w,u.u_pixels_to_tile_units),u_extrude_scale:new a.Uniform2f(w,u.u_extrude_scale),u_overscale_factor:new a.Uniform1f(w,u.u_overscale_factor)}),collisionCircle:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_inv_matrix:new a.UniformMatrix4f(w,u.u_inv_matrix),u_camera_to_center_distance:new a.Uniform1f(w,u.u_camera_to_center_distance),u_viewport_size:new a.Uniform2f(w,u.u_viewport_size)}),debug:(w,u)=>({u_color:new a.UniformColor(w,u.u_color),u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_overlay:new a.Uniform1i(w,u.u_overlay),u_overlay_scale:new a.Uniform1f(w,u.u_overlay_scale)}),clippingMask:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix)}),heatmap:(w,u)=>({u_extrude_scale:new a.Uniform1f(w,u.u_extrude_scale),u_intensity:new a.Uniform1f(w,u.u_intensity),u_matrix:new a.UniformMatrix4f(w,u.u_matrix)}),heatmapTexture:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_world:new a.Uniform2f(w,u.u_world),u_image:new a.Uniform1i(w,u.u_image),u_color_ramp:new a.Uniform1i(w,u.u_color_ramp),u_opacity:new a.Uniform1f(w,u.u_opacity)}),hillshade:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_image:new a.Uniform1i(w,u.u_image),u_latrange:new a.Uniform2f(w,u.u_latrange),u_light:new a.Uniform2f(w,u.u_light),u_shadow:new a.UniformColor(w,u.u_shadow),u_highlight:new a.UniformColor(w,u.u_highlight),u_accent:new a.UniformColor(w,u.u_accent)}),hillshadePrepare:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_image:new a.Uniform1i(w,u.u_image),u_dimension:new a.Uniform2f(w,u.u_dimension),u_zoom:new a.Uniform1f(w,u.u_zoom),u_unpack:new a.Uniform4f(w,u.u_unpack)}),line:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_ratio:new a.Uniform1f(w,u.u_ratio),u_device_pixel_ratio:new a.Uniform1f(w,u.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(w,u.u_units_to_pixels)}),lineGradient:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_ratio:new a.Uniform1f(w,u.u_ratio),u_device_pixel_ratio:new a.Uniform1f(w,u.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(w,u.u_units_to_pixels),u_image:new a.Uniform1i(w,u.u_image),u_image_height:new a.Uniform1f(w,u.u_image_height)}),linePattern:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_texsize:new a.Uniform2f(w,u.u_texsize),u_ratio:new a.Uniform1f(w,u.u_ratio),u_device_pixel_ratio:new a.Uniform1f(w,u.u_device_pixel_ratio),u_image:new a.Uniform1i(w,u.u_image),u_units_to_pixels:new a.Uniform2f(w,u.u_units_to_pixels),u_scale:new a.Uniform3f(w,u.u_scale),u_fade:new a.Uniform1f(w,u.u_fade)}),lineSDF:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_ratio:new a.Uniform1f(w,u.u_ratio),u_device_pixel_ratio:new a.Uniform1f(w,u.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(w,u.u_units_to_pixels),u_patternscale_a:new a.Uniform2f(w,u.u_patternscale_a),u_patternscale_b:new a.Uniform2f(w,u.u_patternscale_b),u_sdfgamma:new a.Uniform1f(w,u.u_sdfgamma),u_image:new a.Uniform1i(w,u.u_image),u_tex_y_a:new a.Uniform1f(w,u.u_tex_y_a),u_tex_y_b:new a.Uniform1f(w,u.u_tex_y_b),u_mix:new a.Uniform1f(w,u.u_mix)}),raster:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_tl_parent:new a.Uniform2f(w,u.u_tl_parent),u_scale_parent:new a.Uniform1f(w,u.u_scale_parent),u_buffer_scale:new a.Uniform1f(w,u.u_buffer_scale),u_fade_t:new a.Uniform1f(w,u.u_fade_t),u_opacity:new a.Uniform1f(w,u.u_opacity),u_image0:new a.Uniform1i(w,u.u_image0),u_image1:new a.Uniform1i(w,u.u_image1),u_brightness_low:new a.Uniform1f(w,u.u_brightness_low),u_brightness_high:new a.Uniform1f(w,u.u_brightness_high),u_saturation_factor:new a.Uniform1f(w,u.u_saturation_factor),u_contrast_factor:new a.Uniform1f(w,u.u_contrast_factor),u_spin_weights:new a.Uniform3f(w,u.u_spin_weights)}),symbolIcon:(w,u)=>({u_is_size_zoom_constant:new a.Uniform1i(w,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(w,u.u_is_size_feature_constant),u_size_t:new a.Uniform1f(w,u.u_size_t),u_size:new a.Uniform1f(w,u.u_size),u_camera_to_center_distance:new a.Uniform1f(w,u.u_camera_to_center_distance),u_pitch:new a.Uniform1f(w,u.u_pitch),u_rotate_symbol:new a.Uniform1i(w,u.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(w,u.u_aspect_ratio),u_fade_change:new a.Uniform1f(w,u.u_fade_change),u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(w,u.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(w,u.u_coord_matrix),u_is_text:new a.Uniform1i(w,u.u_is_text),u_pitch_with_map:new a.Uniform1i(w,u.u_pitch_with_map),u_texsize:new a.Uniform2f(w,u.u_texsize),u_texture:new a.Uniform1i(w,u.u_texture)}),symbolSDF:(w,u)=>({u_is_size_zoom_constant:new a.Uniform1i(w,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(w,u.u_is_size_feature_constant),u_size_t:new a.Uniform1f(w,u.u_size_t),u_size:new a.Uniform1f(w,u.u_size),u_camera_to_center_distance:new a.Uniform1f(w,u.u_camera_to_center_distance),u_pitch:new a.Uniform1f(w,u.u_pitch),u_rotate_symbol:new a.Uniform1i(w,u.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(w,u.u_aspect_ratio),u_fade_change:new a.Uniform1f(w,u.u_fade_change),u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(w,u.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(w,u.u_coord_matrix),u_is_text:new a.Uniform1i(w,u.u_is_text),u_pitch_with_map:new a.Uniform1i(w,u.u_pitch_with_map),u_texsize:new a.Uniform2f(w,u.u_texsize),u_texture:new a.Uniform1i(w,u.u_texture),u_gamma_scale:new a.Uniform1f(w,u.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(w,u.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(w,u.u_is_halo)}),symbolTextAndIcon:(w,u)=>({u_is_size_zoom_constant:new a.Uniform1i(w,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(w,u.u_is_size_feature_constant),u_size_t:new a.Uniform1f(w,u.u_size_t),u_size:new a.Uniform1f(w,u.u_size),u_camera_to_center_distance:new a.Uniform1f(w,u.u_camera_to_center_distance),u_pitch:new a.Uniform1f(w,u.u_pitch),u_rotate_symbol:new a.Uniform1i(w,u.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(w,u.u_aspect_ratio),u_fade_change:new a.Uniform1f(w,u.u_fade_change),u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(w,u.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(w,u.u_coord_matrix),u_is_text:new a.Uniform1i(w,u.u_is_text),u_pitch_with_map:new a.Uniform1i(w,u.u_pitch_with_map),u_texsize:new a.Uniform2f(w,u.u_texsize),u_texsize_icon:new a.Uniform2f(w,u.u_texsize_icon),u_texture:new a.Uniform1i(w,u.u_texture),u_texture_icon:new a.Uniform1i(w,u.u_texture_icon),u_gamma_scale:new a.Uniform1f(w,u.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(w,u.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(w,u.u_is_halo)}),background:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_opacity:new a.Uniform1f(w,u.u_opacity),u_color:new a.UniformColor(w,u.u_color)}),backgroundPattern:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_opacity:new a.Uniform1f(w,u.u_opacity),u_image:new a.Uniform1i(w,u.u_image),u_pattern_tl_a:new a.Uniform2f(w,u.u_pattern_tl_a),u_pattern_br_a:new a.Uniform2f(w,u.u_pattern_br_a),u_pattern_tl_b:new a.Uniform2f(w,u.u_pattern_tl_b),u_pattern_br_b:new a.Uniform2f(w,u.u_pattern_br_b),u_texsize:new a.Uniform2f(w,u.u_texsize),u_mix:new a.Uniform1f(w,u.u_mix),u_pattern_size_a:new a.Uniform2f(w,u.u_pattern_size_a),u_pattern_size_b:new a.Uniform2f(w,u.u_pattern_size_b),u_scale_a:new a.Uniform1f(w,u.u_scale_a),u_scale_b:new a.Uniform1f(w,u.u_scale_b),u_pixel_coord_upper:new a.Uniform2f(w,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(w,u.u_pixel_coord_lower),u_tile_units_to_pixels:new a.Uniform1f(w,u.u_tile_units_to_pixels)}),terrain:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_texture:new a.Uniform1i(w,u.u_texture)}),terrainDepth:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix)}),terrainCoords:(w,u)=>({u_matrix:new a.UniformMatrix4f(w,u.u_matrix),u_texture:new a.Uniform1i(w,u.u_texture),u_terrain_coords_id:new a.Uniform1f(w,u.u_terrain_coords_id)})};class np{constructor(u,m,x){this.context=u;const S=u.gl;this.buffer=S.createBuffer(),this.dynamicDraw=Boolean(x),this.context.unbindVAO(),u.bindElementBuffer.set(this.buffer),S.bufferData(S.ELEMENT_ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(u){const m=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),m.bufferSubData(m.ELEMENT_ARRAY_BUFFER,0,u.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const rp={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ip{constructor(u,m,x,S){this.length=m.length,this.attributes=x,this.itemSize=m.bytesPerElement,this.dynamicDraw=S,this.context=u;const R=u.gl;this.buffer=R.createBuffer(),u.bindVertexBuffer.set(this.buffer),R.bufferData(R.ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?R.DYNAMIC_DRAW:R.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(u){if(u.length!==this.length)throw new Error(`Length of new data is ${u.length}, which doesn't match current length of ${this.length}`);const m=this.context.gl;this.bind(),m.bufferSubData(m.ARRAY_BUFFER,0,u.arrayBuffer)}enableAttributes(u,m){for(let x=0;x0){const cn=a.create(),Jt=wt;a.mul(cn,_t.placementInvProjMatrix,w.transform.glCoordMatrix),a.mul(cn,cn,_t.placementViewportMatrix),ne.push({circleArray:xt,circleOffset:pe,transform:Jt,invTransform:cn,coord:ft}),le+=xt.length/4,pe=le}Ut&&G.draw(V,H.LINES,tr.disabled,Ir.disabled,w.colorModeForRenderPass(),$r.disabled,ls(wt,w.transform,st),w.style.terrain&&w.style.terrain.getTerrainData(ft),m.id,Ut.layoutVertexBuffer,Ut.indexBuffer,Ut.segments,null,w.transform.zoom,null,null,Ut.collisionVertexBuffer)}if(!L||!ne.length)return;const Te=w.useProgram("collisionCircle"),_e=new a.CollisionCircleLayoutArray;_e.resize(4*le),_e._trim();let Ee=0;for(const De of ne)for(let ft=0;ft=0&&(_e[Be.associatedIconIndex]={shiftedAnchor:$n,angle:Hn})}else St(Be.numGlyphs,pe)}if(G){Te.clear();const Ee=w.icon.placedSymbolArray;for(let Be=0;Bew.style.terrain.getElevation(Ut,Tp,hu):null,gl=m.layout.get("text-rotation-alignment")==="map";Xt(cn,Ut.posMatrix,w,S,Wo,vo,Be,G,gl,Go)}const yi=w.translatePosMatrix(Ut.posMatrix,xt,R,L),Zn=We||S&&_t||cf?q1:Wo,pr=w.translatePosMatrix(vo,xt,R,L,!0),Ii=$n&&m.paint.get(S?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let ki;ki=$n?cn.iconsInText?Fv(Hn.kind,gr,rt,Be,w,yi,Zn,pr,ar,la):qd(Hn.kind,gr,rt,Be,w,yi,Zn,pr,S,ar,!0):ep(Hn.kind,gr,rt,Be,w,yi,Zn,pr,S,ar);const Vr={program:mr,buffers:Jt,uniformValues:ki,atlasTexture:br,atlasTextureIcon:za,atlasInterpolation:Ti,atlasInterpolationIcon:Fa,isSDF:$n,hasHalo:Ii};if(De&&cn.canOverlap){ft=!0;const Go=Jt.segments.get();for(const gl of Go)wt.push({segments:new a.SegmentVector([gl]),sortKey:gl.sortKey,state:Vr,terrainData:ir})}else wt.push({segments:Jt.segments,sortKey:0,state:Vr,terrainData:ir})}ft&&wt.sort((Ut,xt)=>Ut.sortKey-xt.sortKey);for(const Ut of wt){const xt=Ut.state;if(pe.activeTexture.set(Te.TEXTURE0),xt.atlasTexture.bind(xt.atlasInterpolation,Te.CLAMP_TO_EDGE),xt.atlasTextureIcon&&(pe.activeTexture.set(Te.TEXTURE1),xt.atlasTextureIcon&&xt.atlasTextureIcon.bind(xt.atlasInterpolationIcon,Te.CLAMP_TO_EDGE)),xt.isSDF){const cn=xt.uniformValues;xt.hasHalo&&(cn.u_is_halo=1,bc(xt.buffers,Ut.segments,m,w,xt.program,st,ne,le,cn,Ut.terrainData)),cn.u_is_halo=0}bc(xt.buffers,Ut.segments,m,w,xt.program,st,ne,le,xt.uniformValues,Ut.terrainData)}}function bc(w,u,m,x,S,R,L,V,H,G){const ne=x.context;S.draw(ne,ne.gl.TRIANGLES,R,L,V,$r.disabled,H,G,m.id,w.layoutVertexBuffer,w.indexBuffer,u,m.paint,x.transform.zoom,w.programConfigurations.get(m.id),w.dynamicLayoutVertexBuffer,w.opacityVertexBuffer)}function _c(w,u,m,x,S,R,L){const V=w.context.gl,H=m.paint.get("fill-pattern"),G=H&&H.constantOr(1),ne=m.getCrossfadeParameters();let le,pe,Te,_e,Ee;L?(pe=G&&!m.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",le=V.LINES):(pe=G?"fillPattern":"fill",le=V.TRIANGLES);for(const Be of x){const We=u.getTile(Be);if(G&&!We.patternsLoaded())continue;const rt=We.getBucket(m);if(!rt)continue;const De=rt.programConfigurations.get(m.id),ft=w.useProgram(pe,De),st=w.style.terrain&&w.style.terrain.getTerrainData(Be);G&&(w.context.activeTexture.set(V.TEXTURE0),We.imageAtlasTexture.bind(V.LINEAR,V.CLAMP_TO_EDGE),De.updatePaintBuffers(ne));const _t=H.constantOr(null);if(_t&&We.imageAtlas){const xt=We.imageAtlas,cn=xt.patternPositions[_t.to.toString()],Jt=xt.patternPositions[_t.from.toString()];cn&&Jt&&De.setConstantPatternPositions(cn,Jt)}const wt=st?Be:null,Ut=w.translatePosMatrix(wt?wt.posMatrix:Be.posMatrix,We,m.paint.get("fill-translate"),m.paint.get("fill-translate-anchor"));if(L){_e=rt.indexBuffer2,Ee=rt.segments2;const xt=[V.drawingBufferWidth,V.drawingBufferHeight];Te=pe==="fillOutlinePattern"&&G?ru(Ut,w,ne,We,xt):ko(Ut,xt)}else _e=rt.indexBuffer,Ee=rt.segments,Te=G?Gr(Ut,w,ne,We):Tr(Ut);ft.draw(w.context,le,S,w.stencilModeForClipping(Be),R,$r.disabled,Te,st,m.id,rt.layoutVertexBuffer,_e,Ee,m.paint,w.transform.zoom,De)}}function wc(w,u,m,x,S,R,L){const V=w.context,H=V.gl,G=m.paint.get("fill-extrusion-pattern"),ne=G.constantOr(1),le=m.getCrossfadeParameters(),pe=m.paint.get("fill-extrusion-opacity");for(const Te of x){const _e=u.getTile(Te),Ee=_e.getBucket(m);if(!Ee)continue;const Be=w.style.terrain&&w.style.terrain.getTerrainData(Te),We=Ee.programConfigurations.get(m.id),rt=w.useProgram(ne?"fillExtrusionPattern":"fillExtrusion",We);ne&&(w.context.activeTexture.set(H.TEXTURE0),_e.imageAtlasTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE),We.updatePaintBuffers(le));const De=G.constantOr(null);if(De&&_e.imageAtlas){const wt=_e.imageAtlas,Ut=wt.patternPositions[De.to.toString()],xt=wt.patternPositions[De.from.toString()];Ut&&xt&&We.setConstantPatternPositions(Ut,xt)}const ft=w.translatePosMatrix(Te.posMatrix,_e,m.paint.get("fill-extrusion-translate"),m.paint.get("fill-extrusion-translate-anchor")),st=m.paint.get("fill-extrusion-vertical-gradient"),_t=ne?Er(ft,w,st,pe,Te,le,_e):rr(ft,w,st,pe);rt.draw(V,V.gl.TRIANGLES,S,R,L,$r.backCCW,_t,Be,m.id,Ee.layoutVertexBuffer,Ee.indexBuffer,Ee.segments,m.paint,w.transform.zoom,We,w.style.terrain&&Ee.centroidVertexBuffer)}}function hp(w,u,m,x,S,R,L){const V=w.context,H=V.gl,G=m.fbo;if(!G)return;const ne=w.useProgram("hillshade"),le=w.style.terrain&&w.style.terrain.getTerrainData(u);V.activeTexture.set(H.TEXTURE0),H.bindTexture(H.TEXTURE_2D,G.colorAttachment.get()),ne.draw(V,H.TRIANGLES,S,R,L,$r.disabled,((pe,Te,_e,Ee)=>{const Be=_e.paint.get("hillshade-shadow-color"),We=_e.paint.get("hillshade-highlight-color"),rt=_e.paint.get("hillshade-accent-color");let De=_e.paint.get("hillshade-illumination-direction")*(Math.PI/180);_e.paint.get("hillshade-illumination-anchor")==="viewport"&&(De-=pe.transform.angle);const ft=!pe.options.moving;return{u_matrix:Ee?Ee.posMatrix:pe.transform.calculatePosMatrix(Te.tileID.toUnwrapped(),ft),u_image:0,u_latrange:Fi(0,Te.tileID),u_light:[_e.paint.get("hillshade-exaggeration"),De],u_shadow:Be,u_highlight:We,u_accent:rt}})(w,m,x,le?u:null),le,x.id,w.rasterBoundsBuffer,w.quadTriangleIndexBuffer,w.rasterBoundsSegments)}function Gv(w,u,m,x,S,R){const L=w.context,V=L.gl,H=u.dem;if(H&&H.data){const G=H.dim,ne=H.stride,le=H.getPixels();if(L.activeTexture.set(V.TEXTURE1),L.pixelStoreUnpackPremultiplyAlpha.set(!1),u.demTexture=u.demTexture||w.getTileTexture(ne),u.demTexture){const Te=u.demTexture;Te.update(le,{premultiply:!1}),Te.bind(V.NEAREST,V.CLAMP_TO_EDGE)}else u.demTexture=new T(L,le,V.RGBA,{premultiply:!1}),u.demTexture.bind(V.NEAREST,V.CLAMP_TO_EDGE);L.activeTexture.set(V.TEXTURE0);let pe=u.fbo;if(!pe){const Te=new T(L,{width:G,height:G,data:null},V.RGBA);Te.bind(V.LINEAR,V.CLAMP_TO_EDGE),pe=u.fbo=L.createFramebuffer(G,G,!0),pe.colorAttachment.set(Te.texture)}L.bindFramebuffer.set(pe.framebuffer),L.viewport.set([0,0,G,G]),w.useProgram("hillshadePrepare").draw(L,V.TRIANGLES,x,S,R,$r.disabled,((Te,_e)=>{const Ee=_e.stride,Be=a.create();return a.ortho(Be,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(Be,Be,[0,-a.EXTENT,0]),{u_matrix:Be,u_image:1,u_dimension:[Ee,Ee],u_zoom:Te.overscaledZ,u_unpack:_e.getUnpackVector()}})(u.tileID,H),null,m.id,w.rasterBoundsBuffer,w.quadTriangleIndexBuffer,w.rasterBoundsSegments),u.needsHillshadePrepare=!1}}function nf(w,u,m,x,S,R){const L=x.paint.get("raster-fade-duration");if(!R&&L>0){const V=a.exported.now(),H=(V-w.timeAdded)/L,G=u?(V-u.timeAdded)/L:-1,ne=m.getSource(),le=S.coveringZoomLevel({tileSize:ne.tileSize,roundZoom:ne.roundZoom}),pe=!u||Math.abs(u.tileID.overscaledZ-le)>Math.abs(w.tileID.overscaledZ-le),Te=pe&&w.refreshedUponExpiration?1:a.clamp(pe?H:1-G,0,1);return w.refreshedUponExpiration&&H>=1&&(w.refreshedUponExpiration=!1),u?{opacity:1,mix:1-Te}:{opacity:Te,mix:0}}return{opacity:1,mix:0}}const rf=new a.Color(1,0,0,1),sa=new a.Color(0,1,0,1),qv=new a.Color(0,0,1,1),pp=new a.Color(1,0,1,1),Zv=new a.Color(0,1,1,1);function hl(w,u,m,x){lu(w,0,u+m/2,w.transform.width,m,x)}function Cc(w,u,m,x){lu(w,u-m/2,0,m,w.transform.height,x)}function lu(w,u,m,x,S,R){const L=w.context,V=L.gl;V.enable(V.SCISSOR_TEST),V.scissor(u*w.pixelRatio,m*w.pixelRatio,x*w.pixelRatio,S*w.pixelRatio),L.clear({color:R}),V.disable(V.SCISSOR_TEST)}function Y1(w,u,m){const x=w.context,S=x.gl,R=m.posMatrix,L=w.useProgram("debug"),V=tr.disabled,H=Ir.disabled,G=w.colorModeForRenderPass(),ne="$debug",le=w.style.terrain&&w.style.terrain.getTerrainData(m);x.activeTexture.set(S.TEXTURE0),w.emptyTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE);const pe=u.getTileByID(m.key).latestRawTileData,Te=Math.floor((pe&&pe.byteLength||0)/1024),_e=u.getTile(m).tileSize,Ee=512/Math.min(_e,512)*(m.overscaledZ/w.transform.zoom)*.5;let Be=m.canonical.toString();m.overscaledZ!==m.canonical.z&&(Be+=` => ${m.overscaledZ}`),function(We,rt){We.initDebugOverlayCanvas();const De=We.debugOverlayCanvas,ft=We.context.gl,st=We.debugOverlayCanvas.getContext("2d");st.clearRect(0,0,De.width,De.height),st.shadowColor="white",st.shadowBlur=2,st.lineWidth=1.5,st.strokeStyle="white",st.textBaseline="top",st.font="bold 36px Open Sans, sans-serif",st.fillText(rt,5,5),st.strokeText(rt,5,5),We.debugOverlayTexture.update(De),We.debugOverlayTexture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE)}(w,`${Be} ${Te}kB`),L.draw(x,S.TRIANGLES,V,H,Or.alphaBlended,$r.disabled,Vn(R,a.Color.transparent,Ee),null,ne,w.debugBuffer,w.quadTriangleIndexBuffer,w.debugSegments),L.draw(x,S.LINE_STRIP,V,H,G,$r.disabled,Vn(R,a.Color.red),le,ne,w.debugBuffer,w.tileBorderIndexBuffer,w.debugSegments)}function of(w,u,m){const x=w.context,S=x.gl,R=w.colorModeForRenderPass(),L=new tr(S.LEQUAL,tr.ReadWrite,w.depthRangeFor3D),V=w.useProgram("terrain"),H=u.getTerrainMesh(),G=u.getTerrainData(m.tileID);x.bindFramebuffer.set(null),x.viewport.set([0,0,w.width,w.height]),x.activeTexture.set(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,u.getRTTFramebuffer().colorAttachment.get());const ne=w.transform.calculatePosMatrix(m.tileID.toUnwrapped());V.draw(x,S.TRIANGLES,L,Ir.disabled,R,$r.backCCW,{u_matrix:ne,u_texture:0},G,"terrain",H.vertexBuffer,H.indexBuffer,H.segments)}function Xv(w,u,m,x){const S=w.context,R=m.tileSize*u.qualityFactor;m.textures[x]||(m.textures[x]=w.getTileTexture(R)||new T(S,{width:R,height:R,data:null},S.gl.RGBA),m.textures[x].bind(S.gl.LINEAR,S.gl.CLAMP_TO_EDGE),x===0&&u.sourceCache.renderHistory.unshift(m.tileID.key));const L=u.getRTTFramebuffer();L.colorAttachment.set(m.textures[x].texture),S.bindFramebuffer.set(L.framebuffer),S.viewport.set([0,0,R,R])}class Yv{constructor(u){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=u,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=u.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){const u=this.painter.style,m=u.terrain;for(const x in u.sourceCaches){this._coordsDescendingInv[x]={};const S=u.sourceCaches[x].getVisibleCoordinates();for(const R of S){const L=m.sourceCache.getTerrainCoords(R);for(const V in L)this._coordsDescendingInv[x][V]||(this._coordsDescendingInv[x][V]=[]),this._coordsDescendingInv[x][V].push(L[V])}}for(const x of u._order){const S=u._layers[x],R=S.source;if(this._renderToTexture[S.type]&&!this._coordsDescendingInvStr[R]){this._coordsDescendingInvStr[R]={};for(const L in this._coordsDescendingInv[R])this._coordsDescendingInvStr[R][L]=this._coordsDescendingInv[R][L].map(V=>V.key).sort().join()}}return this._renderableTiles.forEach(x=>{for(const S in this._coordsDescendingInvStr){const R=this._coordsDescendingInvStr[S][x.tileID.key];R&&R!==x.textureCoords[S]&&x.clearTextures(this.painter),m.needsRerender(S,x.tileID)&&x.clearTextures(this.painter)}this._rerender[x.tileID.key]=!x.textures.length}),m.clearRerenderCache(),m.sourceCache.removeOutdated(this.painter),this}renderLayer(u){const m=u.type,x=this.painter,S=x.style._order,R=x.currentLayer,L=R+1===S.length;if(this._renderToTexture[m]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=m,this._stacks[this._stacks.length-1].push(S[R]),!L))return!0;if(this._renderToTexture[this._prevType]||m==="hillshade"||this._renderToTexture[m]&&L){this._prevType=m;const V=this._stacks.length-1,H=this._stacks[V]||[];for(const G of this._renderableTiles){if(Xv(x,x.style.terrain,G,V),this._rerender[G.tileID.key]){x.context.clear({color:a.Color.transparent});for(let ne=0;neH.style.terrain.getElevation(We,xt,cn):null)}}}(x,w,m,u,m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),S),m.paint.get("icon-opacity").constantOr(1)!==0&&tf(w,u,m,x,!1,m.paint.get("icon-translate"),m.paint.get("icon-translate-anchor"),m.layout.get("icon-rotation-alignment"),m.layout.get("icon-pitch-alignment"),m.layout.get("icon-keep-upright"),R,L),m.paint.get("text-opacity").constantOr(1)!==0&&tf(w,u,m,x,!0,m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),m.layout.get("text-keep-upright"),R,L),u.map.showCollisionBoxes&&(su(w,u,m,x,m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),!0),su(w,u,m,x,m.paint.get("icon-translate"),m.paint.get("icon-translate-anchor"),!1))},circle:function(w,u,m,x){if(w.renderPass!=="translucent")return;const S=m.paint.get("circle-opacity"),R=m.paint.get("circle-stroke-width"),L=m.paint.get("circle-stroke-opacity"),V=!m.layout.get("circle-sort-key").isConstant();if(S.constantOr(1)===0&&(R.constantOr(1)===0||L.constantOr(1)===0))return;const H=w.context,G=H.gl,ne=w.depthModeForSublayer(0,tr.ReadOnly),le=Ir.disabled,pe=w.colorModeForRenderPass(),Te=[];for(let _e=0;_e_e.sortKey-Ee.sortKey);for(const _e of Te){const{programConfiguration:Ee,program:Be,layoutVertexBuffer:We,indexBuffer:rt,uniformValues:De,terrainData:ft}=_e.state;Be.draw(H,G.TRIANGLES,ne,le,pe,$r.disabled,De,ft,m.id,We,rt,_e.segments,m.paint,w.transform.zoom,Ee)}},heatmap:function(w,u,m,x){if(m.paint.get("heatmap-opacity")!==0)if(w.renderPass==="offscreen"){const S=w.context,R=S.gl,L=Ir.disabled,V=new Or([R.ONE,R.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(H,G,ne){const le=H.gl;H.activeTexture.set(le.TEXTURE1),H.viewport.set([0,0,G.width/4,G.height/4]);let pe=ne.heatmapFbo;if(pe)le.bindTexture(le.TEXTURE_2D,pe.colorAttachment.get()),H.bindFramebuffer.set(pe.framebuffer);else{const Te=le.createTexture();le.bindTexture(le.TEXTURE_2D,Te),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_WRAP_S,le.CLAMP_TO_EDGE),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_WRAP_T,le.CLAMP_TO_EDGE),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_MIN_FILTER,le.LINEAR),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_MAG_FILTER,le.LINEAR),pe=ne.heatmapFbo=H.createFramebuffer(G.width/4,G.height/4,!1),function(_e,Ee,Be,We){const rt=_e.gl;rt.texImage2D(rt.TEXTURE_2D,0,rt.RGBA,Ee.width/4,Ee.height/4,0,rt.RGBA,_e.extRenderToTextureHalfFloat?_e.extTextureHalfFloat.HALF_FLOAT_OES:rt.UNSIGNED_BYTE,null),We.colorAttachment.set(Be)}(H,G,Te,pe)}})(S,w,m),S.clear({color:a.Color.transparent});for(let H=0;H{const _e=a.create();a.ortho(_e,0,ne.width,ne.height,0,0,1);const Ee=ne.context.gl;return{u_matrix:_e,u_world:[Ee.drawingBufferWidth,Ee.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:le.paint.get("heatmap-opacity")}})(S,R),null,R.id,S.viewportBuffer,S.quadTriangleIndexBuffer,S.viewportSegments,R.paint,S.transform.zoom)}(w,m))},line:function(w,u,m,x){if(w.renderPass!=="translucent")return;const S=m.paint.get("line-opacity"),R=m.paint.get("line-width");if(S.constantOr(1)===0||R.constantOr(1)===0)return;const L=w.depthModeForSublayer(0,tr.ReadOnly),V=w.colorModeForRenderPass(),H=m.paint.get("line-dasharray"),G=m.paint.get("line-pattern"),ne=G.constantOr(1),le=m.paint.get("line-gradient"),pe=m.getCrossfadeParameters(),Te=ne?"linePattern":H?"lineSDF":le?"lineGradient":"line",_e=w.context,Ee=_e.gl;let Be=!0;for(const We of x){const rt=u.getTile(We);if(ne&&!rt.patternsLoaded())continue;const De=rt.getBucket(m);if(!De)continue;const ft=De.programConfigurations.get(m.id),st=w.context.program.get(),_t=w.useProgram(Te,ft),wt=Be||_t.program!==st,Ut=w.style.terrain&&w.style.terrain.getTerrainData(We),xt=G.constantOr(null);if(xt&&rt.imageAtlas){const fn=rt.imageAtlas,$n=fn.patternPositions[xt.to.toString()],Hn=fn.patternPositions[xt.from.toString()];$n&&Hn&&ft.setConstantPatternPositions($n,Hn)}const cn=Ut?We:null,Jt=ne?dl(w,rt,m,pe,cn):H?us(w,rt,m,H,pe,cn):le?Ho(w,rt,m,De.lineClipsArray.length,cn):As(w,rt,m,cn);if(ne)_e.activeTexture.set(Ee.TEXTURE0),rt.imageAtlasTexture.bind(Ee.LINEAR,Ee.CLAMP_TO_EDGE),ft.updatePaintBuffers(pe);else if(H&&(wt||w.lineAtlas.dirty))_e.activeTexture.set(Ee.TEXTURE0),w.lineAtlas.bind(_e);else if(le){const fn=De.gradients[m.id];let $n=fn.texture;if(m.gradientVersion!==fn.version){let Hn=256;if(m.stepInterpolant){const Tn=u.getSource().maxzoom,mr=We.canonical.z===Tn?Math.ceil(1<256&&this.clearStencil(),x.setColorMode(Or.disabled),x.setDepthMode(tr.disabled);const R=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const L of m){const V=this._tileClippingMaskIDs[L.key]=this.nextStencilID++,H=this.style.terrain&&this.style.terrain.getTerrainData(L);R.draw(x,S.TRIANGLES,tr.disabled,new Ir({func:S.ALWAYS,mask:0},V,255,S.KEEP,S.KEEP,S.REPLACE),Or.disabled,$r.disabled,er(L.posMatrix),H,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const u=this.nextStencilID++,m=this.context.gl;return new Ir({func:m.NOTEQUAL,mask:255},u,255,m.KEEP,m.KEEP,m.REPLACE)}stencilModeForClipping(u){const m=this.context.gl;return new Ir({func:m.EQUAL,mask:255},this._tileClippingMaskIDs[u.key],0,m.KEEP,m.KEEP,m.REPLACE)}stencilConfigForOverlap(u){const m=this.context.gl,x=u.sort((L,V)=>V.overscaledZ-L.overscaledZ),S=x[x.length-1].overscaledZ,R=x[0].overscaledZ-S+1;if(R>1){this.currentStencilSource=void 0,this.nextStencilID+R>256&&this.clearStencil();const L={};for(let V=0;V=0;this.currentLayer--){const G=this.style._layers[x[this.currentLayer]],ne=S[G.source],le=L[G.source];this._renderTileClippingMasks(G,le),this.renderLayer(this,ne,G,le)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer{le.source&&!le.isHidden(this.transform.zoom)&&(le.source!==(ne&&ne.id)&&(ne=this.style.sourceCaches[le.source]),(!G||G.getSource().maxzoom0?m.pop():null}isPatternMissing(u){if(!u)return!1;if(!u.from||!u.to)return!0;const m=this.imageManager.getPattern(u.from.toString()),x=this.imageManager.getPattern(u.to.toString());return!m||!x}useProgram(u,m){this.cache=this.cache||{};const x=u+(m?m.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[x]||(this.cache[x]=new Wn(this.context,u,Mn[u],m,tp[u],this._showOverdrawInspector,this.style.terrain)),this.cache[x]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const u=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(u.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class af{constructor(u,m){this.points=u,this.planes=m}static fromInvProjectionMatrix(u,m,x){const S=Math.pow(2,x),R=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(V=>{const H=1/(V=a.transformMat4([],V,u))[3]/m*S;return a.mul$1(V,V,[H,H,1/V[3],H])}),L=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(V=>{const H=a.sub([],R[V[0]],R[V[1]]),G=a.sub([],R[V[2]],R[V[1]]),ne=a.normalize([],a.cross([],H,G)),le=-a.dot(ne,R[V[1]]);return ne.concat(le)});return new af(R,L)}}class Ec{constructor(u,m){this.min=u,this.max=m,this.center=a.scale$1([],a.add([],this.min,this.max),.5)}quadrant(u){const m=[u%2==0,u<2],x=a.clone$2(this.min),S=a.clone$2(this.max);for(let R=0;R=0&&L++;if(L===0)return 0;L!==m.length&&(x=!1)}if(x)return 2;for(let S=0;S<3;S++){let R=Number.MAX_VALUE,L=-Number.MAX_VALUE;for(let V=0;Vthis.max[S]-this.min[S])return 0}return 1}}class uu{constructor(u=0,m=0,x=0,S=0){if(isNaN(u)||u<0||isNaN(m)||m<0||isNaN(x)||x<0||isNaN(S)||S<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=u,this.bottom=m,this.left=x,this.right=S}interpolate(u,m,x){return m.top!=null&&u.top!=null&&(this.top=a.number(u.top,m.top,x)),m.bottom!=null&&u.bottom!=null&&(this.bottom=a.number(u.bottom,m.bottom,x)),m.left!=null&&u.left!=null&&(this.left=a.number(u.left,m.left,x)),m.right!=null&&u.right!=null&&(this.right=a.number(u.right,m.right,x)),this}getCenter(u,m){const x=a.clamp((this.left+u-this.right)/2,0,u),S=a.clamp((this.top+m-this.bottom)/2,0,m);return new a.pointGeometry(x,S)}equals(u){return this.top===u.top&&this.bottom===u.bottom&&this.left===u.left&&this.right===u.right}clone(){return new uu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Pc{constructor(u,m,x,S,R){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=R===void 0||!!R,this._minZoom=u||0,this._maxZoom=m||22,this._minPitch=x==null?0:x,this._maxPitch=S==null?60:S,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new uu,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const u=new Pc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return u.tileSize=this.tileSize,u.latRange=this.latRange,u.width=this.width,u.height=this.height,u._center=this._center,u._elevation=this._elevation,u.zoom=this.zoom,u.angle=this.angle,u._fov=this._fov,u._pitch=this._pitch,u._unmodified=this._unmodified,u._edgeInsets=this._edgeInsets.clone(),u._calcMatrices(),u}get minZoom(){return this._minZoom}set minZoom(u){this._minZoom!==u&&(this._minZoom=u,this.zoom=Math.max(this.zoom,u))}get maxZoom(){return this._maxZoom}set maxZoom(u){this._maxZoom!==u&&(this._maxZoom=u,this.zoom=Math.min(this.zoom,u))}get minPitch(){return this._minPitch}set minPitch(u){this._minPitch!==u&&(this._minPitch=u,this.pitch=Math.max(this.pitch,u))}get maxPitch(){return this._maxPitch}set maxPitch(u){this._maxPitch!==u&&(this._maxPitch=u,this.pitch=Math.min(this.pitch,u))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(u){u===void 0?u=!0:u===null&&(u=!1),this._renderWorldCopies=u}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(u){const m=-a.wrap(u,-180,180)*Math.PI/180;var x;this.angle!==m&&(this._unmodified=!1,this.angle=m,this._calcMatrices(),this.rotationMatrix=(x=new a.ARRAY_TYPE(4),a.ARRAY_TYPE!=Float32Array&&(x[1]=0,x[2]=0),x[0]=1,x[3]=1,x),function(S,R,L){var V=R[0],H=R[1],G=R[2],ne=R[3],le=Math.sin(L),pe=Math.cos(L);S[0]=V*pe+G*le,S[1]=H*pe+ne*le,S[2]=V*-le+G*pe,S[3]=H*-le+ne*pe}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(u){const m=a.clamp(u,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==m&&(this._unmodified=!1,this._pitch=m,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(u){u=Math.max(.01,Math.min(60,u)),this._fov!==u&&(this._unmodified=!1,this._fov=u/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(u){const m=Math.min(Math.max(u,this.minZoom),this.maxZoom);this._zoom!==m&&(this._unmodified=!1,this._zoom=m,this.scale=this.zoomScale(m),this.tileZoom=Math.floor(m),this.zoomFraction=m-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(u){u.lat===this._center.lat&&u.lng===this._center.lng||(this._unmodified=!1,this._center=u,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(u){u!==this._elevation&&(this._elevation=u,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(u){this._edgeInsets.equals(u)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,u,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(u){return this._edgeInsets.equals(u)}interpolatePadding(u,m,x){this._unmodified=!1,this._edgeInsets.interpolate(u,m,x),this._constrain(),this._calcMatrices()}coveringZoomLevel(u){const m=(u.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/u.tileSize));return Math.max(0,m)}getVisibleUnwrappedCoordinates(u){const m=[new a.UnwrappedTileID(0,u)];if(this._renderWorldCopies){const x=this.pointCoordinate(new a.pointGeometry(0,0)),S=this.pointCoordinate(new a.pointGeometry(this.width,0)),R=this.pointCoordinate(new a.pointGeometry(this.width,this.height)),L=this.pointCoordinate(new a.pointGeometry(0,this.height)),V=Math.floor(Math.min(x.x,S.x,R.x,L.x)),H=Math.floor(Math.max(x.x,S.x,R.x,L.x)),G=1;for(let ne=V-G;ne<=H+G;ne++)ne!==0&&m.push(new a.UnwrappedTileID(ne,u))}return m}coveringTiles(u){var m,x;let S=this.coveringZoomLevel(u);const R=S;if(u.minzoom!==void 0&&Su.maxzoom&&(S=u.maxzoom);const L=this.pointCoordinate(this.getCameraPoint()),V=a.MercatorCoordinate.fromLngLat(this.center),H=Math.pow(2,S),G=[H*L.x,H*L.y,0],ne=[H*V.x,H*V.y,0],le=af.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,S);let pe=u.minzoom||0;!u.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(pe=S);const Te=u.terrain?2/Math.min(this.tileSize,u.tileSize)*this.tileSize:3,_e=De=>({aabb:new Ec([De*H,0,0],[(De+1)*H,H,0]),zoom:0,x:0,y:0,wrap:De,fullyVisible:!1}),Ee=[],Be=[],We=S,rt=u.reparseOverscaled?R:S;if(this._renderWorldCopies)for(let De=1;De<=3;De++)Ee.push(_e(-De)),Ee.push(_e(De));for(Ee.push(_e(0));Ee.length>0;){const De=Ee.pop(),ft=De.x,st=De.y;let _t=De.fullyVisible;if(!_t){const fn=De.aabb.intersects(le);if(fn===0)continue;_t=fn===2}const wt=u.terrain?G:ne,Ut=De.aabb.distanceX(wt),xt=De.aabb.distanceY(wt),cn=Math.max(Math.abs(Ut),Math.abs(xt)),Jt=Te+(1<Jt&&De.zoom>=pe){const fn=We-De.zoom,$n=G[0]-.5-(ft<>1),Tn=De.zoom+1;let mr=De.aabb.quadrant(fn);if(u.terrain){const gr=new a.OverscaledTileID(Tn,De.wrap,Tn,$n,Hn),ir=u.terrain.getMinMaxElevation(gr),ar=(m=ir.minElevation)!==null&&m!==void 0?m:this.elevation,br=(x=ir.maxElevation)!==null&&x!==void 0?x:this.elevation;mr=new Ec([mr.min[0],mr.min[1],ar],[mr.max[0],mr.max[1],br])}Ee.push({aabb:mr,zoom:Tn,x:$n,y:Hn,wrap:De.wrap,fullyVisible:_t})}}return Be.sort((De,ft)=>De.distanceSq-ft.distanceSq).map(De=>De.tileID)}resize(u,m){this.width=u,this.height=m,this.pixelsToGLUnits=[2/u,-2/m],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(u){return Math.pow(2,u)}scaleZoom(u){return Math.log(u)/Math.LN2}project(u){const m=a.clamp(u.lat,-this.maxValidLatitude,this.maxValidLatitude);return new a.pointGeometry(a.mercatorXfromLng(u.lng)*this.worldSize,a.mercatorYfromLat(m)*this.worldSize)}unproject(u){return new a.MercatorCoordinate(u.x/this.worldSize,u.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(u){this.freezeElevation||(this.elevation=u?this.getElevation(this._center,u):0)}getElevation(u,m){const x=a.MercatorCoordinate.fromLngLat(u),S=(1<L&&(S=L-_e)}if(this.lngRange){const Te=(V+H)/2,_e=a.wrap(le.x,Te-this.worldSize/2,Te+this.worldSize/2),Ee=G.x/2;_e-EeH&&(x=H-Ee)}x===void 0&&S===void 0||(this.center=this.unproject(new a.pointGeometry(x!==void 0?x:le.x,S!==void 0?S:le.y)).wrap()),this._unmodified=ne,this._constraining=!1}_calcMatrices(){if(!this.height)return;const u=this.centerOffset,m=this.point.x,x=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=a.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let S=a.identity(new Float64Array(16));a.scale(S,S,[this.width/2,-this.height/2,1]),a.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=a.identity(new Float64Array(16)),a.scale(S,S,[1,-1,1]),a.translate(S,S,[-1,-1,0]),a.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const R=Math.PI/2+this._pitch,L=this._fov*(.5+u.y/this.height),V=Math.sin(L)*this.cameraToSeaLevelDistance/Math.sin(a.clamp(Math.PI-R-L,.01,Math.PI-.01)),H=this.getHorizon(),G=2*Math.atan(H/this.cameraToCenterDistance)*(.5+u.y/(2*H)),ne=Math.sin(G)*this.cameraToSeaLevelDistance/Math.sin(a.clamp(Math.PI-R-G,.01,Math.PI-.01)),le=Math.cos(Math.PI/2-this._pitch)*V+this.cameraToSeaLevelDistance,pe=Math.cos(Math.PI/2-this._pitch)*ne+this.cameraToSeaLevelDistance,Te=1.01*Math.min(le,pe),_e=this.height/50;S=new Float64Array(16),a.perspective(S,this._fov,this.width/this.height,_e,Te),S[8]=2*-u.x/this.width,S[9]=2*u.y/this.height,a.scale(S,S,[1,-1,1]),a.translate(S,S,[0,0,-this.cameraToCenterDistance]),a.rotateX(S,S,this._pitch),a.rotateZ(S,S,this.angle),a.translate(S,S,[-m,-x,0]),this.mercatorMatrix=a.scale([],S,[this.worldSize,this.worldSize,this.worldSize]),a.scale(S,S,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,S),a.translate(S,S,[0,0,-this.elevation]),this.projMatrix=S,this.invProjMatrix=a.invert([],S),this.pixelMatrix3D=a.multiply(new Float64Array(16),this.labelPlaneMatrix,S);const Ee=this.width%2/2,Be=this.height%2/2,We=Math.cos(this.angle),rt=Math.sin(this.angle),De=m-Math.round(m)+We*Ee+rt*Be,ft=x-Math.round(x)+We*Be+rt*Ee,st=new Float64Array(S);if(a.translate(st,st,[De>.5?De-1:De,ft>.5?ft-1:ft,0]),this.alignedProjMatrix=st,S=a.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");this.pixelMatrixInverse=S,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const u=this.pointCoordinate(new a.pointGeometry(0,0)),m=[u.x*this.worldSize,u.y*this.worldSize,0,1];return a.transformMat4(m,m,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const u=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.pointGeometry(0,u))}getCameraQueryGeometry(u){const m=this.getCameraPoint();if(u.length===1)return[u[0],m];{let x=m.x,S=m.y,R=m.x,L=m.y;for(const V of u)x=Math.min(x,V.x),S=Math.min(S,V.y),R=Math.max(R,V.x),L=Math.max(L,V.y);return[new a.pointGeometry(x,S),new a.pointGeometry(R,S),new a.pointGeometry(R,L),new a.pointGeometry(x,L),new a.pointGeometry(x,S)]}}}class Qv{constructor(u){this._hashName=u&&encodeURIComponent(u),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(m,x){let S=!1,R=null;const L=()=>{R=null,S&&(m(),R=setTimeout(L,300),S=!1)};return()=>(S=!0,R||L(),R)}(this._updateHashUnthrottled.bind(this))}addTo(u){return this._map=u,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(u){const m=this._map.getCenter(),x=Math.round(100*this._map.getZoom())/100,S=Math.ceil((x*Math.LN2+Math.log(512/360/.5))/Math.LN10),R=Math.pow(10,S),L=Math.round(m.lng*R)/R,V=Math.round(m.lat*R)/R,H=this._map.getBearing(),G=this._map.getPitch();let ne="";if(ne+=u?`/${L}/${V}/${x}`:`${x}/${V}/${L}`,(H||G)&&(ne+="/"+Math.round(10*H)/10),G&&(ne+=`/${Math.round(G)}`),this._hashName){const le=this._hashName;let pe=!1;const Te=window.location.hash.slice(1).split("&").map(_e=>{const Ee=_e.split("=")[0];return Ee===le?(pe=!0,`${Ee}=${ne}`):_e}).filter(_e=>_e);return pe||Te.push(`${le}=${ne}`),`#${Te.join("&")}`}return`#${ne}`}_getCurrentHash(){const u=window.location.hash.replace("#","");if(this._hashName){let m;return u.split("&").map(x=>x.split("=")).forEach(x=>{x[0]===this._hashName&&(m=x)}),(m&&m[1]||"").split("/")}return u.split("/")}_onHashChange(){const u=this._getCurrentHash();if(u.length>=3&&!u.some(m=>isNaN(m))){const m=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(u[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+u[2],+u[1]],zoom:+u[0],bearing:m,pitch:+(u[4]||0)}),!0}return!1}_updateHashUnthrottled(){const u=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,u)}catch{}}}const Tc={linearity:.3,easing:a.bezier(0,0,.3,1)},Jv=a.extend({deceleration:2500,maxSpeed:1400},Tc),ey=a.extend({deceleration:20,maxSpeed:1400},Tc),ty=a.extend({deceleration:1e3,maxSpeed:360},Tc),cu=a.extend({deceleration:1e3,maxSpeed:90},Tc);class ny{constructor(u){this._map=u,this.clear()}clear(){this._inertiaBuffer=[]}record(u){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.exported.now(),settings:u})}_drainInertiaBuffer(){const u=this._inertiaBuffer,m=a.exported.now();for(;u.length>0&&m-u[0].time>160;)u.shift()}_onMoveEnd(u){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const m={zoom:0,bearing:0,pitch:0,pan:new a.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:R}of this._inertiaBuffer)m.zoom+=R.zoomDelta||0,m.bearing+=R.bearingDelta||0,m.pitch+=R.pitchDelta||0,R.panDelta&&m.pan._add(R.panDelta),R.around&&(m.around=R.around),R.pinchAround&&(m.pinchAround=R.pinchAround);const x=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,S={};if(m.pan.mag()){const R=kc(m.pan.mag(),x,a.extend({},Jv,u||{}));S.offset=m.pan.mult(R.amount/m.pan.mag()),S.center=this._map.transform.center,Ic(S,R)}if(m.zoom){const R=kc(m.zoom,x,ey);S.zoom=this._map.transform.zoom+R.amount,Ic(S,R)}if(m.bearing){const R=kc(m.bearing,x,ty);S.bearing=this._map.transform.bearing+a.clamp(R.amount,-179,179),Ic(S,R)}if(m.pitch){const R=kc(m.pitch,x,cu);S.pitch=this._map.transform.pitch+R.amount,Ic(S,R)}if(S.zoom||S.bearing){const R=m.pinchAround===void 0?m.around:m.pinchAround;S.around=R?this._map.unproject(R):this._map.getCenter()}return this.clear(),a.extend(S,{noMoveStart:!0})}}function Ic(w,u){(!w.duration||w.durationm.unproject(H)),V=R.reduce((H,G,ne,le)=>H.add(G.div(le.length)),new a.pointGeometry(0,0));super(u,{points:R,point:V,lngLats:L,lngLat:m.unproject(V),originalEvent:x}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Do extends a.Event{constructor(u,m,x){super(u,{originalEvent:x}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Q1{constructor(u,m){this._map=u,this._clickTolerance=m.clickTolerance}reset(){delete this._mousedownPos}wheel(u){return this._firePreventable(new Do(u.type,this._map,u))}mousedown(u,m){return this._mousedownPos=m,this._firePreventable(new Ro(u.type,this._map,u))}mouseup(u){this._map.fire(new Ro(u.type,this._map,u))}click(u,m){this._mousedownPos&&this._mousedownPos.dist(m)>=this._clickTolerance||this._map.fire(new Ro(u.type,this._map,u))}dblclick(u){return this._firePreventable(new Ro(u.type,this._map,u))}mouseover(u){this._map.fire(new Ro(u.type,this._map,u))}mouseout(u){this._map.fire(new Ro(u.type,this._map,u))}touchstart(u){return this._firePreventable(new Mc(u.type,this._map,u))}touchmove(u){this._map.fire(new Mc(u.type,this._map,u))}touchend(u){this._map.fire(new Mc(u.type,this._map,u))}touchcancel(u){this._map.fire(new Mc(u.type,this._map,u))}_firePreventable(u){if(this._map.fire(u),u.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ns{constructor(u){this._map=u}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(u){this._map.fire(new Ro(u.type,this._map,u))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ro("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(u){this._delayContextMenu?this._contextMenuEvent=u:this._ignoreContextMenu||this._map.fire(new Ro(u.type,this._map,u)),this._map.listens("contextmenu")&&u.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ry{constructor(u,m){this._map=u,this._el=u.getCanvasContainer(),this._container=u.getContainer(),this._clickTolerance=m.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(u,m){this.isEnabled()&&u.shiftKey&&u.button===0&&(v.disableDrag(),this._startPos=this._lastPos=m,this._active=!0)}mousemoveWindow(u,m){if(!this._active)return;const x=m;if(this._lastPos.equals(x)||!this._box&&x.dist(this._startPos)R.fitScreenCoordinates(x,S,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",u)}keydown(u){this._active&&u.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",u))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(v.remove(this._box),this._box=null),v.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(u,m){return this._map.fire(new a.Event(u,{originalEvent:m}))}}function ds(w,u){if(w.length!==u.length)throw new Error(`The number of touches and points are not equal - touches ${w.length}, points ${u.length}`);const m={};for(let x=0;xthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=u.timeStamp),x.length===this.numTouches&&(this.centroid=function(S){const R=new a.pointGeometry(0,0);for(const L of S)R._add(L);return R.div(S.length)}(m),this.touches=ds(x,m)))}touchmove(u,m,x){if(this.aborted||!this.centroid)return;const S=ds(x,m);for(const R in this.touches){const L=this.touches[R],V=S[R];(!V||V.dist(L)>30)&&(this.aborted=!0)}}touchend(u,m,x){if((!this.centroid||u.timeStamp-this.startTime>500)&&(this.aborted=!0),x.length===0){const S=!this.aborted&&this.centroid;if(this.reset(),S)return S}}}class gp{constructor(u){this.singleTap=new Rc(u),this.numTaps=u.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(u,m,x){this.singleTap.touchstart(u,m,x)}touchmove(u,m,x){this.singleTap.touchmove(u,m,x)}touchend(u,m,x){const S=this.singleTap.touchend(u,m,x);if(S){const R=u.timeStamp-this.lastTime<500,L=!this.lastTap||this.lastTap.dist(S)<30;if(R&&L||this.reset(),this.count++,this.lastTime=u.timeStamp,this.lastTap=S,this.count===this.numTaps)return this.reset(),S}}}class J1{constructor(){this._zoomIn=new gp({numTouches:1,numTaps:2}),this._zoomOut=new gp({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(u,m,x){this._zoomIn.touchstart(u,m,x),this._zoomOut.touchstart(u,m,x)}touchmove(u,m,x){this._zoomIn.touchmove(u,m,x),this._zoomOut.touchmove(u,m,x)}touchend(u,m,x){const S=this._zoomIn.touchend(u,m,x),R=this._zoomOut.touchend(u,m,x);return S?(this._active=!0,u.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:L.getZoom()+1,around:L.unproject(S)},{originalEvent:u})}):R?(this._active=!0,u.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:L.getZoom()-1,around:L.unproject(R)},{originalEvent:u})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const ew={0:1,2:2};class sf{constructor(u){this.reset(),this._clickTolerance=u.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(u,m){return!1}_move(u,m){return{}}mousedown(u,m){if(this._lastPoint)return;const x=v.mouseButton(u);this._correctButton(u,x)&&(this._lastPoint=m,this._eventButton=x)}mousemoveWindow(u,m){const x=this._lastPoint;if(x){if(u.preventDefault(),function(S,R){const L=ew[R];return S.buttons===void 0||(S.buttons&L)!==L}(u,this._eventButton))this.reset();else if(this._moved||!(m.dist(x){this._cancelCooperativeMessage=!1},200)}touchstart(u,m,x){return this._calculateTransform(u,m,x)}touchmove(u,m,x){if(this._map._cooperativeGestures&&(this._minTouches===2&&x.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(u,!1,x.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(x.length0&&(this._active=!0);const S=ds(x,m),R=new a.pointGeometry(0,0),L=new a.pointGeometry(0,0);let V=0;for(const G in S){const ne=S[G],le=this._touches[G];le&&(R._add(ne),L._add(ne.sub(le)),V++,S[G]=ne)}if(this._touches=S,VMath.abs(w.x)}class xp extends pl{constructor(u){super(),this._map=u}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(u,m,x){super.touchstart(u,m,x),this._currentTouchCount=x.length}_start(u){this._lastPoints=u,yp(u[0].sub(u[1]))&&(this._valid=!1)}_move(u,m,x){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const S=u[0].sub(this._lastPoints[0]),R=u[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(S,R,x.timeStamp),this._valid?(this._lastPoints=u,this._active=!0,{pitchDelta:(S.y+R.y)/2*-.5}):void 0}gestureBeginsVertically(u,m,x){if(this._valid!==void 0)return this._valid;const S=u.mag()>=2,R=m.mag()>=2;if(!S&&!R)return;if(!S||!R)return this._firstMove===void 0&&(this._firstMove=x),x-this._firstMove<100&&void 0;const L=u.y>0==m.y>0;return yp(u)&&yp(m)&&L}}const oy={panStep:100,bearingStep:15,pitchStep:10};class ay{constructor(){const u=oy;this._panStep=u.panStep,this._bearingStep=u.bearingStep,this._pitchStep=u.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(u){if(u.altKey||u.ctrlKey||u.metaKey)return;let m=0,x=0,S=0,R=0,L=0;switch(u.keyCode){case 61:case 107:case 171:case 187:m=1;break;case 189:case 109:case 173:m=-1;break;case 37:u.shiftKey?x=-1:(u.preventDefault(),R=-1);break;case 39:u.shiftKey?x=1:(u.preventDefault(),R=1);break;case 38:u.shiftKey?S=1:(u.preventDefault(),L=-1);break;case 40:u.shiftKey?S=-1:(u.preventDefault(),L=1);break;default:return}return this._rotationDisabled&&(x=0,S=0),{cameraAnimation:V=>{const H=V.getZoom();V.easeTo({duration:300,easeId:"keyboardHandler",easing:nw,zoom:m?Math.round(H)+m*(u.shiftKey?2:1):H,bearing:V.getBearing()+x*this._bearingStep,pitch:V.getPitch()+S*this._pitchStep,offset:[-R*this._panStep,-L*this._panStep],center:V.getCenter()},{originalEvent:u})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function nw(w){return w*(2-w)}const sy=4.000244140625;class bp{constructor(u,m){this._map=u,this._el=u.getCanvasContainer(),this._handler=m,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,a.bindAll(["_onTimeout"],this)}setZoomRate(u){this._defaultZoomRate=u}setWheelZoomRate(u){this._wheelZoomRate=u}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(u){this.isEnabled()||(this._enabled=!0,this._aroundCenter=u&&u.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(u){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;u.preventDefault()}let m=u.deltaMode===WheelEvent.DOM_DELTA_LINE?40*u.deltaY:u.deltaY;const x=a.exported.now(),S=x-(this._lastWheelEventTime||0);this._lastWheelEventTime=x,m!==0&&m%sy==0?this._type="wheel":m!==0&&Math.abs(m)<4?this._type="trackpad":S>400?(this._type=null,this._lastValue=m,this._timeout=setTimeout(this._onTimeout,40,u)):this._type||(this._type=Math.abs(S*m)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,m+=this._lastValue)),u.shiftKey&&m&&(m/=4),this._type&&(this._lastWheelEvent=u,this._delta-=m,this._active||this._start(u)),u.preventDefault()}_onTimeout(u){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(u)}_start(u){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const m=v.mousePos(this._el,u);this._around=a.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(m)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const u=this._map.transform;if(this._delta!==0){const V=this._type==="wheel"&&Math.abs(this._delta)>sy?this._wheelZoomRate:this._defaultZoomRate;let H=2/(1+Math.exp(-Math.abs(this._delta*V)));this._delta<0&&H!==0&&(H=1/H);const G=typeof this._targetZoom=="number"?u.zoomScale(this._targetZoom):u.scale;this._targetZoom=Math.min(u.maxZoom,Math.max(u.minZoom,u.scaleZoom(G*H))),this._type==="wheel"&&(this._startZoom=u.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const m=typeof this._targetZoom=="number"?this._targetZoom:u.zoom,x=this._startZoom,S=this._easing;let R,L=!1;if(this._type==="wheel"&&x&&S){const V=Math.min((a.exported.now()-this._lastWheelEventTime)/200,1),H=S(V);R=a.number(x,m,H),V<1?this._frameId||(this._frameId=!0):L=!0}else R=m,L=!0;return this._active=!0,L&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!L,zoomDelta:R-u.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(u){let m=a.ease;if(this._prevEase){const x=this._prevEase,S=(a.exported.now()-x.start)/x.duration,R=x.easing(S+.01)-x.easing(S),L=.27/Math.sqrt(R*R+1e-4)*.01,V=Math.sqrt(.0729-L*L);m=a.bezier(L,V,.25,1)}return this._prevEase={start:a.exported.now(),duration:u,easing:m},m}reset(){this._active=!1}}class _p{constructor(u,m){this._clickZoom=u,this._tapZoom=m}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class wp{constructor(){this.reset()}reset(){this._active=!1}dblclick(u,m){return u.preventDefault(),{cameraAnimation:x=>{x.easeTo({duration:300,zoom:x.getZoom()+(u.shiftKey?-1:1),around:x.unproject(m)},{originalEvent:u})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Cp{constructor(){this._tap=new gp({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(u,m,x){this._swipePoint||(this._tapTime&&u.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?x.length>0&&(this._swipePoint=m[0],this._swipeTouch=x[0].identifier):this._tap.touchstart(u,m,x))}touchmove(u,m,x){if(this._tapTime){if(this._swipePoint){if(x[0].identifier!==this._swipeTouch)return;const S=m[0],R=S.y-this._swipePoint.y;return this._swipePoint=S,u.preventDefault(),this._active=!0,{zoomDelta:R/128}}}else this._tap.touchmove(u,m,x)}touchend(u,m,x){this._tapTime?this._swipePoint&&x.length===0&&this.reset():this._tap.touchend(u,m,x)&&(this._tapTime=u.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class go{constructor(u,m,x){this._el=u,this._mousePan=m,this._touchPan=x}enable(u){this._inertiaOptions=u||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Fs{constructor(u,m,x){this._pitchWithRotate=u.pitchWithRotate,this._mouseRotate=m,this._mousePitch=x}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ly{constructor(u,m,x,S){this._el=u,this._touchZoom=m,this._touchRotate=x,this._tapDragZoom=S,this._rotationDisabled=!1,this._enabled=!0}enable(u){this._touchZoom.enable(u),this._rotationDisabled||this._touchRotate.enable(u),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const du=w=>w.zoom||w.drag||w.pitch||w.rotate;class Sp extends a.Event{}function Oc(w){return w.panDelta&&w.panDelta.mag()||w.zoomDelta||w.bearingDelta||w.pitchDelta}class uy{constructor(u,m){this._map=u,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ny(u),this._bearingSnap=m.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(m),a.bindAll(["handleEvent","handleWindowEvent"],this);const x=this._el;this._listeners=[[x,"touchstart",{passive:!0}],[x,"touchmove",{passive:!1}],[x,"touchend",void 0],[x,"touchcancel",void 0],[x,"mousedown",void 0],[x,"mousemove",void 0],[x,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[x,"mouseover",void 0],[x,"mouseout",void 0],[x,"dblclick",void 0],[x,"click",void 0],[x,"keydown",{capture:!1}],[x,"keyup",void 0],[x,"wheel",{passive:!1}],[x,"contextmenu",void 0],[window,"blur",void 0]];for(const[S,R,L]of this._listeners)v.addEventListener(S,R,S===document?this.handleWindowEvent:this.handleEvent,L)}destroy(){for(const[u,m,x]of this._listeners)v.removeEventListener(u,m,u===document?this.handleWindowEvent:this.handleEvent,x)}_addDefaultHandlers(u){const m=this._map,x=m.getCanvasContainer();this._add("mapEvent",new Q1(m,u));const S=m.boxZoom=new ry(m,u);this._add("boxZoom",S);const R=new J1,L=new wp;m.doubleClickZoom=new _p(L,R),this._add("tapZoom",R),this._add("clickZoom",L);const V=new Cp;this._add("tapDragZoom",V);const H=m.touchPitch=new xp(m);this._add("touchPitch",H);const G=new fs(u),ne=new gn(u);m.dragRotate=new Fs(u,G,ne),this._add("mouseRotate",G,["mousePitch"]),this._add("mousePitch",ne,["mouseRotate"]);const le=new Dc(u),pe=new iy(u,m);m.dragPan=new go(x,le,pe),this._add("mousePan",le),this._add("touchPan",pe,["touchZoom","touchRotate"]);const Te=new tw,_e=new sn;m.touchZoomRotate=new ly(x,_e,Te,V),this._add("touchRotate",Te,["touchPan","touchZoom"]),this._add("touchZoom",_e,["touchPan","touchRotate"]);const Ee=m.scrollZoom=new bp(m,this);this._add("scrollZoom",Ee,["mousePan"]);const Be=m.keyboard=new ay;this._add("keyboard",Be),this._add("blockableMapEvent",new Ns(m));for(const We of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])u.interactive&&u[We]&&m[We].enable(u[We])}_add(u,m,x){this._handlers.push({handlerName:u,handler:m,allowed:x}),this._handlersById[u]=m}stop(u){if(!this._updatingCamera){for(const{handler:m}of this._handlers)m.reset();this._inertia.clear(),this._fireEvents({},{},u),this._changes=[]}}isActive(){for(const{handler:u}of this._handlers)if(u.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(du(this._eventsInProgress))||this.isZooming()}_blockedByActive(u,m,x){for(const S in u)if(S!==x&&(!m||m.indexOf(S)<0))return!0;return!1}handleWindowEvent(u){this.handleEvent(u,`${u.type}Window`)}_getMapTouches(u){const m=[];for(const x of u)this._el.contains(x.target)&&m.push(x);return m}handleEvent(u,m){if(u.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const x=u.type==="renderFrame"?void 0:u,S={needsRenderFrame:!1},R={},L={},V=u.touches,H=V?this._getMapTouches(V):void 0,G=H?v.touchPos(this._el,H):v.mousePos(this._el,u);for(const{handlerName:pe,handler:Te,allowed:_e}of this._handlers){if(!Te.isEnabled())continue;let Ee;this._blockedByActive(L,_e,pe)?Te.reset():Te[m||u.type]&&(Ee=Te[m||u.type](u,G,H),this.mergeHandlerResult(S,R,Ee,pe,x),Ee&&Ee.needsRenderFrame&&this._triggerRenderFrame()),(Ee||Te.isActive())&&(L[pe]=Te)}const ne={};for(const pe in this._previousActiveHandlers)L[pe]||(ne[pe]=x);this._previousActiveHandlers=L,(Object.keys(ne).length||Oc(S))&&(this._changes.push([S,R,ne]),this._triggerRenderFrame()),(Object.keys(L).length||Oc(S))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:le}=S;le&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],le(this._map))}mergeHandlerResult(u,m,x,S,R){if(!x)return;a.extend(u,x);const L={handlerName:S,originalEvent:x.originalEvent||R};x.zoomDelta!==void 0&&(m.zoom=L),x.panDelta!==void 0&&(m.drag=L),x.pitchDelta!==void 0&&(m.pitch=L),x.bearingDelta!==void 0&&(m.rotate=L)}_applyChanges(){const u={},m={},x={};for(const[S,R,L]of this._changes)S.panDelta&&(u.panDelta=(u.panDelta||new a.pointGeometry(0,0))._add(S.panDelta)),S.zoomDelta&&(u.zoomDelta=(u.zoomDelta||0)+S.zoomDelta),S.bearingDelta&&(u.bearingDelta=(u.bearingDelta||0)+S.bearingDelta),S.pitchDelta&&(u.pitchDelta=(u.pitchDelta||0)+S.pitchDelta),S.around!==void 0&&(u.around=S.around),S.pinchAround!==void 0&&(u.pinchAround=S.pinchAround),S.noInertia&&(u.noInertia=S.noInertia),a.extend(m,R),a.extend(x,L);this._updateMapTransform(u,m,x),this._changes=[]}_updateMapTransform(u,m,x){const S=this._map,R=S.transform,L=S.style&&S.style.terrain;if(!(Oc(u)||L&&this._drag))return this._fireEvents(m,x,!0);let{panDelta:V,zoomDelta:H,bearingDelta:G,pitchDelta:ne,around:le,pinchAround:pe}=u;pe!==void 0&&(le=pe),S._stop(!0),le=le||S.transform.centerPoint;const Te=R.pointLocation(V?le.sub(V):le);G&&(R.bearing+=G),ne&&(R.pitch+=ne),H&&(R.zoom+=H),L?m.drag&&!this._drag?(this._drag={center:R.centerPoint,lngLat:R.pointLocation(le),point:le,handlerName:m.drag.handlerName},S.fire(new a.Event("freezeElevation",{freeze:!0}))):this._drag&&x[this._drag.handlerName]?(S.fire(new a.Event("freezeElevation",{freeze:!1})),this._drag=null):m.drag&&this._drag&&(R.center=R.pointLocation(R.centerPoint.sub(V))):R.setLocationAtPoint(Te,le),this._map._update(),u.noInertia||this._inertia.record(u),this._fireEvents(m,x,!0)}_fireEvents(u,m,x){const S=du(this._eventsInProgress),R=du(u),L={};for(const ne in u){const{originalEvent:le}=u[ne];this._eventsInProgress[ne]||(L[`${ne}start`]=le),this._eventsInProgress[ne]=u[ne]}!S&&R&&this._fireEvent("movestart",R.originalEvent);for(const ne in L)this._fireEvent(ne,L[ne]);R&&this._fireEvent("move",R.originalEvent);for(const ne in u){const{originalEvent:le}=u[ne];this._fireEvent(ne,le)}const V={};let H;for(const ne in this._eventsInProgress){const{handlerName:le,originalEvent:pe}=this._eventsInProgress[ne];this._handlersById[le].isActive()||(delete this._eventsInProgress[ne],H=m[le]||pe,V[`${ne}end`]=H)}for(const ne in V)this._fireEvent(ne,V[ne]);const G=du(this._eventsInProgress);if(x&&(S||R)&&!G){this._updatingCamera=!0;const ne=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),le=pe=>pe!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Sp("renderFrame",{timeStamp:u})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Ko={extend:(w,...u)=>a.extend(w,...u),run(w){w()},logToElement(w,u=!1,m="log"){const x=window.document.getElementById(m);x&&(u&&(x.innerHTML=""),x.innerHTML+=`
${w}`)}};class Br extends a.Evented{constructor(u,m){super(),this._moving=!1,this._zooming=!1,this.transform=u,this._bearingSnap=m.bearingSnap,a.bindAll(["_renderFrameCallback"],this)}getCenter(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(u,m){return this.jumpTo({center:u},m)}panBy(u,m,x){return u=a.pointGeometry.convert(u).mult(-1),this.panTo(this.transform.center,a.extend({offset:u},m),x)}panTo(u,m,x){return this.easeTo(a.extend({center:u},m),x)}getZoom(){return this.transform.zoom}setZoom(u,m){return this.jumpTo({zoom:u},m),this}zoomTo(u,m,x){return this.easeTo(a.extend({zoom:u},m),x)}zoomIn(u,m){return this.zoomTo(this.getZoom()+1,u,m),this}zoomOut(u,m){return this.zoomTo(this.getZoom()-1,u,m),this}getBearing(){return this.transform.bearing}setBearing(u,m){return this.jumpTo({bearing:u},m),this}getPadding(){return this.transform.padding}setPadding(u,m){return this.jumpTo({padding:u},m),this}rotateTo(u,m,x){return this.easeTo(a.extend({bearing:u},m),x)}resetNorth(u,m){return this.rotateTo(0,a.extend({duration:1e3},u),m),this}resetNorthPitch(u,m){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},u),m),this}snapToNorth(u,m){return Math.abs(this.getBearing()){if(this._zooming&&(x.zoom=a.number(S,H,_t)),this._rotating&&(x.bearing=a.number(R,G,_t)),this._pitching&&(x.pitch=a.number(L,ne,_t)),this._padding&&(x.interpolatePadding(V,le,_t),Te=x.centerPoint.add(pe)),De)x.setLocationAtPoint(De,ft);else{const wt=x.zoomScale(x.zoom-S),Ut=H>S?Math.min(2,rt):Math.max(.5,rt),xt=Math.pow(Ut,1-_t),cn=x.unproject(Be.add(We.mult(_t*xt)).mult(wt));x.setLocationAtPoint(x.renderWorldCopies?cn.wrap():cn,Te)}this._fireMoveEvents(m)},_t=>{this._afterEase(m,_t)},u),this}_prepareEase(u,m,x={}){this._moving=!0,this.fire(new a.Event("freezeElevation",{freeze:!0})),m||x.moving||this.fire(new a.Event("movestart",u)),this._zooming&&!x.zooming&&this.fire(new a.Event("zoomstart",u)),this._rotating&&!x.rotating&&this.fire(new a.Event("rotatestart",u)),this._pitching&&!x.pitching&&this.fire(new a.Event("pitchstart",u))}_fireMoveEvents(u){this.fire(new a.Event("move",u)),this._zooming&&this.fire(new a.Event("zoom",u)),this._rotating&&this.fire(new a.Event("rotate",u)),this._pitching&&this.fire(new a.Event("pitch",u))}_afterEase(u,m){if(this._easeId&&m&&this._easeId===m)return;delete this._easeId,this.fire(new a.Event("freezeElevation",{freeze:!1}));const x=this._zooming,S=this._rotating,R=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,x&&this.fire(new a.Event("zoomend",u)),S&&this.fire(new a.Event("rotateend",u)),R&&this.fire(new a.Event("pitchend",u)),this.fire(new a.Event("moveend",u))}flyTo(u,m){if(!u.essential&&a.exported.prefersReducedMotion){const Tn=a.pick(u,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Tn,m)}this.stop(),u=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},u);const x=this.transform,S=this.getZoom(),R=this.getBearing(),L=this.getPitch(),V=this.getPadding(),H="zoom"in u?a.clamp(+u.zoom,x.minZoom,x.maxZoom):S,G="bearing"in u?this._normalizeBearing(u.bearing,R):R,ne="pitch"in u?+u.pitch:L,le="padding"in u?u.padding:x.padding,pe=x.zoomScale(H-S),Te=a.pointGeometry.convert(u.offset);let _e=x.centerPoint.add(Te);const Ee=x.pointLocation(_e),Be=a.LngLat.convert(u.center||Ee);this._normalizeCenter(Be);const We=x.project(Ee),rt=x.project(Be).sub(We);let De=u.curve;const ft=Math.max(x.width,x.height),st=ft/pe,_t=rt.mag();if("minZoom"in u){const Tn=a.clamp(Math.min(u.minZoom,S,H),x.minZoom,x.maxZoom),mr=ft/x.zoomScale(Tn-S);De=Math.sqrt(mr/_t*2)}const wt=De*De;function Ut(Tn){const mr=(st*st-ft*ft+(Tn?-1:1)*wt*wt*_t*_t)/(2*(Tn?st:ft)*wt*_t);return Math.log(Math.sqrt(mr*mr+1)-mr)}function xt(Tn){return(Math.exp(Tn)-Math.exp(-Tn))/2}function cn(Tn){return(Math.exp(Tn)+Math.exp(-Tn))/2}const Jt=Ut(0);let fn=function(Tn){return cn(Jt)/cn(Jt+De*Tn)},$n=function(Tn){return ft*((cn(Jt)*(xt(mr=Jt+De*Tn)/cn(mr))-xt(Jt))/wt)/_t;var mr},Hn=(Ut(1)-Jt)/De;if(Math.abs(_t)<1e-6||!isFinite(Hn)){if(Math.abs(ft-st)<1e-6)return this.easeTo(u,m);const Tn=stu.maxDuration&&(u.duration=0),this._zooming=!0,this._rotating=R!==G,this._pitching=ne!==L,this._padding=!x.isPaddingEqual(le),this._prepareEase(m,!1),this._ease(Tn=>{const mr=Tn*Hn,gr=1/fn(mr);x.zoom=Tn===1?H:S+x.scaleZoom(gr),this._rotating&&(x.bearing=a.number(R,G,Tn)),this._pitching&&(x.pitch=a.number(L,ne,Tn)),this._padding&&(x.interpolatePadding(V,le,Tn),_e=x.centerPoint.add(Te));const ir=Tn===1?Be:x.unproject(We.add(rt.mult($n(mr))).mult(gr));x.setLocationAtPoint(x.renderWorldCopies?ir.wrap():ir,_e),this._fireMoveEvents(m)},()=>this._afterEase(m),u),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(u,m){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const x=this._onEaseEnd;delete this._onEaseEnd,x.call(this,m)}if(!u){const x=this.handlers;x&&x.stop(!1)}return this}_ease(u,m,x){x.animate===!1||x.duration===0?(u(1),m()):(this._easeStart=a.exported.now(),this._easeOptions=x,this._onEaseFrame=u,this._onEaseEnd=m,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const u=Math.min((a.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(u)),u<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(u,m){u=a.wrap(u,-180,180);const x=Math.abs(u-m);return Math.abs(u-360-m)180?-360:x<-180?360:0}}class Ac{constructor(u={}){this.options=u,a.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(u){return this._map=u,this._compact=this.options&&this.options.compact,this._container=v.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=v.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=v.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){v.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(u,m){const x=this._map._getUIString(`AttributionControl.${m}`);u.title=x,u.setAttribute("aria-label",x)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(u){!u||u.sourceDataType!=="metadata"&&u.sourceDataType!=="visibility"&&u.dataType!=="style"&&u.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let u=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?u=u.concat(this.options.customAttribution.map(S=>typeof S!="string"?"":S)):typeof this.options.customAttribution=="string"&&u.push(this.options.customAttribution)),this._map.style.stylesheet){const S=this._map.style.stylesheet;this.styleOwner=S.owner,this.styleId=S.id}const m=this._map.style.sourceCaches;for(const S in m){const R=m[S];if(R.used||R.usedForTerrain){const L=R.getSource();L.attribution&&u.indexOf(L.attribution)<0&&u.push(L.attribution)}}u=u.filter(S=>String(S).trim()),u.sort((S,R)=>S.length-R.length),u=u.filter((S,R)=>{for(let L=R+1;L=0)return!1;return!0});const x=u.join(" | ");x!==this._attribHTML&&(this._attribHTML=x,u.length?(this._innerContainer.innerHTML=x,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class uf{constructor(u={}){this.options=u,a.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(u){this._map=u,this._compact=this.options&&this.options.compact,this._container=v.create("div","maplibregl-ctrl mapboxgl-ctrl");const m=v.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return m.target="_blank",m.rel="noopener nofollow",m.href="https://maplibre.org/",m.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),m.setAttribute("rel","noopener nofollow"),this._container.appendChild(m),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){v.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const u=this._container.children;if(u.length){const m=u[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&m.classList.add("maplibregl-compact","mapboxgl-compact"):m.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class cy{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(u){const m=++this._id;return this._queue.push({callback:u,id:m,cancelled:!1}),m}remove(u){const m=this._currentlyRunning,x=m?this._queue.concat(m):this._queue;for(const S of x)if(S.id===u)return void(S.cancelled=!0)}run(u=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const m=this._currentlyRunning=this._queue;this._queue=[];for(const x of m)if(!x.cancelled&&(x.callback(u),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const dy={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"},fy={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},rw={showCompass:!0,showZoom:!0,visualizePitch:!1};class Na{constructor(u,m,x=!1){this._clickTolerance=10,this.element=m,this.mouseRotate=new fs({clickTolerance:u.dragRotate._mouseRotate._clickTolerance}),this.map=u,x&&(this.mousePitch=new gn({clickTolerance:u.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),v.addEventListener(m,"mousedown",this.mousedown),v.addEventListener(m,"touchstart",this.touchstart,{passive:!1}),v.addEventListener(m,"touchmove",this.touchmove),v.addEventListener(m,"touchend",this.touchend),v.addEventListener(m,"touchcancel",this.reset)}down(u,m){this.mouseRotate.mousedown(u,m),this.mousePitch&&this.mousePitch.mousedown(u,m),v.disableDrag()}move(u,m){const x=this.map,S=this.mouseRotate.mousemoveWindow(u,m);if(S&&S.bearingDelta&&x.setBearing(x.getBearing()+S.bearingDelta),this.mousePitch){const R=this.mousePitch.mousemoveWindow(u,m);R&&R.pitchDelta&&x.setPitch(x.getPitch()+R.pitchDelta)}}off(){const u=this.element;v.removeEventListener(u,"mousedown",this.mousedown),v.removeEventListener(u,"touchstart",this.touchstart,{passive:!1}),v.removeEventListener(u,"touchmove",this.touchmove),v.removeEventListener(u,"touchend",this.touchend),v.removeEventListener(u,"touchcancel",this.reset),this.offTemp()}offTemp(){v.enableDrag(),v.removeEventListener(window,"mousemove",this.mousemove),v.removeEventListener(window,"mouseup",this.mouseup)}mousedown(u){this.down(a.extend({},u,{ctrlKey:!0,preventDefault:()=>u.preventDefault()}),v.mousePos(this.element,u)),v.addEventListener(window,"mousemove",this.mousemove),v.addEventListener(window,"mouseup",this.mouseup)}mousemove(u){this.move(u,v.mousePos(this.element,u))}mouseup(u){this.mouseRotate.mouseupWindow(u),this.mousePitch&&this.mousePitch.mouseupWindow(u),this.offTemp()}touchstart(u){u.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=v.touchPos(this.element,u.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>u.preventDefault()},this._startPos))}touchmove(u){u.targetTouches.length!==1?this.reset():(this._lastPos=v.touchPos(this.element,u.targetTouches)[0],this.move({preventDefault:()=>u.preventDefault()},this._lastPos))}touchend(u){u.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const x=m.locationPoint(w);if(x.x>=0&&x.y>=0&&x.x<=m.width&&x.y<=m.height)break;w.lng>m.center.lng?w.lng-=360:w.lng+=360}return w}const xn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Rn(w,u,m){const x=w.classList;for(const S in xn)x.remove(`maplibregl-${m}-anchor-${S}`,`mapboxgl-${m}-anchor-${S}`);x.add(`maplibregl-${m}-anchor-${u}`,`mapboxgl-${m}-anchor-${u}`)}class fu extends a.Evented{constructor(u,m){if(super(),(u instanceof HTMLElement||m)&&(u=a.extend({element:u},m)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=u&&u.anchor||"center",this._color=u&&u.color||"#3FB1CE",this._scale=u&&u.scale||1,this._draggable=u&&u.draggable||!1,this._clickTolerance=u&&u.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=u&&u.rotation||0,this._rotationAlignment=u&&u.rotationAlignment||"auto",this._pitchAlignment=u&&u.pitchAlignment&&u.pitchAlignment!=="auto"?u.pitchAlignment:this._rotationAlignment,u&&u.element)this._element=u.element,this._offset=a.pointGeometry.convert(u&&u.offset||[0,0]);else{this._defaultMarker=!0,this._element=v.create("div"),this._element.setAttribute("aria-label","Map marker");const x=v.createNS("http://www.w3.org/2000/svg","svg"),S=41,R=27;x.setAttributeNS(null,"display","block"),x.setAttributeNS(null,"height",`${S}px`),x.setAttributeNS(null,"width",`${R}px`),x.setAttributeNS(null,"viewBox",`0 0 ${R} ${S}`);const L=v.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"stroke","none"),L.setAttributeNS(null,"stroke-width","1"),L.setAttributeNS(null,"fill","none"),L.setAttributeNS(null,"fill-rule","evenodd");const V=v.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"fill-rule","nonzero");const H=v.createNS("http://www.w3.org/2000/svg","g");H.setAttributeNS(null,"transform","translate(3.0, 29.0)"),H.setAttributeNS(null,"fill","#000000");const G=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const rt of G){const De=v.createNS("http://www.w3.org/2000/svg","ellipse");De.setAttributeNS(null,"opacity","0.04"),De.setAttributeNS(null,"cx","10.5"),De.setAttributeNS(null,"cy","5.80029008"),De.setAttributeNS(null,"rx",rt.rx),De.setAttributeNS(null,"ry",rt.ry),H.appendChild(De)}const ne=v.createNS("http://www.w3.org/2000/svg","g");ne.setAttributeNS(null,"fill",this._color);const le=v.createNS("http://www.w3.org/2000/svg","path");le.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),ne.appendChild(le);const pe=v.createNS("http://www.w3.org/2000/svg","g");pe.setAttributeNS(null,"opacity","0.25"),pe.setAttributeNS(null,"fill","#000000");const Te=v.createNS("http://www.w3.org/2000/svg","path");Te.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),pe.appendChild(Te);const _e=v.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_e.setAttributeNS(null,"fill","#FFFFFF");const Ee=v.createNS("http://www.w3.org/2000/svg","g");Ee.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Be=v.createNS("http://www.w3.org/2000/svg","circle");Be.setAttributeNS(null,"fill","#000000"),Be.setAttributeNS(null,"opacity","0.25"),Be.setAttributeNS(null,"cx","5.5"),Be.setAttributeNS(null,"cy","5.5"),Be.setAttributeNS(null,"r","5.4999962");const We=v.createNS("http://www.w3.org/2000/svg","circle");We.setAttributeNS(null,"fill","#FFFFFF"),We.setAttributeNS(null,"cx","5.5"),We.setAttributeNS(null,"cy","5.5"),We.setAttributeNS(null,"r","5.4999962"),Ee.appendChild(Be),Ee.appendChild(We),V.appendChild(H),V.appendChild(ne),V.appendChild(pe),V.appendChild(_e),V.appendChild(Ee),x.appendChild(V),x.setAttributeNS(null,"height",S*this._scale+"px"),x.setAttributeNS(null,"width",R*this._scale+"px"),this._element.appendChild(x),this._offset=a.pointGeometry.convert(u&&u.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",x=>{x.preventDefault()}),this._element.addEventListener("mousedown",x=>{x.preventDefault()}),Rn(this._element,this._anchor,"marker"),this._popup=null}addTo(u){return this.remove(),this._map=u,u.getCanvasContainer().appendChild(this._element),u.on("move",this._update),u.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),v.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=a.LngLat.convert(u),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(u){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),u){if(!("offset"in u.options)){const S=Math.sqrt(Math.pow(13.5,2)/2);u.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[S,-1*(38.1-13.5+S)],"bottom-right":[-S,-1*(38.1-13.5+S)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=u,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(u){const m=u.code,x=u.charCode||u.keyCode;m!=="Space"&&m!=="Enter"&&x!==32&&x!==13||this.togglePopup()}_onMapClick(u){const m=u.originalEvent.target,x=this._element;this._popup&&(m===x||x.contains(m))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const u=this._popup;return u?(u.isOpen()?u.remove():u.addTo(this._map),this):this}_update(u){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Nc(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let m="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?m=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(m=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let x="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?x="rotateX(0deg)":this._pitchAlignment==="map"&&(x=`rotateX(${this._map.getPitch()}deg)`),u&&u.type!=="moveend"||(this._pos=this._pos.round()),v.setTransform(this._element,`${xn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${x} ${m}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const S=this._map.unproject(this._pos),R=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=S.distanceTo(this._lngLat)>20*R?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(u){return this._offset=a.pointGeometry.convert(u),this._update(),this}_onMove(u){if(!this._isDragging){const m=this._clickTolerance||this._map._clickTolerance;this._isDragging=u.point.dist(this._pointerdownPos)>=m}this._isDragging&&(this._pos=u.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a.Event("dragstart"))),this.fire(new a.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a.Event("dragend")),this._state="inactive"}_addDragHandler(u){this._element.contains(u.originalEvent.target)&&(u.preventDefault(),this._positionDelta=u.point.sub(this._pos).add(this._offset),this._pointerdownPos=u.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(u){return this._draggable=!!u,this._map&&(u?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(u){return this._rotation=u||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(u){return this._rotationAlignment=u||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(u){return this._pitchAlignment=u&&u!=="auto"?u:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Ep={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let zs,zi=0,$s=!1;const La={maxWidth:100,unit:"metric"};function hy(w,u,m){const x=m&&m.maxWidth||100,S=w._container.clientHeight/2,R=w.unproject([0,S]),L=w.unproject([x,S]),V=R.distanceTo(L);if(m&&m.unit==="imperial"){const H=3.2808*V;H>5280?Bs(u,x,H/5280,w._getUIString("ScaleControl.Miles")):Bs(u,x,H,w._getUIString("ScaleControl.Feet"))}else m&&m.unit==="nautical"?Bs(u,x,V/1852,w._getUIString("ScaleControl.NauticalMiles")):V>=1e3?Bs(u,x,V/1e3,w._getUIString("ScaleControl.Kilometers")):Bs(u,x,V,w._getUIString("ScaleControl.Meters"))}function Bs(w,u,m,x){const S=function(R){const L=Math.pow(10,`${Math.floor(R)}`.length-1);let V=R/L;return V=V>=10?10:V>=5?5:V>=3?3:V>=2?2:V>=1?1:function(H){const G=Math.pow(10,Math.ceil(-Math.log(H)/Math.LN10));return Math.round(H*G)/G}(V),L*V}(m);w.style.width=u*(S/m)+"px",w.innerHTML=`${S} ${x}`}const ni={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},hi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Pp(w){if(w){if(typeof w=="number"){const u=Math.round(Math.sqrt(.5*Math.pow(w,2)));return{center:new a.pointGeometry(0,0),top:new a.pointGeometry(0,w),"top-left":new a.pointGeometry(u,u),"top-right":new a.pointGeometry(-u,u),bottom:new a.pointGeometry(0,-w),"bottom-left":new a.pointGeometry(u,-u),"bottom-right":new a.pointGeometry(-u,-u),left:new a.pointGeometry(w,0),right:new a.pointGeometry(-w,0)}}if(w instanceof a.pointGeometry||Array.isArray(w)){const u=a.pointGeometry.convert(w);return{center:u,top:u,"top-left":u,"top-right":u,bottom:u,"bottom-left":u,"bottom-right":u,left:u,right:u}}return{center:a.pointGeometry.convert(w.center||[0,0]),top:a.pointGeometry.convert(w.top||[0,0]),"top-left":a.pointGeometry.convert(w["top-left"]||[0,0]),"top-right":a.pointGeometry.convert(w["top-right"]||[0,0]),bottom:a.pointGeometry.convert(w.bottom||[0,0]),"bottom-left":a.pointGeometry.convert(w["bottom-left"]||[0,0]),"bottom-right":a.pointGeometry.convert(w["bottom-right"]||[0,0]),left:a.pointGeometry.convert(w.left||[0,0]),right:a.pointGeometry.convert(w.right||[0,0])}}return Pp(new a.pointGeometry(0,0))}const ml={supported:c,setRTLTextPlugin:a.setRTLTextPlugin,getRTLTextPluginStatus:a.getRTLTextPluginStatus,Map:class extends Br{constructor(w){var u;if(a.PerformanceUtils.mark(a.PerformanceMarkers.create),(w=a.extend({},fy,w)).minZoom!=null&&w.maxZoom!=null&&w.minZoom>w.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(w.minPitch!=null&&w.maxPitch!=null&&w.minPitch>w.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(w.minPitch!=null&&w.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(w.maxPitch!=null&&w.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Pc(w.minZoom,w.maxZoom,w.minPitch,w.maxPitch,w.renderWorldCopies),{bearingSnap:w.bearingSnap}),this._interactive=w.interactive,this._cooperativeGestures=w.cooperativeGestures,this._maxTileCacheSize=w.maxTileCacheSize,this._failIfMajorPerformanceCaveat=w.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=w.preserveDrawingBuffer,this._antialias=w.antialias,this._trackResize=w.trackResize,this._bearingSnap=w.bearingSnap,this._refreshExpiredTiles=w.refreshExpiredTiles,this._fadeDuration=w.fadeDuration,this._crossSourceCollisions=w.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=w.collectResourceTiming,this._renderTaskQueue=new cy,this._controls=[],this._mapId=a.uniqueId(),this._locale=a.extend({},dy,w.locale),this._clickTolerance=w.clickTolerance,this._pixelRatio=(u=w.pixelRatio)!==null&&u!==void 0?u:devicePixelRatio,this._requestManager=new b(w.transformRequest),typeof w.container=="string"){if(this._container=document.getElementById(w.container),!this._container)throw new Error(`Container '${w.container}' not found.`)}else{if(!(w.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=w.container}if(w.maxBounds&&this.setMaxBounds(w.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new uy(this,w),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=w.hash&&new Qv(typeof w.hash=="string"&&w.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:w.center,zoom:w.zoom,bearing:w.bearing,pitch:w.pitch}),w.bounds&&(this.resize(),this.fitBounds(w.bounds,a.extend({},w.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=w.localIdeographFontFamily,w.style&&this.setStyle(w.style,{localIdeographFontFamily:w.localIdeographFontFamily}),w.attributionControl&&this.addControl(new Ac({customAttribution:w.customAttribution})),w.maplibreLogo&&this.addControl(new uf,w.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",m=>{this._update(m.dataType==="style"),this.fire(new a.Event(`${m.dataType}data`,m))}),this.on("dataloading",m=>{this.fire(new a.Event(`${m.dataType}dataloading`,m))}),this.on("dataabort",m=>{this.fire(new a.Event("sourcedataabort",m))})}_getMapId(){return this._mapId}addControl(w,u){if(u===void 0&&(u=w.getDefaultPosition?w.getDefaultPosition():"top-right"),!w||!w.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const m=w.onAdd(this);this._controls.push(w);const x=this._controlPositions[u];return u.indexOf("bottom")!==-1?x.insertBefore(m,x.firstChild):x.appendChild(m),this}removeControl(w){if(!w||!w.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const u=this._controls.indexOf(w);return u>-1&&this._controls.splice(u,1),w.onRemove(this),this}hasControl(w){return this._controls.indexOf(w)>-1}calculateCameraOptionsFromTo(w,u,m,x){return x==null&&this.style.terrain&&(x=this.transform.getElevation(m,this.style.terrain)),super.calculateCameraOptionsFromTo(w,u,m,x)}resize(w){const u=this._containerDimensions(),m=u[0],x=u[1];this._resizeCanvas(m,x,this.getPixelRatio()),this.transform.resize(m,x),this.painter.resize(m,x,this.getPixelRatio());const S=!this._moving;return S&&(this.stop(),this.fire(new a.Event("movestart",w)).fire(new a.Event("move",w))),this.fire(new a.Event("resize",w)),S&&this.fire(new a.Event("moveend",w)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(w){const[u,m]=this._containerDimensions();this._pixelRatio=w,this._resizeCanvas(u,m,w),this.painter.resize(u,m,w)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(w){return this.transform.setMaxBounds(a.LngLatBounds.convert(w)),this._update()}setMinZoom(w){if((w=w==null?-2:w)>=-2&&w<=this.transform.maxZoom)return this.transform.minZoom=w,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=w,this._update(),this.getZoom()>w&&this.setZoom(w),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(w){if((w=w==null?0:w)<0)throw new Error("minPitch must be greater than or equal to 0");if(w>=0&&w<=this.transform.maxPitch)return this.transform.minPitch=w,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(w>=this.transform.minPitch)return this.transform.maxPitch=w,this._update(),this.getPitch()>w&&this.setPitch(w),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(w){return this.transform.renderWorldCopies=w,this._update()}project(w){return this.transform.locationPoint(a.LngLat.convert(w),this.style&&this.style.terrain)}unproject(w){return this.transform.pointLocation(a.pointGeometry.convert(w),this.style&&this.style.terrain)}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(w,u,m){if(w==="mouseenter"||w==="mouseover"){let x=!1;return{layer:u,listener:m,delegates:{mousemove:R=>{const L=this.getLayer(u)?this.queryRenderedFeatures(R.point,{layers:[u]}):[];L.length?x||(x=!0,m.call(this,new Ro(w,this,R.originalEvent,{features:L}))):x=!1},mouseout:()=>{x=!1}}}}if(w==="mouseleave"||w==="mouseout"){let x=!1;return{layer:u,listener:m,delegates:{mousemove:L=>{(this.getLayer(u)?this.queryRenderedFeatures(L.point,{layers:[u]}):[]).length?x=!0:x&&(x=!1,m.call(this,new Ro(w,this,L.originalEvent)))},mouseout:L=>{x&&(x=!1,m.call(this,new Ro(w,this,L.originalEvent)))}}}}{const x=S=>{const R=this.getLayer(u)?this.queryRenderedFeatures(S.point,{layers:[u]}):[];R.length&&(S.features=R,m.call(this,S),delete S.features)};return{layer:u,listener:m,delegates:{[w]:x}}}}on(w,u,m){if(m===void 0)return super.on(w,u);const x=this._createDelegatedListener(w,u,m);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[w]=this._delegatedListeners[w]||[],this._delegatedListeners[w].push(x);for(const S in x.delegates)this.on(S,x.delegates[S]);return this}once(w,u,m){if(m===void 0)return super.once(w,u);const x=this._createDelegatedListener(w,u,m);for(const S in x.delegates)this.once(S,x.delegates[S]);return this}off(w,u,m){return m===void 0?super.off(w,u):(this._delegatedListeners&&this._delegatedListeners[w]&&(x=>{const S=this._delegatedListeners[w];for(let R=0;R{x?this.fire(new a.ErrorEvent(x)):S&&this._updateDiff(S,u)})}else typeof w=="object"&&this._updateDiff(w,u)}_updateDiff(w,u){try{this.style.setState(w)&&this._update(!0)}catch(m){a.warnOnce(`Unable to perform style diff: ${m.message||m.error||m}. Rebuilding the style from scratch.`),this._updateStyle(w,u)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():a.warnOnce("There is no style added to the map.")}addSource(w,u){return this._lazyInitEmptyStyle(),this.style.addSource(w,u),this._update(!0)}isSourceLoaded(w){const u=this.style&&this.style.sourceCaches[w];if(u!==void 0)return u.loaded();this.fire(new a.ErrorEvent(new Error(`There is no source with ID '${w}'`)))}setTerrain(w){return this.style.setTerrain(w),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){const w=this.style&&this.style.sourceCaches;for(const u in w){const m=w[u]._tiles;for(const x in m){const S=m[x];if(S.state!=="loaded"&&S.state!=="errored")return!1}}return!0}addSourceType(w,u,m){return this._lazyInitEmptyStyle(),this.style.addSourceType(w,u,m)}removeSource(w){return this.style.removeSource(w),this._update(!0)}getSource(w){return this.style.getSource(w)}addImage(w,u,{pixelRatio:m=1,sdf:x=!1,stretchX:S,stretchY:R,content:L}={}){if(this._lazyInitEmptyStyle(),u instanceof HTMLImageElement||a.isImageBitmap(u)){const{width:V,height:H,data:G}=a.exported.getImageData(u);this.style.addImage(w,{data:new a.RGBAImage({width:V,height:H},G),pixelRatio:m,stretchX:S,stretchY:R,content:L,sdf:x,version:0})}else{if(u.width===void 0||u.height===void 0)return this.fire(new a.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:V,height:H,data:G}=u,ne=u;this.style.addImage(w,{data:new a.RGBAImage({width:V,height:H},new Uint8Array(G)),pixelRatio:m,stretchX:S,stretchY:R,content:L,sdf:x,version:0,userImage:ne}),ne.onAdd&&ne.onAdd(this,w)}}}updateImage(w,u){const m=this.style.getImage(w);if(!m)return this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const x=u instanceof HTMLImageElement||a.isImageBitmap(u)?a.exported.getImageData(u):u,{width:S,height:R,data:L}=x;if(S===void 0||R===void 0)return this.fire(new a.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(S!==m.data.width||R!==m.data.height)return this.fire(new a.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const V=!(u instanceof HTMLImageElement||a.isImageBitmap(u));m.data.replace(L,V),this.style.updateImage(w,m)}hasImage(w){return w?!!this.style.getImage(w):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(w){this.style.removeImage(w)}loadImage(w,u){a.getImage(this._requestManager.transformRequest(w,a.ResourceType.Image),u)}listImages(){return this.style.listImages()}addLayer(w,u){return this._lazyInitEmptyStyle(),this.style.addLayer(w,u),this._update(!0)}moveLayer(w,u){return this.style.moveLayer(w,u),this._update(!0)}removeLayer(w){return this.style.removeLayer(w),this._update(!0)}getLayer(w){return this.style.getLayer(w)}setLayerZoomRange(w,u,m){return this.style.setLayerZoomRange(w,u,m),this._update(!0)}setFilter(w,u,m={}){return this.style.setFilter(w,u,m),this._update(!0)}getFilter(w){return this.style.getFilter(w)}setPaintProperty(w,u,m,x={}){return this.style.setPaintProperty(w,u,m,x),this._update(!0)}getPaintProperty(w,u){return this.style.getPaintProperty(w,u)}setLayoutProperty(w,u,m,x={}){return this.style.setLayoutProperty(w,u,m,x),this._update(!0)}getLayoutProperty(w,u){return this.style.getLayoutProperty(w,u)}setLight(w,u={}){return this._lazyInitEmptyStyle(),this.style.setLight(w,u),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(w,u){return this.style.setFeatureState(w,u),this._update()}removeFeatureState(w,u){return this.style.removeFeatureState(w,u),this._update()}getFeatureState(w){return this.style.getFeatureState(w)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let w=0,u=0;return this._container&&(w=this._container.clientWidth||400,u=this._container.clientHeight||300),[w,u]}_setupContainer(){const w=this._container;w.classList.add("maplibregl-map","mapboxgl-map");const u=this._canvasContainer=v.create("div","maplibregl-canvas-container mapboxgl-canvas-container",w);this._interactive&&u.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=v.create("canvas","maplibregl-canvas mapboxgl-canvas",u),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const m=this._containerDimensions();this._resizeCanvas(m[0],m[1],this.getPixelRatio());const x=this._controlContainer=v.create("div","maplibregl-control-container mapboxgl-control-container",w),S=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(R=>{S[R]=v.create("div",`maplibregl-ctrl-${R} mapboxgl-ctrl-${R}`,x)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const w=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=v.create("div","maplibregl-cooperative-gesture-screen",w);let u="Control",m=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(m=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",u="Meta"),this._cooperativeGesturesScreen.innerHTML=`
${m}
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
`,document.addEventListener("keydown",x=>{x.key===u&&(this._metaPress=!0)}),document.addEventListener("keyup",x=>{x.key===u&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",x=>{this._onCooperativeGesture(x,this._metaPress,1)},!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(w,u,m){this._canvas.width=m*w,this._canvas.height=m*u,this._canvas.style.width=`${w}px`,this._canvas.style.height=`${u}px`}_setupPainter(){const w=a.extend({},c.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),u=this._canvas.getContext("webgl",w)||this._canvas.getContext("experimental-webgl",w);u?(this.painter=new mp(u,this.transform),a.exported$1.testSupport(u)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(w){w.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:w}))}_contextRestored(w){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:w}))}_onMapScroll(w){if(w.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(w,u,m){return!u&&m<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(w){return this.style?(this._styleDirty=this._styleDirty||w,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(w){return this._update(),this._renderTaskQueue.add(w)}_cancelRenderFrame(w){this._renderTaskQueue.remove(w)}_render(w){let u,m=0;const x=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(u=x.createQueryEXT(),x.beginQueryEXT(x.TIME_ELAPSED_EXT,u),m=a.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(w),this._removed)return;let S=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const L=this.transform.zoom,V=a.exported.now();this.style.zoomHistory.update(L,V);const H=new a.EvaluationParameters(L,{now:V,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),G=H.crossFadingFactor();G===1&&G===this._crossFadingFactor||(S=!0,this._crossFadingFactor=G),this.style.update(H)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.PerformanceUtils.mark(a.PerformanceMarkers.load),this.fire(new a.Event("load"))),this.style&&(this.style.hasTransitions()||S)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const L=a.exported.now()-m;x.endQueryEXT(x.TIME_ELAPSED_EXT,u),setTimeout(()=>{const V=x.getQueryObjectEXT(u,x.QUERY_RESULT_EXT)/1e6;x.deleteQueryEXT(u),this.fire(new a.Event("gpu-timing-frame",{cpuTime:L,gpuTime:V}))},50)}if(this.listens("gpu-timing-layer")){const L=this.painter.collectGpuTimers();setTimeout(()=>{const V=this.painter.queryGpuTimers(L);this.fire(new a.Event("gpu-timing-layer",{layerTimes:V}))},50)}const R=this._sourcesDirty||this._styleDirty||this._placementDirty;return R||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.Event("idle")),!this._loaded||this._fullyLoaded||R||(this._fullyLoaded=!0,a.PerformanceUtils.mark(a.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const u of this._controls)u.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));const w=this.painter.context.gl.getExtension("WEBGL_lose_context");w&&w.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),v.remove(this._canvasContainer),v.remove(this._controlContainer),this._cooperativeGestures&&v.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),a.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new a.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=a.exported.frame(w=>{a.PerformanceUtils.frame(w),this._frame=null,this._render(w)}))}_onWindowOnline(){this._update()}_onWindowResize(w){this._trackResize&&this.resize({originalEvent:w})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(w){this._showTileBoundaries!==w&&(this._showTileBoundaries=w,this._update())}get showPadding(){return!!this._showPadding}set showPadding(w){this._showPadding!==w&&(this._showPadding=w,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(w){this._showCollisionBoxes!==w&&(this._showCollisionBoxes=w,w?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(w){this._showOverdrawInspector!==w&&(this._showOverdrawInspector=w,this._update())}get repaint(){return!!this._repaint}set repaint(w){this._repaint!==w&&(this._repaint=w,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(w){this._vertices=w,this._update()}_setCacheLimits(w,u){a.setCacheLimits(w,u)}get version(){return"2.4.0"}},NavigationControl:class{constructor(w){this.options=a.extend({},rw,w),this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",u=>u.preventDefault()),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",u=>this._map.zoomIn({},{originalEvent:u})),v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",u=>this._map.zoomOut({},{originalEvent:u})),v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",u=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:u}):this._map.resetNorth({},{originalEvent:u})}),this._compassIcon=v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const w=this._map.getZoom(),u=w===this._map.getMaxZoom(),m=w===this._map.getMinZoom();this._zoomInButton.disabled=u,this._zoomOutButton.disabled=m,this._zoomInButton.setAttribute("aria-disabled",u.toString()),this._zoomOutButton.setAttribute("aria-disabled",m.toString())}_rotateCompassArrow(){const w=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=w}onAdd(w){return this._map=w,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Na(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){v.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(w,u){const m=v.create("button",w,this._container);return m.type="button",m.addEventListener("click",u),m}_setButtonTitle(w,u){const m=this._map._getUIString(`NavigationControl.${u}`);w.title=m,w.setAttribute("aria-label",m)}},GeolocateControl:class extends a.Evented{constructor(w){super(),this.options=a.extend({},Ep,w),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(w){var u;return this._map=w,this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),u=this._setupUI,zs!==void 0?u(zs):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(m=>{zs=m.state!=="denied",u(zs)}):(zs=!!window.navigator.geolocation,u(zs)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),v.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,zi=0,$s=!1}_isOutOfMapMaxBounds(w){const u=this._map.getMaxBounds(),m=w.coords;return u&&(m.longitudeu.getEast()||m.latitudeu.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(w){if(this._map){if(this._isOutOfMapMaxBounds(w))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",w)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=w,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(w),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(w),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",w)),this._finish()}}_updateCamera(w){const u=new a.LngLat(w.coords.longitude,w.coords.latitude),m=w.coords.accuracy,x=this._map.getBearing(),S=a.extend({bearing:x},this.options.fitBoundsOptions);this._map.fitBounds(u.toBounds(m),S,{geolocateSource:!0})}_updateMarker(w){if(w){const u=new a.LngLat(w.coords.longitude,w.coords.latitude);this._accuracyCircleMarker.setLngLat(u).addTo(this._map),this._userLocationDotMarker.setLngLat(u).addTo(this._map),this._accuracy=w.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const w=this._map._container.clientHeight/2,u=this._map.unproject([0,w]),m=this._map.unproject([1,w]),x=u.distanceTo(m),S=Math.ceil(2*this._accuracy/x);this._circleElement.style.width=`${S}px`,this._circleElement.style.height=`${S}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(w){if(this._map){if(this.options.trackUserLocation)if(w.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const u=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=u,this._geolocateButton.setAttribute("aria-label",u),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(w.code===3&&$s)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",w)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(w){if(this._container.addEventListener("contextmenu",u=>u.preventDefault()),this._geolocateButton=v.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",w===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const u=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=u,this._geolocateButton.setAttribute("aria-label",u)}else{const u=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=u,this._geolocateButton.setAttribute("aria-label",u)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=v.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new fu(this._dotElement),this._circleElement=v.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new fu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",u=>{u.geolocateSource||this._watchState!=="ACTIVE_LOCK"||u.originalEvent&&u.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new a.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return a.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":zi--,$s=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let w;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),zi++,zi>1?(w={maximumAge:6e5,timeout:0},$s=!0):(w=this.options.positionOptions,$s=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,w)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ac,LogoControl:uf,ScaleControl:class{constructor(w){this.options=a.extend({},La,w),a.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){hy(this._map,this._container,this.options)}onAdd(w){return this._map=w,this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",w.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){v.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(w){this.options.unit=w,hy(this._map,this._container,this.options)}},FullscreenControl:class{constructor(w){this._fullscreen=!1,w&&w.container&&(w.container instanceof HTMLElement?this._container=w.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(w){return this._map=w,this._container||(this._container=this._map.getContainer()),this._controlContainer=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){v.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){const w=this._fullscreenButton=v.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",w).setAttribute("aria-hidden","true"),w.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const w=this._getTitle();this._fullscreenButton.setAttribute("aria-label",w),this._fullscreenButton.title=w}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},TerrainControl:class{constructor(w){this.options=w,a.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(w){return this._map=w,this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=v.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){v.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._map.style.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends a.Evented{constructor(w){super(),this.options=a.extend(Object.create(ni),w),a.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(w){return this._map&&this.remove(),this._map=w,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new a.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&v.remove(this._content),this._container&&(v.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new a.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(w){return this._lngLat=a.LngLat.convert(w),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(w){return this.setDOMContent(document.createTextNode(w))}setHTML(w){const u=document.createDocumentFragment(),m=document.createElement("body");let x;for(m.innerHTML=w;x=m.firstChild,x;)u.appendChild(x);return this.setDOMContent(u)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(w){return this.options.maxWidth=w,this._update(),this}setDOMContent(w){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=v.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(w),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(w){this._container&&this._container.classList.add(w)}removeClassName(w){this._container&&this._container.classList.remove(w)}setOffset(w){return this.options.offset=w,this._update(),this}toggleClassName(w){if(this._container)return this._container.classList.toggle(w)}_createCloseButton(){this.options.closeButton&&(this._closeButton=v.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(w){this._update(w.point)}_onMouseMove(w){this._update(w.point)}_onDrag(w){this._update(w.point)}_update(w){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=v.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=v.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(R=>this._container.classList.add(R)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Nc(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!w))return;const u=this._pos=this._trackPointer&&w?w:this._map.project(this._lngLat);let m=this.options.anchor;const x=Pp(this.options.offset);if(!m){const R=this._container.offsetWidth,L=this._container.offsetHeight;let V;V=u.y+x.bottom.ythis._map.transform.height-L?["bottom"]:[],u.xthis._map.transform.width-R/2&&V.push("right"),m=V.length===0?"bottom":V.join("-")}const S=u.add(x[m]).round();v.setTransform(this._container,`${xn[m]} translate(${S.x}px,${S.y}px)`),Rn(this._container,m,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const w=this._container.querySelector(hi);w&&w.focus()}_onClose(){this.remove()}},Marker:fu,Style:Fr,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.pointGeometry,MercatorCoordinate:a.MercatorCoordinate,Evented:a.Evented,AJAXError:a.AJAXError,config:a.config,CanvasSource:Se,GeoJSONSource:se,ImageSource:he,RasterDEMTileSource:re,RasterTileSource:J,VectorTileSource:X,VideoSource:Ce,prewarm:function(){vt().acquire(Dt)},clearPrewarmedResources:function(){const w=ot;w&&(w.isPreloaded()&&w.numActive()===1?(w.release(Dt),ot=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"2.4.0"},get workerCount(){return qe.workerCount},set workerCount(w){qe.workerCount=w},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(w){a.config.MAX_PARALLEL_IMAGE_REQUESTS=w},clearStorage(w){a.clearTileCache(w)},workerUrl:"",addProtocol(w,u){a.config.REGISTERED_PROTOCOLS[w]=u},removeProtocol(w){delete a.config.REGISTERED_PROTOCOLS[w]}};return Ko.extend(ml,{isSafari:a.isSafari,getPerformanceMetrics:a.PerformanceUtils.getPerformanceMetrics}),ml});var s=i;return s})})(z5);const Oq=z5.exports,Aq="modulepreload",Nq=function(e){return"/"+e},ZM={},Lq=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=Nq(o),o in ZM)return;ZM[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let p=i.length-1;p>=0;p--){const g=i[p];if(g.href===o&&(!s||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const f=document.createElement("link");if(f.rel=s?"stylesheet":Aq,s||(f.as="script",f.crossOrigin=""),f.href=o,document.head.appendChild(f),s)return new Promise((p,g)=>{f.addEventListener("load",p),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())},zP=E.exports.createContext(null),Fq=e=>{const[t,n]=E.exports.useState({}),r=E.exports.useCallback((o,s="default")=>{n(a=>{if(s==="current")throw new Error("'current' cannot be used as map id");if(a[s])throw new Error(`Multiple maps with the same id: ${s}`);return{...a,[s]:o}})},[]),i=E.exports.useCallback((o="default")=>{n(s=>{if(s[o]){const a={...s};return delete a[o],a}return s})},[]);return A(zP.Provider,{value:{maps:t,onMapMount:r,onMapUnmount:i},children:e.children})};function B5(){var e;const t=(e=E.exports.useContext(zP))===null||e===void 0?void 0:e.maps,n=E.exports.useContext(zd);return E.exports.useMemo(()=>({...t,current:n==null?void 0:n.map}),[t,n])}function zq(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function XM(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function YM(e,t){const n=t.viewState||t;let r=!1;if("longitude"in n&&"latitude"in n){const i=e.center;e.center=new i.constructor(n.longitude,n.latitude),r=r||i!==e.center}if("zoom"in n){const i=e.zoom;e.zoom=n.zoom,r=r||i!==e.zoom}if("bearing"in n){const i=e.bearing;e.bearing=n.bearing,r=r||i!==e.bearing}if("pitch"in n){const i=e.pitch;e.pitch=n.pitch,r=r||i!==e.pitch}return n.padding&&!e.isPaddingEqual(n.padding)&&(r=!0,e.padding=n.padding),r}const $q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function QM(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const r of e.layers)t[r.id]=r;const n=e.layers.map(r=>{const i=t[r.ref];let o=null;if("interactive"in r&&(o={...r},delete o.interactive),i){o=o||{...r},delete o.ref;for(const s of $q)s in i&&(o[s]=i[s])}return o||r});return{...e,layers:n}}function Bq(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===o}function Xa(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{const o=this.props[eR[i.type]];o&&o(i)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const o=this.props[JM[i.type]];if(o){if(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"){const s=this._hoveredFeatures||this._map.queryRenderedFeatures(i.point,{layers:this.props.interactiveLayerIds});i.features=s}o(i),delete i.features}},this._onCameraEvent=i=>{if(!this._internalUpdate){const o=this.props[mC[i.type]];o&&o(i)}i.type in this._deferredEvents&&(this._deferredEvents[i.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const i=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||i||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=ph.savedMaps.pop();if(!r)return null;const i=r.map,o=i.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);i._container=n,r.setProps({...t,styleDiffing:!1}),i.resize();const{initialViewState:s}=t;return s&&(s.bounds?i.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):r._updateViewState(s,!1)),i.isStyleLoaded()?i.fire("load"):i.once("styledata",()=>i.fire("load")),r}_initialize(t){const{props:n}=this,r={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||jq()||null,container:t,style:QM(n.mapStyle)},i=r.initialViewState||r.viewState||r;if(Object.assign(r,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),n.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,n.gl)}const o=new this._MapClass(r);i.padding&&o.setPadding(i.padding),n.cursor&&(o.getCanvas().style.cursor=n.cursor),this._createShadowTransform(o);const s=o._render;o._render=f=>{this._inRender=!0,s.call(o,f),this._inRender=!1};const a=o._renderTaskQueue.run;o._renderTaskQueue.run=f=>{a.call(o._renderTaskQueue,f),this._onBeforeRepaint()},o.on("render",()=>this._onAfterRepaint());const c=o.fire;o.fire=this._fireEvent.bind(this,c),o.on("resize",()=>{this._renderTransform.resize(o.transform.width,o.transform.height)}),o.on("styledata",()=>this._updateStyleComponents(this.props,{})),o.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in JM)o.on(f,this._onPointerEvent);for(const f in mC)o.on(f,this._onCameraEvent);for(const f in eR)o.on(f,this._onEvent);this._map=o}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),ph.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=zq(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,i=this._renderTransform,{zoom:o,pitch:s,bearing:a}=i,c=r.isMoving();c&&(i.cameraElevationReference="sea");const f=YM(i,{...XM(r.transform),...t});if(c&&(i.cameraElevationReference="ground"),f&&n){const p=this._deferredEvents;p.move=!0,p.zoom||(p.zoom=o!==i.zoom),p.rotate||(p.rotate=a!==i.bearing),p.pitch||(p.pitch=s!==i.pitch)}return c||YM(r.transform,t),f}_updateSettings(t,n){const r=this._map;let i=!1;for(const o of Vq)o in t&&!Xa(t[o],n[o])&&(i=!0,r[`set${o[0].toUpperCase()}${o.slice(1)}`](t[o]));return i}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor),t.mapStyle!==n.mapStyle){const r={diff:t.styleDiffing};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(QM(t.mapStyle),r),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let i=!1;return r.style.loaded()&&("light"in t&&!Xa(t.light,n.light)&&(i=!0,r.setLight(t.light)),"fog"in t&&!Xa(t.fog,n.fog)&&(i=!0,r.setFog(t.fog)),"terrain"in t&&!Xa(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(i=!0,r.setTerrain(t.terrain))),i}_updateHandlers(t,n){const r=this._map;let i=!1;for(const o of Uq){const s=t[o];Xa(s,n[o])||(i=!0,s?r[o].enable(s):r[o].disable())}return i}_updateHover(t){var n;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const o=t.type,s=((n=this._hoveredFeatures)===null||n===void 0?void 0:n.length)>0;let a;if(o==="mousemove")try{a=this._map.queryRenderedFeatures(t.point,{layers:r.interactiveLayerIds})}catch{a=[]}else a=[];const c=a.length>0;!c&&s&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=a,c&&!s&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=o}else this._hoveredFeatures=null}_fireEvent(t,n,r){const i=this._map,o=i.transform,s=typeof n=="string"?n:n.type;return s==="move"&&this._updateViewState(this.props,!1),s in mC&&(typeof n=="object"&&(n.viewState=XM(o)),this._map.isMoving())?(i.transform=this._renderTransform,t.call(i,n,r),i.transform=o,i):(t.call(i,n,r),i)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=n}}}ph.savedMaps=[];function jq(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||{}.MapboxAccessToken}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Hq=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Kq(e,t){if(!e)return null;const n=e.map,r={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:i=>e.transform.locationPoint(t.LngLat.convert(i)),unproject:i=>e.transform.pointLocation(t.Point.convert(i)),queryTerrainElevation:(i,o)=>{const s=n.transform;n.transform=e.transform;const a=n.queryTerrainElevation(i,o);return n.transform=s,a}};for(const i of Wq(n))!(i in r)&&!Hq.includes(i)&&(r[i]=n[i].bind(n));return r}function Wq(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Gq=typeof document<"u"?E.exports.useLayoutEffect:E.exports.useEffect,qq=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Zq(e,t){for(const n of qq)n in t&&(e[n]=t[n]);t.RTLTextPlugin&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(t.RTLTextPlugin,n=>{n&&console.error(n)},!1)}const zd=E.exports.createContext(null),Xq={minZoom:0,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,mapStyle:{version:8,sources:{},layers:[]},styleDiffing:!0,projection:"mercator",renderWorldCopies:!0,onError:e=>console.error(e.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},$P=E.exports.forwardRef((e,t)=>{const n=E.exports.useContext(zP),[r,i]=E.exports.useState(null),o=E.exports.useRef(),{current:s}=E.exports.useRef({mapLib:null,map:null});E.exports.useEffect(()=>{const c=e.mapLib;let f=!0,p;return Promise.resolve(c||Lq(()=>import("./index.764e1a39.js").then(g=>g.i),[])).then(g=>{if(!!f){if(g.Map||(g=g.default),!g||!g.Map)throw new Error("Invalid mapLib");if(g.supported(e))Zq(g,e),e.reuseMaps&&(p=ph.reuse(e,o.current)),p||(p=new ph(g.Map,e,o.current)),s.map=Kq(p,g),s.mapLib=g,i(p),n==null||n.onMapMount(s.map,e.id);else throw new Error("Map is not supported by this browser")}}).catch(g=>{e.onError({type:"error",target:null,originalEvent:null,error:g})}),()=>{f=!1,p&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?p.recycle():p.destroy())}},[]),Gq(()=>{r&&r.setProps(e)}),E.exports.useImperativeHandle(t,()=>s.map,[r]);const a=E.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]);return A("div",{id:e.id,ref:o,style:a,children:r&&A(zd.Provider,{value:s,children:A("div",{"mapboxgl-children":"",children:e.children})})})});$P.displayName="Map";$P.defaultProps=Xq;const Yq=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function $d(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const i=t[r];Number.isFinite(i)&&!Yq.test(r)?n[r]=`${i}px`:n[r]=i}}const Qq={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function V5(e){const{map:t,mapLib:n}=E.exports.useContext(zd),r=E.exports.useRef({props:e});r.current.props=e;const i=E.exports.useMemo(()=>{let o=!1;E.exports.Children.forEach(e.children,c=>{c&&(o=!0)});const s={...e,element:o?document.createElement("div"):null},a=new n.Marker(s).setLngLat([e.longitude,e.latitude]);return a.getElement().addEventListener("click",c=>{var f,p;(p=(f=r.current.props).onClick)===null||p===void 0||p.call(f,{type:"click",target:a,originalEvent:c})}),a.on("dragstart",c=>{var f,p;const g=c;g.lngLat=i.getLngLat(),(p=(f=r.current.props).onDragStart)===null||p===void 0||p.call(f,g)}),a.on("drag",c=>{var f,p;const g=c;g.lngLat=i.getLngLat(),(p=(f=r.current.props).onDrag)===null||p===void 0||p.call(f,g)}),a.on("dragend",c=>{var f,p;const g=c;g.lngLat=i.getLngLat(),(p=(f=r.current.props).onDragEnd)===null||p===void 0||p.call(f,g)}),a},[]);return E.exports.useEffect(()=>(i.addTo(t.getMap()),()=>{i.remove()}),[]),E.exports.useEffect(()=>{$d(i.getElement(),e.style)},[e.style]),(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Bq(i.getOffset(),e.offset)&&i.setOffset(e.offset),i.isDraggable()!==e.draggable&&i.setDraggable(e.draggable),i.getRotation()!==e.rotation&&i.setRotation(e.rotation),i.getRotationAlignment()!==e.rotationAlignment&&i.setRotationAlignment(e.rotationAlignment),i.getPitchAlignment()!==e.pitchAlignment&&i.setPitchAlignment(e.pitchAlignment),i.getPopup()!==e.popup&&i.setPopup(e.popup),al.exports.createPortal(e.children,i.getElement())}V5.defaultProps=Qq;E.exports.memo(V5);function tR(e){return new Set(e?e.trim().split(/\s+/):[])}function Jq(e){const{map:t,mapLib:n}=E.exports.useContext(zd),r=E.exports.useMemo(()=>document.createElement("div"),[]),i=E.exports.useRef({props:e});i.current.props=e;const o=E.exports.useMemo(()=>{const s={...e},a=new n.Popup(s).setLngLat([e.longitude,e.latitude]);return a.once("open",c=>{var f,p;(p=(f=i.current.props).onOpen)===null||p===void 0||p.call(f,c)}),a},[]);if(E.exports.useEffect(()=>{const s=a=>{var c,f;(f=(c=i.current.props).onClose)===null||f===void 0||f.call(c,a)};return o.on("close",s),o.setDOMContent(r).addTo(t.getMap()),()=>{o.off("close",s),o.isOpen()&&o.remove()}},[]),E.exports.useEffect(()=>{$d(o.getElement(),e.style)},[e.style]),o.isOpen()&&((o.getLngLat().lng!==e.longitude||o.getLngLat().lat!==e.latitude)&&o.setLngLat([e.longitude,e.latitude]),e.offset&&!Xa(o.options.offset,e.offset)&&o.setOffset(e.offset),(o.options.anchor!==e.anchor||o.options.maxWidth!==e.maxWidth)&&(o.options.anchor=e.anchor,o.setMaxWidth(e.maxWidth)),o.options.className!==e.className)){const s=tR(o.options.className),a=tR(e.className);for(const c of s)a.has(c)||o.removeClassName(c);for(const c of a)s.has(c)||o.addClassName(c);o.options.className=e.className}return al.exports.createPortal(e.children,r)}const eZ=E.exports.memo(Jq);function Xg(e,t,n,r){const i=E.exports.useContext(zd),o=E.exports.useMemo(()=>e(i),[]);return E.exports.useEffect(()=>{const s=r||n||t,a=typeof t=="function"&&typeof n=="function"?t:null,c=typeof n=="function"?n:typeof t=="function"?t:null,{map:f}=i;return f.hasControl(o)||(f.addControl(o,s==null?void 0:s.position),a&&a(i)),()=>{c&&c(i),f.hasControl(o)&&f.removeControl(o)}},[]),o}function tZ(e){const t=Xg(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return E.exports.useEffect(()=>{$d(t._container,e.style)},[e.style]),null}E.exports.memo(tZ);function nZ(e){const t=Xg(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return E.exports.useEffect(()=>{$d(t._controlContainer,e.style)},[e.style]),null}E.exports.memo(nZ);const U5=E.exports.forwardRef((e,t)=>{const n=E.exports.useRef({props:e}),r=Xg(({mapLib:i})=>{const o=new i.GeolocateControl(e),s=o._setupUI;return o._setupUI=a=>{o._container.hasChildNodes()||s(a)},o.on("geolocate",a=>{var c,f;(f=(c=n.current.props).onGeolocate)===null||f===void 0||f.call(c,a)}),o.on("error",a=>{var c,f;(f=(c=n.current.props).onError)===null||f===void 0||f.call(c,a)}),o.on("outofmaxbounds",a=>{var c,f;(f=(c=n.current.props).onOutOfMaxBounds)===null||f===void 0||f.call(c,a)}),o.on("trackuserlocationstart",a=>{var c,f;(f=(c=n.current.props).onTrackUserLocationStart)===null||f===void 0||f.call(c,a)}),o.on("trackuserlocationend",a=>{var c,f;(f=(c=n.current.props).onTrackUserLocationEnd)===null||f===void 0||f.call(c,a)}),o},{position:e.position});return n.current.props=e,E.exports.useImperativeHandle(t,()=>({trigger:()=>r.trigger()}),[]),E.exports.useEffect(()=>{$d(r._container,e.style)},[e.style]),null});U5.displayName="GeolocateControl";E.exports.memo(U5);function rZ(e){const t=Xg(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return E.exports.useEffect(()=>{$d(t._container,e.style)},[e.style]),null}E.exports.memo(rZ);const iZ={unit:"metric",maxWidth:100};function j5(e){const t=Xg(({mapLib:n})=>new n.ScaleControl(e),{position:e.position});return(t.options.unit!==e.unit||t.options.maxWidth!==e.maxWidth)&&(t.options.maxWidth=e.maxWidth,t.setUnit(e.unit)),E.exports.useEffect(()=>{$d(t._container,e.style)},[e.style]),null}j5.defaultProps=iZ;E.exports.memo(j5);function eb(e,t){if(!e)throw new Error(t)}let oZ=0;function aZ(e,t,n){if(e.style&&e.style._loaded){const r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function sZ(e,t,n){eb(t.id===n.id,"source id changed"),eb(t.type===n.type,"source type changed");let r="",i=0;for(const s in t)s!=="children"&&s!=="id"&&!Xa(n[s],t[s])&&(r=s,i++);if(!i)return;const o=t.type;if(o==="geojson")e.setData(t.data);else if(o==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((o==="canvas"||o==="video")&&i===1&&r==="coordinates")e.setCoordinates(t.coordinates);else if(o==="vector"&&"setUrl"in e)switch(r){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles);break}else console.warn(`Unable to update prop: ${r}`)}function xg(e){const t=E.exports.useContext(zd).map.getMap(),n=E.exports.useRef(e),[,r]=E.exports.useState(0),i=E.exports.useMemo(()=>e.id||`jsx-source-${oZ++}`,[]);E.exports.useEffect(()=>{if(t){const s=()=>setTimeout(()=>r(a=>a+1),0);return t.on("styledata",s),s(),()=>{var a;if(t.off("styledata",s),t.style&&t.style._loaded&&t.getSource(i)){const c=(a=t.getStyle())===null||a===void 0?void 0:a.layers;if(c)for(const f of c)f.source===i&&t.removeLayer(f.id);t.removeSource(i)}}}},[t]);let o=t&&t.style&&t.getSource(i);return o?sZ(o,e,n.current):o=aZ(t,i,e),n.current=e,o&&E.exports.Children.map(e.children,s=>s&&E.exports.cloneElement(s,{source:i}))||null}function lZ(e,t,n,r){if(eb(n.id===r.id,"layer id changed"),eb(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:i={},paint:o={},filter:s,minzoom:a,maxzoom:c,beforeId:f}=n;if(f!==r.beforeId&&e.moveLayer(t,f),i!==r.layout){const p=r.layout||{};for(const g in i)Xa(i[g],p[g])||e.setLayoutProperty(t,g,i[g]);for(const g in p)i.hasOwnProperty(g)||e.setLayoutProperty(t,g,void 0)}if(o!==r.paint){const p=r.paint||{};for(const g in o)Xa(o[g],p[g])||e.setPaintProperty(t,g,o[g]);for(const g in p)o.hasOwnProperty(g)||e.setPaintProperty(t,g,void 0)}Xa(s,r.filter)||e.setFilter(t,s),(a!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(t,a,c)}function uZ(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}let cZ=0;function Td(e){const t=E.exports.useContext(zd).map.getMap(),n=E.exports.useRef(e),[,r]=E.exports.useState(0),i=E.exports.useMemo(()=>e.id||`jsx-layer-${cZ++}`,[]);if(E.exports.useEffect(()=>{if(t){const s=()=>r(a=>a+1);return t.on("styledata",s),s(),()=>{t.off("styledata",s),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{lZ(t,i,e,n.current)}catch(s){console.warn(s)}else uZ(t,i,e);return n.current=e,null}function dZ(){for(var e=0,t,n,r="";ee&&(t=0,r=n,n=new Map)}return{get:function(s){var a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set:function(s,a){n.has(s)?n.set(s,a):i(s,a)}}}var W5="!";function yZ(e){var t=e.separator||":";return function(r){for(var i=0,o=[],s=0,a=0;a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $Z(e,t){if(t&&(on(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zn(e)}function li(e){var t=zZ();return function(){var r=tb(e),i;if(t){var o=tb(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return $Z(this,i)}}var X5={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{},n=[];return Un.Children.forEach(e,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Po(r)):w_.exports.isFragment(r)&&r.props?n=n.concat(Po(r.props.children,t)):n.push(r))}),n}var aR={};function KZ(e,t){}function WZ(e,t,n){!t&&!aR[n]&&(e(!1,n),aR[n]=!0)}function Lr(e,t){WZ(KZ,e,t)}function sR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function me(e){for(var t=1;t0},e.prototype.connect_=function(){!q2||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),QZ?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!q2||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=YZ.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),e6=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof mh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new sX(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof mh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;!n.has(t)||(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new lX(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),n6=typeof WeakMap<"u"?new WeakMap:new J5,r6=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=JZ.getInstance(),r=new uX(t,n,this);n6.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){r6.prototype[e]=function(){var t;return(t=n6.get(this))[e].apply(t,arguments)}});var i6=function(){return typeof rb.ResizeObserver<"u"?rb.ResizeObserver:r6}(),Au=new Map;function cX(e){e.forEach(function(t){var n,r=t.target;(n=Au.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var o6=new i6(cX);function dX(e,t){Au.has(e)||(Au.set(e,new Set),o6.observe(e)),Au.get(e).add(t)}function fX(e,t){Au.has(e)&&(Au.get(e).delete(t),Au.get(e).size||(o6.unobserve(e),Au.delete(e)))}var hX=function(e){si(n,e);var t=li(n);function n(){return jr(this,n),t.apply(this,arguments)}return Hr(n,[{key:"render",value:function(){return this.props.children}}]),n}(E.exports.Component),Z2=E.exports.createContext(null);function pX(e){var t=e.children,n=e.onBatchResize,r=E.exports.useRef(0),i=E.exports.useRef([]),o=E.exports.useContext(Z2),s=E.exports.useCallback(function(a,c,f){r.current+=1;var p=r.current;i.current.push({size:a,element:c,data:f}),Promise.resolve().then(function(){p===r.current&&(n==null||n(i.current),i.current=[])}),o==null||o(a,c,f)},[n,o]);return A(Z2.Provider,{value:s,children:t})}function mX(e,t){var n=e.children,r=e.disabled,i=E.exports.useRef(null),o=E.exports.useRef(null),s=E.exports.useContext(Z2),a=typeof n=="function",c=a?n(i):n,f=E.exports.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),p=!a&&E.exports.isValidElement(c)&&Nh(c),g=p?c.ref:null,v=E.exports.useMemo(function(){return Aa(g,i)},[g,i]),b=function(){return bg(i.current)||bg(o.current)};E.exports.useImperativeHandle(t,function(){return b()});var _=E.exports.useRef(e);_.current=e;var T=E.exports.useCallback(function(I){var P=_.current,M=P.onResize,O=P.data,N=I.getBoundingClientRect(),F=N.width,$=N.height,j=I.offsetWidth,U=I.offsetHeight,q=Math.floor(F),Y=Math.floor($);if(f.current.width!==q||f.current.height!==Y||f.current.offsetWidth!==j||f.current.offsetHeight!==U){var te={width:q,height:Y,offsetWidth:j,offsetHeight:U};f.current=te;var Z=j===Math.round(F)?F:j,X=U===Math.round($)?$:U,J=me(me({},te),{},{offsetWidth:Z,offsetHeight:X});s==null||s(J,I,O),M&&Promise.resolve().then(function(){M(J,I)})}},[]);return E.exports.useEffect(function(){var I=b();return I&&!r&&dX(I,T),function(){return fX(I,T)}},[i.current,r]),A(hX,{ref:o,children:p?E.exports.cloneElement(c,{ref:v}):c})}var gX=E.exports.forwardRef(mX),vX="rc-observer-key";function yX(e,t){var n=e.children,r=typeof n=="function"?[n]:Po(n);return r.map(function(i,o){var s=(i==null?void 0:i.key)||"".concat(vX,"-").concat(o);return E.exports.createElement(gX,{...e,key:s,ref:o===0?t:void 0},i)})}var Ql=E.exports.forwardRef(yX);Ql.Collection=pX;function Gi(e,t){var n=me({},e);return Array.isArray(t)&&t.forEach(function(r){delete n[r]}),n}var xX=E.exports.createContext({});const HP=xX;function bX(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function kn(e,t){if(e==null)return{};var n=bX(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function X2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--re){var se=this.tryEntries[re],oe=se.completion;if(se.tryLoc==="root")return ce("end");if(se.tryLoc<=this.prev){var he=n.call(se,"catchLoc"),Ce=n.call(se,"finallyLoc");if(he&&Ce){if(this.prev=0;--ce){var re=this.tryEntries[ce];if(re.tryLoc<=this.prev&&n.call(re,"finallyLoc")&&this.prev=0;--J){var ce=this.tryEntries[J];if(ce.finallyLoc===X)return this.complete(ce.completion,ce.afterLoc),U(ce),g}},catch:function(X){for(var J=this.tryEntries.length-1;J>=0;--J){var ce=this.tryEntries[J];if(ce.tryLoc===X){var re=ce.completion;if(re.type==="throw"){var se=re.arg;U(ce)}return se}}throw new Error("illegal catch attempt")},delegateYield:function(X,J,ce){return this.delegate={iterator:Y(X),resultName:J,nextLoc:ce},this.method==="next"&&(this.arg=void 0),g}},e}function uR(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(f){n(f);return}a.done?t(c):Promise.resolve(c).then(r,i)}function dc(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(c){uR(o,r,i,s,a,"next",c)}function a(c){uR(o,r,i,s,a,"throw",c)}s(void 0)})}}function dd(){return dd=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rx(e,t,n){return SX()?rx=Reflect.construct.bind():rx=function(i,o,s){var a=[null];a.push.apply(a,o);var c=Function.bind.apply(i,a),f=new c;return s&&_g(f,s.prototype),f},rx.apply(null,arguments)}function EX(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function J2(e){var t=typeof Map=="function"?new Map:void 0;return J2=function(r){if(r===null||!EX(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return rx(r,arguments,Q2(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_g(i,r)},J2(e)}var PX=/%[sdj%]/g,TX=function(){};typeof process<"u"&&process.env;function e4(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function xa(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=o)return a;switch(a){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return a}});return s}return e}function IX(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Ki(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||IX(t)&&typeof e=="string"&&!e)}function kX(e,t,n){var r=[],i=0,o=e.length;function s(a){r.push.apply(r,a||[]),i++,i===o&&n(r)}e.forEach(function(a){t(a,s)})}function cR(e,t,n){var r=0,i=e.length;function o(s){if(s&&s.length){n(s);return}var a=r;r=r+1,a()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Cm={integer:function(t){return Cm.number(t)&&parseInt(t,10)===t},float:function(t){return Cm.number(t)&&!Cm.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Cm.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(pR.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(NX())},hex:function(t){return typeof t=="string"&&!!t.match(pR.hex)}},LX=function(t,n,r,i,o){if(t.required&&n===void 0){s6(t,n,r,i,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=t.type;s.indexOf(a)>-1?Cm[a](n)||i.push(xa(o.messages.types[a],t.fullField,t.type)):a&&typeof n!==t.type&&i.push(xa(o.messages.types[a],t.fullField,t.type))},FX=function(t,n,r,i,o){var s=typeof t.len=="number",a=typeof t.min=="number",c=typeof t.max=="number",f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p=n,g=null,v=typeof n=="number",b=typeof n=="string",_=Array.isArray(n);if(v?g="number":b?g="string":_&&(g="array"),!g)return!1;_&&(p=n.length),b&&(p=n.replace(f,"_").length),s?p!==t.len&&i.push(xa(o.messages[g].len,t.fullField,t.len)):a&&!c&&pt.max?i.push(xa(o.messages[g].max,t.fullField,t.max)):a&&c&&(pt.max)&&i.push(xa(o.messages[g].range,t.fullField,t.min,t.max))},wf="enum",zX=function(t,n,r,i,o){t[wf]=Array.isArray(t[wf])?t[wf]:[],t[wf].indexOf(n)===-1&&i.push(xa(o.messages[wf],t.fullField,t[wf].join(", ")))},$X=function(t,n,r,i,o){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(xa(o.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var s=new RegExp(t.pattern);s.test(n)||i.push(xa(o.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},lr={required:s6,whitespace:AX,type:LX,range:FX,enum:zX,pattern:$X},BX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n,"string")&&!t.required)return r();lr.required(t,n,i,s,o,"string"),Ki(n,"string")||(lr.type(t,n,i,s,o),lr.range(t,n,i,s,o),lr.pattern(t,n,i,s,o),t.whitespace===!0&&lr.whitespace(t,n,i,s,o))}r(s)},VX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),n!==void 0&&lr.type(t,n,i,s,o)}r(s)},UX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n===""&&(n=void 0),Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),n!==void 0&&(lr.type(t,n,i,s,o),lr.range(t,n,i,s,o))}r(s)},jX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),n!==void 0&&lr.type(t,n,i,s,o)}r(s)},HX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),Ki(n)||lr.type(t,n,i,s,o)}r(s)},KX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),n!==void 0&&(lr.type(t,n,i,s,o),lr.range(t,n,i,s,o))}r(s)},WX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),n!==void 0&&(lr.type(t,n,i,s,o),lr.range(t,n,i,s,o))}r(s)},GX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n==null&&!t.required)return r();lr.required(t,n,i,s,o,"array"),n!=null&&(lr.type(t,n,i,s,o),lr.range(t,n,i,s,o))}r(s)},qX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),n!==void 0&&lr.type(t,n,i,s,o)}r(s)},ZX="enum",XX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o),n!==void 0&&lr[ZX](t,n,i,s,o)}r(s)},YX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n,"string")&&!t.required)return r();lr.required(t,n,i,s,o),Ki(n,"string")||lr.pattern(t,n,i,s,o)}r(s)},QX=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n,"date")&&!t.required)return r();if(lr.required(t,n,i,s,o),!Ki(n,"date")){var c;n instanceof Date?c=n:c=new Date(n),lr.type(t,c,i,s,o),c&&lr.range(t,c.getTime(),i,s,o)}}r(s)},JX=function(t,n,r,i,o){var s=[],a=Array.isArray(n)?"array":typeof n;lr.required(t,n,i,s,o,a),r(s)},vC=function(t,n,r,i,o){var s=t.type,a=[],c=t.required||!t.required&&i.hasOwnProperty(t.field);if(c){if(Ki(n,s)&&!t.required)return r();lr.required(t,n,i,a,o,s),Ki(n,s)||lr.type(t,n,i,a,o)}r(a)},eY=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Ki(n)&&!t.required)return r();lr.required(t,n,i,s,o)}r(s)},Um={string:BX,method:VX,number:UX,boolean:jX,regexp:HX,integer:KX,float:WX,array:GX,object:qX,enum:XX,pattern:YX,date:QX,url:vC,hex:vC,email:vC,required:JX,any:eY};function t4(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var n4=t4(),Qg=function(){function e(n){this.rules=null,this._messages=n4,this.define(n)}var t=e.prototype;return t.define=function(r){var i=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(o){var s=r[o];i.rules[o]=Array.isArray(s)?s:[s]})},t.messages=function(r){return r&&(this._messages=hR(t4(),r)),this._messages},t.validate=function(r,i,o){var s=this;i===void 0&&(i={}),o===void 0&&(o=function(){});var a=r,c=i,f=o;if(typeof c=="function"&&(f=c,c={}),!this.rules||Object.keys(this.rules).length===0)return f&&f(null,a),Promise.resolve(a);function p(T){var I=[],P={};function M(N){if(Array.isArray(N)){var F;I=(F=I).concat.apply(F,N)}else I.push(N)}for(var O=0;O3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!u6(e,t.slice(0,-1))?e:f6(e,t,n,r)}function A_(e){return Array.isArray(e)?rY(e):on(e)==="object"&&e!==null?nY(e):e}function nY(e){if(Object.getPrototypeOf(e)===Object.prototype){var t={};for(var n in e)t[n]=A_(e[n]);return t}return e}function rY(e){return e.map(function(t){return A_(t)})}function _i(e){return Y2(e)}function Nu(e,t){var n=u6(e,t);return n}function Su(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=tY(e,t,n,r);return i}function mR(e,t){var n={};return t.forEach(function(r){var i=Nu(e,r);n=Su(n,r,i)}),n}function jm(e,t){return e&&e.some(function(n){return p6(n,t)})}function gR(e){return on(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function h6(e,t){var n=Array.isArray(e)?Mt(e):me({},e);return t&&Object.keys(t).forEach(function(r){var i=n[r],o=t[r],s=gR(i)&&gR(o);n[r]=s?h6(i,o||{}):A_(o)}),n}function ix(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=r||n<0||n>=r)return e;var i=e[t],o=t-n;return o>0?[].concat(Mt(e.slice(0,n)),[i],Mt(e.slice(n,t)),Mt(e.slice(t+1,r))):o<0?[].concat(Mt(e.slice(0,t)),Mt(e.slice(t+1,n+1)),[i],Mt(e.slice(n+1,r))):e}var aY=Qg;function sY(e,t){return e.replace(/\$\{\w+\}/g,function(n){var r=n.slice(2,-1);return t[r]})}var yR="CODE_LOGIC_ERROR";function r4(e,t,n,r,i){return i4.apply(this,arguments)}function i4(){return i4=dc(Hi().mark(function e(t,n,r,i,o){var s,a,c,f,p,g,v,b,_;return Hi().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return s=me({},r),delete s.ruleIndex,s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(P){return console.error(P),Promise.reject(yR)}}),c=null,s&&s.type==="array"&&s.defaultField&&(c=s.defaultField,delete s.defaultField),f=new aY(ae({},t,[s])),p=ix({},l6,i.validateMessages),f.messages(p),g=[],I.prev=9,I.next=12,Promise.resolve(f.validate(ae({},t,n),me({},i)));case 12:I.next=17;break;case 14:I.prev=14,I.t0=I.catch(9),I.t0.errors&&(g=I.t0.errors.map(function(P,M){var O=P.message,N=O===yR?p.default:O;return E.exports.isValidElement(N)?E.exports.cloneElement(N,{key:"error_".concat(M)}):N}));case 17:if(!(!g.length&&c)){I.next=22;break}return I.next=20,Promise.all(n.map(function(P,M){return r4("".concat(t,".").concat(M),P,c,i,o)}));case 20:return v=I.sent,I.abrupt("return",v.reduce(function(P,M){return[].concat(Mt(P),Mt(M))},[]));case 22:return b=me(me({},r),{},{name:t,enum:(r.enum||[]).join(", ")},o),_=g.map(function(P){return typeof P=="string"?sY(P,b):P}),I.abrupt("return",_);case 25:case"end":return I.stop()}},e,null,[[9,14]])})),i4.apply(this,arguments)}function lY(e,t,n,r,i,o){var s=e.join("."),a=n.map(function(p,g){var v=p.validator,b=me(me({},p),{},{ruleIndex:g});return v&&(b.validator=function(_,T,I){var P=!1,M=function(){for(var F=arguments.length,$=new Array(F),j=0;j0&&arguments[0]!==void 0?arguments[0]:Va;if(i.validatePromise===g){var F;i.validatePromise=null;var $=[],j=[];(F=N.forEach)===null||F===void 0||F.call(N,function(U){var q=U.rule.warningOnly,Y=U.errors,te=Y===void 0?Va:Y;q?j.push.apply(j,Mt(te)):$.push.apply($,Mt(te))}),i.errors=$,i.warnings=j,i.triggerMetaEvent(),i.reRender()}}),O});return i.validatePromise=g,i.dirty=!0,i.errors=Va,i.warnings=Va,i.triggerMetaEvent(),i.reRender(),g},i.isFieldValidating=function(){return!!i.validatePromise},i.isFieldTouched=function(){return i.touched},i.isFieldDirty=function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var c=i.props.fieldContext,f=c.getInternalHooks(cd),p=f.getInitialValue;return p(i.getNamePath())!==void 0},i.getErrors=function(){return i.errors},i.getWarnings=function(){return i.warnings},i.isListField=function(){return i.props.isListField},i.isList=function(){return i.props.isList},i.isPreserve=function(){return i.props.preserve},i.getMeta=function(){i.prevValidating=i.isFieldValidating();var c={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath()};return c},i.getOnlyChild=function(c){if(typeof c=="function"){var f=i.getMeta();return me(me({},i.getOnlyChild(c(i.getControlled(),f,i.props.fieldContext))),{},{isFunction:!0})}var p=Po(c);return p.length!==1||!E.exports.isValidElement(p[0])?{child:p,isFunction:!1}:{child:p[0],isFunction:!1}},i.getValue=function(c){var f=i.props.fieldContext.getFieldsValue,p=i.getNamePath();return Nu(c||f(!0),p)},i.getControlled=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=i.props,p=f.trigger,g=f.validateTrigger,v=f.getValueFromEvent,b=f.normalize,_=f.valuePropName,T=f.getValueProps,I=f.fieldContext,P=g!==void 0?g:I.validateTrigger,M=i.getNamePath(),O=I.getInternalHooks,N=I.getFieldsValue,F=O(cd),$=F.dispatch,j=i.getValue(),U=T||function(Z){return ae({},_,Z)},q=c[p],Y=me(me({},c),U(j));Y[p]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var Z,X=arguments.length,J=new Array(X),ce=0;ce=0&&q<=Y.length?(f.keys=[].concat(Mt(f.keys.slice(0,q)),[f.id],Mt(f.keys.slice(q))),M([].concat(Mt(Y.slice(0,q)),[U],Mt(Y.slice(q))))):(f.keys=[].concat(Mt(f.keys),[f.id]),M([].concat(Mt(Y),[U]))),f.id+=1},remove:function(U){var q=N(),Y=new Set(Array.isArray(U)?U:[U]);Y.size<=0||(f.keys=f.keys.filter(function(te,Z){return!Y.has(Z)}),M(q.filter(function(te,Z){return!Y.has(Z)})))},move:function(U,q){if(U!==q){var Y=N();U<0||U>=Y.length||q<0||q>=Y.length||(f.keys=vR(f.keys,U,q),M(vR(Y,U,q)))}}},$=P||[];return Array.isArray($)||($=[]),i($.map(function(j,U){var q=f.keys[U];return q===void 0&&(f.keys[U]=f.id,q=f.keys[U],f.id+=1),{name:U,key:q,isListField:!0}}),F,T)}})})})};function pY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],c=!0,f=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(f)throw i}}return a}}function $e(e,t){return c6(e)||pY(e,t)||KP(e,t)||d6()}function mY(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,o){e.forEach(function(s,a){s.catch(function(c){return t=!0,c}).then(function(c){n-=1,r[a]=c,!(n>0)&&(t&&o(r),i(r))})})}):Promise.resolve([])}var g6="__@field_split__";function yC(e){return e.map(function(t){return"".concat(on(t),":").concat(t)}).join(g6)}var Cf=function(){function e(){jr(this,e),this.kvs=new Map}return Hr(e,[{key:"set",value:function(n,r){this.kvs.set(yC(n),r)}},{key:"get",value:function(n){return this.kvs.get(yC(n))}},{key:"update",value:function(n,r){var i=this.get(n),o=r(i);o?this.set(n,o):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(yC(n))}},{key:"map",value:function(n){return Mt(this.kvs.entries()).map(function(r){var i=$e(r,2),o=i[0],s=i[1],a=o.split(g6);return n({key:a.map(function(c){var f=c.match(/^([^:]*):(.*)$/),p=$e(f,3),g=p[1],v=p[2];return g==="number"?Number(v):v}),value:s})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,o=r.value;return n[i.join(".")]=o,null}),n}}]),e}(),gY=["name","errors"],vY=Hr(function e(t){var n=this;jr(this,e),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}},this.getInternalHooks=function(r){return r===cd?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Lr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(r){n.subscribable=r},this.prevWithoutPreserves=null,this.setInitialValues=function(r,i){if(n.initialValues=r||{},i){var o,s=ix({},r,n.store);(o=n.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var c=a.key;s=Su(s,c,Nu(r,c))}),n.prevWithoutPreserves=null,n.updateStore(s)}},this.destroyForm=function(){var r=new Cf;n.getFieldEntities(!0).forEach(function(i){n.isMergedPreserve(i.isPreserve())||r.set(i.getNamePath(),!0)}),n.prevWithoutPreserves=r},this.getInitialValue=function(r){var i=Nu(n.initialValues,r);return r.length?A_(i):i},this.setCallbacks=function(r){n.callbacks=r},this.setValidateMessages=function(r){n.validateMessages=r},this.setPreserve=function(r){n.preserve=r},this.watchList=[],this.registerWatch=function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}},this.notifyWatch=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue();n.watchList.forEach(function(o){o(i,r)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(r){n.store=r},this.getFieldEntities=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities},this.getFieldsMap=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new Cf;return n.getFieldEntities(r).forEach(function(o){var s=o.getNamePath();i.set(s,o)}),i},this.getFieldEntitiesForNamePathList=function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(o){var s=_i(o);return i.get(s)||{INVALIDATE_NAME_PATH:_i(o)}})},this.getFieldsValue=function(r,i){if(n.warningUnhooked(),r===!0&&!i)return n.store;var o=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),s=[];return o.forEach(function(a){var c,f="INVALIDATE_NAME_PATH"in a?a.INVALIDATE_NAME_PATH:a.getNamePath();if(!(!r&&((c=a.isListField)===null||c===void 0?void 0:c.call(a))))if(!i)s.push(f);else{var p="getMeta"in a?a.getMeta():null;i(p)&&s.push(f)}}),mR(n.store,s.map(_i))},this.getFieldValue=function(r){n.warningUnhooked();var i=_i(r);return Nu(n.store,i)},this.getFieldsError=function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:_i(r[s]),errors:[],warnings:[]}})},this.getFieldError=function(r){n.warningUnhooked();var i=_i(r),o=n.getFieldsError([i])[0];return o.errors},this.getFieldWarning=function(r){n.warningUnhooked();var i=_i(r),o=n.getFieldsError([i])[0];return o.warnings},this.isFieldsTouched=function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},i=new Cf,o=n.getFieldEntities(!0);o.forEach(function(c){var f=c.props.initialValue,p=c.getNamePath();if(f!==void 0){var g=i.get(p)||new Set;g.add({entity:c,value:f}),i.set(p,g)}});var s=function(f){f.forEach(function(p){var g=p.props.initialValue;if(g!==void 0){var v=p.getNamePath(),b=n.getInitialValue(v);if(b!==void 0)Lr(!1,"Form already set 'initialValues' with path '".concat(v.join("."),"'. Field can not overwrite it."));else{var _=i.get(v);if(_&&_.size>1)Lr(!1,"Multiple Field with path '".concat(v.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(_){var T=n.getFieldValue(v);(!r.skipExist||T===void 0)&&n.updateStore(Su(n.store,v,Mt(_)[0].value))}}}})},a;r.entities?a=r.entities:r.namePathList?(a=[],r.namePathList.forEach(function(c){var f=i.get(c);if(f){var p;(p=a).push.apply(p,Mt(Mt(f).map(function(g){return g.entity})))}})):a=o,s(a)},this.resetFields=function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(ix({},n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var o=r.map(_i);o.forEach(function(s){var a=n.getInitialValue(s);n.updateStore(Su(n.store,s,a))}),n.resetWithFieldInitialValue({namePathList:o}),n.notifyObservers(i,o,{type:"reset"}),n.notifyWatch(o)},this.setFields=function(r){n.warningUnhooked();var i=n.store,o=[];r.forEach(function(s){var a=s.name;s.errors;var c=kn(s,gY),f=_i(a);o.push(f),"value"in c&&n.updateStore(Su(n.store,f,c.value)),n.notifyObservers(i,[f],{type:"setField",data:s})}),n.notifyWatch(o)},this.getFields=function(){var r=n.getFieldEntities(!0),i=r.map(function(o){var s=o.getNamePath(),a=o.getMeta(),c=me(me({},a),{},{name:s,value:n.getFieldValue(s)});return Object.defineProperty(c,"originRCField",{value:!0}),c});return i},this.initEntityValue=function(r){var i=r.props.initialValue;if(i!==void 0){var o=r.getNamePath(),s=Nu(n.store,o);s===void 0&&n.updateStore(Su(n.store,o,i))}},this.isMergedPreserve=function(r){var i=r!==void 0?r:n.preserve;return i!=null?i:!0},this.registerField=function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var o=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(o,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(g){return g!==r}),!n.isMergedPreserve(a)&&(!s||c.length>1)){var f=s?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==f&&n.fieldEntities.every(function(g){return!p6(g.getNamePath(),i)})){var p=n.store;n.updateStore(Su(p,i,f,!0)),n.notifyObservers(p,[i],{type:"remove"}),n.triggerDependenciesUpdate(p,i)}}n.notifyWatch([i])}},this.dispatch=function(r){switch(r.type){case"updateValue":{var i=r.namePath,o=r.value;n.updateValue(i,o);break}case"validateField":{var s=r.namePath,a=r.triggerName;n.validateFields([s],{triggerName:a});break}}},this.notifyObservers=function(r,i,o){if(n.subscribable){var s=me(me({},o),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(a){var c=a.onStoreChange;c(r,i,s)})}else n.forceRootUpdate()},this.triggerDependenciesUpdate=function(r,i){var o=n.getDependencyChildrenFields(i);return o.length&&n.validateFields(o),n.notifyObservers(r,o,{type:"dependenciesUpdate",relatedFields:[i].concat(Mt(o))}),o},this.updateValue=function(r,i){var o=_i(r),s=n.store;n.updateStore(Su(n.store,o,i)),n.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),n.notifyWatch([o]);var a=n.triggerDependenciesUpdate(s,o),c=n.callbacks.onValuesChange;if(c){var f=mR(n.store,[o]);c(f,n.getFieldsValue())}n.triggerOnFieldsChange([o].concat(Mt(a)))},this.setFieldsValue=function(r){n.warningUnhooked();var i=n.store;if(r){var o=ix(n.store,r);n.updateStore(o)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()},this.setFieldValue=function(r,i){n.setFields([{name:r,value:i}])},this.getDependencyChildrenFields=function(r){var i=new Set,o=[],s=new Cf;n.getFieldEntities().forEach(function(c){var f=c.props.dependencies;(f||[]).forEach(function(p){var g=_i(p);s.update(g,function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return v.add(c),v})})});var a=function c(f){var p=s.get(f)||new Set;p.forEach(function(g){if(!i.has(g)){i.add(g);var v=g.getNamePath();g.isFieldDirty()&&v.length&&(o.push(v),c(v))}})};return a(r),o},this.triggerOnFieldsChange=function(r,i){var o=n.callbacks.onFieldsChange;if(o){var s=n.getFields();if(i){var a=new Cf;i.forEach(function(f){var p=f.name,g=f.errors;a.set(p,g)}),s.forEach(function(f){f.errors=a.get(f.name)||f.errors})}var c=s.filter(function(f){var p=f.name;return jm(r,p)});o(c,s)}},this.validateFields=function(r,i){n.warningUnhooked();var o=!!r,s=o?r.map(_i):[],a=[];n.getFieldEntities(!0).forEach(function(p){if(o||s.push(p.getNamePath()),(i==null?void 0:i.recursive)&&o){var g=p.getNamePath();g.every(function(_,T){return r[T]===_||r[T]===void 0})&&s.push(g)}if(!(!p.props.rules||!p.props.rules.length)){var v=p.getNamePath();if(!o||jm(s,v)){var b=p.validateRules(me({validateMessages:me(me({},l6),n.validateMessages)},i));a.push(b.then(function(){return{name:v,errors:[],warnings:[]}}).catch(function(_){var T,I=[],P=[];return(T=_.forEach)===null||T===void 0||T.call(_,function(M){var O=M.rule.warningOnly,N=M.errors;O?P.push.apply(P,Mt(N)):I.push.apply(I,Mt(N))}),I.length?Promise.reject({name:v,errors:I,warnings:P}):{name:v,errors:I,warnings:P}}))}}});var c=mY(a);n.lastValidatePromise=c,c.catch(function(p){return p}).then(function(p){var g=p.map(function(v){var b=v.name;return b});n.notifyObservers(n.store,g,{type:"validateFinish"}),n.triggerOnFieldsChange(g,p)});var f=c.then(function(){return n.lastValidatePromise===c?Promise.resolve(n.getFieldsValue(s)):Promise.reject([])}).catch(function(p){var g=p.filter(function(v){return v&&v.errors.length});return Promise.reject({values:n.getFieldsValue(s),errorFields:g,outOfDate:n.lastValidatePromise!==c})});return f.catch(function(p){return p}),f},this.submit=function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(o){console.error(o)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})},this.forceRootUpdate=t});function v6(e){var t=E.exports.useRef(),n=E.exports.useState({}),r=$e(n,2),i=r[1];if(!t.current)if(e)t.current=e;else{var o=function(){i({})},s=new vY(o);t.current=s.getForm()}return[t.current]}var s4=E.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),y6=function(t){var n=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,o=t.children,s=E.exports.useContext(s4),a=E.exports.useRef({});return A(s4.Provider,{value:me(me({},s),{},{validateMessages:me(me({},s.validateMessages),n),triggerFormChange:function(f,p){r&&r(f,{changedFields:p,forms:a.current}),s.triggerFormChange(f,p)},triggerFormFinish:function(f,p){i&&i(f,{values:p,forms:a.current}),s.triggerFormFinish(f,p)},registerForm:function(f,p){f&&(a.current=me(me({},a.current),{},ae({},f,p))),s.registerForm(f,p)},unregisterForm:function(f){var p=me({},a.current);delete p[f],a.current=p,s.unregisterForm(f)}}),children:o})},yY=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],xY=function(t,n){var r=t.name,i=t.initialValues,o=t.fields,s=t.form,a=t.preserve,c=t.children,f=t.component,p=f===void 0?"form":f,g=t.validateMessages,v=t.validateTrigger,b=v===void 0?"onChange":v,_=t.onValuesChange,T=t.onFieldsChange,I=t.onFinish,P=t.onFinishFailed,M=kn(t,yY),O=E.exports.useContext(s4),N=v6(s),F=$e(N,1),$=F[0],j=$.getInternalHooks(cd),U=j.useSubscribe,q=j.setInitialValues,Y=j.setCallbacks,te=j.setValidateMessages,Z=j.setPreserve,X=j.destroyForm;E.exports.useImperativeHandle(n,function(){return $}),E.exports.useEffect(function(){return O.registerForm(r,$),function(){O.unregisterForm(r)}},[O,$,r]),te(me(me({},O.validateMessages),g)),Y({onValuesChange:_,onFieldsChange:function(be){if(O.triggerFormChange(r,be),T){for(var Re=arguments.length,Ie=new Array(Re>1?Re-1:0),Me=1;Me1)&&(e=1),e}function n0(e){return e<=1?"".concat(Number(e)*100,"%"):e}function fd(e){return e.length===1?"0"+e:String(e)}function LY(e,t,n){return{r:po(e,255)*255,g:po(t,255)*255,b:po(n,255)*255}}function CR(e,t,n){e=po(e,255),t=po(t,255),n=po(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,s=0,a=(r+i)/2;if(r===i)s=0,o=0;else{var c=r-i;switch(s=a>.5?c/(2-r-i):c/(r+i),r){case e:o=(t-n)/c+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function FY(e,t,n){var r,i,o;if(e=po(e,360),t=po(t,100),n=po(n,100),t===0)i=n,o=n,r=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=xC(a,s,e+1/3),i=xC(a,s,e),o=xC(a,s,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function ob(e,t,n){e=po(e,255),t=po(t,255),n=po(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,s=r,a=r-i,c=r===0?0:a/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/a+(t>16,g:(e&65280)>>8,b:e&255}}var l4={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Es(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,s=!1,a=!1;return typeof e=="string"&&(e=HY(e)),typeof e=="object"&&(El(e.r)&&El(e.g)&&El(e.b)?(t=LY(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):El(e.h)&&El(e.s)&&El(e.v)?(r=n0(e.s),i=n0(e.v),t=zY(e.h,r,i),s=!0,a="hsv"):El(e.h)&&El(e.s)&&El(e.l)&&(r=n0(e.s),o=n0(e.l),t=FY(e.h,r,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=w6(n),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var UY="[-\\+]?\\d+%?",jY="[-\\+]?\\d*\\.\\d+%?",Lu="(?:".concat(jY,")|(?:").concat(UY,")"),bC="[\\s|\\(]+(".concat(Lu,")[,|\\s]+(").concat(Lu,")[,|\\s]+(").concat(Lu,")\\s*\\)?"),_C="[\\s|\\(]+(".concat(Lu,")[,|\\s]+(").concat(Lu,")[,|\\s]+(").concat(Lu,")[,|\\s]+(").concat(Lu,")\\s*\\)?"),bs={CSS_UNIT:new RegExp(Lu),rgb:new RegExp("rgb"+bC),rgba:new RegExp("rgba"+_C),hsl:new RegExp("hsl"+bC),hsla:new RegExp("hsla"+_C),hsv:new RegExp("hsv"+bC),hsva:new RegExp("hsva"+_C),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function HY(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(l4[e])e=l4[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=bs.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=bs.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=bs.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=bs.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=bs.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=bs.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=bs.hex8.exec(e),n?{r:ma(n[1]),g:ma(n[2]),b:ma(n[3]),a:SR(n[4]),format:t?"name":"hex8"}:(n=bs.hex6.exec(e),n?{r:ma(n[1]),g:ma(n[2]),b:ma(n[3]),format:t?"name":"hex"}:(n=bs.hex4.exec(e),n?{r:ma(n[1]+n[1]),g:ma(n[2]+n[2]),b:ma(n[3]+n[3]),a:SR(n[4]+n[4]),format:t?"name":"hex8"}:(n=bs.hex3.exec(e),n?{r:ma(n[1]+n[1]),g:ma(n[2]+n[2]),b:ma(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function El(e){return Boolean(bs.CSS_UNIT.exec(String(e)))}var wC=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=VY(t)),this.originalInput=t;var i=Es(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,s=t.g/255,a=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),a<=.03928?i=a/12.92:i=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=w6(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=ob(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=ob(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=CR(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=CR(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),ab(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),$Y(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(po(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(po(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+ab(this.r,this.g,this.b,!1),n=0,r=Object.entries(l4);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=t0(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=t0(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=t0(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=t0(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,s={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/t;t--;)s.push(new e({h:r,s:i,v:o})),o=(o+a)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,s=1;s=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-r0*t:Math.round(e.h)+r0*t:r=n?Math.round(e.h)+r0*t:Math.round(e.h)-r0*t,r<0?r+=360:r>=360&&(r-=360),r}function IR(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-ER*t:t===S6?r=e.s+ER:r=e.s+KY*t,r>1&&(r=1),n&&t===C6&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function kR(e,t,n){var r;return n?r=e.v+WY*t:r=e.v-GY*t,r>1&&(r=1),Number(r.toFixed(2))}function wg(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Es(e),i=C6;i>0;i-=1){var o=PR(r),s=i0(Es({h:TR(o,i,!0),s:IR(o,i,!0),v:kR(o,i,!0)}));n.push(s)}n.push(i0(r));for(var a=1;a<=S6;a+=1){var c=PR(r),f=i0(Es({h:TR(c,a),s:IR(c,a),v:kR(c,a)}));n.push(f)}return t.theme==="dark"?qY.map(function(p){var g=p.index,v=p.opacity,b=i0(ZY(Es(t.backgroundColor||"#141414"),Es(n[g]),v*100));return b}):n}var th={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},CC={},SC={};Object.keys(th).forEach(function(e){CC[e]=wg(th[e]),CC[e].primary=CC[e][5],SC[e]=wg(th[e],{theme:"dark",backgroundColor:"#141414"}),SC[e].primary=SC[e][5]});function To(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function yd(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var MR="data-rc-order",XY="rc-util-key",u4=new Map;function E6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):XY}function N_(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function YY(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function P6(e){return Array.from((u4.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function T6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!To())return null;var n=t.csp,r=t.prepend,i=document.createElement("style");i.setAttribute(MR,YY(r)),n!=null&&n.nonce&&(i.nonce=n==null?void 0:n.nonce),i.innerHTML=e;var o=N_(t),s=o.firstChild;if(r){if(r==="queue"){var a=P6(o).filter(function(c){return["prepend","prependQueue"].includes(c.getAttribute(MR))});if(a.length)return o.insertBefore(i,a[a.length-1].nextSibling),i}o.insertBefore(i,s)}else o.appendChild(i);return i}function I6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=N_(t);return P6(n).find(function(r){return r.getAttribute(E6(t))===e})}function RR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=I6(e,t);if(n){var r=N_(t);r.removeChild(n)}}function QY(e,t){var n=u4.get(e);if(!n||!yd(document,n)){var r=T6("",t),i=r.parentNode;u4.set(e,i),e.removeChild(r)}}function ev(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=N_(n);QY(r,n);var i=I6(t,n);if(i){var o,s;if((o=n.csp)!==null&&o!==void 0&&o.nonce&&i.nonce!==((s=n.csp)===null||s===void 0?void 0:s.nonce)){var a;i.nonce=(a=n.csp)===null||a===void 0?void 0:a.nonce}return i.innerHTML!==e&&(i.innerHTML=e),i}var c=T6(e,n);return c.setAttribute(E6(n),t),c}function JY(e,t){Lr(e,"[@ant-design/icons] ".concat(t))}function DR(e){return on(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(on(e.icon)==="object"||typeof e.icon=="function")}function OR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t},{})}function c4(e,t,n){return n?Un.createElement(e.tag,me(me({key:t},OR(e.attrs)),n),(e.children||[]).map(function(r,i){return c4(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):Un.createElement(e.tag,me({key:t},OR(e.attrs)),(e.children||[]).map(function(r,i){return c4(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function k6(e){return wg(e)[0]}function M6(e){return e?Array.isArray(e)?e:[e]:[]}var eQ=` .anticon { display: inline-block; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,tQ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eQ,n=E.exports.useContext(HP),r=n.csp;E.exports.useEffect(function(){ev(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},nQ=["icon","className","onClick","style","primaryColor","secondaryColor"],Hm={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function rQ(e){var t=e.primaryColor,n=e.secondaryColor;Hm.primaryColor=t,Hm.secondaryColor=n||k6(t),Hm.calculated=!!n}function iQ(){return me({},Hm)}var L_=function(t){var n=t.icon,r=t.className,i=t.onClick,o=t.style,s=t.primaryColor,a=t.secondaryColor,c=kn(t,nQ),f=Hm;if(s&&(f={primaryColor:s,secondaryColor:a||k6(s)}),tQ(),JY(DR(n),"icon should be icon definiton, but got ".concat(n)),!DR(n))return null;var p=n;return p&&typeof p.icon=="function"&&(p=me(me({},p),{},{icon:p.icon(f.primaryColor,f.secondaryColor)})),c4(p.icon,"svg-".concat(p.name),me({className:r,onClick:i,style:o,"data-icon":p.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},c))};L_.displayName="IconReact";L_.getTwoToneColors=iQ;L_.setTwoToneColors=rQ;const ZP=L_;function R6(e){var t=M6(e),n=$e(t,2),r=n[0],i=n[1];return ZP.setTwoToneColors({primaryColor:r,secondaryColor:i})}function oQ(){var e=ZP.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var aQ=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];R6("#1890ff");var F_=E.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,o=e.spin,s=e.rotate,a=e.tabIndex,c=e.onClick,f=e.twoToneColor,p=kn(e,aQ),g=E.exports.useContext(HP),v=g.prefixCls,b=v===void 0?"anticon":v,_=g.rootClassName,T=je(_,b,(n={},ae(n,"".concat(b,"-").concat(i.name),!!i.name),ae(n,"".concat(b,"-spin"),!!o||i.name==="loading"),n),r),I=a;I===void 0&&c&&(I=-1);var P=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,M=M6(f),O=$e(M,2),N=O[0],F=O[1];return A("span",{...me(me({role:"img","aria-label":i.name},p),{},{ref:t,tabIndex:I,onClick:c,className:T}),children:A(ZP,{icon:i,primaryColor:N,secondaryColor:F,style:P})})});F_.displayName="AntdIcon";F_.getTwoToneColor=oQ;F_.setTwoToneColor=R6;const Yn=F_;var D6=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:OY})})};D6.displayName="CheckCircleFilled";const XP=E.exports.forwardRef(D6);var sQ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"};const lQ=sQ;var O6=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:lQ})})};O6.displayName="CloseCircleFilled";const Fh=E.exports.forwardRef(O6);var uQ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};const cQ=uQ;var A6=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:cQ})})};A6.displayName="ExclamationCircleFilled";const N6=E.exports.forwardRef(A6);var dQ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};const fQ=dQ;var L6=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:fQ})})};L6.displayName="InfoCircleFilled";const F6=E.exports.forwardRef(L6);var hQ={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const z6=hQ;var $6=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:z6})})};$6.displayName="LoadingOutlined";const kd=E.exports.forwardRef($6);var tv=me({},NG),pQ=tv.version,mQ=tv.render,gQ=tv.unmountComponentAtNode,z_;try{var vQ=Number((pQ||"").split(".")[0]);vQ>=18&&(z_=tv.createRoot)}catch{}function AR(e){var t=tv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&on(t)==="object"&&(t.usingClientEntryPoint=e)}var sb="__rc_react_root__";function yQ(e,t){AR(!0);var n=t[sb]||z_(t);AR(!1),n.render(e),t[sb]=n}function xQ(e,t){mQ(e,t)}function B6(e,t){if(z_){yQ(e,t);return}xQ(e,t)}function bQ(e){return d4.apply(this,arguments)}function d4(){return d4=dc(Hi().mark(function e(t){return Hi().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=t[sb])===null||i===void 0||i.unmount(),delete t[sb]}));case 1:case"end":return r.stop()}},e)})),d4.apply(this,arguments)}function _Q(e){gQ(e)}function V6(e){return f4.apply(this,arguments)}function f4(){return f4=dc(Hi().mark(function e(t){return Hi().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(z_===void 0){r.next=2;break}return r.abrupt("return",bQ(t));case 2:_Q(t);case 3:case"end":return r.stop()}},e)})),f4.apply(this,arguments)}function NR(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function wQ(e,t){var n={animationend:NR("Animation","AnimationEnd"),transitionend:NR("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var CQ=wQ(To(),typeof window<"u"?window:{}),U6={};if(To()){var SQ=document.createElement("div");U6=SQ.style}var o0={};function j6(e){if(o0[e])return o0[e];var t=CQ[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:1;BR+=1;var r=BR;function i(o){if(o===0)Z6(r),t();else{var s=G6(function(){i(o-1)});QP.set(r,s)}}return i(n),r};ur.cancel=function(e){var t=QP.get(e);return Z6(t),q6(t)};const EQ=function(){var e=E.exports.useRef(null);function t(){ur.cancel(e.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var o=ur(function(){i<=1?r({isCanceled:function(){return o!==e.current}}):n(r,i-1)});e.current=o}return E.exports.useEffect(function(){return function(){t()}},[]),[n,t]};var X6=To()?E.exports.useLayoutEffect:E.exports.useEffect,VR=[Ol,Hf,Kf,YP],Y6=!1,PQ=!0;function Q6(e){return e===Kf||e===YP}const TQ=function(e,t){var n=Ul($R),r=$e(n,2),i=r[0],o=r[1],s=EQ(),a=$e(s,2),c=a[0],f=a[1];function p(){o(Ol,!0)}return X6(function(){if(i!==$R&&i!==YP){var g=VR.indexOf(i),v=VR[g+1],b=t(i);b===Y6?o(v,!0):c(function(_){function T(){_.isCanceled()||o(v,!0)}b===!0?T():Promise.resolve(b).then(T)})}},[e,i]),E.exports.useEffect(function(){return function(){f()}},[]),[p,i]},IQ=function(e){var t=E.exports.useRef(),n=E.exports.useRef(e);n.current=e;var r=E.exports.useCallback(function(s){n.current(s)},[]);function i(s){s&&(s.removeEventListener(FR,r),s.removeEventListener(LR,r))}function o(s){t.current&&t.current!==s&&i(t.current),s&&s!==t.current&&(s.addEventListener(FR,r),s.addEventListener(LR,r),t.current=s)}return E.exports.useEffect(function(){return function(){i(t.current)}},[]),[o,i]};function kQ(e,t,n,r){var i=r.motionEnter,o=i===void 0?!0:i,s=r.motionAppear,a=s===void 0?!0:s,c=r.motionLeave,f=c===void 0?!0:c,p=r.motionDeadline,g=r.motionLeaveImmediately,v=r.onAppearPrepare,b=r.onEnterPrepare,_=r.onLeavePrepare,T=r.onAppearStart,I=r.onEnterStart,P=r.onLeaveStart,M=r.onAppearActive,O=r.onEnterActive,N=r.onLeaveActive,F=r.onAppearEnd,$=r.onEnterEnd,j=r.onLeaveEnd,U=r.onVisibleChanged,q=Ul(),Y=$e(q,2),te=Y[0],Z=Y[1],X=Ul(Mf),J=$e(X,2),ce=J[0],re=J[1],se=Ul(null),oe=$e(se,2),he=oe[0],Ce=oe[1],Se=E.exports.useRef(!1),be=E.exports.useRef(null);function Re(){return n()}var Ie=E.exports.useRef(!1);function Me(yt){var Tt=Re();if(!(yt&&!yt.deadline&&yt.target!==Tt)){var et=Ie.current,ut;ce===a0&&et?ut=F==null?void 0:F(Tt,yt):ce===s0&&et?ut=$==null?void 0:$(Tt,yt):ce===l0&&et&&(ut=j==null?void 0:j(Tt,yt)),ce!==Mf&&et&&ut!==!1&&(re(Mf,!0),Ce(null,!0))}}var Ae=IQ(Me),Fe=$e(Ae,1),Ke=Fe[0],Ue=E.exports.useMemo(function(){var yt,Tt,et;switch(ce){case a0:return yt={},ae(yt,Ol,v),ae(yt,Hf,T),ae(yt,Kf,M),yt;case s0:return Tt={},ae(Tt,Ol,b),ae(Tt,Hf,I),ae(Tt,Kf,O),Tt;case l0:return et={},ae(et,Ol,_),ae(et,Hf,P),ae(et,Kf,N),et;default:return{}}},[ce]),pt=TQ(ce,function(yt){if(yt===Ol){var Tt=Ue[Ol];return Tt?Tt(Re()):Y6}if(qe in Ue){var et;Ce(((et=Ue[qe])===null||et===void 0?void 0:et.call(Ue,Re(),null))||null)}return qe===Kf&&(Ke(Re()),p>0&&(clearTimeout(be.current),be.current=setTimeout(function(){Me({deadline:!0})},p))),PQ}),gt=$e(pt,2),Dt=gt[0],qe=gt[1],Ct=Q6(qe);Ie.current=Ct,X6(function(){Z(t);var yt=Se.current;if(Se.current=!0,!!e){var Tt;!yt&&t&&a&&(Tt=a0),yt&&t&&o&&(Tt=s0),(yt&&!t&&f||!yt&&g&&!t&&f)&&(Tt=l0),Tt&&(re(Tt),Dt())}},[t]),E.exports.useEffect(function(){(ce===a0&&!a||ce===s0&&!o||ce===l0&&!f)&&re(Mf)},[a,o,f]),E.exports.useEffect(function(){return function(){Se.current=!1,clearTimeout(be.current)}},[]);var ot=E.exports.useRef(!1);E.exports.useEffect(function(){te&&(ot.current=!0),te!==void 0&&ce===Mf&&((ot.current||te)&&(U==null||U(te)),ot.current=!0)},[te,ce]);var vt=he;return Ue[Ol]&&qe===Hf&&(vt=me({transition:"none"},vt)),[ce,qe,vt,te!=null?te:t]}var MQ=function(e){si(n,e);var t=li(n);function n(){return jr(this,n),t.apply(this,arguments)}return Hr(n,[{key:"render",value:function(){return this.props.children}}]),n}(E.exports.Component);function RQ(e){var t=e;on(e)==="object"&&(t=e.transitionSupport);function n(i){return!!(i.motionName&&t)}var r=E.exports.forwardRef(function(i,o){var s=i.visible,a=s===void 0?!0:s,c=i.removeOnLeave,f=c===void 0?!0:c,p=i.forceRender,g=i.children,v=i.motionName,b=i.leavedClassName,_=i.eventProps,T=n(i),I=E.exports.useRef(),P=E.exports.useRef();function M(){try{return I.current instanceof HTMLElement?I.current:bg(P.current)}catch{return null}}var O=kQ(T,a,M,i),N=$e(O,4),F=N[0],$=N[1],j=N[2],U=N[3],q=E.exports.useRef(U);U&&(q.current=!0);var Y=E.exports.useCallback(function(se){I.current=se,nb(o,se)},[o]),te,Z=me(me({},_),{},{visible:a});if(!g)te=null;else if(F===Mf||!n(i))U?te=g(me({},Z),Y):!f&&q.current&&b?te=g(me(me({},Z),{},{className:b}),Y):p||!f&&!b?te=g(me(me({},Z),{},{style:{display:"none"}}),Y):te=null;else{var X,J;$===Ol?J="prepare":Q6($)?J="active":$===Hf&&(J="start"),te=g(me(me({},Z),{},{className:je(zR(v,F),(X={},ae(X,zR(v,"".concat(F,"-").concat(J)),J),ae(X,v,typeof v=="string"),X)),style:j}),Y)}if(E.exports.isValidElement(te)&&Nh(te)){var ce=te,re=ce.ref;re||(te=E.exports.cloneElement(te,{ref:Y}))}return A(MQ,{ref:P,children:te})});return r.displayName="CSSMotion",r}const oa=RQ(W6);var h4="add",p4="keep",m4="remove",EC="removed";function DQ(e){var t;return e&&on(e)==="object"&&"key"in e?t=e:t={key:e},me(me({},t),{},{key:String(t.key)})}function g4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(DQ)}function OQ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=t.length,o=g4(e),s=g4(t);o.forEach(function(f){for(var p=!1,g=r;g1});return c.forEach(function(f){n=n.filter(function(p){var g=p.key,v=p.status;return g!==f||v!==m4}),n.forEach(function(p){p.key===f&&(p.status=p4)})}),n}var AQ=["component","children","onVisibleChanged","onAllRemoved"],NQ=["status"],LQ=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function FQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oa,n=function(r){si(o,r);var i=li(o);function o(){var s;jr(this,o);for(var a=arguments.length,c=new Array(a),f=0;f=v&&(g.key=I[0].notice.key,g.updateMark=jR(),g.userPassKey=p,I.shift()),I.push({notice:g,holderCallback:c})),{notices:I}})},r.remove=function(a){r.setState(function(c){var f=c.notices;return{notices:f.filter(function(p){var g=p.notice,v=g.key,b=g.userPassKey,_=b!=null?b:v;return _!==a})}})},r.noticePropsMap={},r}return Hr(n,[{key:"getTransitionName",value:function(){var i=this.props,o=i.prefixCls,s=i.animation,a=this.props.transitionName;return!a&&s&&(a="".concat(o,"-").concat(s)),a}},{key:"render",value:function(){var i=this,o=this.state.notices,s=this.props,a=s.prefixCls,c=s.className,f=s.closeIcon,p=s.style,g=[];return o.forEach(function(v,b){var _=v.notice,T=v.holderCallback,I=b===o.length-1?_.updateMark:void 0,P=_.key,M=_.userPassKey,O=me(me(me({prefixCls:a,closeIcon:f},_),_.props),{},{key:P,noticeKey:M||P,updateMark:I,onClose:function(F){var $;i.remove(F),($=_.onClose)===null||$===void 0||$.call(_)},onClick:_.onClick,children:_.content});g.push(P),i.noticePropsMap[P]={props:O,holderCallback:T}}),A("div",{className:je(a,c),style:p,children:A(J6,{keys:g,motionName:this.getTransitionName(),onVisibleChanged:function(b,_){var T=_.key;b||delete i.noticePropsMap[T]},children:function(v){var b=v.key,_=v.className,T=v.style,I=v.visible,P=i.noticePropsMap[b],M=P.props,O=P.holderCallback;return O?A("div",{className:je(_,"".concat(a,"-hook-holder")),style:me({},T),ref:function(F){typeof b>"u"||(F?(i.hookRefs.set(b,F),O(F,M)):i.hookRefs.delete(b))}},b):A(JP,{...M,className:je(_,M==null?void 0:M.className),style:me(me({},T),M==null?void 0:M.style),visible:I})}})})}}]),n}(E.exports.Component);vh.newInstance=void 0;vh.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}};vh.newInstance=function(t,n){var r=t||{},i=r.getContainer,o=kn(r,zQ),s=document.createElement("div");if(i){var a=i();a.appendChild(s)}else document.body.appendChild(s);var c=!1;function f(p){c||(c=!0,n({notice:function(v){p.add(v)},removeNotice:function(v){p.remove(v)},component:p,destroy:function(){V6(s),s.parentNode&&s.parentNode.removeChild(s)},useNotification:function(){return eT(p)}}))}B6(A(vh,{...o,ref:f}),s)};function BQ(e,t){var n=function(){var i,o,s=null,a={add:function(T,I){s==null||s.component.add(T,I)}},c=eT(a),f=$e(c,2),p=f[0],g=f[1];function v(_){var T=_.prefixCls,I=i("message",T),P=i(),M=_.key||s$(),O=new Promise(function(F){var $=function(){return typeof _.onClose=="function"&&_.onClose(),F(!0)};e(Je(Je({},_),{prefixCls:I,rootPrefixCls:P,getPopupContainer:o}),function(j){var U=j.prefixCls,q=j.instance;s=q,p(t(Je(Je({},_),{key:M,onClose:$}),U))})}),N=function(){s&&s.removeNotice(M)};return N.then=function(F,$){return O.then(F,$)},N.promise=O,N}var b=E.exports.useRef({});return b.current.open=v,c$.forEach(function(_){return f$(b.current,_)}),[b.current,A(Vd,{children:function(_){return i=_.getPrefixCls,o=_.getPopupContainer,g}},"holder")]};return n}var Bo,e$=3,t$,VQ=1,n$="",v4="move-up",r$=!1,i$,o$,a$=!1;function s$(){return VQ++}function UQ(e){e.top!==void 0&&(t$=e.top,Bo=null),e.duration!==void 0&&(e$=e.duration),e.prefixCls!==void 0&&(n$=e.prefixCls),e.getContainer!==void 0&&(i$=e.getContainer,Bo=null),e.transitionName!==void 0&&(v4=e.transitionName,Bo=null,r$=!0),e.maxCount!==void 0&&(o$=e.maxCount,Bo=null),e.rtl!==void 0&&(a$=e.rtl)}function l$(e,t){var n=e.prefixCls,r=e.getPopupContainer,i=iT(),o=i.getPrefixCls,s=i.getRootPrefixCls,a=i.getIconPrefixCls,c=o("message",n||n$),f=s(e.rootPrefixCls,c),p=a();if(Bo){t({prefixCls:c,rootPrefixCls:f,iconPrefixCls:p,instance:Bo});return}var g={prefixCls:c,transitionName:r$?v4:"".concat(f,"-").concat(v4),style:{top:t$},getContainer:i$||r,maxCount:o$};vh.newInstance(g,function(v){if(Bo){t({prefixCls:c,rootPrefixCls:f,iconPrefixCls:p,instance:Bo});return}Bo=v,t({prefixCls:c,rootPrefixCls:f,iconPrefixCls:p,instance:v})})}var u$={info:F6,success:XP,error:Fh,warning:N6,loading:kd},c$=Object.keys(u$);function d$(e,t,n){var r,i=e.duration!==void 0?e.duration:e$,o=u$[e.type],s=je("".concat(t,"-custom-content"),(r={},ae(r,"".concat(t,"-").concat(e.type),e.type),ae(r,"".concat(t,"-rtl"),a$===!0),r));return{key:e.key,duration:i,style:e.style||{},className:e.className,content:A($h,{iconPrefixCls:n,children:it("div",{className:s,children:[e.icon||o&&A(o,{}),A("span",{children:e.content})]})}),onClose:e.onClose,onClick:e.onClick}}function jQ(e){var t=e.key||s$(),n=new Promise(function(i){var o=function(){return typeof e.onClose=="function"&&e.onClose(),i(!0)};l$(e,function(s){var a=s.prefixCls,c=s.iconPrefixCls,f=s.instance;f.notice(d$(Je(Je({},e),{key:t,onClose:o}),a,c))})}),r=function(){var o;Bo&&(Bo.removeNotice(t),(o=e.onClose)===null||o===void 0||o.call(e))};return r.then=function(i,o){return n.then(i,o)},r.promise=n,r}function HQ(e){return Object.prototype.toString.call(e)==="[object Object]"&&!!e.content}var Cg={open:jQ,config:UQ,destroy:function(t){if(Bo)if(t){var n=Bo,r=n.removeNotice;r(t)}else{var i=Bo,o=i.destroy;o(),Bo=null}}};function f$(e,t){e[t]=function(n,r,i){return HQ(n)?e.open(Je(Je({},n),{type:t})):(typeof r=="function"&&(i=r,r=void 0),e.open({content:n,duration:r,type:t,onClose:i}))}}c$.forEach(function(e){return f$(Cg,e)});Cg.warn=Cg.warning;Cg.useMessage=BQ(l$,d$);const KQ=Cg;var WQ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};const GQ=WQ;var h$=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:GQ})})};h$.displayName="CheckCircleOutlined";const tT=E.exports.forwardRef(h$);var qQ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"};const ZQ=qQ;var p$=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:ZQ})})};p$.displayName="CloseCircleOutlined";const nT=E.exports.forwardRef(p$);var XQ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"};const YQ=XQ;var m$=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:YQ})})};m$.displayName="CloseOutlined";const zh=E.exports.forwardRef(m$);var QQ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"};const JQ=QQ;var g$=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:JQ})})};g$.displayName="ExclamationCircleOutlined";const $_=E.exports.forwardRef(g$);var eJ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};const tJ=eJ;var v$=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:tJ})})};v$.displayName="InfoCircleOutlined";const rT=E.exports.forwardRef(v$);function nJ(e,t){var n=function(){var i,o=null,s={add:function(_,T){o==null||o.component.add(_,T)}},a=eT(s),c=$e(a,2),f=c[0],p=c[1];function g(b){var _=b.prefixCls,T=i("notification",_);e(Je(Je({},b),{prefixCls:T}),function(I){var P=I.prefixCls,M=I.instance;o=M,f(t(b,P))})}var v=E.exports.useRef({});return v.current.open=g,["success","info","warning","error"].forEach(function(b){v.current[b]=function(_){return v.current.open(Je(Je({},_),{type:b}))}}),[v.current,A(Vd,{children:function(b){return i=b.getPrefixCls,p}},"holder")]};return n}globalThis&&globalThis.__awaiter;var od={},y$=4.5,x$=24,b$=24,_$="",y4="topRight",w$,C$,S$=!1,E$;function rJ(e){var t=e.duration,n=e.placement,r=e.bottom,i=e.top,o=e.getContainer,s=e.closeIcon,a=e.prefixCls;a!==void 0&&(_$=a),t!==void 0&&(y$=t),n!==void 0?y4=n:e.rtl&&(y4="topLeft"),r!==void 0&&(b$=r),i!==void 0&&(x$=i),o!==void 0&&(w$=o),s!==void 0&&(C$=s),e.rtl!==void 0&&(S$=e.rtl),e.maxCount!==void 0&&(E$=e.maxCount)}function iJ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x$,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b$,r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n};break}return r}function P$(e,t){var n=e.placement,r=n===void 0?y4:n,i=e.top,o=e.bottom,s=e.getContainer,a=s===void 0?w$:s,c=e.prefixCls,f=iT(),p=f.getPrefixCls,g=f.getIconPrefixCls,v=p("notification",c||_$),b=g(),_="".concat(v,"-").concat(r),T=od[_];if(T){Promise.resolve(T).then(function(P){t({prefixCls:"".concat(v,"-notice"),iconPrefixCls:b,instance:P})});return}var I=je("".concat(v,"-").concat(r),ae({},"".concat(v,"-rtl"),S$===!0));od[_]=new Promise(function(P){vh.newInstance({prefixCls:v,className:I,style:iJ(r,i,o),getContainer:a,maxCount:E$},function(M){P(M),t({prefixCls:"".concat(v,"-notice"),iconPrefixCls:b,instance:M})})})}var oJ={success:tT,info:rT,error:nT,warning:$_};function T$(e,t,n){var r=e.duration,i=e.icon,o=e.type,s=e.description,a=e.message,c=e.btn,f=e.onClose,p=e.onClick,g=e.key,v=e.style,b=e.className,_=e.closeIcon,T=_===void 0?C$:_,I=e.props,P=r===void 0?y$:r,M=null;i?M=A("span",{className:"".concat(t,"-icon"),children:e.icon}):o&&(M=E.exports.createElement(oJ[o]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(o)}));var O=A("span",{className:"".concat(t,"-close-x"),children:T||A(zh,{className:"".concat(t,"-close-icon")})}),N=!s&&M?A("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:A($h,{iconPrefixCls:n,children:it("div",{className:M?"".concat(t,"-with-icon"):"",role:"alert",children:[M,it("div",{className:"".concat(t,"-message"),children:[N,a]}),A("div",{className:"".concat(t,"-description"),children:s}),c?A("span",{className:"".concat(t,"-btn"),children:c}):null]})}),duration:P,closable:!0,closeIcon:O,onClose:f,onClick:p,key:g,style:v||{},className:je(b,ae({},"".concat(t,"-").concat(o),!!o)),props:I}}function aJ(e){P$(e,function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.instance;i.notice(T$(e,n,r))})}var yh={open:aJ,close:function(t){Object.keys(od).forEach(function(n){return Promise.resolve(od[n]).then(function(r){r.removeNotice(t)})})},config:rJ,destroy:function(){Object.keys(od).forEach(function(t){Promise.resolve(od[t]).then(function(n){n.destroy()}),delete od[t]})}};["success","info","warning","error"].forEach(function(e){yh[e]=function(t){return yh.open(Je(Je({},t),{type:e}))}});yh.warn=yh.warning;yh.useNotification=nJ(P$,T$);const sJ=yh;var lJ=function(t,n){return n||(t?"ant-".concat(t):"ant")},Fn=E.exports.createContext({getPrefixCls:lJ}),Vd=Fn.Consumer,uJ="-ant-".concat(Date.now(),"-").concat(Math.random());function cJ(e,t){var n={},r=function(p,g){var v=p.clone();return v=(g==null?void 0:g(v))||v,v.toRgbString()},i=function(p,g){var v=new wC(p),b=wg(v.toRgbString());n["".concat(g,"-color")]=r(v),n["".concat(g,"-color-disabled")]=b[1],n["".concat(g,"-color-hover")]=b[4],n["".concat(g,"-color-active")]=b[6],n["".concat(g,"-color-outline")]=v.clone().setAlpha(.2).toRgbString(),n["".concat(g,"-color-deprecated-bg")]=b[0],n["".concat(g,"-color-deprecated-border")]=b[2]};if(t.primaryColor){i(t.primaryColor,"primary");var o=new wC(t.primaryColor),s=wg(o.toRgbString());s.forEach(function(f,p){n["primary-".concat(p+1)]=f}),n["primary-color-deprecated-l-35"]=r(o,function(f){return f.lighten(35)}),n["primary-color-deprecated-l-20"]=r(o,function(f){return f.lighten(20)}),n["primary-color-deprecated-t-20"]=r(o,function(f){return f.tint(20)}),n["primary-color-deprecated-t-50"]=r(o,function(f){return f.tint(50)}),n["primary-color-deprecated-f-12"]=r(o,function(f){return f.setAlpha(f.getAlpha()*.12)});var a=new wC(s[0]);n["primary-color-active-deprecated-f-30"]=r(a,function(f){return f.setAlpha(f.getAlpha()*.3)}),n["primary-color-active-deprecated-d-02"]=r(a,function(f){return f.darken(2)})}t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info");var c=Object.keys(n).map(function(f){return"--".concat(e,"-").concat(f,": ").concat(n[f],";")});return` :root { `.concat(c.join(` `),` } `).trim()}function dJ(e,t){var n=cJ(e,t);To()&&ev(n,"".concat(uJ,"-dynamic-theme"))}var x4=E.exports.createContext(!1),fJ=function(t){var n=t.children,r=t.disabled,i=E.exports.useContext(x4);return A(x4.Provider,{value:r!=null?r:i,children:n})};const fc=x4;var b4=E.exports.createContext(void 0),hJ=function(t){var n=t.children,r=t.size;return A(b4.Consumer,{children:function(i){return A(b4.Provider,{value:r||i,children:n})}})};const Jl=b4;var pJ=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form"],mJ="ant",gJ="anticon",lb,I$;function ax(){return lb||mJ}function vJ(){return I$||gJ}var yJ=function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.theme;n!==void 0&&(lb=n),r!==void 0&&(I$=r),i&&dJ(ax(),i)},iT=function(){return{getPrefixCls:function(n,r){return r||(n?"".concat(ax(),"-").concat(n):ax())},getIconPrefixCls:vJ,getRootPrefixCls:function(n,r){return n||lb||(r&&r.includes("-")?r.replace(/^(.*)-[^-]*$/,"$1"):ax())}}},xJ=function(t){var n,r,i=t.children,o=t.csp,s=t.autoInsertSpaceInButton,a=t.form,c=t.locale,f=t.componentSize,p=t.direction,g=t.space,v=t.virtual,b=t.dropdownMatchSelectWidth,_=t.legacyLocale,T=t.parentContext,I=t.iconPrefixCls,P=t.componentDisabled,M=E.exports.useCallback(function(U,q){var Y=t.prefixCls;if(q)return q;var te=Y||T.getPrefixCls("");return U?"".concat(te,"-").concat(U):te},[T.getPrefixCls,t.prefixCls]),O=Je(Je({},T),{csp:o,autoInsertSpaceInButton:s,locale:c||_,direction:p,space:g,virtual:v,dropdownMatchSelectWidth:b,getPrefixCls:M});pJ.forEach(function(U){var q=t[U];q&&(O[U]=q)});var N=Yg(function(){return O},O,function(U,q){var Y=Object.keys(U),te=Object.keys(q);return Y.length!==te.length||Y.some(function(Z){return U[Z]!==q[Z]})}),F=E.exports.useMemo(function(){return{prefixCls:I,csp:o}},[I,o]),$=i,j={};return c&&(j=((n=c.Form)===null||n===void 0?void 0:n.defaultValidateMessages)||((r=Ms.Form)===null||r===void 0?void 0:r.defaultValidateMessages)||{}),a&&a.validateMessages&&(j=Je(Je({},j),a.validateMessages)),Object.keys(j).length>0&&($=A(y6,{validateMessages:j,children:i})),c&&($=A(kY,{locale:c,_ANT_MARK__:TY,children:$})),(I||o)&&($=A(HP.Provider,{value:F,children:$})),f&&($=A(hJ,{size:f,children:$})),P!==void 0&&($=A(fJ,{disabled:P,children:$})),A(Fn.Provider,{value:N,children:$})},$h=function(t){return E.exports.useEffect(function(){t.direction&&(KQ.config({rtl:t.direction==="rtl"}),sJ.config({rtl:t.direction==="rtl"}))},[t.direction]),A(Lh,{children:function(n,r,i){return A(Vd,{children:function(o){return A(xJ,{parentContext:o,legacyLocale:i,...t})}})}})};$h.ConfigContext=Fn;$h.SizeContext=Jl;$h.config=yJ;function Qo(e,t,n,r){var i=ic.unstable_batchedUpdates?function(s){ic.unstable_batchedUpdates(n,s)}:n;return e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){e.removeEventListener&&e.removeEventListener(t,i,r)}}}function k$(e){return Object.keys(e).reduce(function(t,n){return(n.startsWith("data-")||n.startsWith("aria-")||n==="role")&&!n.startsWith("data-__")&&(t[n]=e[n]),t},{})}var Ta=E.exports.isValidElement;function M$(e){return e&&Ta(e)&&e.type===E.exports.Fragment}function R$(e,t,n){return Ta(e)?E.exports.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t}function Pi(e,t){return R$(e,e,t)}var bJ=function(e){si(n,e);var t=li(n);function n(){var r;return jr(this,n),r=t.apply(this,arguments),r.state={error:void 0,info:{componentStack:""}},r}return Hr(n,[{key:"componentDidCatch",value:function(i,o){this.setState({error:i,info:o})}},{key:"render",value:function(){var i=this.props,o=i.message,s=i.description,a=i.children,c=this.state,f=c.error,p=c.info,g=p&&p.componentStack?p.componentStack:null,v=typeof o>"u"?(f||"").toString():o,b=typeof s>"u"?g:s;return f?A(O$,{type:"error",message:v,description:A("pre",{children:b})}):a}}]),n}(E.exports.Component);const _J=bJ;var wJ=globalThis&&globalThis.__rest||function(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"u")return 0;var i=t?"scrollTop":"scrollLeft",o=0;return _4(e)?o=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?o=e.documentElement[i]:(e instanceof HTMLElement||e)&&(o=e[i]),e&&!_4(e)&&typeof o!="number"&&(o=(r=((n=e.ownerDocument)!==null&&n!==void 0?n:e).documentElement)===null||r===void 0?void 0:r[i]),o}function IJ(e,t,n,r){var i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function kJ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.getContainer,r=n===void 0?function(){return window}:n,i=t.callback,o=t.duration,s=o===void 0?450:o,a=r(),c=TJ(a,!0),f=Date.now(),p=function g(){var v=Date.now(),b=v-f,_=IJ(b>s?s:b,c,e,s);_4(a)?a.scrollTo(window.pageXOffset,_):a instanceof Document||a.constructor.name==="HTMLDocument"?a.documentElement.scrollTop=_:a.scrollTop=_,b"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};var Pt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=Pt.F1&&n<=Pt.F12)return!1;switch(n){case Pt.ALT:case Pt.CAPS_LOCK:case Pt.CONTEXT_MENU:case Pt.CTRL:case Pt.DOWN:case Pt.END:case Pt.ESC:case Pt.HOME:case Pt.INSERT:case Pt.LEFT:case Pt.MAC_FF_META:case Pt.META:case Pt.NUMLOCK:case Pt.NUM_CENTER:case Pt.PAGE_DOWN:case Pt.PAGE_UP:case Pt.PAUSE:case Pt.PRINT_SCREEN:case Pt.RIGHT:case Pt.SHIFT:case Pt.UP:case Pt.WIN_KEY:case Pt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=Pt.ZERO&&t<=Pt.NINE||t>=Pt.NUM_ZERO&&t<=Pt.NUM_MULTIPLY||t>=Pt.A&&t<=Pt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case Pt.SPACE:case Pt.QUESTION_MARK:case Pt.NUM_PLUS:case Pt.NUM_MINUS:case Pt.NUM_PERIOD:case Pt.NUM_DIVISION:case Pt.SEMICOLON:case Pt.DASH:case Pt.EQUALS:case Pt.COMMA:case Pt.PERIOD:case Pt.SLASH:case Pt.APOSTROPHE:case Pt.SINGLE_QUOTE:case Pt.OPEN_SQUARE_BRACKET:case Pt.BACKSLASH:case Pt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},N$=E.exports.createContext(null);function L$(){return E.exports.useContext(N$)}function MJ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=E.exports.useState(!1),n=$e(t,2),r=n[0],i=n[1],o=E.exports.useRef(null),s=function(){window.clearTimeout(o.current)};E.exports.useEffect(function(){return s},[]);var a=function(f,p){s(),o.current=window.setTimeout(function(){i(f),p&&p()},e)};return[r,a,s]}function F$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=E.exports.useRef(null),n=E.exports.useRef(null);E.exports.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||t.current===null)&&(t.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}return[function(){return t.current},r]}function RJ(e,t,n,r){var i=E.exports.useRef(null);i.current={open:t,triggerOpen:n,customizedTrigger:r},E.exports.useEffect(function(){function o(s){var a;if(!((a=i.current)!==null&&a!==void 0&&a.customizedTrigger)){var c=s.target;c.shadowRoot&&s.composed&&(c=s.composedPath()[0]||c),i.current.open&&e().filter(function(f){return f}).every(function(f){return!f.contains(c)&&f!==c})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",o),function(){return window.removeEventListener("mousedown",o)}},[])}var DJ=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name noValidate nonce open optimum pattern placeholder poster preload radioGroup readOnly rel required reversed role rowSpan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap`,OJ=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,AJ="".concat(DJ," ").concat(OJ).split(/[\s\n]+/),NJ="aria-",LJ="data-";function KR(e,t){return e.indexOf(t)===0}function Zl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=me({},t);var r={};return Object.keys(e).forEach(function(i){(n.aria&&(i==="role"||KR(i,NJ))||n.data&&KR(i,LJ)||n.attr&&AJ.includes(i))&&(r[i]=e[i])}),r}var FJ=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Sf=void 0;function zJ(e,t){var n=e.prefixCls,r=e.invalidate,i=e.item,o=e.renderItem,s=e.responsive,a=e.responsiveDisabled,c=e.registerSize,f=e.itemKey,p=e.className,g=e.style,v=e.children,b=e.display,_=e.order,T=e.component,I=T===void 0?"div":T,P=kn(e,FJ),M=s&&!b;function O(U){c(f,U)}E.exports.useEffect(function(){return function(){O(null)}},[]);var N=o&&i!==Sf?o(i):v,F;r||(F={opacity:M?0:1,height:M?0:Sf,overflowY:M?"hidden":Sf,order:s?_:Sf,pointerEvents:M?"none":Sf,position:M?"absolute":Sf});var $={};M&&($["aria-hidden"]=!0);var j=A(I,{className:je(!r&&n,p),style:me(me({},F),g),...$,...P,ref:t,children:N});return s&&(j=A(Ql,{onResize:function(q){var Y=q.offsetWidth;O(Y)},disabled:a,children:j})),j}var Km=E.exports.forwardRef(zJ);Km.displayName="Item";function $J(){var e=Ul({}),t=$e(e,2),n=t[1],r=E.exports.useRef([]),i=0,o=0;function s(a){var c=i;i+=1,r.current.length_,Ye=E.exports.useMemo(function(){var dt=o;return Lt?te===null&&U?dt=o:dt=o.slice(0,Math.min(o.length,X/p)):typeof _=="number"&&(dt=o.slice(0,_)),dt},[o,p,te,_,Lt]),Zt=E.exports.useMemo(function(){return Lt?o.slice(Tt+1):o.slice(Ye.length)},[o,Ye,Lt,Tt]),an=E.exports.useCallback(function(dt,mt){var $t;return typeof c=="function"?c(dt):($t=c&&(dt==null?void 0:dt[c]))!==null&&$t!==void 0?$t:mt},[c]),Kt=E.exports.useCallback(s||function(dt){return dt},[s]);function Vt(dt,mt,$t){vt===dt&&(mt===void 0||mt===Dt)||(yt(dt),$t||(He(dtX){Vt(Wt-1,dt-mn-Ke+Ie);break}}P&&At(0)+Ke>X&&qe(null)}},[X,re,Ie,Ke,an,Ye]);var qt=at&&!!Zt.length,En={};Dt!==null&&Lt&&(En={position:"absolute",left:Dt,top:0});var yn={prefixCls:ct,responsive:Lt,component:N,invalidate:Ht},St=a?function(dt,mt){var $t=an(dt,mt);return A(ub.Provider,{value:me(me({},yn),{},{order:mt,item:dt,itemKey:$t,registerSize:Xt,display:mt<=Tt}),children:a(dt,mt)},$t)}:function(dt,mt){var $t=an(dt,mt);return E.exports.createElement(Km,{...yn,order:mt,key:$t,item:dt,renderItem:Kt,itemKey:$t,registerSize:Xt,display:mt<=Tt})},Pn,_n={order:qt?Tt:Number.MAX_SAFE_INTEGER,className:"".concat(ct,"-rest"),registerSize:pn,display:qt};if(I)I&&(Pn=A(ub.Provider,{value:me(me({},yn),_n),children:I(Zt)}));else{var tn=T||KJ;Pn=A(Km,{...yn,..._n,children:typeof tn=="function"?tn(Zt):tn})}var zt=it(O,{className:je(!Ht&&r,b),style:v,ref:t,...$,children:[Ye.map(St),ze?Pn:null,P&&A(Km,{...yn,responsive:Ot,responsiveDisabled:!Lt,order:Tt,className:"".concat(ct,"-suffix"),registerSize:tt,display:!0,style:En,children:P})]});return Ot&&(zt=A(Ql,{onResize:It,disabled:!Lt,children:zt})),zt}var nl=E.exports.forwardRef(WJ);nl.displayName="Overflow";nl.Item=z$;nl.RESPONSIVE=$$;nl.INVALIDATE=B$;var cb=function(t){var n=t.className,r=t.customizeIcon,i=t.customizeIconProps,o=t.onMouseDown,s=t.onClick,a=t.children,c;return typeof r=="function"?c=r(i):c=r,A("span",{className:n,onMouseDown:function(p){p.preventDefault(),o&&o(p)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0,children:c!==void 0?c:A("span",{className:je(n.split(/\s+/).map(function(f){return"".concat(f,"-icon")})),children:a})})},GJ=function(t,n){var r,i,o=t.prefixCls,s=t.id,a=t.inputElement,c=t.disabled,f=t.tabIndex,p=t.autoFocus,g=t.autoComplete,v=t.editable,b=t.activeDescendantId,_=t.value,T=t.maxLength,I=t.onKeyDown,P=t.onMouseDown,M=t.onChange,O=t.onPaste,N=t.onCompositionStart,F=t.onCompositionEnd,$=t.open,j=t.attrs,U=a||A("input",{}),q=U,Y=q.ref,te=q.props,Z=te.onKeyDown,X=te.onChange,J=te.onMouseDown,ce=te.onCompositionStart,re=te.onCompositionEnd,se=te.style;return"maxLength"in U.props,U=E.exports.cloneElement(U,me(me(me({type:"search"},te),{},{id:s,ref:Aa(n,Y),disabled:c,tabIndex:f,autoComplete:g||"off",autoFocus:p,className:je("".concat(o,"-selection-search-input"),(r=U)===null||r===void 0||(i=r.props)===null||i===void 0?void 0:i.className),role:"combobox","aria-expanded":$,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":b},j),{},{value:v?_:"",maxLength:T,readOnly:!v,unselectable:v?null:"on",style:me(me({},se),{},{opacity:v?null:0}),onKeyDown:function(he){I(he),Z&&Z(he)},onMouseDown:function(he){P(he),J&&J(he)},onChange:function(he){M(he),X&&X(he)},onCompositionStart:function(he){N(he),ce&&ce(he)},onCompositionEnd:function(he){F(he),re&&re(he)},onPaste:O})),U},oT=E.exports.forwardRef(GJ);oT.displayName="Input";function V$(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}var qJ=typeof window<"u"&&window.document&&window.document.documentElement,ZJ=qJ;function XJ(e){return e!=null}function WR(e){return["string","number"].includes(on(e))}function U$(e){var t=void 0;return e&&(WR(e.title)?t=e.title.toString():WR(e.label)&&(t=e.label.toString())),t}function YJ(e,t){ZJ?E.exports.useLayoutEffect(e,t):E.exports.useEffect(e,t)}function QJ(e){var t;return(t=e.key)!==null&&t!==void 0?t:e.value}var GR=function(t){t.preventDefault(),t.stopPropagation()},JJ=function(t){var n=t.id,r=t.prefixCls,i=t.values,o=t.open,s=t.searchValue,a=t.autoClearSearchValue,c=t.inputRef,f=t.placeholder,p=t.disabled,g=t.mode,v=t.showSearch,b=t.autoFocus,_=t.autoComplete,T=t.activeDescendantId,I=t.tabIndex,P=t.removeIcon,M=t.maxTagCount,O=t.maxTagTextLength,N=t.maxTagPlaceholder,F=N===void 0?function(qe){return"+ ".concat(qe.length," ...")}:N,$=t.tagRender,j=t.onToggleOpen,U=t.onRemove,q=t.onInputChange,Y=t.onInputPaste,te=t.onInputKeyDown,Z=t.onInputMouseDown,X=t.onInputCompositionStart,J=t.onInputCompositionEnd,ce=E.exports.useRef(null),re=E.exports.useState(0),se=$e(re,2),oe=se[0],he=se[1],Ce=E.exports.useState(!1),Se=$e(Ce,2),be=Se[0],Re=Se[1],Ie="".concat(r,"-selection"),Me=o||g==="multiple"&&a===!1||g==="tags"?s:"",Ae=g==="tags"||g==="multiple"&&a===!1||v&&(o||be);YJ(function(){he(ce.current.scrollWidth)},[Me]);function Fe(qe,Ct,ot,vt,yt){return it("span",{className:je("".concat(Ie,"-item"),ae({},"".concat(Ie,"-item-disabled"),ot)),title:U$(qe),children:[A("span",{className:"".concat(Ie,"-item-content"),children:Ct}),vt&&A(cb,{className:"".concat(Ie,"-item-remove"),onMouseDown:GR,onClick:yt,customizeIcon:P,children:"\xD7"})]})}function Ke(qe,Ct,ot,vt,yt){var Tt=function(ut){GR(ut),j(!o)};return A("span",{onMouseDown:Tt,children:$({label:Ct,value:qe,disabled:ot,closable:vt,onClose:yt})})}function Ue(qe){var Ct=qe.disabled,ot=qe.label,vt=qe.value,yt=!p&&!Ct,Tt=ot;if(typeof O=="number"&&(typeof ot=="string"||typeof ot=="number")){var et=String(Tt);et.length>O&&(Tt="".concat(et.slice(0,O),"..."))}var ut=function(He){He&&He.stopPropagation(),U(qe)};return typeof $=="function"?Ke(vt,Tt,Ct,yt,ut):Fe(qe,Tt,Ct,yt,ut)}function pt(qe){var Ct=typeof F=="function"?F(qe):F;return Fe({title:Ct},Ct,!1)}var gt=it("div",{className:"".concat(Ie,"-search"),style:{width:oe},onFocus:function(){Re(!0)},onBlur:function(){Re(!1)},children:[A(oT,{ref:c,open:o,prefixCls:r,id:n,inputElement:null,disabled:p,autoFocus:b,autoComplete:_,editable:Ae,activeDescendantId:T,value:Me,onKeyDown:te,onMouseDown:Z,onChange:q,onPaste:Y,onCompositionStart:X,onCompositionEnd:J,tabIndex:I,attrs:Zl(t,!0)}),it("span",{ref:ce,className:"".concat(Ie,"-search-mirror"),"aria-hidden":!0,children:[Me,"\xA0"]})]}),Dt=A(nl,{prefixCls:"".concat(Ie,"-overflow"),data:i,renderItem:Ue,renderRest:pt,suffix:gt,itemKey:QJ,maxCount:M});return it(nr,{children:[Dt,!i.length&&!Me&&A("span",{className:"".concat(Ie,"-placeholder"),children:f})]})},eee=function(t){var n=t.inputElement,r=t.prefixCls,i=t.id,o=t.inputRef,s=t.disabled,a=t.autoFocus,c=t.autoComplete,f=t.activeDescendantId,p=t.mode,g=t.open,v=t.values,b=t.placeholder,_=t.tabIndex,T=t.showSearch,I=t.searchValue,P=t.activeValue,M=t.maxLength,O=t.onInputKeyDown,N=t.onInputMouseDown,F=t.onInputChange,$=t.onInputPaste,j=t.onInputCompositionStart,U=t.onInputCompositionEnd,q=E.exports.useState(!1),Y=$e(q,2),te=Y[0],Z=Y[1],X=p==="combobox",J=X||T,ce=v[0],re=I||"";X&&P&&!te&&(re=P),E.exports.useEffect(function(){X&&Z(!1)},[X,P]);var se=p!=="combobox"&&!g&&!T?!1:!!re,oe=U$(ce),he=function(){if(ce)return null;var Se=se?{visibility:"hidden"}:void 0;return A("span",{className:"".concat(r,"-selection-placeholder"),style:Se,children:b})};return it(nr,{children:[A("span",{className:"".concat(r,"-selection-search"),children:A(oT,{ref:o,prefixCls:r,id:i,open:g,inputElement:n,disabled:s,autoFocus:a,autoComplete:c,editable:J,activeDescendantId:f,value:re,onKeyDown:O,onMouseDown:N,onChange:function(Se){Z(!0),F(Se)},onPaste:$,onCompositionStart:j,onCompositionEnd:U,tabIndex:_,attrs:Zl(t,!0),maxLength:X?M:void 0})}),!X&&ce&&!se&&A("span",{className:"".concat(r,"-selection-item"),title:oe,children:ce.label}),he()]})};function tee(e){return![Pt.ESC,Pt.SHIFT,Pt.BACKSPACE,Pt.TAB,Pt.WIN_KEY,Pt.ALT,Pt.META,Pt.WIN_KEY_RIGHT,Pt.CTRL,Pt.SEMICOLON,Pt.EQUALS,Pt.CAPS_LOCK,Pt.CONTEXT_MENU,Pt.F1,Pt.F2,Pt.F3,Pt.F4,Pt.F5,Pt.F6,Pt.F7,Pt.F8,Pt.F9,Pt.F10,Pt.F11,Pt.F12].includes(e)}var nee=function(t,n){var r=E.exports.useRef(null),i=E.exports.useRef(!1),o=t.prefixCls,s=t.open,a=t.mode,c=t.showSearch,f=t.tokenWithEnter,p=t.autoClearSearchValue,g=t.onSearch,v=t.onSearchSubmit,b=t.onToggleOpen,_=t.onInputKeyDown,T=t.domRef;E.exports.useImperativeHandle(n,function(){return{focus:function(){r.current.focus()},blur:function(){r.current.blur()}}});var I=F$(0),P=$e(I,2),M=P[0],O=P[1],N=function(se){var oe=se.which;(oe===Pt.UP||oe===Pt.DOWN)&&se.preventDefault(),_&&_(se),oe===Pt.ENTER&&a==="tags"&&!i.current&&!s&&(v==null||v(se.target.value)),tee(oe)&&b(!0)},F=function(){O(!0)},$=E.exports.useRef(null),j=function(se){g(se,!0,i.current)!==!1&&b(!0)},U=function(){i.current=!0},q=function(se){i.current=!1,a!=="combobox"&&j(se.target.value)},Y=function(se){var oe=se.target.value;if(f&&$.current&&/[\r\n]/.test($.current)){var he=$.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");oe=oe.replace(he,$.current)}$.current=null,j(oe)},te=function(se){var oe=se.clipboardData,he=oe.getData("text");$.current=he},Z=function(se){var oe=se.target;if(oe!==r.current){var he=document.body.style.msTouchAction!==void 0;he?setTimeout(function(){r.current.focus()}):r.current.focus()}},X=function(se){var oe=M();se.target!==r.current&&!oe&&a!=="combobox"&&se.preventDefault(),(a!=="combobox"&&(!c||!oe)||!s)&&(s&&p!==!1&&g("",!0,!1),b())},J={inputRef:r,onInputKeyDown:N,onInputMouseDown:F,onInputChange:Y,onInputPaste:te,onInputCompositionStart:U,onInputCompositionEnd:q},ce=a==="multiple"||a==="tags"?A(JJ,{...t,...J}):A(eee,{...t,...J});return A("div",{ref:T,className:"".concat(o,"-selector"),onClick:Z,onMouseDown:X,children:ce})},j$=E.exports.forwardRef(nee);j$.displayName="Selector";var ree=E.exports.forwardRef(function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,o=E.exports.useRef(),s=E.exports.useRef();E.exports.useImperativeHandle(t,function(){return{}});var a=E.exports.useRef(!1);return!a.current&&To()&&(s.current=r(),o.current=s.current.parentNode,a.current=!0),E.exports.useEffect(function(){n==null||n(e)}),E.exports.useEffect(function(){return s.current.parentNode===null&&o.current!==null&&o.current.appendChild(s.current),function(){var c,f;(c=s.current)===null||c===void 0||(f=c.parentNode)===null||f===void 0||f.removeChild(s.current)}},[]),s.current?ic.createPortal(i,s.current):null});function iee(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function oee(e,t,n){var r=e[t]||{};return me(me({},r),n)}function aee(e,t,n,r){for(var i=n.points,o=Object.keys(e),s=0;s=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Mee(e,t,n,r){var i=Gn.clone(e),o={width:t.width,height:t.height};return r.adjustX&&i.left=n.left&&i.left+o.width>n.right&&(o.width-=i.left+o.width-n.right),r.adjustX&&i.left+o.width>n.right&&(i.left=Math.max(n.right-o.width,n.left)),r.adjustY&&i.top=n.top&&i.top+o.height>n.bottom&&(o.height-=i.top+o.height-n.bottom),r.adjustY&&i.top+o.height>n.bottom&&(i.top=Math.max(n.bottom-o.height,n.top)),Gn.mix(i,o)}function uT(e){var t,n,r;if(!Gn.isWindow(e)&&e.nodeType!==9)t=Gn.offset(e),n=Gn.outerWidth(e),r=Gn.outerHeight(e);else{var i=Gn.getWindow(e);t={left:Gn.getWindowScrollLeft(i),top:Gn.getWindowScrollTop(i)},n=Gn.viewportWidth(i),r=Gn.viewportHeight(i)}return t.width=n,t.height=r,t}function rD(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,o=e.height,s=e.left,a=e.top;return n==="c"?a+=o/2:n==="b"&&(a+=o),r==="c"?s+=i/2:r==="r"&&(s+=i),{left:s,top:a}}function c0(e,t,n,r,i){var o=rD(t,n[1]),s=rD(e,n[0]),a=[s.left-o.left,s.top-o.top];return{left:Math.round(e.left-a[0]+r[0]-i[0]),top:Math.round(e.top-a[1]+r[1]-i[1])}}function iD(e,t,n){return e.leftn.right}function oD(e,t,n){return e.topn.bottom}function Ree(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.right||r.top>=n.bottom}function cT(e,t,n){var r=n.target||t,i=uT(r),o=!Oee(r,n.overflow&&n.overflow.alwaysByViewport);return Q$(e,i,n,o)}cT.__getOffsetParent=E4;cT.__getVisibleRectForElement=lT;function Aee(e,t,n){var r,i,o=Gn.getDocument(e),s=o.defaultView||o.parentWindow,a=Gn.getWindowScrollLeft(s),c=Gn.getWindowScrollTop(s),f=Gn.viewportWidth(s),p=Gn.viewportHeight(s);"pageX"in t?r=t.pageX:r=a+t.clientX,"pageY"in t?i=t.pageY:i=c+t.clientY;var g={left:r,top:i,width:0,height:0},v=r>=0&&r<=a+f&&i>=0&&i<=c+p,b=[n.points[0],"cc"];return Q$(e,g,ZR(ZR({},n),{},{points:b}),v)}function dT(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=r.has(o);if(Lr(!c,"Warning: There may be circular references"),c)return!1;if(o===s)return!0;if(n&&a>1)return!1;r.add(o);var f=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var p=0;p1&&(Dt=A("div",{className:"".concat(r,"-content"),children:s})),A(oa,{visible:n,ref:$,leavedClassName:"".concat(r,"-hidden"),...Ke,onAppearPrepare:Ue,onEnterPrepare:Ue,removeOnLeave:f,forceRender:p,children:function(qe,Ct){var ot=qe.className,vt=qe.style,yt=je(r,i,q,ot);return A(J$,{target:Me(),ref:F,monitorWindowResize:!0,disabled:gt,align:g,onAlign:Fe,children:A("div",{ref:Ct,className:yt,onMouseEnter:I,onMouseLeave:P,onMouseDownCapture:M,onTouchStartCapture:O,onClick:N,style:me(me({},vt),pt),children:Dt})},"popup")}})});eB.displayName="PopupInner";var tB=E.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.visible,i=e.zIndex,o=e.children,s=e.mobile;s=s===void 0?{}:s;var a=s.popupClassName,c=s.popupStyle,f=s.popupMotion,p=f===void 0?{}:f,g=s.popupRender,v=e.onClick,b=E.exports.useRef();E.exports.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return b.current}}});var _=me({zIndex:i},c),T=o;return E.exports.Children.count(o)>1&&(T=A("div",{className:"".concat(n,"-content"),children:o})),g&&(T=g(T)),A(oa,{visible:r,ref:b,removeOnLeave:!0,...p,children:function(I,P){var M=I.className,O=I.style,N=je(n,a,M);return A("div",{ref:P,className:N,onClick:v,style:me(me({},O),_),children:T})}})});tB.displayName="MobilePopupInner";var Vee=["visible","mobile"],nB=E.exports.forwardRef(function(e,t){var n=e.visible,r=e.mobile,i=kn(e,Vee),o=E.exports.useState(n),s=$e(o,2),a=s[0],c=s[1],f=E.exports.useState(!1),p=$e(f,2),g=p[0],v=p[1],b=me(me({},i),{},{visible:a});E.exports.useEffect(function(){c(n),n&&r&&v(A$())},[n,r]);var _=g?A(tB,{...b,mobile:r,ref:t}):A(eB,{...b,ref:t});return it("div",{children:[A(see,{...b}),_]})});nB.displayName="Popup";var fD=E.exports.createContext(null);function RC(){}function Uee(){return""}function jee(e){return e?e.ownerDocument:window.document}var Hee=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Kee(e){var t=function(n){si(i,n);var r=li(i);function i(o){var s;jr(this,i),s=r.call(this,o),ae(zn(s),"popupRef",E.exports.createRef()),ae(zn(s),"triggerRef",E.exports.createRef()),ae(zn(s),"portalContainer",void 0),ae(zn(s),"attachId",void 0),ae(zn(s),"clickOutsideHandler",void 0),ae(zn(s),"touchOutsideHandler",void 0),ae(zn(s),"contextMenuOutsideHandler1",void 0),ae(zn(s),"contextMenuOutsideHandler2",void 0),ae(zn(s),"mouseDownTimeout",void 0),ae(zn(s),"focusTime",void 0),ae(zn(s),"preClickTime",void 0),ae(zn(s),"preTouchTime",void 0),ae(zn(s),"delayTimer",void 0),ae(zn(s),"hasPopupMouseDown",void 0),ae(zn(s),"onMouseEnter",function(c){var f=s.props.mouseEnterDelay;s.fireEvents("onMouseEnter",c),s.delaySetPopupVisible(!0,f,f?null:c)}),ae(zn(s),"onMouseMove",function(c){s.fireEvents("onMouseMove",c),s.setPoint(c)}),ae(zn(s),"onMouseLeave",function(c){s.fireEvents("onMouseLeave",c),s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),ae(zn(s),"onPopupMouseEnter",function(){s.clearDelayTimer()}),ae(zn(s),"onPopupMouseLeave",function(c){var f;c.relatedTarget&&!c.relatedTarget.setTimeout&&yd((f=s.popupRef.current)===null||f===void 0?void 0:f.getElement(),c.relatedTarget)||s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),ae(zn(s),"onFocus",function(c){s.fireEvents("onFocus",c),s.clearDelayTimer(),s.isFocusToShow()&&(s.focusTime=Date.now(),s.delaySetPopupVisible(!0,s.props.focusDelay))}),ae(zn(s),"onMouseDown",function(c){s.fireEvents("onMouseDown",c),s.preClickTime=Date.now()}),ae(zn(s),"onTouchStart",function(c){s.fireEvents("onTouchStart",c),s.preTouchTime=Date.now()}),ae(zn(s),"onBlur",function(c){s.fireEvents("onBlur",c),s.clearDelayTimer(),s.isBlurToHide()&&s.delaySetPopupVisible(!1,s.props.blurDelay)}),ae(zn(s),"onContextMenu",function(c){c.preventDefault(),s.fireEvents("onContextMenu",c),s.setPopupVisible(!0,c)}),ae(zn(s),"onContextMenuClose",function(){s.isContextMenuToShow()&&s.close()}),ae(zn(s),"onClick",function(c){if(s.fireEvents("onClick",c),s.focusTime){var f;if(s.preClickTime&&s.preTouchTime?f=Math.min(s.preClickTime,s.preTouchTime):s.preClickTime?f=s.preClickTime:s.preTouchTime&&(f=s.preTouchTime),Math.abs(f-s.focusTime)<20)return;s.focusTime=0}s.preClickTime=0,s.preTouchTime=0,s.isClickToShow()&&(s.isClickToHide()||s.isBlurToHide())&&c&&c.preventDefault&&c.preventDefault();var p=!s.state.popupVisible;(s.isClickToHide()&&!p||p&&s.isClickToShow())&&s.setPopupVisible(!s.state.popupVisible,c)}),ae(zn(s),"onPopupMouseDown",function(){if(s.hasPopupMouseDown=!0,clearTimeout(s.mouseDownTimeout),s.mouseDownTimeout=window.setTimeout(function(){s.hasPopupMouseDown=!1},0),s.context){var c;(c=s.context).onPopupMouseDown.apply(c,arguments)}}),ae(zn(s),"onDocumentClick",function(c){if(!(s.props.mask&&!s.props.maskClosable)){var f=c.target,p=s.getRootDomNode(),g=s.getPopupDomNode();(!yd(p,f)||s.isContextMenuOnly())&&!yd(g,f)&&!s.hasPopupMouseDown&&s.close()}}),ae(zn(s),"getRootDomNode",function(){var c=s.props.getTriggerDOMNode;if(c)return c(s.triggerRef.current);try{var f=bg(s.triggerRef.current);if(f)return f}catch{}return ic.findDOMNode(zn(s))}),ae(zn(s),"getPopupClassNameFromAlign",function(c){var f=[],p=s.props,g=p.popupPlacement,v=p.builtinPlacements,b=p.prefixCls,_=p.alignPoint,T=p.getPopupClassNameFromAlign;return g&&v&&f.push(aee(v,b,c,_)),T&&f.push(T(c)),f.join(" ")}),ae(zn(s),"getComponent",function(){var c=s.props,f=c.prefixCls,p=c.destroyPopupOnHide,g=c.popupClassName,v=c.onPopupAlign,b=c.popupMotion,_=c.popupAnimation,T=c.popupTransitionName,I=c.popupStyle,P=c.mask,M=c.maskAnimation,O=c.maskTransitionName,N=c.maskMotion,F=c.zIndex,$=c.popup,j=c.stretch,U=c.alignPoint,q=c.mobile,Y=c.forceRender,te=c.onPopupClick,Z=s.state,X=Z.popupVisible,J=Z.point,ce=s.getPopupAlign(),re={};return s.isMouseEnterToShow()&&(re.onMouseEnter=s.onPopupMouseEnter),s.isMouseLeaveToHide()&&(re.onMouseLeave=s.onPopupMouseLeave),re.onMouseDown=s.onPopupMouseDown,re.onTouchStart=s.onPopupMouseDown,A(nB,{prefixCls:f,destroyPopupOnHide:p,visible:X,point:U&&J,className:g,align:ce,onAlign:v,animation:_,getClassNameFromAlign:s.getPopupClassNameFromAlign,...re,stretch:j,getRootDomNode:s.getRootDomNode,style:I,mask:P,zIndex:F,transitionName:T,maskAnimation:M,maskTransitionName:O,maskMotion:N,ref:s.popupRef,motion:b,mobile:q,forceRender:Y,onClick:te,children:typeof $=="function"?$():$})}),ae(zn(s),"attachParent",function(c){ur.cancel(s.attachId);var f=s.props,p=f.getPopupContainer,g=f.getDocument,v=s.getRootDomNode(),b;p?(v||p.length===0)&&(b=p(v)):b=g(s.getRootDomNode()).body,b?b.appendChild(c):s.attachId=ur(function(){s.attachParent(c)})}),ae(zn(s),"getContainer",function(){if(!s.portalContainer){var c=s.props.getDocument,f=c(s.getRootDomNode()).createElement("div");f.style.position="absolute",f.style.top="0",f.style.left="0",f.style.width="100%",s.portalContainer=f}return s.attachParent(s.portalContainer),s.portalContainer}),ae(zn(s),"setPoint",function(c){var f=s.props.alignPoint;!f||!c||s.setState({point:{pageX:c.pageX,pageY:c.pageY}})}),ae(zn(s),"handlePortalUpdate",function(){s.state.prevPopupVisible!==s.state.popupVisible&&s.props.afterPopupVisibleChange(s.state.popupVisible)}),ae(zn(s),"triggerContextValue",{onPopupMouseDown:s.onPopupMouseDown});var a;return"popupVisible"in o?a=!!o.popupVisible:a=!!o.defaultPopupVisible,s.state={prevPopupVisible:a,popupVisible:a},Hee.forEach(function(c){s["fire".concat(c)]=function(f){s.fireEvents(c,f)}}),s}return Hr(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var s=this.props,a=this.state;if(a.popupVisible){var c;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(c=s.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Qo(c,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(c=c||s.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Qo(c,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(c=c||s.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Qo(c,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Qo(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ur.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var s;return((s=this.popupRef.current)===null||s===void 0?void 0:s.getElement())||null}},{key:"getPopupAlign",value:function(){var s=this.props,a=s.popupPlacement,c=s.popupAlign,f=s.builtinPlacements;return a&&f?oee(f,a,c):c}},{key:"setPopupVisible",value:function(s,a){var c=this.props.alignPoint,f=this.state.popupVisible;this.clearDelayTimer(),f!==s&&("popupVisible"in this.props||this.setState({popupVisible:s,prevPopupVisible:f}),this.props.onPopupVisibleChange(s)),c&&a&&s&&this.setPoint(a)}},{key:"delaySetPopupVisible",value:function(s,a,c){var f=this,p=a*1e3;if(this.clearDelayTimer(),p){var g=c?{pageX:c.pageX,pageY:c.pageY}:null;this.delayTimer=window.setTimeout(function(){f.setPopupVisible(s,g),f.clearDelayTimer()},p)}else this.setPopupVisible(s,c)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(s){var a=this.props.children.props,c=this.props;return a[s]&&c[s]?this["fire".concat(s)]:a[s]||c[s]}},{key:"isClickToShow",value:function(){var s=this.props,a=s.action,c=s.showAction;return a.indexOf("click")!==-1||c.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var s=this.props.action;return s==="contextMenu"||s.length===1&&s[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var s=this.props,a=s.action,c=s.showAction;return a.indexOf("contextMenu")!==-1||c.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var s=this.props,a=s.action,c=s.hideAction;return a.indexOf("click")!==-1||c.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var s=this.props,a=s.action,c=s.showAction;return a.indexOf("hover")!==-1||c.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var s=this.props,a=s.action,c=s.hideAction;return a.indexOf("hover")!==-1||c.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var s=this.props,a=s.action,c=s.showAction;return a.indexOf("focus")!==-1||c.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var s=this.props,a=s.action,c=s.hideAction;return a.indexOf("focus")!==-1||c.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var s;(s=this.popupRef.current)===null||s===void 0||s.forceAlign()}}},{key:"fireEvents",value:function(s,a){var c=this.props.children.props[s];c&&c(a);var f=this.props[s];f&&f(a)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var s=this.state.popupVisible,a=this.props,c=a.children,f=a.forceRender,p=a.alignPoint,g=a.className,v=a.autoDestroy,b=E.exports.Children.only(c),_={key:"trigger"};this.isContextMenuToShow()?_.onContextMenu=this.onContextMenu:_.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(_.onClick=this.onClick,_.onMouseDown=this.onMouseDown,_.onTouchStart=this.onTouchStart):(_.onClick=this.createTwoChains("onClick"),_.onMouseDown=this.createTwoChains("onMouseDown"),_.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(_.onMouseEnter=this.onMouseEnter,p&&(_.onMouseMove=this.onMouseMove)):_.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?_.onMouseLeave=this.onMouseLeave:_.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(_.onFocus=this.onFocus,_.onBlur=this.onBlur):(_.onFocus=this.createTwoChains("onFocus"),_.onBlur=this.createTwoChains("onBlur"));var T=je(b&&b.props&&b.props.className,g);T&&(_.className=T);var I=me({},_);Nh(b)&&(I.ref=Aa(this.triggerRef,b.ref));var P=E.exports.cloneElement(b,I),M;return(s||this.popupRef.current||f)&&(M=A(e,{getContainer:this.getContainer,didUpdate:this.handlePortalUpdate,children:this.getComponent()},"portal")),!s&&v&&(M=null),it(fD.Provider,{value:this.triggerContextValue,children:[P,M]})}}],[{key:"getDerivedStateFromProps",value:function(s,a){var c=s.popupVisible,f={};return c!==void 0&&a.popupVisible!==c&&(f.popupVisible=c,f.prevPopupVisible=a.popupVisible),f}}]),i}(E.exports.Component);return ae(t,"contextType",fD),ae(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Uee,getDocument:jee,onPopupVisibleChange:RC,afterPopupVisibleChange:RC,onPopupAlign:RC,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}const V_=Kee(ree);var Wee=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Gee=function(t){var n=t===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}}}},qee=function(t,n){var r=t.prefixCls;t.disabled;var i=t.visible,o=t.children,s=t.popupElement,a=t.containerWidth,c=t.animation,f=t.transitionName,p=t.dropdownStyle,g=t.dropdownClassName,v=t.direction,b=v===void 0?"ltr":v,_=t.placement,T=t.dropdownMatchSelectWidth,I=t.dropdownRender,P=t.dropdownAlign,M=t.getPopupContainer,O=t.empty,N=t.getTriggerDOMNode,F=t.onPopupVisibleChange,$=t.onPopupMouseEnter,j=kn(t,Wee),U="".concat(r,"-dropdown"),q=s;I&&(q=I(s));var Y=E.exports.useMemo(function(){return Gee(T)},[T]),te=c?"".concat(U,"-").concat(c):f,Z=E.exports.useRef(null);E.exports.useImperativeHandle(n,function(){return{getPopupElement:function(){return Z.current}}});var X=me({minWidth:a},p);return typeof T=="number"?X.width=T:T&&(X.width=a),A(V_,{...j,showAction:F?["click"]:[],hideAction:F?["click"]:[],popupPlacement:_||(b==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Y,prefixCls:U,popupTransitionName:te,popup:A("div",{ref:Z,onMouseEnter:$,children:q}),popupAlign:P,popupVisible:i,getPopupContainer:M,popupClassName:je(g,ae({},"".concat(U,"-empty"),O)),popupStyle:X,getTriggerDOMNode:N,onPopupVisibleChange:F,children:o})},rB=E.exports.forwardRef(qee);rB.displayName="SelectTrigger";function hD(e,t){var n=e.key,r;return"value"in e&&(r=e.value),n!=null?n:r!==void 0?r:"rc-index-key-".concat(t)}function iB(e,t){var n=e||{},r=n.label,i=n.value,o=n.options;return{label:r||(t?"children":"label"),value:i||"value",options:o||"options"}}function Zee(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],o=iB(n,!1),s=o.label,a=o.value,c=o.options;function f(p,g){p.forEach(function(v){var b=v[s];if(g||!(c in v)){var _=v[a];i.push({key:hD(v,i.length),groupOption:g,data:v,label:b,value:_})}else{var T=b;T===void 0&&r&&(T=v.label),i.push({key:hD(v,i.length),group:!0,data:v,label:T}),f(v[c],!0)}})}return f(e,!1),i}function P4(e){var t=me({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Lr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function Xee(e,t){if(!t||!t.length)return null;var n=!1;function r(o,s){var a=WP(s),c=a[0],f=a.slice(1);if(!c)return[o];var p=o.split(c);return n=n||p.length>1,p.reduce(function(g,v){return[].concat(Mt(g),Mt(r(v,f)))},[]).filter(function(g){return g})}var i=r(e,t);return n?i:null}var Yee=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Qee=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function T4(e){return e==="tags"||e==="multiple"}var oB=E.exports.forwardRef(function(e,t){var n,r,i=e.id,o=e.prefixCls,s=e.className,a=e.showSearch,c=e.tagRender,f=e.direction,p=e.omitDomProps,g=e.displayValues,v=e.onDisplayValuesChange,b=e.emptyOptions,_=e.notFoundContent,T=_===void 0?"Not Found":_,I=e.onClear,P=e.mode,M=e.disabled,O=e.loading,N=e.getInputElement,F=e.getRawInputElement,$=e.open,j=e.defaultOpen,U=e.onDropdownVisibleChange,q=e.activeValue,Y=e.onActiveValueChange,te=e.activeDescendantId,Z=e.searchValue,X=e.autoClearSearchValue,J=e.onSearch,ce=e.onSearchSplit,re=e.tokenSeparators,se=e.allowClear,oe=e.showArrow,he=e.inputIcon,Ce=e.clearIcon,Se=e.OptionList,be=e.animation,Re=e.transitionName,Ie=e.dropdownStyle,Me=e.dropdownClassName,Ae=e.dropdownMatchSelectWidth,Fe=e.dropdownRender,Ke=e.dropdownAlign,Ue=e.placement,pt=e.getPopupContainer,gt=e.showAction,Dt=gt===void 0?[]:gt,qe=e.onFocus,Ct=e.onBlur,ot=e.onKeyUp,vt=e.onKeyDown,yt=e.onMouseDown,Tt=kn(e,Yee),et=T4(P),ut=(a!==void 0?a:et)||P==="combobox",at=me({},Tt);Qee.forEach(function(Dn){delete at[Dn]}),p==null||p.forEach(function(Dn){delete at[Dn]});var He=E.exports.useState(!1),ct=$e(He,2),bt=ct[0],Ot=ct[1];E.exports.useEffect(function(){Ot(A$())},[]);var Lt=E.exports.useRef(null),Ht=E.exports.useRef(null),ze=E.exports.useRef(null),Ye=E.exports.useRef(null),Zt=E.exports.useRef(null),an=MJ(),Kt=$e(an,3),Vt=Kt[0],It=Kt[1],Xt=Kt[2];E.exports.useImperativeHandle(t,function(){var Dn,Mn;return{focus:(Dn=Ye.current)===null||Dn===void 0?void 0:Dn.focus,blur:(Mn=Ye.current)===null||Mn===void 0?void 0:Mn.blur,scrollTo:function(ti){var wr;return(wr=Zt.current)===null||wr===void 0?void 0:wr.scrollTo(ti)}}});var pn=E.exports.useMemo(function(){var Dn;if(P!=="combobox")return Z;var Mn=(Dn=g[0])===null||Dn===void 0?void 0:Dn.value;return typeof Mn=="string"||typeof Mn=="number"?String(Mn):""},[Z,P,g]),tt=P==="combobox"&&typeof N=="function"&&N()||null,At=typeof F=="function"&&F(),qt=Q5(Ht,At==null||(n=At.props)===null||n===void 0?void 0:n.ref),En=Ei(void 0,{defaultValue:j,value:$}),yn=$e(En,2),St=yn[0],Pn=yn[1],_n=St,tn=!T&&b;(M||tn&&_n&&P==="combobox")&&(_n=!1);var zt=tn?!1:_n,dt=E.exports.useCallback(function(Dn){var Mn=Dn!==void 0?Dn:!_n;M||(Pn(Mn),_n!==Mn&&(U==null||U(Mn)))},[M,_n,Pn,U]),mt=E.exports.useMemo(function(){return(re||[]).some(function(Dn){return[` `,`\r `].includes(Dn)})},[re]),$t=function(Mn,Nn,ti){var wr=!0,Wn=Mn;Y==null||Y(null);var Bn=ti?null:Xee(Mn,re);return P!=="combobox"&&Bn&&(Wn="",ce==null||ce(Bn),dt(!1),wr=!1),J&&pn!==Wn&&J(Wn,{source:Nn?"typing":"effect"}),wr},Wt=function(Mn){!Mn||!Mn.trim()||J(Mn,{source:"submit"})};E.exports.useEffect(function(){!_n&&!et&&P!=="combobox"&&$t("",!1,!1)},[_n]),E.exports.useEffect(function(){St&&M&&Pn(!1),M&&It(!1)},[M]);var mn=F$(),An=$e(mn,2),Qn=An[0],Jn=An[1],ye=function(Mn){var Nn=Qn(),ti=Mn.which;if(ti===Pt.ENTER&&(P!=="combobox"&&Mn.preventDefault(),_n||dt(!0)),Jn(!!pn),ti===Pt.BACKSPACE&&!Nn&&et&&!pn&&g.length){for(var wr=Mt(g),Wn=null,Bn=wr.length-1;Bn>=0;Bn-=1){var rr=wr[Bn];if(!rr.disabled){wr.splice(Bn,1),Wn=rr;break}}Wn&&v(wr,{type:"remove",values:[Wn]})}for(var Er=arguments.length,Tr=new Array(Er>1?Er-1:0),Gr=1;Gr1?Nn-1:0),wr=1;wr1?Bn-1:0),Er=1;Er1&&arguments[1]!==void 0?arguments[1]:!1;return Po(e).map(function(n,r){if(!E.exports.isValidElement(n)||!n.type)return null;var i=n,o=i.type.isSelectOptGroup,s=i.key,a=i.props,c=a.children,f=kn(a,ite);return t||!o?ote(n):me(me({key:"__RC_SELECT_GRP__".concat(s===null?r:s,"__"),label:s},f),{},{options:sB(c)})}).filter(function(n){return n})}function ate(e,t,n,r,i){return E.exports.useMemo(function(){var o=e,s=!e;s&&(o=sB(t));var a=new Map,c=new Map,f=function(v,b,_){_&&typeof _=="string"&&v.set(b[_],b)};function p(g){for(var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,b=0;bc},r}return Hr(n,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(i){i.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var i=this.state,o=i.dragging,s=i.visible,a=this.props.prefixCls,c=this.getSpinHeight(),f=this.getTop(),p=this.showScroll(),g=p&&s;return A("div",{ref:this.scrollbarRef,className:je("".concat(a,"-scrollbar"),ae({},"".concat(a,"-scrollbar-show"),p)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:g?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden,children:A("div",{ref:this.thumbRef,className:je("".concat(a,"-scrollbar-thumb"),ae({},"".concat(a,"-scrollbar-thumb-moving"),o)),style:{width:"100%",height:c,top:f,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown})})}}]),n}(E.exports.Component);function ute(e){var t=e.children,n=e.setRef,r=E.exports.useCallback(function(i){n(i)},[]);return E.exports.cloneElement(t,{ref:r})}function cte(e,t,n,r,i,o){var s=o.getKey;return e.slice(t,n+1).map(function(a,c){var f=t+c,p=i(a,f,{}),g=s(a);return A(ute,{setRef:function(b){return r(a,b)},children:p},g)})}var dte=function(){function e(){jr(this,e),this.maps=void 0,this.maps=Object.create(null)}return Hr(e,[{key:"set",value:function(n,r){this.maps[n]=r}},{key:"get",value:function(n){return this.maps[n]}}]),e}();function fte(e,t,n){var r=E.exports.useState(0),i=$e(r,2),o=i[0],s=i[1],a=E.exports.useRef(new Map),c=E.exports.useRef(new dte),f=E.exports.useRef();function p(){ur.cancel(f.current)}function g(){p(),f.current=ur(function(){a.current.forEach(function(b,_){if(b&&b.offsetParent){var T=bg(b),I=T.offsetHeight;c.current.get(_)!==I&&c.current.set(_,T.offsetHeight)}}),s(function(b){return b+1})})}function v(b,_){var T=e(b),I=a.current.get(T);_?(a.current.set(T,_),g()):a.current.delete(T),!I!=!_&&(_?t==null||t(b):n==null||n(b))}return E.exports.useEffect(function(){return p},[]),[v,g,c.current,o]}function hte(e,t,n,r,i,o,s,a){var c=E.exports.useRef();return function(f){if(f==null){a();return}if(ur.cancel(c.current),typeof f=="number")s(f);else if(f&&on(f)==="object"){var p,g=f.align;"index"in f?p=f.index:p=t.findIndex(function(T){return i(T)===f.key});var v=f.offset,b=v===void 0?0:v,_=function T(I,P){if(!(I<0||!e.current)){var M=e.current.clientHeight,O=!1,N=P;if(M){for(var F=P||g,$=0,j=0,U=0,q=Math.min(t.length,p),Y=0;Y<=q;Y+=1){var te=i(t[Y]);j=$;var Z=n.get(te);U=j+(Z===void 0?r:Z),$=U,Y===p&&Z===void 0&&(O=!0)}var X=null;switch(F){case"top":X=j-b;break;case"bottom":X=U-M+b;break;default:{var J=e.current.scrollTop,ce=J+M;jce&&(N="bottom")}}X!==null&&X!==e.current.scrollTop&&s(X)}c.current=ur(function(){O&&o(),T(I-1,N)},2)}};_(3)}}}function pte(e,t,n){var r=e.length,i=t.length,o,s;if(r===0&&i===0)return null;r"u"?"undefined":on(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const uB=function(e,t){var n=E.exports.useRef(!1),r=E.exports.useRef(null);function i(){clearTimeout(r.current),n.current=!0,r.current=setTimeout(function(){n.current=!1},50)}var o=E.exports.useRef({top:e,bottom:t});return o.current.top=e,o.current.bottom=t,function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c=s<0&&o.current.top||s>0&&o.current.bottom;return a&&c?(clearTimeout(r.current),n.current=!1):(!c||n.current)&&i(),!n.current&&c}};function vte(e,t,n,r){var i=E.exports.useRef(0),o=E.exports.useRef(null),s=E.exports.useRef(null),a=E.exports.useRef(!1),c=uB(t,n);function f(g){if(!!e){ur.cancel(o.current);var v=g.deltaY;i.current+=v,s.current=v,!c(v)&&(gte||g.preventDefault(),o.current=ur(function(){var b=a.current?10:1;r(i.current*b),i.current=0}))}}function p(g){!e||(a.current=g.detail===s.current)}return[f,p]}var yte=14/15;function xte(e,t,n){var r=E.exports.useRef(!1),i=E.exports.useRef(0),o=E.exports.useRef(null),s=E.exports.useRef(null),a,c=function(v){if(r.current){var b=Math.ceil(v.touches[0].pageY),_=i.current-b;i.current=b,n(_)&&v.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){_*=yte,(!n(_,!0)||Math.abs(_)<=.1)&&clearInterval(s.current)},16)}},f=function(){r.current=!1,a()},p=function(v){a(),v.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(v.touches[0].pageY),o.current=v.target,o.current.addEventListener("touchmove",c),o.current.addEventListener("touchend",f))};a=function(){o.current&&(o.current.removeEventListener("touchmove",c),o.current.removeEventListener("touchend",f))},Si(function(){return e&&t.current.addEventListener("touchstart",p),function(){var g;(g=t.current)===null||g===void 0||g.removeEventListener("touchstart",p),a(),clearInterval(s.current)}},[e])}var bte=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],_te=[],wte={overflowY:"auto",overflowAnchor:"none"};function Cte(e,t){var n=e.prefixCls,r=n===void 0?"rc-virtual-list":n,i=e.className,o=e.height,s=e.itemHeight,a=e.fullHeight,c=a===void 0?!0:a,f=e.style,p=e.data,g=e.children,v=e.itemKey,b=e.virtual,_=e.component,T=_===void 0?"div":_,I=e.onScroll,P=e.onVisibleChange,M=e.innerProps,O=kn(e,bte),N=!!(b!==!1&&o&&s),F=N&&p&&s*p.length>o,$=E.exports.useState(0),j=$e($,2),U=j[0],q=j[1],Y=E.exports.useState(!1),te=$e(Y,2),Z=te[0],X=te[1],J=je(r,i),ce=p||_te,re=E.exports.useRef(),se=E.exports.useRef(),oe=E.exports.useRef(),he=E.exports.useCallback(function(Vt){return typeof v=="function"?v(Vt):Vt==null?void 0:Vt[v]},[v]),Ce={getKey:he};function Se(Vt){q(function(It){var Xt;typeof Vt=="function"?Xt=Vt(It):Xt=Vt;var pn=ut(Xt);return re.current.scrollTop=pn,pn})}var be=E.exports.useRef({start:0,end:ce.length}),Re=E.exports.useRef(),Ie=mte(ce,he),Me=$e(Ie,1),Ae=Me[0];Re.current=Ae;var Fe=fte(he,null,null),Ke=$e(Fe,4),Ue=Ke[0],pt=Ke[1],gt=Ke[2],Dt=Ke[3],qe=E.exports.useMemo(function(){if(!N)return{scrollHeight:void 0,start:0,end:ce.length-1,offset:void 0};if(!F){var Vt;return{scrollHeight:((Vt=se.current)===null||Vt===void 0?void 0:Vt.offsetHeight)||0,start:0,end:ce.length-1,offset:void 0}}for(var It=0,Xt,pn,tt,At=ce.length,qt=0;qt=U&&Xt===void 0&&(Xt=qt,pn=It),Pn>U+o&&tt===void 0&&(tt=qt),It=Pn}return Xt===void 0&&(Xt=0,pn=0,tt=Math.ceil(o/s)),tt===void 0&&(tt=ce.length-1),tt=Math.min(tt+1,ce.length),{scrollHeight:It,start:Xt,end:tt,offset:pn}},[F,N,U,ce,Dt,o]),Ct=qe.scrollHeight,ot=qe.start,vt=qe.end,yt=qe.offset;be.current.start=ot,be.current.end=vt;var Tt=Ct-o,et=E.exports.useRef(Tt);et.current=Tt;function ut(Vt){var It=Vt;return Number.isNaN(et.current)||(It=Math.min(It,et.current)),It=Math.max(It,0),It}var at=U<=0,He=U>=Tt,ct=uB(at,He);function bt(Vt){var It=Vt;Se(It)}function Ot(Vt){var It=Vt.currentTarget.scrollTop;It!==U&&Se(It),I==null||I(Vt)}var Lt=vte(N,at,He,function(Vt){Se(function(It){var Xt=It+Vt;return Xt})}),Ht=$e(Lt,2),ze=Ht[0],Ye=Ht[1];xte(N,re,function(Vt,It){return ct(Vt,It)?!1:(ze({preventDefault:function(){},deltaY:Vt}),!0)}),Si(function(){function Vt(It){N&&It.preventDefault()}return re.current.addEventListener("wheel",ze),re.current.addEventListener("DOMMouseScroll",Ye),re.current.addEventListener("MozMousePixelScroll",Vt),function(){re.current&&(re.current.removeEventListener("wheel",ze),re.current.removeEventListener("DOMMouseScroll",Ye),re.current.removeEventListener("MozMousePixelScroll",Vt))}},[N]);var Zt=hte(re,ce,gt,s,he,pt,Se,function(){var Vt;(Vt=oe.current)===null||Vt===void 0||Vt.delayHidden()});E.exports.useImperativeHandle(t,function(){return{scrollTo:Zt}}),Si(function(){if(P){var Vt=ce.slice(ot,vt+1);P(Vt,ce)}},[ot,vt,ce]);var an=cte(ce,ot,vt,Ue,g,Ce),Kt=null;return o&&(Kt=me(ae({},c?"height":"maxHeight",o),wte),N&&(Kt.overflowY="hidden",Z&&(Kt.pointerEvents="none"))),it("div",{style:me(me({},f),{},{position:"relative"}),className:J,...O,children:[A(T,{className:"".concat(r,"-holder"),style:Kt,ref:re,onScroll:Ot,children:A(lB,{prefixCls:r,height:Ct,offset:yt,onInnerResize:pt,ref:se,innerProps:M,children:an})}),N&&A(lte,{ref:oe,prefixCls:r,scrollTop:U,height:o,scrollHeight:Ct,count:ce.length,onScroll:bt,onStartMove:function(){X(!0)},onStopMove:function(){X(!1)}})]})}var mT=E.exports.forwardRef(Cte);mT.displayName="List";function Ste(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var cB=E.exports.createContext(null),Ete=["disabled","title","children","style","className"];function vD(e){return typeof e=="string"||typeof e=="number"}var Pte=function(t,n){var r=L$(),i=r.prefixCls,o=r.id,s=r.open,a=r.multiple,c=r.mode,f=r.searchValue,p=r.toggleOpen,g=r.notFoundContent,v=r.onPopupScroll,b=E.exports.useContext(cB),_=b.flattenOptions,T=b.onActiveValue,I=b.defaultActiveFirstOption,P=b.onSelect,M=b.menuItemSelectedIcon,O=b.rawValues,N=b.fieldNames,F=b.virtual,$=b.listHeight,j=b.listItemHeight,U="".concat(i,"-item"),q=Yg(function(){return _},[s,_],function(Ie,Me){return Me[0]&&Ie[1]!==Me[1]}),Y=E.exports.useRef(null),te=function(Me){Me.preventDefault()},Z=function(Me){Y.current&&Y.current.scrollTo(typeof Me=="number"?{index:Me}:Me)},X=function(Me){for(var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Fe=q.length,Ke=0;Ke1&&arguments[1]!==void 0?arguments[1]:!1;se(Me);var Fe={source:Ae?"keyboard":"mouse"},Ke=q[Me];if(!Ke){T(null,-1,Fe);return}T(Ke.value,Me,Fe)};E.exports.useEffect(function(){oe(I!==!1?X(0):-1)},[q.length,f]);var he=E.exports.useCallback(function(Ie){return O.has(Ie)&&c!=="combobox"},[c,Mt(O).toString(),O.size]);E.exports.useEffect(function(){var Ie=setTimeout(function(){if(!a&&s&&O.size===1){var Ae=Array.from(O)[0],Fe=q.findIndex(function(Ke){var Ue=Ke.data;return Ue.value===Ae});Fe!==-1&&(oe(Fe),Z(Fe))}});if(s){var Me;(Me=Y.current)===null||Me===void 0||Me.scrollTo(void 0)}return function(){return clearTimeout(Ie)}},[s,f]);var Ce=function(Me){Me!==void 0&&P(Me,{selected:!O.has(Me)}),a||p(!1)};if(E.exports.useImperativeHandle(n,function(){return{onKeyDown:function(Me){var Ae=Me.which,Fe=Me.ctrlKey;switch(Ae){case Pt.N:case Pt.P:case Pt.UP:case Pt.DOWN:{var Ke=0;if(Ae===Pt.UP?Ke=-1:Ae===Pt.DOWN?Ke=1:Ste()&&Fe&&(Ae===Pt.N?Ke=1:Ae===Pt.P&&(Ke=-1)),Ke!==0){var Ue=X(re+Ke,Ke);Z(Ue),oe(Ue,!0)}break}case Pt.ENTER:{var pt=q[re];pt&&!pt.data.disabled?Ce(pt.value):Ce(void 0),s&&Me.preventDefault();break}case Pt.ESC:p(!1),s&&Me.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Me){Z(Me)}}}),q.length===0)return A("div",{role:"listbox",id:"".concat(o,"_list"),className:"".concat(U,"-empty"),onMouseDown:te,children:g});var Se=Object.keys(N).map(function(Ie){return N[Ie]}),be=function(Me){return Me.label},Re=function(Me){var Ae=q[Me];if(!Ae)return null;var Fe=Ae.data||{},Ke=Fe.value,Ue=Ae.group,pt=Zl(Fe,!0),gt=be(Ae);return Ae?E.exports.createElement("div",{"aria-label":typeof gt=="string"&&!Ue?gt:null,...pt,key:Me,role:Ue?"presentation":"option",id:"".concat(o,"_list_").concat(Me),"aria-selected":he(Ke)},Ke):null};return it(nr,{children:[it("div",{role:"listbox",id:"".concat(o,"_list"),style:{height:0,width:0,overflow:"hidden"},children:[Re(re-1),Re(re),Re(re+1)]}),A(mT,{itemKey:"key",ref:Y,data:q,height:$,itemHeight:j,fullHeight:!1,onMouseDown:te,onScroll:v,virtual:F,children:function(Ie,Me){var Ae,Fe=Ie.group,Ke=Ie.groupOption,Ue=Ie.data,pt=Ie.label,gt=Ie.value,Dt=Ue.key;if(Fe){var qe,Ct=(qe=Ue.title)!==null&&qe!==void 0?qe:vD(pt)?pt.toString():void 0;return A("div",{className:je(U,"".concat(U,"-group")),title:Ct,children:pt!==void 0?pt:Dt})}var ot=Ue.disabled,vt=Ue.title;Ue.children;var yt=Ue.style,Tt=Ue.className,et=kn(Ue,Ete),ut=Gi(et,Se),at=he(gt),He="".concat(U,"-option"),ct=je(U,He,Tt,(Ae={},ae(Ae,"".concat(He,"-grouped"),Ke),ae(Ae,"".concat(He,"-active"),re===Me&&!ot),ae(Ae,"".concat(He,"-disabled"),ot),ae(Ae,"".concat(He,"-selected"),at),Ae)),bt=be(Ie),Ot=!M||typeof M=="function"||at,Lt=typeof bt=="number"?bt:bt||gt,Ht=vD(Lt)?Lt.toString():void 0;return vt!==void 0&&(Ht=vt),it("div",{...Zl(ut),"aria-selected":at,className:ct,title:Ht,onMouseMove:function(){re===Me||ot||oe(Me)},onClick:function(){ot||Ce(gt)},style:yt,children:[A("div",{className:"".concat(He,"-content"),children:Lt}),E.exports.isValidElement(M)||at,Ot&&A(cb,{className:"".concat(U,"-option-state"),customizeIcon:M,customizeIconProps:{isSelected:at},children:at?"\u2713":null})]})}})]})},dB=E.exports.forwardRef(Pte);dB.displayName="OptionList";var Tte=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],Ite=["inputValue"];function kte(e){return!e||on(e)!=="object"}var Mte=E.exports.forwardRef(function(e,t){var n=e.id,r=e.mode,i=e.prefixCls,o=i===void 0?"rc-select":i,s=e.backfill,a=e.fieldNames,c=e.inputValue,f=e.searchValue,p=e.onSearch,g=e.autoClearSearchValue,v=g===void 0?!0:g,b=e.onSelect,_=e.onDeselect,T=e.dropdownMatchSelectWidth,I=T===void 0?!0:T,P=e.filterOption,M=e.filterSort,O=e.optionFilterProp,N=e.optionLabelProp,F=e.options,$=e.children,j=e.defaultActiveFirstOption,U=e.menuItemSelectedIcon,q=e.virtual,Y=e.listHeight,te=Y===void 0?200:Y,Z=e.listItemHeight,X=Z===void 0?20:Z,J=e.value,ce=e.defaultValue,re=e.labelInValue,se=e.onChange,oe=kn(e,Tte),he=aB(n),Ce=T4(r),Se=!!(!F&&$),be=E.exports.useMemo(function(){return P===void 0&&r==="combobox"?!1:P},[P,r]),Re=E.exports.useMemo(function(){return iB(a,Se)},[JSON.stringify(a),Se]),Ie=Ei("",{value:f!==void 0?f:c,postState:function(mt){return mt||""}}),Me=$e(Ie,2),Ae=Me[0],Fe=Me[1],Ke=ate(F,$,Re,O,N),Ue=Ke.valueOptions,pt=Ke.labelOptions,gt=Ke.options,Dt=E.exports.useCallback(function(dt){var mt=V$(dt);return mt.map(function($t){var Wt,mn,An,Qn,Jn;if(kte($t))Wt=$t;else{var ye;An=$t.key,mn=$t.label,Wt=(ye=$t.value)!==null&&ye!==void 0?ye:An}var W=Ue.get(Wt);if(W){var Q;mn===void 0&&(mn=W==null?void 0:W[N||Re.label]),An===void 0&&(An=(Q=W==null?void 0:W.key)!==null&&Q!==void 0?Q:Wt),Qn=W==null?void 0:W.disabled,Jn=W==null?void 0:W.title}return{label:mn,value:Wt,key:An,disabled:Qn,title:Jn}})},[Re,N,Ue]),qe=Ei(ce,{value:J}),Ct=$e(qe,2),ot=Ct[0],vt=Ct[1],yt=E.exports.useMemo(function(){var dt,mt=Dt(ot);return r==="combobox"&&!((dt=mt[0])!==null&&dt!==void 0&&dt.value)?[]:mt},[ot,Dt,r]),Tt=Jee(yt,Ue),et=$e(Tt,2),ut=et[0],at=et[1],He=E.exports.useMemo(function(){if(!r&&ut.length===1){var dt=ut[0];if(dt.value===null&&(dt.label===null||dt.label===void 0))return[]}return ut.map(function(mt){var $t;return me(me({},mt),{},{label:($t=mt.label)!==null&&$t!==void 0?$t:mt.value})})},[r,ut]),ct=E.exports.useMemo(function(){return new Set(ut.map(function(dt){return dt.value}))},[ut]);E.exports.useEffect(function(){if(r==="combobox"){var dt,mt=(dt=ut[0])===null||dt===void 0?void 0:dt.value;Fe(XJ(mt)?String(mt):"")}},[ut]);var bt=mD(function(dt,mt){var $t,Wt=mt!=null?mt:dt;return $t={},ae($t,Re.value,dt),ae($t,Re.label,Wt),$t}),Ot=E.exports.useMemo(function(){if(r!=="tags")return gt;var dt=Mt(gt),mt=function(Wt){return Ue.has(Wt)};return Mt(ut).sort(function($t,Wt){return $t.value2&&arguments[2]!==void 0?arguments[2]:{},Wt=$t.source,mn=Wt===void 0?"keyboard":Wt;At(mt),s&&r==="combobox"&&dt!==null&&mn==="keyboard"&&It(String(dt))},[s,r]),yn=function(mt,$t,Wt){var mn=function(){var ke,we=at(mt);return[re?{label:we==null?void 0:we[Re.label],value:mt,key:(ke=we==null?void 0:we.key)!==null&&ke!==void 0?ke:mt}:mt,P4(we)]};if($t&&b){var An=mn(),Qn=$e(An,2),Jn=Qn[0],ye=Qn[1];b(Jn,ye)}else if(!$t&&_&&Wt!=="clear"){var W=mn(),Q=$e(W,2),fe=Q[0],ue=Q[1];_(fe,ue)}},St=mD(function(dt,mt){var $t,Wt=Ce?mt.selected:!0;Wt?$t=Ce?[].concat(Mt(ut),[dt]):[dt]:$t=ut.filter(function(mn){return mn.value!==dt}),Zt($t),yn(dt,Wt),r==="combobox"?It(""):(!T4||v)&&(Fe(""),It(""))}),Pn=function(mt,$t){Zt(mt);var Wt=$t.type,mn=$t.values;(Wt==="remove"||Wt==="clear")&&mn.forEach(function(An){yn(An.value,!1,Wt)})},_n=function(mt,$t){if(Fe(mt),It(null),$t.source==="submit"){var Wt=(mt||"").trim();if(Wt){var mn=Array.from(new Set([].concat(Mt(ct),[Wt])));Zt(mn),yn(Wt,!0),Fe("")}return}$t.source!=="blur"&&(r==="combobox"&&Zt(mt),p==null||p(mt))},tn=function(mt){var $t=mt;r!=="tags"&&($t=mt.map(function(mn){var An=pt.get(mn);return An==null?void 0:An.value}).filter(function(mn){return mn!==void 0}));var Wt=Array.from(new Set([].concat(Mt(ct),Mt($t))));Zt(Wt),Wt.forEach(function(mn){yn(mn,!0)})},zt=E.exports.useMemo(function(){var dt=q!==!1&&I!==!1;return me(me({},Ke),{},{flattenOptions:Ye,onActiveValue:En,defaultActiveFirstOption:qt,onSelect:St,menuItemSelectedIcon:U,rawValues:ct,fieldNames:Re,virtual:dt,listHeight:te,listItemHeight:X,childrenAsData:Se})},[Ke,Ye,En,qt,St,U,ct,Re,q,I,te,X,Se]);return A(cB.Provider,{value:zt,children:A(oB,{...oe,id:he,prefixCls:o,ref:t,omitDomProps:Ite,mode:r,displayValues:He,onDisplayValuesChange:Pn,searchValue:Ae,onSearch:_n,autoClearSearchValue:v,onSearchSplit:tn,dropdownMatchSelectWidth:I,OptionList:dB,emptyOptions:!Ye.length,activeValue:Vt,activeDescendantId:"".concat(he,"_list_").concat(tt)})})}),gT=Mte;gT.Option=pT;gT.OptGroup=hT;var Rte=function(){var t=E.exports.useContext(Fn),n=t.getPrefixCls,r=n("empty-img-default");return A("svg",{className:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg",children:it("g",{fill:"none",fillRule:"evenodd",children:[it("g",{transform:"translate(24 31.67)",children:[A("ellipse",{className:"".concat(r,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),A("path",{className:"".concat(r,"-path-1"),d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),A("path",{className:"".concat(r,"-path-2"),d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",transform:"translate(13.56)"}),A("path",{className:"".concat(r,"-path-3"),d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),A("path",{className:"".concat(r,"-path-4"),d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})]}),A("path",{className:"".concat(r,"-path-5"),d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),it("g",{className:"".concat(r,"-g"),transform:"translate(149.65 15.383)",children:[A("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),A("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})]})]})})};const Dte=Rte;var Ote=function(){var t=E.exports.useContext(Fn),n=t.getPrefixCls,r=n("empty-img-simple");return A("svg",{className:r,width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:it("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[A("ellipse",{className:"".concat(r,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),it("g",{className:"".concat(r,"-g"),fillRule:"nonzero",children:[A("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),A("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",className:"".concat(r,"-path")})]})]})})};const Ate=Ote;var Nte=globalThis&&globalThis.__rest||function(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=1},subscribe:function(t){return jc.size||this.register(),NC+=1,jc.set(NC,t),t(p0),NC},unsubscribe:function(t){jc.delete(t),jc.size||this.unregister()},unregister:function(){var t=this;Object.keys(h0).forEach(function(n){var r=h0[n],i=t.matchHandlers[r];i==null||i.mql.removeListener(i==null?void 0:i.listener)}),jc.clear()},register:function(){var t=this;Object.keys(h0).forEach(function(n){var r=h0[n],i=function(a){var c=a.matches;t.dispatch(Je(Je({},p0),ae({},n,c)))},o=window.matchMedia(r);o.addListener(i),t.matchHandlers[r]={mql:o,listener:i},i(o)})}};const pb=Xte;function wB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=E.exports.useRef({}),n=_T();return E.exports.useEffect(function(){var r=pb.subscribe(function(i){t.current=i,e&&n()});return function(){return pb.unsubscribe(r)}},[]),t.current}var Ua={adjustX:1,adjustY:1},ja=[0,0],CB={left:{points:["cr","cl"],overflow:Ua,offset:[-4,0],targetOffset:ja},right:{points:["cl","cr"],overflow:Ua,offset:[4,0],targetOffset:ja},top:{points:["bc","tc"],overflow:Ua,offset:[0,-4],targetOffset:ja},bottom:{points:["tc","bc"],overflow:Ua,offset:[0,4],targetOffset:ja},topLeft:{points:["bl","tl"],overflow:Ua,offset:[0,-4],targetOffset:ja},leftTop:{points:["tr","tl"],overflow:Ua,offset:[-4,0],targetOffset:ja},topRight:{points:["br","tr"],overflow:Ua,offset:[0,-4],targetOffset:ja},rightTop:{points:["tl","tr"],overflow:Ua,offset:[4,0],targetOffset:ja},bottomRight:{points:["tr","br"],overflow:Ua,offset:[0,4],targetOffset:ja},rightBottom:{points:["bl","br"],overflow:Ua,offset:[4,0],targetOffset:ja},bottomLeft:{points:["tl","bl"],overflow:Ua,offset:[0,4],targetOffset:ja},leftBottom:{points:["br","bl"],overflow:Ua,offset:[-4,0],targetOffset:ja}};function Yte(e){var t=e.showArrow,n=e.arrowContent,r=e.children,i=e.prefixCls,o=e.id,s=e.overlayInnerStyle,a=e.className,c=e.style;return it("div",{className:je("".concat(i,"-content"),a),style:c,children:[t!==!1&&A("div",{className:"".concat(i,"-arrow"),children:n},"arrow"),A("div",{className:"".concat(i,"-inner"),id:o,role:"tooltip",style:s,children:typeof r=="function"?r():r})]})}var Qte=function(t,n){var r=t.overlayClassName,i=t.trigger,o=i===void 0?["hover"]:i,s=t.mouseEnterDelay,a=s===void 0?0:s,c=t.mouseLeaveDelay,f=c===void 0?.1:c,p=t.overlayStyle,g=t.prefixCls,v=g===void 0?"rc-tooltip":g,b=t.children,_=t.onVisibleChange,T=t.afterVisibleChange,I=t.transitionName,P=t.animation,M=t.motion,O=t.placement,N=O===void 0?"right":O,F=t.align,$=F===void 0?{}:F,j=t.destroyTooltipOnHide,U=j===void 0?!1:j,q=t.defaultVisible,Y=t.getTooltipContainer,te=t.overlayInnerStyle,Z=t.arrowContent,X=t.overlay,J=t.id,ce=t.showArrow,re=kn(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),se=E.exports.useRef(null);E.exports.useImperativeHandle(n,function(){return se.current});var oe=me({},re);"visible"in t&&(oe.popupVisible=t.visible);var he=function(){return A(Yte,{showArrow:ce,arrowContent:Z,prefixCls:v,id:J,overlayInnerStyle:te,children:X},"content")},Ce=!1,Se=!1;if(typeof U=="boolean")Ce=U;else if(U&&on(U)==="object"){var be=U.keepParent;Ce=be===!0,Se=be===!1}return A(V_,{popupClassName:r,prefixCls:v,popup:he,action:o,builtinPlacements:CB,popupPlacement:N,ref:se,popupAlign:$,getPopupContainer:Y,onPopupVisibleChange:_,afterPopupVisibleChange:T,popupTransitionName:I,popupAnimation:P,popupMotion:M,defaultPopupVisible:q,destroyPopupOnHide:Ce,autoDestroy:Se,mouseLeaveDelay:f,popupStyle:p,mouseEnterDelay:a,...oe,children:b})};const Jte=E.exports.forwardRef(Qte);aa("success","processing","error","default","warning");var ene=aa("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"),tne={adjustX:1,adjustY:1},xD={adjustX:0,adjustY:0},nne=[0,0];function bD(e){return typeof e=="boolean"?e?tne:xD:Je(Je({},xD),e)}function SB(e){var t=e.arrowWidth,n=t===void 0?4:t,r=e.horizontalArrowShift,i=r===void 0?16:r,o=e.verticalArrowShift,s=o===void 0?8:o,a=e.autoAdjustOverflow,c=e.arrowPointAtCenter,f={left:{points:["cr","cl"],offset:[-4,0]},right:{points:["cl","cr"],offset:[4,0]},top:{points:["bc","tc"],offset:[0,-4]},bottom:{points:["tc","bc"],offset:[0,4]},topLeft:{points:["bl","tc"],offset:[-(i+n),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(s+n)]},topRight:{points:["br","tc"],offset:[i+n,-4]},rightTop:{points:["tl","cr"],offset:[4,-(s+n)]},bottomRight:{points:["tr","bc"],offset:[i+n,4]},rightBottom:{points:["bl","cr"],offset:[4,s+n]},bottomLeft:{points:["tl","bc"],offset:[-(i+n),4]},leftBottom:{points:["br","cl"],offset:[-4,s+n]}};return Object.keys(f).forEach(function(p){f[p]=c?Je(Je({},f[p]),{overflow:bD(a),targetOffset:nne}):Je(Je({},CB[p]),{overflow:bD(a)}),f[p].ignoreShake=!0}),f}var rne=globalThis&&globalThis.__rest||function(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);i1&&arguments[1]!==void 0?arguments[1]:!1;if(fT(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),o=Number(i),s=null;return i&&!Number.isNaN(o)?s=o:r&&s===null&&(s=0),r&&e.disabled&&(s=null),s!==null&&(s>=0||t&&s<0)}return!1}function OB(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Mt(e.querySelectorAll("*")).filter(function(r){return CD(r,t)});return CD(e,t)&&n.unshift(e),n}var k4=Pt.LEFT,M4=Pt.RIGHT,R4=Pt.UP,sx=Pt.DOWN,lx=Pt.ENTER,AB=Pt.ESC,rm=Pt.HOME,im=Pt.END,SD=[R4,sx,k4,M4];function mne(e,t,n,r){var i,o,s,a,c="prev",f="next",p="children",g="parent";if(e==="inline"&&r===lx)return{inlineTrigger:!0};var v=(i={},ae(i,R4,c),ae(i,sx,f),i),b=(o={},ae(o,k4,n?f:c),ae(o,M4,n?c:f),ae(o,sx,p),ae(o,lx,p),o),_=(s={},ae(s,R4,c),ae(s,sx,f),ae(s,lx,p),ae(s,AB,g),ae(s,k4,n?p:g),ae(s,M4,n?g:p),s),T={inline:v,horizontal:b,vertical:_,inlineSub:v,horizontalSub:_,verticalSub:_},I=(a=T["".concat(e).concat(t?"":"Sub")])===null||a===void 0?void 0:a[r];switch(I){case c:return{offset:-1,sibling:!0};case f:return{offset:1,sibling:!0};case g:return{offset:-1,sibling:!1};case p:return{offset:1,sibling:!1};default:return null}}function gne(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function vne(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}function NB(e,t){var n=OB(e,!0);return n.filter(function(r){return t.has(r)})}function ED(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var i=NB(e,t),o=i.length,s=i.findIndex(function(a){return n===a});return r<0?s===-1?s=o-1:s-=1:r>0&&(s+=1),s=(s+o)%o,i[s]}function yne(e,t,n,r,i,o,s,a,c,f){var p=E.exports.useRef(),g=E.exports.useRef();g.current=t;var v=function(){ur.cancel(p.current)};return E.exports.useEffect(function(){return function(){v()}},[]),function(b){var _=b.which;if([].concat(SD,[lx,AB,rm,im]).includes(_)){var T,I,P,M=function(){T=new Set,I=new Map,P=new Map;var ce=o();return ce.forEach(function(re){var se=document.querySelector("[data-menu-id='".concat(wT(r,re),"']"));se&&(T.add(se),P.set(se,re),I.set(re,se))}),T};M();var O=I.get(t),N=vne(O,T),F=P.get(N),$=mne(e,s(F,!0).length===1,n,_);if(!$&&_!==rm&&_!==im)return;(SD.includes(_)||[rm,im].includes(_))&&b.preventDefault();var j=function(ce){if(ce){var re=ce,se=ce.querySelector("a");se!=null&&se.getAttribute("href")&&(re=se);var oe=P.get(ce);a(oe),v(),p.current=ur(function(){g.current===oe&&re.focus()})}};if([rm,im].includes(_)||$.sibling||!N){var U;!N||e==="inline"?U=i.current:U=gne(N);var q,Y=NB(U,T);_===rm?q=Y[0]:_===im?q=Y[Y.length-1]:q=ED(U,T,N,$.offset),j(q)}else if($.inlineTrigger)c(F);else if($.offset>0)c(F,!0),v(),p.current=ur(function(){M();var J=N.getAttribute("aria-controls"),ce=document.getElementById(J),re=ED(ce,T);j(re)},5);else if($.offset<0){var te=s(F,!0),Z=te[te.length-2],X=I.get(Z);c(Z,!1),j(X)}}f==null||f(b)}}function xne(e){Promise.resolve().then(e)}var ST="__RC_UTIL_PATH_SPLIT__",PD=function(t){return t.join(ST)},bne=function(t){return t.split(ST)},D4="rc-menu-more";function _ne(){var e=E.exports.useState({}),t=$e(e,2),n=t[1],r=E.exports.useRef(new Map),i=E.exports.useRef(new Map),o=E.exports.useState([]),s=$e(o,2),a=s[0],c=s[1],f=E.exports.useRef(0),p=E.exports.useRef(!1),g=function(){p.current||n({})},v=E.exports.useCallback(function(O,N){var F=PD(N);i.current.set(F,O),r.current.set(O,F),f.current+=1;var $=f.current;xne(function(){$===f.current&&g()})},[]),b=E.exports.useCallback(function(O,N){var F=PD(N);i.current.delete(F),r.current.delete(O)},[]),_=E.exports.useCallback(function(O){c(O)},[]),T=E.exports.useCallback(function(O,N){var F=r.current.get(O)||"",$=bne(F);return N&&a.includes($[0])&&$.unshift(D4),$},[a]),I=E.exports.useCallback(function(O,N){return O.some(function(F){var $=T(F,!0);return $.includes(N)})},[T]),P=function(){var N=Mt(r.current.keys());return a.length&&N.push(D4),N},M=E.exports.useCallback(function(O){var N="".concat(r.current.get(O)).concat(ST),F=new Set;return Mt(i.current.keys()).forEach(function($){$.startsWith(N)&&F.add(i.current.get($))}),F},[]);return E.exports.useEffect(function(){return function(){p.current=!0}},[]),{registerPath:v,unregisterPath:b,refreshOverflowKeys:_,isSubPathKey:I,getKeyPath:T,getKeys:P,getSubPathKeys:M}}function Rf(e){var t=E.exports.useRef(e);t.current=e;var n=E.exports.useCallback(function(){for(var r,i=arguments.length,o=new Array(i),s=0;s1&&(M.motionAppear=!1);var O=M.onVisibleChanged;return M.onVisibleChanged=function(N){return!v.current&&!N&&I(!0),O==null?void 0:O(N)},T?null:A(Pg,{mode:o,locked:!v.current,children:A(oa,{visible:P,...M,forceRender:c,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden"),children:function(N){var F=N.className,$=N.style;return A(ET,{id:t,className:F,style:$,children:i})}})})}var $ne=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Bne=["active"],Vne=function(t){var n,r=t.style,i=t.className,o=t.title,s=t.eventKey;t.warnKey;var a=t.disabled,c=t.internalPopupClose,f=t.children,p=t.itemIcon,g=t.expandIcon,v=t.popupClassName,b=t.popupOffset,_=t.onClick,T=t.onMouseEnter,I=t.onMouseLeave,P=t.onTitleClick,M=t.onTitleMouseEnter,O=t.onTitleMouseLeave,N=kn(t,$ne),F=kB(s),$=E.exports.useContext(Ds),j=$.prefixCls,U=$.mode,q=$.openKeys,Y=$.disabled,te=$.overflowDisabled,Z=$.activeKey,X=$.selectedKeys,J=$.itemIcon,ce=$.expandIcon,re=$.onItemClick,se=$.onOpenChange,oe=$.onActive,he=E.exports.useContext(CT),Ce=he._internalRenderSubMenuItem,Se=E.exports.useContext(DB),be=Se.isSubPathKey,Re=Vh(),Ie="".concat(j,"-submenu"),Me=Y||a,Ae=E.exports.useRef(),Fe=E.exports.useRef(),Ke=p||J,Ue=g||ce,pt=q.includes(s),gt=!te&&pt,Dt=be(X,s),qe=LB(s,Me,M,O),Ct=qe.active,ot=kn(qe,Bne),vt=E.exports.useState(!1),yt=$e(vt,2),Tt=yt[0],et=yt[1],ut=function(Xt){Me||et(Xt)},at=function(Xt){ut(!0),T==null||T({key:s,domEvent:Xt})},He=function(Xt){ut(!1),I==null||I({key:s,domEvent:Xt})},ct=E.exports.useMemo(function(){return Ct||(U!=="inline"?Tt||be([Z],s):!1)},[U,Ct,Z,Tt,s,be]),bt=zB(Re.length),Ot=function(Xt){Me||(P==null||P({key:s,domEvent:Xt}),U==="inline"&&se(s,!pt))},Lt=Rf(function(It){_==null||_(mb(It)),re(It)}),Ht=function(Xt){U!=="inline"&&se(s,Xt)},ze=function(){oe(s)},Ye=F&&"".concat(F,"-popup"),Zt=it("div",{role:"menuitem",style:bt,className:"".concat(Ie,"-title"),tabIndex:Me?null:-1,ref:Ae,title:typeof o=="string"?o:null,"data-menu-id":te&&F?null:F,"aria-expanded":gt,"aria-haspopup":!0,"aria-controls":Ye,"aria-disabled":Me,onClick:Ot,onFocus:ze,...ot,children:[o,A(FB,{icon:U!=="horizontal"?Ue:null,props:me(me({},t),{},{isOpen:gt,isSubMenu:!0}),children:A("i",{className:"".concat(Ie,"-arrow")})})]}),an=E.exports.useRef(U);if(U!=="inline"&&Re.length>1?an.current="vertical":an.current=U,!te){var Kt=an.current;Zt=A(Fne,{mode:Kt,prefixCls:Ie,visible:!c&>&&U!=="inline",popupClassName:v,popupOffset:b,popup:A(Pg,{mode:Kt==="horizontal"?"vertical":Kt,children:A(ET,{id:Ye,ref:Fe,children:f})}),disabled:Me,onVisibleChange:Ht,children:Zt})}var Vt=it(nl.Item,{role:"none",...N,component:"li",style:r,className:je(Ie,"".concat(Ie,"-").concat(U),i,(n={},ae(n,"".concat(Ie,"-open"),gt),ae(n,"".concat(Ie,"-active"),ct),ae(n,"".concat(Ie,"-selected"),Dt),ae(n,"".concat(Ie,"-disabled"),Me),n)),onMouseEnter:at,onMouseLeave:He,children:[Zt,!te&&A(zne,{id:Ye,open:gt,keyPath:Re,children:f})]});return Ce&&(Vt=Ce(Vt,t,{selected:Dt,active:ct,open:gt,disabled:Me})),A(Pg,{onItemClick:Lt,mode:U==="horizontal"?"vertical":U,itemIcon:Ke,expandIcon:Ue,children:Vt})};function G_(e){var t=e.eventKey,n=e.children,r=Vh(t),i=PT(n,r),o=K_();E.exports.useEffect(function(){if(o)return o.registerPath(t,r),function(){o.unregisterPath(t,r)}},[r]);var s;return o?s=i:s=A(Vne,{...e,children:i}),A(RB.Provider,{value:r,children:s})}var Une=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Ef=[],jne=E.exports.forwardRef(function(e,t){var n,r,i=e,o=i.prefixCls,s=o===void 0?"rc-menu":o,a=i.rootClassName,c=i.style,f=i.className,p=i.tabIndex,g=p===void 0?0:p,v=i.items,b=i.children,_=i.direction,T=i.id,I=i.mode,P=I===void 0?"vertical":I,M=i.inlineCollapsed,O=i.disabled,N=i.disabledOverflow,F=i.subMenuOpenDelay,$=F===void 0?.1:F,j=i.subMenuCloseDelay,U=j===void 0?.1:j,q=i.forceSubMenuRender,Y=i.defaultOpenKeys,te=i.openKeys,Z=i.activeKey,X=i.defaultActiveFirst,J=i.selectable,ce=J===void 0?!0:J,re=i.multiple,se=re===void 0?!1:re,oe=i.defaultSelectedKeys,he=i.selectedKeys,Ce=i.onSelect,Se=i.onDeselect,be=i.inlineIndent,Re=be===void 0?24:be,Ie=i.motion,Me=i.defaultMotions,Ae=i.triggerSubMenuAction,Fe=Ae===void 0?"hover":Ae,Ke=i.builtinPlacements,Ue=i.itemIcon,pt=i.expandIcon,gt=i.overflowedIndicator,Dt=gt===void 0?"...":gt,qe=i.overflowedIndicatorPopupClassName,Ct=i.getPopupContainer,ot=i.onClick,vt=i.onOpenChange,yt=i.onKeyDown;i.openAnimation,i.openTransitionName;var Tt=i._internalRenderMenuItem,et=i._internalRenderSubMenuItem,ut=kn(i,Une),at=E.exports.useMemo(function(){return One(b,v,Ef)},[b,v]),He=E.exports.useState(!1),ct=$e(He,2),bt=ct[0],Ot=ct[1],Lt=E.exports.useRef(),Ht=Cne(T),ze=_==="rtl",Ye=Ei(Y,{value:te,postState:function(Bn){return Bn||Ef}}),Zt=$e(Ye,2),an=Zt[0],Kt=Zt[1],Vt=function(Bn){var rr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Er(){Kt(Bn),vt==null||vt(Bn)}rr?al.exports.flushSync(Er):Er()},It=E.exports.useState(an),Xt=$e(It,2),pn=Xt[0],tt=Xt[1],At=E.exports.useRef(!1),qt=E.exports.useMemo(function(){return(P==="inline"||P==="vertical")&&M?["vertical",M]:[P,!1]},[P,M]),En=$e(qt,2),yn=En[0],St=En[1],Pn=yn==="inline",_n=E.exports.useState(yn),tn=$e(_n,2),zt=tn[0],dt=tn[1],mt=E.exports.useState(St),$t=$e(mt,2),Wt=$t[0],mn=$t[1];E.exports.useEffect(function(){dt(yn),mn(St),At.current&&(Pn?Kt(pn):Vt(Ef))},[yn,St]);var An=E.exports.useState(0),Qn=$e(An,2),Jn=Qn[0],ye=Qn[1],W=Jn>=at.length-1||zt!=="horizontal"||N;E.exports.useEffect(function(){Pn&&tt(an)},[an]),E.exports.useEffect(function(){return At.current=!0,function(){At.current=!1}},[]);var Q=_ne(),fe=Q.registerPath,ue=Q.unregisterPath,xe=Q.refreshOverflowKeys,ke=Q.isSubPathKey,we=Q.getKeyPath,Pe=Q.getKeys,Le=Q.getSubPathKeys,Ze=E.exports.useMemo(function(){return{registerPath:fe,unregisterPath:ue}},[fe,ue]),Xe=E.exports.useMemo(function(){return{isSubPathKey:ke}},[ke]);E.exports.useEffect(function(){xe(W?Ef:at.slice(Jn+1).map(function(Wn){return Wn.key}))},[Jn,W]);var Ve=Ei(Z||X&&((n=at[0])===null||n===void 0?void 0:n.key),{value:Z}),Bt=$e(Ve,2),Et=Bt[0],nt=Bt[1],Ft=Rf(function(Wn){nt(Wn)}),Gt=Rf(function(){nt(void 0)});E.exports.useImperativeHandle(t,function(){return{list:Lt.current,focus:function(Bn){var rr,Er=Et!=null?Et:(rr=at.find(function(ru){return!ru.props.disabled}))===null||rr===void 0?void 0:rr.key;if(Er){var Tr,Gr,ko;(Tr=Lt.current)===null||Tr===void 0||(Gr=Tr.querySelector("li[data-menu-id='".concat(wT(Ht,Er),"']")))===null||Gr===void 0||(ko=Gr.focus)===null||ko===void 0||ko.call(Gr,Bn)}}}});var wn=Ei(oe||[],{value:he,postState:function(Bn){return Array.isArray(Bn)?Bn:Bn==null?Ef:[Bn]}}),dn=$e(wn,2),Cn=dn[0],jn=dn[1],or=function(Bn){if(ce){var rr=Bn.key,Er=Cn.includes(rr),Tr;se?Er?Tr=Cn.filter(function(ko){return ko!==rr}):Tr=[].concat(Mt(Cn),[rr]):Tr=[rr],jn(Tr);var Gr=me(me({},Bn),{},{selectedKeys:Tr});Er?Se==null||Se(Gr):Ce==null||Ce(Gr)}!se&&an.length&&zt!=="inline"&&Vt(Ef)},Wr=Rf(function(Wn){ot==null||ot(mb(Wn)),or(Wn)}),dr=Rf(function(Wn,Bn){var rr=an.filter(function(Tr){return Tr!==Wn});if(Bn)rr.push(Wn);else if(zt!=="inline"){var Er=Le(Wn);rr=rr.filter(function(Tr){return!Er.has(Tr)})}dT(an,rr,!0)||Vt(rr,!0)}),Fr=Rf(Ct),Dn=function(Bn,rr){var Er=rr!=null?rr:!an.includes(Bn);dr(Bn,Er)},Mn=yne(zt,Et,ze,Ht,Lt,Pe,we,nt,Dn,yt);E.exports.useEffect(function(){Ot(!0)},[]);var Nn=E.exports.useMemo(function(){return{_internalRenderMenuItem:Tt,_internalRenderSubMenuItem:et}},[Tt,et]),ti=zt!=="horizontal"||N?at:at.map(function(Wn,Bn){return A(Pg,{overflowDisabled:Bn>Jn,children:Wn},Wn.key)}),wr=A(nl,{id:T,ref:Lt,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:W_,className:je(s,"".concat(s,"-root"),"".concat(s,"-").concat(zt),f,(r={},ae(r,"".concat(s,"-inline-collapsed"),Wt),ae(r,"".concat(s,"-rtl"),ze),r),a),dir:_,style:c,role:"menu",tabIndex:g,data:ti,renderRawItem:function(Bn){return Bn},renderRawRest:function(Bn){var rr=Bn.length,Er=rr?at.slice(-rr):null;return A(G_,{eventKey:D4,title:Dt,disabled:W,internalPopupClose:rr===0,popupClassName:qe,children:Er})},maxCount:zt!=="horizontal"||N?nl.INVALIDATE:nl.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Bn){ye(Bn)},onKeyDown:Mn,...ut});return A(CT.Provider,{value:Nn,children:A(IB.Provider,{value:Ht,children:it(Pg,{prefixCls:s,rootClassName:a,mode:zt,openKeys:an,rtl:ze,disabled:O,motion:bt?Ie:null,defaultMotions:bt?Me:null,activeKey:Et,onActive:Ft,onInactive:Gt,selectedKeys:Cn,inlineIndent:Re,subMenuOpenDelay:$,subMenuCloseDelay:U,forceSubMenuRender:q,builtinPlacements:Ke,triggerSubMenuAction:Fe,getPopupContainer:Fr,itemIcon:Ue,expandIcon:pt,onItemClick:Wr,onOpenChange:dr,children:[A(DB.Provider,{value:Xe,children:wr}),A("div",{style:{display:"none"},"aria-hidden":!0,children:A(MB.Provider,{value:Ze,children:at})})]})})})}),Hne=["className","title","eventKey","children"],Kne=["children"],Wne=function(t){var n=t.className,r=t.title;t.eventKey;var i=t.children,o=kn(t,Hne),s=E.exports.useContext(Ds),a=s.prefixCls,c="".concat(a,"-item-group");return it("li",{role:"presentation",...o,onClick:function(p){return p.stopPropagation()},className:je(c,n),children:[A("div",{role:"presentation",className:"".concat(c,"-title"),title:typeof r=="string"?r:void 0,children:r}),A("ul",{role:"group",className:"".concat(c,"-list"),children:i})]})};function q_(e){var t=e.children,n=kn(e,Kne),r=Vh(n.eventKey),i=PT(t,r),o=K_();return o?i:A(Wne,{...Gi(n,["warnKey"]),children:i})}function TT(e){var t=e.className,n=e.style,r=E.exports.useContext(Ds),i=r.prefixCls,o=K_();return o?null:A("li",{className:je("".concat(i,"-item-divider"),t),style:n})}var iv=jne;iv.Item=W_;iv.SubMenu=G_;iv.ItemGroup=q_;iv.Divider=TT;var Gne={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const qne=Gne;var BB=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:qne})})};BB.displayName="LeftOutlined";const VB=E.exports.forwardRef(BB);var Zne={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const Xne=Zne;var UB=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Xne})})};UB.displayName="RightOutlined";const Z_=E.exports.forwardRef(UB);globalThis&&globalThis.__rest;var jB=E.exports.createContext({}),Yne=globalThis&&globalThis.__rest||function(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"u"?$=p?I:"":M===!1&&($="");var j={title:$};!s&&!g&&(j.title=null,j.open=!1);var U=Po(I).length,q=it(W_,{...F,className:je((o={},ae(o,"".concat(f,"-item-danger"),N),ae(o,"".concat(f,"-item-only-child"),(O?U+1:U)===1),o),T),title:typeof M=="string"?M:void 0,children:[Pi(O,{className:je(Ta(O)?(a=O.props)===null||a===void 0?void 0:a.className:"","".concat(f,"-item-icon"))}),r.renderItemChildren(g)]});return b||(q=A(ka,{...j,placement:v==="rtl"?"left":"right",overlayClassName:"".concat(f,"-inline-collapsed-tooltip"),children:q})),q},r}return Hr(n,[{key:"renderItemChildren",value:function(i){var o=this.context,s=o.prefixCls,a=o.firstLevel,c=this.props,f=c.icon,p=c.children,g=A("span",{className:"".concat(s,"-title-content"),children:p});return(!f||Ta(p)&&p.type==="span")&&p&&i&&a&&typeof p=="string"?A("div",{className:"".concat(s,"-inline-collapsed-noicon"),children:p.charAt(0)}):g}},{key:"render",value:function(){return A(jB.Consumer,{children:this.renderItem})}}]),n}(E.exports.Component);IT.contextType=gb;function KB(e){var t,n=e.popupClassName,r=e.icon,i=e.title,o=e.theme,s=E.exports.useContext(gb),a=s.prefixCls,c=s.inlineCollapsed,f=s.antdMenuTheme,p=Vh(),g;if(!r)g=c&&!p.length&&i&&typeof i=="string"?A("div",{className:"".concat(a,"-inline-collapsed-noicon"),children:i.charAt(0)}):A("span",{className:"".concat(a,"-title-content"),children:i});else{var v=Ta(i)&&i.type==="span";g=it(nr,{children:[Pi(r,{className:je(Ta(r)?(t=r.props)===null||t===void 0?void 0:t.className:"","".concat(a,"-item-icon"))}),v?i:A("span",{className:"".concat(a,"-title-content"),children:i})]})}var b=E.exports.useMemo(function(){return Je(Je({},s),{firstLevel:!1})},[s]);return A(gb.Provider,{value:b,children:A(G_,{...Gi(e,["icon"]),title:g,popupClassName:je(a,"".concat(a,"-").concat(o||f),n)})})}var tre=globalThis&&globalThis.__rest||function(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);i1&&arguments[1]!==void 0?arguments[1]:1,n=hre++,r=t;function i(){r-=1,r<=0?(e(),delete rh[n]):rh[n]=ur(i)}return rh[n]=ur(i),n}yb.cancel=function(t){t!==void 0&&(ur.cancel(rh[t]),delete rh[t])};yb.ids=rh;var LC;function ID(e){return!e||e.offsetParent===null||e.hidden}function pre(e){return e instanceof Document?e.body:Array.from(e.childNodes).find(function(t){return(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE})}function mre(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return t&&t[1]&&t[2]&&t[3]?!(t[1]===t[2]&&t[2]===t[3]):!0}var qB=function(e){si(n,e);var t=li(n);function n(){var r;return jr(this,n),r=t.apply(this,arguments),r.containerRef=E.exports.createRef(),r.animationStart=!1,r.destroyed=!1,r.onClick=function(i,o){var s,a,c=r.props,f=c.insertExtraNode,p=c.disabled;if(!(p||!i||ID(i)||i.className.includes("-leave"))){r.extraNode=document.createElement("div");var g=zn(r),v=g.extraNode,b=r.context.getPrefixCls;v.className="".concat(b(""),"-click-animating-node");var _=r.getAttributeName();if(i.setAttribute(_,"true"),o&&o!=="#fff"&&o!=="#ffffff"&&o!=="rgb(255, 255, 255)"&&o!=="rgba(255, 255, 255, 1)"&&mre(o)&&!/rgba\((?:\d*, ){3}0\)/.test(o)&&o!=="transparent"){v.style.borderColor=o;var T=((s=i.getRootNode)===null||s===void 0?void 0:s.call(i))||i.ownerDocument,I=(a=pre(T))!==null&&a!==void 0?a:T;LC=ev(` [`.concat(b(""),"-click-animating-without-extra-node='true']::after, .").concat(b(""),`-click-animating-node { --antd-wave-shadow-color: `).concat(o,`; }`),"antd-wave",{csp:r.csp,attachTo:I})}f&&i.appendChild(v),["transition","animation"].forEach(function(P){i.addEventListener("".concat(P,"start"),r.onTransitionStart),i.addEventListener("".concat(P,"end"),r.onTransitionEnd)})}},r.onTransitionStart=function(i){if(!r.destroyed){var o=r.containerRef.current;!i||i.target!==o||r.animationStart||r.resetEffect(o)}},r.onTransitionEnd=function(i){!i||i.animationName!=="fadeEffect"||r.resetEffect(i.target)},r.bindAnimationEvent=function(i){if(!(!i||!i.getAttribute||i.getAttribute("disabled")||i.className.includes("disabled"))){var o=function(a){if(!(a.target.tagName==="INPUT"||ID(a.target))){r.resetEffect(i);var c=getComputedStyle(i).getPropertyValue("border-top-color")||getComputedStyle(i).getPropertyValue("border-color")||getComputedStyle(i).getPropertyValue("background-color");r.clickWaveTimeoutId=window.setTimeout(function(){return r.onClick(i,c)},0),yb.cancel(r.animationStartId),r.animationStart=!0,r.animationStartId=yb(function(){r.animationStart=!1},10)}};return i.addEventListener("click",o,!0),{cancel:function(){i.removeEventListener("click",o,!0)}}}},r.renderWave=function(i){var o=i.csp,s=r.props.children;if(r.csp=o,!E.exports.isValidElement(s))return s;var a=r.containerRef;return Nh(s)&&(a=Aa(s.ref,r.containerRef)),Pi(s,{ref:a})},r}return Hr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var i=this.containerRef.current;!i||i.nodeType!==1||(this.instance=this.bindAnimationEvent(i))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var i=this.context.getPrefixCls,o=this.props.insertExtraNode;return o?"".concat(i(""),"-click-animating"):"".concat(i(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(i){var o=this;if(!(!i||i===this.extraNode||!(i instanceof Element))){var s=this.props.insertExtraNode,a=this.getAttributeName();i.setAttribute(a,"false"),LC&&(LC.innerHTML=""),s&&this.extraNode&&i.contains(this.extraNode)&&i.removeChild(this.extraNode),["transition","animation"].forEach(function(c){i.removeEventListener("".concat(c,"start"),o.onTransitionStart),i.removeEventListener("".concat(c,"end"),o.onTransitionEnd)})}}},{key:"render",value:function(){return A(Vd,{children:this.renderWave})}}]),n}(E.exports.Component);qB.contextType=Fn;const gre=qB;var vre=globalThis&&globalThis.__rest||function(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);i0&&(X=T.map(function(re){return typeof re=="string"||typeof re=="number"?A(xb,{prefixCls:te,disabled:M,value:re,checked:f===re,children:re},re.toString()):A(xb,{prefixCls:te,disabled:re.disabled||M,value:re.value,checked:f===re.value,style:re.style,children:re.label},"radio-group-value-options-".concat(re.value))}));var J=N||s,ce=je(Z,"".concat(Z,"-").concat(P),(n={},ae(n,"".concat(Z,"-").concat(J),J),ae(n,"".concat(Z,"-rtl"),o==="rtl"),n),_);return A("div",{...k$(e),className:ce,style:F,onMouseEnter:j,onMouseLeave:U,onFocus:q,onBlur:Y,id:$,ref:t,children:A(Eie,{value:{onChange:g,value:f,disabled:e.disabled,name:e.name,optionType:e.optionType},children:X})})});const Rie=E.exports.memo(Mie);var Die=globalThis&&globalThis.__rest||function(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=t||j<0||g&&U>=o}function P(){var $=BC();if(I($))return M($);a=setTimeout(P,T($))}function M($){return a=void 0,v&&r?b($):(r=i=void 0,s)}function O(){a!==void 0&&clearTimeout(a),f=0,r=c=i=a=void 0}function N(){return a===void 0?s:M(BC())}function F(){var $=BC(),j=I($);if(r=arguments,i=this,c=$,j){if(a===void 0)return _(c);if(g)return clearTimeout(a),a=setTimeout(P,t),b(c)}return a===void 0&&(a=setTimeout(P,t)),s}return F.cancel=O,F.flush=N,F}var jie=Uie;function u8(e,t){var n=new Set;return e.forEach(function(r){t.has(r)||n.add(r)}),n}function Hie(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,i=t.checkable;return!!(n||r)||i===!1}function Kie(e,t,n,r){for(var i=new Set(e),o=new Set,s=0;s<=n;s+=1){var a=t.get(s)||new Set;a.forEach(function(g){var v=g.key,b=g.node,_=g.children,T=_===void 0?[]:_;i.has(v)&&!r(b)&&T.filter(function(I){return!r(I.node)}).forEach(function(I){i.add(I.key)})})}for(var c=new Set,f=n;f>=0;f-=1){var p=t.get(f)||new Set;p.forEach(function(g){var v=g.parent,b=g.node;if(!(r(b)||!g.parent||c.has(g.parent.key))){if(r(g.parent.node)){c.add(v.key);return}var _=!0,T=!1;(v.children||[]).filter(function(I){return!r(I.node)}).forEach(function(I){var P=I.key,M=i.has(P);_&&!M&&(_=!1),!T&&(M||o.has(P))&&(T=!0)}),_&&i.add(v.key),T&&o.add(v.key),c.add(v.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(u8(o,i))}}function Wie(e,t,n,r,i){for(var o=new Set(e),s=new Set(t),a=0;a<=r;a+=1){var c=n.get(a)||new Set;c.forEach(function(v){var b=v.key,_=v.node,T=v.children,I=T===void 0?[]:T;!o.has(b)&&!s.has(b)&&!i(_)&&I.filter(function(P){return!i(P.node)}).forEach(function(P){o.delete(P.key)})})}s=new Set;for(var f=new Set,p=r;p>=0;p-=1){var g=n.get(p)||new Set;g.forEach(function(v){var b=v.parent,_=v.node;if(!(i(_)||!v.parent||f.has(v.parent.key))){if(i(v.parent.node)){f.add(b.key);return}var T=!0,I=!1;(b.children||[]).filter(function(P){return!i(P.node)}).forEach(function(P){var M=P.key,O=o.has(M);T&&!O&&(T=!1),!I&&(O||s.has(M))&&(I=!0)}),T||o.delete(b.key),I&&s.add(b.key),f.add(b.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(u8(s,o))}}function jl(e,t,n,r){var i=[],o;r?o=r:o=Hie;var s=new Set(e.filter(function(p){var g=!!n[p];return g||i.push(p),g})),a=new Map,c=0;Object.keys(n).forEach(function(p){var g=n[p],v=g.level,b=a.get(v);b||(b=new Set,a.set(v,b)),b.add(g),c=Math.max(c,v)}),Lr(!i.length,"Tree missing follow keys: ".concat(i.slice(0,100).map(function(p){return"'".concat(p,"'")}).join(", ")));var f;return t===!0?f=Kie(s,a,c,o):f=Wie(s,t.halfCheckedKeys,a,c,o),f}var OT=E.exports.createContext(null),Gie=function(t){for(var n=t.prefixCls,r=t.level,i=t.isStart,o=t.isEnd,s="".concat(n,"-indent-unit"),a=[],c=0;c=0&&n.splice(r,1),n}function Tl(e,t){var n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function AT(e){return e.split("-")}function c8(e,t){return"".concat(e,"-").concat(t)}function Qie(e){return e&&e.type&&e.type.isTreeNode}function Jie(e,t){var n=[],r=t[e];function i(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(s){var a=s.key,c=s.children;n.push(a),i(c)})}return i(r.children),n}function eoe(e){if(e.parent){var t=AT(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function toe(e){var t=AT(e.pos);return Number(t[t.length-1])===0}function zD(e,t,n,r,i,o,s,a,c,f){var p,g=e.clientX,v=e.clientY,b=e.target.getBoundingClientRect(),_=b.top,T=b.height,I=(f==="rtl"?-1:1)*(((i==null?void 0:i.x)||0)-g),P=(I-12)/r,M=a[n.props.eventKey];if(v<_+T/2){var O=s.findIndex(function(ce){return ce.key===M.key}),N=O<=0?0:O-1,F=s[N].key;M=a[F]}var $=M.key,j=M,U=M.key,q=0,Y=0;if(!c.includes($))for(var te=0;te-1.5?o({dragNode:Z,dropNode:X,dropPosition:1})?q=1:J=!1:o({dragNode:Z,dropNode:X,dropPosition:0})?q=0:o({dragNode:Z,dropNode:X,dropPosition:1})?q=1:J=!1:o({dragNode:Z,dropNode:X,dropPosition:1})?q=1:J=!1,{dropPosition:q,dropLevelOffset:Y,dropTargetKey:M.key,dropTargetPos:M.pos,dragOverNodeKey:U,dropContainerKey:q===0?null:((p=M.parent)===null||p===void 0?void 0:p.key)||null,dropAllowed:J}}function $D(e,t){if(!!e){var n=t.multiple;return n?e.slice():e.length?[e[0]]:e}}function VC(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(on(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return Lr(!1,"`checkedKeys` is not an array or an object"),null;return t}function F4(e,t){var n=new Set;function r(i){if(!n.has(i)){var o=t[i];if(!!o){n.add(i);var s=o.parent,a=o.node;a.disabled||s&&r(s.key)}}}return(e||[]).forEach(function(i){r(i)}),Mt(n)}var noe=["children"];function lv(e,t){return e!=null?e:t}function bb(e){var t=e||{},n=t.title,r=t._title,i=t.key,o=t.children,s=n||"title";return{title:s,_title:r||[s],key:i||"key",children:o||"children"}}function d8(e){function t(n){var r=Po(n);return r.map(function(i){if(!Qie(i))return Lr(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var o=i.key,s=i.props,a=s.children,c=kn(s,noe),f=me({key:o},c),p=t(a);return p.length&&(f.children=p),f}).filter(function(i){return i})}return t(e)}function UC(e,t,n){var r=bb(n),i=r._title,o=r.key,s=r.children,a=new Set(t===!0?[]:t),c=[];function f(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return p.map(function(v,b){for(var _=c8(g?g.pos:"0",b),T=lv(v[o],_),I,P=0;P1&&arguments[1]!==void 0?arguments[1]:{},n=t.initWrapper,r=t.processEntity,i=t.onProcessFinished,o=t.externalGetKey,s=t.childrenPropName,a=t.fieldNames,c=arguments.length>2?arguments[2]:void 0,f=o||c,p={},g={},v={posEntities:p,keyEntities:g};return n&&(v=n(v)||v),roe(e,function(b){var _=b.node,T=b.index,I=b.pos,P=b.key,M=b.parentPos,O=b.level,N=b.nodes,F={node:_,nodes:N,index:T,key:P,pos:I,level:O},$=lv(P,I);p[I]=F,g[$]=F,F.parent=p[M],F.parent&&(F.parent.children=F.parent.children||[],F.parent.children.push(F)),r&&r(F,v)},{externalGetKey:f,childrenPropName:s,fieldNames:a}),i&&i(v),v}function Wm(e,t){var n=t.expandedKeys,r=t.selectedKeys,i=t.loadedKeys,o=t.loadingKeys,s=t.checkedKeys,a=t.halfCheckedKeys,c=t.dragOverNodeKey,f=t.dropPosition,p=t.keyEntities,g=p[e],v={eventKey:e,expanded:n.indexOf(e)!==-1,selected:r.indexOf(e)!==-1,loaded:i.indexOf(e)!==-1,loading:o.indexOf(e)!==-1,checked:s.indexOf(e)!==-1,halfChecked:a.indexOf(e)!==-1,pos:String(g?g.pos:""),dragOver:c===e&&f===0,dragOverGapTop:c===e&&f===-1,dragOverGapBottom:c===e&&f===1};return v}function Oi(e){var t=e.data,n=e.expanded,r=e.selected,i=e.checked,o=e.loaded,s=e.loading,a=e.halfChecked,c=e.dragOver,f=e.dragOverGapTop,p=e.dragOverGapBottom,g=e.pos,v=e.active,b=e.eventKey,_=me(me({},t),{},{expanded:n,selected:r,checked:i,loaded:o,loading:s,halfChecked:a,dragOver:c,dragOverGapTop:f,dragOverGapBottom:p,pos:g,active:v,key:b});return"props"in _||Object.defineProperty(_,"props",{get:function(){return Lr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),_}var ioe=globalThis&&globalThis.__rest||function(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);i0&&(i=j().map(function(re){return A(Gm,{prefixCls:te,disabled:"disabled"in re?re.disabled:g.disabled,value:re.value,checked:P.includes(re.value),onChange:re.onChange,className:"".concat(Z,"-item"),style:re.style,children:re.label},re.value.toString())}));var J={toggleOption:Y,value:P,disabled:g.disabled,name:g.name,registerValue:q,cancelValue:U},ce=je(Z,ae({},"".concat(Z,"-rtl"),_==="rtl"),c);return A("div",{className:ce,style:f,...X,ref:n,children:A(f8.Provider,{value:J,children:i})})},aoe=E.exports.forwardRef(ooe);const soe=E.exports.memo(aoe);var loe=globalThis&&globalThis.__rest||function(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);i0){var q=a[0]/2;U.paddingLeft=q,U.paddingRight=q}if(a&&a[1]>0&&!f){var Y=a[1]/2;U.paddingTop=Y,U.paddingBottom=Y}return M&&(U.flex=hoe(M),c===!1&&!U.minWidth&&(U.minWidth=0)),A("div",{...N,style:Je(Je({},U),O),className:j,ref:t,children:P})});const _b=moe;var goe=globalThis&&globalThis.__rest||function(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);i0?J[0]/-2:void 0,oe=J[1]!=null&&J[1]>0?J[1]/-2:void 0;if(se&&(re.marginLeft=se,re.marginRight=se),Y){var he=$e(J,2);re.rowGap=he[1]}else oe&&(re.marginTop=oe,re.marginBottom=oe);var Ce=$e(J,2),Se=Ce[0],be=Ce[1],Re=E.exports.useMemo(function(){return{gutter:[Se,be],wrap:g,supportFlexGap:Y}},[Se,be,g,Y]);return A(h8.Provider,{value:Re,children:A("div",{...v,className:ce,style:Je(Je({},re),a),ref:t,children:c})})});const ad=voe;var p8=E.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.forceRender,o=e.className,s=e.style,a=e.children,c=e.isActive,f=e.role,p=E.exports.useState(c||i),g=$e(p,2),v=g[0],b=g[1];return E.exports.useEffect(function(){(i||c)&&b(!0)},[i,c]),v?A("div",{ref:t,className:je("".concat(r,"-content"),(n={},ae(n,"".concat(r,"-content-active"),c),ae(n,"".concat(r,"-content-inactive"),!c),n),o),style:s,role:f,children:A("div",{className:"".concat(r,"-content-box"),children:a})}):null});p8.displayName="PanelContent";var yoe=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],m8=function(e){si(n,e);var t=li(n);function n(){var r;jr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s-1;g?f.splice(p,1):f.push(c)}i.setActiveKey(f)},i.getNewChild=function(c,f){if(!c)return null;var p=i.state.activeKey,g=i.props,v=g.prefixCls,b=g.openMotion,_=g.accordion,T=g.destroyInactivePanel,I=g.expandIcon,P=g.collapsible,M=c.key||String(f),O=c.props,N=O.header,F=O.headerClass,$=O.destroyInactivePanel,j=O.collapsible,U=!1;_?U=p[0]===M:U=p.indexOf(M)>-1;var q=j!=null?j:P,Y={key:M,panelKey:M,header:N,headerClass:F,isActive:U,prefixCls:v,destroyInactivePanel:$!=null?$:T,openMotion:b,accordion:_,children:c.props.children,onItemClick:q==="disabled"?null:i.onClickItem,expandIcon:I,collapsible:q};return typeof c.type=="string"?c:(Object.keys(Y).forEach(function(te){typeof Y[te]>"u"&&delete Y[te]}),E.exports.cloneElement(c,Y))},i.getItems=function(){var c=i.props.children;return Po(c).map(i.getNewChild)},i.setActiveKey=function(c){"activeKey"in i.props||i.setState({activeKey:c}),i.props.onChange(i.props.accordion?c[0]:c)};var o=r.activeKey,s=r.defaultActiveKey,a=s;return"activeKey"in r&&(a=o),i.state={activeKey:VD(a)},i}return Hr(n,[{key:"shouldComponentUpdate",value:function(i,o){return!Md(this.props,i)||!Md(this.state,o)}},{key:"render",value:function(){var i,o=this.props,s=o.prefixCls,a=o.className,c=o.style,f=o.accordion,p=je((i={},ae(i,s,!0),ae(i,a,!!a),i));return A("div",{className:p,style:c,role:f?"tablist":null,children:this.getItems()})}}],[{key:"getDerivedStateFromProps",value:function(i){var o={};return"activeKey"in i&&(o.activeKey=VD(i.activeKey)),o}}]),n}(E.exports.Component);uv.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1};uv.Panel=m8;uv.Panel;var xoe=function(t){var n=E.exports.useContext(Fn),r=n.getPrefixCls,i=t.prefixCls,o=t.className,s=o===void 0?"":o,a=t.showArrow,c=a===void 0?!0:a,f=r("collapse",i),p=je(ae({},"".concat(f,"-no-arrow"),!c),s);return A(uv.Panel,{...t,prefixCls:f,className:p})};const boe=xoe;var g8=function(t){var n,r=E.exports.useContext(Fn),i=r.getPrefixCls,o=r.direction,s=t.prefixCls,a=t.className,c=a===void 0?"":a,f=t.bordered,p=f===void 0?!0:f,g=t.ghost,v=t.expandIconPosition,b=v===void 0?"start":v,_=i("collapse",s),T=E.exports.useMemo(function(){return b==="left"?"start":b==="right"?"end":b},[b]),I=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=t.expandIcon,j=$?$(F):A(Z_,{rotate:F.isActive?90:void 0});return Pi(j,function(){return{className:je(j.props.className,"".concat(_,"-arrow"))}})},P=je("".concat(_,"-icon-position-").concat(T),(n={},ae(n,"".concat(_,"-borderless"),!p),ae(n,"".concat(_,"-rtl"),o==="rtl"),ae(n,"".concat(_,"-ghost"),!!g),n),c),M=Je(Je({},U_),{motionAppear:!1,leavedClassName:"".concat(_,"-content-hidden")}),O=function(){var F=t.children;return Po(F).map(function($,j){var U;if(!((U=$.props)===null||U===void 0)&&U.disabled){var q=$.key||String(j),Y=$.props,te=Y.disabled,Z=Y.collapsible,X=Je(Je({},Gi($.props,["disabled"])),{key:q,collapsible:Z!=null?Z:te?"disabled":void 0});return Pi($,X)}return $})};return A(uv,{openMotion:M,...t,expandIcon:I,prefixCls:_,className:P,children:O()})};g8.Panel=boe;const UD=g8;var _oe=globalThis&&globalThis.__rest||function(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);i0?"-".concat(p):p,O=!!b,N=p==="left"&&g!=null,F=p==="right"&&g!=null,$=je(P,"".concat(P,"-").concat(c),(n={},ae(n,"".concat(P,"-with-text"),O),ae(n,"".concat(P,"-with-text").concat(M),O),ae(n,"".concat(P,"-dashed"),!!_),ae(n,"".concat(P,"-plain"),!!T),ae(n,"".concat(P,"-rtl"),o==="rtl"),ae(n,"".concat(P,"-no-default-orientation-margin-left"),N),ae(n,"".concat(P,"-no-default-orientation-margin-right"),F),n),v),j=Je(Je({},N&&{marginLeft:g}),F&&{marginRight:g});return A("div",{className:$,...I,role:"separator",children:b&&c!=="vertical"&&A("span",{className:"".concat(P,"-inner-text"),style:j,children:b})})};const Coe=woe;var v8=E.exports.createContext(null),jD=[];function Soe(e,t){var n=E.exports.useState(function(){if(!To())return null;var _=document.createElement("div");return _}),r=$e(n,1),i=r[0],o=E.exports.useRef(!1),s=E.exports.useContext(v8),a=E.exports.useState(jD),c=$e(a,2),f=c[0],p=c[1],g=s||(o.current?void 0:function(_){p(function(T){var I=[_].concat(Mt(T));return I})});function v(){i.parentElement||document.body.appendChild(i),o.current=!0}function b(){var _;(_=i.parentElement)===null||_===void 0||_.removeChild(i),o.current=!1}return Si(function(){return e?s?s(v):v():b(),b},[e]),Si(function(){f.length&&(f.forEach(function(_){return _()}),p(jD))},[f]),[i,g]}var jC;function wb(e){if(typeof document>"u")return 0;if(e||jC===void 0){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var i=t.offsetWidth;n.style.overflow="scroll";var o=t.offsetWidth;i===o&&(o=n.clientWidth),document.body.removeChild(n),jC=i-o}return jC}function HD(e){var t=e.match(/^(.*)px$/),n=Number(t==null?void 0:t[1]);return Number.isNaN(n)?wb():n}function KD(e){if(typeof document>"u"||!e||!(e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),n=t.width,r=t.height;return{width:HD(n),height:HD(r)}}function Eoe(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var Poe="rc-util-locker-".concat(Date.now()),WD=0;function Toe(e){var t=!!e,n=E.exports.useState(function(){return WD+=1,"".concat(Poe,"_").concat(WD)}),r=$e(n,1),i=r[0];Si(function(){if(t){var o=wb(),s=Eoe();ev(` html body { overflow-y: hidden; `.concat(s?"width: calc(100% - ".concat(o,"px);"):"",` }`),i)}else RR(i);return function(){RR(i)}},[t,i])}var GD=!1;function Ioe(e){return typeof e=="boolean"&&(GD=e),GD}var qD=function(t){return t===!1?!1:!To()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},y8=E.exports.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer;e.debug;var o=e.autoDestroy,s=o===void 0?!0:o,a=e.children,c=E.exports.useState(n),f=$e(c,2),p=f[0],g=f[1],v=p||n;E.exports.useEffect(function(){(s||n)&&g(n)},[n,s]);var b=E.exports.useState(function(){return qD(i)}),_=$e(b,2),T=_[0],I=_[1];E.exports.useEffect(function(){var te=qD(i);I(te!=null?te:null)});var P=Soe(v&&!T),M=$e(P,2),O=M[0],N=M[1],F=T!=null?T:O;Toe(r&&n&&To()&&(F===O||F===document.body));var $=null;if(a&&Nh(a)&&t){var j=a;$=j.ref}var U=Q5($,t);if(!v||!To()||T===void 0)return null;var q=F===!1||Ioe(),Y=a;return t&&(Y=E.exports.cloneElement(a,{ref:U})),A(v8.Provider,{value:N,children:q?Y:al.exports.createPortal(Y,F)})}),koe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};const Moe=koe;var x8=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Moe})})};x8.displayName="EyeOutlined";const LT=E.exports.forwardRef(x8);function b8(){var e=document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{width:e,height:t}}function z4(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function Roe(){var e=me({},Tx);return e.useId}var ZD=0;function Doe(e){var t=E.exports.useState("ssr-id"),n=$e(t,2),r=n[0],i=n[1],o=Roe(),s=o==null?void 0:o();return E.exports.useEffect(function(){if(!o){var a=ZD;ZD+=1,i("rc_unique_".concat(a))}},[]),e||s||r}function Ooe(e){var t=e.prefixCls,n=e.style,r=e.visible,i=e.maskProps,o=e.motionName;return A(oa,{visible:r,motionName:o,leavedClassName:"".concat(t,"-mask-hidden"),children:function(s,a){var c=s.className,f=s.style;return A("div",{ref:a,style:me(me({},f),n),className:je("".concat(t,"-mask"),c),...i})}},"mask")}function XD(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}function YD(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if(typeof n!="number"){var i=e.document;n=i.documentElement[r],typeof n!="number"&&(n=i.body[r])}return n}function Aoe(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=YD(i),n.top+=YD(i,!0),n}const Noe=E.exports.memo(function(e){var t=e.children;return t},function(e,t){var n=t.shouldUpdate;return!n});var QD={width:0,height:0,overflow:"hidden",outline:"none"},Loe=Un.forwardRef(function(e,t){var n=e.prefixCls,r=e.className,i=e.style,o=e.title,s=e.ariaId,a=e.footer,c=e.closable,f=e.closeIcon,p=e.onClose,g=e.children,v=e.bodyStyle,b=e.bodyProps,_=e.modalRender,T=e.onMouseDown,I=e.onMouseUp,P=e.holderRef,M=e.visible,O=e.forceRender,N=e.width,F=e.height,$=E.exports.useRef(),j=E.exports.useRef();Un.useImperativeHandle(t,function(){return{focus:function(){var J;(J=$.current)===null||J===void 0||J.focus()},changeActive:function(J){var ce=document,re=ce.activeElement;J&&re===j.current?$.current.focus():!J&&re===$.current&&j.current.focus()}}});var U={};N!==void 0&&(U.width=N),F!==void 0&&(U.height=F);var q;a&&(q=A("div",{className:"".concat(n,"-footer"),children:a}));var Y;o&&(Y=A("div",{className:"".concat(n,"-header"),children:A("div",{className:"".concat(n,"-title"),id:s,children:o})}));var te;c&&(te=A("button",{type:"button",onClick:p,"aria-label":"Close",className:"".concat(n,"-close"),children:f||A("span",{className:"".concat(n,"-close-x")})}));var Z=it("div",{className:"".concat(n,"-content"),children:[te,Y,A("div",{className:"".concat(n,"-body"),style:v,...b,children:g}),q]});return it("div",{role:"dialog","aria-labelledby":o?s:null,"aria-modal":"true",ref:P,style:me(me({},i),U),className:je(n,r),onMouseDown:T,onMouseUp:I,children:[A("div",{tabIndex:0,ref:$,style:QD,"aria-hidden":"true"}),A(Noe,{shouldUpdate:M||O,children:_?_(Z):Z}),A("div",{tabIndex:0,ref:j,style:QD,"aria-hidden":"true"})]},"dialog-element")}),_8=E.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.title,i=e.style,o=e.className,s=e.visible,a=e.forceRender,c=e.destroyOnClose,f=e.motionName,p=e.ariaId,g=e.onVisibleChanged,v=e.mousePosition,b=E.exports.useRef(),_=E.exports.useState(),T=$e(_,2),I=T[0],P=T[1],M={};I&&(M.transformOrigin=I);function O(){var N=Aoe(b.current);P(v?"".concat(v.x-N.left,"px ").concat(v.y-N.top,"px"):"")}return A(oa,{visible:s,onVisibleChanged:g,onAppearPrepare:O,onEnterPrepare:O,forceRender:a,motionName:f,removeOnLeave:c,ref:b,children:function(N,F){var $=N.className,j=N.style;return A(Loe,{...e,ref:t,title:r,ariaId:p,prefixCls:n,holderRef:F,style:me(me(me({},j),i),M),className:je(o,$)})}})});_8.displayName="Content";function Foe(e){var t=e.prefixCls,n=t===void 0?"rc-dialog":t,r=e.zIndex,i=e.visible,o=i===void 0?!1:i,s=e.keyboard,a=s===void 0?!0:s,c=e.focusTriggerAfterClose,f=c===void 0?!0:c,p=e.wrapStyle,g=e.wrapClassName,v=e.wrapProps,b=e.onClose,_=e.afterClose,T=e.transitionName,I=e.animation,P=e.closable,M=P===void 0?!0:P,O=e.mask,N=O===void 0?!0:O,F=e.maskTransitionName,$=e.maskAnimation,j=e.maskClosable,U=j===void 0?!0:j,q=e.maskStyle,Y=e.maskProps,te=e.rootClassName,Z=E.exports.useRef(),X=E.exports.useRef(),J=E.exports.useRef(),ce=E.exports.useState(o),re=$e(ce,2),se=re[0],oe=re[1],he=Doe();function Ce(){yd(X.current,document.activeElement)||(Z.current=document.activeElement)}function Se(){if(!yd(X.current,document.activeElement)){var pt;(pt=J.current)===null||pt===void 0||pt.focus()}}function be(pt){if(pt)Se();else{if(oe(!1),N&&Z.current&&f){try{Z.current.focus({preventScroll:!0})}catch{}Z.current=null}se&&(_==null||_())}}function Re(pt){b==null||b(pt)}var Ie=E.exports.useRef(!1),Me=E.exports.useRef(),Ae=function(){clearTimeout(Me.current),Ie.current=!0},Fe=function(){Me.current=setTimeout(function(){Ie.current=!1})},Ke=null;U&&(Ke=function(gt){Ie.current?Ie.current=!1:X.current===gt.target&&Re(gt)});function Ue(pt){if(a&&pt.keyCode===Pt.ESC){pt.stopPropagation(),Re(pt);return}o&&pt.keyCode===Pt.TAB&&J.current.changeActive(!pt.shiftKey)}return E.exports.useEffect(function(){o&&(oe(!0),Ce())},[o]),E.exports.useEffect(function(){return function(){clearTimeout(Me.current)}},[]),it("div",{className:je("".concat(n,"-root"),te),...Zl(e,{data:!0}),children:[A(Ooe,{prefixCls:n,visible:N&&o,motionName:XD(n,F,$),style:me({zIndex:r},q),maskProps:Y}),A("div",{tabIndex:-1,onKeyDown:Ue,className:je("".concat(n,"-wrap"),g),ref:X,onClick:Ke,style:me(me({zIndex:r},p),{},{display:se?null:"none"}),...v,children:A(_8,{...e,onMouseDown:Ae,onMouseUp:Fe,ref:J,closable:M,ariaId:he,prefixCls:n,visible:o&&se,onClose:Re,onVisibleChanged:be,motionName:XD(n,T,I)})})]})}var FT=function(t){var n=t.visible,r=t.getContainer,i=t.forceRender,o=t.destroyOnClose,s=o===void 0?!1:o,a=t.afterClose,c=E.exports.useState(n),f=$e(c,2),p=f[0],g=f[1];return E.exports.useEffect(function(){n&&g(!0)},[n]),!i&&s&&!p?null:A(y8,{open:n||i||p,autoDestroy:!1,getContainer:r,autoLock:n||p,children:A(Foe,{...t,destroyOnClose:s,afterClose:function(){a==null||a(),g(!1)}})})};FT.displayName="Dialog";var zoe=["visible","onVisibleChange","getContainer","current","countRender"],zT=E.exports.createContext({previewUrls:new Map,setPreviewUrls:function(){return null},current:null,setCurrent:function(){return null},setShowPreview:function(){return null},setMousePosition:function(){return null},registerImage:function(){return function(){return null}},rootClassName:""}),$oe=zT.Provider,Boe=function(t){var n=t.previewPrefixCls,r=n===void 0?"rc-image-preview":n,i=t.children,o=t.icons,s=o===void 0?{}:o,a=t.preview,c=on(a)==="object"?a:{},f=c.visible,p=f===void 0?void 0:f,g=c.onVisibleChange,v=g===void 0?void 0:g,b=c.getContainer,_=b===void 0?void 0:b,T=c.current,I=T===void 0?0:T,P=c.countRender,M=P===void 0?void 0:P,O=kn(c,zoe),N=E.exports.useState(new Map),F=$e(N,2),$=F[0],j=F[1],U=E.exports.useState(),q=$e(U,2),Y=q[0],te=q[1],Z=Ei(!!p,{value:p,onChange:v}),X=$e(Z,2),J=X[0],ce=X[1],re=E.exports.useState(null),se=$e(re,2),oe=se[0],he=se[1],Ce=p!==void 0,Se=Array.from($.keys()),be=Se[I],Re=new Map(Array.from($).filter(function(Ae){var Fe=$e(Ae,2),Ke=Fe[1].canPreview;return!!Ke}).map(function(Ae){var Fe=$e(Ae,2),Ke=Fe[0],Ue=Fe[1].url;return[Ke,Ue]})),Ie=function(Fe,Ke){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,pt=function(){j(function(Dt){var qe=new Map(Dt),Ct=qe.delete(Fe);return Ct?qe:Dt})};return j(function(gt){return new Map(gt).set(Fe,{url:Ke,canPreview:Ue})}),pt},Me=function(Fe){Fe.stopPropagation(),ce(!1),he(null)};return E.exports.useEffect(function(){te(be)},[be]),E.exports.useEffect(function(){!J&&Ce&&te(be)},[be,Ce,J]),it($oe,{value:{isPreviewGroup:!0,previewUrls:Re,setPreviewUrls:j,current:Y,setCurrent:te,setShowPreview:ce,setMousePosition:he,registerImage:Ie},children:[i,A(w8,{"aria-hidden":!J,visible:J,prefixCls:r,onClose:Me,mousePosition:oe,src:Re.get(Y),icons:s,getContainer:_,countRender:M,...O})]})},ux=1,cx=50,am=1,Voe=.2,Uoe=function(t){var n,r=t.visible,i=t.maskTransitionName,o=t.getContainer,s=t.prefixCls,a=t.rootClassName,c=t.icons,f=t.countRender,p=t.showSwitch,g=t.showProgress,v=t.current,b=t.count,_=t.scale,T=t.onSwitchLeft,I=t.onSwitchRight,P=t.onClose,M=t.onZoomIn,O=t.onZoomOut,N=t.onRotateRight,F=t.onRotateLeft,$=c.rotateLeft,j=c.rotateRight,U=c.zoomIn,q=c.zoomOut,Y=c.close,te=c.left,Z=c.right,X="".concat(s,"-operations-operation"),J="".concat(s,"-operations-icon"),ce=[{icon:Y,onClick:P,type:"close"},{icon:U,onClick:M,type:"zoomIn",disabled:_===cx},{icon:q,onClick:O,type:"zoomOut",disabled:_===ux},{icon:j,onClick:N,type:"rotateRight"},{icon:$,onClick:F,type:"rotateLeft"}],re=it(nr,{children:[p&&it(nr,{children:[A("div",{className:je("".concat(s,"-switch-left"),ae({},"".concat(s,"-switch-left-disabled"),v===0)),onClick:T,children:te}),A("div",{className:je("".concat(s,"-switch-right"),ae({},"".concat(s,"-switch-right-disabled"),v===b-1)),onClick:I,children:Z})]}),it("ul",{className:"".concat(s,"-operations"),children:[g&&A("li",{className:"".concat(s,"-operations-progress"),children:(n=f==null?void 0:f(v+1,b))!==null&&n!==void 0?n:"".concat(v+1," / ").concat(b)}),ce.map(function(se){var oe,he=se.icon,Ce=se.onClick,Se=se.type,be=se.disabled;return A("li",{className:je(X,(oe={},ae(oe,"".concat(s,"-operations-operation-").concat(Se),!0),ae(oe,"".concat(s,"-operations-operation-disabled"),!!be),oe)),onClick:Ce,children:E.exports.isValidElement(he)?E.exports.cloneElement(he,{className:J}):he},Se)})]})]});return A(oa,{visible:r,motionName:i,children:function(se){var oe=se.className,he=se.style;return A(y8,{open:!0,getContainer:o!=null?o:document.body,children:A("div",{className:je("".concat(s,"-operations-wrapper"),oe,a),style:he,children:re})})}})},JD={x:0,y:0,rotate:0,scale:1};function joe(e){var t=E.exports.useRef(null),n=E.exports.useRef([]),r=E.exports.useState(JD),i=$e(r,2),o=i[0],s=i[1],a=function(){s(JD)},c=function(g){t.current===null&&(n.current=[],t.current=ur(function(){s(function(v){var b=v;return n.current.forEach(function(_){b=me(me({},b),_)}),t.current=null,b})})),n.current.push(me(me({},o),g))},f=function(g,v,b){var _=e.current,T=_.width,I=_.height,P=_.offsetWidth,M=_.offsetHeight,O=_.offsetLeft,N=_.offsetTop,F=g,$=o.scale*g;$>cx?(F=cx/o.scale,$=cx):$r){if(t>0)return ae({},e,o);if(t<0&&ir)return ae({},e,t<0?o:-o);return{}}function Hoe(e,t,n,r){var i=b8(),o=i.width,s=i.height,a=null;return e<=o&&t<=s?a={x:0,y:0}:(e>o||t>s)&&(a=me(me({},eO("x",n,e,o)),eO("y",r,t,s))),a}var Koe=["prefixCls","src","alt","onClose","afterClose","visible","icons","rootClassName","getContainer","countRender","scaleStep","transitionName","maskTransitionName"],w8=function(t){var n=t.prefixCls,r=t.src,i=t.alt,o=t.onClose;t.afterClose;var s=t.visible,a=t.icons,c=a===void 0?{}:a,f=t.rootClassName,p=t.getContainer,g=t.countRender,v=t.scaleStep,b=v===void 0?.5:v,_=t.transitionName,T=_===void 0?"zoom":_,I=t.maskTransitionName,P=I===void 0?"fade":I,M=kn(t,Koe),O=E.exports.useRef(),N=E.exports.useRef({deltaX:0,deltaY:0,transformX:0,transformY:0}),F=E.exports.useState(!1),$=$e(F,2),j=$[0],U=$[1],q=E.exports.useContext(zT),Y=q.previewUrls,te=q.current,Z=q.isPreviewGroup,X=q.setCurrent,J=Y.size,ce=Array.from(Y.keys()),re=ce.indexOf(te),se=Z?Y.get(te):r,oe=Z&&J>1,he=Z&&J>=1,Ce=joe(O),Se=Ce.transform,be=Ce.resetTransform,Re=Ce.updateTransform,Ie=Ce.dispatchZoonChange,Me=Se.rotate,Ae=Se.scale,Fe=je(ae({},"".concat(n,"-moving"),j)),Ke=function(){be()},Ue=function(){Ie(am+b)},pt=function(){Ie(am-b)},gt=function(){Re({rotate:Me+90})},Dt=function(){Re({rotate:Me-90})},qe=function(He){He.preventDefault(),He.stopPropagation(),re>0&&X(ce[re-1])},Ct=function(He){He.preventDefault(),He.stopPropagation(),re0&&(Ot=am/Ot),Ie(Ot,He.clientX,He.clientY)}},et=E.exports.useCallback(function(at){!s||!oe||(at.keyCode===Pt.LEFT?re>0&&X(ce[re-1]):at.keyCode===Pt.RIGHT&&re"u"||e===null?"":String(e)}var hae=function(t){var n=t.inputElement,r=t.prefixCls,i=t.prefix,o=t.suffix,s=t.addonBefore,a=t.addonAfter,c=t.className,f=t.style,p=t.affixWrapperClassName,g=t.groupClassName,v=t.wrapperClassName,b=t.disabled,_=t.readOnly,T=t.focused,I=t.triggerFocus,P=t.allowClear,M=t.value,O=t.handleReset,N=t.hidden,F=E.exports.useRef(null),$=function(oe){var he;(he=F.current)!==null&&he!==void 0&&he.contains(oe.target)&&(I==null||I())},j=function(){var oe;if(!P)return null;var he=!b&&!_&&M,Ce="".concat(r,"-clear-icon"),Se=on(P)==="object"&&P!==null&&P!==void 0&&P.clearIcon?P.clearIcon:"\u2716";return A("span",{onClick:O,onMouseDown:function(Re){return Re.preventDefault()},className:je(Ce,(oe={},ae(oe,"".concat(Ce,"-hidden"),!he),ae(oe,"".concat(Ce,"-has-suffix"),!!o),oe)),role:"button",tabIndex:-1,children:Se})},U=E.exports.cloneElement(n,{value:M,hidden:N});if(k8(t)){var q,Y="".concat(r,"-affix-wrapper"),te=je(Y,(q={},ae(q,"".concat(Y,"-disabled"),b),ae(q,"".concat(Y,"-focused"),T),ae(q,"".concat(Y,"-readonly"),_),ae(q,"".concat(Y,"-input-with-clear-btn"),o&&P&&M),q),!dx(t)&&c,p),Z=(o||P)&&it("span",{className:"".concat(r,"-suffix"),children:[j(),o]});U=it("span",{className:te,style:f,hidden:!dx(t)&&N,onClick:$,ref:F,children:[i&&A("span",{className:"".concat(r,"-prefix"),children:i}),E.exports.cloneElement(n,{style:null,value:M,hidden:null}),Z]})}if(dx(t)){var X="".concat(r,"-group"),J="".concat(X,"-addon"),ce=je("".concat(r,"-wrapper"),X,v),re=je("".concat(r,"-group-wrapper"),c,g);return A("span",{className:re,style:f,hidden:N,children:it("span",{className:ce,children:[s&&A("span",{className:J,children:s}),E.exports.cloneElement(U,{style:null,hidden:null}),a&&A("span",{className:J,children:a})]})})}return U},pae=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],mae=E.exports.forwardRef(function(e,t){var n=e.autoComplete,r=e.onChange,i=e.onFocus,o=e.onBlur,s=e.onPressEnter,a=e.onKeyDown,c=e.prefixCls,f=c===void 0?"rc-input":c,p=e.disabled,g=e.htmlSize,v=e.className,b=e.maxLength,_=e.suffix,T=e.showCount,I=e.type,P=I===void 0?"text":I,M=e.inputClassName,O=kn(e,pae),N=Ei(e.defaultValue,{value:e.value}),F=$e(N,2),$=F[0],j=F[1],U=E.exports.useState(!1),q=$e(U,2),Y=q[0],te=q[1],Z=E.exports.useRef(null),X=function(be){Z.current&&fae(Z.current,be)};E.exports.useImperativeHandle(t,function(){return{focus:X,blur:function(){var be;(be=Z.current)===null||be===void 0||be.blur()},setSelectionRange:function(be,Re,Ie){var Me;(Me=Z.current)===null||Me===void 0||Me.setSelectionRange(be,Re,Ie)},select:function(){var be;(be=Z.current)===null||be===void 0||be.select()},input:Z.current}}),E.exports.useEffect(function(){te(function(Se){return Se&&p?!1:Se})},[p]);var J=function(be){e.value===void 0&&j(be.target.value),Z.current&&rO(Z.current,be,r)},ce=function(be){s&&be.key==="Enter"&&s(be),a==null||a(be)},re=function(be){te(!0),i==null||i(be)},se=function(be){te(!1),o==null||o(be)},oe=function(be){j(""),X(),Z.current&&rO(Z.current,be,r)},he=function(){var be=Gi(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return A("input",{autoComplete:n,...be,onChange:J,onFocus:re,onBlur:se,onKeyDown:ce,className:je(f,ae({},"".concat(f,"-disabled"),p),M,!dx(e)&&!k8(e)&&v),ref:Z,size:g,type:P})},Ce=function(){var be=Number(b)>0;if(_||T){var Re=iO($),Ie=Mt(Re).length,Me=on(T)==="object"?T.formatter({value:Re,count:Ie,maxLength:b}):"".concat(Ie).concat(be?" / ".concat(b):"");return it(nr,{children:[!!T&&A("span",{className:je("".concat(f,"-show-count-suffix"),ae({},"".concat(f,"-show-count-has-suffix"),!!_)),children:Me}),_]})}return null};return A(hae,{...O,prefixCls:f,className:v,inputElement:he(),handleReset:oe,value:iO($),focused:Y,triggerFocus:X,suffix:Ce(),disabled:p})});function M8(e,t){var n=E.exports.useRef([]),r=function(){n.current.push(setTimeout(function(){var o,s,a,c;((o=e.current)===null||o===void 0?void 0:o.input)&&((s=e.current)===null||s===void 0?void 0:s.input.getAttribute("type"))==="password"&&((a=e.current)===null||a===void 0?void 0:a.input.hasAttribute("value"))&&((c=e.current)===null||c===void 0||c.input.removeAttribute("value"))}))};return E.exports.useEffect(function(){return t&&r(),function(){return n.current.forEach(function(i){i&&clearTimeout(i)})}},[]),r}function gae(e){return!!(e.prefix||e.suffix||e.allowClear)}var vae=globalThis&&globalThis.__rest||function(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"u"||e===null?"":String(e)}function HC(e,t,n,r){if(!!n){var i=t;if(t.type==="click"){var o=e.cloneNode(!0);i=Object.create(t,{target:{value:o},currentTarget:{value:o}}),o.value="",n(i);return}if(r!==void 0){i=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,n(i);return}n(i)}}function xae(e,t){if(!!e){e.focus(t);var n=t||{},r=n.cursor;if(r){var i=e.value.length;switch(r){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i);break}}}}var $T=E.exports.forwardRef(function(e,t){var n,r,i,o=e.prefixCls,s=e.bordered,a=s===void 0?!0:s,c=e.status,f=e.size,p=e.disabled,g=e.onBlur,v=e.onFocus,b=e.suffix,_=e.allowClear,T=e.addonAfter,I=e.addonBefore,P=e.className,M=e.onChange,O=vae(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","onChange"]),N=Un.useContext(Fn),F=N.getPrefixCls,$=N.direction,j=N.input,U=F("input",o),q=E.exports.useRef(null),Y=Bh(U,$),te=Y.compactSize,Z=Y.compactItemClassnames,X=Un.useContext(Jl),J=te||f||X,ce=Un.useContext(fc),re=p!=null?p:ce,se=E.exports.useContext(Rs),oe=se.status,he=se.hasFeedback,Ce=se.feedbackIcon,Se=rv(oe,c),be=gae(e)||!!he,Re=E.exports.useRef(be);E.exports.useEffect(function(){be&&Re.current,Re.current=be},[be]);var Ie=M8(q,!0),Me=function(gt){Ie(),g==null||g(gt)},Ae=function(gt){Ie(),v==null||v(gt)},Fe=function(gt){Ie(),M==null||M(gt)},Ke=(he||b)&&it(nr,{children:[b,he&&Ce]}),Ue;return on(_)==="object"&&(_==null?void 0:_.clearIcon)?Ue=_:_&&(Ue={clearIcon:A(Fh,{})}),A(mae,{ref:Aa(t,q),prefixCls:U,autoComplete:j==null?void 0:j.autoComplete,...O,disabled:re||void 0,onBlur:Me,onFocus:Ae,suffix:Ke,allowClear:Ue,className:je(P,Z),onChange:Fe,addonAfter:T&&A(fb,{children:A(I4,{override:!0,status:!0,children:T})}),addonBefore:I&&A(fb,{children:A(I4,{override:!0,status:!0,children:I})}),inputClassName:je((n={},ae(n,"".concat(U,"-sm"),J==="small"),ae(n,"".concat(U,"-lg"),J==="large"),ae(n,"".concat(U,"-rtl"),$==="rtl"),ae(n,"".concat(U,"-borderless"),!a),n),!be&&Xu(U,Se)),affixWrapperClassName:je((r={},ae(r,"".concat(U,"-affix-wrapper-sm"),J==="small"),ae(r,"".concat(U,"-affix-wrapper-lg"),J==="large"),ae(r,"".concat(U,"-affix-wrapper-rtl"),$==="rtl"),ae(r,"".concat(U,"-affix-wrapper-borderless"),!a),r),Xu("".concat(U,"-affix-wrapper"),Se,he)),wrapperClassName:je(ae({},"".concat(U,"-group-rtl"),$==="rtl")),groupClassName:je((i={},ae(i,"".concat(U,"-group-wrapper-sm"),J==="small"),ae(i,"".concat(U,"-group-wrapper-lg"),J==="large"),ae(i,"".concat(U,"-group-wrapper-rtl"),$==="rtl"),i),Xu("".concat(U,"-group-wrapper"),Se,he))})}),bae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};const _ae=bae;var R8=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:_ae})})};R8.displayName="EyeInvisibleOutlined";const wae=E.exports.forwardRef(R8);var Cae=globalThis&&globalThis.__rest||function(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);i1&&arguments[1]!==void 0?arguments[1]:!1,n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&KC[n])return KC[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),s=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),a=Dae.map(function(f){return"".concat(f,":").concat(r.getPropertyValue(f))}).join(";"),c={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:i};return t&&n&&(KC[n]=c),c}function Aae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Ha||(Ha=document.createElement("textarea"),Ha.setAttribute("tab-index","-1"),Ha.setAttribute("aria-hidden","true"),document.body.appendChild(Ha)),e.getAttribute("wrap")?Ha.setAttribute("wrap",e.getAttribute("wrap")):Ha.removeAttribute("wrap");var i=Oae(e,t),o=i.paddingSize,s=i.borderSize,a=i.boxSizing,c=i.sizingStyle;Ha.setAttribute("style","".concat(c,";").concat(Rae)),Ha.value=e.value||e.placeholder||"";var f=void 0,p=void 0,g,v=Ha.scrollHeight;if(a==="border-box"?v+=s:a==="content-box"&&(v-=o),n!==null||r!==null){Ha.value=" ";var b=Ha.scrollHeight-o;n!==null&&(f=b*n,a==="border-box"&&(f=f+o+s),v=Math.max(f,v)),r!==null&&(p=b*r,a==="border-box"&&(p=p+o+s),g=v>p?"":"hidden",v=Math.min(p,v))}var _={height:v,overflowY:g,resize:"none"};return f&&(_.minHeight=f),p&&(_.maxHeight=p),_}var Nae=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],WC=0,GC=1,qC=2,Lae=E.exports.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-textarea":n;e.onPressEnter;var i=e.defaultValue,o=e.value,s=e.autoSize,a=e.onResize,c=e.className,f=e.style,p=e.disabled,g=e.onChange;e.onInternalAutoSize;var v=kn(e,Nae),b=Ei(i,{value:o,postState:function(Ie){return Ie!=null?Ie:""}}),_=$e(b,2),T=_[0],I=_[1],P=function(Ie){I(Ie.target.value),g==null||g(Ie)},M=E.exports.useRef();E.exports.useImperativeHandle(t,function(){return{textArea:M.current}});var O=E.exports.useMemo(function(){return s&&on(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),N=$e(O,2),F=N[0],$=N[1],j=!!s,U=function(){try{if(document.activeElement===M.current){var Ie=M.current,Me=Ie.selectionStart,Ae=Ie.selectionEnd,Fe=Ie.scrollTop;M.current.setSelectionRange(Me,Ae),M.current.scrollTop=Fe}}catch{}},q=E.exports.useState(qC),Y=$e(q,2),te=Y[0],Z=Y[1],X=E.exports.useState(),J=$e(X,2),ce=J[0],re=J[1],se=function(){Z(WC)};Si(function(){j&&se()},[o,F,$,j]),Si(function(){if(te===WC)Z(GC);else if(te===GC){var Re=Aae(M.current,!1,F,$);Z(qC),re(Re)}else U()},[te]);var oe=E.exports.useRef(),he=function(){ur.cancel(oe.current)},Ce=function(Ie){te===qC&&(a==null||a(Ie),s&&(he(),oe.current=ur(function(){se()})))};E.exports.useEffect(function(){return he},[]);var Se=j?ce:null,be=me(me({},f),Se);return(te===WC||te===GC)&&(be.overflowY="hidden",be.overflowX="hidden"),A(Ql,{onResize:Ce,disabled:!(s||a),children:A("textarea",{...v,ref:M,style:be,className:je(r,c,ae({},"".concat(r,"-disabled"),p)),disabled:p,value:T,onChange:P})})}),Fae=function(e){si(n,e);var t=li(n);function n(r){var i;jr(this,n),i=t.call(this,r),i.resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(s){i.resizableTextArea=s},i.handleChange=function(s){var a=i.props.onChange;i.setValue(s.target.value),a&&a(s)},i.handleKeyDown=function(s){var a=i.props,c=a.onPressEnter,f=a.onKeyDown;s.keyCode===13&&c&&c(s),f&&f(s)};var o=typeof r.value>"u"||r.value===null?r.defaultValue:r.value;return i.state={value:o},i}return Hr(n,[{key:"setValue",value:function(i,o){"value"in this.props||this.setState({value:i},o)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return A(Lae,{...this.props,value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea})}}],[{key:"getDerivedStateFromProps",value:function(i){return"value"in i?{value:i.value}:null}}]),n}(E.exports.Component),zae=aa("text","input");function $ae(e){return!!(e.addonBefore||e.addonAfter)}var Bae=function(e){si(n,e);var t=li(n);function n(){return jr(this,n),t.apply(this,arguments)}return Hr(n,[{key:"renderClearIcon",value:function(i){var o,s=this.props,a=s.value,c=s.disabled,f=s.readOnly,p=s.handleReset,g=s.suffix,v=!c&&!f&&a,b="".concat(i,"-clear-icon");return A(Fh,{onClick:p,onMouseDown:function(T){return T.preventDefault()},className:je((o={},ae(o,"".concat(b,"-hidden"),!v),ae(o,"".concat(b,"-has-suffix"),!!g),o),b),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(i,o,s){var a,c=this.props,f=c.value,p=c.allowClear,g=c.className,v=c.style,b=c.direction,_=c.bordered,T=c.hidden,I=c.status,P=s.status,M=s.hasFeedback;if(!p)return Pi(o,{value:f});var O=je("".concat(i,"-affix-wrapper"),"".concat(i,"-affix-wrapper-textarea-with-clear-btn"),Xu("".concat(i,"-affix-wrapper"),rv(P,I),M),(a={},ae(a,"".concat(i,"-affix-wrapper-rtl"),b==="rtl"),ae(a,"".concat(i,"-affix-wrapper-borderless"),!_),ae(a,"".concat(g),!$ae(this.props)&&g),a));return it("span",{className:O,style:v,hidden:T,children:[Pi(o,{style:null,value:f}),this.renderClearIcon(i)]})}},{key:"render",value:function(){var i=this;return A(Rs.Consumer,{children:function(o){var s=i.props,a=s.prefixCls,c=s.inputType,f=s.element;if(c===zae[0])return i.renderTextAreaWithClearIcon(a,f,o)}})}}]),n}(E.exports.Component);const Vae=Bae;var Uae=globalThis&&globalThis.__rest||function(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);ir&&(i=t),i}var jae=E.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.bordered,o=i===void 0?!0:i,s=e.showCount,a=s===void 0?!1:s,c=e.maxLength,f=e.className,p=e.style,g=e.size,v=e.disabled,b=e.onCompositionStart,_=e.onCompositionEnd,T=e.onChange,I=e.status,P=Uae(e,["prefixCls","bordered","showCount","maxLength","className","style","size","disabled","onCompositionStart","onCompositionEnd","onChange","status"]),M=E.exports.useContext(Fn),O=M.getPrefixCls,N=M.direction,F=E.exports.useContext(Jl),$=E.exports.useContext(fc),j=v!=null?v:$,U=E.exports.useContext(Rs),q=U.status,Y=U.hasFeedback,te=U.isFormItemInput,Z=U.feedbackIcon,X=rv(q,I),J=E.exports.useRef(null),ce=E.exports.useRef(null),re=E.exports.useState(!1),se=$e(re,2),oe=se[0],he=se[1],Ce=E.exports.useRef(),Se=E.exports.useRef(0),be=Ei(P.defaultValue,{value:P.value}),Re=$e(be,2),Ie=Re[0],Me=Re[1],Ae=P.hidden,Fe=function(at,He){P.value===void 0&&(Me(at),He==null||He())},Ke=Number(c)>0,Ue=function(at){he(!0),Ce.current=Ie,Se.current=at.currentTarget.selectionStart,b==null||b(at)},pt=function(at){var He;he(!1);var ct=at.currentTarget.value;if(Ke){var bt=Se.current>=c+1||Se.current===((He=Ce.current)===null||He===void 0?void 0:He.length);ct=oO(bt,Ce.current,ct,c)}ct!==Ie&&(Fe(ct),HC(at.currentTarget,at,T,ct)),_==null||_(at)},gt=function(at){var He=at.target.value;if(!oe&&Ke){var ct=at.target.selectionStart>=c+1||at.target.selectionStart===He.length||!at.target.selectionStart;He=oO(ct,Ie,He,c)}Fe(He),HC(at.currentTarget,at,T,He)},Dt=function(at){var He,ct,bt;Fe(""),(He=J.current)===null||He===void 0||He.focus(),HC((bt=(ct=J.current)===null||ct===void 0?void 0:ct.resizableTextArea)===null||bt===void 0?void 0:bt.textArea,at,T)},qe=O("input",r);E.exports.useImperativeHandle(t,function(){var ut;return{resizableTextArea:(ut=J.current)===null||ut===void 0?void 0:ut.resizableTextArea,focus:function(He){var ct,bt;xae((bt=(ct=J.current)===null||ct===void 0?void 0:ct.resizableTextArea)===null||bt===void 0?void 0:bt.textArea,He)},blur:function(){var He;return(He=J.current)===null||He===void 0?void 0:He.blur()}}});var Ct=A(Fae,{...Gi(P,["allowClear"]),disabled:j,className:je((n={},ae(n,"".concat(qe,"-borderless"),!o),ae(n,f,f&&!a),ae(n,"".concat(qe,"-sm"),F==="small"||g==="small"),ae(n,"".concat(qe,"-lg"),F==="large"||g==="large"),n),Xu(qe,X)),style:a?{resize:p==null?void 0:p.resize}:p,prefixCls:qe,onCompositionStart:Ue,onChange:gt,onCompositionEnd:pt,ref:J}),ot=yae(Ie);!oe&&Ke&&(P.value===null||P.value===void 0)&&(ot=D8(ot,c));var vt=A(Vae,{disabled:j,...P,prefixCls:qe,direction:N,inputType:"text",value:ot,element:Ct,handleReset:Dt,ref:ce,bordered:o,status:I,style:a?void 0:p});if(a||Y){var yt,Tt=Mt(ot).length,et="";return on(a)==="object"?et=a.formatter({value:ot,count:Tt,maxLength:c}):et="".concat(Tt).concat(Ke?" / ".concat(c):""),it("div",{hidden:Ae,className:je("".concat(qe,"-textarea"),(yt={},ae(yt,"".concat(qe,"-textarea-rtl"),N==="rtl"),ae(yt,"".concat(qe,"-textarea-show-count"),a),ae(yt,"".concat(qe,"-textarea-in-form-item"),te),yt),Xu("".concat(qe,"-textarea"),X,Y),f),style:p,"data-count":et,children:[vt,Y&&A("span",{className:"".concat(qe,"-textarea-suffix"),children:Z})]})}return vt});const O8=jae;var cv=$T;cv.Group=dae;cv.Search=Mae;cv.TextArea=O8;cv.Password=Tae;const Hae=cv;var Kae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};const Wae=Kae;var A8=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Wae})})};A8.displayName="DoubleLeftOutlined";const Gae=E.exports.forwardRef(A8);var qae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};const Zae=qae;var N8=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Zae})})};N8.displayName="DoubleRightOutlined";const Xae=E.exports.forwardRef(N8);var sm=function(t){var n,r="".concat(t.rootPrefixCls,"-item"),i=je(r,"".concat(r,"-").concat(t.page),(n={},ae(n,"".concat(r,"-active"),t.active),ae(n,"".concat(r,"-disabled"),!t.page),ae(n,t.className,!!t.className),n)),o=function(){t.onClick(t.page)},s=function(c){t.onKeyPress(c,t.onClick,t.page)};return A("li",{title:t.showTitle?t.page:null,className:i,onClick:o,onKeyPress:s,tabIndex:"0",children:t.itemRender(t.page,"page",A("a",{rel:"nofollow",children:t.page}))})};const Qc={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};var L8=function(e){si(n,e);var t=li(n);function n(){var r;jr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0||a.relatedTarget.className.indexOf("".concat(g,"-item"))>=0))&&p(r.getValidValue()))},r.go=function(a){var c=r.state.goInputText;c!==""&&(a.keyCode===Qc.ENTER||a.type==="click")&&(r.setState({goInputText:""}),r.props.quickGo(r.getValidValue()))},r}return Hr(n,[{key:"getValidValue",value:function(){var i=this.state.goInputText;return!i||isNaN(i)?void 0:Number(i)}},{key:"getPageSizeOptions",value:function(){var i=this.props,o=i.pageSize,s=i.pageSizeOptions;return s.some(function(a){return a.toString()===o.toString()})?s:s.concat([o.toString()]).sort(function(a,c){var f=isNaN(Number(a))?0:Number(a),p=isNaN(Number(c))?0:Number(c);return f-p})}},{key:"render",value:function(){var i=this,o=this.props,s=o.pageSize,a=o.locale,c=o.rootPrefixCls,f=o.changeSize,p=o.quickGo,g=o.goButton,v=o.selectComponentClass,b=o.buildOptionText,_=o.selectPrefixCls,T=o.disabled,I=this.state.goInputText,P="".concat(c,"-options"),M=v,O=null,N=null,F=null;if(!f&&!p)return null;var $=this.getPageSizeOptions();if(f&&M){var j=$.map(function(U,q){return A(M.Option,{value:U.toString(),children:(b||i.buildOptionText)(U)},q)});O=A(M,{disabled:T,prefixCls:_,showSearch:!1,className:"".concat(P,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(s||$[0]).toString(),onChange:this.changeSize,getPopupContainer:function(q){return q.parentNode},"aria-label":a.page_size,defaultOpen:!1,children:j})}return p&&(g&&(F=typeof g=="boolean"?A("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:T,className:"".concat(P,"-quick-jumper-button"),children:a.jump_to_confirm}):A("span",{onClick:this.go,onKeyUp:this.go,children:g})),N=it("div",{className:"".concat(P,"-quick-jumper"),children:[a.jump_to,A("input",{disabled:T,type:"text",value:I,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":a.page}),a.page,F]})),it("li",{className:"".concat(P),children:[O,N]})}}]),n}(Un.Component);L8.defaultProps={pageSizeOptions:["10","20","50","100"]};const Yae={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"};function $4(){}function aO(e){var t=Number(e);return typeof t=="number"&&!isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function Qae(e,t,n){return n}function _u(e,t,n){var r=typeof e>"u"?t.pageSize:e;return Math.floor((n.total-1)/r)+1}var F8=function(e){si(n,e);var t=li(n);function n(r){var i;jr(this,n),i=t.call(this,r),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(_u(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(f,p){var g=i.props.prefixCls,v=f||A("button",{type:"button","aria-label":p,className:"".concat(g,"-item-link")});return typeof f=="function"&&(v=Un.createElement(f,me({},i.props))),v},i.savePaginationNode=function(f){i.paginationNode=f},i.isValid=function(f){var p=i.props.total;return aO(f)&&f!==i.state.current&&aO(p)&&p>0},i.shouldDisplayQuickJumper=function(){var f=i.props,p=f.showQuickJumper,g=f.total,v=i.state.pageSize;return g<=v?!1:p},i.handleKeyDown=function(f){(f.keyCode===Qc.ARROW_UP||f.keyCode===Qc.ARROW_DOWN)&&f.preventDefault()},i.handleKeyUp=function(f){var p=i.getValidValue(f),g=i.state.currentInputValue;p!==g&&i.setState({currentInputValue:p}),f.keyCode===Qc.ENTER?i.handleChange(p):f.keyCode===Qc.ARROW_UP?i.handleChange(p-1):f.keyCode===Qc.ARROW_DOWN&&i.handleChange(p+1)},i.handleBlur=function(f){var p=i.getValidValue(f);i.handleChange(p)},i.changePageSize=function(f){var p=i.state.current,g=_u(f,i.state,i.props);p=p>g?g:p,g===0&&(p=i.state.current),typeof f=="number"&&("pageSize"in i.props||i.setState({pageSize:f}),"current"in i.props||i.setState({current:p,currentInputValue:p})),i.props.onShowSizeChange(p,f),"onChange"in i.props&&i.props.onChange&&i.props.onChange(p,f)},i.handleChange=function(f){var p=i.props,g=p.disabled,v=p.onChange,b=i.state,_=b.pageSize,T=b.current,I=b.currentInputValue;if(i.isValid(f)&&!g){var P=_u(void 0,i.state,i.props),M=f;return f>P?M=P:f<1&&(M=1),"current"in i.props||i.setState({current:M}),M!==I&&i.setState({currentInputValue:M}),v(M,_),M}return T},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current<_u(void 0,i.state,i.props)},i.runIfEnter=function(f,p){if(f.key==="Enter"||f.charCode===13){for(var g=arguments.length,v=new Array(g>2?g-2:0),b=2;b=s?c=s:c=Number(o),c}},{key:"getShowSizeChanger",value:function(){var i=this.props,o=i.showSizeChanger,s=i.total,a=i.totalBoundaryShowSizeChanger;return typeof o<"u"?o:s>a}},{key:"renderPrev",value:function(i){var o=this.props,s=o.prevIcon,a=o.itemRender,c=a(i,"prev",this.getItemIcon(s,"prev page")),f=!this.hasPrev();return E.exports.isValidElement(c)?E.exports.cloneElement(c,{disabled:f}):c}},{key:"renderNext",value:function(i){var o=this.props,s=o.nextIcon,a=o.itemRender,c=a(i,"next",this.getItemIcon(s,"next page")),f=!this.hasNext();return E.exports.isValidElement(c)?E.exports.cloneElement(c,{disabled:f}):c}},{key:"render",value:function(){var i=this,o=this.props,s=o.prefixCls,a=o.className,c=o.style,f=o.disabled,p=o.hideOnSinglePage,g=o.total,v=o.locale,b=o.showQuickJumper,_=o.showLessItems,T=o.showTitle,I=o.showTotal,P=o.simple,M=o.itemRender,O=o.showPrevNextJumpers,N=o.jumpPrevIcon,F=o.jumpNextIcon,$=o.selectComponentClass,j=o.selectPrefixCls,U=o.pageSizeOptions,q=this.state,Y=q.current,te=q.pageSize,Z=q.currentInputValue;if(p===!0&&g<=te)return null;var X=_u(void 0,this.state,this.props),J=[],ce=null,re=null,se=null,oe=null,he=null,Ce=b&&b.goButton,Se=_?1:2,be=Y-1>0?Y-1:0,Re=Y+1g?g:Y*te])});if(P)return Ce&&(typeof Ce=="boolean"?he=A("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:v.jump_to_confirm}):he=A("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:Ce}),he=A("li",{title:T?"".concat(v.jump_to).concat(Y,"/").concat(X):null,className:"".concat(s,"-simple-pager"),children:he})),it("ul",{className:je(s,"".concat(s,"-simple"),ae({},"".concat(s,"-disabled"),f),a),style:c,ref:this.savePaginationNode,...Ie,children:[Me,A("li",{title:T?v.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:je("".concat(s,"-prev"),ae({},"".concat(s,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev(),children:this.renderPrev(be)}),it("li",{title:T?"".concat(Y,"/").concat(X):null,className:"".concat(s,"-simple-pager"),children:[A("input",{type:"text",value:Z,disabled:f,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),A("span",{className:"".concat(s,"-slash"),children:"/"}),X]}),A("li",{title:T?v.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:je("".concat(s,"-next"),ae({},"".concat(s,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext(),children:this.renderNext(Re)}),he]});if(X<=3+Se*2){var Ae={locale:v,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:T,itemRender:M};X||J.push(E.exports.createElement(sm,{...Ae,key:"noPager",page:1,className:"".concat(s,"-item-disabled")}));for(var Fe=1;Fe<=X;Fe+=1){var Ke=Y===Fe;J.push(E.exports.createElement(sm,{...Ae,key:Fe,page:Fe,active:Ke}))}}else{var Ue=_?v.prev_3:v.prev_5,pt=_?v.next_3:v.next_5;O&&(ce=A("li",{title:T?Ue:null,onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:je("".concat(s,"-jump-prev"),ae({},"".concat(s,"-jump-prev-custom-icon"),!!N)),children:M(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(N,"prev page"))},"prev"),re=A("li",{title:T?pt:null,tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:je("".concat(s,"-jump-next"),ae({},"".concat(s,"-jump-next-custom-icon"),!!F)),children:M(this.getJumpNextPage(),"jump-next",this.getItemIcon(F,"next page"))},"next")),oe=A(sm,{locale:v,last:!0,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:X,active:!1,showTitle:T,itemRender:M},X),se=A(sm,{locale:v,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:1,active:!1,showTitle:T,itemRender:M},1);var gt=Math.max(1,Y-Se),Dt=Math.min(Y+Se,X);Y-1<=Se&&(Dt=1+Se*2),X-Y<=Se&&(gt=X-Se*2);for(var qe=gt;qe<=Dt;qe+=1){var Ct=Y===qe;J.push(A(sm,{locale:v,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:qe,active:Ct,showTitle:T,itemRender:M},qe))}Y-1>=Se*2&&Y!==1+2&&(J[0]=E.exports.cloneElement(J[0],{className:"".concat(s,"-item-after-jump-prev")}),J.unshift(ce)),X-Y>=Se*2&&Y!==X-2&&(J[J.length-1]=E.exports.cloneElement(J[J.length-1],{className:"".concat(s,"-item-before-jump-next")}),J.push(re)),gt!==1&&J.unshift(se),Dt!==X&&J.push(oe)}var ot=!this.hasPrev()||!X,vt=!this.hasNext()||!X;return it("ul",{className:je(s,a,ae({},"".concat(s,"-disabled"),f)),style:c,ref:this.savePaginationNode,...Ie,children:[Me,A("li",{title:T?v.prev_page:null,onClick:this.prev,tabIndex:ot?null:0,onKeyPress:this.runIfEnterPrev,className:je("".concat(s,"-prev"),ae({},"".concat(s,"-disabled"),ot)),"aria-disabled":ot,children:this.renderPrev(be)}),J,A("li",{title:T?v.next_page:null,onClick:this.next,tabIndex:vt?null:0,onKeyPress:this.runIfEnterNext,className:je("".concat(s,"-next"),ae({},"".concat(s,"-disabled"),vt)),"aria-disabled":vt,children:this.renderNext(Re)}),A(L8,{disabled:f,locale:v,rootPrefixCls:s,selectComponentClass:$,selectPrefixCls:j,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Y,pageSize:te,pageSizeOptions:U,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ce})]})}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s={};if("current"in i&&(s.current=i.current,i.current!==o.current&&(s.currentInputValue=s.current)),"pageSize"in i&&i.pageSize!==o.pageSize){var a=o.current,c=_u(i.pageSize,o,i);a=a>c?c:a,"current"in i||(s.current=a,s.currentInputValue=a),s.pageSize=i.pageSize}return s}}]),n}(Un.Component);F8.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:$4,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:$4,locale:Yae,style:{},itemRender:Qae,totalBoundaryShowSizeChanger:50};var z8=function(t){return A(Ud,{...t,size:"small"})},$8=function(t){return A(Ud,{...t,size:"middle"})};z8.Option=Ud.Option;$8.Option=Ud.Option;var Jae=globalThis&&globalThis.__rest||function(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);i10&&arguments[10]!==void 0?arguments[10]:0,v=r/100*360*((360-s)/360),b=s===0?0:{bottom:0,top:180,left:90,right:-90}[a],_=(100-i)/100*n;return f==="round"&&i!==100&&(_+=p/2,_>=n&&(_=n-.01)),{stroke:typeof c=="string"?c:void 0,strokeDasharray:"".concat(n,"px ").concat(t),strokeDashoffset:_+g,transform:"rotate(".concat(o+v+b,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},BT=function(t){var n=t.id,r=t.prefixCls,i=t.steps,o=t.strokeWidth,s=t.trailWidth,a=t.gapDegree,c=a===void 0?0:a,f=t.gapPosition,p=t.trailColor,g=t.strokeLinecap,v=t.style,b=t.className,_=t.strokeColor,T=t.percent,I=kn(t,Ise),P=Tse(n),M="".concat(P,"-gradient"),O=lm/2-o/2,N=Math.PI*2*O,F=c>0?90+c/2:-90,$=N*((360-c)/360),j=on(i)==="object"?i:{count:i,space:2},U=j.count,q=j.space,Y=ZC(N,$,0,100,F,c,f,p,g,o),te=hO(T),Z=hO(_),X=Z.find(function(se){return se&&on(se)==="object"}),J=Sse(),ce=function(){var oe=0;return te.map(function(he,Ce){var Se=Z[Ce]||Z[Z.length-1],be=Se&&on(Se)==="object"?"url(#".concat(M,")"):void 0,Re=ZC(N,$,oe,he,F,c,f,Se,g,o);return oe+=he,A("circle",{className:"".concat(r,"-circle-path"),r:O,cx:0,cy:0,stroke:be,strokeLinecap:g,strokeWidth:o,opacity:he===0?0:1,style:Re,ref:function(Me){J[Ce]=Me}},Ce)}).reverse()},re=function(){var oe=Math.round(U*(te[0]/100)),he=100/U,Ce=0;return new Array(U).fill(null).map(function(Se,be){var Re=be<=oe-1?Z[0]:p,Ie=Re&&on(Re)==="object"?"url(#".concat(M,")"):void 0,Me=ZC(N,$,Ce,he,F,c,f,Re,"butt",o,q);return Ce+=($-Me.strokeDashoffset+q)*100/$,A("circle",{className:"".concat(r,"-circle-path"),r:O,cx:0,cy:0,stroke:Ie,strokeWidth:o,opacity:1,style:Me,ref:function(Fe){J[be]=Fe}},be)})};return it("svg",{className:je("".concat(r,"-circle"),b),viewBox:"".concat(-lm/2," ").concat(-lm/2," ").concat(lm," ").concat(lm),style:v,id:n,role:"presentation",...I,children:[X&&A("defs",{children:A("linearGradient",{id:M,x1:"100%",y1:"0%",x2:"0%",y2:"0%",children:Object.keys(X).sort(function(se,oe){return fO(se)-fO(oe)}).map(function(se,oe){return A("stop",{offset:se,stopColor:X[se]},oe)})})}),!U&&A("circle",{className:"".concat(r,"-circle-trail"),r:O,cx:0,cy:0,stroke:p,strokeLinecap:g,strokeWidth:s||o,style:Y}),U?re():ce()]})};BT.defaultProps=Cse;BT.displayName="Circle";function xd(e){return!e||e<0?0:e>100?100:e}function Cb(e){var t=e.success,n=e.successPercent,r=n;return t&&"progress"in t&&(r=t.progress),t&&"percent"in t&&(r=t.percent),r}function kse(e){var t=e.percent,n=e.success,r=e.successPercent,i=xd(Cb({success:n,successPercent:r}));return[i,xd(xd(t)-i)]}function Mse(e){var t=e.success,n=t===void 0?{}:t,r=e.strokeColor,i=n.strokeColor;return[i||th.green,r||null]}var Rse=function(t){var n=t.prefixCls,r=t.width,i=t.strokeWidth,o=t.trailColor,s=o===void 0?null:o,a=t.strokeLinecap,c=a===void 0?"round":a,f=t.gapPosition,p=t.gapDegree,g=t.type,v=t.children,b=t.success,_=r||120,T={width:_,height:_,fontSize:_*.15+6},I=i||6,P=f||g==="dashboard"&&"bottom"||void 0,M=function(){if(p||p===0)return p;if(g==="dashboard")return 75},O=Object.prototype.toString.call(t.strokeColor)==="[object Object]",N=Mse({success:b,strokeColor:t.strokeColor}),F=je("".concat(n,"-inner"),ae({},"".concat(n,"-circle-gradient"),O));return it("div",{className:F,style:T,children:[A(BT,{percent:kse(t),strokeWidth:I,trailWidth:I,strokeColor:N,strokeLinecap:c,trailColor:s,prefixCls:n,gapDegree:M(),gapPosition:P}),v]})};const Dse=Rse;var Ose=globalThis&&globalThis.__rest||function(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=100?"success":X||"normal"}function M(X,J){var ce=t.format,re=Cb(t);if(!v)return null;var se,oe=ce||function(Ce){return"".concat(Ce,"%")},he=_==="line";return ce||J!=="exception"&&J!=="success"?se=oe(xd(c),xd(re)):J==="exception"?se=he?A(Fh,{}):A(zh,{}):J==="success"&&(se=he?A(XP,{}):A(xT,{})),A("span",{className:"".concat(X,"-text"),title:typeof se=="string"?se:void 0,children:se})}var O=E.exports.useContext(Fn),N=O.getPrefixCls,F=O.direction,$=N("progress",r),j=P(),U=M($,j),q=Array.isArray(s)?s[0]:s,Y=typeof s=="string"||Array.isArray(s)?s:void 0,te;_==="line"?te=o?A($se,{...t,strokeColor:Y,prefixCls:$,steps:o,children:U}):A(Fse,{...t,strokeColor:q,prefixCls:$,direction:F,children:U}):(_==="circle"||_==="dashboard")&&(te=A(Dse,{...t,strokeColor:q,prefixCls:$,progressStatus:j,children:U}));var Z=je($,(n={},ae(n,"".concat($,"-").concat(_==="dashboard"&&"circle"||o&&"steps"||_),!0),ae(n,"".concat($,"-status-").concat(j),!0),ae(n,"".concat($,"-show-info"),v),ae(n,"".concat($,"-").concat(p),p),ae(n,"".concat($,"-rtl"),F==="rtl"),n),i);return A("div",{...Gi(T,["status","format","trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"]),className:Z,role:"progressbar",children:te})};const VT=Use;var jd=E.exports.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0});function V4(e,t,n){return(e-t)/(n-t)}function UT(e,t,n,r){var i=V4(t,n,r),o={};switch(e){case"rtl":o.right="".concat(i*100,"%"),o.transform="translateX(50%)";break;case"btt":o.bottom="".concat(i*100,"%"),o.transform="translateY(50%)";break;case"ttb":o.top="".concat(i*100,"%"),o.transform="translateY(-50%)";break;default:o.left="".concat(i*100,"%"),o.transform="translateX(-50%)";break}return o}function Gf(e,t){return Array.isArray(e)?e[t]:e}var jse=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"],Hse=E.exports.forwardRef(function(e,t){var n,r,i=e.prefixCls,o=e.value,s=e.valueIndex,a=e.onStartMove,c=e.style,f=e.render,p=e.dragging,g=e.onOffsetChange,v=kn(e,jse),b=E.exports.useContext(jd),_=b.min,T=b.max,I=b.direction,P=b.disabled,M=b.range,O=b.tabIndex,N=b.ariaLabelForHandle,F=b.ariaLabelledByForHandle,$=b.ariaValueTextFormatterForHandle,j="".concat(i,"-handle"),U=function(X){P||a(X,s)},q=function(X){if(!P){var J=null;switch(X.which||X.keyCode){case Pt.LEFT:J=I==="ltr"||I==="btt"?-1:1;break;case Pt.RIGHT:J=I==="ltr"||I==="btt"?1:-1;break;case Pt.UP:J=I!=="ttb"?1:-1;break;case Pt.DOWN:J=I!=="ttb"?-1:1;break;case Pt.HOME:J="min";break;case Pt.END:J="max";break;case Pt.PAGE_UP:J=2;break;case Pt.PAGE_DOWN:J=-2;break}J!==null&&(X.preventDefault(),g(J,s))}},Y=UT(I,o,_,T),te=A("div",{ref:t,className:je(j,(n={},ae(n,"".concat(j,"-").concat(s+1),M),ae(n,"".concat(j,"-dragging"),p),n)),style:me(me({},Y),c),onMouseDown:U,onTouchStart:U,onKeyDown:q,tabIndex:P?null:Gf(O,s),role:"slider","aria-valuemin":_,"aria-valuemax":T,"aria-valuenow":o,"aria-disabled":P,"aria-label":Gf(N,s),"aria-labelledby":Gf(F,s),"aria-valuetext":(r=Gf($,s))===null||r===void 0?void 0:r(o),...v});return f&&(te=f(te,{index:s,prefixCls:i,value:o,dragging:p})),te}),Kse=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","draggingIndex"],Wse=E.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,i=e.onStartMove,o=e.onOffsetChange,s=e.values,a=e.handleRender,c=e.draggingIndex,f=kn(e,Kse),p=E.exports.useRef({});return E.exports.useImperativeHandle(t,function(){return{focus:function(v){var b;(b=p.current[v])===null||b===void 0||b.focus()}}}),A(nr,{children:s.map(function(g,v){return A(Hse,{ref:function(_){_?p.current[v]=_:delete p.current[v]},dragging:c===v,prefixCls:n,style:Gf(r,v),value:g,valueIndex:v,onStartMove:i,onOffsetChange:o,render:a,...f},v)})})});function pO(e){var t="touches"in e?e.touches[0]:e;return{pageX:t.pageX,pageY:t.pageY}}function Gse(e,t,n,r,i,o,s,a,c){var f=E.exports.useState(null),p=$e(f,2),g=p[0],v=p[1],b=E.exports.useState(-1),_=$e(b,2),T=_[0],I=_[1],P=E.exports.useState(n),M=$e(P,2),O=M[0],N=M[1],F=E.exports.useState(n),$=$e(F,2),j=$[0],U=$[1],q=E.exports.useRef(null),Y=E.exports.useRef(null);E.exports.useEffect(function(){T===-1&&N(n)},[n,T]),E.exports.useEffect(function(){return function(){document.removeEventListener("mousemove",q.current),document.removeEventListener("mouseup",Y.current),document.removeEventListener("touchmove",q.current),document.removeEventListener("touchend",Y.current)}},[]);var te=function(se,oe){O.some(function(he,Ce){return he!==se[Ce]})&&(oe!==void 0&&v(oe),N(se),s(se))},Z=function(se,oe){if(se===-1){var he=j[0],Ce=j[j.length-1],Se=r-he,be=i-Ce,Re=oe*(i-r);Re=Math.max(Re,Se),Re=Math.min(Re,be);var Ie=o(he+Re);Re=Ie-he;var Me=j.map(function(Ue){return Ue+Re});te(Me)}else{var Ae=(i-r)*oe,Fe=Mt(O);Fe[se]=j[se];var Ke=c(Fe,Ae,se,"dist");te(Ke.values,Ke.value)}},X=E.exports.useRef(Z);X.current=Z;var J=function(se,oe){se.stopPropagation();var he=n[oe];I(oe),v(he),U(n);var Ce=pO(se),Se=Ce.pageX,be=Ce.pageY,Re=function(Ae){Ae.preventDefault();var Fe=pO(Ae),Ke=Fe.pageX,Ue=Fe.pageY,pt=Ke-Se,gt=Ue-be,Dt=e.current.getBoundingClientRect(),qe=Dt.width,Ct=Dt.height,ot;switch(t){case"btt":ot=-gt/Ct;break;case"ttb":ot=gt/Ct;break;case"rtl":ot=-pt/qe;break;default:ot=pt/qe}X.current(oe,ot)},Ie=function Me(Ae){Ae.preventDefault(),document.removeEventListener("mouseup",Me),document.removeEventListener("mousemove",Re),document.removeEventListener("touchend",Me),document.removeEventListener("touchmove",Re),q.current=null,Y.current=null,I(-1),a()};document.addEventListener("mouseup",Ie),document.addEventListener("mousemove",Re),document.addEventListener("touchend",Ie),document.addEventListener("touchmove",Re),q.current=Re,Y.current=Ie},ce=E.exports.useMemo(function(){var re=Mt(n).sort(function(oe,he){return oe-he}),se=Mt(O).sort(function(oe,he){return oe-he});return re.every(function(oe,he){return oe===se[he]})?O:n},[n,O]);return[T,g,ce,J]}function qse(e){var t=e.prefixCls,n=e.style,r=e.start,i=e.end,o=e.index,s=e.onStartMove,a=E.exports.useContext(jd),c=a.direction,f=a.min,p=a.max,g=a.disabled,v=a.range,b="".concat(t,"-track"),_=V4(r,f,p),T=V4(i,f,p),I=function(O){!g&&s&&s(O,-1)},P={};switch(c){case"rtl":P.right="".concat(_*100,"%"),P.width="".concat(T*100-_*100,"%");break;case"btt":P.bottom="".concat(_*100,"%"),P.height="".concat(T*100-_*100,"%");break;case"ttb":P.top="".concat(_*100,"%"),P.height="".concat(T*100-_*100,"%");break;default:P.left="".concat(_*100,"%"),P.width="".concat(T*100-_*100,"%")}return A("div",{className:je(b,v&&"".concat(b,"-").concat(o+1)),style:me(me({},P),n),onMouseDown:I,onTouchStart:I})}function Zse(e){var t=e.prefixCls,n=e.style,r=e.values,i=e.startPoint,o=e.onStartMove,s=E.exports.useContext(jd),a=s.included,c=s.range,f=s.min,p=E.exports.useMemo(function(){if(!c){if(r.length===0)return[];var g=i!=null?i:f,v=r[0];return[{start:Math.min(g,v),end:Math.max(g,v)}]}for(var b=[],_=0;_3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof T=="number"){var M,O=_[I],N=O+T,F=[];r.forEach(function(Y){F.push(Y.value)}),F.push(e,t),F.push(a(O));var $=T>0?1:-1;P==="unit"?F.push(a(O+$*n)):F.push(a(N)),F=F.filter(function(Y){return Y!==null}).filter(function(Y){return T<0?Y<=O:Y>=O}),P==="unit"&&(F=F.filter(function(Y){return Y!==O}));var j=P==="unit"?O:N;M=F[0];var U=Math.abs(M-j);if(F.forEach(function(Y){var te=Math.abs(Y-j);te1){var q=Mt(_);return q[I]=M,b(q,T-$,I,P)}return M}else{if(T==="min")return e;if(T==="max")return t}},p=function(_,T,I){var P=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",M=_[I],O=f(_,T,I,P);return{value:O,changed:O!==M}},g=function(_){return o===null&&_===0||typeof o=="number"&&_3&&arguments[3]!==void 0?arguments[3]:"unit",M=_.map(c),O=M[I],N=f(M,T,I,P);if(M[I]=N,i===!1){var F=o||0;I>0&&M[I-1]!==O&&(M[I]=Math.max(M[I],M[I-1]+F)),I0;q-=1)for(var Y=!0;g(M[q]-M[q-1])&&Y;){var te=p(M,-1,q-1);M[q-1]=te.value,Y=te.changed}for(var Z=M.length-1;Z>0;Z-=1)for(var X=!0;g(M[Z]-M[Z-1])&&X;){var J=p(M,-1,Z-1);M[Z-1]=J.value,X=J.changed}for(var ce=0;ce=0?Z:!1},[Z,yt]),et=E.exports.useMemo(function(){var ye=Object.keys(Ie||{});return ye.map(function(W){var Q=Ie[W],fe={value:Number(W)};return Q&&on(Q)==="object"&&!E.exports.isValidElement(Q)&&("label"in Q||"style"in Q)?(fe.style=Q.style,fe.label=Q.label):fe.label=Q,fe}).filter(function(W){var Q=W.label;return Q||typeof Q=="number"}).sort(function(W,Q){return W.value-Q.value})},[Ie]),ut=ele(ot,vt,yt,et,Y,Tt),at=$e(ut,2),He=at[0],ct=at[1],bt=Ei(O,{value:M}),Ot=$e(bt,2),Lt=Ot[0],Ht=Ot[1],ze=E.exports.useMemo(function(){var ye=Lt==null?[]:Array.isArray(Lt)?Lt:[Lt],W=$e(ye,1),Q=W[0],fe=Q===void 0?ot:Q,ue=Lt===null?[]:[fe];if(N){if(ue=Mt(ye),F||Lt===void 0){var xe=F>=0?F+1:2;for(ue=ue.slice(0,xe);ue.length=0&&Dt.current.focus(ye)}tt(null)},[pn]);var qt=E.exports.useMemo(function(){return X&&yt===null?!1:X},[X,yt]),En=function(){U==null||U(Zt(Ye.current))},yn=Gse(qe,Ct,ze,ot,vt,He,an,En,ct),St=$e(yn,4),Pn=St[0],_n=St[1],tn=St[2],zt=St[3],dt=function(W,Q){zt(W,Q),j==null||j(Zt(Ye.current))},mt=Pn!==-1;E.exports.useEffect(function(){if(!mt){var ye=ze.lastIndexOf(_n);Dt.current.focus(ye)}},[mt]);var $t=E.exports.useMemo(function(){return Mt(tn).sort(function(ye,W){return ye-W})},[tn]),Wt=E.exports.useMemo(function(){return N?[$t[0],$t[$t.length-1]]:[ot,$t[0]]},[$t,N,ot]),mn=$e(Wt,2),An=mn[0],Qn=mn[1];E.exports.useImperativeHandle(t,function(){return{focus:function(){Dt.current.focus(0)},blur:function(){var W=document,Q=W.activeElement;qe.current.contains(Q)&&(Q==null||Q.blur())}}}),E.exports.useEffect(function(){f&&Dt.current.focus(0)},[]);var Jn=E.exports.useMemo(function(){return{min:ot,max:vt,direction:Ct,disabled:c,step:yt,included:se,includedStart:An,includedEnd:Qn,range:N,tabIndex:Ke,ariaLabelForHandle:Ue,ariaLabelledByForHandle:pt,ariaValueTextFormatterForHandle:gt}},[ot,vt,Ct,c,yt,se,An,Qn,N,Ke,Ue,pt,gt]);return A(jd.Provider,{value:Jn,children:it("div",{ref:qe,className:je(i,o,(n={},ae(n,"".concat(i,"-disabled"),c),ae(n,"".concat(i,"-vertical"),ce),ae(n,"".concat(i,"-horizontal"),!ce),ae(n,"".concat(i,"-with-marks"),et.length),n)),style:s,onMouseDown:Vt,children:[A("div",{className:"".concat(i,"-rail"),style:Se}),A(Zse,{prefixCls:i,style:he,values:$t,startPoint:oe,onStartMove:qt?dt:null}),A(Jse,{prefixCls:i,marks:et,dots:Me,style:be,activeStyle:Re}),A(Wse,{ref:Dt,prefixCls:i,style:Ce,values:tn,draggingIndex:Pn,onStartMove:dt,onOffsetChange:At,onFocus:p,onBlur:g,handleRender:Ae}),A(Yse,{prefixCls:i,marks:et,onClick:Kt})]})})}),nle=E.exports.forwardRef(function(e,t){var n=e.open,r=E.exports.useRef(null),i=E.exports.useRef(null);function o(){ur.cancel(i.current),i.current=null}function s(){i.current=ur(function(){var a;(a=r.current)===null||a===void 0||a.forcePopupAlign(),i.current=null})}return E.exports.useEffect(function(){return n?s():o(),o},[n,e.title]),A(ka,{ref:Aa(r,t),...e})});const rle=nle;var ile=globalThis&&globalThis.__rest||function(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=n}function ple(e){return e&&on(e)==="object"&&!Array.isArray(e)&&!E.exports.isValidElement(e)}function mle(e){return typeof e=="string"?!0:Nh(e)}var gle=function(t){var n=t.ellipsis,r=t.rowType,i=t.children,o,s=n===!0?{showTitle:!0}:n;return s&&(s.showTitle||r==="header")&&(typeof i=="string"||typeof i=="number"?o=i.toString():E.exports.isValidElement(i)&&typeof i.props.children=="string"&&(o=i.props.children)),o};function vle(e,t){var n,r,i,o=e.prefixCls,s=e.className,a=e.record,c=e.index,f=e.renderIndex,p=e.dataIndex,g=e.render,v=e.children,b=e.component,_=b===void 0?"td":b,T=e.colSpan,I=e.rowSpan,P=e.fixLeft,M=e.fixRight,O=e.firstFixLeft,N=e.lastFixLeft,F=e.firstFixRight,$=e.lastFixRight,j=e.appendNode,U=e.additionalProps,q=U===void 0?{}:U,Y=e.ellipsis,te=e.align,Z=e.rowType,X=e.isSticky,J=e.hovering,ce=e.onHover,re="".concat(o,"-cell"),se=E.exports.useContext(tV),oe=E.exports.useContext(J8),he=E.exports.useContext(n1),Ce=he.allColumnsFixedLeft,Se=E.exports.useMemo(function(){if(U4(v))return[v];var He=Q8(a,p),ct=He,bt=void 0;if(g){var Ot=g(He,a,f);ple(Ot)?(ct=Ot.children,bt=Ot.props,se.renderWithProps=!0):ct=Ot}return[ct,bt]},[se.renderWithProps?Math.random():0,v,p,se,a,g,f]),be=$e(Se,2),Re=be[0],Ie=be[1],Me=Re;on(Me)==="object"&&!Array.isArray(Me)&&!E.exports.isValidElement(Me)&&(Me=null),Y&&(N||F)&&(Me=A("span",{className:"".concat(re,"-content"),children:Me}));var Ae=Ie||{},Fe=Ae.colSpan,Ke=Ae.rowSpan,Ue=Ae.style,pt=Ae.className,gt=kn(Ae,fle),Dt=(n=Fe!==void 0?Fe:T)!==null&&n!==void 0?n:1,qe=(r=Ke!==void 0?Ke:I)!==null&&r!==void 0?r:1;if(Dt===0||qe===0)return null;var Ct={},ot=typeof P=="number"&&oe,vt=typeof M=="number"&&oe;ot&&(Ct.position="sticky",Ct.left=P),vt&&(Ct.position="sticky",Ct.right=M);var yt={};te&&(yt.textAlign=te);var Tt=function(ct){var bt;a&&ce(c,c+qe-1),q==null||(bt=q.onMouseEnter)===null||bt===void 0||bt.call(q,ct)},et=function(ct){var bt;a&&ce(-1,-1),q==null||(bt=q.onMouseLeave)===null||bt===void 0||bt.call(q,ct)},ut=gle({rowType:Z,ellipsis:Y,children:Re}),at=me(me(me({title:ut},gt),q),{},{colSpan:Dt!==1?Dt:null,rowSpan:qe!==1?qe:null,className:je(re,s,(i={},ae(i,"".concat(re,"-fix-left"),ot&&oe),ae(i,"".concat(re,"-fix-left-first"),O&&oe),ae(i,"".concat(re,"-fix-left-last"),N&&oe),ae(i,"".concat(re,"-fix-left-all"),N&&Ce&&oe),ae(i,"".concat(re,"-fix-right"),vt&&oe),ae(i,"".concat(re,"-fix-right-first"),F&&oe),ae(i,"".concat(re,"-fix-right-last"),$&&oe),ae(i,"".concat(re,"-ellipsis"),Y),ae(i,"".concat(re,"-with-append"),j),ae(i,"".concat(re,"-fix-sticky"),(ot||vt)&&X&&oe),ae(i,"".concat(re,"-row-hover"),!Ie&&J),i),q.className,pt),style:me(me(me(me({},q.style),yt),Ct),Ue),onMouseEnter:Tt,onMouseLeave:et,ref:mle(_)?t:null});return it(_,{...at,children:[j,Me]})}var nV=E.exports.forwardRef(vle);nV.displayName="Cell";var yle=["expanded","className","hovering"],xle=E.exports.memo(nV,function(e,t){return t.shouldCellUpdate?yle.every(function(n){return e[n]===t[n]})&&!t.shouldCellUpdate(t.record,e.record):Md(e,t)}),hv=E.exports.forwardRef(function(e,t){var n=e.index,r=e.additionalProps,i=r===void 0?{}:r,o=e.colSpan,s=e.rowSpan,a=i.colSpan,c=i.rowSpan,f=o!=null?o:a,p=s!=null?s:c,g=dle(eV,function(_){var T=hle(n,p||1,_==null?void 0:_.startRow,_==null?void 0:_.endRow);return{onHover:_==null?void 0:_.onHover,hovering:T}}),v=g.onHover,b=g.hovering;return A(xle,{...e,colSpan:f,rowSpan:p,hovering:b,ref:t,onHover:v})});hv.displayName="WrappedCell";var ul=E.exports.createContext(null);function jT(e,t,n,r,i){var o=n[e]||{},s=n[t]||{},a,c;o.fixed==="left"?a=r.left[e]:s.fixed==="right"&&(c=r.right[t]);var f=!1,p=!1,g=!1,v=!1,b=n[t+1],_=n[e-1];if(i==="rtl"){if(a!==void 0){var T=_&&_.fixed==="left";v=!T}else if(c!==void 0){var I=b&&b.fixed==="right";g=!I}}else if(a!==void 0){var P=b&&b.fixed==="left";f=!P}else if(c!==void 0){var M=_&&_.fixed==="right";p=!M}return{fixLeft:a,fixRight:c,lastFixLeft:f,firstFixRight:p,lastFixRight:g,firstFixLeft:v,isSticky:r.isSticky}}function rV(e){var t=e.cells,n=e.stickyOffsets,r=e.flattenColumns,i=e.rowComponent,o=e.cellComponent,s=e.onHeaderRow,a=e.index,c=E.exports.useContext(ul),f=c.prefixCls,p=c.direction,g;s&&(g=s(t.map(function(b){return b.column}),a));var v=t1(t.map(function(b){return b.column}));return A(i,{...g,children:t.map(function(b,_){var T=b.column,I=jT(b.colStart,b.colEnd,r,n,p),P;return T&&T.onHeaderCell&&(P=b.column.onHeaderCell(T)),E.exports.createElement(hv,{...b,ellipsis:T.ellipsis,align:T.align,component:o,prefixCls:f,key:v[_],...I,additionalProps:P,rowType:"header"})})})}rV.displayName="HeaderRow";function ble(e){var t=[];function n(s,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[c]=t[c]||[];var f=a,p=s.filter(Boolean).map(function(g){var v={key:g.key,className:g.className||"",children:g.title,column:g,colStart:f},b=1,_=g.children;return _&&_.length>0&&(b=n(_,f,c+1).reduce(function(T,I){return T+I},0),v.hasSubColumns=!0),"colSpan"in g&&(b=g.colSpan),"rowSpan"in g&&(v.rowSpan=g.rowSpan),v.colSpan=b,v.colEnd=v.colStart+b-1,t[c].push(v),f+=b,b});return p}n(e,0);for(var r=t.length,i=function(a){t[a].forEach(function(c){!("rowSpan"in c)&&!c.hasSubColumns&&(c.rowSpan=r-a)})},o=0;o1?ot-1:0),yt=1;yt0?[].concat(Mt(t),Mt(j4(o).map(function(s){return me({fixed:i},s)}))):[].concat(Mt(t),[me(me({},n),{},{fixed:i})])},[])}function kle(e){return e.map(function(t){var n=t.fixed,r=kn(t,Ile),i=n;return n==="left"?i="right":n==="right"&&(i="left"),me({fixed:i},r)})}function Mle(e,t){var n=e.prefixCls,r=e.columns,i=e.children,o=e.expandable,s=e.expandedKeys,a=e.columnTitle,c=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,g=e.rowExpandable,v=e.expandIconColumnIndex,b=e.direction,_=e.expandRowByClick,T=e.columnWidth,I=e.fixed,P=E.exports.useMemo(function(){return r||HT(i)},[r,i]),M=E.exports.useMemo(function(){if(o){var F,$=P.slice();if(!$.includes(Jc)){var j=v||0;j>=0&&$.splice(j,0,Jc)}var U=$.indexOf(Jc);$=$.filter(function(Z,X){return Z!==Jc||X===U});var q=P[U],Y;(I==="left"||I)&&!v?Y="left":(I==="right"||I)&&v===P.length?Y="right":Y=q?q.fixed:null;var te=(F={},ae(F,qm,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),ae(F,"title",a),ae(F,"fixed",Y),ae(F,"className","".concat(n,"-row-expand-icon-cell")),ae(F,"width",T),ae(F,"render",function(X,J,ce){var re=c(J,ce),se=s.has(re),oe=g?g(J):!0,he=p({prefixCls:n,expanded:se,expandable:oe,record:J,onExpand:f});return _?A("span",{onClick:function(Se){return Se.stopPropagation()},children:he}):he}),F);return $.map(function(Z){return Z===Jc?te:Z})}return P.filter(function(Z){return Z!==Jc})},[o,P,c,s,p,b]),O=E.exports.useMemo(function(){var F=M;return t&&(F=t(F)),F.length||(F=[{render:function(){return null}}]),F},[t,M,b]),N=E.exports.useMemo(function(){return b==="rtl"?kle(j4(O)):j4(O)},[O,b]);return[O,N]}function cV(e){var t=E.exports.useRef(e),n=E.exports.useState({}),r=$e(n,2),i=r[1],o=E.exports.useRef(null),s=E.exports.useRef([]);function a(c){s.current.push(c);var f=Promise.resolve();o.current=f,f.then(function(){if(o.current===f){var p=s.current,g=t.current;s.current=[],p.forEach(function(v){t.current=v(t.current)}),o.current=null,g!==t.current&&i({})}})}return E.exports.useEffect(function(){return function(){o.current=null}},[]),[t.current,a]}function Rle(e){var t=E.exports.useRef(e||null),n=E.exports.useRef();function r(){window.clearTimeout(n.current)}function i(s){t.current=s,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)}function o(){return t.current}return E.exports.useEffect(function(){return r},[]),[i,o]}function Dle(e,t,n){var r=E.exports.useMemo(function(){for(var i=[],o=[],s=0,a=0,c=0;c=0;a-=1){var c=t[a],f=n&&n[a],p=f&&f[qm];if(c||p||s){var g=p||{};g.columnType;var v=kn(g,Ole);i.unshift(A("col",{style:{width:c},...v},a)),s=!0}}return A("colgroup",{children:i})}function gO(e){var t=e.className,n=e.children;return A("div",{className:t,children:n})}var fV=E.exports.createContext({});function Ale(e){var t=e.className,n=e.index,r=e.children,i=e.colSpan,o=i===void 0?1:i,s=e.rowSpan,a=e.align,c=E.exports.useContext(ul),f=c.prefixCls,p=c.direction,g=E.exports.useContext(fV),v=g.scrollColumnIndex,b=g.stickyOffsets,_=g.flattenColumns,T=n+o-1,I=T+1===v?o+1:o,P=jT(n,n+I-1,_,b,p);return A(hv,{className:t,index:n,component:"td",prefixCls:f,record:null,dataIndex:null,align:a,colSpan:I,rowSpan:s,render:function(){return r},...P})}var Nle=["children"];function Lle(e){var t=e.children,n=kn(e,Nle);return A("tr",{...n,children:t})}function r1(e){var t=e.children;return t}r1.Row=Lle;r1.Cell=Ale;function g0(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,i=E.exports.useContext(ul),o=i.prefixCls,s=r.length-1,a=r[s],c=E.exports.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:a!=null&&a.scrollbar?s:null}},[a,r,s,n]);return A(fV.Provider,{value:c,children:A("tfoot",{className:"".concat(o,"-summary"),children:t})})}var hV=r1;function Fle(e){var t,n=e.prefixCls,r=e.record,i=e.onExpand,o=e.expanded,s=e.expandable,a="".concat(n,"-row-expand-icon");if(!s)return A("span",{className:je(a,"".concat(n,"-row-spaced"))});var c=function(p){i(r,p),p.stopPropagation()};return A("span",{className:je(a,(t={},ae(t,"".concat(n,"-row-expanded"),o),ae(t,"".concat(n,"-row-collapsed"),!o),t)),onClick:c})}function zle(e,t,n){var r=[];function i(o){(o||[]).forEach(function(s,a){r.push(t(s,a)),i(s[n])})}return i(e),r}var $le=function(t,n){var r,i,o=t.scrollBodyRef,s=t.onScroll,a=t.offsetScroll,c=t.container,f=E.exports.useContext(ul),p=f.prefixCls,g=((r=o.current)===null||r===void 0?void 0:r.scrollWidth)||0,v=((i=o.current)===null||i===void 0?void 0:i.clientWidth)||0,b=g&&v*(v/g),_=E.exports.useRef(),T=cV({scrollLeft:0,isHiddenScrollBar:!1}),I=$e(T,2),P=I[0],M=I[1],O=E.exports.useRef({delta:0,x:0}),N=E.exports.useState(!1),F=$e(N,2),$=F[0],j=F[1],U=function(){j(!1)},q=function(J){J.persist(),O.current.delta=J.pageX-P.scrollLeft,O.current.x=0,j(!0),J.preventDefault()},Y=function(J){var ce,re=J||((ce=window)===null||ce===void 0?void 0:ce.event),se=re.buttons;if(!$||se===0){$&&j(!1);return}var oe=O.current.x+J.pageX-O.current.x-O.current.delta;oe<=0&&(oe=0),oe+b>=v&&(oe=v-b),s({scrollLeft:oe/v*(g+2)}),O.current.x=J.pageX},te=function(){if(!!o.current){var J=z4(o.current).top,ce=J+o.current.offsetHeight,re=c===window?document.documentElement.scrollTop+window.innerHeight:z4(c).top+c.clientHeight;ce-wb()<=re||J>=re-a?M(function(se){return me(me({},se),{},{isHiddenScrollBar:!0})}):M(function(se){return me(me({},se),{},{isHiddenScrollBar:!1})})}},Z=function(J){M(function(ce){return me(me({},ce),{},{scrollLeft:J/g*v||0})})};return E.exports.useImperativeHandle(n,function(){return{setScrollLeft:Z}}),E.exports.useEffect(function(){var X=Qo(document.body,"mouseup",U,!1),J=Qo(document.body,"mousemove",Y,!1);return te(),function(){X.remove(),J.remove()}},[b,$]),E.exports.useEffect(function(){var X=Qo(c,"scroll",te,!1),J=Qo(window,"resize",te,!1);return function(){X.remove(),J.remove()}},[c]),E.exports.useEffect(function(){P.isHiddenScrollBar||M(function(X){var J=o.current;return J?me(me({},X),{},{scrollLeft:J.scrollLeft/J.scrollWidth*J.clientWidth}):X})},[P.isHiddenScrollBar]),g<=v||!b||P.isHiddenScrollBar?null:A("div",{style:{height:wb(),width:v,bottom:a},className:"".concat(p,"-sticky-scroll"),children:A("div",{onMouseDown:q,ref:_,className:je("".concat(p,"-sticky-scroll-bar"),ae({},"".concat(p,"-sticky-scroll-bar-active"),$)),style:{width:"".concat(b,"px"),transform:"translate3d(".concat(P.scrollLeft,"px, 0, 0)")}})})};const Ble=E.exports.forwardRef($le);var vO=To()?window:null;function Vle(e,t){var n=on(e)==="object"?e:{},r=n.offsetHeader,i=r===void 0?0:r,o=n.offsetSummary,s=o===void 0?0:o,a=n.offsetScroll,c=a===void 0?0:a,f=n.getContainer,p=f===void 0?function(){return vO}:f,g=p()||vO;return E.exports.useMemo(function(){var v=!!e;return{isSticky:v,stickyClassName:v?"".concat(t,"-sticky-holder"):"",offsetHeader:i,offsetSummary:s,offsetScroll:c,container:g}},[c,i,s,t,g])}var Ule=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function jle(e,t){return E.exports.useMemo(function(){for(var n=[],r=0;r=0})},[o]),Y=o[o.length-1],te={fixed:Y?Y.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(O,"-cell-scrollbar")}}},Z=E.exports.useMemo(function(){return $?[].concat(Mt(i),[te]):i},[$,i]),X=E.exports.useMemo(function(){return $?[].concat(Mt(o),[te]):o},[$,o]),J=E.exports.useMemo(function(){var re=c.right,se=c.left;return me(me({},c),{},{left:f==="rtl"?[].concat(Mt(se.map(function(oe){return oe+$})),[0]):se,right:f==="rtl"?re:[].concat(Mt(re.map(function(oe){return oe+$})),[0]),isSticky:F})},[$,c,F]),ce=jle(s,a);return A("div",{style:me({overflow:"hidden"},F?{top:g,bottom:v}:{}),ref:U,className:je(n,ae({},b,!!b)),children:it("table",{style:{tableLayout:"fixed",visibility:r||ce?null:"hidden"},children:[(!r||!T||q)&&A(dV,{colWidths:ce?[].concat(Mt(ce),[$]):[],columCount:a+1,columns:X}),I(me(me({},P),{},{stickyOffsets:J,columns:Z,flattenColumns:X}))]})})});H4.displayName="FixedHolder";var Hle=[],Kle={},hx="rc-table-internal-hook",Wle=E.exports.memo(function(e){var t=e.children;return t},function(e,t){return Md(e.props,t.props)?e.pingLeft!==t.pingLeft||e.pingRight!==t.pingRight:!1});function Hd(e){var t,n=e.prefixCls,r=e.className,i=e.rowClassName,o=e.style,s=e.data,a=e.rowKey,c=e.scroll,f=e.tableLayout,p=e.direction,g=e.title,v=e.footer,b=e.summary,_=e.id,T=e.showHeader,I=e.components,P=e.emptyText,M=e.onRow,O=e.onHeaderRow,N=e.internalHooks,F=e.transformColumns,$=e.internalRefs,j=e.sticky,U=s||Hle,q=!!U.length,Y=E.exports.useCallback(function(Vn,er){return Q8(I||{},Vn)||er},[I]),te=E.exports.useMemo(function(){return typeof a=="function"?a:function(Vn){var er=Vn&&Vn[a];return er}},[a]),Z=Ple(e),X=Z.expandIcon,J=Z.expandedRowKeys,ce=Z.defaultExpandedRowKeys,re=Z.defaultExpandAllRows,se=Z.expandedRowRender,oe=Z.columnTitle,he=Z.onExpand,Ce=Z.onExpandedRowsChange,Se=Z.expandRowByClick,be=Z.rowExpandable,Re=Z.expandIconColumnIndex,Ie=Z.expandedRowClassName,Me=Z.childrenColumnName,Ae=Z.indentSize,Fe=X||Fle,Ke=Me||"children",Ue=E.exports.useMemo(function(){return se?"row":e.expandable&&N===hx&&e.expandable.__PARENT_RENDER_ICON__||U.some(function(Vn){return Vn&&on(Vn)==="object"&&Vn[Ke]})?"nest":!1},[!!se,U]),pt=E.exports.useState(function(){return ce||(re?zle(U,te,Ke):[])}),gt=$e(pt,2),Dt=gt[0],qe=gt[1],Ct=E.exports.useMemo(function(){return new Set(J||Dt||[])},[J,Dt]),ot=E.exports.useCallback(function(Vn){var er=te(Vn,U.indexOf(Vn)),zr,Fi=Ct.has(er);Fi?(Ct.delete(er),zr=Mt(Ct)):zr=[].concat(Mt(Ct),[er]),qe(zr),he&&he(!Fi,Vn),Ce&&Ce(zr)},[te,Ct,U,he,Ce]),vt=E.exports.useState(0),yt=$e(vt,2),Tt=yt[0],et=yt[1],ut=Mle(me(me(me({},e),Z),{},{expandable:!!se,columnTitle:oe,expandedKeys:Ct,getRowKey:te,onTriggerExpand:ot,expandIcon:Fe,expandIconColumnIndex:Re,direction:p}),N===hx?F:null),at=$e(ut,2),He=at[0],ct=at[1],bt=E.exports.useMemo(function(){return{columns:He,flattenColumns:ct}},[He,ct]),Ot=E.exports.useRef(),Lt=E.exports.useRef(),Ht=E.exports.useRef(),ze=E.exports.useRef(),Ye=E.exports.useRef(),Zt=E.exports.useState(!1),an=$e(Zt,2),Kt=an[0],Vt=an[1],It=E.exports.useState(!1),Xt=$e(It,2),pn=Xt[0],tt=Xt[1],At=cV(new Map),qt=$e(At,2),En=qt[0],yn=qt[1],St=t1(ct),Pn=St.map(function(Vn){return En.get(Vn)}),_n=E.exports.useMemo(function(){return Pn},[Pn.join("_")]),tn=Dle(_n,ct.length,p),zt=c&&U4(c.y),dt=c&&U4(c.x)||Boolean(Z.fixed),mt=dt&&ct.some(function(Vn){var er=Vn.fixed;return er}),$t=E.exports.useRef(),Wt=Vle(j,n),mn=Wt.isSticky,An=Wt.offsetHeader,Qn=Wt.offsetSummary,Jn=Wt.offsetScroll,ye=Wt.stickyClassName,W=Wt.container,Q=b==null?void 0:b(U),fe=(zt||mn)&&E.exports.isValidElement(Q)&&Q.type===r1&&Q.props.fixed,ue,xe,ke;zt&&(xe={overflowY:"scroll",maxHeight:c.y}),dt&&(ue={overflowX:"auto"},zt||(xe={overflowY:"hidden"}),ke={width:(c==null?void 0:c.x)===!0?"auto":c==null?void 0:c.x,minWidth:"100%"});var we=E.exports.useCallback(function(Vn,er){fT(Ot.current)&&yn(function(zr){if(zr.get(Vn)!==er){var Fi=new Map(zr);return Fi.set(Vn,er),Fi}return zr})},[]),Pe=Rle(null),Le=$e(Pe,2),Ze=Le[0],Xe=Le[1];function Ve(Vn,er){!er||(typeof er=="function"?er(Vn):er.scrollLeft!==Vn&&(er.scrollLeft=Vn))}var Bt=function(er){var zr=er.currentTarget,Fi=er.scrollLeft,As=p==="rtl",Ho=typeof Fi=="number"?Fi:zr.scrollLeft,dl=zr||Kle;if(!Xe()||Xe()===dl){var us;Ze(dl),Ve(Ho,Lt.current),Ve(Ho,Ht.current),Ve(Ho,Ye.current),Ve(Ho,(us=$t.current)===null||us===void 0?void 0:us.setScrollLeft)}if(zr){var Cr=zr.scrollWidth,cs=zr.clientWidth;if(Cr===cs){Vt(!1),tt(!1);return}As?(Vt(-Ho0)):(Vt(Ho>0),tt(Ho-1}var mue=pue,gue=a1;function vue(e,t){var n=this.__data__,r=gue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var yue=vue,xue=tue,bue=uue,_ue=fue,wue=mue,Cue=yue;function Uh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ta))return!1;var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var g=-1,v=!0,b=n&jde?new $de:void 0;for(o.set(e,t),o.set(t,e);++g-1&&e%1==0&&e-1&&e%1==0&&e<=Yfe}var _V=Qfe,Jfe=av,ehe=_V,the=sv,nhe="[object Arguments]",rhe="[object Array]",ihe="[object Boolean]",ohe="[object Date]",ahe="[object Error]",she="[object Function]",lhe="[object Map]",uhe="[object Number]",che="[object Object]",dhe="[object RegExp]",fhe="[object Set]",hhe="[object String]",phe="[object WeakMap]",mhe="[object ArrayBuffer]",ghe="[object DataView]",vhe="[object Float32Array]",yhe="[object Float64Array]",xhe="[object Int8Array]",bhe="[object Int16Array]",_he="[object Int32Array]",whe="[object Uint8Array]",Che="[object Uint8ClampedArray]",She="[object Uint16Array]",Ehe="[object Uint32Array]",Jr={};Jr[vhe]=Jr[yhe]=Jr[xhe]=Jr[bhe]=Jr[_he]=Jr[whe]=Jr[Che]=Jr[She]=Jr[Ehe]=!0;Jr[nhe]=Jr[rhe]=Jr[mhe]=Jr[ihe]=Jr[ghe]=Jr[ohe]=Jr[ahe]=Jr[she]=Jr[lhe]=Jr[uhe]=Jr[che]=Jr[dhe]=Jr[fhe]=Jr[hhe]=Jr[phe]=!1;function Phe(e){return the(e)&&ehe(e.length)&&!!Jr[Jfe(e)]}var The=Phe;function Ihe(e){return function(t){return e(t)}}var khe=Ihe,K4={exports:{}};(function(e,t){var n=i8,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=a})(K4,K4.exports);var Mhe=The,Rhe=khe,PO=K4.exports,TO=PO&&PO.isTypedArray,Dhe=TO?Rhe(TO):Mhe,wV=Dhe,Ohe=Afe,Ahe=Hfe,Nhe=RT,Lhe=Eb.exports,Fhe=Xfe,zhe=wV,$he=Object.prototype,Bhe=$he.hasOwnProperty;function Vhe(e,t){var n=Nhe(e),r=!n&&Ahe(e),i=!n&&!r&&Lhe(e),o=!n&&!r&&!i&&zhe(e),s=n||r||i||o,a=s?Ohe(e.length,String):[],c=a.length;for(var f in e)(t||Bhe.call(e,f))&&!(s&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Fhe(f,c)))&&a.push(f);return a}var Uhe=Vhe,jhe=Object.prototype;function Hhe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||jhe;return e===n}var Khe=Hhe;function Whe(e,t){return function(n){return e(t(n))}}var Ghe=Whe,qhe=Ghe,Zhe=qhe(Object.keys,Object),Xhe=Zhe,Yhe=Khe,Qhe=Xhe,Jhe=Object.prototype,epe=Jhe.hasOwnProperty;function tpe(e){if(!Yhe(e))return Qhe(e);var t=[];for(var n in Object(e))epe.call(e,n)&&n!="constructor"&&t.push(n);return t}var npe=tpe,rpe=gV,ipe=_V;function ope(e){return e!=null&&ipe(e.length)&&!rpe(e)}var ape=ope,spe=Uhe,lpe=npe,upe=ape;function cpe(e){return upe(e)?spe(e):lpe(e)}var dpe=cpe,fpe=wfe,hpe=Dfe,ppe=dpe;function mpe(e){return fpe(e,ppe,hpe)}var gpe=mpe,IO=gpe,vpe=1,ype=Object.prototype,xpe=ype.hasOwnProperty;function bpe(e,t,n,r,i,o){var s=n&vpe,a=IO(e),c=a.length,f=IO(t),p=f.length;if(c!=p&&!s)return!1;for(var g=c;g--;){var v=a[g];if(!(s?v in t:xpe.call(t,v)))return!1}var b=o.get(e),_=o.get(t);if(b&&_)return b==t&&_==e;var T=!0;o.set(e,t),o.set(t,e);for(var I=s;++g0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function i(o,s){var a=new Map;o.forEach(function(f){a.set(f,!0)});var c=s.filter(function(f){return!a.has(f)});return c.length===1?c[0]:null}return n ").concat(t);return t}var IV=E.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.data;e.selectable,e.checkable;var i=e.expandedKeys,o=e.selectedKeys,s=e.checkedKeys,a=e.loadedKeys,c=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,g=e.disabled,v=e.dragging,b=e.dragOverNodeKey,_=e.dropPosition,T=e.motion,I=e.height,P=e.itemHeight,M=e.virtual,O=e.focusable,N=e.activeItem,F=e.focused,$=e.tabIndex,j=e.onKeyDown,U=e.onFocus,q=e.onBlur,Y=e.onActiveChange,te=e.onListChangeStart,Z=e.onListChangeEnd,X=kn(e,ame),J=E.exports.useRef(null),ce=E.exports.useRef(null);E.exports.useImperativeHandle(t,function(){return{scrollTo:function(at){J.current.scrollTo(at)},getIndentWidth:function(){return ce.current.offsetWidth}}});var re=E.exports.useState(i),se=$e(re,2),oe=se[0],he=se[1],Ce=E.exports.useState(r),Se=$e(Ce,2),be=Se[0],Re=Se[1],Ie=E.exports.useState(r),Me=$e(Ie,2),Ae=Me[0],Fe=Me[1],Ke=E.exports.useState([]),Ue=$e(Ke,2),pt=Ue[0],gt=Ue[1],Dt=E.exports.useState(null),qe=$e(Dt,2),Ct=qe[0],ot=qe[1],vt=E.exports.useRef(r);vt.current=r;function yt(){var ut=vt.current;Re(ut),Fe(ut),gt([]),ot(null),Z()}E.exports.useEffect(function(){he(i);var ut=ome(oe,i);if(ut.key!==null)if(ut.add){var at=be.findIndex(function(Ht){var ze=Ht.key;return ze===ut.key}),He=KO(UO(be,r,ut.key),M,I,P),ct=be.slice();ct.splice(at+1,0,HO),Fe(ct),gt(He),ot("show")}else{var bt=r.findIndex(function(Ht){var ze=Ht.key;return ze===ut.key}),Ot=KO(UO(r,be,ut.key),M,I,P),Lt=r.slice();Lt.splice(bt+1,0,HO),Fe(Lt),gt(Ot),ot("hide")}else be!==r&&(Re(r),Fe(r))},[i,r]),E.exports.useEffect(function(){v||yt()},[v]);var Tt=T?Ae:r,et={expandedKeys:i,selectedKeys:o,loadedKeys:a,loadingKeys:c,checkedKeys:s,halfCheckedKeys:f,dragOverNodeKey:b,dropPosition:_,keyEntities:p};return it(nr,{children:[F&&N&&A("span",{style:jO,"aria-live":"assertive",children:lme(N)}),A("div",{children:A("input",{style:jO,disabled:O===!1||g,tabIndex:O!==!1?$:null,onKeyDown:j,onFocus:U,onBlur:q,value:"",onChange:sme,"aria-label":"for screen reader"})}),A("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0},children:A("div",{className:"".concat(n,"-indent"),children:A("div",{ref:ce,className:"".concat(n,"-indent-unit")})})}),A(mT,{...X,data:Tt,itemKey:WO,height:I,fullHeight:!1,virtual:M,itemHeight:P,prefixCls:"".concat(n,"-list"),ref:J,onVisibleChange:function(at,He){var ct=new Set(at),bt=He.filter(function(Ot){return!ct.has(Ot)});bt.some(function(Ot){return WO(Ot)===Dd})&&yt()},children:function(ut){var at=ut.pos,He=Je({},(EV(ut.data),ut.data)),ct=ut.title,bt=ut.key,Ot=ut.isStart,Lt=ut.isEnd,Ht=lv(bt,at);delete He.key,delete He.children;var ze=Wm(Ht,et);return A(ime,{...He,...ze,title:ct,active:!!N&&bt===N.key,pos:at,data:ut.data,isStart:Ot,isEnd:Lt,motion:T,motionNodes:bt===Dd?pt:null,motionType:Ct,onMotionStart:te,onMotionEnd:yt,treeNodeRequiredProps:et,onMouseMove:function(){Y(null)}})}})]})});IV.displayName="NodeList";function ume(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,i={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:i.top=0,i.left=-n*r;break;case 1:i.bottom=0,i.left=-n*r;break;case 0:i.bottom=0,i.left=r;break}return A("div",{style:i})}var cme=10,c1=function(e){si(n,e);var t=li(n);function n(){var r;jr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,g=r.state,v=g.dragChildrenKeys,b=g.dropPosition,_=g.dropTargetKey,T=g.dropTargetPos,I=g.dropAllowed;if(!!I){var P=r.props.onDrop;if(r.setState({dragOverNodeKey:null}),r.cleanDragState(),_!==null){var M=me(me({},Wm(_,r.getTreeNodeRequiredProps())),{},{active:((f=r.getActiveItem())===null||f===void 0?void 0:f.key)===_,data:r.state.keyEntities[_].node}),O=v.indexOf(_)!==-1;Lr(!O,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var N=AT(T),F={event:a,node:Oi(M),dragNode:r.dragNode?Oi(r.dragNode.props):null,dragNodesKeys:[r.dragNode.props.eventKey].concat(v),dropToGap:b!==0,dropPosition:b+Number(N[N.length-1])};p||P==null||P(F),r.dragNode=null}}},r.cleanDragState=function(){var a=r.state.draggingNodeKey;a!==null&&r.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),r.dragStartMousePosition=null,r.currentMouseOverDroppableNodeKey=null},r.triggerExpandActionExpand=function(a,c){var f=r.state,p=f.expandedKeys,g=f.flattenNodes,v=c.expanded,b=c.key,_=c.isLeaf;if(!(_||a.shiftKey||a.metaKey||a.ctrlKey)){var T=g.filter(function(P){return P.key===b})[0],I=Oi(me(me({},Wm(b,r.getTreeNodeRequiredProps())),{},{data:T.data}));r.setExpandedKeys(v?Ks(p,b):Tl(p,b)),r.onNodeExpand(a,I)}},r.onNodeClick=function(a,c){var f=r.props,p=f.onClick,g=f.expandAction;g==="click"&&r.triggerExpandActionExpand(a,c),p==null||p(a,c)},r.onNodeDoubleClick=function(a,c){var f=r.props,p=f.onDoubleClick,g=f.expandAction;g==="doubleClick"&&r.triggerExpandActionExpand(a,c),p==null||p(a,c)},r.onNodeSelect=function(a,c){var f=r.state.selectedKeys,p=r.state,g=p.keyEntities,v=p.fieldNames,b=r.props,_=b.onSelect,T=b.multiple,I=c.selected,P=c[v.key],M=!I;M?T?f=Tl(f,P):f=[P]:f=Ks(f,P);var O=f.map(function(N){var F=g[N];return F?F.node:null}).filter(function(N){return N});r.setUncontrolledState({selectedKeys:f}),_==null||_(f,{event:"select",selected:M,node:c,selectedNodes:O,nativeEvent:a.nativeEvent})},r.onNodeCheck=function(a,c,f){var p=r.state,g=p.keyEntities,v=p.checkedKeys,b=p.halfCheckedKeys,_=r.props,T=_.checkStrictly,I=_.onCheck,P=c.key,M,O={event:"check",node:c,checked:f,nativeEvent:a.nativeEvent};if(T){var N=f?Tl(v,P):Ks(v,P),F=Ks(b,P);M={checked:N,halfChecked:F},O.checkedNodes=N.map(function(te){return g[te]}).filter(function(te){return te}).map(function(te){return te.node}),r.setUncontrolledState({checkedKeys:N})}else{var $=jl([].concat(Mt(v),[P]),!0,g),j=$.checkedKeys,U=$.halfCheckedKeys;if(!f){var q=new Set(j);q.delete(P);var Y=jl(Array.from(q),{checked:!1,halfCheckedKeys:U},g);j=Y.checkedKeys,U=Y.halfCheckedKeys}M=j,O.checkedNodes=[],O.checkedNodesPositions=[],O.halfCheckedKeys=U,j.forEach(function(te){var Z=g[te];if(!!Z){var X=Z.node,J=Z.pos;O.checkedNodes.push(X),O.checkedNodesPositions.push({node:X,pos:J})}}),r.setUncontrolledState({checkedKeys:j},!1,{halfCheckedKeys:U})}I==null||I(M,O)},r.onNodeLoad=function(a){var c=a.key,f=new Promise(function(p,g){r.setState(function(v){var b=v.loadedKeys,_=b===void 0?[]:b,T=v.loadingKeys,I=T===void 0?[]:T,P=r.props,M=P.loadData,O=P.onLoad;if(!M||_.indexOf(c)!==-1||I.indexOf(c)!==-1)return null;var N=M(a);return N.then(function(){var F=r.state.loadedKeys,$=Tl(F,c);O==null||O($,{event:"load",node:a}),r.setUncontrolledState({loadedKeys:$}),r.setState(function(j){return{loadingKeys:Ks(j.loadingKeys,c)}}),p()}).catch(function(F){if(r.setState(function(j){return{loadingKeys:Ks(j.loadingKeys,c)}}),r.loadingRetryTimes[c]=(r.loadingRetryTimes[c]||0)+1,r.loadingRetryTimes[c]>=cme){var $=r.state.loadedKeys;Lr(!1,"Retry for `loadData` many times but still failed. No more retry."),r.setUncontrolledState({loadedKeys:Tl($,c)}),p()}g(F)}),{loadingKeys:Tl(I,c)}})});return f.catch(function(){}),f},r.onNodeMouseEnter=function(a,c){var f=r.props.onMouseEnter;f==null||f({event:a,node:c})},r.onNodeMouseLeave=function(a,c){var f=r.props.onMouseLeave;f==null||f({event:a,node:c})},r.onNodeContextMenu=function(a,c){var f=r.props.onRightClick;f&&(a.preventDefault(),f({event:a,node:c}))},r.onFocus=function(){var a=r.props.onFocus;r.setState({focused:!0});for(var c=arguments.length,f=new Array(c),p=0;p1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!r.destroyed){var p=!1,g=!0,v={};Object.keys(a).forEach(function(b){if(b in r.props){g=!1;return}p=!0,v[b]=a[b]}),p&&(!c||g)&&r.setState(me(me({},v),f))}},r.scrollTo=function(a){r.listRef.current.scrollTo(a)},r}return Hr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var i=this.props.activeKey;i!==void 0&&i!==this.state.activeKey&&(this.setState({activeKey:i}),i!==null&&this.scrollTo({key:i}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var i,o=this.state,s=o.focused,a=o.flattenNodes,c=o.keyEntities,f=o.draggingNodeKey,p=o.activeKey,g=o.dropLevelOffset,v=o.dropContainerKey,b=o.dropTargetKey,_=o.dropPosition,T=o.dragOverNodeKey,I=o.indent,P=this.props,M=P.prefixCls,O=P.className,N=P.style,F=P.showLine,$=P.focusable,j=P.tabIndex,U=j===void 0?0:j,q=P.selectable,Y=P.showIcon,te=P.icon,Z=P.switcherIcon,X=P.draggable,J=P.checkable,ce=P.checkStrictly,re=P.disabled,se=P.motion,oe=P.loadData,he=P.filterTreeNode,Ce=P.height,Se=P.itemHeight,be=P.virtual,Re=P.titleRender,Ie=P.dropIndicatorRender,Me=P.onContextMenu,Ae=P.onScroll,Fe=P.direction,Ke=P.rootClassName,Ue=P.rootStyle,pt=Zl(this.props,{aria:!0,data:!0}),gt;return X&&(on(X)==="object"?gt=X:typeof X=="function"?gt={nodeDraggable:X}:gt={}),A(OT.Provider,{value:{prefixCls:M,selectable:q,showIcon:Y,icon:te,switcherIcon:Z,draggable:gt,draggingNodeKey:f,checkable:J,checkStrictly:ce,disabled:re,keyEntities:c,dropLevelOffset:g,dropContainerKey:v,dropTargetKey:b,dropPosition:_,dragOverNodeKey:T,indent:I,direction:Fe,dropIndicatorRender:Ie,loadData:oe,filterTreeNode:he,titleRender:Re,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop},children:A("div",{role:"tree",className:je(M,O,Ke,(i={},ae(i,"".concat(M,"-show-line"),F),ae(i,"".concat(M,"-focused"),s),ae(i,"".concat(M,"-active-focused"),p!==null),i)),style:Ue,children:A(IV,{ref:this.listRef,prefixCls:M,style:N,data:a,disabled:re,selectable:q,checkable:!!J,motion:se,dragging:f!==null,height:Ce,itemHeight:Se,virtual:be,focusable:$,focused:s,tabIndex:U,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Me,onScroll:Ae,...this.getTreeNodeRequiredProps(),...pt})})})}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a={prevProps:i};function c($){return!s&&$ in i||s&&s[$]!==i[$]}var f,p=o.fieldNames;if(c("fieldNames")&&(p=bb(i.fieldNames),a.fieldNames=p),c("treeData")?f=i.treeData:c("children")&&(Lr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),f=d8(i.children)),f){a.treeData=f;var g=J_(f,{fieldNames:p});a.keyEntities=me(ae({},Dd,TV),g.keyEntities)}var v=a.keyEntities||o.keyEntities;if(c("expandedKeys")||s&&c("autoExpandParent"))a.expandedKeys=i.autoExpandParent||!s&&i.defaultExpandParent?F4(i.expandedKeys,v):i.expandedKeys;else if(!s&&i.defaultExpandAll){var b=me({},v);delete b[Dd],a.expandedKeys=Object.keys(b).map(function($){return b[$].key})}else!s&&i.defaultExpandedKeys&&(a.expandedKeys=i.autoExpandParent||i.defaultExpandParent?F4(i.defaultExpandedKeys,v):i.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,f||a.expandedKeys){var _=UC(f||o.treeData,a.expandedKeys||o.expandedKeys,p);a.flattenNodes=_}if(i.selectable&&(c("selectedKeys")?a.selectedKeys=$D(i.selectedKeys,i):!s&&i.defaultSelectedKeys&&(a.selectedKeys=$D(i.defaultSelectedKeys,i))),i.checkable){var T;if(c("checkedKeys")?T=VC(i.checkedKeys)||{}:!s&&i.defaultCheckedKeys?T=VC(i.defaultCheckedKeys)||{}:f&&(T=VC(i.checkedKeys)||{checkedKeys:o.checkedKeys,halfCheckedKeys:o.halfCheckedKeys}),T){var I=T,P=I.checkedKeys,M=P===void 0?[]:P,O=I.halfCheckedKeys,N=O===void 0?[]:O;if(!i.checkStrictly){var F=jl(M,!0,v);M=F.checkedKeys,N=F.halfCheckedKeys}a.checkedKeys=M,a.halfCheckedKeys=N}}return c("loadedKeys")&&(a.loadedKeys=i.loadedKeys),a}}]),n}(E.exports.Component);c1.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:ume,allowDrop:function(){return!0},expandAction:!1};c1.TreeNode=Rd;var dme={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const fme=dme;var kV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:fme})})};kV.displayName="HolderOutlined";const hme=E.exports.forwardRef(kV);var GO=4;function pme(e){var t,n=e.dropPosition,r=e.dropLevelOffset,i=e.prefixCls,o=e.indent,s=e.direction,a=s===void 0?"ltr":s,c=a==="ltr"?"left":"right",f=a==="ltr"?"right":"left",p=(t={},ae(t,c,-r*o+GO),ae(t,f,0),t);switch(n){case-1:p.top=-3;break;case 1:p.bottom=-3;break;default:p.bottom=-3,p[c]=o+GO;break}return A("div",{style:p,className:"".concat(i,"-drop-indicator")})}var mme={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const gme=mme;var MV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:gme})})};MV.displayName="CaretDownFilled";const vme=E.exports.forwardRef(MV);var yme={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const xme=yme;var RV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:xme})})};RV.displayName="FileOutlined";const DV=E.exports.forwardRef(RV);var bme={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const _me=bme;var OV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:_me})})};OV.displayName="MinusSquareOutlined";const wme=E.exports.forwardRef(OV);var Cme={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const Sme=Cme;var AV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Sme})})};AV.displayName="PlusSquareOutlined";const Eme=E.exports.forwardRef(AV);function NV(e,t,n,r){var i=r.isLeaf,o=r.expanded,s=r.loading;if(s)return A(kd,{className:"".concat(e,"-switcher-loading-icon")});var a;if(n&&on(n)==="object"&&(a=n.showLeafIcon),i){if(!n)return null;if(typeof a!="boolean"&&!!a){var c=typeof a=="function"?a(r):a,f="".concat(e,"-switcher-line-custom-icon");return Ta(c)?Pi(c,{className:je(c.props.className||"",f)}):c}return a?A(DV,{className:"".concat(e,"-switcher-line-icon")}):A("span",{className:"".concat(e,"-switcher-leaf-line")})}var p="".concat(e,"-switcher-icon"),g=typeof t=="function"?t(r):t;return Ta(g)?Pi(g,{className:je(g.props.className||"",p)}):g||(n?o?A(wme,{className:"".concat(e,"-switcher-line-icon")}):A(Eme,{className:"".concat(e,"-switcher-line-icon")}):A(vme,{className:p}))}var Pme=E.exports.forwardRef(function(e,t){var n,r=E.exports.useContext(Fn),i=r.getPrefixCls,o=r.direction,s=r.virtual,a=e.prefixCls,c=e.className,f=e.showIcon,p=f===void 0?!1:f,g=e.showLine,v=e.switcherIcon,b=e.blockNode,_=b===void 0?!1:b,T=e.children,I=e.checkable,P=I===void 0?!1:I,M=e.selectable,O=M===void 0?!0:M,N=e.draggable,F=e.motion,$=F===void 0?Je(Je({},U_),{motionAppear:!1}):F,j=i("tree",a),U=Je(Je({},e),{checkable:P,selectable:O,showIcon:p,motion:$,blockNode:_,showLine:Boolean(g),dropIndicatorRender:pme}),q=E.exports.useMemo(function(){if(!N)return!1;var Y={};switch(on(N)){case"function":Y.nodeDraggable=N;break;case"object":Y=Je({},N);break}return Y.icon!==!1&&(Y.icon=Y.icon||A(hme,{})),Y},[N]);return A(c1,{itemHeight:20,ref:t,virtual:s,...U,prefixCls:j,className:je((n={},ae(n,"".concat(j,"-icon-hide"),!p),ae(n,"".concat(j,"-block-node"),_),ae(n,"".concat(j,"-unselectable"),!O),ae(n,"".concat(j,"-rtl"),o==="rtl"),n),c),direction:o,checkable:P&&A("span",{className:"".concat(j,"-checkbox-inner")}),selectable:O,switcherIcon:function(te){return NV(j,v,g,te)},draggable:q,children:T})});const LV=Pme;var Tme={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const Ime=Tme;var FV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Ime})})};FV.displayName="FolderOpenOutlined";const kme=E.exports.forwardRef(FV);var Mme={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const Rme=Mme;var zV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Rme})})};zV.displayName="FolderOutlined";const Dme=E.exports.forwardRef(zV);var Rl;(function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"})(Rl||(Rl={}));function WT(e,t){function n(r){var i=r.key,o=r.children;t(i,r)!==!1&&WT(o||[],t)}e.forEach(n)}function Ome(e){var t=e.treeData,n=e.expandedKeys,r=e.startKey,i=e.endKey,o=[],s=Rl.None;if(r&&r===i)return[r];if(!r||!i)return[];function a(c){return c===r||c===i}return WT(t,function(c){if(s===Rl.End)return!1;if(a(c)){if(o.push(c),s===Rl.None)s=Rl.Start;else if(s===Rl.Start)return s=Rl.End,!1}else s===Rl.Start&&o.push(c);return n.includes(c)}),o}function JC(e,t){var n=Mt(t),r=[];return WT(e,function(i,o){var s=n.indexOf(i);return s!==-1&&(r.push(o),n.splice(s,1)),!!n.length}),r}var qO=globalThis&&globalThis.__rest||function(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);i0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1},Zt=Ye.confirm,an=Ye.closeDropdown;Zt&>([]),an&&Z(!1),Ue(""),oe(F?($||[]).map(function(Kt){return String(Kt)}):[])},Ct=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0},Zt=Ye.closeDropdown;Zt&&Z(!1),gt(se())},ot=function(Ye){Ye&&J!==void 0&&oe(J||[]),Z(Ye),!Ye&&!i.filterDropdown&&Dt()},vt=je(ae({},"".concat(o,"-menu-without-submenu"),!jme(i.filters||[]))),yt=function(Ye){if(Ye.target.checked){var Zt=ih(i==null?void 0:i.filters).map(function(an){return String(an)});oe(Zt)}else oe([])},Tt=function ze(Ye){var Zt=Ye.filters;return(Zt||[]).map(function(an,Kt){var Vt=String(an.value),It={title:an.text,key:an.value!==void 0?Vt:Kt};return an.children&&(It.children=ze({filters:an.children})),It})},et=function ze(Ye){var Zt;return Je(Je({},Ye),{text:Ye.title,value:Ye.key,children:((Zt=Ye.children)===null||Zt===void 0?void 0:Zt.map(function(an){return ze(an)}))||[]})},ut;if(typeof i.filterDropdown=="function")ut=i.filterDropdown({prefixCls:"".concat(o,"-custom"),setSelectedKeys:function(Ye){return he({selectedKeys:Ye})},selectedKeys:se(),confirm:Ct,clearFilters:qe,filters:i.filters,visible:X,close:function(){Z(!1)}});else if(i.filterDropdown)ut=i.filterDropdown;else{var at=se()||[],He=function(){return(i.filters||[]).length===0?A(Ys,{image:Ys.PRESENTED_IMAGE_SIMPLE,description:_.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):f==="tree"?it(nr,{children:[A(XO,{filterSearch:g,value:Ke,onChange:pt,tablePrefixCls:n,locale:_}),it("div",{className:"".concat(n,"-filter-dropdown-tree"),children:[a?A(xh,{checked:at.length===ih(i.filters).length,indeterminate:at.length>0&&at.length0?o:e}),v=Math.ceil((o||e)/g.pageSize);g.current>v&&(g.current=v||1);var b=function(I,P){p({current:I!=null?I:1,pageSize:P||g.pageSize})},_=function(I,P){var M;t&&((M=t.onChange)===null||M===void 0||M.call(t,I,P)),b(I,P),n(I,P||(g==null?void 0:g.pageSize))};return t===!1?[{},function(){}]:[Je(Je({},g),{onChange:_}),b]}var Eu={},J4="SELECT_ALL",eE="SELECT_INVERT",tE="SELECT_NONE",JO=[];function jV(e,t){var n=[];return(e||[]).forEach(function(r){n.push(r),r&&on(r)==="object"&&t in r&&(n=[].concat(Mt(n),Mt(jV(r[t],t))))}),n}function Yme(e,t){var n=e||{},r=n.preserveSelectedRowKeys,i=n.selectedRowKeys,o=n.defaultSelectedRowKeys,s=n.getCheckboxProps,a=n.onChange,c=n.onSelect,f=n.onSelectAll,p=n.onSelectInvert,g=n.onSelectNone,v=n.onSelectMultiple,b=n.columnWidth,_=n.type,T=n.selections,I=n.fixed,P=n.renderCell,M=n.hideSelectAll,O=n.checkStrictly,N=O===void 0?!0:O,F=t.prefixCls,$=t.data,j=t.pageData,U=t.getRecordByKey,q=t.getRowKey,Y=t.expandType,te=t.childrenColumnName,Z=t.locale,X=t.getPopupContainer,J=Ei(i||o||JO,{value:i}),ce=$e(J,2),re=ce[0],se=ce[1],oe=E.exports.useRef(new Map),he=E.exports.useCallback(function(et){if(r){var ut=new Map;et.forEach(function(at){var He=U(at);!He&&oe.current.has(at)&&(He=oe.current.get(at)),ut.set(at,He)}),oe.current=ut}},[U,r]);E.exports.useEffect(function(){he(re)},[re]);var Ce=E.exports.useMemo(function(){return N?{keyEntities:null}:J_($,{externalGetKey:q,childrenPropName:te})},[$,q,N,te]),Se=Ce.keyEntities,be=E.exports.useMemo(function(){return jV(j,te)},[j,te]),Re=E.exports.useMemo(function(){var et=new Map;return be.forEach(function(ut,at){var He=q(ut,at),ct=(s?s(ut):null)||{};et.set(He,ct)}),et},[be,q,s]),Ie=E.exports.useCallback(function(et){var ut;return!!(!((ut=Re.get(q(et)))===null||ut===void 0)&&ut.disabled)},[Re,q]),Me=E.exports.useMemo(function(){if(N)return[re||[],[]];var et=jl(re,!0,Se,Ie),ut=et.checkedKeys,at=et.halfCheckedKeys;return[ut||[],at]},[re,N,Se,Ie]),Ae=$e(Me,2),Fe=Ae[0],Ke=Ae[1],Ue=E.exports.useMemo(function(){var et=_==="radio"?Fe.slice(0,1):Fe;return new Set(et)},[Fe,_]),pt=E.exports.useMemo(function(){return _==="radio"?new Set:new Set(Ke)},[Ke,_]),gt=E.exports.useState(null),Dt=$e(gt,2),qe=Dt[0],Ct=Dt[1];E.exports.useEffect(function(){e||se(JO)},[!!e]);var ot=E.exports.useCallback(function(et,ut){var at,He;he(et),r?(at=et,He=et.map(function(ct){return oe.current.get(ct)})):(at=[],He=[],et.forEach(function(ct){var bt=U(ct);bt!==void 0&&(at.push(ct),He.push(bt))})),se(at),a==null||a(at,He,{type:ut})},[se,U,a,r]),vt=E.exports.useCallback(function(et,ut,at,He){if(c){var ct=at.map(function(bt){return U(bt)});c(U(et),ut,ct,He)}ot(at,"single")},[c,U,ot]),yt=E.exports.useMemo(function(){if(!T||M)return null;var et=T===!0?[J4,eE,tE]:T;return et.map(function(ut){return ut===J4?{key:"all",text:Z.selectionAll,onSelect:function(){ot($.map(function(He,ct){return q(He,ct)}).filter(function(He){var ct=Re.get(He);return!(ct!=null&&ct.disabled)||Ue.has(He)}),"all")}}:ut===eE?{key:"invert",text:Z.selectInvert,onSelect:function(){var He=new Set(Ue);j.forEach(function(bt,Ot){var Lt=q(bt,Ot),Ht=Re.get(Lt);Ht!=null&&Ht.disabled||(He.has(Lt)?He.delete(Lt):He.add(Lt))});var ct=Array.from(He);p&&p(ct),ot(ct,"invert")}}:ut===tE?{key:"none",text:Z.selectNone,onSelect:function(){g==null||g(),ot(Array.from(Ue).filter(function(He){var ct=Re.get(He);return ct==null?void 0:ct.disabled}),"none")}}:ut}).map(function(ut){return Je(Je({},ut),{onSelect:function(){for(var He,ct,bt=arguments.length,Ot=new Array(bt),Lt=0;Lt2&&arguments[2]!==void 0?arguments[2]:!1,nt=Je(Je({},He),Ve);Et&&(He.resetPagination(),nt.pagination.current&&(nt.pagination.current=1),p&&p.onChange&&p.onChange(1,nt.pagination.pageSize)),Y&&Y.scrollToFirstRowOnChange!==!1&&yt.body.current&&kJ(0,{getContainer:function(){return yt.body.current}}),M==null||M(nt.pagination,nt.filters,nt.sorter,{currentDataSource:QO(rE(Ke,nt.sorterStates,ot),nt.filterStates),action:Bt})},bt=function(Ve,Bt){ct({sorter:Ve,sorterStates:Bt},"sort",!1)},Ot=oge({prefixCls:gt,mergedColumns:oe,onSorterChange:bt,sortDirections:te||["ascend","descend"],tableLocale:Fe,showSorterTooltip:J}),Lt=$e(Ot,4),Ht=Lt[0],ze=Lt[1],Ye=Lt[2],Zt=Lt[3],an=E.exports.useMemo(function(){return rE(Ke,ze,ot)},[Ke,ze]);He.sorter=Zt(),He.sorterStates=ze;var Kt=function(Ve,Bt){ct({filters:Ve,filterStates:Bt},"filter",!0)},Vt=Kme({prefixCls:gt,locale:Fe,dropdownPrefixCls:Dt,mergedColumns:oe,onFilterChange:Kt,getPopupContainer:O}),It=$e(Vt,3),Xt=It[0],pn=It[1],tt=It[2],At=QO(an,pn);He.filters=tt,He.filterStates=pn;var qt=E.exports.useMemo(function(){var Xe={};return Object.keys(tt).forEach(function(Ve){tt[Ve]!==null&&(Xe[Ve]=tt[Ve])}),Je(Je({},Ye),{filters:Xe})},[Ye,tt]),En=age(qt),yn=$e(En,1),St=yn[0],Pn=function(Ve,Bt){ct({pagination:Je(Je({},He.pagination),{current:Ve,pageSize:Bt})},"paginate")},_n=Xme(At.length,p,Pn),tn=$e(_n,2),zt=tn[0],dt=tn[1];He.pagination=p===!1?{}:qme(p,zt),He.resetPagination=dt;var mt=E.exports.useMemo(function(){if(p===!1||!zt.pageSize)return At;var Xe=zt.current,Ve=Xe===void 0?1:Xe,Bt=zt.total,Et=zt.pageSize,nt=Et===void 0?UV:Et;return At.lengthnt?At.slice((Ve-1)*nt,Ve*nt):At:At.slice((Ve-1)*nt,Ve*nt)},[!!p,At,zt&&zt.current,zt&&zt.pageSize,zt&&zt.total]),$t=Yme(g,{prefixCls:gt,data:At,pageData:mt,getRowKey:Tt,getRecordByKey:at,expandType:vt,childrenColumnName:ot,locale:Fe,getPopupContainer:O}),Wt=$e($t,2),mn=Wt[0],An=Wt[1],Qn=function(Ve,Bt,Et){var nt;return typeof _=="function"?nt=je(_(Ve,Bt,Et)):nt=je(_),je(ae({},"".concat(gt,"-row-selected"),An.has(Tt(Ve,Bt))),nt)};qe.__PARENT_RENDER_ICON__=qe.expandIcon,qe.expandIcon=qe.expandIcon||F||Zle(Fe),vt==="nest"&&qe.expandIconColumnIndex===void 0?qe.expandIconColumnIndex=g?1:0:qe.expandIconColumnIndex>0&&g&&(qe.expandIconColumnIndex-=1),typeof qe.indentSize!="number"&&(qe.indentSize=typeof q=="number"?q:15);var Jn=E.exports.useCallback(function(Xe){return St(mn(Xt(Ht(Xe))))},[Ht,Xt,mn]),ye,W;if(p!==!1&&(zt==null?void 0:zt.total)){var Q;zt.size?Q=zt.size:Q=Ae==="small"||Ae==="middle"?"small":void 0;var fe=function(Ve){return A(tse,{...zt,className:je("".concat(gt,"-pagination ").concat(gt,"-pagination-").concat(Ve),zt.className),size:Q})},ue=Me==="rtl"?"left":"right",xe=zt.position;if(xe!==null&&Array.isArray(xe)){var ke=xe.find(function(Xe){return Xe.includes("top")}),we=xe.find(function(Xe){return Xe.includes("bottom")}),Pe=xe.every(function(Xe){return"".concat(Xe)==="none"});!ke&&!we&&!Pe&&(W=fe(ue)),ke&&(ye=fe(ke.toLowerCase().replace("top",""))),we&&(W=fe(we.toLowerCase().replace("bottom","")))}else W=fe(ue)}var Le;typeof N=="boolean"?Le={spinning:N}:on(N)==="object"&&(Le=Je({spinning:!0},N));var Ze=je("".concat(gt,"-wrapper"),ae({},"".concat(gt,"-wrapper-rtl"),Me==="rtl"),i);return A("div",{ref:t,className:Ze,style:o,children:it(dv,{spinning:!1,...Le,children:[ye,A(Hd,{...he,columns:oe,direction:Me,expandable:qe,prefixCls:gt,className:je((n={},ae(n,"".concat(gt,"-middle"),Ae==="middle"),ae(n,"".concat(gt,"-small"),Ae==="small"),ae(n,"".concat(gt,"-bordered"),a),ae(n,"".concat(gt,"-empty"),Ke.length===0),n)),data:mt,rowKey:Tt,rowClassName:Qn,emptyText:Z&&Z.emptyText||(Ie||yT)("Table"),internalHooks:hx,internalRefs:yt,transformColumns:Jn}),W]})})}var uge=E.exports.forwardRef(lge),eu=uge;eu.SELECTION_COLUMN=Eu;eu.EXPAND_COLUMN=Hd.EXPAND_COLUMN;eu.SELECTION_ALL=J4;eu.SELECTION_INVERT=eE;eu.SELECTION_NONE=tE;eu.Column=Gle;eu.ColumnGroup=qle;eu.Summary=hV;const cge=eu;var dge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const fge=dge;var qV=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:fge})})};qV.displayName="DeleteOutlined";const hge=E.exports.forwardRef(qV);var ZV=E.exports.createContext(null),XV=E.exports.createContext(null);function pge(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function mge(e){var t=e||{},n=t.label,r=t.value,i=t.children,o=r||"value";return{_title:n?[n]:["title","label"],value:o,key:o,children:i||"children"}}function iE(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function gge(e,t){var n=[];function r(i){i.forEach(function(o){var s=o[t.children];s&&(n.push(o[t.value]),r(s))})}return r(e),n}function rA(e){return e==null}var vge={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},yge=function(t,n){var r=L$(),i=r.prefixCls,o=r.multiple,s=r.searchValue,a=r.toggleOpen,c=r.open,f=r.notFoundContent,p=E.exports.useContext(XV),g=p.virtual,v=p.listHeight,b=p.listItemHeight,_=p.treeData,T=p.fieldNames,I=p.onSelect,P=p.dropdownMatchSelectWidth,M=p.treeExpandAction,O=E.exports.useContext(ZV),N=O.checkable,F=O.checkedKeys,$=O.halfCheckedKeys,j=O.treeExpandedKeys,U=O.treeDefaultExpandAll,q=O.treeDefaultExpandedKeys,Y=O.onTreeExpand,te=O.treeIcon,Z=O.showTreeIcon,X=O.switcherIcon,J=O.treeLine,ce=O.treeNodeFilterProp,re=O.loadData,se=O.treeLoadedKeys,oe=O.treeMotion,he=O.onTreeLoad,Ce=O.keyEntities,Se=E.exports.useRef(),be=Yg(function(){return _},[c,_],function(bt,Ot){return Ot[0]&&bt[1]!==Ot[1]}),Re=E.exports.useMemo(function(){return N?{checked:F,halfChecked:$}:null},[N,F,$]);E.exports.useEffect(function(){if(c&&!o&&F.length){var bt;(bt=Se.current)===null||bt===void 0||bt.scrollTo({key:F[0]})}},[c]);var Ie=String(s).toLowerCase(),Me=function(Ot){return Ie?String(Ot[ce]).toLowerCase().includes(Ie):!1},Ae=E.exports.useState(q),Fe=$e(Ae,2),Ke=Fe[0],Ue=Fe[1],pt=E.exports.useState(null),gt=$e(pt,2),Dt=gt[0],qe=gt[1],Ct=E.exports.useMemo(function(){return j?Mt(j):s?Dt:Ke},[Ke,Dt,j,s]);E.exports.useEffect(function(){s&&qe(gge(_,T))},[s]);var ot=function(Ot){Ue(Ot),qe(Ot),Y&&Y(Ot)},vt=function(Ot){Ot.preventDefault()},yt=function(Ot,Lt){var Ht=Lt.node;N&&iE(Ht)||(I(Ht.key,{selected:!F.includes(Ht.key)}),o||a(!1))},Tt=E.exports.useState(null),et=$e(Tt,2),ut=et[0],at=et[1],He=Ce[ut];if(E.exports.useImperativeHandle(n,function(){var bt;return{scrollTo:(bt=Se.current)===null||bt===void 0?void 0:bt.scrollTo,onKeyDown:function(Lt){var Ht,ze=Lt.which;switch(ze){case Pt.UP:case Pt.DOWN:case Pt.LEFT:case Pt.RIGHT:(Ht=Se.current)===null||Ht===void 0||Ht.onKeyDown(Lt);break;case Pt.ENTER:{if(He){var Ye=(He==null?void 0:He.node)||{},Zt=Ye.selectable,an=Ye.value;Zt!==!1&&yt(null,{node:{key:ut},selected:!F.includes(an)})}break}case Pt.ESC:a(!1)}},onKeyUp:function(){}}}),be.length===0)return A("div",{role:"listbox",className:"".concat(i,"-empty"),onMouseDown:vt,children:f});var ct={fieldNames:T};return se&&(ct.loadedKeys=se),Ct&&(ct.expandedKeys=Ct),it("div",{onMouseDown:vt,children:[He&&c&&A("span",{style:vge,"aria-live":"assertive",children:He.node.value}),A(c1,{ref:Se,focusable:!1,prefixCls:"".concat(i,"-tree"),treeData:be,height:v,itemHeight:b,virtual:g!==!1&&P!==!1,multiple:o,icon:te,showIcon:Z,switcherIcon:X,showLine:J,loadData:s?null:re,motion:oe,activeKey:ut,checkable:N,checkStrictly:!0,checkedKeys:Re,selectedKeys:N?[]:F,defaultExpandAll:U,...ct,onActiveChange:at,onSelect:yt,onCheck:yt,onExpand:ot,onLoad:he,filterTreeNode:Me,expandAction:M})]})},YV=E.exports.forwardRef(yge);YV.displayName="OptionList";var qT=function(){return null},QV="SHOW_ALL",ZT="SHOW_PARENT",d1="SHOW_CHILD";function iA(e,t,n,r){var i=new Set(e);return t===d1?e.filter(function(o){var s=n[o];return!(s&&s.children&&s.children.some(function(a){var c=a.node;return i.has(c[r.value])})&&s.children.every(function(a){var c=a.node;return iE(c)||i.has(c[r.value])}))}):t===ZT?e.filter(function(o){var s=n[o],a=s?s.parent:null;return!(a&&!iE(a.node)&&i.has(a.key))}):e}var xge=["children","value"];function JV(e){return Po(e).map(function(t){if(!E.exports.isValidElement(t)||!t.type)return null;var n=t,r=n.key,i=n.props,o=i.children,s=i.value,a=kn(i,xge),c=me({key:r,value:s},a),f=JV(o);return f.length&&(c.children=f),c}).filter(function(t){return t})}function oE(e){if(!e)return e;var t=me({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Lr(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function bge(e,t,n,r,i,o){var s=null,a=null;function c(){function f(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return p.map(function(b,_){var T="".concat(g,"-").concat(_),I=b[o.value],P=n.includes(I),M=f(b[o.children]||[],T,P),O=A(qT,{...b,children:M.map(function(F){return F.node})});if(t===I&&(s=O),P){var N={pos:T,node:O,children:M};return v||a.push(N),N}return null}).filter(function(b){return b})}a||(a=[],f(r),a.sort(function(p,g){var v=p.node.props.value,b=g.node.props.value,_=n.indexOf(v),T=n.indexOf(b);return _-T}))}Object.defineProperty(e,"triggerNode",{get:function(){return Lr(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),c(),s}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Lr(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),c(),i?a:a.map(function(p){var g=p.node;return g})}})}function _ge(e,t){var n=t.id,r=t.pId,i=t.rootPId,o={},s=[],a=e.map(function(c){var f=me({},c),p=f[n];return o[p]=f,f.key=f.key||p,f});return a.forEach(function(c){var f=c[r],p=o[f];p&&(p.children=p.children||[],p.children.push(c)),(f===i||!p&&i===null)&&s.push(c)}),s}function wge(e,t,n){return E.exports.useMemo(function(){return e?n?_ge(e,me({id:"id",pId:"pId",rootPId:null},n!==!0?n:{})):e:JV(t)},[t,n,e])}const Cge=function(e){var t=E.exports.useRef({valueLabels:new Map});return E.exports.useMemo(function(){var n=t.current.valueLabels,r=new Map,i=e.map(function(o){var s,a=o.value,c=(s=o.label)!==null&&s!==void 0?s:n.get(a);return r.set(a,c),me(me({},o),{},{label:c})});return t.current.valueLabels=r,[i]},[e])};function oA(e){var t=E.exports.useRef();t.current=e;var n=E.exports.useCallback(function(){return t.current.apply(t,arguments)},[]);return n}const Sge=function(e,t){return E.exports.useMemo(function(){var n=J_(e,{fieldNames:t,initWrapper:function(i){return me(me({},i),{},{valueEntities:new Map})},processEntity:function(i,o){var s=i.node[t.value];o.valueEntities.set(s,i)}});return n},[e,t])},Ege=function(e,t,n,r){return E.exports.useMemo(function(){var i=e.map(function(c){var f=c.value;return f}),o=t.map(function(c){var f=c.value;return f}),s=i.filter(function(c){return!r[c]});if(n){var a=jl(i,!0,r);i=a.checkedKeys,o=a.halfCheckedKeys}return[Array.from(new Set([].concat(Mt(s),Mt(i)))),o]},[e,t,n,r])},Pge=function(e,t,n){var r=n.treeNodeFilterProp,i=n.filterTreeNode,o=n.fieldNames,s=o.children;return E.exports.useMemo(function(){if(!t||i===!1)return e;var a;if(typeof i=="function")a=i;else{var c=t.toUpperCase();a=function(g,v){var b=v[r];return String(b).toUpperCase().includes(c)}}function f(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return p.map(function(v){var b=v[s],_=g||a(t,oE(v)),T=f(b||[],_);return _||T.length?me(me({},v),{},ae({isLeaf:void 0},s,T)):null}).filter(function(v){return v})}return f(e)},[e,t,s,r,i])};var Tge=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion"];function Ige(e){return!e||on(e)!=="object"}var kge=E.exports.forwardRef(function(e,t){var n=e.id,r=e.prefixCls,i=r===void 0?"rc-tree-select":r,o=e.value,s=e.defaultValue,a=e.onChange,c=e.onSelect,f=e.onDeselect,p=e.searchValue,g=e.inputValue,v=e.onSearch,b=e.autoClearSearchValue,_=b===void 0?!0:b,T=e.filterTreeNode,I=e.treeNodeFilterProp,P=I===void 0?"value":I,M=e.showCheckedStrategy,O=M===void 0?d1:M,N=e.treeNodeLabelProp,F=e.multiple,$=e.treeCheckable,j=e.treeCheckStrictly,U=e.labelInValue,q=e.fieldNames,Y=e.treeDataSimpleMode,te=e.treeData,Z=e.children,X=e.loadData,J=e.treeLoadedKeys,ce=e.onTreeLoad,re=e.treeDefaultExpandAll,se=e.treeExpandedKeys,oe=e.treeDefaultExpandedKeys,he=e.onTreeExpand,Ce=e.treeExpandAction,Se=e.virtual,be=e.listHeight,Re=be===void 0?200:be,Ie=e.listItemHeight,Me=Ie===void 0?20:Ie,Ae=e.onDropdownVisibleChange,Fe=e.dropdownMatchSelectWidth,Ke=Fe===void 0?!0:Fe,Ue=e.treeLine,pt=e.treeIcon,gt=e.showTreeIcon,Dt=e.switcherIcon,qe=e.treeMotion,Ct=kn(e,Tge),ot=aB(n),vt=$&&!j,yt=$||j,Tt=j||U,et=yt||F,ut=Ei(s,{value:o}),at=$e(ut,2),He=at[0],ct=at[1],bt=E.exports.useMemo(function(){return mge(q)},[JSON.stringify(q)]),Ot=Ei("",{value:p!==void 0?p:g,postState:function(xe){return xe||""}}),Lt=$e(Ot,2),Ht=Lt[0],ze=Lt[1],Ye=function(xe){ze(xe),v==null||v(xe)},Zt=wge(te,Z,Y),an=Sge(Zt,bt),Kt=an.keyEntities,Vt=an.valueEntities,It=E.exports.useCallback(function(ue){var xe=[],ke=[];return ue.forEach(function(we){Vt.has(we)?ke.push(we):xe.push(we)}),{missingRawValues:xe,existRawValues:ke}},[Vt]),Xt=Pge(Zt,Ht,{fieldNames:bt,treeNodeFilterProp:P,filterTreeNode:T}),pn=E.exports.useCallback(function(ue){if(ue){if(N)return ue[N];for(var xe=bt._title,ke=0;ke"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var g=aA[t.format]||aA.default;window.clipboardData.setData(g,e)}else p.clipboardData.clearData(),p.clipboardData.setData(t.format,e);t.onCopy&&(p.preventDefault(),t.onCopy(p.clipboardData))}),document.body.appendChild(a),o.selectNodeContents(a),s.addRange(o);var f=document.execCommand("copy");if(!f)throw new Error("copy command was unsuccessful");c=!0}catch(p){n&&console.error("unable to copy using execCommand: ",p),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(g){n&&console.error("unable to copy using clipboardData: ",g),n&&console.error("falling back to prompt"),r=Uge("message"in t?t.message:Vge),window.prompt(r,e)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(o):s.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var Hge=jge,Kge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"};const Wge=Kge;var nU=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:Wge})})};nU.displayName="EnterOutlined";const Gge=E.exports.forwardRef(nU);var qge=function(t){var n=t.prefixCls,r=t["aria-label"],i=t.className,o=t.style,s=t.direction,a=t.maxLength,c=t.autoSize,f=c===void 0?!0:c,p=t.value,g=t.onSave,v=t.onCancel,b=t.onEnd,_=t.component,T=t.enterIcon,I=T===void 0?A(Gge,{}):T,P=E.exports.useRef(null),M=E.exports.useRef(!1),O=E.exports.useRef(),N=E.exports.useState(p),F=$e(N,2),$=F[0],j=F[1];E.exports.useEffect(function(){j(p)},[p]),E.exports.useEffect(function(){if(P.current&&P.current.resizableTextArea){var se=P.current.resizableTextArea.textArea;se.focus();var oe=se.value.length;se.setSelectionRange(oe,oe)}},[]);var U=function(oe){var he=oe.target;j(he.value.replace(/[\n\r]/g,""))},q=function(){M.current=!0},Y=function(){M.current=!1},te=function(oe){var he=oe.keyCode;M.current||(O.current=he)},Z=function(){g($.trim())},X=function(oe){var he=oe.keyCode,Ce=oe.ctrlKey,Se=oe.altKey,be=oe.metaKey,Re=oe.shiftKey;O.current===he&&!M.current&&!Ce&&!Se&&!be&&!Re&&(he===Pt.ENTER?(Z(),b==null||b()):he===Pt.ESC&&v())},J=function(){Z()},ce=_?"".concat(n,"-").concat(_):"",re=je(n,"".concat(n,"-edit-content"),ae({},"".concat(n,"-rtl"),s==="rtl"),i,ce);return it("div",{className:re,style:o,children:[A(O8,{ref:P,maxLength:a,value:$,onChange:U,onKeyDown:te,onKeyUp:X,onCompositionStart:q,onCompositionEnd:Y,onBlur:J,"aria-label":r,rows:1,autoSize:f}),I!==null?Pi(I,{className:"".concat(n,"-edit-content-confirm")}):null]})};const Zge=qge;function tS(e,t){return E.exports.useMemo(function(){var n=!!e;return[n,Je(Je({},t),n&&on(e)==="object"?e:null)]},[e])}var Xge=function(t,n){var r=E.exports.useRef(!1);E.exports.useEffect(function(){r.current?t():r.current=!0},n)};const Yge=Xge;var Qge=globalThis&&globalThis.__rest||function(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);it){var f=t-n;return r.push(String(o).slice(0,f)),r}r.push(o),n=c}return e}var tve=0,y0=1,lA=2,nS=3,uA=4,nve=function(t){var n=t.enabledMeasure,r=t.children,i=t.text,o=t.width,s=t.fontSize,a=t.rows,c=t.onEllipsis,f=E.exports.useState([0,0,0]),p=$e(f,2),g=$e(p[0],3),v=g[0],b=g[1],_=g[2],T=p[1],I=E.exports.useState(tve),P=$e(I,2),M=P[0],O=P[1],N=E.exports.useState(0),F=$e(N,2),$=F[0],j=F[1],U=E.exports.useRef(null),q=E.exports.useRef(null),Y=E.exports.useMemo(function(){return Po(i)},[i]),te=E.exports.useMemo(function(){return eve(Y)},[Y]),Z=E.exports.useMemo(function(){return!n||M!==nS?r(Y,!1):r(sA(Y,b),b1&&dt,mn=function(nt){var Ft;Lt(!0),(Ft=St.onExpand)===null||Ft===void 0||Ft.call(St,nt)},An=E.exports.useState(0),Qn=$e(An,2),Jn=Qn[0],ye=Qn[1],W=E.exports.useState(0),Q=$e(W,2),fe=Q[0],ue=Q[1],xe=function(nt,Ft){var Gt=nt.offsetWidth,wn;ye(Gt),ue(parseInt((wn=window.getComputedStyle)===null||wn===void 0?void 0:wn.call(window,Ft).fontSize,10)||0)},ke=function(nt){var Ft;Zt(nt),Ye!==nt&&((Ft=St.onEllipsis)===null||Ft===void 0||Ft.call(St,nt))};E.exports.useEffect(function(){var Et=F.current;if(yn&&dt&&Et){var nt=Wt?Et.offsetHeight"u"||!Et||!dt||!Pn)){var nt=new IntersectionObserver(function(){At(!!Et.offsetParent)});return nt.observe(Et),function(){nt.disconnect()}}},[dt,Pn]);var we={};St.tooltip===!0?we={title:(n=Z.text)!==null&&n!==void 0?n:p}:E.exports.isValidElement(St.tooltip)?we={title:St.tooltip}:on(St.tooltip)==="object"?we=Je({title:(r=Z.text)!==null&&r!==void 0?r:p},St.tooltip):we={title:St.tooltip};var Pe=E.exports.useMemo(function(){var Et=function(Ft){return["string","number"].includes(on(Ft))};if(!(!yn||dt)){if(Et(Z.text))return Z.text;if(Et(p))return p;if(Et(T))return T;if(Et(we.title))return we.title}},[yn,dt,T,we.title,mt]);if(ce)return A(Zge,{value:(i=Z.text)!==null&&i!==void 0?i:typeof p=="string"?p:"",onSave:Se,onCancel:be,onEnd:Z.onEnd,prefixCls:j,className:s,style:a,direction:O,component:_,maxLength:Z.maxLength,autoSize:Z.autoSize,enterIcon:Z.enterIcon});var Le=function(){var nt=St.expandable,Ft=St.symbol;if(!nt)return null;var Gt;return Ft?Gt=Ft:Gt=N.expand,A("a",{className:"".concat(j,"-expand"),onClick:mn,"aria-label":N.expand,children:Gt},"expand")},Ze=function(){if(!!te){var nt=Z.icon,Ft=Z.tooltip,Gt=Po(Ft)[0]||N.edit,wn=typeof Gt=="string"?Gt:"";return oe.includes("icon")?A(ka,{title:Ft===!1?"":Gt,children:A(cO,{ref:$,className:"".concat(j,"-edit"),onClick:Ce,"aria-label":wn,children:nt||A(zge,{role:"button"})})},"edit"):null}},Xe=function(){if(!!Me){var nt=Ae.tooltips,Ft=Ae.icon,Gt=cA(nt),wn=cA(Ft),dn=Ue?x0(Gt[1],N.copied):x0(Gt[0],N.copy),Cn=Ue?N.copied:N.copy,jn=typeof dn=="string"?dn:Cn;return A(ka,{title:dn,children:A(cO,{className:je("".concat(j,"-copy"),Ue&&"".concat(j,"-copy-success")),onClick:Ct,"aria-label":jn,children:Ue?x0(wn[1],A(xT,{}),!0):x0(wn[0],A(Nge,{}),!0)})},"copy")}},Ve=function(nt){return[nt&&Le(),Ze(),Xe()]},Bt=function(nt){return[nt&&A("span",{"aria-hidden":!0,children:lve},"ellipsis"),St.suffix,Ve(nt)]};return A(Ql,{onResize:xe,disabled:!Pn||dt,children:function(Et){var nt;return A(ove,{tooltipProps:we,enabledEllipsis:Pn,isEllipsis:mt,children:A(rU,{className:je((nt={},ae(nt,"".concat(j,"-").concat(c),c),ae(nt,"".concat(j,"-disabled"),f),ae(nt,"".concat(j,"-ellipsis"),yn),ae(nt,"".concat(j,"-single-line"),Pn&&tn===1),ae(nt,"".concat(j,"-ellipsis-single-line"),$t),ae(nt,"".concat(j,"-ellipsis-multiple-line"),Wt),nt),s),prefixCls:o,style:Je(Je({},a),{WebkitLineClamp:Wt?tn:void 0}),component:_,ref:Aa(Et,F,t),direction:O,onClick:oe.includes("text")?Ce:void 0,"aria-label":Pe==null?void 0:Pe.toString(),title:T,...U,children:A(rve,{enabledMeasure:Pn&&!dt,text:p,rows:tn,width:Jn,fontSize:fe,onEllipsis:ke,children:function(Ft,Gt){var wn=Ft;Ft.length&&Gt&&Pe&&(wn=A("span",{"aria-hidden":!0,children:wn},"show-content"));var dn=sve(e,it(nr,{children:[wn,Bt(Gt)]}));return dn}})})})}})});const h1=uve;var cve=globalThis&&globalThis.__rest||function(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);i0&&(o.percent=o.loaded/o.total*100),e.onProgress(o)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(i){var o=e.data[i];if(Array.isArray(o)){o.forEach(function(s){n.append("".concat(i,"[]"),s)});return}n.append(i,o)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(o){e.onError(o)},t.onload=function(){return t.status<200||t.status>=300?e.onError(Cve(e,t),dA(t)):e.onSuccess(dA(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return r["X-Requested-With"]!==null&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(i){r[i]!==null&&t.setRequestHeader(i,r[i])}),t.send(n),{abort:function(){t.abort()}}}var Eve=+new Date,Pve=0;function rS(){return"rc-upload-".concat(Eve,"-").concat(++Pve)}const iS=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=e.type||"",o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim();if(/^\*(\/\*)?$/.test(s))return!0;if(a.charAt(0)==="."){var c=r.toLowerCase(),f=a.toLowerCase(),p=[f];return(f===".jpg"||f===".jpeg")&&(p=[".jpg",".jpeg"]),p.some(function(g){return c.endsWith(g)})}return/\/\*$/.test(a)?o===a.replace(/\/.*$/,""):i===a?!0:/^\w+$/.test(a)?(Lr(!1,"Upload takes an invalidate 'accept' type '".concat(a,"'.Skip for check.")),!0):!1})}return!0};function Tve(e,t){var n=e.createReader(),r=[];function i(){n.readEntries(function(o){var s=Array.prototype.slice.apply(o);r=r.concat(s);var a=!s.length;a?t(r):i()})}i()}var Ive=function(t,n,r){var i=function o(s,a){s.path=a||"",s.isFile?s.file(function(c){r(c)&&(s.fullPath&&!c.webkitRelativePath&&(Object.defineProperties(c,{webkitRelativePath:{writable:!0}}),c.webkitRelativePath=s.fullPath.replace(/^\//,""),Object.defineProperties(c,{webkitRelativePath:{writable:!1}})),n([c]))}):s.isDirectory&&Tve(s,function(c){c.forEach(function(f){o(f,"".concat(a).concat(s.name,"/"))})})};t.forEach(function(o){i(o.webkitGetAsEntry())})},kve=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],Mve=function(e){si(n,e);var t=li(n);function n(){var r;jr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:"",n=t.split("/"),r=n[n.length-1],i=r.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(i)||[""])[0]},lU=function(t){return t.indexOf("image/")===0},Uve=function(t){if(t.type&&!t.thumbUrl)return lU(t.type);var n=t.thumbUrl||t.url||"",r=Vve(n);return/^data:image\//.test(n)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(r)?!0:!(/^data:/.test(n)||r)},wu=200;function jve(e){return new Promise(function(t){if(!e.type||!lU(e.type)){t("");return}var n=document.createElement("canvas");n.width=wu,n.height=wu,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(wu,"px; height: ").concat(wu,"px; z-index: 9999; display: none;"),document.body.appendChild(n);var r=n.getContext("2d"),i=new Image;if(i.onload=function(){var s=i.width,a=i.height,c=wu,f=wu,p=0,g=0;s>a?(f=a*(wu/s),g=-(f-c)/2):(c=s*(wu/a),p=-(c-f)/2),r.drawImage(i,p,g,c,f);var v=n.toDataURL();document.body.removeChild(n),t(v)},i.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){var o=new FileReader;o.addEventListener("load",function(){o.result&&(i.src=o.result)}),o.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var Hve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};const uU=Hve;var cU=function(t,n){return A(Yn,{...me(me({},t),{},{ref:n,icon:uU})})};cU.displayName="DownloadOutlined";const Kve=E.exports.forwardRef(cU);var Wve=E.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.className,o=e.style,s=e.locale,a=e.listType,c=e.file,f=e.items,p=e.progress,g=e.iconRender,v=e.actionIconRender,b=e.itemRender,_=e.isImgUrl,T=e.showPreviewIcon,I=e.showRemoveIcon,P=e.showDownloadIcon,M=e.previewIcon,O=e.removeIcon,N=e.downloadIcon,F=e.onPreview,$=e.onDownload,j=e.onClose,U,q,Y=c.status,te=E.exports.useState(Y),Z=$e(te,2),X=Z[0],J=Z[1];E.exports.useEffect(function(){Y!=="removed"&&J(Y)},[Y]);var ce=E.exports.useState(!1),re=$e(ce,2),se=re[0],oe=re[1],he=E.exports.useRef(null);E.exports.useEffect(function(){return he.current=setTimeout(function(){oe(!0)},300),function(){he.current&&clearTimeout(he.current)}},[]);var Ce="".concat(r,"-span"),Se=g(c),be=A("div",{className:"".concat(r,"-text-icon"),children:Se});if(a==="picture"||a==="picture-card")if(X==="uploading"||!c.thumbUrl&&!c.url){var Re,Ie=je((Re={},ae(Re,"".concat(r,"-list-item-thumbnail"),!0),ae(Re,"".concat(r,"-list-item-file"),X!=="uploading"),Re));be=A("div",{className:Ie,children:Se})}else{var Me,Ae=_!=null&&_(c)?A("img",{src:c.thumbUrl||c.url,alt:c.name,className:"".concat(r,"-list-item-image"),crossOrigin:c.crossOrigin}):Se,Fe=je((Me={},ae(Me,"".concat(r,"-list-item-thumbnail"),!0),ae(Me,"".concat(r,"-list-item-file"),_&&!_(c)),Me));be=A("a",{className:Fe,onClick:function(Ht){return F(c,Ht)},href:c.url||c.thumbUrl,target:"_blank",rel:"noopener noreferrer",children:Ae})}var Ke=je((n={},ae(n,"".concat(r,"-list-item"),!0),ae(n,"".concat(r,"-list-item-").concat(X),!0),ae(n,"".concat(r,"-list-item-list-type-").concat(a),!0),n)),Ue=typeof c.linkProps=="string"?JSON.parse(c.linkProps):c.linkProps,pt=I?v((typeof O=="function"?O(c):O)||A(hge,{}),function(){return j(c)},r,s.removeFile):null,gt=P&&X==="done"?v((typeof N=="function"?N(c):N)||A(Kve,{}),function(){return $(c)},r,s.downloadFile):null,Dt=a!=="picture-card"&&it("span",{className:je("".concat(r,"-list-item-card-actions"),{picture:a==="picture"}),children:[gt,pt]},"download-delete"),qe=je("".concat(r,"-list-item-name")),Ct=c.url?[A("a",{target:"_blank",rel:"noopener noreferrer",className:qe,title:c.name,...Ue,href:c.url,onClick:function(Ht){return F(c,Ht)},children:c.name},"view"),Dt]:[A("span",{className:qe,onClick:function(Ht){return F(c,Ht)},title:c.name,children:c.name},"view"),Dt],ot={pointerEvents:"none",opacity:.5},vt=T?A("a",{href:c.url||c.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:c.url||c.thumbUrl?void 0:ot,onClick:function(Ht){return F(c,Ht)},title:s.previewFile,children:typeof M=="function"?M(c):M||A(LT,{})}):null,yt=a==="picture-card"&&X!=="uploading"&&it("span",{className:"".concat(r,"-list-item-actions"),children:[vt,X==="done"&>,pt]}),Tt;c.response&&typeof c.response=="string"?Tt=c.response:Tt=((U=c.error)===null||U===void 0?void 0:U.statusText)||((q=c.error)===null||q===void 0?void 0:q.message)||s.uploadError;var et=it("span",{className:Ce,children:[be,Ct]}),ut=E.exports.useContext(Fn),at=ut.getPrefixCls,He=at(),ct=it("div",{className:Ke,children:[A("div",{className:"".concat(r,"-list-item-info"),children:et}),yt,se&&A(oa,{motionName:"".concat(He,"-fade"),visible:X==="uploading",motionDeadline:2e3,children:function(Lt){var Ht=Lt.className,ze="percent"in c?A(VT,{...p,type:"line",percent:c.percent}):null;return A("div",{className:je("".concat(r,"-list-item-progress"),Ht),children:ze})}})]}),bt=je("".concat(r,"-list-").concat(a,"-container"),i),Ot=X==="error"?A(ka,{title:Tt,getPopupContainer:function(Ht){return Ht.parentNode},children:ct}):ct;return A("div",{className:bt,style:o,ref:t,children:b?b(Ot,c,f,{download:$.bind(null,c),preview:F.bind(null,c),remove:j.bind(null,c)}):Ot})});const Gve=Wve;var p1=Je({},U_);delete p1.onAppearEnd;delete p1.onEnterEnd;delete p1.onLeaveEnd;var qve=function(t,n){var r,i=t.listType,o=i===void 0?"text":i,s=t.previewFile,a=s===void 0?jve:s,c=t.onPreview,f=t.onDownload,p=t.onRemove,g=t.locale,v=t.iconRender,b=t.isImageUrl,_=b===void 0?Uve:b,T=t.prefixCls,I=t.items,P=I===void 0?[]:I,M=t.showPreviewIcon,O=M===void 0?!0:M,N=t.showRemoveIcon,F=N===void 0?!0:N,$=t.showDownloadIcon,j=$===void 0?!1:$,U=t.removeIcon,q=t.previewIcon,Y=t.downloadIcon,te=t.progress,Z=te===void 0?{strokeWidth:2,showInfo:!1}:te,X=t.appendAction,J=t.appendActionVisible,ce=J===void 0?!0:J,re=t.itemRender,se=_T(),oe=E.exports.useState(!1),he=$e(oe,2),Ce=he[0],Se=he[1];E.exports.useEffect(function(){o!=="picture"&&o!=="picture-card"||(P||[]).forEach(function(ot){typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(ot.originFileObj instanceof File||ot.originFileObj instanceof Blob)||ot.thumbUrl!==void 0||(ot.thumbUrl="",a&&a(ot.originFileObj).then(function(vt){ot.thumbUrl=vt||"",se()}))})},[o,P,a]),E.exports.useEffect(function(){Se(!0)},[]);var be=function(vt,yt){if(!!c)return yt==null||yt.preventDefault(),c(vt)},Re=function(vt){typeof f=="function"?f(vt):vt.url&&window.open(vt.url)},Ie=function(vt){p==null||p(vt)},Me=function(vt){if(v)return v(vt,o);var yt=vt.status==="uploading",Tt=_&&_(vt)?A($ve,{}):A(Ove,{}),et=yt?A(kd,{}):A(Lve,{});return o==="picture"?et=yt?A(kd,{}):Tt:o==="picture-card"&&(et=yt?g.uploading:Tt),et},Ae=function(vt,yt,Tt,et){var ut={type:"text",size:"small",title:et,onClick:function(ct){yt(),Ta(vt)&&vt.props.onClick&&vt.props.onClick(ct)},className:"".concat(Tt,"-list-item-card-actions-btn")};if(Ta(vt)){var at=Pi(vt,Je(Je({},vt.props),{onClick:function(){}}));return A(Yr,{...ut,icon:at})}return A(Yr,{...ut,children:A("span",{children:vt})})};E.exports.useImperativeHandle(n,function(){return{handlePreview:be,handleDownload:Re}});var Fe=E.exports.useContext(Fn),Ke=Fe.getPrefixCls,Ue=Fe.direction,pt=Ke("upload",T),gt=je((r={},ae(r,"".concat(pt,"-list"),!0),ae(r,"".concat(pt,"-list-").concat(o),!0),ae(r,"".concat(pt,"-list-rtl"),Ue==="rtl"),r)),Dt=Mt(P.map(function(ot){return{key:ot.uid,file:ot}})),qe=o==="picture-card"?"animate-inline":"animate",Ct={motionDeadline:2e3,motionName:"".concat(pt,"-").concat(qe),keys:Dt,motionAppear:Ce};return o!=="picture-card"&&(Ct=Je(Je({},p1),Ct)),it("div",{className:gt,children:[A(J6,{...Ct,component:!1,children:function(ot){var vt=ot.key,yt=ot.file,Tt=ot.className,et=ot.style;return A(Gve,{locale:g,prefixCls:pt,className:Tt,style:et,file:yt,items:P,progress:Z,listType:o,isImgUrl:_,showPreviewIcon:O,showRemoveIcon:F,showDownloadIcon:j,removeIcon:U,previewIcon:q,downloadIcon:Y,iconRender:Me,actionIconRender:Ae,itemRender:re,onPreview:be,onDownload:Re,onClose:Ie},vt)}}),X&&A(oa,{...Ct,visible:ce,forceRender:!0,children:function(ot){var vt=ot.className,yt=ot.style;return Pi(X,function(Tt){return{className:je(Tt.className,vt),style:Je(Je(Je({},yt),{pointerEvents:vt?"none":void 0}),Tt.style)}})}})]})},Zve=E.exports.forwardRef(qve);const Xve=Zve;var Yve=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(p){try{f(r.next(p))}catch(g){s(g)}}function c(p){try{f(r.throw(p))}catch(g){s(g)}}function f(p){p.done?o(p.value):i(p.value).then(a,c)}f((r=r.apply(e,t||[])).next())})},Em="__LIST_IGNORE_".concat(Date.now(),"__"),Qve=function(t,n){var r,i=t.fileList,o=t.defaultFileList,s=t.onRemove,a=t.showUploadList,c=a===void 0?!0:a,f=t.listType,p=f===void 0?"text":f,g=t.onPreview,v=t.onDownload,b=t.onChange,_=t.onDrop,T=t.previewFile,I=t.disabled,P=t.locale,M=t.iconRender,O=t.isImageUrl,N=t.progress,F=t.prefixCls,$=t.className,j=t.type,U=j===void 0?"select":j,q=t.children,Y=t.style,te=t.itemRender,Z=t.maxCount,X=t.data,J=X===void 0?{}:X,ce=t.multiple,re=ce===void 0?!1:ce,se=t.action,oe=se===void 0?"":se,he=t.accept,Ce=he===void 0?"":he,Se=t.supportServerRender,be=Se===void 0?!0:Se,Re=E.exports.useContext(fc),Ie=I!=null?I:Re,Me=Ei(o||[],{value:i,postState:function(It){return It!=null?It:[]}}),Ae=$e(Me,2),Fe=Ae[0],Ke=Ae[1],Ue=E.exports.useState("drop"),pt=$e(Ue,2),gt=pt[0],Dt=pt[1],qe=E.exports.useRef(null);E.exports.useMemo(function(){var Vt=Date.now();(i||[]).forEach(function(It,Xt){!It.uid&&!Object.isFrozen(It)&&(It.uid="__AUTO__".concat(Vt,"_").concat(Xt,"__"))})},[i]);var Ct=function(It,Xt,pn){var tt=Mt(Xt);Z===1?tt=tt.slice(-1):Z&&(tt=tt.slice(0,Z)),al.exports.flushSync(function(){Ke(tt)});var At={file:It,fileList:tt};pn&&(At.event=pn),b==null||b(At)},ot=function(It,Xt){return Yve(void 0,void 0,void 0,Hi().mark(function pn(){var tt,At,qt,En;return Hi().wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(tt=t.beforeUpload,At=t.transformFile,qt=It,!tt){St.next=13;break}return St.next=5,tt(It,Xt);case 5:if(En=St.sent,En!==!1){St.next=8;break}return St.abrupt("return",!1);case 8:if(delete It[Em],En!==Em){St.next=12;break}return Object.defineProperty(It,Em,{value:!0,configurable:!0}),St.abrupt("return",!1);case 12:on(En)==="object"&&En&&(qt=En);case 13:if(!At){St.next=17;break}return St.next=16,At(qt);case 16:qt=St.sent;case 17:return St.abrupt("return",qt);case 18:case"end":return St.stop()}},pn)}))},vt=function(It){var Xt=It.filter(function(At){return!At.file[Em]});if(!!Xt.length){var pn=Xt.map(function(At){return b0(At.file)}),tt=Mt(Fe);pn.forEach(function(At){tt=_0(At,tt)}),pn.forEach(function(At,qt){var En=At;if(Xt[qt].parsedFile)At.status="uploading";else{var yn=At.originFileObj,St;try{St=new File([yn],yn.name,{type:yn.type})}catch{St=new Blob([yn],{type:yn.type}),St.name=yn.name,St.lastModifiedDate=new Date,St.lastModified=new Date().getTime()}St.uid=At.uid,En=St}Ct(En,tt)})}},yt=function(It,Xt,pn){try{typeof It=="string"&&(It=JSON.parse(It))}catch{}if(!!aS(Xt,Fe)){var tt=b0(Xt);tt.status="done",tt.percent=100,tt.response=It,tt.xhr=pn;var At=_0(tt,Fe);Ct(tt,At)}},Tt=function(It,Xt){if(!!aS(Xt,Fe)){var pn=b0(Xt);pn.status="uploading",pn.percent=It.percent;var tt=_0(pn,Fe);Ct(pn,tt,It)}},et=function(It,Xt,pn){if(!!aS(pn,Fe)){var tt=b0(pn);tt.error=It,tt.response=Xt,tt.status="error";var At=_0(tt,Fe);Ct(tt,At)}},ut=function(It){var Xt;Promise.resolve(typeof s=="function"?s(It):s).then(function(pn){var tt;if(pn!==!1){var At=Bve(It,Fe);At&&(Xt=Je(Je({},It),{status:"removed"}),Fe==null||Fe.forEach(function(qt){var En=Xt.uid!==void 0?"uid":"name";qt[En]===Xt[En]&&!Object.isFrozen(qt)&&(qt.status="removed")}),(tt=qe.current)===null||tt===void 0||tt.abort(Xt),Ct(Xt,At))}})},at=function(It){Dt(It.type),It.type==="drop"&&(_==null||_(It))};E.exports.useImperativeHandle(n,function(){return{onBatchStart:vt,onSuccess:yt,onProgress:Tt,onError:et,fileList:Fe,upload:qe.current}});var He=E.exports.useContext(Fn),ct=He.getPrefixCls,bt=He.direction,Ot=ct("upload",F),Lt=Je(Je({onBatchStart:vt,onError:et,onProgress:Tt,onSuccess:yt},t),{data:J,multiple:re,action:oe,accept:Ce,supportServerRender:be,prefixCls:Ot,disabled:Ie,beforeUpload:ot,onChange:void 0});delete Lt.className,delete Lt.style,(!q||Ie)&&delete Lt.id;var Ht=function(It,Xt){return c?A(Lh,{componentName:"Upload",defaultLocale:Ms.Upload,children:function(pn){var tt=typeof c=="boolean"?{}:c,At=tt.showRemoveIcon,qt=tt.showPreviewIcon,En=tt.showDownloadIcon,yn=tt.removeIcon,St=tt.previewIcon,Pn=tt.downloadIcon;return A(Xve,{prefixCls:Ot,listType:p,items:Fe,previewFile:T,onPreview:g,onDownload:v,onRemove:ut,showRemoveIcon:!Ie&&At,showPreviewIcon:qt,showDownloadIcon:En,removeIcon:yn,previewIcon:St,downloadIcon:Pn,iconRender:M,locale:Je(Je({},pn),P),isImageUrl:O,progress:N,appendAction:It,appendActionVisible:Xt,itemRender:te})}}):It};if(U==="drag"){var ze,Ye=je(Ot,(ze={},ae(ze,"".concat(Ot,"-drag"),!0),ae(ze,"".concat(Ot,"-drag-uploading"),Fe.some(function(Vt){return Vt.status==="uploading"})),ae(ze,"".concat(Ot,"-drag-hover"),gt==="dragover"),ae(ze,"".concat(Ot,"-disabled"),Ie),ae(ze,"".concat(Ot,"-rtl"),bt==="rtl"),ze),$);return it("span",{children:[A("div",{className:Ye,onDrop:at,onDragOver:at,onDragLeave:at,style:Y,children:A(aE,{...Lt,ref:qe,className:"".concat(Ot,"-btn"),children:A("div",{className:"".concat(Ot,"-drag-container"),children:q})})}),Ht()]})}var Zt=je(Ot,(r={},ae(r,"".concat(Ot,"-select"),!0),ae(r,"".concat(Ot,"-select-").concat(p),!0),ae(r,"".concat(Ot,"-disabled"),Ie),ae(r,"".concat(Ot,"-rtl"),bt==="rtl"),r)),an=function(It){return A("div",{className:Zt,style:It,children:A(aE,{...Lt,ref:qe})})},Kt=an(q?void 0:{display:"none"});return p==="picture-card"?A("span",{className:je("".concat(Ot,"-picture-card-wrapper"),$),children:Ht(Kt,!!q)}):it("span",{className:$,children:[Kt,Ht()]})},Jve=E.exports.forwardRef(Qve);const dU=Jve;var eye=globalThis&&globalThis.__rest||function(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);iA("div",{className:Id("mb-1",t),children:A(iye,{type:r,className:n,children:e})});function oye(e,t,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function aye(e,t,n){n===void 0&&(n={});for(var r=0,i=e;rn[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]t=>{const n=pU.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),tu=e=>(e=e.toLowerCase(),t=>QT(t)===e),m1=e=>t=>typeof t===e,{isArray:qh}=Array,Tg=m1("undefined");function sye(e){return e!==null&&!Tg(e)&&e.constructor!==null&&!Tg(e.constructor)&&oc(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const mU=tu("ArrayBuffer");function lye(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mU(e.buffer),t}const uye=m1("string"),oc=m1("function"),gU=m1("number"),JT=e=>e!==null&&typeof e=="object",cye=e=>e===!0||e===!1,mx=e=>{if(QT(e)!=="object")return!1;const t=YT(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},dye=tu("Date"),fye=tu("File"),hye=tu("Blob"),pye=tu("FileList"),mye=e=>JT(e)&&oc(e.pipe),gye=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||pU.call(e)===t||oc(e.toString)&&e.toString()===t)},vye=tu("URLSearchParams"),yye=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vv(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),qh(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const yU=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),xU=e=>!Tg(e)&&e!==yU;function lE(){const{caseless:e}=xU(this)&&this||{},t={},n=(r,i)=>{const o=e&&vU(t,i)||i;mx(t[o])&&mx(r)?t[o]=lE(t[o],r):mx(r)?t[o]=lE({},r):qh(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(vv(t,(i,o)=>{n&&oc(i)?e[o]=hU(i,n):e[o]=i},{allOwnKeys:r}),e),bye=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_ye=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},wye=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&YT(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Cye=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Sye=e=>{if(!e)return null;if(qh(e))return e;let t=e.length;if(!gU(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Eye=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&YT(Uint8Array)),Pye=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Tye=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Iye=tu("HTMLFormElement"),kye=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),fA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Mye=tu("RegExp"),bU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};vv(n,(i,o)=>{t(i,o,e)!==!1&&(r[o]=i)}),Object.defineProperties(e,r)},Rye=e=>{bU(e,(t,n)=>{if(oc(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(!!oc(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Dye=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return qh(e)?r(e):r(String(e).split(t)),n},Oye=()=>{},Aye=(e,t)=>(e=+e,Number.isFinite(e)?e:t),sS="abcdefghijklmnopqrstuvwxyz",hA="0123456789",_U={DIGIT:hA,ALPHA:sS,ALPHA_DIGIT:sS+sS.toUpperCase()+hA},Nye=(e=16,t=_U.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Lye(e){return!!(e&&oc(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Fye=e=>{const t=new Array(10),n=(r,i)=>{if(JT(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=qh(r)?[]:{};return vv(r,(s,a)=>{const c=n(s,i+1);!Tg(c)&&(o[a]=c)}),t[i]=void 0,o}}return r};return n(e,0)},Nt={isArray:qh,isArrayBuffer:mU,isBuffer:sye,isFormData:gye,isArrayBufferView:lye,isString:uye,isNumber:gU,isBoolean:cye,isObject:JT,isPlainObject:mx,isUndefined:Tg,isDate:dye,isFile:fye,isBlob:hye,isRegExp:Mye,isFunction:oc,isStream:mye,isURLSearchParams:vye,isTypedArray:Eye,isFileList:pye,forEach:vv,merge:lE,extend:xye,trim:yye,stripBOM:bye,inherits:_ye,toFlatObject:wye,kindOf:QT,kindOfTest:tu,endsWith:Cye,toArray:Sye,forEachEntry:Pye,matchAll:Tye,isHTMLForm:Iye,hasOwnProperty:fA,hasOwnProp:fA,reduceDescriptors:bU,freezeMethods:Rye,toObjectSet:Dye,toCamelCase:kye,noop:Oye,toFiniteNumber:Aye,findKey:vU,global:yU,isContextDefined:xU,ALPHABET:_U,generateString:Nye,isSpecCompliantForm:Lye,toJSONObject:Fye};function vr(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}Nt.inherits(vr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Nt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const wU=vr.prototype,CU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{CU[e]={value:e}});Object.defineProperties(vr,CU);Object.defineProperty(wU,"isAxiosError",{value:!0});vr.from=(e,t,n,r,i,o)=>{const s=Object.create(wU);return Nt.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),vr.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const zye=null;function uE(e){return Nt.isPlainObject(e)||Nt.isArray(e)}function SU(e){return Nt.endsWith(e,"[]")?e.slice(0,-2):e}function pA(e,t,n){return e?e.concat(t).map(function(i,o){return i=SU(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function $ye(e){return Nt.isArray(e)&&!e.some(uE)}const Bye=Nt.toFlatObject(Nt,{},null,function(t){return/^is[A-Z]/.test(t)});function g1(e,t,n){if(!Nt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Nt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,I){return!Nt.isUndefined(I[T])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Nt.isSpecCompliantForm(t);if(!Nt.isFunction(i))throw new TypeError("visitor must be a function");function f(_){if(_===null)return"";if(Nt.isDate(_))return _.toISOString();if(!c&&Nt.isBlob(_))throw new vr("Blob is not supported. Use a Buffer instead.");return Nt.isArrayBuffer(_)||Nt.isTypedArray(_)?c&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function p(_,T,I){let P=_;if(_&&!I&&typeof _=="object"){if(Nt.endsWith(T,"{}"))T=r?T:T.slice(0,-2),_=JSON.stringify(_);else if(Nt.isArray(_)&&$ye(_)||(Nt.isFileList(_)||Nt.endsWith(T,"[]"))&&(P=Nt.toArray(_)))return T=SU(T),P.forEach(function(O,N){!(Nt.isUndefined(O)||O===null)&&t.append(s===!0?pA([T],N,o):s===null?T:T+"[]",f(O))}),!1}return uE(_)?!0:(t.append(pA(I,T,o),f(_)),!1)}const g=[],v=Object.assign(Bye,{defaultVisitor:p,convertValue:f,isVisitable:uE});function b(_,T){if(!Nt.isUndefined(_)){if(g.indexOf(_)!==-1)throw Error("Circular reference detected in "+T.join("."));g.push(_),Nt.forEach(_,function(P,M){(!(Nt.isUndefined(P)||P===null)&&i.call(t,P,Nt.isString(M)?M.trim():M,T,v))===!0&&b(P,T?T.concat(M):[M])}),g.pop()}}if(!Nt.isObject(e))throw new TypeError("data must be an object");return b(e),t}function mA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function eI(e,t){this._pairs=[],e&&g1(e,this,t)}const EU=eI.prototype;EU.append=function(t,n){this._pairs.push([t,n])};EU.toString=function(t){const n=t?function(r){return t.call(this,r,mA)}:mA;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Vye(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function PU(e,t,n){if(!t)return e;const r=n&&n.encode||Vye,i=n&&n.serialize;let o;if(i?o=i(t,n):o=Nt.isURLSearchParams(t)?t.toString():new eI(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Uye{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Nt.forEach(this.handlers,function(r){r!==null&&t(r)})}}const gA=Uye,TU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},jye=typeof URLSearchParams<"u"?URLSearchParams:eI,Hye=typeof FormData<"u"?FormData:null,Kye=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Wye=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Js={isBrowser:!0,classes:{URLSearchParams:jye,FormData:Hye,Blob},isStandardBrowserEnv:Kye,isStandardBrowserWebWorkerEnv:Wye,protocols:["http","https","file","blob","url","data"]};function Gye(e,t){return g1(e,new Js.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Js.isNode&&Nt.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function qye(e){return Nt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Zye(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&Nt.isArray(i)?i.length:s,c?(Nt.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!Nt.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&Nt.isArray(i[s])&&(i[s]=Zye(i[s])),!a)}if(Nt.isFormData(e)&&Nt.isFunction(e.entries)){const n={};return Nt.forEachEntry(e,(r,i)=>{t(qye(r),i,n,0)}),n}return null}const Xye={"Content-Type":void 0};function Yye(e,t,n){if(Nt.isString(e))try{return(t||JSON.parse)(e),Nt.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const v1={transitional:TU,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=Nt.isObject(t);if(o&&Nt.isHTMLForm(t)&&(t=new FormData(t)),Nt.isFormData(t))return i&&i?JSON.stringify(IU(t)):t;if(Nt.isArrayBuffer(t)||Nt.isBuffer(t)||Nt.isStream(t)||Nt.isFile(t)||Nt.isBlob(t))return t;if(Nt.isArrayBufferView(t))return t.buffer;if(Nt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gye(t,this.formSerializer).toString();if((a=Nt.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return g1(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Yye(t)):t}],transformResponse:[function(t){const n=this.transitional||v1.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&Nt.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?vr.from(a,vr.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Js.classes.FormData,Blob:Js.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Nt.forEach(["delete","get","head"],function(t){v1.headers[t]={}});Nt.forEach(["post","put","patch"],function(t){v1.headers[t]=Nt.merge(Xye)});const tI=v1,Qye=Nt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Jye=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&Qye[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},vA=Symbol("internals");function um(e){return e&&String(e).trim().toLowerCase()}function gx(e){return e===!1||e==null?e:Nt.isArray(e)?e.map(gx):String(e)}function e0e(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function t0e(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function lS(e,t,n,r,i){if(Nt.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Nt.isString(t)){if(Nt.isString(r))return t.indexOf(r)!==-1;if(Nt.isRegExp(r))return r.test(t)}}function n0e(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function r0e(e,t){const n=Nt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}class y1{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,c,f){const p=um(c);if(!p)throw new Error("header name must be a non-empty string");const g=Nt.findKey(i,p);(!g||i[g]===void 0||f===!0||f===void 0&&i[g]!==!1)&&(i[g||c]=gx(a))}const s=(a,c)=>Nt.forEach(a,(f,p)=>o(f,p,c));return Nt.isPlainObject(t)||t instanceof this.constructor?s(t,n):Nt.isString(t)&&(t=t.trim())&&!t0e(t)?s(Jye(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=um(t),t){const r=Nt.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return e0e(i);if(Nt.isFunction(n))return n.call(this,i,r);if(Nt.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=um(t),t){const r=Nt.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||lS(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=um(s),s){const a=Nt.findKey(r,s);a&&(!n||lS(r,r[a],a,n))&&(delete r[a],i=!0)}}return Nt.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||lS(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return Nt.forEach(this,(i,o)=>{const s=Nt.findKey(r,o);if(s){n[s]=gx(i),delete n[o];return}const a=t?n0e(o):String(o).trim();a!==o&&delete n[o],n[a]=gx(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Nt.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Nt.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[vA]=this[vA]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=um(s);r[a]||(r0e(i,s),r[a]=!0)}return Nt.isArray(t)?t.forEach(o):o(t),this}}y1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Nt.freezeMethods(y1.prototype);Nt.freezeMethods(y1);const Hl=y1;function uS(e,t){const n=this||tI,r=t||n,i=Hl.from(r.headers);let o=r.data;return Nt.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function kU(e){return!!(e&&e.__CANCEL__)}function yv(e,t,n){vr.call(this,e==null?"canceled":e,vr.ERR_CANCELED,t,n),this.name="CanceledError"}Nt.inherits(yv,vr,{__CANCEL__:!0});function i0e(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new vr("Request failed with status code "+n.status,[vr.ERR_BAD_REQUEST,vr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const o0e=Js.isStandardBrowserEnv?function(){return{write:function(n,r,i,o,s,a){const c=[];c.push(n+"="+encodeURIComponent(r)),Nt.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),Nt.isString(o)&&c.push("path="+o),Nt.isString(s)&&c.push("domain="+s),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function a0e(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function s0e(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function MU(e,t){return e&&!a0e(t)?s0e(e,t):t}const l0e=Js.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=Nt.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function u0e(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function c0e(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),p=r[o];s||(s=f),n[i]=c,r[i]=f;let g=o,v=0;for(;g!==i;)v+=n[g++],g=g%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-s{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a),f=o<=s;n=o;const p={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&f?(s-o)/c:void 0,event:i};p[t?"download":"upload"]=!0,e(p)}}const d0e=typeof XMLHttpRequest<"u",f0e=d0e&&function(e){return new Promise(function(n,r){let i=e.data;const o=Hl.from(e.headers).normalize(),s=e.responseType;let a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}Nt.isFormData(i)&&(Js.isStandardBrowserEnv||Js.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let f=new XMLHttpRequest;if(e.auth){const b=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(b+":"+_))}const p=MU(e.baseURL,e.url);f.open(e.method.toUpperCase(),PU(p,e.params,e.paramsSerializer),!0),f.timeout=e.timeout;function g(){if(!f)return;const b=Hl.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),T={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:b,config:e,request:f};i0e(function(P){n(P),c()},function(P){r(P),c()},T),f=null}if("onloadend"in f?f.onloadend=g:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(g)},f.onabort=function(){!f||(r(new vr("Request aborted",vr.ECONNABORTED,e,f)),f=null)},f.onerror=function(){r(new vr("Network Error",vr.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const T=e.transitional||TU;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),r(new vr(_,T.clarifyTimeoutError?vr.ETIMEDOUT:vr.ECONNABORTED,e,f)),f=null},Js.isStandardBrowserEnv){const b=(e.withCredentials||l0e(p))&&e.xsrfCookieName&&o0e.read(e.xsrfCookieName);b&&o.set(e.xsrfHeaderName,b)}i===void 0&&o.setContentType(null),"setRequestHeader"in f&&Nt.forEach(o.toJSON(),function(_,T){f.setRequestHeader(T,_)}),Nt.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),s&&s!=="json"&&(f.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&f.addEventListener("progress",yA(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",yA(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=b=>{!f||(r(!b||b.type?new yv(null,e,f):b),f.abort(),f=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const v=u0e(p);if(v&&Js.protocols.indexOf(v)===-1){r(new vr("Unsupported protocol "+v+":",vr.ERR_BAD_REQUEST,e));return}f.send(i||null)})},vx={http:zye,xhr:f0e};Nt.forEach(vx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const h0e={getAdapter:e=>{e=Nt.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof Hl?e.toJSON():e;function _h(e,t){t=t||{};const n={};function r(f,p,g){return Nt.isPlainObject(f)&&Nt.isPlainObject(p)?Nt.merge.call({caseless:g},f,p):Nt.isPlainObject(p)?Nt.merge({},p):Nt.isArray(p)?p.slice():p}function i(f,p,g){if(Nt.isUndefined(p)){if(!Nt.isUndefined(f))return r(void 0,f,g)}else return r(f,p,g)}function o(f,p){if(!Nt.isUndefined(p))return r(void 0,p)}function s(f,p){if(Nt.isUndefined(p)){if(!Nt.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function a(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(f,p)=>i(bA(f),bA(p),!0)};return Nt.forEach(Object.keys(e).concat(Object.keys(t)),function(p){const g=c[p]||i,v=g(e[p],t[p],p);Nt.isUndefined(v)&&g!==a||(n[p]=v)}),n}const RU="1.3.3",nI={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{nI[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const _A={};nI.transitional=function(t,n,r){function i(o,s){return"[Axios v"+RU+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new vr(i(s," has been removed"+(n?" in "+n:"")),vr.ERR_DEPRECATED);return n&&!_A[s]&&(_A[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};function p0e(e,t,n){if(typeof e!="object")throw new vr("options must be an object",vr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new vr("option "+o+" must be "+c,vr.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new vr("Unknown option "+o,vr.ERR_BAD_OPTION)}}const cE={assertOptions:p0e,validators:nI},Cu=cE.validators;class Tb{constructor(t){this.defaults=t,this.interceptors={request:new gA,response:new gA}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=_h(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&cE.assertOptions(r,{silentJSONParsing:Cu.transitional(Cu.boolean),forcedJSONParsing:Cu.transitional(Cu.boolean),clarifyTimeoutError:Cu.transitional(Cu.boolean)},!1),i!==void 0&&cE.assertOptions(i,{encode:Cu.function,serialize:Cu.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=o&&Nt.merge(o.common,o[n.method]),s&&Nt.forEach(["delete","get","head","post","put","patch","common"],_=>{delete o[_]}),n.headers=Hl.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(c=c&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});const f=[];this.interceptors.response.forEach(function(T){f.push(T.fulfilled,T.rejected)});let p,g=0,v;if(!c){const _=[xA.bind(this),void 0];for(_.unshift.apply(_,a),_.push.apply(_,f),v=_.length,p=Promise.resolve(n);g{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new yv(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new rI(function(i){t=i}),cancel:t}}}const m0e=rI;function g0e(e){return function(n){return e.apply(null,n)}}function v0e(e){return Nt.isObject(e)&&e.isAxiosError===!0}const dE={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(dE).forEach(([e,t])=>{dE[t]=e});const y0e=dE;function DU(e){const t=new yx(e),n=hU(yx.prototype.request,t);return Nt.extend(n,yx.prototype,t,{allOwnKeys:!0}),Nt.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return DU(_h(e,i))},n}const Wi=DU(tI);Wi.Axios=yx;Wi.CanceledError=yv;Wi.CancelToken=m0e;Wi.isCancel=kU;Wi.VERSION=RU;Wi.toFormData=g1;Wi.AxiosError=vr;Wi.Cancel=Wi.CanceledError;Wi.all=function(t){return Promise.all(t)};Wi.spread=g0e;Wi.isAxiosError=v0e;Wi.mergeConfig=_h;Wi.AxiosHeaders=Hl;Wi.formToJSON=e=>IU(Nt.isHTMLForm(e)?new FormData(e):e);Wi.HttpStatusCode=y0e;Wi.default=Wi;const x0e=Wi,Ib="https://dzkh.yourfavorite.agency",as=x0e.create({baseURL:Ib}),OU=(e,t)=>{const n=e||new URLSearchParams;return t&&(t.type==="ao"&&n.append("district[]",t.id),t.type==="rayon"&&n.append("rayon",t.id)),n},b0e=async(e,t,n)=>{const r=OU(e,t),{data:i}=await as.get(`/api/data/?${r.toString()}`,{signal:n});return i},_0e=async(e,t)=>{const n=OU(e,t),{data:r}=await as.get(`/api/data/to_csv/?${n.toString()}`,{responseType:"arraybuffer"});return r},w0e=async e=>{const{data:t}=await as.get(`/default_data/templates/${e}.xlsx`,{responseType:"arraybuffer"});return t},C0e=async(e,t,n=!1)=>{const r=new FormData;r.append("file",e),r.append("model",t),r.append("refill",n);const{data:i}=await as.post("/api/import_file/",r);return i},S0e=async()=>{const{data:e}=await as.get("/api/data/start_ds_miracle");return e};var xv={exports:{}};xv.exports=AU;xv.exports.parse=AU;xv.exports.stringify=NU;var wA=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,CA=new RegExp("^"+wA.source+"(\\s"+wA.source+"){1,}");function AU(e){var t=e.split(";"),n=t.pop(),r=(t.shift()||"").split("=").pop(),i=0;function o(M){var O=n.substring(i).match(M);return O?(i+=O[0].length,O[0]):null}function s(M){return M&&r.match(/\d+/)&&(M.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+r}}),M}function a(){o(/^\s*/)}function c(){a();for(var M=0,O=[],N=[O],F=O,$;$=o(/^(\()/)||o(/^(\))/)||o(/^(,)/)||o(CA);){if($==="(")N.push(F),F=[],N[N.length-1].push(F),M++;else if($===")"){if(F.length===0||(F=N.pop(),!F))return null;if(M--,M===0)break}else if($===",")F=[],N[N.length-1].push(F);else if(!$.split(/\s/g).some(isNaN))Array.prototype.push.apply(F,$.split(/\s/g).map(parseFloat));else return null;a()}return M!==0?null:O}function f(){for(var M=[],O,N;N=o(CA)||o(/^(,)/);)N===","?(M.push(O),O=[]):N.split(/\s/g).some(isNaN)||(O||(O=[]),Array.prototype.push.apply(O,N.split(/\s/g).map(parseFloat))),a();if(O)M.push(O);else return null;return M.length?M:null}function p(){if(!o(/^(point(\sz)?)/i)||(a(),!o(/^(\()/)))return null;var M=f();return!M||(a(),!o(/^(\))/))?null:{type:"Point",coordinates:M[0]}}function g(){if(!o(/^(multipoint)/i))return null;a();var M=n.substring(n.indexOf("(")+1,n.length-1).replace(/\(/g,"").replace(/\)/g,"");n="MULTIPOINT ("+M+")";var O=c();return O?(a(),{type:"MultiPoint",coordinates:O}):null}function v(){if(!o(/^(multilinestring)/i))return null;a();var M=c();return M?(a(),{type:"MultiLineString",coordinates:M}):null}function b(){if(!o(/^(linestring(\sz)?)/i)||(a(),!o(/^(\()/)))return null;var M=f();return!M||!o(/^(\))/)?null:{type:"LineString",coordinates:M}}function _(){if(!o(/^(polygon(\sz)?)/i))return null;a();var M=c();return M?{type:"Polygon",coordinates:M}:null}function T(){if(!o(/^(multipolygon)/i))return null;a();var M=c();return M?{type:"MultiPolygon",coordinates:M}:null}function I(){var M=[],O;if(!o(/^(geometrycollection)/i)||(a(),!o(/^(\()/)))return null;for(;O=P();)M.push(O),a(),o(/^(,)/),a();return o(/^(\))/)?{type:"GeometryCollection",geometries:M}:null}function P(){return p()||b()||_()||g()||v()||T()||I()}return s(P())}function NU(e){e.type==="Feature"&&(e=e.geometry);function t(s){return s.join(" ")}function n(s){return s.map(t).join(", ")}function r(s){return s.map(n).map(o).join(", ")}function i(s){return s.map(r).map(o).join(", ")}function o(s){return"("+s+")"}switch(e.type){case"Point":return"POINT ("+t(e.coordinates)+")";case"LineString":return"LINESTRING ("+n(e.coordinates)+")";case"Polygon":return"POLYGON ("+r(e.coordinates)+")";case"MultiPoint":return"MULTIPOINT ("+n(e.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON ("+i(e.coordinates)+")";case"MultiLineString":return"MULTILINESTRING ("+r(e.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION ("+e.geometries.map(NU).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}}class bv{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(n=>n!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const Ig=typeof window>"u"||"Deno"in window;function Ga(){}function E0e(e,t){return typeof e=="function"?e(t):e}function fE(e){return typeof e=="number"&&e>=0&&e!==1/0}function LU(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pm(e,t,n){return x1(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Iu(e,t,n){return x1(e)?[{...t,queryKey:e},n]:[e||{},t]}function SA(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(x1(s)){if(r){if(t.queryHash!==iI(s,t.options))return!1}else if(!kb(t.queryKey,s))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function EA(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(x1(o)){if(!t.options.mutationKey)return!1;if(n){if(hd(t.options.mutationKey)!==hd(o))return!1}else if(!kb(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function iI(e,t){return((t==null?void 0:t.queryKeyHashFn)||hd)(e)}function hd(e){return JSON.stringify(e,(t,n)=>hE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function kb(e,t){return FU(e,t)}function FU(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!FU(e[n],t[n])):!1}function zU(e,t){if(e===t)return e;const n=TA(e)&&TA(t);if(n||hE(e)&&hE(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,s=n?[]:{};let a=0;for(let c=0;c"u")return!0;const n=t.prototype;return!(!IA(n)||!n.hasOwnProperty("isPrototypeOf"))}function IA(e){return Object.prototype.toString.call(e)==="[object Object]"}function x1(e){return Array.isArray(e)}function $U(e){return new Promise(t=>{setTimeout(t,e)})}function kA(e){$U(0).then(e)}function P0e(){if(typeof AbortController=="function")return new AbortController}function pE(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?zU(e,t):t}class T0e extends bv{constructor(){super(),this.setup=t=>{if(!Ig&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Mb=new T0e;class I0e extends bv{constructor(){super(),this.setup=t=>{if(!Ig&&window.addEventListener){const n=()=>t();return window.addEventListener("online",n,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Rb=new I0e;function k0e(e){return Math.min(1e3*2**e,3e4)}function b1(e){return(e!=null?e:"online")==="online"?Rb.isOnline():!0}class BU{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function xx(e){return e instanceof BU}function VU(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((I,P)=>{o=I,s=P}),c=I=>{r||(b(new BU(I)),e.abort==null||e.abort())},f=()=>{t=!0},p=()=>{t=!1},g=()=>!Mb.isFocused()||e.networkMode!=="always"&&!Rb.isOnline(),v=I=>{r||(r=!0,e.onSuccess==null||e.onSuccess(I),i==null||i(),o(I))},b=I=>{r||(r=!0,e.onError==null||e.onError(I),i==null||i(),s(I))},_=()=>new Promise(I=>{i=P=>{const M=r||!g();return M&&I(P),M},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),T=()=>{if(r)return;let I;try{I=e.fn()}catch(P){I=Promise.reject(P)}Promise.resolve(I).then(v).catch(P=>{var M,O;if(r)return;const N=(M=e.retry)!=null?M:3,F=(O=e.retryDelay)!=null?O:k0e,$=typeof F=="function"?F(n,P):F,j=N===!0||typeof N=="number"&&n{if(g())return _()}).then(()=>{t?b(P):T()})})};return b1(e.networkMode)?T():_().then(T),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:f,continueRetry:p}}const oI=console;function M0e(){let e=[],t=0,n=p=>{p()},r=p=>{p()};const i=p=>{let g;t++;try{g=p()}finally{t--,t||a()}return g},o=p=>{t?e.push(p):kA(()=>{n(p)})},s=p=>(...g)=>{o(()=>{p(...g)})},a=()=>{const p=e;e=[],p.length&&kA(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p}}}const Ai=M0e();class UU{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fE(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:Ig?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class R0e extends UU{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||oI,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||D0e(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=pE(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(Ga).catch(Ga):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!LU(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(_=>_.options.queryFn);b&&this.setOptions(b.options)}Array.isArray(this.options.queryKey);const s=P0e(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};c(a);const f=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn"),p={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:f};if(c(p),(r=this.options.behavior)==null||r.onFetch(p),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=p.fetchOptions)==null?void 0:i.meta)){var g;this.dispatch({type:"fetch",meta:(g=p.fetchOptions)==null?void 0:g.meta})}const v=b=>{if(xx(b)&&b.silent||this.dispatch({type:"error",error:b}),!xx(b)){var _,T;(_=(T=this.cache.config).onError)==null||_.call(T,b,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=VU({fn:p.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:b=>{var _,T;if(typeof b>"u"){v(new Error("undefined"));return}this.setData(b),(_=(T=this.cache.config).onSuccess)==null||_.call(T,b,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:v,onFail:(b,_)=>{this.dispatch({type:"failed",failureCount:b,error:_})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:b1(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return xx(s)&&s.revert&&this.revertState?{...this.revertState}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ai.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function D0e(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class O0e extends bv{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:iI(o,n);let a=this.get(s);return a||(a=new R0e({cache:this,logger:t.getLogger(),queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){Ai.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Iu(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>SA(r,i))}findAll(t,n){const[r]=Iu(t,n);return Object.keys(r).length>0?this.queries.filter(i=>SA(r,i)):this.queries}notify(t){Ai.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ai.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Ai.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class A0e extends UU{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||oI,this.observers=[],this.state=t.state||N0e(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var O;return this.retryer=VU({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(N,F)=>{this.dispatch({type:"failed",failureCount:N,error:F})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(O=this.options.retry)!=null?O:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,a,c;if(!n){var f,p,g,v;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(p=this.mutationCache.config).onMutate)==null?void 0:f.call(p,this.state.variables,this));const N=await((g=(v=this.options).onMutate)==null?void 0:g.call(v,this.state.variables));N!==this.state.context&&this.dispatch({type:"loading",context:N,variables:this.state.variables})}const O=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,O,this.state.variables,this.state.context,this)),await((o=(s=this.options).onSuccess)==null?void 0:o.call(s,O,this.state.variables,this.state.context)),await((a=(c=this.options).onSettled)==null?void 0:a.call(c,O,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:O}),O}catch(O){try{var b,_,T,I,P,M;throw await((b=(_=this.mutationCache.config).onError)==null?void 0:b.call(_,O,this.state.variables,this.state.context,this)),await((T=(I=this.options).onError)==null?void 0:T.call(I,O,this.state.variables,this.state.context)),await((P=(M=this.options).onSettled)==null?void 0:P.call(M,void 0,O,this.state.variables,this.state.context)),O}finally{this.dispatch({type:"error",error:O})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!b1(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ai.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function N0e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class L0e extends bv{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new A0e({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){Ai.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>EA(t,n))}findAll(t){return this.mutations.filter(n=>EA(t,n))}notify(t){Ai.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return Ai.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(Ga)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function F0e(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,s;const a=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,c=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,f=c==null?void 0:c.pageParam,p=(c==null?void 0:c.direction)==="forward",g=(c==null?void 0:c.direction)==="backward",v=((o=e.state.data)==null?void 0:o.pages)||[],b=((s=e.state.data)==null?void 0:s.pageParams)||[];let _=b,T=!1;const I=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>{var j;if((j=e.signal)!=null&&j.aborted)T=!0;else{var U;(U=e.signal)==null||U.addEventListener("abort",()=>{T=!0})}return e.signal}})},P=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),M=($,j,U,q)=>(_=q?[j,..._]:[..._,j],q?[U,...$]:[...$,U]),O=($,j,U,q)=>{if(T)return Promise.reject("Cancelled");if(typeof U>"u"&&!j&&$.length)return Promise.resolve($);const Y={queryKey:e.queryKey,pageParam:U,meta:e.options.meta};I(Y);const te=P(Y);return Promise.resolve(te).then(X=>M($,U,X,q))};let N;if(!v.length)N=O([]);else if(p){const $=typeof f<"u",j=$?f:MA(e.options,v);N=O(v,$,j)}else if(g){const $=typeof f<"u",j=$?f:z0e(e.options,v);N=O(v,$,j,!0)}else{_=[];const $=typeof e.options.getNextPageParam>"u";N=(a&&v[0]?a(v[0],0,v):!0)?O([],$,b[0]):Promise.resolve(M([],b[0],v[0]));for(let U=1;U{if(a&&v[U]?a(v[U],U,v):!0){const te=$?b[U]:MA(e.options,q);return O(q,$,te)}return Promise.resolve(M(q,b[U],v[U]))})}return N.then($=>({pages:$,pageParams:_}))}}}}function MA(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function z0e(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class $0e{constructor(t={}){this.queryCache=t.queryCache||new O0e,this.mutationCache=t.mutationCache||new L0e,this.logger=t.logger||oI,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Mb.subscribe(()=>{Mb.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Rb.subscribe(()=>{Rb.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=Iu(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=Pm(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),o=i==null?void 0:i.state.data,s=E0e(n,o);if(typeof s>"u")return;const a=Pm(t),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return Ai.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Iu(t,n),i=this.queryCache;Ai.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=Iu(t,n,r),s=this.queryCache,a={type:"active",...i};return Ai.batch(()=>(s.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,o)))}cancelQueries(t,n,r){const[i,o={}]=Iu(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const s=Ai.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(o)));return Promise.all(s).then(Ga).catch(Ga)}invalidateQueries(t,n,r){const[i,o]=Iu(t,n,r);return Ai.batch(()=>{var s,a;if(this.queryCache.findAll(i).forEach(f=>{f.invalidate()}),i.refetchType==="none")return Promise.resolve();const c={...i,type:(s=(a=i.refetchType)!=null?a:i.type)!=null?s:"active"};return this.refetchQueries(c,o)})}refetchQueries(t,n,r){const[i,o]=Iu(t,n,r),s=Ai.batch(()=>this.queryCache.findAll(i).filter(c=>!c.isDisabled()).map(c=>{var f;return c.fetch(void 0,{...o,cancelRefetch:(f=o==null?void 0:o.cancelRefetch)!=null?f:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(s).then(Ga);return o!=null&&o.throwOnError||(a=a.catch(Ga)),a}fetchQuery(t,n,r){const i=Pm(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(Ga).catch(Ga)}fetchInfiniteQuery(t,n,r){const i=Pm(t,n,r);return i.behavior=F0e(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(Ga).catch(Ga)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>hd(t)===hd(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>kb(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>hd(t)===hd(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>kb(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=iI(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class B0e extends bv{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),RA(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return mE(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mE(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),PA(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&DA(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t);return this.createResult(n,t)}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ga)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Ig||this.currentResult.isStale||!fE(this.options.staleTime))return;const n=LU(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Ig||this.options.enabled===!1||!fE(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Mb.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,c=t!==r,f=c?t.state:this.currentQueryInitialState,p=c?this.currentResult:this.previousQueryResult,{state:g}=t;let{dataUpdatedAt:v,error:b,errorUpdatedAt:_,fetchStatus:T,status:I}=g,P=!1,M=!1,O;if(n._optimisticResults){const U=this.hasListeners(),q=!U&&RA(t,n),Y=U&&DA(t,r,n,i);(q||Y)&&(T=b1(t.options.networkMode)?"fetching":"paused",v||(I="loading")),n._optimisticResults==="isRestoring"&&(T="idle")}if(n.keepPreviousData&&!g.dataUpdatedAt&&p!=null&&p.isSuccess&&I!=="error")O=p.data,v=p.dataUpdatedAt,I=p.status,P=!0;else if(n.select&&typeof g.data<"u")if(o&&g.data===(s==null?void 0:s.data)&&n.select===this.selectFn)O=this.selectResult;else try{this.selectFn=n.select,O=n.select(g.data),O=pE(o==null?void 0:o.data,O,n),this.selectResult=O,this.selectError=null}catch(U){this.selectError=U}else O=g.data;if(typeof n.placeholderData<"u"&&typeof O>"u"&&I==="loading"){let U;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))U=o.data;else if(U=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof U<"u")try{U=n.select(U),this.selectError=null}catch(q){this.selectError=q}typeof U<"u"&&(I="success",O=pE(o==null?void 0:o.data,U,n),M=!0)}this.selectError&&(b=this.selectError,O=this.selectResult,_=Date.now(),I="error");const N=T==="fetching",F=I==="loading",$=I==="error";return{status:I,fetchStatus:T,isLoading:F,isSuccess:I==="success",isError:$,isInitialLoading:F&&N,data:O,dataUpdatedAt:v,error:b,errorUpdatedAt:_,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:N,isRefetching:N&&!F,isLoadingError:$&&g.dataUpdatedAt===0,isPaused:T==="paused",isPlaceholderData:M,isPreviousData:P,isRefetchError:$&&g.dataUpdatedAt!==0,isStale:aI(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,PA(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options;if(s==="all"||!s&&!this.trackedProps.size)return!0;const a=new Set(s!=null?s:this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(c=>{const f=c;return this.currentResult[f]!==n[f]&&a.has(f)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!xx(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){Ai.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var s,a,c,f;(s=(a=this.options).onError)==null||s.call(a,this.currentResult.error),(c=(f=this.options).onSettled)==null||c.call(f,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(p=>{p(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function V0e(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function RA(e,t){return V0e(e,t)||e.state.dataUpdatedAt>0&&mE(e,t,t.refetchOnMount)}function mE(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&aI(e,t)}return!1}function DA(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&aI(e,n)}function aI(e,t){return e.isStaleByTime(t.staleTime)}var sI={exports:{}},jU={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wh=E.exports;function U0e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var j0e=typeof Object.is=="function"?Object.is:U0e,H0e=wh.useState,K0e=wh.useEffect,W0e=wh.useLayoutEffect,G0e=wh.useDebugValue;function q0e(e,t){var n=t(),r=H0e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return W0e(function(){i.value=n,i.getSnapshot=t,dS(i)&&o({inst:i})},[e,n,t]),K0e(function(){return dS(i)&&o({inst:i}),e(function(){dS(i)&&o({inst:i})})},[e]),G0e(n),n}function dS(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!j0e(e,n)}catch{return!0}}function Z0e(e,t){return t()}var X0e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Z0e:q0e;jU.useSyncExternalStore=wh.useSyncExternalStore!==void 0?wh.useSyncExternalStore:X0e;(function(e){e.exports=jU})(sI);const Y0e=sI.exports.useSyncExternalStore,OA=E.exports.createContext(void 0),HU=E.exports.createContext(!1);function KU(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=OA),window.ReactQueryClientContext):OA)}const WU=({context:e}={})=>{const t=E.exports.useContext(KU(e,E.exports.useContext(HU)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Q0e=({client:e,children:t,context:n,contextSharing:r=!1})=>{E.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=KU(n,r);return A(HU.Provider,{value:!n&&r,children:A(i.Provider,{value:e,children:t})})},GU=E.exports.createContext(!1),J0e=()=>E.exports.useContext(GU);GU.Provider;function exe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const txe=E.exports.createContext(exe()),nxe=()=>E.exports.useContext(txe);function rxe(e,t){return typeof e=="function"?e(...t):!!e}const ixe=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},oxe=e=>{E.exports.useEffect(()=>{e.clearReset()},[e])},axe=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&rxe(n,[e.error,r]),sxe=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},lxe=(e,t)=>e.isLoading&&e.isFetching&&!t,uxe=(e,t,n)=>(e==null?void 0:e.suspense)&&lxe(t,n),cxe=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function dxe(e,t){const n=WU({context:e.context}),r=J0e(),i=nxe(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=Ai.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=Ai.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=Ai.batchCalls(o.onSettled)),sxe(o),ixe(o,i),oxe(i);const[s]=E.exports.useState(()=>new t(n,o)),a=s.getOptimisticResult(o);if(Y0e(E.exports.useCallback(c=>r?()=>{}:s.subscribe(Ai.batchCalls(c)),[s,r]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),E.exports.useEffect(()=>{s.setOptions(o,{listeners:!1})},[o,s]),uxe(o,a,r))throw cxe(o,s,i);if(axe({result:a,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:s.getCurrentQuery()}))throw a.error;return o.notifyOnChangeProps?a:s.trackResult(a)}function nu(e,t,n){const r=Pm(e,t,n);return dxe(r,B0e)}const{TreeNode:AA}=f1,fxe=e=>e.reduce((t,n)=>(t[n.name]=n,t[n.name].type="ao",n.rayons&&n.rayons.forEach(r=>{t[r.name]=r,t[r.name].type="rayon"}),t),{}),lI=()=>nu(["regions"],async()=>{const{data:e}=await as.get("/api/ao_rayons/");return e},{select:e=>({raw:e,normalized:fxe(e)}),refetchOnWindowFocus:!1,refetchOnMount:!1}),hxe=({disabled:e,value:t,onChange:n})=>{const{map:r}=B5(),{data:i,isInitialLoading:o}=lI();return it("div",{children:[A(cl,{text:"\u0410\u041E / \u0440\u0430\u0439\u043E\u043D"}),A(f1,{showSearch:!0,style:{width:"100%"},value:t,dropdownStyle:{maxHeight:400,overflow:"auto"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0410\u041E \u0438\u043B\u0438 \u0440\u0430\u0439\u043E\u043D",allowClear:!0,treeDefaultExpandAll:!1,onChange:c=>{if(!c)return;const f=i.normalized[c],p=xv.exports(f.polygon),g=aye(p.coordinates[0]),v=sE(g);n({id:f.name,geometry:g,type:f.type}),r.fitBounds([[v[0],v[1]],[v[2],v[3]]],{padding:20})},loading:o,treeNodeFilterProp:"title",onClear:()=>n(null),notFoundContent:A(Ys,{image:Ys.PRESENTED_IMAGE_SIMPLE,description:"\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"}),disabled:e,children:i==null?void 0:i.raw.map(c=>{var f;return A(AA,{value:c.name,title:c.name,children:(f=c.rayons)==null?void 0:f.map(p=>A(AA,{value:p.name,title:p.name},p.name))},c.name)})})]})},NA=e=>{let t;const n=new Set,r=(c,f)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const g=t;t=(f!=null?f:typeof p!="object")?p:Object.assign({},t,p),n.forEach(v=>v(t,g))}},i=()=>t,a={setState:r,getState:i,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{var c;((c={VITE_API_URL:"https://dzkh.yourfavorite.agency",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:c.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},pxe=e=>e?NA(e):NA;var qU={exports:{}},ZU={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var _1=E.exports,mxe=sI.exports;function gxe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vxe=typeof Object.is=="function"?Object.is:gxe,yxe=mxe.useSyncExternalStore,xxe=_1.useRef,bxe=_1.useEffect,_xe=_1.useMemo,wxe=_1.useDebugValue;ZU.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=xxe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=_xe(function(){function c(b){if(!f){if(f=!0,p=b,b=r(b),i!==void 0&&s.hasValue){var _=s.value;if(i(_,b))return g=_}return g=b}if(_=g,vxe(p,b))return _;var T=r(b);return i!==void 0&&i(_,T)?_:(p=b,g=T)}var f=!1,p,g,v=n===void 0?null:n;return[function(){return c(t())},v===null?void 0:function(){return c(v())}]},[t,n,r,i]);var a=yxe(e,o[0],o[1]);return bxe(function(){s.hasValue=!0,s.value=a},[a]),wxe(a),a};(function(e){e.exports=ZU})(qU);const Cxe=VE(qU.exports),{useSyncExternalStoreWithSelector:Sxe}=Cxe;function Exe(e,t=e.getState,n){const r=Sxe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return E.exports.useDebugValue(r),r}const LA=e=>{var t;((t={VITE_API_URL:"https://dzkh.yourfavorite.agency",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?pxe(e):e,r=(i,o)=>Exe(n,i,o);return Object.assign(r,n),r},hc=e=>e?LA(e):LA;function Ya(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:uI(e)?2:cI(e)?3:0}function gE(e,t){return Zh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Pxe(e,t){return Zh(e)===2?e.get(t):e[t]}function XU(e,t,n){var r=Zh(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Txe(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function uI(e){return Oxe&&e instanceof Map}function cI(e){return Axe&&e instanceof Set}function Ji(e){return e.o||e.t}function dI(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Lxe(e);delete t[Pr];for(var n=mI(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=Ixe),Object.freeze(e),t&&Sh(e,function(n,r){return fI(r,!0)},!0)),e}function Ixe(){Ya(2)}function hI(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function rl(e){var t=yE[e];return t||Ya(18,e),t}function kxe(e,t){yE[e]||(yE[e]=t)}function Db(){return Mg}function fS(e,t){t&&(rl("Patches"),e.u=[],e.s=[],e.v=t)}function Ob(e){vE(e),e.p.forEach(Mxe),e.p=null}function vE(e){e===Mg&&(Mg=e.l)}function FA(e){return Mg={p:[],l:Mg,h:e,m:!0,_:0}}function Mxe(e){var t=e[Pr];t.i===0||t.i===1?t.j():t.O=!0}function hS(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||rl("ES5").S(t,e,r),r?(n[Pr].P&&(Ob(t),Ya(4)),Xl(e)&&(e=Ab(t,e),t.l||Nb(t,e)),t.u&&rl("Patches").M(n[Pr].t,e,t.u,t.s)):e=Ab(t,n,[]),Ob(t),t.u&&t.v(t.u,t.s),e!==YU?e:void 0}function Ab(e,t,n){if(hI(t))return t;var r=t[Pr];if(!r)return Sh(t,function(a,c){return zA(e,r,t,a,c,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Nb(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=dI(r.k):r.o,o=i,s=!1;r.i===3&&(o=new Set(i),i.clear(),s=!0),Sh(o,function(a,c){return zA(e,r,i,a,c,n,s)}),Nb(e,i,!1),n&&e.u&&rl("Patches").N(r,n,e.u,e.s)}return r.o}function zA(e,t,n,r,i,o,s){if(Ch(i)){var a=Ab(e,i,o&&t&&t.i!==3&&!gE(t.R,r)?o.concat(r):void 0);if(XU(n,r,a),!Ch(a))return;e.m=!1}else s&&n.add(i);if(Xl(i)&&!hI(i)){if(!e.h.D&&e._<1)return;Ab(e,i),t&&t.A.l||Nb(e,i)}}function Nb(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&fI(t,n)}function pS(e,t){var n=e[Pr];return(n?Ji(n):e)[t]}function $A(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Al(e){e.P||(e.P=!0,e.l&&Al(e.l))}function mS(e){e.o||(e.o=dI(e.t))}function kg(e,t,n){var r=uI(t)?rl("MapSet").F(t,n):cI(t)?rl("MapSet").T(t,n):e.g?function(i,o){var s=Array.isArray(i),a={i:s?1:0,A:o?o.A:Db(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},c=a,f=xE;s&&(c=[a],f=Tm);var p=Proxy.revocable(c,f),g=p.revoke,v=p.proxy;return a.k=v,a.j=g,v}(t,n):rl("ES5").J(t,n);return(n?n.A:Db()).p.push(r),r}function Rxe(e){return Ch(e)||Ya(22,e),function t(n){if(!Xl(n))return n;var r,i=n[Pr],o=Zh(n);if(i){if(!i.P&&(i.i<4||!rl("ES5").K(i)))return i.t;i.I=!0,r=BA(n,o),i.I=!1}else r=BA(n,o);return Sh(r,function(s,a){i&&Pxe(i.t,s)===a||XU(r,s,t(a))}),o===3?new Set(r):r}(e)}function BA(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return dI(e)}function Dxe(){function e(a,c){function f(){this.constructor=a}i(a,c),a.prototype=(f.prototype=c.prototype,new f)}function t(a){a.o||(a.R=new Map,a.o=new Map(a.t))}function n(a){a.o||(a.o=new Set,a.t.forEach(function(c){if(Xl(c)){var f=kg(a.A.h,c,a);a.p.set(c,f),a.o.add(f)}else a.o.add(c)}))}function r(a){a.O&&Ya(3,JSON.stringify(Ji(a)))}var i=function(a,c){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,p){f.__proto__=p}||function(f,p){for(var g in p)p.hasOwnProperty(g)&&(f[g]=p[g])})(a,c)},o=function(){function a(f,p){return this[Pr]={i:2,l:p,A:p?p.A:Db(),P:!1,I:!1,o:void 0,R:void 0,t:f,k:this,C:!1,O:!1},this}e(a,Map);var c=a.prototype;return Object.defineProperty(c,"size",{get:function(){return Ji(this[Pr]).size}}),c.has=function(f){return Ji(this[Pr]).has(f)},c.set=function(f,p){var g=this[Pr];return r(g),Ji(g).has(f)&&Ji(g).get(f)===p||(t(g),Al(g),g.R.set(f,!0),g.o.set(f,p),g.R.set(f,!0)),this},c.delete=function(f){if(!this.has(f))return!1;var p=this[Pr];return r(p),t(p),Al(p),p.t.has(f)?p.R.set(f,!1):p.R.delete(f),p.o.delete(f),!0},c.clear=function(){var f=this[Pr];r(f),Ji(f).size&&(t(f),Al(f),f.R=new Map,Sh(f.t,function(p){f.R.set(p,!1)}),f.o.clear())},c.forEach=function(f,p){var g=this;Ji(this[Pr]).forEach(function(v,b){f.call(p,g.get(b),b,g)})},c.get=function(f){var p=this[Pr];r(p);var g=Ji(p).get(f);if(p.I||!Xl(g)||g!==p.t.get(f))return g;var v=kg(p.A.h,g,p);return t(p),p.o.set(f,v),v},c.keys=function(){return Ji(this[Pr]).keys()},c.values=function(){var f,p=this,g=this.keys();return(f={})[w0]=function(){return p.values()},f.next=function(){var v=g.next();return v.done?v:{done:!1,value:p.get(v.value)}},f},c.entries=function(){var f,p=this,g=this.keys();return(f={})[w0]=function(){return p.entries()},f.next=function(){var v=g.next();if(v.done)return v;var b=p.get(v.value);return{done:!1,value:[v.value,b]}},f},c[w0]=function(){return this.entries()},a}(),s=function(){function a(f,p){return this[Pr]={i:3,l:p,A:p?p.A:Db(),P:!1,I:!1,o:void 0,t:f,k:this,p:new Map,O:!1,C:!1},this}e(a,Set);var c=a.prototype;return Object.defineProperty(c,"size",{get:function(){return Ji(this[Pr]).size}}),c.has=function(f){var p=this[Pr];return r(p),p.o?!!p.o.has(f)||!(!p.p.has(f)||!p.o.has(p.p.get(f))):p.t.has(f)},c.add=function(f){var p=this[Pr];return r(p),this.has(f)||(n(p),Al(p),p.o.add(f)),this},c.delete=function(f){if(!this.has(f))return!1;var p=this[Pr];return r(p),n(p),Al(p),p.o.delete(f)||!!p.p.has(f)&&p.o.delete(p.p.get(f))},c.clear=function(){var f=this[Pr];r(f),Ji(f).size&&(n(f),Al(f),f.o.clear())},c.values=function(){var f=this[Pr];return r(f),n(f),f.o.values()},c.entries=function(){var f=this[Pr];return r(f),n(f),f.o.entries()},c.keys=function(){return this.values()},c[w0]=function(){return this.values()},c.forEach=function(f,p){for(var g=this.values(),v=g.next();!v.done;)f.call(p,v.value,v.value,this),v=g.next()},a}();kxe("MapSet",{F:function(a,c){return new o(a,c)},T:function(a,c){return new s(a,c)}})}var VA,Mg,pI=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Oxe=typeof Map<"u",Axe=typeof Set<"u",UA=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",YU=pI?Symbol.for("immer-nothing"):((VA={})["immer-nothing"]=!0,VA),jA=pI?Symbol.for("immer-draftable"):"__$immer_draftable",Pr=pI?Symbol.for("immer-state"):"__$immer_state",w0=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Nxe=""+Object.prototype.constructor,mI=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Lxe=Object.getOwnPropertyDescriptors||function(e){var t={};return mI(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},yE={},xE={get:function(e,t){if(t===Pr)return e;var n=Ji(e);if(!gE(n,t))return function(i,o,s){var a,c=$A(o,s);return c?"value"in c?c.value:(a=c.get)===null||a===void 0?void 0:a.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!Xl(r)?r:r===pS(e.t,t)?(mS(e),e.o[t]=kg(e.A.h,r,e)):r},has:function(e,t){return t in Ji(e)},ownKeys:function(e){return Reflect.ownKeys(Ji(e))},set:function(e,t,n){var r=$A(Ji(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=pS(Ji(e),t),o=i==null?void 0:i[Pr];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Txe(n,i)&&(n!==void 0||gE(e.t,t)))return!0;mS(e),Al(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return pS(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,mS(e),Al(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Ji(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Ya(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Ya(12)}},Tm={};Sh(xE,function(e,t){Tm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Tm.deleteProperty=function(e,t){return Tm.set.call(this,e,t,void 0)},Tm.set=function(e,t,n){return xE.set.call(this,e[0],t,n,e[0])};var Fxe=function(){function e(n){var r=this;this.g=UA,this.D=!0,this.produce=function(i,o,s){if(typeof i=="function"&&typeof o!="function"){var a=o;o=i;var c=r;return function(T){var I=this;T===void 0&&(T=a);for(var P=arguments.length,M=Array(P>1?P-1:0),O=1;O1?p-1:0),v=1;v=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var s=rl("Patches").$;return Ch(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),Ma=new Fxe,zxe=Ma.produce;Ma.produceWithPatches.bind(Ma);Ma.setAutoFreeze.bind(Ma);Ma.setUseProxies.bind(Ma);Ma.applyPatches.bind(Ma);Ma.createDraft.bind(Ma);Ma.finishDraft.bind(Ma);const $xe=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?zxe(i):i;return t(a,o,...s)},e(r.setState,n,r)),pc=$xe;function Bxe(e){let t;try{t=e()}catch{return}return{getItem:r=>{var i;const o=a=>a===null?null:JSON.parse(a),s=(i=t.getItem(r))!=null?i:null;return s instanceof Promise?s.then(o):o(s)},setItem:(r,i)=>t.setItem(r,JSON.stringify(i)),removeItem:r=>t.removeItem(r)}}const Rg=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Rg(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Rg(r)(n)}}}},Vxe=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:I=>I,version:0,merge:(I,P)=>({...P,...I}),...t},s=!1;const a=new Set,c=new Set;let f;try{f=o.getStorage()}catch{}if(!f)return e((...I)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...I)},r,i);const p=Rg(o.serialize),g=()=>{const I=o.partialize({...r()});let P;const M=p({state:I,version:o.version}).then(O=>f.setItem(o.name,O)).catch(O=>{P=O});if(P)throw P;return M},v=i.setState;i.setState=(I,P)=>{v(I,P),g()};const b=e((...I)=>{n(...I),g()},r,i);let _;const T=()=>{var I;if(!f)return;s=!1,a.forEach(M=>M(r()));const P=((I=o.onRehydrateStorage)==null?void 0:I.call(o,r()))||void 0;return Rg(f.getItem.bind(f))(o.name).then(M=>{if(M)return o.deserialize(M)}).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==o.version){if(o.migrate)return o.migrate(M.state,M.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return M.state}).then(M=>{var O;return _=o.merge(M,(O=r())!=null?O:b),n(_,!0),g()}).then(()=>{P==null||P(_,void 0),s=!0,c.forEach(M=>M(_))}).catch(M=>{P==null||P(void 0,M)})};return i.persist={setOptions:I=>{o={...o,...I},I.getStorage&&(f=I.getStorage())},clearStorage:()=>{f==null||f.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>T(),hasHydrated:()=>s,onHydrate:I=>(a.add(I),()=>{a.delete(I)}),onFinishHydration:I=>(c.add(I),()=>{c.delete(I)})},T(),_||b},Uxe=(e,t)=>(n,r,i)=>{let o={storage:Bxe(()=>localStorage),partialize:T=>T,version:0,merge:(T,I)=>({...I,...T}),...t},s=!1;const a=new Set,c=new Set;let f=o.storage;if(!f)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...T)},r,i);const p=()=>{const T=o.partialize({...r()});return f.setItem(o.name,{state:T,version:o.version})},g=i.setState;i.setState=(T,I)=>{g(T,I),p()};const v=e((...T)=>{n(...T),p()},r,i);let b;const _=()=>{var T;if(!f)return;s=!1,a.forEach(P=>P(r()));const I=((T=o.onRehydrateStorage)==null?void 0:T.call(o,r()))||void 0;return Rg(f.getItem.bind(f))(o.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==o.version){if(o.migrate)return o.migrate(P.state,P.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return P.state}).then(P=>{var M;return b=o.merge(P,(M=r())!=null?M:v),n(b,!0),p()}).then(()=>{I==null||I(b,void 0),s=!0,c.forEach(P=>P(b))}).catch(P=>{I==null||I(void 0,P)})};return i.persist={setOptions:T=>{o={...o,...T},T.storage&&(f=T.storage)},clearStorage:()=>{f==null||f.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>_(),hasHydrated:()=>s,onHydrate:T=>(a.add(T),()=>{a.delete(T)}),onFinishHydration:T=>(c.add(T),()=>{c.delete(T)})},_(),b||v},jxe=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_API_URL:"https://dzkh.yourfavorite.agency",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Vxe(e,t)):Uxe(e,t)},gI=jxe,gS={region:null,prob1__gt:0,prob1__lt:5e3,prob2__gt:0,prob2__lt:5e3,prob3__gt:0,prob3__lt:5e3,prob4__gt:0,prob4__lt:5e3,prob5__gt:0,prob5__lt:5e3,prob6__gt:0,prob6__lt:5e3,cooling_time__gt:0,cooling_time__lt:5e3,priority__gt:0,priority__lt:5e3},Hxe={prob1:[0,5e3],prob2:[0,5e3],prob3:[0,5e3],prob4:[0,5e3],prob5:[0,5e3],prob6:[0,5e3],cooling_time:[0,5e3],priority:[0,5e3]},Kxe=e=>({filters:gS,consumer_filter:null,consumer_ranges:null,source_filter:null,consumer_type:null,energy_class:null,wall_material:null,ranges:Hxe,setConsumerFilter:(t,n)=>e(r=>{if(!t){r.consumer_filter=null;return}const i=n||r.ranges[t];r.consumer_filter={key:t,gt:i[0],lt:i[1]}}),setSourceFilter:(t,n)=>e(r=>{if(!t){r.source_filter=null;return}const i=n||r.ranges[t];r.source_filter={key:t,gt:i[0],lt:i[1]}}),setRegion:t=>e(n=>{n.filters.region=t}),setConsumerType:t=>e(n=>{n.consumer_type=t}),setEnergyClass:t=>e(n=>{n.energy_class=t}),setWallMaterial:t=>e(n=>{n.wall_material=t}),setFilterWithKey:(t,n)=>e(r=>{r.filters[`${n}__gt`]=t[0],r.filters[`${n}__lt`]=t[1]}),setRanges:t=>e(n=>{n.ranges=t}),clear:t=>e(n=>{if(n.consumer_filter=null,n.source_filter=null,n.energy_class=null,n.consumer_type=null,n.wall_material=null,!t)return n.filters=gS,n;n.filters={...gS,prediction:t.prediction}})}),qi=hc(gI(pc(Kxe),{name:"dzkh/filters"})),Wxe=[{value:"category1",title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",selectable:!1,children:[{value:"prob1",title:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043E\u0442\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0432 \u0434\u043E\u043C\u0435"},{value:"prob2",title:"\u041F\u0440\u043E\u0442\u0435\u0447\u043A\u0430 \u0442\u0440\u0443\u0431 \u0432 \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u0435"},{value:"prob3",title:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432 \u043A\u0432\u0430\u0440\u0442\u0438\u0440\u0435 \u043D\u0438\u0436\u0435 \u043D\u043E\u0440\u043C\u0430\u0442\u0438\u0432\u043D\u043E\u0439"},{value:"prob4",title:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432 \u043F\u043E\u043C\u0435\u0449\u0435\u043D\u0438\u0438 \u043E\u0431\u0449\u0435\u0433\u043E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u043D\u0438\u0436\u0435 \u043D\u043E\u0440\u043C\u0430\u0442\u0438\u0432\u043D\u043E\u0439"},{value:"prob5",title:"\u0422\u0435\u0447\u044C \u0432 \u0441\u0438\u0441\u0442\u0435\u043C\u0435 \u043E\u0442\u043E\u043F\u043B\u0435\u043D\u0438\u044F"}]},{value:"category2",title:"\u0420\u0435\u0430\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",selectable:!1,children:[{value:"cooling_time",title:"\u0412\u0440\u0435\u043C\u044F \u043E\u0441\u0442\u044B\u0432\u0430\u043D\u0438\u044F, \u0447"},{value:"priority",title:"\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442 \u0437\u0434\u0430\u043D\u0438\u044F"}]}],Gxe=()=>{const e={};let t=0;for(let n=-25;n<25;n++)e[n]=t,t++;return e},Vi=Gxe(),qxe=({disabled:e})=>{const{consumer_filter:t,setConsumerFilter:n}=qi();return it("div",{children:[A(cl,{text:"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C \u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u044F"}),A(f1,{mode:"tags",style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C",onChange:r=>n(r),treeData:Wxe,allowClear:!0,value:t==null?void 0:t.key,disabled:e,treeDefaultExpandAll:!0})]})},Nl=({value:e})=>A("span",{className:"text-grey text-xs bg-white-background-light",children:e}),HA=(e,t)=>{if(Array.isArray(t)){const[n,r]=t;return{...e,[n]:A(Nl,{value:n}),[r]:A(Nl,{value:r})}}else return{...e,[t]:A(Nl,{value:t})}},vI=({title:e,value:t,onChange:n,onAfterChange:r,min:i=0,max:o=100,range:s=!1,step:a=1,disabled:c=!1,onMouseEnter:f,onMouseLeave:p,showZeroMark:g=!1})=>{const v={[i]:A(Nl,{value:i}),[o]:A(Nl,{value:o})},[b,_]=E.exports.useState(t),[T,I]=E.exports.useState(HA(v,t));E.exports.useEffect(()=>{_(t),I(HA(v,t))},[t]);const P=N=>{if(Array.isArray(N)){const[F,$]=N;I({...v,[F]:A(Nl,{value:F}),[$]:A(Nl,{value:$})})}else I({...v,[N]:A(Nl,{value:N})});r==null||r(N)},M=N=>{_(N),n==null||n(N)},O=g?{...T,0:A(Nl,{value:0})}:T;return it("div",{onMouseEnter:f,onMouseLeave:p,children:[A(cl,{text:e}),A(ale,{range:s,value:b,marks:O,onChange:M,onAfterChange:P,min:i,max:o,step:a,disabled:c})]})},Zxe=e=>({value:0,range:[-25,18],setValue:t=>{e(n=>{n.value=t})},clear:()=>e(t=>{t.value=0})}),ss=hc(gI(pc(Zxe),{name:"weather-filter"})),yI=e=>nu(["dzkh-filter-range",e],async()=>{const{data:t,isInitialLoading:n,isFetching:r}=await as.get(`/api/data/filters_ranges/?field=${e}`);return{data:t,isLoading:n||r}},{select:({data:t,isLoading:n})=>{let r;return!t||!t[e]?r=[0,0]:r=[t[e].min,t[e].max],{range:r,isLoading:n}}}),xI=e=>nu(["dzkh-filter-values",e],async()=>{const{data:t,isInitialLoading:n,isFetching:r}=await as.get(`/api/data/filters_ranges/?field=${e}`);return{data:t,isLoading:n||r}},{select:({data:t,isLoading:n})=>t?[...t[e]]:[]}),Xxe=e=>nu(["dzkh-shap",e],async()=>{const{data:t,isInitialLoading:n,isFetching:r}=await as.get(`/api/data/${e}/data_shap/`);return{data:t,isLoading:n||r}},{select:t=>t.data.shap}),Yxe=e=>{const{value:t}=ss();return e?nu(["dzkh-crush",e],async()=>{const{data:n,isInitialLoading:r,isFetching:i}=await as.get(`/api/data/${e}/crush_summary/?current_temp=${t}`);return{data:n,isLoading:r||i}},{select:n=>n.data}):{data:null}},Qxe=({disabled:e,isLoading:t})=>{const{consumer_filter:n,setConsumerFilter:r}=qi(),i=E.exports.useMemo(()=>n==null?void 0:n.key,[n==null?void 0:n.key]),o=E.exports.useMemo(()=>{if(!i)return[0,0];const v=n.gt,b=n.lt;return[v,b]},[n,i]),{value:s}=ss(),a=E.exports.useMemo(()=>{if(i)return`${i}_${Vi[s]}`},[i,s]),{data:c,isLoading:f}=yI(a),p=E.exports.useMemo(()=>(c==null?void 0:c.range)||[0,0],[c==null?void 0:c.range]),g=v=>r(i,v);return t||f?A("div",{className:"flex justify-center items-center",children:A(dv,{})}):A(nr,{children:n&&p&&A(vI,{title:i.includes("prob")?"\u0421\u043A\u043B\u043E\u043D\u043D\u043E\u0441\u0442\u044C \u043A \u0430\u0432\u0430\u0440\u0438\u0439\u043D\u043E\u0441\u0442\u0438":i.includes("cooling_time")?"\u0412\u0440\u0435\u043C\u044F \u043E\u0441\u0442\u044B\u0432\u0430\u043D\u0438\u044F, \u0447":"\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442 \u0437\u0434\u0430\u043D\u0438\u044F",value:[o[0],o[1]],onAfterChange:g,min:p[0],max:p[1],range:!0,step:.01,disabled:e})})},Jxe=[{value:"prob6",label:"\u0410\u0432\u0430\u0440\u0438\u044F \u043D\u0430 \u0422\u041F"}],ebe=({disabled:e})=>{const{source_filter:t,setSourceFilter:n}=qi();return it("div",{children:[A(cl,{text:"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430"}),A(f1,{mode:"tags",style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C",onChange:r=>n(r),treeData:Jxe,allowClear:!0,value:t==null?void 0:t.key,disabled:e,treeDefaultExpandAll:!0})]})},tbe=({disabled:e,isLoading:t})=>{const{source_filter:n,setSourceFilter:r}=qi(),i=E.exports.useMemo(()=>n==null?void 0:n.key,[n==null?void 0:n.key]),o=E.exports.useMemo(()=>{if(!i)return[0,0];const v=n.gt,b=n.lt;return[v,b]},[n,i]),{value:s}=ss(),a=E.exports.useMemo(()=>{if(i)return`${i}_${Vi[s]}`},[i,s]),{data:c,isLoading:f}=yI(a),p=E.exports.useMemo(()=>(c==null?void 0:c.range)||[0,0],[c==null?void 0:c.range]),g=v=>r(i,v);return t?A("div",{className:"flex justify-center items-center",children:A(dv,{})}):A(nr,{children:n&&p&&A(vI,{title:"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044E",value:[o[0],o[1]],onAfterChange:g,min:p[0],max:p[1],range:!0,step:.01,disabled:e})})},nbe="potreb_type",rbe={living_house:"\u0416\u0438\u043B\u043E\u0439 \u0434\u043E\u043C",soc_object:"\u0421\u043E\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442"},ibe=({disabled:e})=>{const{consumer_type:t,setConsumerType:n}=qi(),{data:r,isLoading:i}=xI(nbe),o=E.exports.useMemo(()=>r?r==null?void 0:r.filter(Boolean).map(s=>({value:s,label:rbe[s]})):[],[r]);return it("div",{children:[A(cl,{text:"\u0422\u0438\u043F \u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u044F"}),A(Ud,{style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043F",onChange:(s,a)=>n(a),options:o,allowClear:!0,value:t,disabled:e})]})},obe="fi_energy_class",abe=({disabled:e})=>{const{energy_class:t,setEnergyClass:n}=qi(),{data:r,isLoading:i}=xI(obe),o=E.exports.useMemo(()=>r?r==null?void 0:r.filter(Boolean).map(s=>({value:s,label:s})):[],[r]);return it("div",{children:[A(cl,{text:"\u041A\u043B\u0430\u0441\u0441 \u044D\u043D\u0435\u0440\u0433\u043E\u044D\u0444\u0444\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438"}),A(Ud,{style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043F",onChange:(s,a)=>n(a),options:o,allowClear:!0,value:t,disabled:e})]})},sbe="wall_materials",lbe=({disabled:e})=>{const{wall_material:t,setWallMaterial:n}=qi(),{data:r,isLoading:i}=xI(sbe),o=E.exports.useMemo(()=>r?r==null?void 0:r.filter(Boolean).map(s=>({value:s,label:s})):[],[r]);return it("div",{children:[A(cl,{text:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D"}),A(Ud,{style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043F",onChange:(s,a)=>n(a),options:o,allowClear:!0,value:t,disabled:e})]})},ube=()=>{const{clear:e,consumer_filter:t,source_filter:n}=qi();return it("div",{className:"flex flex-col flex-1",children:[it("div",{className:"space-y-5",children:[A(qxe,{}),A(Qxe,{}),A(ebe,{}),A(tbe,{}),A(ibe,{}),A(abe,{}),A(lbe,{})]}),(t||n)&&A("div",{className:"flex items-center justify-end pt-4",children:A("div",{className:"flex gap-2",children:A(Yr,{onClick:()=>e(),type:"secondary",children:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B"})})})]})},cbe="/assets/dzkh_logo.bd091fb4.png",dbe="/assets/dit_logo.d7458a9f.png",fbe=E.exports.forwardRef(({isCollapsed:e},t)=>{var i;const{filters:n,setRegion:r}=qi();return A("div",{className:Id("h-screen p-3 overflow-y-auto shrink-0 border-solid border-border border-0 border-r-[1px] flex flex-col transition-all",e?"basis-0 px-0 -translate-x-[320px]":"basis-[320px]"),ref:t,children:A("div",{className:"flex flex-col flex-1",children:it("div",{className:"space-y-5",children:[it("div",{className:"flex flex-row gap-1 justify-between items-center",children:[A("img",{width:"48%",height:50,src:cbe,alt:"logo"}),A("img",{width:"48%",height:50,src:dbe,alt:"logo"})]}),A(hxe,{value:(i=n.region)==null?void 0:i.id,onChange:r}),A(ube,{})]})})})}),hbe=e=>({updateCounter:-1,toggleUpdateCounter:()=>{e(t=>{t.updateCounter=t.updateCounter===-1?1:-1})}}),QU=hc(pc(hbe)),Ci={consumer:"potreb",source:"tp",dispatcher:"ods"},pbe={[Ci.consumer]:!0,[Ci.source]:!0,[Ci.dispatcher]:!0},mbe=e=>({isVisible:pbe,toggleVisibility:t=>e(n=>{n.isVisible[t]=!n.isVisible[t]}),showLayers:t=>e(n=>{t.forEach(r=>{n.isVisible[r]=!0})}),setLayersVisibility:t=>e(n=>{t.forEach(i=>{n.isVisible[i]=!0}),Object.keys(n.isVisible).filter(i=>!t.includes(i)).forEach(i=>{n.isVisible[i]=!1})})}),w1=hc(gI(pc(mbe),{name:"dzkh/layers-visibility"})),gbe={ao:"ao_id",rayon:"rayon_id"},bI=e=>E.exports.useMemo(()=>e?["==",["get",gbe[e.type]],e.id]:null,[e]),vbe=6,Lb={stops:[[.05,"#fff700"],[.2,"#ffda00"],[.35,"#ffbc00"],[.5,"#ff9d00"],[.65,"#ff7a00"],[.8,"#ff5200"],[.95,"#ff0000"]]},ybe={stops:[[2.8,"#ff0000"],[3.7,"#ff5200"],[4.6,"#ff7a00"],[5.5,"#ff9d00"],[6.4,"#ffbc00"],[7.3,"#ffda00"],[8.2,"#fff700"]]},JU={stops:[[.05,"#fd99ff"],[.2,"#da7ee1"],[.35,"#b964c3"],[.5,"#984ba6"],[.65,"#793389"],[.8,"#5a1a6e"],[.95,"#3d0053"]]},KA={type:"circle",paint:{"circle-stroke-width":.1,"circle-stroke-color":"#262626","circle-opacity":.8}},Fb=(e="grey",t=vbe)=>({...KA,paint:{...KA.paint,"circle-color":e,"circle-radius":["interpolate",["linear"],["zoom"],3,0,10,1,13,t]}}),WA=e=>({type:"symbol",layout:{"icon-image":["coalesce",["image",e],["image","defaultIcon"]],"icon-size":["interpolate",["linear"],["zoom"],3,0,9,.1,13,.5]}}),vS={...Fb(),paint:{...Fb().paint}},yS={...Fb("grey",10),paint:{...Fb("grey",10).paint}},e7="#676767",GA={id:"ao",type:"line",source:"ao","source-layer":"public.service_ao",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":e7,"line-width":1.5,"line-opacity":.8}},qA={id:"rayon",type:"line",source:"rayon","source-layer":"public.service_rayon",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":e7,"line-width":.5,"line-opacity":.8}},xbe={id:"selected-region",type:"line",source:"selected-region",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#CC2222","line-width":4}},bbe=()=>{const{consumer_filter:e,consumer_type:t,energy_class:n,wall_material:r}=qi(),{value:i}=ss(),o=Vi[i];return[...(()=>{const a=[];if(e){const c=`${e.key}_${o}`;a.push([">=",["get",c],e.gt],["<=",["get",c],e.lt])}return t&&a.push(["==",["get","potreb_type"],t.value]),n&&a.push(["==",["get","fi_energy_class"],n.value]),r&&a.push(["==",["get","wall_materials"],r.value]),a})()]},_be=e=>({selectedSourceConfig:{sourceId:null,dispatcherNumber:null},setSelectedSourceConfig:({pointId:t,sourceId:n,dispatcherNumber:r})=>e(i=>{i.selectedSourceConfig={pointId:t,sourceId:n,dispatcherNumber:r||null}})}),Kd=hc(pc(_be)),wbe=["==",["get","point_type"],Ci.consumer],Cbe=()=>{const{isVisible:e}=w1(),{filters:{region:t},consumer_filter:n}=qi(),r=bI(t),i=bbe(),{selectedSourceConfig:o}=Kd(),{value:s}=ss(),a=E.exports.useMemo(()=>n==null?void 0:n.key,[n==null?void 0:n.key]),c=E.exports.useMemo(()=>{if(a)return`${a}_${Vi[s]}`},[a,s]),{data:f,isLoading:p}=yI(c),g=E.exports.useMemo(()=>(f==null?void 0:f.range)||[0,0],[f==null?void 0:f.range]),v=()=>{const P=["all",wbe,...i];return r&&P.push(r),o.sourceId&&P.push(["==",["get","tp_number"],o.sourceId]),P},b=n!=null&&n.key?`${n.key}_${Vi[s]}`:null,_=E.exports.useMemo(()=>n&&n.key.includes("cooling"),[n]),T=E.exports.useMemo(()=>{const P=g[0],O=(g[1]-P)/8;return _?[].concat(Lb.stops).reverse().map((N,F)=>[P+F*O,N[1]]):Lb.stops.map((N,F)=>[P+F*O,N[1]])},[g]),I=b?{...vS.paint,"circle-color":{property:b,stops:T}}:vS.paint;return A(nr,{children:A(Td,{...vS,id:Ci.consumer,source:"points","source-layer":"public.data",layout:{visibility:e[Ci.consumer]?"visible":"none"},filter:v(),paint:I})})},Sbe=["==",["get","point_type"],Ci.dispatcher],Ebe=()=>{const{isVisible:e}=w1(),{filters:{region:t}}=qi(),n=bI(t),{selectedSourceConfig:r}=Kd(),i=()=>{const o=["all",Sbe];return n&&o.push(n),r.sourceId&&o.push(["==",["get","ods_number"],r.dispatcherNumber]),o};return A(nr,{children:A(Td,{type:WA("dispatcherIcon").type,id:Ci.dispatcher,source:"points","source-layer":"public.data",layout:{...WA("dispatcherIcon").layout,visibility:e[Ci.dispatcher]?"visible":"none"},filter:i()})})},Pbe=()=>{const{source_filter:e}=qi(),{value:t}=ss(),n=Vi[t];return[...(()=>{if(e){const i=`${e.key}_${n}`;return[[">=",["get",i],e.gt],["<=",["get",i],e.lt]]}return[]})()]},Tbe=["==",["get","point_type"],Ci.source],Ibe=()=>{const{isVisible:e}=w1(),{filters:{region:t},source_filter:n}=qi(),r=bI(t),i=Pbe(),{selectedSourceConfig:o}=Kd(),{value:s}=ss(),a=()=>{const p=["all",Tbe,...i];return r&&p.push(r),o.sourceId&&p.push(["==",["get","tp_number"],o.sourceId]),p},c=n!=null&&n.key?`${n.key}_${Vi[s]}`:null,f=c?{...yS.paint,"circle-color":{property:c,stops:JU.stops}}:yS.paint;return A(nr,{children:A(Td,{...yS,id:Ci.source,source:"points","source-layer":"public.data",layout:{visibility:e[Ci.source]?"visible":"none"},filter:a(),paint:f})})},kbe=()=>{const{updateCounter:e}=QU();return A(nr,{children:it(xg,{id:"points",type:"vector",tiles:[`${Ib}/martin/public.data/{z}/{x}/{y}.pbf`],children:[A(Ibe,{}),A(Cbe,{}),A(Ebe,{})]},`points-${e}`)})},Mbe=({data:e})=>A(xg,{id:"selected-region",type:"geojson",data:e,children:A(Td,{...xbe})}),Rbe=()=>{const{filters:{region:e}}=qi();return e!=null&&e.geometry?A(Mbe,{data:e.geometry}):null},Dbe=()=>it(nr,{children:[A(xg,{id:"ao",type:"vector",tiles:[`${Ib}/martin/public.service_ao/{z}/{x}/{y}.pbf`],children:A(Td,{...GA,layout:{...GA.layout}})}),A(xg,{id:"rayon",type:"vector",tiles:[`${Ib}/martin/public.service_rayon/{z}/{x}/{y}.pbf`],children:A(Td,{...qA,layout:{...qA.layout}})}),A(Rbe,{}),A(kbe,{})]}),Obe=({lat:e,lng:t,onClose:n,children:r})=>A(eZ,{longitude:t,latitude:e,onClose:n,closeOnClick:!1,style:{minWidth:"330px"},children:r}),xS=[{name:"\u0410\u0434\u0440\u0435\u0441",field:"building_address"},{name:"\u041D\u043E\u043C\u0435\u0440 \u0422\u041F",field:"tp_number"},{name:"\u041D\u043E\u043C\u0435\u0440 \u041E\u0414\u0421",field:"ods_number"},{name:"\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u041E\u0414\u0421",field:"phone_number"}];function t7(e,t){const n=window.document.createElement("a");n.href=window.URL.createObjectURL(new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}const td=e=>e==null||e==="",Abe=[{field:"prob1",name:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043E\u0442\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0432 \u0434\u043E\u043C\u0435"},{field:"prob2",name:"\u041F\u0440\u043E\u0442\u0435\u0447\u043A\u0430 \u0442\u0440\u0443\u0431 \u0432 \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u0435"},{field:"prob3",name:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432 \u043A\u0432\u0430\u0440\u0442\u0438\u0440\u0435 \u043D\u0438\u0436\u0435 \u043D\u043E\u0440\u043C\u0430\u0442\u0438\u0432\u043D\u043E\u0439"},{field:"prob4",name:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432 \u043F\u043E\u043C\u0435\u0449\u0435\u043D\u0438\u0438 \u043E\u0431\u0449\u0435\u0433\u043E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u043D\u0438\u0436\u0435 \u043D\u043E\u0440\u043C\u0430\u0442\u0438\u0432\u043D\u043E\u0439"},{field:"prob5",name:"\u0422\u0435\u0447\u044C \u0432 \u0441\u0438\u0441\u0442\u0435\u043C\u0435 \u043E\u0442\u043E\u043F\u043B\u0435\u043D\u0438\u044F"},{field:"cooling_time",name:"\u0412\u0440\u0435\u043C\u044F \u043E\u0441\u0442\u044B\u0432\u0430\u043D\u0438\u044F (\u0447\u0430\u0441\u044B)"},{field:"priority",name:"\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442 \u0437\u0434\u0430\u043D\u0438\u044F"}],Nbe=({feature:e})=>{const{data:t}=lI(),{setSelectedSourceConfig:n}=Kd(),{value:r}=ss(),i=e.properties.point_type==="tp",o=e.properties.point_type==="ods",s=()=>{if(o)return xS;if(i)return[...xS,{field:`prob6_${Vi[r]}`,name:"\u0410\u0432\u0430\u0440\u0438\u044F \u043D\u0430 \u0422\u041F"}];const f=Abe.map(p=>({...p,field:`${p.field}_${Vi[r]}`}));return[...xS,...f]},a=({field:f,render:p,empty:g,type:v,fallbackField:b})=>{let _=e.properties[f];return v==="region"?(_=_||e[b],_=p(_,t==null?void 0:t.normalized)):(_=p?p(_):_,_=td(_)&&g?g:_),_},c=()=>n({pointId:e.properties.id,sourceId:e.properties.tp_number,dispatcherNumber:e.properties.ods_number});return it("div",{children:[s().map(f=>it(ad,{className:"p-1",children:[A(_b,{className:"font-semibold",span:12,children:f.name}),A(_b,{span:12,className:"text-right",children:a(f)})]},f.field)),i?A("div",{className:"mt-3 text-center",children:A(Yr,{type:"primary",onClick:c,children:"\u0421\u043C\u043E\u0434\u0435\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0430\u0432\u0430\u0440\u0438\u044E"})}):null]})},Lbe=e=>({popup:null,setPopup:t=>{e(n=>{if(!t)return n.popup=null,n;n.popup=t})}}),C1=hc(pc(Lbe));/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License */function _v(e){return e+.5|0}const zu=(e,t,n)=>Math.max(Math.min(e,n),t);function Im(e){return zu(_v(e*2.55),0,255)}function Yu(e){return zu(_v(e*255),0,255)}function Ll(e){return zu(_v(e/2.55)/100,0,1)}function ZA(e){return zu(_v(e*100),0,100)}const Ka={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},bE=[..."0123456789ABCDEF"],Fbe=e=>bE[e&15],zbe=e=>bE[(e&240)>>4]+bE[e&15],C0=e=>(e&240)>>4===(e&15),$be=e=>C0(e.r)&&C0(e.g)&&C0(e.b)&&C0(e.a);function Bbe(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Ka[e[1]]*17,g:255&Ka[e[2]]*17,b:255&Ka[e[3]]*17,a:t===5?Ka[e[4]]*17:255}:(t===7||t===9)&&(n={r:Ka[e[1]]<<4|Ka[e[2]],g:Ka[e[3]]<<4|Ka[e[4]],b:Ka[e[5]]<<4|Ka[e[6]],a:t===9?Ka[e[7]]<<4|Ka[e[8]]:255})),n}const Vbe=(e,t)=>e<255?t(e):"";function Ube(e){var t=$be(e)?Fbe:zbe;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Vbe(e.a,t):void 0}const jbe=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function n7(e,t,n){const r=t*Math.min(n,1-n),i=(o,s=(o+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function Hbe(e,t,n){const r=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function Kbe(e,t,n){const r=n7(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Wbe(e,t,n,r,i){return e===i?(t-n)/r+(t.5?p/(2-o-s):p/(o+s),c=Wbe(n,r,i,p,o),c=c*60+.5),[c|0,f||0,a]}function wI(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Yu)}function CI(e,t,n){return wI(n7,e,t,n)}function Gbe(e,t,n){return wI(Kbe,e,t,n)}function qbe(e,t,n){return wI(Hbe,e,t,n)}function r7(e){return(e%360+360)%360}function Zbe(e){const t=jbe.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Im(+t[5]):Yu(+t[5]));const i=r7(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=Gbe(i,o,s):t[1]==="hsv"?r=qbe(i,o,s):r=CI(i,o,s),{r:r[0],g:r[1],b:r[2],a:n}}function Xbe(e,t){var n=_I(e);n[0]=r7(n[0]+t),n=CI(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Ybe(e){if(!e)return;const t=_I(e),n=t[0],r=ZA(t[1]),i=ZA(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Ll(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const XA={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},YA={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Qbe(){const e={},t=Object.keys(YA),n=Object.keys(XA);let r,i,o,s,a;for(r=0;r>16&255,o>>8&255,o&255]}return e}let S0;function Jbe(e){S0||(S0=Qbe(),S0.transparent=[0,0,0,0]);const t=S0[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const e_e=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function t_e(e){const t=e_e.exec(e);let n=255,r,i,o;if(!!t){if(t[7]!==r){const s=+t[7];n=t[8]?Im(s):zu(s*255,0,255)}return r=+t[1],i=+t[3],o=+t[5],r=255&(t[2]?Im(r):zu(r,0,255)),i=255&(t[4]?Im(i):zu(i,0,255)),o=255&(t[6]?Im(o):zu(o,0,255)),{r,g:i,b:o,a:n}}}function n_e(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ll(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const bS=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,If=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function r_e(e,t,n){const r=If(Ll(e.r)),i=If(Ll(e.g)),o=If(Ll(e.b));return{r:Yu(bS(r+n*(If(Ll(t.r))-r))),g:Yu(bS(i+n*(If(Ll(t.g))-i))),b:Yu(bS(o+n*(If(Ll(t.b))-o))),a:e.a+n*(t.a-e.a)}}function E0(e,t,n){if(e){let r=_I(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=CI(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function i7(e,t){return e&&Object.assign(t||{},e)}function QA(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Yu(e[3]))):(t=i7(e,{r:0,g:0,b:0,a:1}),t.a=Yu(t.a)),t}function i_e(e){return e.charAt(0)==="r"?t_e(e):Zbe(e)}class Dg{constructor(t){if(t instanceof Dg)return t;const n=typeof t;let r;n==="object"?r=QA(t):n==="string"&&(r=Bbe(t)||Jbe(t)||i_e(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=i7(this._rgb);return t&&(t.a=Ll(t.a)),t}set rgb(t){this._rgb=QA(t)}rgbString(){return this._valid?n_e(this._rgb):void 0}hexString(){return this._valid?Ube(this._rgb):void 0}hslString(){return this._valid?Ybe(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let o;const s=n===o?.5:n,a=2*s-1,c=r.a-i.a,f=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-f,r.r=255&f*r.r+o*i.r+.5,r.g=255&f*r.g+o*i.g+.5,r.b=255&f*r.b+o*i.b+.5,r.a=s*r.a+(1-s)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=r_e(this._rgb,t._rgb,n)),this}clone(){return new Dg(this.rgb)}alpha(t){return this._rgb.a=Yu(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=_v(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return E0(this._rgb,2,t),this}darken(t){return E0(this._rgb,2,-t),this}saturate(t){return E0(this._rgb,1,t),this}desaturate(t){return E0(this._rgb,1,-t),this}rotate(t){return Xbe(this._rgb,t),this}}/*! * Chart.js v4.4.0 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */function Pl(){}const o_e=(()=>{let e=0;return()=>e++})();function Mr(e){return e===null||typeof e>"u"}function ai(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function _r(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function to(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ga(e,t){return to(e)?e:t}function sr(e,t){return typeof e>"u"?t:e}const a_e=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Zr(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function kr(e,t,n,r){let i,o,s;if(ai(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function u_e(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function c_e(e){const t=u_e(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Eh(e,t){return(JA[t]||(JA[t]=c_e(t)))(e)}function SI(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ag=e=>typeof e<"u",ac=e=>typeof e=="function",eN=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function d_e(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Li=Math.PI,ns=2*Li,f_e=ns+Li,Bb=Number.POSITIVE_INFINITY,h_e=Li/180,ba=Li/2,Hc=Li/4,tN=Li*2/3,$u=Math.log10,il=Math.sign;function Xm(e,t,n){return Math.abs(e-t)i-o).pop(),t}function Ng(e){return!isNaN(parseFloat(e))&&isFinite(e)}function m_e(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function a7(e,t,n){let r,i,o;for(r=0,i=e.length;rc&&f=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function PI(e,t,n){n=n||(s=>e[s]1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const md=(e,t,n,r)=>PI(e,n,r?i=>{const o=e[i][t];return oe[i][t]PI(e,n,r=>e[r][t]>=n);function b_e(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{const r="_onData"+SI(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function iN(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(l7.forEach(o=>{delete e[o]}),delete e._chartjs)}function u7(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const c7=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function d7(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,c7.call(window,()=>{r=!1,e.apply(t,n)}))}}function w_e(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const TI=e=>e==="start"?"left":e==="end"?"right":"center",Co=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,C_e=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function S_e(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,c=s.axis,{min:f,max:p,minDefined:g,maxDefined:v}=s.getUserBounds();g&&(i=_a(Math.min(md(a,c,f).lo,n?r:md(t,c,s.getPixelForValue(f)).lo),0,r-1)),v?o=_a(Math.max(md(a,s.axis,p,!0).hi+1,n?0:md(t,c,s.getPixelForValue(p),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function E_e(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const P0=e=>e===0||e===1,oN=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ns/n)),aN=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ns/n)+1,Ym={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ba)+1,easeOutSine:e=>Math.sin(e*ba),easeInOutSine:e=>-.5*(Math.cos(Li*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>P0(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>P0(e)?e:oN(e,.075,.3),easeOutElastic:e=>P0(e)?e:aN(e,.075,.3),easeInOutElastic(e){return P0(e)?e:e<.5?.5*oN(e*2,.1125,.45):.5+.5*aN(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Ym.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Ym.easeInBounce(e*2)*.5:Ym.easeOutBounce(e*2-1)*.5+.5};function II(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function sN(e){return II(e)?e:new Dg(e)}function _S(e){return II(e)?e:new Dg(e).saturate(.5).darken(.1).hexString()}const P_e=["x","y","borderWidth","radius","tension"],T_e=["color","borderColor","backgroundColor"];function I_e(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:T_e},numbers:{type:"number",properties:P_e}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function k_e(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const lN=new Map;function M_e(e,t){t=t||{};const n=e+JSON.stringify(t);let r=lN.get(n);return r||(r=new Intl.NumberFormat(e,t),lN.set(n,r)),r}function kI(e,t,n){return M_e(t,n).format(e)}const f7={values(e){return ai(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const f=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(f<1e-4||f>1e15)&&(i="scientific"),o=R_e(e,n)}const s=$u(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),kI(e,r,c)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor($u(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?f7.numeric.call(this,e,t,n):""}};function R_e(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var S1={formatters:f7};function D_e(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:S1.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Od=Object.create(null),wE=Object.create(null);function Qm(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;rr.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>_S(i.backgroundColor),this.hoverBorderColor=(r,i)=>_S(i.borderColor),this.hoverColor=(r,i)=>_S(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return wS(this,t,n)}get(t){return Qm(this,t)}describe(t,n){return wS(wE,t,n)}override(t,n){return wS(Od,t,n)}route(t,n,r,i){const o=Qm(this,t),s=Qm(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],f=s[i];return _r(c)?Object.assign({},f,c):sr(c,f)},set(c){this[a]=c}}})}apply(t){t.forEach(n=>n(this))}}var vi=new O_e({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[I_e,k_e,D_e]);function A_e(e){return!e||Mr(e.size)||Mr(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Vb(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function N_e(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let c,f,p,g,v;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function Bl(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let c,f;for(e.save(),e.font=i.string,z_e(e,o),c=0;c+e||0;function p7(e,t){const n={},r=_r(t),i=r?Object.keys(t):t,o=_r(e)?r?s=>sr(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=H_e(o(s));return n}function m7(e){return p7(e,{top:"y",right:"x",bottom:"y",left:"x"})}function bd(e){return p7(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Io(e){const t=m7(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ji(e,t){e=e||{},t=t||vi.font;let n=sr(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=sr(e.style,t.style);r&&!(""+r).match(U_e)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:sr(e.family,t.family),lineHeight:j_e(sr(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:sr(e.weight,t.weight),string:""};return i.string=A_e(i),i}function T0(e,t,n,r){let i=!0,o,s,a;for(o=0,s=e.length;on&&a===0?0:a+c;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function mc(e,t){return Object.assign(Object.create(e),t)}function DI(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=x7("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>DI([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return v7(a,c,()=>J_e(c,t,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return dN(a).includes(c)},ownKeys(a){return dN(a)},set(a,c,f){const p=a._storage||(a._storage=i());return a[c]=p[c]=f,delete a._keys,!0}})}function Ph(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:g7(e,r),setContext:o=>Ph(e,o,n,r),override:o=>Ph(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return v7(o,s,()=>G_e(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function g7(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:ac(n)?n:()=>n,isIndexable:ac(r)?r:()=>r}}const W_e=(e,t)=>e?e+SI(t):t,OI=(e,t)=>_r(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function v7(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function G_e(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return ac(a)&&s.isScriptable(t)&&(a=q_e(t,a,e,n)),ai(a)&&a.length&&(a=Z_e(t,a,e,s.isIndexable)),OI(t,a)&&(a=Ph(a,i,o&&o[t],s)),a}function q_e(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let c=t(o,s||r);return a.delete(e),OI(e,c)&&(c=AI(i._scopes,i,e,c)),c}function Z_e(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(_r(t[0])){const c=t,f=i._scopes.filter(p=>p!==c);t=[];for(const p of c){const g=AI(f,i,e,p);t.push(Ph(g,o,s&&s[e],a))}}return t}function y7(e,t,n){return ac(e)?e(t,n):e}const X_e=(e,t)=>e===!0?t:typeof e=="string"?Eh(t,e):void 0;function Y_e(e,t,n,r,i){for(const o of t){const s=X_e(n,o);if(s){e.add(s);const a=y7(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function AI(e,t,n,r){const i=t._rootScopes,o=y7(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let c=cN(a,s,n,o||n,r);return c===null||typeof o<"u"&&o!==n&&(c=cN(a,s,o,c,r),c===null)?!1:DI(Array.from(a),[""],i,o,()=>Q_e(t,n,r))}function cN(e,t,n,r,i){for(;n;)n=Y_e(e,t,n,r,i);return n}function Q_e(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return ai(i)&&_r(n)?n:i||{}}function J_e(e,t,n,r){let i;for(const o of t)if(i=x7(W_e(o,e),n),typeof i<"u")return OI(e,i)?AI(n,r,e,i):i}function x7(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function dN(e){let t=e._keys;return t||(t=e._keys=e1e(e._scopes)),t}function e1e(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}const t1e=Number.EPSILON||1e-14,Th=(e,t)=>te==="x"?"y":"x";function n1e(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=_E(o,i),c=_E(s,o);let f=a/(a+c),p=c/(a+c);f=isNaN(f)?0:f,p=isNaN(p)?0:p;const g=r*f,v=r*p;return{previous:{x:o.x-g*(s.x-i.x),y:o.y-g*(s.y-i.y)},next:{x:o.x+v*(s.x-i.x),y:o.y+v*(s.y-i.y)}}}function r1e(e,t,n){const r=e.length;let i,o,s,a,c,f=Th(e,0);for(let p=0;p!f.skip)),t.cubicInterpolationMode==="monotone")o1e(e,i);else{let f=r?e[e.length-1]:e[0];for(o=0,s=e.length;oe.ownerDocument.defaultView.getComputedStyle(e,null);function l1e(e,t){return E1(e).getPropertyValue(t)}const u1e=["top","right","bottom","left"];function _d(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=u1e[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const c1e=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function d1e(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,c;if(c1e(i,o,e.target))a=i,c=o;else{const f=t.getBoundingClientRect();a=r.clientX-f.left,c=r.clientY-f.top,s=!0}return{x:a,y:c,box:s}}function nd(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=E1(n),o=i.boxSizing==="border-box",s=_d(i,"padding"),a=_d(i,"border","width"),{x:c,y:f,box:p}=d1e(e,n),g=s.left+(p&&a.left),v=s.top+(p&&a.top);let{width:b,height:_}=t;return o&&(b-=s.width+a.width,_-=s.height+a.height),{x:Math.round((c-g)/b*n.width/r),y:Math.round((f-v)/_*n.height/r)}}function f1e(e,t,n){let r,i;if(t===void 0||n===void 0){const o=NI(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=E1(o),c=_d(a,"border","width"),f=_d(a,"padding");t=s.width-f.width-c.width,n=s.height-f.height-c.height,r=Ub(a.maxWidth,o,"clientWidth"),i=Ub(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Bb,maxHeight:i||Bb}}const k0=e=>Math.round(e*10)/10;function h1e(e,t,n,r){const i=E1(e),o=_d(i,"margin"),s=Ub(i.maxWidth,e,"clientWidth")||Bb,a=Ub(i.maxHeight,e,"clientHeight")||Bb,c=f1e(e,t,n);let{width:f,height:p}=c;if(i.boxSizing==="content-box"){const v=_d(i,"border","width"),b=_d(i,"padding");f-=b.width+v.width,p-=b.height+v.height}return f=Math.max(0,f-o.width),p=Math.max(0,r?f/r:p-o.height),f=k0(Math.min(f,s,c.maxWidth)),p=k0(Math.min(p,a,c.maxHeight)),f&&!p&&(p=k0(f/2)),(t!==void 0||n!==void 0)&&r&&c.height&&p>c.height&&(p=c.height,f=k0(Math.floor(p*r))),{width:f,height:p}}function fN(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const p1e=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function hN(e,t){const n=l1e(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function rd(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function m1e(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function g1e(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=rd(e,i,n),a=rd(i,o,n),c=rd(o,t,n),f=rd(s,a,n),p=rd(a,c,n);return rd(f,p,n)}const v1e=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},y1e=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function oh(e,t,n){return e?v1e(t,n):y1e()}function w7(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function C7(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function S7(e){return e==="angle"?{between:s7,compare:v_e,normalize:Cs}:{between:pd,compare:(t,n)=>t-n,normalize:t=>t}}function pN({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function x1e(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=S7(r),c=t.length;let{start:f,end:p,loop:g}=e,v,b;if(g){for(f+=c,p+=c,v=0,b=c;vc(i,O,P)&&a(i,O)!==0,F=()=>a(o,P)===0||c(o,O,P),$=()=>T||N(),j=()=>!T||F();for(let U=p,q=p;U<=g;++U)M=t[U%s],!M.skip&&(P=f(M[r]),P!==O&&(T=c(P,i,o),I===null&&$()&&(I=a(P,i)===0?U:q),I!==null&&j()&&(_.push(pN({start:I,end:U,loop:v,count:s,style:b})),I=null),q=U,O=P));return I!==null&&_.push(pN({start:I,end:g,loop:v,count:s,style:b})),_}function _1e(e,t){const n=[],r=e.segments;for(let i=0;ii&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function C1e(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],c;for(c=t+1;c<=n;++c){const f=e[c%i];f.skip||f.stop?a.skip||(r=!1,o.push({start:t%i,end:(c-1)%i,loop:r}),t=s=f.stop?c:null):(s=c,a.skip&&(t=c)),a=f}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function S1e(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=w1e(n,i,o,r);if(r===!0)return mN(e,[{start:s,end:a,loop:o}],n,t);const c=aa({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=c7.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,c;for(;s>=0;--s)c=o[s],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);!n||(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Il=new T1e;const vN="transparent",I1e={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=sN(e||vN),i=r.valid&&sN(t||vN);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class k1e{constructor(t,n,r,i){const o=n[r];i=T0([t.to,i,o,t.from]);const s=T0([t.from,o,i]);this._active=!0,this._fn=t.fn||I1e[t.type||typeof s],this._easing=Ym[t.easing]||Ym.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=T0([t.to,n,i,t.from]),this._from=T0([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let c;if(this._active=o!==a&&(s||n1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[i]=this._fn(o,a,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i{const o=t[i];if(!_r(o))return;const s={};for(const a of n)s[a]=o[a];(ai(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=R1e(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&M1e(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let c;for(c=s.length-1;c>=0;--c){const f=s[c];if(f.charAt(0)==="$")continue;if(f==="options"){i.push(...this._animateOptions(t,n));continue}const p=n[f];let g=o[f];const v=r.get(f);if(g)if(v&&g.active()){g.update(v,p,a);continue}else g.cancel();if(!v||!v.duration){t[f]=p;continue}o[f]=g=new k1e(v,t,f,p),i.push(g)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Il.add(this._chart,r),!0}}function M1e(e,t){const n=[],r=Object.keys(t);for(let i=0;i0||!n&&o<0)return i.index}return null}function wN(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,c=o.axis,f=s.axis,p=N1e(o,s,r),g=t.length;let v;for(let b=0;bn[r].axis===t).shift()}function z1e(e,t){return mc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function $1e(e,t,n){return mc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function cm(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(!!r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const SS=e=>e==="reset"||e==="none",CN=(e,t)=>t?e:Object.assign({},e),B1e=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:P7(n,!0),values:null};class ah{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=bN(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&cm(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(g,v,b,_)=>g==="x"?v:g==="r"?_:b,o=n.xAxisID=sr(r.xAxisID,CS(t,"x")),s=n.yAxisID=sr(r.yAxisID,CS(t,"y")),a=n.rAxisID=sr(r.rAxisID,CS(t,"r")),c=n.indexAxis,f=n.iAxisID=i(c,o,s,a),p=n.vAxisID=i(c,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(f),n.vScale=this.getScaleForId(p)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&iN(this._data,this),t._stacked&&cm(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(_r(n))this._data=A1e(n);else if(r!==n){if(r){iN(r,this);const i=this._cachedMeta;cm(i),i._parsed=[]}n&&Object.isExtensible(n)&&__e(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=bN(n.vScale,n),n.stack!==r.stack&&(i=!0,cm(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&wN(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let c=t===0&&n===i.length?!0:r._sorted,f=t>0&&r._parsed[t-1],p,g,v;if(this._parsing===!1)r._parsed=i,r._sorted=!0,v=i;else{ai(i[t])?v=this.parseArrayData(r,i,t,n):_r(i[t])?v=this.parseObjectData(r,i,t,n):v=this.parsePrimitiveData(r,i,t,n);const b=()=>g[a]===null||f&&g[a]T||g=0;--v)if(!_()){this.updateRangeFromParsed(f,t,b,c);break}}return f}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i=0&&tthis.getContext(r,i,n),T=f.resolveNamedOptions(v,b,_,g);return T.$shared&&(T.$shared=c,o[s]=Object.freeze(CN(T,c))),T}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let c;if(i.options.animation!==!1){const p=this.chart.config,g=p.datasetAnimationScopeKeys(this._type,n),v=p.getOptionScopes(this.getDataset(),g);c=p.createResolver(v,this.getContext(t,r,n))}const f=new E7(i,c&&c.animations);return c&&c._cacheable&&(o[s]=Object.freeze(f)),f}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||SS(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){SS(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!SS(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,c,f]of this._syncList)this[a](c,f);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o{for(f.length+=n,a=f.length-1;a>=s;a--)f[a]=f[a-n]};for(c(o),a=t;ai-o))}return e._cache.$bar}function U1e(e){const t=e.iScale,n=V1e(t,e.type);let r=t._length,i,o,s,a;const c=()=>{s===32767||s===-32768||(Ag(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i0?i[e-1]:null,a=eMath.abs(a)&&(c=a,f=s),t[n.axis]=f,t._custom={barStart:c,barEnd:f,start:i,end:o,min:s,max:a}}function T7(e,t,n,r){return ai(e)?K1e(e,t,n,r):t[n.axis]=n.parse(e,r),t}function SN(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,c=[];let f,p,g,v;for(f=n,p=n+r;f=n?1:-1)}function G1e(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.basec.controller.options.grouped),o=r.options.stacked,s=[],a=c=>{const f=c.controller.getParsed(n),p=f&&f[c.vScale.axis];if(Mr(p)||isNaN(p))return!0};for(const c of i)if(!(n!==void 0&&a(c))&&((o===!1||s.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&s.push(c.stack),c.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o0&&this.getParsed(n-1);for(let F=0;F=M){j.skip=!0;continue}const U=this.getParsed(F),q=Mr(U[b]),Y=j[v]=s.getPixelForValue(U[v],F),te=j[b]=o||q?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,U,c):U[b],F);j.skip=isNaN(Y)||isNaN(te)||q,j.stop=F>0&&Math.abs(U[v]-N[v])>I,T&&(j.parsed=U,j.raw=f.data[F]),g&&(j.options=p||this.resolveDataElementOptions(F,$.active?"active":i)),P||this.updateElement($,F,j,i),N=U}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ln(_x,"id","line"),Ln(_x,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ln(_x,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Wc(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class LI{constructor(t){Ln(this,"options");this.options=t||{}}static override(t){Object.assign(LI.prototype,t)}init(){}formats(){return Wc()}parse(){return Wc()}format(){return Wc()}add(){return Wc()}diff(){return Wc()}startOf(){return Wc()}endOf(){return Wc()}}var Y1e={_date:LI};function Q1e(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const c=a._reversePixels?x_e:md;if(r){if(i._sharedOptions){const f=o[0],p=typeof f.getRange=="function"&&f.getRange(t);if(p){const g=c(o,t,n-p),v=c(o,t,n+p);return{lo:g.lo,hi:v.hi}}}}else return c(o,t,n)}return{lo:0,hi:o.length-1}}function wv(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,c=o.length;a{c[s](t[n],i)&&(o.push({element:c,datasetIndex:f,index:p}),a=a||c.inRange(t.x,t.y,i))}),r&&!a?[]:o}var nwe={evaluateInteractionItems:wv,modes:{index(e,t,n,r){const i=nd(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?PS(e,i,o,r,s):TS(e,i,o,!1,r,s),c=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(f=>{const p=a[0].index,g=f.data[p];g&&!g.skip&&c.push({element:g,datasetIndex:f.index,index:p})}),c):[]},dataset(e,t,n,r){const i=nd(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?PS(e,i,o,r,s):TS(e,i,o,!1,r,s);if(a.length>0){const c=a[0].datasetIndex,f=e.getDatasetMeta(c).data;a=[];for(let p=0;pn.pos===t)}function IN(e,t){return e.filter(n=>I7.indexOf(n.pos)===-1&&n.box.axis===t)}function fm(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function rwe(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;nf.box.fullSize),!0),r=fm(dm(t,"left"),!0),i=fm(dm(t,"right")),o=fm(dm(t,"top"),!0),s=fm(dm(t,"bottom")),a=IN(t,"x"),c=IN(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(c).concat(s).concat(a),chartArea:dm(t,"chartArea"),vertical:r.concat(i).concat(c),horizontal:o.concat(s).concat(a)}}function kN(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function k7(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function swe(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!_r(i)){n.size&&(e[i]-=n.size);const g=r[n.stack]||{size:0,count:1};g.size=Math.max(g.size,n.horizontal?o.height:o.width),n.size=g.size/g.count,e[i]+=n.size}o.getPadding&&k7(s,o.getPadding());const a=Math.max(0,t.outerWidth-kN(s,e,"left","right")),c=Math.max(0,t.outerHeight-kN(s,e,"top","bottom")),f=a!==e.w,p=c!==e.h;return e.w=a,e.h=c,n.horizontal?{same:f,other:p}:{same:p,other:f}}function lwe(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function uwe(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function km(e,t,n,r){const i=[];let o,s,a,c,f,p;for(o=0,s=e.length,f=0;o{typeof T.beforeLayout=="function"&&T.beforeLayout()});const p=c.reduce((T,I)=>I.box.options&&I.box.options.display===!1?T:T+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/p,hBoxMaxHeight:s/2}),v=Object.assign({},i);k7(v,Io(r));const b=Object.assign({maxPadding:v,w:o,h:s,x:i.left,y:i.top},i),_=owe(c.concat(f),g);km(a.fullSize,b,g,_),km(c,b,g,_),km(f,b,g,_)&&km(c,b,g,_),lwe(b),MN(a.leftAndTop,b,g,_),b.x+=b.w,b.y+=b.h,MN(a.rightAndBottom,b,g,_),e.chartArea={left:b.left,top:b.top,right:b.left+b.w,bottom:b.top+b.h,height:b.h,width:b.w},kr(a.chartArea,T=>{const I=T.box;Object.assign(I,e.chartArea),I.update(b.w,b.h,{left:0,top:0,right:0,bottom:0})})}};class M7{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class cwe extends M7{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const wx="$chartjs",dwe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},RN=e=>e===null||e==="";function fwe(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[wx]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",RN(i)){const o=hN(e,"width");o!==void 0&&(e.width=o)}if(RN(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=hN(e,"height");o!==void 0&&(e.height=o)}return e}const R7=p1e?{passive:!0}:!1;function hwe(e,t,n){e.addEventListener(t,n,R7)}function pwe(e,t,n){e.canvas.removeEventListener(t,n,R7)}function mwe(e,t){const n=dwe[e.type]||e.type,{x:r,y:i}=nd(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function jb(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function gwe(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||jb(a.addedNodes,r),s=s&&!jb(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function vwe(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||jb(a.removedNodes,r),s=s&&!jb(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Fg=new Map;let DN=0;function D7(){const e=window.devicePixelRatio;e!==DN&&(DN=e,Fg.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ywe(e,t){Fg.size||window.addEventListener("resize",D7),Fg.set(e,t)}function xwe(e){Fg.delete(e),Fg.size||window.removeEventListener("resize",D7)}function bwe(e,t,n){const r=e.canvas,i=r&&NI(r);if(!i)return;const o=d7((a,c)=>{const f=i.clientWidth;n(a,c),f{const c=a[0],f=c.contentRect.width,p=c.contentRect.height;f===0&&p===0||o(f,p)});return s.observe(i),ywe(e,o),s}function IS(e,t,n){n&&n.disconnect(),t==="resize"&&xwe(e)}function _we(e,t,n){const r=e.canvas,i=d7(o=>{e.ctx!==null&&n(mwe(o,e))},e);return hwe(r,t,i),i}class wwe extends M7{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(fwe(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[wx])return!1;const r=n[wx].initial;["height","width"].forEach(o=>{const s=r[o];Mr(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[wx],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:gwe,detach:vwe,resize:bwe}[n]||_we;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:IS,detach:IS,resize:IS}[n]||pwe)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return h1e(t,n,r,i)}isAttached(t){const n=NI(t);return!!(n&&n.isConnected)}}function Cwe(e){return!_7()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?cwe:wwe}class ol{constructor(){Ln(this,"x");Ln(this,"y");Ln(this,"active",!1);Ln(this,"options");Ln(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ng(this.x)&&Ng(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}}Ln(ol,"defaults",{}),Ln(ol,"defaultRoutes");function Swe(e,t){const n=e.options.ticks,r=Ewe(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?Twe(t):[],s=o.length,a=o[0],c=o[s-1],f=[];if(s>i)return Iwe(t,f,o,s/i),f;const p=Pwe(o,t,i);if(s>0){let g,v;const b=s>1?Math.round((c-a)/(s-1)):null;for(R0(t,f,p,Mr(b)?0:a-b,a),g=0,v=s-1;gi)return c}return Math.max(i,1)}function Twe(e){const t=[];let n,r;for(n=0,r=e.length;ne==="left"?"right":e==="right"?"left":e,ON=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,AN=(e,t)=>Math.min(t||e,e);function NN(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;os+a)))return c}function Dwe(e,t){kr(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;or?r:n,r=i&&n>r?n:r,{min:ga(n,ga(r,n)),max:ga(r,ga(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Zr(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=K_e(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const p=this._getLabelSizes(),g=p.widest.width,v=p.highest.height,b=_a(this.chart.width-g,0,this.maxWidth);a=t.offset?this.maxWidth/r:b/(r-1),g+6>a&&(a=b/(r-(t.offset?.5:1)),c=this.maxHeight-hm(t.grid)-n.padding-LN(t.title,this.chart.options.font),f=Math.sqrt(g*g+v*v),s=EI(Math.min(Math.asin(_a((p.highest.height+6)/a,-1,1)),Math.asin(_a(c/f,-1,1))-Math.asin(_a(v/f,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){Zr(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Zr(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const c=LN(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=hm(o)+c):(t.height=this.maxHeight,t.width=hm(o)+c),r.display&&this.ticks.length){const{first:f,last:p,widest:g,highest:v}=this._getLabelSizes(),b=r.padding*2,_=Bu(this.labelRotation),T=Math.cos(_),I=Math.sin(_);if(a){const P=r.mirror?0:I*g.width+T*v.height;t.height=Math.min(this.maxHeight,t.height+P+b)}else{const P=r.mirror?0:T*g.width+I*v.height;t.width=Math.min(this.maxWidth,t.width+P+b)}this._calculatePadding(f,p,I,T)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,c=this.labelRotation!==0,f=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const p=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let v=0,b=0;c?f?(v=i*t.width,b=r*n.height):(v=r*t.height,b=i*n.width):o==="start"?b=n.width:o==="end"?v=t.width:o!=="inner"&&(v=t.width/2,b=n.width/2),this.paddingLeft=Math.max((v-p+s)*this.width/(this.width-p),0),this.paddingRight=Math.max((b-g+s)*this.width/(this.width-g),0)}else{let p=n.height/2,g=t.height/2;o==="start"?(p=0,g=t.height):o==="end"&&(p=n.height,g=0),this.paddingTop=p+s,this.paddingBottom=g+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Zr(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n({width:s[q]||0,height:a[q]||0});return{first:U(0),last:U(n-1),widest:U($),highest:U(j),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return y_e(this._alignToPixels?Kc(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*i?a/r:c/i:c*i0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,c=o.offset,f=this.isHorizontal(),g=this.ticks.length+(c?1:0),v=hm(o),b=[],_=a.setContext(this.getContext()),T=_.display?_.width:0,I=T/2,P=function(re){return Kc(r,re,T)};let M,O,N,F,$,j,U,q,Y,te,Z,X;if(s==="top")M=P(this.bottom),j=this.bottom-v,q=M-I,te=P(t.top)+I,X=t.bottom;else if(s==="bottom")M=P(this.top),te=t.top,X=P(t.bottom)-I,j=M+I,q=this.top+v;else if(s==="left")M=P(this.right),$=this.right-v,U=M-I,Y=P(t.left)+I,Z=t.right;else if(s==="right")M=P(this.left),Y=t.left,Z=P(t.right)-I,$=M+I,U=this.left+v;else if(n==="x"){if(s==="center")M=P((t.top+t.bottom)/2+.5);else if(_r(s)){const re=Object.keys(s)[0],se=s[re];M=P(this.chart.scales[re].getPixelForValue(se))}te=t.top,X=t.bottom,j=M+I,q=j+v}else if(n==="y"){if(s==="center")M=P((t.left+t.right)/2);else if(_r(s)){const re=Object.keys(s)[0],se=s[re];M=P(this.chart.scales[re].getPixelForValue(se))}$=M-I,U=$-v,Y=t.left,Z=t.right}const J=sr(i.ticks.maxTicksLimit,g),ce=Math.max(1,Math.ceil(g/J));for(O=0;Oo.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(c,f,p)=>{!p.width||!p.color||(r.save(),r.lineWidth=p.width,r.strokeStyle=p.color,r.setLineDash(p.borderDash||[]),r.lineDashOffset=p.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(f.x,f.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),c=s.join(".");vi.route(o,i,c,a)})}function $we(e){return"id"in e&&"defaults"in e}class Bwe{constructor(){this.controllers=new D0(ah,"datasets",!0),this.elements=new D0(ol,"elements"),this.plugins=new D0(Object,"plugins"),this.scales=new D0(Wd,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):kr(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=SI(t);Zr(r["before"+i],[],r),n[t](r),Zr(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;no.filter(a=>!s.some(c=>a.plugin.id===c.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function Uwe(e){const t={},n=[],r=Object.keys(qs.plugins.items);for(let o=0;o1&&FN(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function zN(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Zwe(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return zN(e,"x",n[0])||zN(e,"y",n[0])}return{}}function Xwe(e,t){const n=Od[e.type]||{scales:{}},r=t.scales||{},i=SE(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!_r(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const c=EE(s,a,Zwe(s,e),vi.scales[a.type]),f=Gwe(c,i),p=n.scales||{};o[s]=Zm(Object.create(null),[{axis:c},a,p[c],p[f]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,c=s.indexAxis||SE(a,t),p=(Od[a]||{}).scales||{};Object.keys(p).forEach(g=>{const v=Wwe(g,c),b=s[v+"AxisID"]||v;o[b]=o[b]||Object.create(null),Zm(o[b],[{axis:v},r[b],p[g]])})}),Object.keys(o).forEach(s=>{const a=o[s];Zm(a,[vi.scales[a.type],vi.scale])}),o}function O7(e){const t=e.options||(e.options={});t.plugins=sr(t.plugins,{}),t.scales=Xwe(e,t)}function A7(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ywe(e){return e=e||{},e.data=A7(e.data),O7(e),e}const $N=new Map,N7=new Set;function O0(e,t){let n=$N.get(e);return n||(n=t(),$N.set(e,n),N7.add(n)),n}const pm=(e,t,n)=>{const r=Eh(t,n);r!==void 0&&e.add(r)};class Qwe{constructor(t){this._config=Ywe(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=A7(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),O7(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return O0(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return O0(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return O0(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return O0(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const c=new Set;n.forEach(p=>{t&&(c.add(t),p.forEach(g=>pm(c,t,g))),p.forEach(g=>pm(c,i,g)),p.forEach(g=>pm(c,Od[o]||{},g)),p.forEach(g=>pm(c,vi,g)),p.forEach(g=>pm(c,wE,g))});const f=Array.from(c);return f.length===0&&f.push(Object.create(null)),N7.has(n)&&s.set(n,f),f}chartOptionScopes(){const{options:t,type:n}=this;return[t,Od[n]||{},vi.datasets[n]||{},{type:n},vi,wE]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=BN(this._resolverCache,t,i);let c=s;if(eCe(s,n)){o.$shared=!1,r=ac(r)?r():r;const f=this.createResolver(t,r,a);c=Ph(s,r,f)}for(const f of n)o[f]=c[f];return o}createResolver(t,n,r=[""],i){const{resolver:o}=BN(this._resolverCache,t,r);return _r(n)?Ph(o,n,void 0,i):o}}function BN(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:DI(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const Jwe=e=>_r(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||ac(e[n]),!1);function eCe(e,t){const{isScriptable:n,isIndexable:r}=g7(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(ac(a)||Jwe(a))||s&&ai(a))return!0}return!1}var tCe="4.4.0";const nCe=["top","bottom","left","right","chartArea"];function VN(e,t){return e==="top"||e==="bottom"||nCe.indexOf(e)===-1&&t==="x"}function UN(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function jN(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Zr(n&&n.onComplete,[e],t)}function rCe(e){const t=e.chart,n=t.options.animation;Zr(n&&n.onProgress,[e],t)}function L7(e){return _7()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Cx={},HN=e=>{const t=L7(e);return Object.values(Cx).filter(n=>n.canvas===t).pop()};function iCe(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function oCe(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function A0(e,t,n){return e.options.clip?e[n]:t[n]}function aCe(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:A0(n,t,"left"),right:A0(n,t,"right"),top:A0(r,t,"top"),bottom:A0(r,t,"bottom")}:t}class Zs{static register(...t){qs.add(...t),KN()}static unregister(...t){qs.remove(...t),KN()}constructor(t,n){const r=this.config=new Qwe(n),i=L7(t),o=HN(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Cwe(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),c=a&&a.canvas,f=c&&c.height,p=c&&c.width;if(this.id=o_e(),this.ctx=a,this.canvas=c,this.width=p,this.height=f,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Vwe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=w_e(g=>this.update(g),s.resizeDelay||0),this._dataChanges=[],Cx[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Il.listen(this,"complete",jN),Il.listen(this,"progress",rCe),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return Mr(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qs}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():fN(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return uN(this.canvas,this.ctx),this}stop(){return Il.stop(this),this}resize(t,n){Il.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,fN(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Zr(r.onResize,[this,s],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};kr(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],c=EE(s,a),f=c==="r",p=c==="x";return{options:a,dposition:f?"chartArea":p?"bottom":"left",dtype:f?"radialLinear":p?"category":"linear"}}))),kr(o,s=>{const a=s.options,c=a.id,f=EE(c,a),p=sr(a.type,s.dtype);(a.position===void 0||VN(a.position,f)!==VN(s.dposition))&&(a.position=s.dposition),i[c]=!0;let g=null;if(c in r&&r[c].type===p)g=r[c];else{const v=qs.getScale(p);g=new v({id:c,type:p,ctx:this.ctx,chart:this}),r[g.id]=g}g.init(a,t)}),kr(i,(s,a)=>{s||delete r[a]}),kr(r,s=>{Ja.configure(this,s,s.options),Ja.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;in.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let f=0,p=this.data.datasets.length;f{f.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(UN("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){kr(this.scales,t=>{Ja.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!eN(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;iCe(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ja.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],kr(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=aCe(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&MI(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&RI(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Bl(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=nwe.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=mc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);Ag(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Il.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};kr(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(c,f)=>{n.addEventListener(this,c,f),t[c]=f},i=(c,f)=>{t[c]&&(n.removeEventListener(this,c,f),delete t[c])},o=(c,f)=>{this.canvas&&this.resize(c,f)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){kr(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},kr(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,c=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!zb(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(c,f)=>c.filter(p=>!f.some(g=>p.datasetIndex===g.datasetIndex&&p.index===g.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),c=d_e(t),f=oCe(t,this._lastEvent,r,c);r&&(this._lastEvent=null,Zr(o.onHover,[t,a,this],this),c&&Zr(o.onClick,[t,a,this],this));const p=!zb(a,i);return(p||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=f,p}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Ln(Zs,"defaults",vi),Ln(Zs,"instances",Cx),Ln(Zs,"overrides",Od),Ln(Zs,"registry",qs),Ln(Zs,"version",tCe),Ln(Zs,"getChart",HN);function KN(){return kr(Zs.instances,e=>e._plugins.invalidate())}function F7(e,t,n=t){e.lineCap=sr(n.borderCapStyle,t.borderCapStyle),e.setLineDash(sr(n.borderDash,t.borderDash)),e.lineDashOffset=sr(n.borderDashOffset,t.borderDashOffset),e.lineJoin=sr(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=sr(n.borderWidth,t.borderWidth),e.strokeStyle=sr(n.borderColor,t.borderColor)}function sCe(e,t,n){e.lineTo(n.x,n.y)}function lCe(e){return e.stepped?L_e:e.tension||e.cubicInterpolationMode==="monotone"?F_e:sCe}function z7(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,c=Math.max(i,s),f=Math.min(o,a),p=ia&&o>a;return{count:r,start:c,loop:t.loop,ilen:f(s+(f?a-N:N))%o,O=()=>{T!==I&&(e.lineTo(p,I),e.lineTo(p,T),e.lineTo(p,P))};for(c&&(b=i[M(0)],e.moveTo(b.x,b.y)),v=0;v<=a;++v){if(b=i[M(v)],b.skip)continue;const N=b.x,F=b.y,$=N|0;$===_?(FI&&(I=F),p=(g*p+N)/++g):(O(),e.lineTo(N,F),_=$,g=0,T=I=F),P=F}O()}function PE(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?cCe:uCe}function dCe(e){return e.stepped?m1e:e.tension||e.cubicInterpolationMode==="monotone"?g1e:rd}function fCe(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),F7(e,t.options),e.stroke(i)}function hCe(e,t,n,r){const{segments:i,options:o}=t,s=PE(t);for(const a of i)F7(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const pCe=typeof Path2D=="function";function mCe(e,t,n,r){pCe&&!t.options.segment?fCe(e,t,n,r):hCe(e,t,n,r)}class Mm extends ol{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;s1e(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=S1e(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=_1e(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],c=dCe(r);let f,p;for(f=0,p=s.length;ft!=="borderDash"&&t!=="fill"});function WN(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o){let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},_Ce=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class qN extends ol{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Zr(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=ji(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=GN(r,o);let f,p;n.font=i.string,this.isHorizontal()?(f=this.maxWidth,p=this._fitRows(s,o,a,c)+10):(p=this.maxHeight,f=this._fitCols(s,i,a,c)+10),this.width=Math.min(f,t.maxWidth||this.maxWidth),this.height=Math.min(p,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],f=this.lineWidths=[0],p=i+a;let g=t;o.textAlign="left",o.textBaseline="middle";let v=-1,b=-p;return this.legendItems.forEach((_,T)=>{const I=r+n/2+o.measureText(_.text).width;(T===0||f[f.length-1]+I+2*a>s)&&(g+=p,f[f.length-(T>0?0:1)]=0,b+=p,v++),c[T]={left:0,top:b,row:v,width:I,height:i},f[f.length-1]+=I+a}),g}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],f=this.columnSizes=[],p=s-t;let g=a,v=0,b=0,_=0,T=0;return this.legendItems.forEach((I,P)=>{const{itemWidth:M,itemHeight:O}=wCe(r,n,o,I,i);P>0&&b+O+2*a>p&&(g+=v+a,f.push({width:v,height:b}),_+=v+a,T++,v=b=0),c[P]={left:_,top:b,col:T,width:M,height:O},v=Math.max(v,M),b+=O+a}),g+=v,f.push({width:v,height:b}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=oh(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=Co(r,this.left+i,this.right-this.lineWidths[a]);for(const f of n)a!==f.row&&(a=f.row,c=Co(r,this.left+i,this.right-this.lineWidths[a])),f.top+=this.top+t+i,f.left=s.leftForLtr(s.x(c),f.width),c+=f.width+i}else{let a=0,c=Co(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const f of n)f.col!==a&&(a=f.col,c=Co(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),f.top=c,f.left+=this.left+i,f.left=s.leftForLtr(s.x(f.left),f.width),c+=f.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;MI(t,this),this._draw(),RI(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=vi.color,c=oh(t.rtl,this.left,this.width),f=ji(s.font),{padding:p}=s,g=f.size,v=g/2;let b;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=f.string;const{boxWidth:_,boxHeight:T,itemHeight:I}=GN(s,g),P=function($,j,U){if(isNaN(_)||_<=0||isNaN(T)||T<0)return;i.save();const q=sr(U.lineWidth,1);if(i.fillStyle=sr(U.fillStyle,a),i.lineCap=sr(U.lineCap,"butt"),i.lineDashOffset=sr(U.lineDashOffset,0),i.lineJoin=sr(U.lineJoin,"miter"),i.lineWidth=q,i.strokeStyle=sr(U.strokeStyle,a),i.setLineDash(sr(U.lineDash,[])),s.usePointStyle){const Y={radius:T*Math.SQRT2/2,pointStyle:U.pointStyle,rotation:U.rotation,borderWidth:q},te=c.xPlus($,_/2),Z=j+v;h7(i,Y,te,Z,s.pointStyleWidth&&_)}else{const Y=j+Math.max((g-T)/2,0),te=c.leftForLtr($,_),Z=bd(U.borderRadius);i.beginPath(),Object.values(Z).some(X=>X!==0)?Lg(i,{x:te,y:Y,w:_,h:T,radius:Z}):i.rect(te,Y,_,T),i.fill(),q!==0&&i.stroke()}i.restore()},M=function($,j,U){Ad(i,U.text,$,j+I/2,f,{strikethrough:U.hidden,textAlign:c.textAlign(U.textAlign)})},O=this.isHorizontal(),N=this._computeTitleHeight();O?b={x:Co(o,this.left+p,this.right-r[0]),y:this.top+p+N,line:0}:b={x:this.left+p,y:Co(o,this.top+N+p,this.bottom-n[0].height),line:0},w7(this.ctx,t.textDirection);const F=I+p;this.legendItems.forEach(($,j)=>{i.strokeStyle=$.fontColor,i.fillStyle=$.fontColor;const U=i.measureText($.text).width,q=c.textAlign($.textAlign||($.textAlign=s.textAlign)),Y=_+v+U;let te=b.x,Z=b.y;c.setWidth(this.width),O?j>0&&te+Y+p>this.right&&(Z=b.y+=F,b.line++,te=b.x=Co(o,this.left+p,this.right-r[b.line])):j>0&&Z+F>this.bottom&&(te=b.x=te+n[b.line].width+p,b.line++,Z=b.y=Co(o,this.top+N+p,this.bottom-n[b.line].height));const X=c.x(te);if(P(X,Z,$),te=C_e(q,te+_+v,O?te+Y:this.right,t.rtl),M(c.x(te),Z,$),O)b.x+=Y+p;else if(typeof $.text!="string"){const J=f.lineHeight;b.y+=B7($,J)+p}else b.y+=F}),C7(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ji(n.font),i=Io(n.padding);if(!n.display)return;const o=oh(t.rtl,this.left,this.width),s=this.ctx,a=n.position,c=r.size/2,f=i.top+c;let p,g=this.left,v=this.width;if(this.isHorizontal())v=Math.max(...this.lineWidths),p=this.top+f,g=Co(t.align,g,this.right-v);else{const _=this.columnSizes.reduce((T,I)=>Math.max(T,I.height),0);p=f+Co(t.align,this.top,this.bottom-_-t.labels.padding-this._computeTitleHeight())}const b=Co(a,g,g+v);s.textAlign=o.textAlign(TI(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Ad(s,n.text,b,p,r)}_computeTitleHeight(){const t=this.options.title,n=ji(t.font),r=Io(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(pd(t,this.left,this.right)&&pd(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;ro.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function SCe(e,t,n){let r=e;return typeof t.text!="string"&&(r=B7(t,n)),r}function B7(e,t){const n=e.text?e.text.length:0;return t*n}function ECe(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var PCe={id:"legend",_element:qN,start(e,t,n){const r=e.legend=new qN({ctx:e.ctx,options:n,chart:e});Ja.configure(e,r,n),Ja.addBox(e,r)},stop(e){Ja.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Ja.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const f=c.controller.getStyle(n?0:void 0),p=Io(f.borderWidth);return{text:t[c.index].label,fillStyle:f.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:f.borderCapStyle,lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:(p.width+p.height)/4,strokeStyle:f.borderColor,pointStyle:r||f.pointStyle,rotation:f.rotation,textAlign:i||f.textAlign,borderRadius:s&&(a||f.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class V7 extends ol{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=ai(r.text)?r.text.length:1;this._padding=Io(r.padding);const o=i*ji(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let c=0,f,p,g;return this.isHorizontal()?(p=Co(a,r,o),g=n+t,f=o-r):(s.position==="left"?(p=r+t,g=Co(a,i,n),c=Li*-.5):(p=o-t,g=Co(a,n,i),c=Li*.5),f=i-n),{titleX:p,titleY:g,maxWidth:f,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ji(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:c,rotation:f}=this._drawArgs(o);Ad(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:f,textAlign:TI(n.align),textBaseline:"middle",translation:[s,a]})}}function TCe(e,t){const n=new V7({ctx:e.ctx,options:t,chart:e});Ja.configure(e,n,t),Ja.addBox(e,n),e.titleBlock=n}var ICe={id:"title",_element:V7,start(e,t,n){TCe(e,n)},stop(e){const t=e.titleBlock;Ja.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Ja.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Rm={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=0;for(t=0,n=e.length;t-1?e.split(` `):e}function kCe(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function ZN(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,c=ji(t.bodyFont),f=ji(t.titleFont),p=ji(t.footerFont),g=o.length,v=i.length,b=r.length,_=Io(t.padding);let T=_.height,I=0,P=r.reduce((N,F)=>N+F.before.length+F.lines.length+F.after.length,0);if(P+=e.beforeBody.length+e.afterBody.length,g&&(T+=g*f.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),P){const N=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;T+=b*N+(P-b)*c.lineHeight+(P-1)*t.bodySpacing}v&&(T+=t.footerMarginTop+v*p.lineHeight+(v-1)*t.footerSpacing);let M=0;const O=function(N){I=Math.max(I,n.measureText(N).width+M)};return n.save(),n.font=f.string,kr(e.title,O),n.font=c.string,kr(e.beforeBody.concat(e.afterBody),O),M=t.displayColors?s+2+t.boxPadding:0,kr(r,N=>{kr(N.before,O),kr(N.lines,O),kr(N.after,O)}),M=0,n.font=p.string,kr(e.footer,O),n.restore(),I+=_.width,{width:I,height:T}}function MCe(e,t){const{y:n,height:r}=t;return ne.height-r/2?"bottom":"center"}function RCe(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function DCe(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:c}}=e;let f="center";return r==="center"?f=i<=(a+c)/2?"left":"right":i<=o/2?f="left":i>=s-o/2&&(f="right"),RCe(f,e,t,n)&&(f="center"),f}function XN(e,t,n){const r=n.yAlign||t.yAlign||MCe(e,n);return{xAlign:n.xAlign||t.xAlign||DCe(e,t,n,r),yAlign:r}}function OCe(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function ACe(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function YN(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:c}=n,f=i+o,{topLeft:p,topRight:g,bottomLeft:v,bottomRight:b}=bd(s);let _=OCe(t,a);const T=ACe(t,c,f);return c==="center"?a==="left"?_+=f:a==="right"&&(_-=f):a==="left"?_-=Math.max(p,v)+i:a==="right"&&(_+=Math.max(g,b)+i),{x:_a(_,0,r.width-t.width),y:_a(T,0,r.height-t.height)}}function N0(e,t,n){const r=Io(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function QN(e){return Ws([],kl(e))}function NCe(e,t,n){return mc(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function JN(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const U7={beforeTitle:Pl,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex"u"?U7[t].call(n,r):i}class TE extends ol{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new E7(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=NCe(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Zo(r,"beforeTitle",this,t),o=Zo(r,"title",this,t),s=Zo(r,"afterTitle",this,t);let a=[];return a=Ws(a,kl(i)),a=Ws(a,kl(o)),a=Ws(a,kl(s)),a}getBeforeBody(t,n){return QN(Zo(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return kr(t,o=>{const s={before:[],lines:[],after:[]},a=JN(r,o);Ws(s.before,kl(Zo(a,"beforeLabel",this,o))),Ws(s.lines,Zo(a,"label",this,o)),Ws(s.after,kl(Zo(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return QN(Zo(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Zo(r,"beforeFooter",this,t),o=Zo(r,"footer",this,t),s=Zo(r,"afterFooter",this,t);let a=[];return a=Ws(a,kl(i)),a=Ws(a,kl(o)),a=Ws(a,kl(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],c,f;for(c=0,f=n.length;ct.filter(p,g,v,r))),t.itemSort&&(a=a.sort((p,g)=>t.itemSort(p,g,r))),kr(a,p=>{const g=JN(t.callbacks,p);i.push(Zo(g,"labelColor",this,p)),o.push(Zo(g,"labelPointStyle",this,p)),s.push(Zo(g,"labelTextColor",this,p))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=Rm[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const c=this._size=ZN(this,r),f=Object.assign({},a,c),p=XN(this.chart,r,f),g=YN(r,f,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,o={opacity:1,x:g.x,y:g.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:c,topRight:f,bottomLeft:p,bottomRight:g}=bd(a),{x:v,y:b}=t,{width:_,height:T}=n;let I,P,M,O,N,F;return o==="center"?(N=b+T/2,i==="left"?(I=v,P=I-s,O=N+s,F=N-s):(I=v+_,P=I+s,O=N-s,F=N+s),M=I):(i==="left"?P=v+Math.max(c,p)+s:i==="right"?P=v+_-Math.max(f,g)-s:P=this.caretX,o==="top"?(O=b,N=O-s,I=P-s,M=P+s):(O=b+T,N=O+s,I=P+s,M=P-s),F=O),{x1:I,x2:P,x3:M,y1:O,y2:N,y3:F}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,c;if(o){const f=oh(r.rtl,this.x,this.width);for(t.x=N0(this,r.titleAlign,r),n.textAlign=f.textAlign(r.titleAlign),n.textBaseline="middle",s=ji(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,c=0;cM!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Lg(t,{x:T,y:_,w:f,h:c,radius:P}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Lg(t,{x:I,y:_+1,w:f-2,h:c-2,radius:P}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(T,_,f,c),t.strokeRect(T,_,f,c),t.fillStyle=s.backgroundColor,t.fillRect(I,_+1,f-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:c,boxWidth:f,boxPadding:p}=r,g=ji(r.bodyFont);let v=g.lineHeight,b=0;const _=oh(r.rtl,this.x,this.width),T=function(U){n.fillText(U,_.x(t.x+b),t.y+v/2),t.y+=v+o},I=_.textAlign(s);let P,M,O,N,F,$,j;for(n.textAlign=s,n.textBaseline="middle",n.font=g.string,t.x=N0(this,I,r),n.fillStyle=r.bodyColor,kr(this.beforeBody,T),b=a&&I!=="right"?s==="center"?f/2+p:f+2+p:0,N=0,$=i.length;N<$;++N){for(P=i[N],M=this.labelTextColors[N],n.fillStyle=M,kr(P.before,T),O=P.lines,a&&O.length&&(this._drawColorBox(n,t,N,_,r),v=Math.max(g.lineHeight,c)),F=0,j=O.length;F0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=Rm[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=ZN(this,t),c=Object.assign({},s,this._size),f=XN(n,t,c),p=YN(t,c,f,n);(i._to!==p.x||o._to!==p.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,p))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Io(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),w7(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),C7(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:c})=>{const f=this.chart.getDatasetMeta(a);if(!f)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:f.data[c],index:c}}),o=!zb(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),c=n||!zb(s,o)||a;return c&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n;const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=Rm[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}}Ln(TE,"positioners",Rm);var LCe={id:"tooltip",_element:TE,positioners:Rm,afterInit(e,t,n){n&&(e.tooltip=new TE({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:U7},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const FCe=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function zCe(e,t,n,r){const i=e.indexOf(t);if(i===-1)return FCe(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const $Ce=(e,t)=>e===null?null:_a(Math.round(e),0,t);function eL(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ln(IE,"id","category"),Ln(IE,"defaults",{ticks:{callback:eL}});function BCe(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:c,count:f,maxTicks:p,maxDigits:g,includeBounds:v}=e,b=o||1,_=p-1,{min:T,max:I}=t,P=!Mr(s),M=!Mr(a),O=!Mr(f),N=(I-T)/(g+1);let F=nN((I-T)/_/b)*b,$,j,U,q;if(F<1e-14&&!P&&!M)return[{value:T},{value:I}];q=Math.ceil(I/F)-Math.floor(T/F),q>_&&(F=nN(q*F/_/b)*b),Mr(c)||($=Math.pow(10,c),F=Math.ceil(F*$)/$),i==="ticks"?(j=Math.floor(T/F)*F,U=Math.ceil(I/F)*F):(j=T,U=I),P&&M&&o&&m_e((a-s)/o,F/1e3)?(q=Math.round(Math.min((a-s)/F,p)),F=(a-s)/q,j=s,U=a):O?(j=P?s:j,U=M?a:U,q=f-1,F=(U-j)/q):(q=(U-j)/F,Xm(q,Math.round(q),F/1e3)?q=Math.round(q):q=Math.ceil(q));const Y=Math.max(rN(F),rN(j));$=Math.pow(10,Mr(c)?Y:c),j=Math.round(j*$)/$,U=Math.round(U*$)/$;let te=0;for(P&&(v&&j!==s?(n.push({value:s}),ja)break;n.push({value:Z})}return M&&v&&U!==a?n.length&&Xm(n[n.length-1].value,a,tL(a,N,e))?n[n.length-1].value=a:n.push({value:a}):(!M||U===a)&&n.push({value:U}),n}function tL(e,t,{horizontal:n,minRotation:r}){const i=Bu(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Hb extends Wd{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Mr(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=c=>i=n?i:c,a=c=>o=r?o:c;if(t){const c=il(i),f=il(o);c<0&&f<0?a(0):c>0&&f>0&&s(0)}if(i===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||s(i-c)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=BCe(i,o);return t.bounds==="ticks"&&a7(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return kI(t,this.chart.options.locale,this.options.ticks.format)}}class kE extends Hb{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=to(t)?t:0,this.max=to(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Bu(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ln(kE,"id","linear"),Ln(kE,"defaults",{ticks:{callback:S1.formatters.numeric}});const zg=e=>Math.floor($u(e)),Gc=(e,t)=>Math.pow(10,zg(e)+t);function nL(e){return e/Math.pow(10,zg(e))===1}function rL(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function VCe(e,t){const n=t-e;let r=zg(n);for(;rL(e,t,r)>10;)r++;for(;rL(e,t,r)<10;)r--;return Math.min(r,zg(e))}function UCe(e,{min:t,max:n}){t=ga(e.min,t);const r=[],i=zg(t);let o=VCe(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=i>o?Math.pow(10,i):0,f=Math.round((t-c)*s)/s,p=Math.floor((t-c)/a/10)*a*10;let g=Math.floor((f-p)/Math.pow(10,o)),v=ga(e.min,Math.round((c+p+g*Math.pow(10,o))*s)/s);for(;v=10?g=g<15?15:20:g++,g>=20&&(o++,g=2,s=o>=0?1:s),v=Math.round((c+p+g*Math.pow(10,o))*s)/s;const b=ga(e.max,v);return r.push({value:b,major:nL(b),significand:g}),r}class iL extends Wd{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Hb.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return to(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=to(t)?Math.max(0,t):null,this.max=to(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!to(this._userMin)&&(this.min=t===Gc(this.min,0)?Gc(this.min,-1):Gc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(Gc(r,-1)),s(Gc(i,1)))),r<=0&&o(Gc(i,-1)),i<=0&&s(Gc(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=UCe(n,this);return t.bounds==="ticks"&&a7(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":kI(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=$u(t),this._valueRange=$u(this.max)-$u(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:($u(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ln(iL,"id","logarithmic"),Ln(iL,"defaults",{ticks:{callback:S1.formatters.logarithmic,major:{enabled:!0}}});function ME(e){const t=e.ticks;if(t.display&&e.display){const n=Io(t.backdropPadding);return sr(t.font&&t.font.size,vi.font.size)+n.height}return 0}function jCe(e,t,n){return n=ai(n)?n:[n],{w:N_e(e,t.string,n),h:n.length*t.lineHeight}}function oL(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function HCe(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Li/o:0;for(let c=0;ct.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.startt.b&&(c=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+c))}function WCe(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,c=e.getPointPosition(t,r+i+s,o),f=Math.round(EI(Cs(c.angle+ba))),p=YCe(c.y,a.h,f),g=ZCe(f),v=XCe(c.x,a.w,g);return{visible:!0,x:c.x,y:p,textAlign:g,left:v,top:p,right:v+a.w,bottom:p+a.h}}function GCe(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(Bl({x:n,y:r},t)||Bl({x:n,y:o},t)||Bl({x:i,y:r},t)||Bl({x:i,y:o},t))}function qCe(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,c={extra:ME(o)/2,additionalAngle:s?Li/i:0};let f;for(let p=0;p270||n<90)&&(e-=t),e}function QCe(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!Mr(a)){const c=bd(t.borderRadius),f=Io(t.backdropPadding);e.fillStyle=a;const p=r-f.left,g=i-f.top,v=o-r+f.width,b=s-i+f.height;Object.values(c).some(_=>_!==0)?(e.beginPath(),Lg(e,{x:p,y:g,w:v,h:b,radius:c}),e.fill()):e.fillRect(p,g,v,b)}}function JCe(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));QCe(n,s,o);const a=ji(s.font),{x:c,y:f,textAlign:p}=o;Ad(n,e._pointLabels[i],c,f+a.lineHeight/2,a,{color:s.color,textAlign:p,textBaseline:"middle"})}}function j7(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ns);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s{const i=Zr(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?HCe(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ns/(this._pointLabels.length||1),r=this.options.startAngle||0;return Cs(t*n+Bu(r))}getDistanceFromCenterForValue(t){if(Mr(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Mr(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(g!==0){c=this.getDistanceFromCenterForValue(p.value);const v=this.getContext(g),b=i.setContext(v),_=o.setContext(v);eSe(this,b,c,s,_)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const p=r.setContext(this.getPointLabelContext(a)),{color:g,lineWidth:v}=p;!v||!g||(t.lineWidth=v,t.strokeStyle=g,t.setLineDash(p.borderDash),t.lineDashOffset=p.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),f=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(f.x,f.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&!n.reverse)return;const f=r.setContext(this.getContext(c)),p=ji(f.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),f.showLabelBackdrop){t.font=p.string,s=t.measureText(a.label).width,t.fillStyle=f.backdropColor;const g=Io(f.backdropPadding);t.fillRect(-s/2-g.left,-o-p.size/2-g.top,s+g.width,p.size+g.height)}Ad(t,a.label,0,-o,p,{color:f.color,strokeColor:f.textStrokeColor,strokeWidth:f.textStrokeWidth})}),t.restore()}drawTitle(){}}Ln(L0,"id","radialLinear"),Ln(L0,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:S1.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ln(L0,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ln(L0,"descriptors",{angleLines:{_fallback:"grid"}});const P1={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Jo=Object.keys(P1);function aL(e,t){return e-t}function sL(e,t){if(Mr(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),to(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(Ng(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function lL(e,t,n,r){const i=Jo.length;for(let o=Jo.indexOf(e);o=Jo.indexOf(n);o--){const s=Jo[o];if(P1[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return Jo[n?Jo.indexOf(n):0]}function rSe(e){for(let t=Jo.indexOf(e)+1,n=Jo.length;t=t?n[r]:n[i];e[o]=!0}}function iSe(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,c;for(a=o;a<=s;a=+i.add(a,1,r))c=n[a],c>=0&&(t[c].major=!0);return t}function cL(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=_a(n,0,s),r=_a(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||lL(o.minUnit,n,r,this._getLabelCapacity(n)),a=sr(i.ticks.stepSize,1),c=s==="week"?o.isoWeekday:!1,f=Ng(c)||c===!0,p={};let g=n,v,b;if(f&&(g=+t.startOf(g,"isoWeek",c)),g=+t.startOf(g,f?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const _=i.ticks.source==="data"&&this.getDataTimestamps();for(v=g,b=0;v+T)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return Zr(s,[t,n,r],this);const a=o.time.displayFormats,c=this._unit,f=this._majorUnit,p=c&&a[c],g=f&&a[f],v=r[n],b=f&&g&&v&&v.major;return this._adapter.format(t,i||(b?g:p))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=md(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=md(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:c}=e[i]);const f=s-o;return f?a+(c-a)*(t-o)/f:a}class dL extends Kb{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=F0(n,this.min),this._tableRange=F0(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,c,f,p;for(s=0,a=t.length;s=n&&f<=r&&i.push(f);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;si-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(F0(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return F0(this._table,r*this._tableRange+this._minPos,!0)}}Ln(dL,"id","timeseries"),Ln(dL,"defaults",Kb.defaults);const H7="label";function fL(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function oSe(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function K7(e,t){e.labels=t}function W7(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:H7;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(s=>s[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function aSe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H7;const n={labels:[],datasets:[]};return K7(n,e.labels),W7(n,e.datasets,t),n}function sSe(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:s,data:a,options:c,plugins:f=[],fallbackContent:p,updateMode:g,...v}=e,b=E.exports.useRef(null),_=E.exports.useRef(),T=()=>{!b.current||(_.current=new Zs(b.current,{type:s,data:aSe(a,o),options:c&&{...c},plugins:f}),fL(t,_.current))},I=()=>{fL(t,null),_.current&&(_.current.destroy(),_.current=null)};return E.exports.useEffect(()=>{!i&&_.current&&c&&oSe(_.current,c)},[i,c]),E.exports.useEffect(()=>{!i&&_.current&&K7(_.current.config.data,a.labels)},[i,a.labels]),E.exports.useEffect(()=>{!i&&_.current&&a.datasets&&W7(_.current.config.data,a.datasets,o)},[i,a.datasets]),E.exports.useEffect(()=>{!_.current||(i?(I(),setTimeout(T)):_.current.update(g))},[i,c,a.labels,a.datasets,g]),E.exports.useEffect(()=>{!_.current||(I(),setTimeout(T))},[s]),E.exports.useEffect(()=>(T(),()=>I()),[]),A("canvas",{...Object.assign({ref:b,role:"img",height:n,width:r},v),children:p})}const lSe=E.exports.forwardRef(sSe);function uSe(e,t){return Zs.register(t),E.exports.forwardRef((n,r)=>A(lSe,{...Object.assign({},n,{ref:r,type:e})}))}const cSe=uSe("line",_x);Zs.register(IE,bx,Sx,Mm,kE,Ex,ICe,LCe,PCe);const hL={t_shap:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u043E\u0437\u0434\u0443\u0445\u0430",fi_remont1_shap:"\u0417\u0430\u043C\u0435\u043D\u0430 \u0441\u0442\u043E\u044F\u043A\u043E\u0432 \u0425\u0412\u0421",fi_remont2_shap:"\u0420\u0435\u043C\u043E\u043D\u0442 \u0440\u0430\u0437\u0432\u043E\u0434\u044F\u0449\u0438\u0445 \u0432\u043D\u0443\u0442\u0440\u0438\u0434\u043E\u043C\u043E\u0432\u044B\u0445 \u043C\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043B\u0435\u0439 \u0425\u0412\u0421",fi_remont3_shap:"\u0417\u0430\u043C\u0435\u043D\u0430 \u0441\u0442\u043E\u044F\u043A\u043E\u0432 \u0413\u0412\u0421",fi_remont4_shap:"\u0420\u0435\u043C\u043E\u043D\u0442 \u0440\u0430\u0437\u0432\u043E\u0434\u044F\u0449\u0438\u0445 \u0432\u043D\u0443\u0442\u0440\u0438\u0434\u043E\u043C\u043E\u0432\u044B\u0445 \u043C\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043B\u0435\u0439 \u0413\u0412\u0421",fi_remont5_shap:"\u0420\u0435\u043C\u043E\u043D\u0442 \u0441\u0442\u043E\u044F\u043A\u043E\u0432 \u043A\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438",fi_remont6_shap:"\u0420\u0435\u043C\u043E\u043D\u0442 \u0432\u044B\u043F\u0443\u0441\u043A\u043E\u0432 \u0438 \u0441\u0431\u043E\u0440\u043D\u044B\u0445 \u0442\u0440\u0443\u0431\u043E\u043F\u0440\u043E\u0432\u043E\u0434\u043E\u0432 \u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043A\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438",fi_remont7_shap:"\u0420\u0435\u043C\u043E\u043D\u0442 \u0432\u043D\u0443\u0442\u0440\u0438\u0434\u043E\u043C\u043E\u0432\u044B\u0445 \u0441\u0438\u0441\u0442\u0435\u043C \u0442\u0435\u043F\u043B\u043E\u0441\u043D\u0430\u0431\u0436\u0435\u043D\u0438\u044F (\u0441 \u0437\u0430\u043C\u0435\u043D\u043E\u0439 \u0441\u0442\u043E\u044F\u043A\u043E\u0432)",fi_remont8_shap:"\u0420\u0435\u043C\u043E\u043D\u0442 \u0440\u0430\u0437\u0432\u043E\u0434\u044F\u0449\u0438\u0445 \u043C\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043B\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0442\u0435\u043F\u043B\u043E\u0441\u043D\u0430\u0431\u0436\u0435\u043D\u0438\u044F",total_area_shap:"\u041E\u0431\u0449\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u044C",fi_is_block_shap:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B - \u0431\u043B\u043E\u0447\u043D\u044B\u0439",fi_is_brick_shap:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B - \u043A\u0438\u0440\u043F\u0438\u0447\u043D\u044B\u0439",fi_is_panel_shap:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B - \u043F\u0430\u043D\u0435\u043B\u044C\u043D\u044B\u0439",building_wear_shap:"\u0418\u0437\u043D\u043E\u0441",fi_is_monolit_shap:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B - \u043C\u043E\u043D\u043E\u043B\u0438\u0442\u043D\u044B\u0439",fi_energy_class_shap:"\u041A\u043B\u0430\u0441\u0441 \u044D\u043D\u0435\u0440\u0433\u043E\u044D\u0444\u0444\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438",fi_building_year_shap:"\u0413\u043E\u0434 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438",gvs_avg_heat_load_shap:"\u0421\u0440\u0435\u0434\u043D\u044F\u044F \u0442\u0435\u043F\u043B\u043E\u0432\u0430\u044F \u043D\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0413\u0412\u0421",heating_heat_load_shap:"\u0422\u0435\u043F\u043B\u043E\u0432\u0430\u044F \u043D\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043D\u0430 \u043E\u0442\u043E\u043F\u043B\u0435\u043D\u0438\u0435",gvs_fact_heat_load_shap:"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0442\u0435\u043F\u043B\u043E\u0432\u0430\u044F \u043D\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0413\u0412\u0421",ventilation_heat_load_shap:"\u0422\u0435\u043F\u043B\u043E\u0432\u0430\u044F \u043D\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043D\u0430 \u0432\u0435\u043D\u0442\u0438\u043B\u044F\u0446\u0438\u044E"},dSe=({point:e})=>{const{data:t}=Xxe(e.id),{consumer_filter:n}=qi(),r=E.exports.useMemo(()=>t?!n||!n.key.includes("prob")?t.prob1_35:t[`${n.key}_35`]:null,[t,n]);if(!t||!r)return"";const i={indexAxis:"y",elements:{bar:{borderWidth:0,borderRadius:5,pointStyle:"circle"}},plugins:{legend:{display:!1},tooltip:{displayColors:!1,yAlign:"top"}},scales:{y:{stacked:!0},x:{title:{display:!0,text:"\u0412\u043A\u043B\u0430\u0434 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437, %"},grid:{color:function(a){return a.tick.value===0?"#000000":"#E5E5E5"}}}}},o=Object.keys(hL).sort((a,c)=>Math.abs(r[a])hL[a]),datasets:[{data:o.map(a=>r?r[a]:0),backgroundColor:o.map(a=>r[a]).map(a=>a<=0?"#278211":"#CC2500"),hoverBackgroundColor:o.map(a=>r[a]).map(a=>a<=0?"#2DB20C":"#F22C00"),type:"bar",showLine:!1}]};return A(cSe,{options:i,data:s})},fSe=()=>it("div",{className:"w-[200px]",children:["\u0413\u0440\u0430\u0444\u0438\u043A \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0442\u043E\u043F-15 \u0444\u0430\u043A\u0442\u043E\u0440\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442 \u043D\u0430\u0438\u0431\u043E\u043B\u044C\u0448\u0435\u0435 \u0432\u043B\u0438\u044F\u043D\u0438\u0435 \u043D\u0430 \u043F\u0440\u043E\u0433\u043D\u043E\u0437 \u0430\u0432\u0430\u0440\u0438\u0439\u043D\u043E\u0441\u0442\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u0430.",A("br",{}),A("br",{}),"\u0424\u0430\u043A\u0442\u043E\u0440\u044B \u043C\u043E\u0433\u0443\u0442 \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u043E\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0438\u043B\u0438 \u043E\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0432\u043B\u0438\u044F\u043D\u0438\u0435.",A("br",{}),A("br",{}),"\u0427\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u0432\u043B\u0438\u044F\u043D\u0438\u044F \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0444\u0430\u043A\u0442\u043E\u0440 \u043D\u0430 \u0430\u0432\u0430\u0440\u0438\u0439\u043D\u043E\u0441\u0442\u044C, \u0442\u0435\u043C \u0431\u043B\u0438\u0436\u0435 \u0435\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043A 100% (-100%)."]}),hSe=({point:e})=>{const[t,n]=E.exports.useState(!1);return it("div",{className:"flex items-center",children:[A(ka,{title:"\u0412\u043B\u0438\u044F\u043D\u0438\u0435 \u0444\u0430\u043A\u0442\u043E\u0440\u043E\u0432 \u043D\u0430 \u043F\u0440\u043E\u0433\u043D\u043E\u0437",children:A(Yr,{className:"flex justify-center items-center h-6 ml-1 mb-1 p-2",type:"primary",onClick:()=>n(!0),children:"\u0412\u043B\u0438\u044F\u043D\u0438\u0435 \u0444\u0430\u043A\u0442\u043E\u0440\u043E\u0432 \u043D\u0430 \u043F\u0440\u043E\u0433\u043D\u043E\u0437"})}),A(X8,{open:t,title:"\u0412\u043A\u043B\u0430\u0434 \u0444\u0430\u043A\u0442\u043E\u0440\u043E\u0432 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437 \u0430\u0432\u0430\u0440\u0438\u0439\u043D\u043E\u0441\u0442\u0438",onCancel:()=>n(!1),width:800,footer:(()=>[A(Yr,{type:"primary",onClick:()=>n(!1),children:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C"},"close-button")])(),style:{top:"15px"},children:it("div",{children:[A("div",{className:"flex flex-col gap-2",children:it(ad,{className:Id("p-1"),children:[A(_b,{className:"font-semibold",span:12,children:"\u0410\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438:"}),A(_b,{span:12,children:e.building_address})]})}),A(Coe,{}),A(dSe,{point:e}),A(EB,{content:A(fSe,{autoFocus:!0}),trigger:"click",placement:"leftBottom",color:"#ffffff",children:A(Yr,{type:"text",className:"text-[#1890FF] p-0",children:"\u041A\u0430\u043A \u0447\u0438\u0442\u0430\u0442\u044C \u0433\u0440\u0430\u0444\u0438\u043A?"})})]})})]})},pSe=({feature:e})=>it("div",{className:"flex-col gap-2",children:[e.properties.point_type==="potreb"&&A(hSe,{point:e.properties}),A(Nbe,{feature:e})]}),mSe={potreb:"\u041F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u044C",tp:"\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A",ods:"\u0414\u0438\u0441\u043F\u0435\u0442\u0447\u0435\u0440\u0441\u043A\u0430\u044F"},gSe=({features:e})=>{const{setPopup:t}=C1();return A("div",{className:"space-y-2 p-1",children:e.map(n=>{const r=n.properties.id;return A("div",{className:"flex flex-row items-center gap-2 w-full",children:A(Yr,{className:"text-start flex-1 !w-0",block:!0,onClick:()=>{t({features:[n],coordinates:n.geometry.coordinates})},children:A("div",{className:"space-x-2 flex items-center w-full",children:A("span",{className:"flex-1 truncate inline-block",children:mSe[n.properties.point_type]})})})},r)})})},vSe=({features:e,lat:t,lng:n,onClose:r})=>A(Obe,{lat:t,lng:n,onClose:r,children:(()=>e.length===1?A(pSe,{feature:e[0]}):A(gSe,{features:e}))()}),ySe="https://api.mapbox.com/styles/v1/ghermant/cla2nwk5f00el14nxvtjlsi6z/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiZ2hlcm1hbnQiLCJhIjoiY2xhMm5zZ3ZrMDF4MDN2bzc5Yjd0ZjZ1dCJ9.fqnvrEqKKBoguR7R6DR7Yw",xSe=()=>A(xg,{type:"raster",id:"basemap",tiles:[ySe],tileSize:256,children:A(Td,{type:"raster",source:"basemap",id:"basemap-layer",paint:{}})});var bSe="Expected a function",pL=0/0,_Se="[object Symbol]",wSe=/^\s+|\s+$/g,CSe=/^[-+]0x[0-9a-f]+$/i,SSe=/^0b[01]+$/i,ESe=/^0o[0-7]+$/i,PSe=parseInt,TSe=typeof Fl=="object"&&Fl&&Fl.Object===Object&&Fl,ISe=typeof self=="object"&&self&&self.Object===Object&&self,kSe=TSe||ISe||Function("return this")(),MSe=Object.prototype,RSe=MSe.toString,DSe=Math.max,OSe=Math.min,RS=function(){return kSe.Date.now()};function ASe(e,t,n){var r,i,o,s,a,c,f=0,p=!1,g=!1,v=!0;if(typeof e!="function")throw new TypeError(bSe);t=mL(t)||0,RE(n)&&(p=!!n.leading,g="maxWait"in n,o=g?DSe(mL(n.maxWait)||0,t):o,v="trailing"in n?!!n.trailing:v);function b($){var j=r,U=i;return r=i=void 0,f=$,s=e.apply(U,j),s}function _($){return f=$,a=setTimeout(P,t),p?b($):s}function T($){var j=$-c,U=$-f,q=t-j;return g?OSe(q,o-U):q}function I($){var j=$-c,U=$-f;return c===void 0||j>=t||j<0||g&&U>=o}function P(){var $=RS();if(I($))return M($);a=setTimeout(P,T($))}function M($){return a=void 0,v&&r?b($):(r=i=void 0,s)}function O(){a!==void 0&&clearTimeout(a),f=0,r=c=i=a=void 0}function N(){return a===void 0?s:M(RS())}function F(){var $=RS(),j=I($);if(r=arguments,i=this,c=$,j){if(a===void 0)return _(c);if(g)return a=setTimeout(P,t),b(c)}return a===void 0&&(a=setTimeout(P,t)),s}return F.cancel=O,F.flush=N,F}function RE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function NSe(e){return!!e&&typeof e=="object"}function LSe(e){return typeof e=="symbol"||NSe(e)&&RSe.call(e)==_Se}function mL(e){if(typeof e=="number")return e;if(LSe(e))return pL;if(RE(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=RE(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(wSe,"");var n=SSe.test(e);return n||ESe.test(e)?PSe(e.slice(2),n?2:8):CSe.test(e)?pL:+e}var FSe=ASe;const zSe=e=>({clickedPointConfig:null,setClickedPointConfig:(t,n=!1)=>{e(r=>{if(t===null)return r.clickedPointConfig=null,r;r.clickedPointConfig={id:t,shouldSelect:n}})}}),Cv=hc(pc(zSe)),G7="/assets/circle.48dd350a.svg",DS=({color:e,imageSrc:t,name:n,border:r})=>it("div",{className:"flex gap-2 items-center",children:[t&&A(uae,{src:t,width:18,height:18,className:"flex items-center",preview:!1}),e&&!t&&A("span",{className:"w-4 h-[100%] flex items-center justify-center",children:A("span",{className:`rounded-xl w-3 h-3 inline-block ${r&&"border-black border-[1px] border-solid"}`,style:{backgroundColor:e}})}),A("span",{className:"text-xs text-grey",children:n})]}),gL=({colors:e,name:t,desc:n})=>it("div",{children:[A("span",{className:"text-xs text-grey",children:t}),A("div",{className:"w-[200px]",children:A("div",{className:"w-full h-[10px] rounded-xl",style:{background:`linear-gradient(to right, ${e.join(",")})`}})}),it("span",{className:"text-xs text-grey italic",children:[n," \u2192"]})]});Lb.stops.map(e=>e[1]);const $Se=JU.stops.map(e=>e[1]);function BSe(){const{toggleVisibility:e,isVisible:t}=w1(),{consumer_filter:n,source_filter:r}=qi(),i=E.exports.useMemo(()=>n&&n.key.includes("cooling"),[n]),o=E.exports.useMemo(()=>i?ybe.stops.map(s=>s[1]):Lb.stops.map(s=>s[1]),[i]);return A("div",{className:"absolute bottom-[20px] right-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3 space-y-3",children:A("div",{children:it("div",{className:"space-y-2 flex flex-col",children:[A(Gm,{className:"!ml-0",onChange:()=>e(Ci.consumer),checked:t[Ci.consumer],children:n?A(gL,{colors:o,name:"\u041F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u044C",desc:n.key.includes("prob")?"\u0441\u043A\u043B\u043E\u043D\u043D\u043E\u0441\u0442\u044C \u043A \u0430\u0432\u0430\u0440\u0438\u0439\u043D\u043E\u0441\u0442\u0438":n.key.includes("cooling_time")?"\u0432\u0440\u0435\u043C\u044F \u043E\u0441\u0442\u044B\u0432\u0430\u043D\u0438\u044F, \u0447":"\u043F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442 \u0437\u0434\u0430\u043D\u0438\u044F"}):A(DS,{name:"\u041F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u044C"})}),A(Gm,{className:"!ml-0",onChange:()=>e(Ci.source),checked:t[Ci.source],children:r?A(gL,{colors:$Se,name:"\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A",desc:"\u0441\u043A\u043B\u043E\u043D\u043D\u043E\u0441\u0442\u044C \u043A \u0430\u0432\u0430\u0440\u0438\u0439\u043D\u043E\u0441\u0442\u0438"}):A(DS,{name:"\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A"})}),A(Gm,{className:"!ml-0 flex items-center",onChange:()=>e(Ci.dispatcher),checked:t[Ci.dispatcher],children:A(DS,{name:"\u0414\u0438\u0441\u043F\u0435\u0442\u0447\u0435\u0440\u0441\u043A\u0430\u044F",imageSrc:G7})})]})})})}let vL=e=>typeof e=="object"&&e!=null&&e.nodeType===1,yL=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",OS=(e,t)=>{if(e.clientHeight{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightot||o>e&&s=t&&a>=n?o-e-r:s>t&&an?s-t+i:0,VSe=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},xL=(e,t)=>{var n,r,i,o;if(typeof document>"u")return[];let{scrollMode:s,block:a,inline:c,boundary:f,skipOverflowHiddenElements:p}=t,g=typeof f=="function"?f:Z=>Z!==f;if(!vL(e))throw new TypeError("Invalid target");let v=document.scrollingElement||document.documentElement,b=[],_=e;for(;vL(_)&&g(_);){if(_=VSe(_),_===v){b.push(_);break}_!=null&&_===document.body&&OS(_)&&!OS(document.documentElement)||_!=null&&OS(_,p)&&b.push(_)}let T=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,I=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:P,scrollY:M}=window,{height:O,width:N,top:F,right:$,bottom:j,left:U}=e.getBoundingClientRect(),q=a==="start"||a==="nearest"?F:a==="end"?j:F+O/2,Y=c==="center"?U+N/2:c==="end"?$:U,te=[];for(let Z=0;Z=0&&U>=0&&j<=I&&$<=T&&F>=re&&j<=oe&&U>=he&&$<=se)return te;let Ce=getComputedStyle(X),Se=parseInt(Ce.borderLeftWidth,10),be=parseInt(Ce.borderTopWidth,10),Re=parseInt(Ce.borderRightWidth,10),Ie=parseInt(Ce.borderBottomWidth,10),Me=0,Ae=0,Fe="offsetWidth"in X?X.offsetWidth-X.clientWidth-Se-Re:0,Ke="offsetHeight"in X?X.offsetHeight-X.clientHeight-be-Ie:0,Ue="offsetWidth"in X?X.offsetWidth===0?0:ce/X.offsetWidth:0,pt="offsetHeight"in X?X.offsetHeight===0?0:J/X.offsetHeight:0;if(v===X)Me=a==="start"?q:a==="end"?q-I:a==="nearest"?z0(M,M+I,I,be,Ie,M+q,M+q+O,O):q-I/2,Ae=c==="start"?Y:c==="center"?Y-T/2:c==="end"?Y-T:z0(P,P+T,T,Se,Re,P+Y,P+Y+N,N),Me=Math.max(0,Me+M),Ae=Math.max(0,Ae+P);else{Me=a==="start"?q-re-be:a==="end"?q-oe+Ie+Ke:a==="nearest"?z0(re,oe,J,be,Ie+Ke,q,q+O,O):q-(re+J/2)+Ke/2,Ae=c==="start"?Y-he-Se:c==="center"?Y-(he+ce/2)+Fe/2:c==="end"?Y-se+Re+Fe:z0(he,se,ce,Se,Re+Fe,Y,Y+N,N);let{scrollLeft:gt,scrollTop:Dt}=X;Me=Math.max(0,Math.min(Dt+Me/pt,X.scrollHeight-J/pt+Ke)),Ae=Math.max(0,Math.min(gt+Ae/Ue,X.scrollWidth-ce/Ue+Fe)),q+=Dt-Me,Y+=gt-Ae}te.push({el:X,top:Me,left:Ae})}return te},USe=e=>typeof e=="object"&&typeof e.behavior=="function",jSe=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function HSe(e,t){if(!e.isConnected||!e.ownerDocument.documentElement.contains(e))return;if(USe(t))return t.behavior(xL(e,t));let n=typeof t=="boolean"||t==null?void 0:t.behavior;for(let{el:r,top:i,left:o}of xL(e,jSe(t)))r.scroll({top:i,left:o,behavior:n})}var KSe=E.exports.createContext({});const q7=KSe;var $0=2,bL=.16,WSe=.05,GSe=.05,qSe=.15,Z7=5,X7=4,ZSe=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function _L(e){var t=e.r,n=e.g,r=e.b,i=ob(t,n,r);return{h:i.h*360,s:i.s,v:i.v}}function B0(e){var t=e.r,n=e.g,r=e.b;return"#".concat(ab(t,n,r,!1))}function XSe(e,t,n){var r=n/100,i={r:(t.r-e.r)*r+e.r,g:(t.g-e.g)*r+e.g,b:(t.b-e.b)*r+e.b};return i}function wL(e,t,n){var r;return Math.round(e.h)>=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-$0*t:Math.round(e.h)+$0*t:r=n?Math.round(e.h)+$0*t:Math.round(e.h)-$0*t,r<0?r+=360:r>=360&&(r-=360),r}function CL(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-bL*t:t===X7?r=e.s+bL:r=e.s+WSe*t,r>1&&(r=1),n&&t===Z7&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function SL(e,t,n){var r;return n?r=e.v+GSe*t:r=e.v-qSe*t,r>1&&(r=1),Number(r.toFixed(2))}function DE(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Es(e),i=Z7;i>0;i-=1){var o=_L(r),s=B0(Es({h:wL(o,i,!0),s:CL(o,i,!0),v:SL(o,i,!0)}));n.push(s)}n.push(B0(r));for(var a=1;a<=X7;a+=1){var c=_L(r),f=B0(Es({h:wL(c,a),s:CL(c,a),v:SL(c,a)}));n.push(f)}return t.theme==="dark"?ZSe.map(function(p){var g=p.index,v=p.opacity,b=B0(XSe(Es(t.backgroundColor||"#141414"),Es(n[g]),v*100));return b}):n}var AS={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},NS={},LS={};Object.keys(AS).forEach(function(e){NS[e]=DE(AS[e]),NS[e].primary=NS[e][5],LS[e]=DE(AS[e],{theme:"dark",backgroundColor:"#141414"}),LS[e].primary=LS[e][5]});function YSe(e,t){Lr(e,"[@ant-design/icons] ".concat(t))}function EL(e){return on(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(on(e.icon)==="object"||typeof e.icon=="function")}function PL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t},{})}function OE(e,t,n){return n?Un.createElement(e.tag,me(me({key:t},PL(e.attrs)),n),(e.children||[]).map(function(r,i){return OE(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):Un.createElement(e.tag,me({key:t},PL(e.attrs)),(e.children||[]).map(function(r,i){return OE(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function Y7(e){return DE(e)[0]}function Q7(e){return e?Array.isArray(e)?e:[e]:[]}var QSe=` .anticon { display: inline-block; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,JSe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QSe,n=E.exports.useContext(q7),r=n.csp,i=n.prefixCls,o=t;i&&(o=o.replace(/anticon/g,i)),E.exports.useEffect(function(){ev(o,"@ant-design-icons",{prepend:!0,csp:r})},[])},e2e=["icon","className","onClick","style","primaryColor","secondaryColor"],Jm={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function t2e(e){var t=e.primaryColor,n=e.secondaryColor;Jm.primaryColor=t,Jm.secondaryColor=n||Y7(t),Jm.calculated=!!n}function n2e(){return me({},Jm)}var T1=function(t){var n=t.icon,r=t.className,i=t.onClick,o=t.style,s=t.primaryColor,a=t.secondaryColor,c=kn(t,e2e),f=Jm;if(s&&(f={primaryColor:s,secondaryColor:a||Y7(s)}),JSe(),YSe(EL(n),"icon should be icon definiton, but got ".concat(n)),!EL(n))return null;var p=n;return p&&typeof p.icon=="function"&&(p=me(me({},p),{},{icon:p.icon(f.primaryColor,f.secondaryColor)})),OE(p.icon,"svg-".concat(p.name),me({className:r,onClick:i,style:o,"data-icon":p.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},c))};T1.displayName="IconReact";T1.getTwoToneColors=n2e;T1.setTwoToneColors=t2e;const FI=T1;function J7(e){var t=Q7(e),n=$e(t,2),r=n[0],i=n[1];return FI.setTwoToneColors({primaryColor:r,secondaryColor:i})}function r2e(){var e=FI.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var i2e=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];J7("#1890ff");var I1=E.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,o=e.spin,s=e.rotate,a=e.tabIndex,c=e.onClick,f=e.twoToneColor,p=kn(e,i2e),g=E.exports.useContext(q7),v=g.prefixCls,b=v===void 0?"anticon":v,_=g.rootClassName,T=je(_,b,(n={},ae(n,"".concat(b,"-").concat(i.name),!!i.name),ae(n,"".concat(b,"-spin"),!!o||i.name==="loading"),n),r),I=a;I===void 0&&c&&(I=-1);var P=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,M=Q7(f),O=$e(M,2),N=O[0],F=O[1];return A("span",{...me(me({role:"img","aria-label":i.name},p),{},{ref:t,tabIndex:I,onClick:c,className:T}),children:A(FI,{icon:i,primaryColor:N,secondaryColor:F,style:P})})});I1.displayName="AntdIcon";I1.getTwoToneColor=r2e;I1.setTwoToneColor=J7;const Xh=I1;var e9=function(t,n){return A(Xh,{...me(me({},t),{},{ref:n,icon:uU})})};e9.displayName="DownloadOutlined";const o2e=E.exports.forwardRef(e9);var a2e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"};const s2e=a2e;var t9=function(t,n){return A(Xh,{...me(me({},t),{},{ref:n,icon:s2e})})};t9.displayName="FullscreenExitOutlined";const l2e=E.exports.forwardRef(t9);var u2e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"};const c2e=u2e;var n9=function(t,n){return A(Xh,{...me(me({},t),{},{ref:n,icon:c2e})})};n9.displayName="FullscreenOutlined";const d2e=E.exports.forwardRef(n9);var r9=function(t,n){return A(Xh,{...me(me({},t),{},{ref:n,icon:z6})})};r9.displayName="LoadingOutlined";const f2e=E.exports.forwardRef(r9);var h2e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const p2e=h2e;var i9=function(t,n){return A(Xh,{...me(me({},t),{},{ref:n,icon:p2e})})};i9.displayName="SettingOutlined";const m2e=E.exports.forwardRef(i9);var g2e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};const v2e=g2e;var o9=function(t,n){return A(Xh,{...me(me({},t),{},{ref:n,icon:v2e})})};o9.displayName="UploadOutlined";const a9=E.exports.forwardRef(o9),y2e=e=>{t7("data.csv",e)},x2e=({provider:e})=>{const[t,n]=E.exports.useState(!1);return e(t,()=>n(!1)),A(ka,{title:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",children:A(Yr,{onClick:i=>{i.stopPropagation(),n(!0)},loading:t,disabled:t,children:A(o2e,{})})})},b2e={isOpened:!1,fullScreen:!1},_2e=e=>({tableState:b2e,toggleOpened:t=>{e(n=>{n.tableState.isOpened=t[0]==="opened"})},toggleFullScreen:()=>{e(t=>{t.tableState.fullScreen=!t.tableState.fullScreen})},openTable:()=>{e(t=>{t.tableState.isOpened=!0})}}),k1=hc(pc(_2e));function AE(e,t){return AE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},AE(e,t)}function s9(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,AE(e,t)}function qn(){return qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Xo(1));return n(l9)(e,t)}if(typeof e!="function")throw new Error(Xo(2));var i=e,o=t,s=[],a=s,c=!1;function f(){a===s&&(a=s.slice())}function p(){if(c)throw new Error(Xo(3));return o}function g(T){if(typeof T!="function")throw new Error(Xo(4));if(c)throw new Error(Xo(5));var I=!0;return f(),a.push(T),function(){if(!!I){if(c)throw new Error(Xo(6));I=!1,f();var M=a.indexOf(T);a.splice(M,1),s=null}}}function v(T){if(!E2e(T))throw new Error(Xo(7));if(typeof T.type>"u")throw new Error(Xo(8));if(c)throw new Error(Xo(9));try{c=!0,o=i(o,T)}finally{c=!1}for(var I=s=a,P=0;P=0)&&(n[i]=e[i]);return n}var zI=w_.exports,D2e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},O2e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},A2e={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},p9={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},$I={};$I[zI.ForwardRef]=A2e;$I[zI.Memo]=p9;function AL(e){return zI.isMemo(e)?p9:$I[e.$$typeof]||D2e}var N2e=Object.defineProperty,L2e=Object.getOwnPropertyNames,NL=Object.getOwnPropertySymbols,F2e=Object.getOwnPropertyDescriptor,z2e=Object.getPrototypeOf,LL=Object.prototype;function m9(e,t,n){if(typeof t!="string"){if(LL){var r=z2e(t);r&&r!==LL&&m9(e,r,n)}var i=L2e(t);NL&&(i=i.concat(NL(t)));for(var o=AL(e),s=AL(t),a=0;a=0;r--){var i=t[r](e);if(i)return i}return function(o,s){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function w4e(e,t){return e===t}function C4e(e){var t=e===void 0?{}:e,n=t.connectHOC,r=n===void 0?r4e:n,i=t.mapStateToPropsFactories,o=i===void 0?d4e:i,s=t.mapDispatchToPropsFactories,a=s===void 0?l4e:s,c=t.mergePropsFactories,f=c===void 0?g4e:c,p=t.selectorFactory,g=p===void 0?b4e:p;return function(b,_,T,I){I===void 0&&(I={});var P=I,M=P.pure,O=M===void 0?!0:M,N=P.areStatesEqual,F=N===void 0?w4e:N,$=P.areOwnPropsEqual,j=$===void 0?zS:$,U=P.areStatePropsEqual,q=U===void 0?zS:U,Y=P.areMergedPropsEqual,te=Y===void 0?zS:Y,Z=Wb(P,_4e),X=$S(b,o,"mapStateToProps"),J=$S(_,a,"mapDispatchToProps"),ce=$S(T,f,"mergeProps");return r(g,Ih({methodName:"connect",getDisplayName:function(se){return"Connect("+se+")"},shouldHandleStateChanges:Boolean(b),initMapStateToProps:X,initMapDispatchToProps:J,initMergeProps:ce,pure:O,areStatesEqual:F,areOwnPropsEqual:j,areStatePropsEqual:q,areMergedPropsEqual:te},Z))}}const C9=C4e();I2e(al.exports.unstable_batchedUpdates);function S4e(e,t){if(e.length!==t.length)return!1;for(var n=0;n");return r.callbacks},r.setCallbacks=function(a){r.callbacks=a},r}var n=t.prototype;return n.componentDidMount=function(){this.unbind=es(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(i){if(i instanceof Zb){this.setState({});return}throw i},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(Un.Component),L4e=` Press space bar to start a drag. When dragging you can use the arrow keys to move the item around and escape to cancel. Some screen readers may require you to be in focus mode or to use your pass through key `,Xb=function(t){return t+1},F4e=function(t){return` You have lifted an item in position `+Xb(t.source.index)+` `},I9=function(t,n){var r=t.droppableId===n.droppableId,i=Xb(t.index),o=Xb(n.index);return r?` You have moved the item from position `+i+` to position `+o+` `:` You have moved the item from position `+i+` in list `+t.droppableId+` to list `+n.droppableId+` in position `+o+` `},k9=function(t,n,r){var i=n.droppableId===r.droppableId;return i?` The item `+t+` has been combined with `+r.draggableId:` The item `+t+` in list `+n.droppableId+` has been combined with `+r.draggableId+` in list `+r.droppableId+` `},z4e=function(t){var n=t.destination;if(n)return I9(t.source,n);var r=t.combine;return r?k9(t.draggableId,t.source,r):"You are over an area that cannot be dropped on"},jL=function(t){return` The item has returned to its starting position of `+Xb(t.index)+` `},$4e=function(t){if(t.reason==="CANCEL")return` Movement cancelled. `+jL(t.source)+` `;var n=t.destination,r=t.combine;return n?` You have dropped the item. `+I9(t.source,n)+` `:r?` You have dropped the item. `+k9(t.draggableId,t.source,r)+` `:` The item has been dropped while not over a drop area. `+jL(t.source)+` `},Px={dragHandleUsageInstructions:L4e,onDragStart:F4e,onDragUpdate:z4e,onDragEnd:$4e},io={x:0,y:0},fo=function(t,n){return{x:t.x+n.x,y:t.y+n.y}},wa=function(t,n){return{x:t.x-n.x,y:t.y-n.y}},Ju=function(t,n){return t.x===n.x&&t.y===n.y},Yh=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},Nd=function(t,n,r){var i;return r===void 0&&(r=0),i={},i[t]=n,i[t==="x"?"y":"x"]=r,i},Vg=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},HL=function(t,n){return Math.min.apply(Math,n.map(function(r){return Vg(t,r)}))},M9=function(t){return function(n){return{x:t(n.x),y:t(n.y)}}},B4e=function(e,t){var n=Ps({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n},Ov=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},KL=function(t){return[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}]},V4e={top:0,right:0,bottom:0,left:0},U4e=function(t,n){return n?Ov(t,n.scroll.diff.displacement):t},j4e=function(t,n,r){if(r&&r.increasedBy){var i;return qn({},t,(i={},i[n.end]=t[n.end]+r.increasedBy[n.line],i))}return t},H4e=function(t,n){return n&&n.shouldClipSubject?B4e(n.pageMarginBox,t):Ps(t)},kh=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,i=e.frame,o=U4e(t.marginBox,i),s=j4e(o,r,n),a=H4e(s,i);return{page:t,withPlaceholder:n,active:a}},HI=function(e,t){e.frame||rn(!1);var n=e.frame,r=wa(t,n.scroll.initial),i=Yh(r),o=qn({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}}),s=kh({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o}),a=qn({},e,{frame:o,subject:s});return a};function Yb(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function KI(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;ne.bottom,f=r.lefte.right,p=c&&f;if(p)return!0;var g=c&&s||f&&o;return g}},q4e=function(e){var t=rs(e.top,e.bottom),n=rs(e.left,e.right);return function(r){var i=t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right);return i}},GI={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},L9={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Z4e=function(e){return function(t){var n=rs(t.top,t.bottom),r=rs(t.left,t.right);return function(i){return e===GI?n(i.top)&&n(i.bottom):r(i.left)&&r(i.right)}}},X4e=function(t,n){var r=n.frame?n.frame.scroll.diff.displacement:io;return Ov(t,r)},Y4e=function(t,n,r){return n.subject.active?r(n.subject.active)(t):!1},Q4e=function(t,n,r){return r(n)(t)},qI=function(t){var n=t.target,r=t.destination,i=t.viewport,o=t.withDroppableDisplacement,s=t.isVisibleThroughFrameFn,a=o?X4e(n,r):n;return Y4e(a,r,s)&&Q4e(a,i,s)},J4e=function(t){return qI(qn({},t,{isVisibleThroughFrameFn:N9}))},F9=function(t){return qI(qn({},t,{isVisibleThroughFrameFn:q4e}))},eEe=function(t){return qI(qn({},t,{isVisibleThroughFrameFn:Z4e(t.destination.axis)}))},tEe=function(t,n,r){if(typeof r=="boolean")return r;if(!n)return!0;var i=n.invisible,o=n.visible;if(i[t])return!1;var s=o[t];return s?s.shouldAnimate:!0};function nEe(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return Ps(UI(n,r))}function jg(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,i=e.viewport,o=e.forceShouldAnimate,s=e.last;return t.reduce(function(c,f){var p=nEe(f,r),g=f.descriptor.id;c.all.push(g);var v=J4e({target:p,destination:n,viewport:i,withDroppableDisplacement:!0});if(!v)return c.invisible[f.descriptor.id]=!0,c;var b=tEe(g,s,o),_={draggableId:g,shouldAnimate:b};return c.visible[g]=_,c},{all:[],visible:{},invisible:{}})}function rEe(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function WL(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,i=e.destination,o=rEe(t,{inHomeList:n});return{displaced:Ug,displacedBy:r,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:o}}}}function Qb(e){var t=e.draggable,n=e.insideDestination,r=e.destination,i=e.viewport,o=e.displacedBy,s=e.last,a=e.index,c=e.forceShouldAnimate,f=Jh(t,r);if(a==null)return WL({insideDestination:n,inHomeList:f,displacedBy:o,destination:r});var p=gc(n,function(T){return T.descriptor.index===a});if(!p)return WL({insideDestination:n,inHomeList:f,displacedBy:o,destination:r});var g=A1(t,n),v=n.indexOf(p),b=g.slice(v),_=jg({afterDragging:b,destination:r,displacedBy:o,last:s,viewport:i.frame,forceShouldAnimate:c});return{displaced:_,displacedBy:o,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function sc(e,t){return Boolean(t.effected[e])}var iEe=function(e){var t=e.isMovingForward,n=e.destination,r=e.draggables,i=e.combine,o=e.afterCritical;if(!n.isCombineEnabled)return null;var s=i.draggableId,a=r[s],c=a.descriptor.index,f=sc(s,o);return f?t?c:c-1:t?c+1:c},oEe=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,i=e.location;if(!r.length)return null;var o=i.index,s=t?o+1:o-1,a=r[0].descriptor.index,c=r[r.length-1].descriptor.index,f=n?c:c+1;return sf?null:s},aEe=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,i=e.draggables,o=e.destination,s=e.insideDestination,a=e.previousImpact,c=e.viewport,f=e.afterCritical,p=a.at;if(p||rn(!1),p.type==="REORDER"){var g=oEe({isMovingForward:t,isInHomeList:n,location:p.destination,insideDestination:s});return g==null?null:Qb({draggable:r,insideDestination:s,destination:o,viewport:c,last:a.displaced,displacedBy:a.displacedBy,index:g})}var v=iEe({isMovingForward:t,destination:o,displaced:a.displaced,draggables:i,combine:p.combine,afterCritical:f});return v==null?null:Qb({draggable:r,insideDestination:s,destination:o,viewport:c,last:a.displaced,displacedBy:a.displacedBy,index:v})},sEe=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,i=e.displacedBy,o=Boolean(t.visible[r]||t.invisible[r]);return sc(r,n)?o?io:Yh(i.point):o?i.point:io},lEe=function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,i=O1(n);i||rn(!1);var o=i.draggableId,s=r[o].page.borderBox.center,a=sEe({displaced:n.displaced,afterCritical:t,combineWith:o,displacedBy:n.displacedBy});return fo(s,a)},z9=function(t,n){return n.margin[t.start]+n.borderBox[t.size]/2},uEe=function(t,n){return n.margin[t.end]+n.borderBox[t.size]/2},ZI=function(t,n,r){return n[t.crossAxisStart]+r.margin[t.crossAxisStart]+r.borderBox[t.crossAxisSize]/2},GL=function(t){var n=t.axis,r=t.moveRelativeTo,i=t.isMoving;return Nd(n.line,r.marginBox[n.end]+z9(n,i),ZI(n,r.marginBox,i))},qL=function(t){var n=t.axis,r=t.moveRelativeTo,i=t.isMoving;return Nd(n.line,r.marginBox[n.start]-uEe(n,i),ZI(n,r.marginBox,i))},cEe=function(t){var n=t.axis,r=t.moveInto,i=t.isMoving;return Nd(n.line,r.contentBox[n.start]+z9(n,i),ZI(n,r.contentBox,i))},dEe=function(e){var t=e.impact,n=e.draggable,r=e.draggables,i=e.droppable,o=e.afterCritical,s=Qh(i.descriptor.id,r),a=n.page,c=i.axis;if(!s.length)return cEe({axis:c,moveInto:i.page,isMoving:a});var f=t.displaced,p=t.displacedBy,g=f.all[0];if(g){var v=r[g];if(sc(g,o))return qL({axis:c,moveRelativeTo:v.page,isMoving:a});var b=Gb(v.page,p.point);return qL({axis:c,moveRelativeTo:b,isMoving:a})}var _=s[s.length-1];if(_.descriptor.id===n.descriptor.id)return a.borderBox.center;if(sc(_.descriptor.id,o)){var T=Gb(_.page,Yh(o.displacedBy.point));return GL({axis:c,moveRelativeTo:T,isMoving:a})}return GL({axis:c,moveRelativeTo:_.page,isMoving:a})},NE=function(e,t){var n=e.frame;return n?fo(t,n.scroll.diff.displacement):t},fEe=function(t){var n=t.impact,r=t.draggable,i=t.droppable,o=t.draggables,s=t.afterCritical,a=r.page.borderBox.center,c=n.at;return!i||!c?a:c.type==="REORDER"?dEe({impact:n,draggable:r,draggables:o,droppable:i,afterCritical:s}):lEe({impact:n,draggables:o,afterCritical:s})},N1=function(e){var t=fEe(e),n=e.droppable,r=n?NE(n,t):t;return r},$9=function(e,t){var n=wa(t,e.scroll.initial),r=Yh(n),i=Ps({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),o={frame:i,scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}};return o};function ZL(e,t){return e.map(function(n){return t[n]})}function hEe(e,t){for(var n=0;n1?p.sort(function(g,v){return zo(g)[a.start]-zo(v)[a.start]})[0]:f.sort(function(g,v){var b=HL(n,KL(zo(g))),_=HL(n,KL(zo(v)));return b!==_?b-_:zo(g)[a.start]-zo(v)[a.start]})[0]},XL=function(t,n){var r=t.page.borderBox.center;return sc(t.descriptor.id,n)?wa(r,n.displacedBy.point):r},yEe=function(t,n){var r=t.page.borderBox;return sc(t.descriptor.id,n)?Ov(r,Yh(n.displacedBy.point)):r},xEe=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,i=e.insideDestination,o=e.afterCritical,s=i.filter(function(a){return F9({target:yEe(a,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})}).sort(function(a,c){var f=Vg(t,NE(r,XL(a,o))),p=Vg(t,NE(r,XL(c,o)));return ft.left&&e.topt.top}function TEe(e){var t=e.pageBorderBox,n=e.draggable,r=e.candidates,i=n.page.borderBox.center,o=r.map(function(s){var a=s.axis,c=Nd(s.axis.line,t.center[a.line],s.page.borderBox.center[a.crossAxisLine]);return{id:s.descriptor.id,distance:Vg(i,c)}}).sort(function(s,a){return a.distance-s.distance});return o[0]?o[0].id:null}function IEe(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,i=D1(r).filter(function(o){if(!o.isEnabled)return!1;var s=o.subject.active;if(!s||!PEe(t,s))return!1;if(j9(s)(t.center))return!0;var a=o.axis,c=s.center[a.crossAxisLine],f=t[a.crossAxisStart],p=t[a.crossAxisEnd],g=rs(s[a.crossAxisStart],s[a.crossAxisEnd]),v=g(f),b=g(p);return!v&&!b?!0:v?fc});return i.length?i.length===1?i[0].descriptor.id:TEe({pageBorderBox:t,draggable:n,candidates:i}):null}var H9=function(t,n){return Ps(Ov(t,n))},kEe=function(e,t){var n=e.frame;return n?H9(t,n.scroll.diff.value):t};function K9(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}function MEe(e){var t=e.draggable,n=e.closest,r=e.inHomeList;return n?r&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}var REe=function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,i=e.insideDestination,o=e.last,s=e.viewport,a=e.afterCritical,c=r.axis,f=Av(r.axis,n.displaceBy),p=f.value,g=t[c.start],v=t[c.end],b=A1(n,i),_=gc(b,function(I){var P=I.descriptor.id,M=I.page.borderBox.center[c.line],O=sc(P,a),N=K9({displaced:o,id:P});return O?N?v<=M:gP[a.start]+O&&gP[a.start]-f+O&&pP[a.start]+f+O&&gP[a.start]+O&&p=JL)return ej;var o=i/JL,s=zE+lPe*o,a=r==="CANCEL"?s*uPe:s;return Number(a.toFixed(2))},dPe=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,i=e.viewport,o=e.afterCritical,s=r.draggables,a=r.droppables,c=Sa(t),f=c?a[c]:null,p=a[n.descriptor.droppableId],g=q9({impact:t,draggable:n,draggables:s,afterCritical:o,droppable:f||p,viewport:i}),v=wa(g,n.client.borderBox.center);return v},fPe=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,i=e.home,o=e.viewport,s=e.onLiftImpact;if(!r.at||n!=="DROP"){var a=G9({draggables:t,impact:s,destination:i,viewport:o,forceShouldAnimate:!0});return{impact:a,didDropInsideDroppable:!1}}if(r.at.type==="REORDER")return{impact:r,didDropInsideDroppable:!0};var c=qn({},r,{displaced:Ug});return{impact:c,didDropInsideDroppable:!0}},hPe=function(e){var t=e.getState,n=e.dispatch;return function(r){return function(i){if(i.type!=="DROP"){r(i);return}var o=t(),s=i.payload.reason;if(o.phase==="COLLECTING"){n(oPe({reason:s}));return}if(o.phase!=="IDLE"){var a=o.phase==="DROP_PENDING"&&o.isWaiting;a&&rn(!1),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||rn(!1);var c=o.critical,f=o.dimensions,p=f.draggables[o.critical.draggable.id],g=fPe({reason:s,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),v=g.impact,b=g.didDropInsideDroppable,_=b?WI(v):null,T=b?O1(v):null,I={index:c.draggable.index,droppableId:c.droppable.id},P={draggableId:p.descriptor.id,type:p.descriptor.type,source:I,reason:s,mode:o.movementMode,destination:_,combine:T},M=dPe({impact:v,draggable:p,dimensions:f,viewport:o.viewport,afterCritical:o.afterCritical}),O={critical:o.critical,afterCritical:o.afterCritical,result:P,impact:v},N=!Ju(o.current.client.offset,M)||Boolean(P.combine);if(!N){n(JI({completed:O}));return}var F=cPe({current:o.current.client.offset,destination:M,reason:s}),$={newHomeClientOffset:M,dropDuration:F,completed:O};n(iPe($))}}}},tj=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function pPe(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(n){n.target!==window&&n.target!==window.document||e()}}}function mPe(e){var t=e.onWindowScroll;function n(){t(tj())}var r=Bg(n),i=pPe(r),o=Qu;function s(){return o!==Qu}function a(){s()&&rn(!1),o=es(window,[i])}function c(){s()||rn(!1),r.cancel(),o(),o=Qu}return{start:a,stop:c,isActive:s}}var gPe=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},vPe=function(e){var t=mPe({onWindowScroll:function(r){e.dispatch(QEe({newScroll:r}))}});return function(n){return function(r){!t.isActive()&&r.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&gPe(r)&&t.stop(),n(r)}}},yPe=function(e){var t=!1,n=!1,r=setTimeout(function(){n=!0}),i=function(s){t||n||(t=!0,e(s),clearTimeout(r))};return i.wasCalled=function(){return t},i},xPe=function(){var e=[],t=function(o){var s=KI(e,function(f){return f.timerId===o});s===-1&&rn(!1);var a=e.splice(s,1),c=a[0];c.callback()},n=function(o){var s=setTimeout(function(){return t(s)}),a={timerId:s,callback:o};e.push(a)},r=function(){if(!!e.length){var o=[].concat(e);e.length=0,o.forEach(function(s){clearTimeout(s.timerId),s.callback()})}};return{add:n,flush:r}},bPe=function(t,n){return t==null&&n==null?!0:t==null||n==null?!1:t.droppableId===n.droppableId&&t.index===n.index},_Pe=function(t,n){return t==null&&n==null?!0:t==null||n==null?!1:t.draggableId===n.draggableId&&t.droppableId===n.droppableId},wPe=function(t,n){if(t===n)return!0;var r=t.draggable.id===n.draggable.id&&t.draggable.droppableId===n.draggable.droppableId&&t.draggable.type===n.draggable.type&&t.draggable.index===n.draggable.index,i=t.droppable.id===n.droppable.id&&t.droppable.type===n.droppable.type;return r&&i},mm=function(t,n){n()},V0=function(t,n){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:n}},HS=function(t,n,r,i){if(!t){r(i(n));return}var o=yPe(r),s={announce:o};t(n,s),o.wasCalled()||r(i(n))},CPe=function(e,t){var n=xPe(),r=null,i=function(v,b){r&&rn(!1),mm("onBeforeCapture",function(){var _=e().onBeforeCapture;if(_){var T={draggableId:v,mode:b};_(T)}})},o=function(v,b){r&&rn(!1),mm("onBeforeDragStart",function(){var _=e().onBeforeDragStart;_&&_(V0(v,b))})},s=function(v,b){r&&rn(!1);var _=V0(v,b);r={mode:b,lastCritical:v,lastLocation:_.source,lastCombine:null},n.add(function(){mm("onDragStart",function(){return HS(e().onDragStart,_,t,Px.onDragStart)})})},a=function(v,b){var _=WI(b),T=O1(b);r||rn(!1);var I=!wPe(v,r.lastCritical);I&&(r.lastCritical=v);var P=!bPe(r.lastLocation,_);P&&(r.lastLocation=_);var M=!_Pe(r.lastCombine,T);if(M&&(r.lastCombine=T),!(!I&&!P&&!M)){var O=qn({},V0(v,r.mode),{combine:T,destination:_});n.add(function(){mm("onDragUpdate",function(){return HS(e().onDragUpdate,O,t,Px.onDragUpdate)})})}},c=function(){r||rn(!1),n.flush()},f=function(v){r||rn(!1),r=null,mm("onDragEnd",function(){return HS(e().onDragEnd,v,t,Px.onDragEnd)})},p=function(){if(!!r){var v=qn({},V0(r.lastCritical,r.mode),{combine:null,destination:null,reason:"CANCEL"});f(v)}};return{beforeCapture:i,beforeStart:o,start:s,update:a,flush:c,drop:f,abort:p}},SPe=function(e,t){var n=CPe(e,t);return function(r){return function(i){return function(o){if(o.type==="BEFORE_INITIAL_CAPTURE"){n.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(o.type==="INITIAL_PUBLISH"){var s=o.payload.critical;n.beforeStart(s,o.payload.movementMode),i(o),n.start(s,o.payload.movementMode);return}if(o.type==="DROP_COMPLETE"){var a=o.payload.completed.result;n.flush(),i(o),n.drop(a);return}if(i(o),o.type==="FLUSH"){n.abort();return}var c=r.getState();c.phase==="DRAGGING"&&n.update(c.critical,c.impact)}}}},EPe=function(e){return function(t){return function(n){if(n.type!=="DROP_ANIMATION_FINISHED"){t(n);return}var r=e.getState();r.phase!=="DROP_ANIMATING"&&rn(!1),e.dispatch(JI({completed:r.completed}))}}},PPe=function(e){var t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return function(i){return function(o){if((o.type==="FLUSH"||o.type==="DROP_COMPLETE"||o.type==="DROP_ANIMATION_FINISHED")&&r(),i(o),o.type==="DROP_ANIMATE"){var s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var c=e.getState();c.phase==="DROP_ANIMATING"&&e.dispatch(J9())}};n=requestAnimationFrame(function(){n=null,t=es(window,[s])})}}}},TPe=function(e){return function(){return function(t){return function(n){(n.type==="DROP_COMPLETE"||n.type==="FLUSH"||n.type==="DROP_ANIMATE")&&e.stopPublishing(),t(n)}}}},IPe=function(e){var t=!1;return function(){return function(n){return function(r){if(r.type==="INITIAL_PUBLISH"){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(r.type==="FLUSH"){t=!1,e.tryRestoreFocusRecorded();return}if(r.type==="DROP_COMPLETE"){t=!1;var i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}},kPe=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},MPe=function(e){return function(t){return function(n){return function(r){if(kPe(r)){e.stop(),n(r);return}if(r.type==="INITIAL_PUBLISH"){n(r);var i=t.getState();i.phase!=="DRAGGING"&&rn(!1),e.start(i);return}n(r),e.scroll(t.getState())}}}},RPe=function(e){return function(t){return function(n){if(t(n),n.type==="PUBLISH_WHILE_DRAGGING"){var r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Q9({reason:r.reason})))}}}},DPe=u9,OPe=function(e){var t=e.dimensionMarshal,n=e.focusMarshal,r=e.styleMarshal,i=e.getResponders,o=e.announce,s=e.autoScroller;return l9(jEe,DPe(P2e(sPe(r),TPe(t),aPe(t),hPe,EPe,PPe,RPe,MPe(s),vPe,IPe(n),SPe(i,o))))},KS=function(){return{additions:{},removals:{},modified:{}}};function APe(e){var t=e.registry,n=e.callbacks,r=KS(),i=null,o=function(){i||(n.collectionStarting(),i=requestAnimationFrame(function(){i=null;var p=r,g=p.additions,v=p.removals,b=p.modified,_=Object.keys(g).map(function(P){return t.draggable.getById(P).getDimension(io)}).sort(function(P,M){return P.descriptor.index-M.descriptor.index}),T=Object.keys(b).map(function(P){var M=t.droppable.getById(P),O=M.callbacks.getScrollWhileDragging();return{droppableId:P,scroll:O}}),I={additions:_,removals:Object.keys(v),modified:T};r=KS(),n.publish(I)}))},s=function(p){var g=p.descriptor.id;r.additions[g]=p,r.modified[p.descriptor.droppableId]=!0,r.removals[g]&&delete r.removals[g],o()},a=function(p){var g=p.descriptor;r.removals[g.id]=!0,r.modified[g.droppableId]=!0,r.additions[g.id]&&delete r.additions[g.id],o()},c=function(){!i||(cancelAnimationFrame(i),i=null,r=KS())};return{add:s,remove:a,stop:c}}var nj=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,i=e.width,o=wa({x:n,y:t},{x:i,y:r}),s={x:Math.max(0,o.x),y:Math.max(0,o.y)};return s},rj=function(){var e=document.documentElement;return e||rn(!1),e},ij=function(){var e=rj(),t=nj({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t},NPe=function(){var e=tj(),t=ij(),n=e.y,r=e.x,i=rj(),o=i.clientWidth,s=i.clientHeight,a=r+o,c=n+s,f=Ps({top:n,left:r,right:a,bottom:c}),p={frame:f,scroll:{initial:e,current:e,max:t,diff:{value:io,displacement:io}}};return p},LPe=function(e){var t=e.critical,n=e.scrollOptions,r=e.registry,i=NPe(),o=i.scroll.current,s=t.droppable,a=r.droppable.getAllByType(s.type).map(function(g){return g.callbacks.getDimensionAndWatchScroll(o,n)}),c=r.draggable.getAllByType(t.draggable.type).map(function(g){return g.getDimension(o)}),f={draggables:O9(c),droppables:D9(a)},p={dimensions:f,critical:t,viewport:i};return p};function eF(e,t,n){if(n.descriptor.id===t.id||n.descriptor.type!==t.type)return!1;var r=e.droppable.getById(n.descriptor.droppableId);return r.descriptor.mode==="virtual"}var FPe=function(e,t){var n=null,r=APe({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(b,_){e.droppable.exists(b)||rn(!1),n&&t.updateDroppableIsEnabled({id:b,isEnabled:_})},o=function(b,_){!n||(e.droppable.exists(b)||rn(!1),t.updateDroppableIsCombineEnabled({id:b,isCombineEnabled:_}))},s=function(b,_){!n||(e.droppable.exists(b)||rn(!1),t.updateDroppableScroll({id:b,newScroll:_}))},a=function(b,_){!n||e.droppable.getById(b).callbacks.scroll(_)},c=function(){if(!!n){r.stop();var b=n.critical.droppable;e.droppable.getAllByType(b.type).forEach(function(_){return _.callbacks.dragStopped()}),n.unsubscribe(),n=null}},f=function(b){n||rn(!1);var _=n.critical.draggable;b.type==="ADDITION"&&eF(e,_,b.value)&&r.add(b.value),b.type==="REMOVAL"&&eF(e,_,b.value)&&r.remove(b.value)},p=function(b){n&&rn(!1);var _=e.draggable.getById(b.draggableId),T=e.droppable.getById(_.descriptor.droppableId),I={draggable:_.descriptor,droppable:T.descriptor},P=e.subscribe(f);return n={critical:I,unsubscribe:P},LPe({critical:I,registry:e,scrollOptions:b.scrollOptions})},g={updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:s,startPublishing:p,stopPublishing:c};return g},oj=function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"},zPe=function(e){window.scrollBy(e.x,e.y)},$Pe=ro(function(e){return D1(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),BPe=function(t,n){var r=gc($Pe(n),function(i){return i.frame||rn(!1),j9(i.frame.pageMarginBox)(t)});return r},VPe=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var i=r[n];return i.frame?i:null}var o=BPe(t,r);return o},ec={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},UPe=function(e,t){var n=e[t.size]*ec.startFromPercentage,r=e[t.size]*ec.maxScrollAtPercentage,i={startScrollingFrom:n,maxScrollValueAt:r};return i},aj=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,i=n-t;if(i===0)return 0;var o=r-t,s=o/i;return s},nk=1,jPe=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return ec.maxPixelScroll;if(e===t.startScrollingFrom)return nk;var n=aj({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=1-n,i=ec.maxPixelScroll*ec.ease(r);return Math.ceil(i)},tF=ec.durationDampening.accelerateAt,nF=ec.durationDampening.stopDampeningAt,HPe=function(e,t){var n=t,r=nF,i=Date.now(),o=i-n;if(o>=nF)return e;if(ot.height,o=n.width>t.width;return!o&&!i?r:o&&i?null:{x:o?0:r.x,y:i?0:r.y}},WPe=M9(function(e){return e===0?0:e}),sj=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,i=e.center,o=e.shouldUseTimeDampening,s={top:i.y-n.top,right:n.right-i.x,bottom:n.bottom-i.y,left:i.x-n.left},a=iF({container:n,distanceToEdges:s,dragStartTime:t,axis:GI,shouldUseTimeDampening:o}),c=iF({container:n,distanceToEdges:s,dragStartTime:t,axis:L9,shouldUseTimeDampening:o}),f=WPe({x:c,y:a});if(Ju(f,io))return null;var p=KPe({container:n,subject:r,proposedScroll:f});return p?Ju(p,io)?null:p:null},GPe=M9(function(e){return e===0?0:e>0?1:-1}),rk=function(){var e=function(n,r){return n<0?n:n>r?n-r:0};return function(t){var n=t.current,r=t.max,i=t.change,o=fo(n,i),s={x:e(o.x,r.x),y:e(o.y,r.y)};return Ju(s,io)?null:s}}(),lj=function(t){var n=t.max,r=t.current,i=t.change,o={x:Math.max(r.x,n.x),y:Math.max(r.y,n.y)},s=GPe(i),a=rk({max:o,current:r,change:s});return!a||s.x!==0&&a.x===0||s.y!==0&&a.y===0},ik=function(t,n){return lj({current:t.scroll.current,max:t.scroll.max,change:n})},qPe=function(t,n){if(!ik(t,n))return null;var r=t.scroll.max,i=t.scroll.current;return rk({current:i,max:r,change:n})},ok=function(t,n){var r=t.frame;return r?lj({current:r.scroll.current,max:r.scroll.max,change:n}):!1},ZPe=function(t,n){var r=t.frame;return!r||!ok(t,n)?null:rk({current:r.scroll.current,max:r.scroll.max,change:n})},XPe=function(e){var t=e.viewport,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,s=sj({dragStartTime:i,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return s&&ik(t,s)?s:null},YPe=function(e){var t=e.droppable,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,s=t.frame;if(!s)return null;var a=sj({dragStartTime:i,container:s.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:o});return a&&ok(t,a)?a:null},oF=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,i=e.scrollWindow,o=e.scrollDroppable,s=t.current.page.borderBoxCenter,a=t.dimensions.draggables[t.critical.draggable.id],c=a.page.marginBox;if(t.isWindowScrollAllowed){var f=t.viewport,p=XPe({dragStartTime:n,viewport:f,subject:c,center:s,shouldUseTimeDampening:r});if(p){i(p);return}}var g=VPe({center:s,destination:Sa(t.impact),droppables:t.dimensions.droppables});if(!!g){var v=YPe({dragStartTime:n,droppable:g,subject:c,center:s,shouldUseTimeDampening:r});v&&o(g.descriptor.id,v)}},QPe=function(e){var t=e.scrollWindow,n=e.scrollDroppable,r=Bg(t),i=Bg(n),o=null,s=function(p){o||rn(!1);var g=o,v=g.shouldUseTimeDampening,b=g.dragStartTime;oF({state:p,scrollWindow:r,scrollDroppable:i,dragStartTime:b,shouldUseTimeDampening:v})},a=function(p){o&&rn(!1);var g=Date.now(),v=!1,b=function(){v=!0};oF({state:p,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:b,scrollDroppable:b}),o={dragStartTime:g,shouldUseTimeDampening:v},v&&s(p)},c=function(){!o||(r.cancel(),i.cancel(),o=null)};return{start:a,stop:c,scroll:s}},JPe=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow,i=function(f,p){var g=fo(f.current.client.selection,p);t({client:g})},o=function(f,p){if(!ok(f,p))return p;var g=ZPe(f,p);if(!g)return n(f.descriptor.id,p),null;var v=wa(p,g);n(f.descriptor.id,v);var b=wa(p,v);return b},s=function(f,p,g){if(!f||!ik(p,g))return g;var v=qPe(p,g);if(!v)return r(g),null;var b=wa(g,v);r(b);var _=wa(g,b);return _},a=function(f){var p=f.scrollJumpRequest;if(!!p){var g=Sa(f.impact);g||rn(!1);var v=o(f.dimensions.droppables[g],p);if(!!v){var b=f.viewport,_=s(f.isWindowScrollAllowed,b,v);!_||i(f,_)}}};return a},eTe=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,i=QPe({scrollWindow:n,scrollDroppable:t}),o=JPe({move:r,scrollWindow:n,scrollDroppable:t}),s=function(f){if(f.phase==="DRAGGING"){if(f.movementMode==="FLUID"){i.scroll(f);return}!f.scrollJumpRequest||o(f)}},a={scroll:s,start:i.start,stop:i.stop};return a},Mh="data-rbd",Rh=function(){var e=Mh+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),$E=function(){var e=Mh+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),tTe=function(){var e=Mh+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),aF={contextId:Mh+"-scroll-container-context-id"},nTe=function(t){return function(n){return"["+n+'="'+t+'"]'}},gm=function(t,n){return t.map(function(r){var i=r.styles[n];return i?r.selector+" { "+i+" }":""}).join(" ")},rTe="pointer-events: none;",iTe=function(e){var t=nTe(e),n=function(){var a=` cursor: -webkit-grab; cursor: grab; `;return{selector:t(Rh.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:a,dragging:rTe,dropAnimating:a}}}(),r=function(){var a=` transition: `+tg.outOfTheWay+`; `;return{selector:t($E.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}}(),i={selector:t(tTe.contextId),styles:{always:"overflow-anchor: none;"}},o={selector:"body",styles:{dragging:` cursor: grabbing; cursor: -webkit-grabbing; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; overflow-anchor: none; `}},s=[r,n,i,o];return{always:gm(s,"always"),resting:gm(s,"resting"),dragging:gm(s,"dragging"),dropAnimating:gm(s,"dropAnimating"),userCancel:gm(s,"userCancel")}},Ea=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?E.exports.useLayoutEffect:E.exports.useEffect,WS=function(){var t=document.querySelector("head");return t||rn(!1),t},sF=function(t){var n=document.createElement("style");return t&&n.setAttribute("nonce",t),n.type="text/css",n};function oTe(e,t){var n=yr(function(){return iTe(e)},[e]),r=E.exports.useRef(null),i=E.exports.useRef(null),o=On(ro(function(g){var v=i.current;v||rn(!1),v.textContent=g}),[]),s=On(function(g){var v=r.current;v||rn(!1),v.textContent=g},[]);Ea(function(){!r.current&&!i.current||rn(!1);var g=sF(t),v=sF(t);return r.current=g,i.current=v,g.setAttribute(Mh+"-always",e),v.setAttribute(Mh+"-dynamic",e),WS().appendChild(g),WS().appendChild(v),s(n.always),o(n.resting),function(){var b=function(T){var I=T.current;I||rn(!1),WS().removeChild(I),T.current=null};b(r),b(i)}},[t,s,o,n.always,n.resting,e]);var a=On(function(){return o(n.dragging)},[o,n.dragging]),c=On(function(g){if(g==="DROP"){o(n.dropAnimating);return}o(n.userCancel)},[o,n.dropAnimating,n.userCancel]),f=On(function(){!i.current||o(n.resting)},[o,n.resting]),p=yr(function(){return{dragging:a,dropping:c,resting:f}},[a,c,f]);return p}var uj=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function L1(e){return e instanceof uj(e).HTMLElement}function aTe(e,t){var n="["+Rh.contextId+'="'+e+'"]',r=R9(document.querySelectorAll(n));if(!r.length)return null;var i=gc(r,function(o){return o.getAttribute(Rh.draggableId)===t});return!i||!L1(i)?null:i}function sTe(e){var t=E.exports.useRef({}),n=E.exports.useRef(null),r=E.exports.useRef(null),i=E.exports.useRef(!1),o=On(function(v,b){var _={id:v,focus:b};return t.current[v]=_,function(){var I=t.current,P=I[v];P!==_&&delete I[v]}},[]),s=On(function(v){var b=aTe(e,v);b&&b!==document.activeElement&&b.focus()},[e]),a=On(function(v,b){n.current===v&&(n.current=b)},[]),c=On(function(){r.current||!i.current||(r.current=requestAnimationFrame(function(){r.current=null;var v=n.current;v&&s(v)}))},[s]),f=On(function(v){n.current=null;var b=document.activeElement;!b||b.getAttribute(Rh.draggableId)===v&&(n.current=v)},[]);Ea(function(){return i.current=!0,function(){i.current=!1;var v=r.current;v&&cancelAnimationFrame(v)}},[]);var p=yr(function(){return{register:o,tryRecordFocus:f,tryRestoreFocusRecorded:c,tryShiftRecord:a}},[o,f,c,a]);return p}function lTe(){var e={draggables:{},droppables:{}},t=[];function n(g){return t.push(g),function(){var b=t.indexOf(g);b!==-1&&t.splice(b,1)}}function r(g){t.length&&t.forEach(function(v){return v(g)})}function i(g){return e.draggables[g]||null}function o(g){var v=i(g);return v||rn(!1),v}var s={register:function(v){e.draggables[v.descriptor.id]=v,r({type:"ADDITION",value:v})},update:function(v,b){var _=e.draggables[b.descriptor.id];!_||_.uniqueId===v.uniqueId&&(delete e.draggables[b.descriptor.id],e.draggables[v.descriptor.id]=v)},unregister:function(v){var b=v.descriptor.id,_=i(b);!_||v.uniqueId===_.uniqueId&&(delete e.draggables[b],r({type:"REMOVAL",value:v}))},getById:o,findById:i,exists:function(v){return Boolean(i(v))},getAllByType:function(v){return Yb(e.draggables).filter(function(b){return b.descriptor.type===v})}};function a(g){return e.droppables[g]||null}function c(g){var v=a(g);return v||rn(!1),v}var f={register:function(v){e.droppables[v.descriptor.id]=v},unregister:function(v){var b=a(v.descriptor.id);!b||v.uniqueId===b.uniqueId&&delete e.droppables[v.descriptor.id]},getById:c,findById:a,exists:function(v){return Boolean(a(v))},getAllByType:function(v){return Yb(e.droppables).filter(function(b){return b.descriptor.type===v})}};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:f,subscribe:n,clean:p}}function uTe(){var e=yr(lTe,[]);return E.exports.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var ak=Un.createContext(null),Jb=function(){var e=document.body;return e||rn(!1),e},cTe={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},dTe=function(t){return"rbd-announcement-"+t};function fTe(e){var t=yr(function(){return dTe(e)},[e]),n=E.exports.useRef(null);E.exports.useEffect(function(){var o=document.createElement("div");return n.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),qn(o.style,cTe),Jb().appendChild(o),function(){setTimeout(function(){var c=Jb();c.contains(o)&&c.removeChild(o),o===n.current&&(n.current=null)})}},[t]);var r=On(function(i){var o=n.current;if(o){o.textContent=i;return}},[]);return r}var hTe=0,pTe={separator:"::"};function sk(e,t){return t===void 0&&(t=pTe),yr(function(){return""+e+t.separator+hTe++},[t.separator,e])}function mTe(e){var t=e.contextId,n=e.uniqueId;return"rbd-hidden-text-"+t+"-"+n}function gTe(e){var t=e.contextId,n=e.text,r=sk("hidden-text",{separator:"-"}),i=yr(function(){return mTe({contextId:t,uniqueId:r})},[r,t]);return E.exports.useEffect(function(){var s=document.createElement("div");return s.id=i,s.textContent=n,s.style.display="none",Jb().appendChild(s),function(){var c=Jb();c.contains(s)&&c.removeChild(s)}},[i,n]),i}var F1=Un.createContext(null);function cj(e){var t=E.exports.useRef(e);return E.exports.useEffect(function(){t.current=e}),t}function vTe(){var e=null;function t(){return Boolean(e)}function n(s){return s===e}function r(s){e&&rn(!1);var a={abandon:s};return e=a,a}function i(){e||rn(!1),e=null}function o(){e&&(e.abandon(),i())}return{isClaimed:t,isActive:n,claim:r,release:i,tryAbandon:o}}var yTe=9,xTe=13,lk=27,dj=32,bTe=33,_Te=34,wTe=35,CTe=36,STe=37,ETe=38,PTe=39,TTe=40,U0,ITe=(U0={},U0[xTe]=!0,U0[yTe]=!0,U0),fj=function(e){ITe[e.keyCode]&&e.preventDefault()},z1=function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],n=gc(t,function(r){return"on"+r in document});return n||e}(),hj=0,lF=5;function kTe(e,t){return Math.abs(t.x-e.x)>=lF||Math.abs(t.y-e.y)>=lF}var uF={type:"IDLE"};function MTe(e){var t=e.cancel,n=e.completed,r=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(s){var a=s.button,c=s.clientX,f=s.clientY;if(a===hj){var p={x:c,y:f},g=r();if(g.type==="DRAGGING"){s.preventDefault(),g.actions.move(p);return}g.type!=="PENDING"&&rn(!1);var v=g.point;if(!!kTe(v,p)){s.preventDefault();var b=g.actions.fluidLift(p);i({type:"DRAGGING",actions:b})}}}},{eventName:"mouseup",fn:function(s){var a=r();if(a.type!=="DRAGGING"){t();return}s.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),n()}},{eventName:"mousedown",fn:function(s){r().type==="DRAGGING"&&s.preventDefault(),t()}},{eventName:"keydown",fn:function(s){var a=r();if(a.type==="PENDING"){t();return}if(s.keyCode===lk){s.preventDefault(),t();return}fj(s)}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){r().type==="PENDING"&&t()}},{eventName:"webkitmouseforcedown",fn:function(s){var a=r();if(a.type==="IDLE"&&rn(!1),a.actions.shouldRespectForcePress()){t();return}s.preventDefault()}},{eventName:z1,fn:t}]}function RTe(e){var t=E.exports.useRef(uF),n=E.exports.useRef(Qu),r=yr(function(){return{eventName:"mousedown",fn:function(g){if(!g.defaultPrevented&&g.button===hj&&!(g.ctrlKey||g.metaKey||g.shiftKey||g.altKey)){var v=e.findClosestDraggableId(g);if(!!v){var b=e.tryGetLock(v,s,{sourceEvent:g});if(!!b){g.preventDefault();var _={x:g.clientX,y:g.clientY};n.current(),f(b,_)}}}}}},[e]),i=yr(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(g){if(!g.defaultPrevented){var v=e.findClosestDraggableId(g);if(!!v){var b=e.findOptionsForDraggable(v);!b||b.shouldRespectForcePress||!e.canGetLock(v)||g.preventDefault()}}}}},[e]),o=On(function(){var g={passive:!1,capture:!0};n.current=es(window,[i,r],g)},[i,r]),s=On(function(){var p=t.current;p.type!=="IDLE"&&(t.current=uF,n.current(),o())},[o]),a=On(function(){var p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),c=On(function(){var g={capture:!0,passive:!1},v=MTe({cancel:a,completed:s,getPhase:function(){return t.current},setPhase:function(_){t.current=_}});n.current=es(window,v,g)},[a,s]),f=On(function(g,v){t.current.type!=="IDLE"&&rn(!1),t.current={type:"PENDING",point:v,actions:g},c()},[c]);Ea(function(){return o(),function(){n.current()}},[o])}var kf;function DTe(){}var OTe=(kf={},kf[_Te]=!0,kf[bTe]=!0,kf[CTe]=!0,kf[wTe]=!0,kf);function ATe(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:function(o){if(o.keyCode===lk){o.preventDefault(),n();return}if(o.keyCode===dj){o.preventDefault(),r();return}if(o.keyCode===TTe){o.preventDefault(),e.moveDown();return}if(o.keyCode===ETe){o.preventDefault(),e.moveUp();return}if(o.keyCode===PTe){o.preventDefault(),e.moveRight();return}if(o.keyCode===STe){o.preventDefault(),e.moveLeft();return}if(OTe[o.keyCode]){o.preventDefault();return}fj(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:z1,fn:n}]}function NTe(e){var t=E.exports.useRef(DTe),n=yr(function(){return{eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==dj)return;var s=e.findClosestDraggableId(o);if(!s)return;var a=e.tryGetLock(s,p,{sourceEvent:o});if(!a)return;o.preventDefault();var c=!0,f=a.snapLift();t.current();function p(){c||rn(!1),c=!1,t.current(),r()}t.current=es(window,ATe(f,p),{capture:!0,passive:!1})}}},[e]),r=On(function(){var o={passive:!1,capture:!0};t.current=es(window,[n],o)},[n]);Ea(function(){return r(),function(){t.current()}},[r])}var GS={type:"IDLE"},LTe=120,FTe=.15;function zTe(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(i){i.preventDefault()}},{eventName:"keydown",fn:function(i){if(n().type!=="DRAGGING"){t();return}i.keyCode===lk&&i.preventDefault(),t()}},{eventName:z1,fn:t}]}function $Te(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(o){var s=r();if(s.type!=="DRAGGING"){t();return}s.hasMoved=!0;var a=o.touches[0],c=a.clientX,f=a.clientY,p={x:c,y:f};o.preventDefault(),s.actions.move(p)}},{eventName:"touchend",fn:function(o){var s=r();if(s.type!=="DRAGGING"){t();return}o.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),n()}},{eventName:"touchcancel",fn:function(o){if(r().type!=="DRAGGING"){t();return}o.preventDefault(),t()}},{eventName:"touchforcechange",fn:function(o){var s=r();s.type==="IDLE"&&rn(!1);var a=o.touches[0];if(!!a){var c=a.force>=FTe;if(!!c){var f=s.actions.shouldRespectForcePress();if(s.type==="PENDING"){f&&t();return}if(f){if(s.hasMoved){o.preventDefault();return}t();return}o.preventDefault()}}}},{eventName:z1,fn:t}]}function BTe(e){var t=E.exports.useRef(GS),n=E.exports.useRef(Qu),r=On(function(){return t.current},[]),i=On(function(b){t.current=b},[]),o=yr(function(){return{eventName:"touchstart",fn:function(b){if(!b.defaultPrevented){var _=e.findClosestDraggableId(b);if(!!_){var T=e.tryGetLock(_,a,{sourceEvent:b});if(!!T){var I=b.touches[0],P=I.clientX,M=I.clientY,O={x:P,y:M};n.current(),g(T,O)}}}}}},[e]),s=On(function(){var b={capture:!0,passive:!1};n.current=es(window,[o],b)},[o]),a=On(function(){var v=t.current;v.type!=="IDLE"&&(v.type==="PENDING"&&clearTimeout(v.longPressTimerId),i(GS),n.current(),s())},[s,i]),c=On(function(){var v=t.current;a(),v.type==="DRAGGING"&&v.actions.cancel({shouldBlockNextClick:!0}),v.type==="PENDING"&&v.actions.abort()},[a]),f=On(function(){var b={capture:!0,passive:!1},_={cancel:c,completed:a,getPhase:r},T=es(window,$Te(_),b),I=es(window,zTe(_),b);n.current=function(){T(),I()}},[c,r,a]),p=On(function(){var b=r();b.type!=="PENDING"&&rn(!1);var _=b.actions.fluidLift(b.point);i({type:"DRAGGING",actions:_,hasMoved:!1})},[r,i]),g=On(function(b,_){r().type!=="IDLE"&&rn(!1);var T=setTimeout(p,LTe);i({type:"PENDING",point:_,actions:b,longPressTimerId:T}),f()},[f,r,i,p]);Ea(function(){return s(),function(){n.current();var _=r();_.type==="PENDING"&&(clearTimeout(_.longPressTimerId),i(GS))}},[r,s,i]),Ea(function(){var b=es(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return b},[])}var VTe={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function pj(e,t){if(t==null)return!1;var n=Boolean(VTe[t.tagName.toLowerCase()]);if(n)return!0;var r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:pj(e,t.parentElement)}function UTe(e,t){var n=t.target;return L1(n)?pj(e,n):!1}var jTe=function(e){return Ps(e.getBoundingClientRect()).center};function HTe(e){return e instanceof uj(e).Element}var KTe=function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],n=gc(t,function(r){return r in Element.prototype});return n||e}();function mj(e,t){return e==null?null:e[KTe](t)?e:mj(e.parentElement,t)}function WTe(e,t){return e.closest?e.closest(t):mj(e,t)}function GTe(e){return"["+Rh.contextId+'="'+e+'"]'}function qTe(e,t){var n=t.target;if(!HTe(n))return null;var r=GTe(e),i=WTe(n,r);return!i||!L1(i)?null:i}function ZTe(e,t){var n=qTe(e,t);return n?n.getAttribute(Rh.draggableId):null}function XTe(e,t){var n="["+$E.contextId+'="'+e+'"]',r=R9(document.querySelectorAll(n)),i=gc(r,function(o){return o.getAttribute($E.id)===t});return!i||!L1(i)?null:i}function YTe(e){e.preventDefault()}function j0(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!(!r()||t!==n)}function gj(e){var t=e.lockAPI,n=e.store,r=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var o=r.draggable.findById(i);return!(!o||!o.options.isEnabled||!oj(n.getState(),i))}function QTe(e){var t=e.lockAPI,n=e.contextId,r=e.store,i=e.registry,o=e.draggableId,s=e.forceSensorStop,a=e.sourceEvent,c=gj({lockAPI:t,store:r,registry:i,draggableId:o});if(!c)return null;var f=i.draggable.getById(o),p=XTe(n,f.descriptor.id);if(!p||a&&!f.options.canDragInteractiveElements&&UTe(p,a))return null;var g=t.claim(s||Qu),v="PRE_DRAG";function b(){return f.options.shouldRespectForcePress}function _(){return t.isActive(g)}function T($,j){j0({expected:$,phase:v,isLockActive:_,shouldWarn:!0})&&r.dispatch(j())}var I=T.bind(null,"DRAGGING");function P($){function j(){t.release(),v="COMPLETED"}v!=="PRE_DRAG"&&(j(),v!=="PRE_DRAG"&&rn(!1)),r.dispatch(KEe($.liftActionArgs)),v="DRAGGING";function U(q,Y){if(Y===void 0&&(Y={shouldBlockNextClick:!1}),$.cleanup(),Y.shouldBlockNextClick){var te=es(window,[{eventName:"click",fn:YTe,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(te)}j(),r.dispatch(Q9({reason:q}))}return qn({isActive:function(){return j0({expected:"DRAGGING",phase:v,isLockActive:_,shouldWarn:!1})},shouldRespectForcePress:b,drop:function(Y){return U("DROP",Y)},cancel:function(Y){return U("CANCEL",Y)}},$.actions)}function M($){var j=Bg(function(q){I(function(){return Y9({client:q})})}),U=P({liftActionArgs:{id:o,clientSelection:$,movementMode:"FLUID"},cleanup:function(){return j.cancel()},actions:{move:j}});return qn({},U,{move:j})}function O(){var $={moveUp:function(){return I(ePe)},moveRight:function(){return I(nPe)},moveDown:function(){return I(tPe)},moveLeft:function(){return I(rPe)}};return P({liftActionArgs:{id:o,clientSelection:jTe(p),movementMode:"SNAP"},cleanup:Qu,actions:$})}function N(){var $=j0({expected:"PRE_DRAG",phase:v,isLockActive:_,shouldWarn:!0});$&&t.release()}var F={isActive:function(){return j0({expected:"PRE_DRAG",phase:v,isLockActive:_,shouldWarn:!1})},shouldRespectForcePress:b,fluidLift:M,snapLift:O,abort:N};return F}var JTe=[RTe,NTe,BTe];function eIe(e){var t=e.contextId,n=e.store,r=e.registry,i=e.customSensors,o=e.enableDefaultSensors,s=[].concat(o?JTe:[],i||[]),a=E.exports.useState(function(){return vTe()})[0],c=On(function(M,O){M.isDragging&&!O.isDragging&&a.tryAbandon()},[a]);Ea(function(){var M=n.getState(),O=n.subscribe(function(){var N=n.getState();c(M,N),M=N});return O},[a,n,c]),Ea(function(){return a.tryAbandon},[a.tryAbandon]);for(var f=On(function(P){return gj({lockAPI:a,registry:r,store:n,draggableId:P})},[a,r,n]),p=On(function(P,M,O){return QTe({lockAPI:a,registry:r,contextId:t,store:n,draggableId:P,forceSensorStop:M,sourceEvent:O&&O.sourceEvent?O.sourceEvent:null})},[t,a,r,n]),g=On(function(P){return ZTe(t,P)},[t]),v=On(function(P){var M=r.draggable.findById(P);return M?M.options:null},[r.draggable]),b=On(function(){!a.isClaimed()||(a.tryAbandon(),n.getState().phase!=="IDLE"&&n.dispatch(QI()))},[a,n]),_=On(a.isClaimed,[a]),T=yr(function(){return{canGetLock:f,tryGetLock:p,findClosestDraggableId:g,findOptionsForDraggable:v,tryReleaseLock:b,isLockClaimed:_}},[f,p,g,v,b,_]),I=0;I{const[t,n]=E.exports.useState(e.order);E.exports.useEffect(()=>{n(e.order)},[e]);const r=s=>{if(!s.destination)return;var a=[...t];const[c]=a.splice(s.source.index,1);a.splice(s.destination.index,0,c),n(a),e.setOrder(a)},i=s=>{const a=t.map((c,f)=>s===f?{...c,show:!c.show}:c);n(a),e.setOrder(a)},o=()=>A("div",{onClick:s=>s.stopPropagation(),className:"z-10 bg-white-background rounded-xl p-3 space-y-3",style:{maxHeight:"80vh",overflowY:"scroll",margin:"24px 0 24px"},children:A(oIe,{onDragEnd:r,children:A(wj,{droppableId:"tableOrder",children:s=>it("div",{className:"flex flex-col",...s.droppableProps,ref:s.innerRef,children:[t.map((a,c)=>{const f=a.position;if(!!e.defaultColumns[f])return A(UIe,{draggableId:`list-${f}`,index:c,children:p=>it("div",{className:"flex flex-row gap-2 p-1.5 hover:bg-gray-300 rounded-md",ref:p.innerRef,...p.draggableProps,...p.dragHandleProps,children:[A(xh,{onChange:()=>i(c),checked:a.show}),A("p",{className:"m-0",children:e.defaultColumns[f].name||e.defaultColumns[f].title})]})},`list-${f}`)}),s.placeholder]})})})});return A(X_,{trigger:"click",dropdownRender:()=>o(),children:A(Yr,{onClick:s=>s.stopPropagation(),children:A(m2e,{})})})},ZIe=()=>{const{tableState:{fullScreen:e},toggleFullScreen:t}=k1(),[n,r]=E.exports.useState(!1);return E.exports.useEffect(()=>{const a=setTimeout(()=>r(!1),1500);return()=>clearTimeout(a)},[n]),A(ka,{title:e?"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C":"\u0420\u0430\u0441\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043F\u043E\u043B\u043D\u044B\u0439 \u044D\u043A\u0440\u0430\u043D",placement:"topRight",open:n,children:A(Yr,{onClick:a=>{a.stopPropagation(),t()},onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},children:e?A(l2e,{}):A(d2e,{})})})},Cj=({leftColumn:e,rightColumn:t,exportProvider:n,classes:r,orderColumns:i})=>it("div",{className:"flex items-center w-full justify-between",children:[it("div",{className:r==null?void 0:r.leftColumn,children:[A("span",{className:"py-[5px]",children:"\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432"}),e]}),it("div",{className:r==null?void 0:r.rightColumn,children:[t,it("div",{className:"flex items-center gap-x-1",children:[A(qIe,{orderColumns:i}),n&&A(x2e,{provider:n}),A(ZIe,{})]})]})]}),XIe=Un.memo(({data:e,pageSize:t,isClickedPointLoading:n,page:r,onPageChange:i,columns:o,header:s,fullWidth:a,loading:c,onChange:f})=>{const{clickedPointConfig:p,setClickedPointConfig:g}=Cv(),{map:v}=B5(),{tableState:b,toggleOpened:_}=k1(),{setPopup:T}=C1(),I={y:b.fullScreen?"calc(100vh - 136px)":"200px",x:"max-content"};return E.exports.useEffect(()=>{if(p===null||n)return;const P=document.querySelector(".scroll-row");P&&HSe(P,{behavior:"smooth"})},[p,e]),A(UD,{bordered:!1,onChange:_,activeKey:b.isOpened?"opened":null,children:A(UD.Panel,{header:s||A(Cj,{}),collapsible:b.fullScreen?"disabled":void 0,children:A(cge,{size:"small",className:Id("table__wrapper",b.fullScreen&&"table__wrapper__fullScreen"),locale:{emptyText:A(Ys,{description:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"})},pagination:{pageSize:t,current:r,onChange:i,total:e==null?void 0:e.count,showSizeChanger:!1,position:"bottomCenter"},showHeader:(e==null?void 0:e.results)&&e.results.length>0,dataSource:e==null?void 0:e.results,columns:o,onChange:f,rowKey:"id",scroll:I,sticky:!0,onRow:P=>({onClick:()=>{const M=xv.exports(P.geometry);v.flyTo({center:[M.coordinates[0],M.coordinates[1]],zoom:13,essential:!0}),T({features:[{properties:P}],coordinates:M.coordinates}),g(P.id,rowSelection==null?void 0:rowSelection.selectedRowKeys.includes(P.id))}}),rowClassName:P=>Id("cursor-pointer",P.id===(p==null?void 0:p.id)&&"scroll-row"),"data-fullwidth":a,loading:c})},"opened")})}),t_=30,YIe=(e,t)=>{const{clickedPointConfig:n}=Cv(),{data:r,isInitialLoading:i,isFetching:o}=nu(["clicked-point",n==null?void 0:n.id],async()=>{const s=new URLSearchParams({"location_ids[]":[n.id]}),{data:a}=await as.get(`/api/placement_points?${s.toString()}`);return a},{enabled:e,onSuccess:t});return{data:r,isLoading:i||o}},QIe=(e,t)=>{const[n,r]=E.exports.useState(),[i,o]=E.exports.useState(!1),s=E.exports.useRef(),{data:a,isLoading:c}=YIe(i,()=>o(!1)),{clickedPointConfig:f}=Cv(),p=WU();return E.exports.useEffect(()=>{!e||r(e)},[e]),E.exports.useEffect(()=>{!e||f===null||e.results.find(v=>v.id===f.id)||o(!0)},[e,f]),E.exports.useEffect(()=>{var g;!((g=a==null?void 0:a.results)!=null&&g[0])||(s.current=a.results[0].id,t(t_+1),r({count:(e==null?void 0:e.count)+1,results:[a.results[0],...e.results]}))},[a,e]),E.exports.useEffect(()=>{if(f===null){const g=["clicked-point",s.current];p.removeQueries({queryKey:g}),t(t_),r(e)}},[f,e]),{data:n,isClickedPointLoading:c}},JIe=(e,t,n,r,i)=>{const{filters:o,consumer_filter:s,source_filter:a,consumer_type:c,wall_material:f,energy_class:p}=qi(),{value:g}=ss(),{selectedSourceConfig:v}=Kd(),b=Vi[g],{updateCounter:_}=QU(),{region:T}=o,I=()=>{const $=i&&(i.includes("prob")||i.includes("cooling_time")||i.includes("priority"))?`${i}_${b}`:i,j=new URLSearchParams({page:e,page_size:n});$&&j.append("ordering",$);const U=[];if(s&&a){const q=s.key+"_"+b,Y=a.key+"_"+b,te=`${q}__gte=${s.gt}&${q}__lte=${s.lt}`,Z=`${Y}__gte=${a.gt}&${Y}__lt=${a.lt}`;U.push(`(${Z})|(${te})`)}return v&&(v.sourceId&&U.push(`(tp_number=${v.sourceId})`),v.dispatcherNumber&&U.push(`(ods_number=${v.dispatcherNumber})`)),U.length!==0&&j.append("filters",U.join("&")),s&&!a&&(j.append(s.key+"_"+b+"__gt",s.gt),j.append(s.key+"_"+b+"__lt",s.lt)),a&&!s&&(j.append(a.key+"_"+b+"__gt",a.gt),j.append(a.key+"_"+b+"__lt",a.lt)),j},{data:P,isInitialLoading:M,isFetching:O}=nu(["table",e,o,i,_,s,a,v],async({signal:$})=>{const j=I();return await b0e(j,T,$)},{onError:$=>{$.response.data.detail==="\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430"&&t()},refetchOnWindowFocus:!1}),{data:N,isClickedPointLoading:F}=QIe(P,r);return{data:N,pageSize:n,isClickedPointLoading:F,isDataLoading:M||O}},eke=(e,t)=>{const{filters:n,consumer_filter:r,source_filter:i,consumer_type:o,wall_material:s,energy_class:a}=qi(),{value:c}=ss(),{selectedSourceConfig:f}=Kd(),p=Vi[c],{region:g}=n,v=()=>{const b=new URLSearchParams,_=[];if(r&&i){const T=r.key+"_"+p,I=i.key+"_"+p,P=`${T}__gte=${r.gt}&${T}__lte=${r.lt}`,M=`${I}__gte=${i.gt}&${I}__lt=${i.lt}`;_.push(`(${M})|(${P})`)}return f&&(f.sourceId&&_.push(`(tp_number=${f.sourceId})`),f.dispatcherNumber&&_.push(`(ods_number=${f.dispatcherNumber})`)),_.length!==0&&b.append("filters",_.join("&")),r&&!i&&(b.append(r.key+"_"+p+"__gt",r.gt),b.append(r.key+"_"+p+"__lt",r.lt)),i&&!r&&(b.append(i.key+"_"+p+"__gt",i.gt),b.append(i.key+"_"+p+"__lt",i.lt)),b};return nu(["export-initial",n],async()=>await _0e(v(),g),{enabled:e,onSuccess:y2e,onSettled:t,retry:!1})},mF=(e,t)=>{const[n,r]=E.exports.useState(()=>{let i;try{i=JSON.parse(localStorage.getItem(e)||String(t))}catch{i=t}return i});return E.exports.useEffect(()=>{localStorage.setItem(e,JSON.stringify(n))},[n,e]),[n,r]},tke=e=>{const{data:t}=lI(),{tableState:{fullScreen:n}}=k1(),{value:r}=ss(),[i,o]=mF(`${e}Sort`,null),s=E.exports.useMemo(()=>[{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"building_address",key:"building_address",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041D\u043E\u043C\u0435\u0440 \u0422\u041F",dataIndex:"tp_number",key:"tp_number",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041D\u043E\u043C\u0435\u0440 \u041E\u0414\u0421",dataIndex:"ods_number",key:"ods_number",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u041E\u0414\u0421",dataIndex:"phone_number",key:"phone_number",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043E\u0442\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0432 \u0434\u043E\u043C\u0435",dataIndex:`prob1_${Vi[r]}`,key:"prob1",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041F\u0440\u043E\u0442\u0435\u0447\u043A\u0430 \u0442\u0440\u0443\u0431 \u0432 \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u0435",dataIndex:`prob2_${Vi[r]}`,key:"prob2",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432 \u043A\u0432\u0430\u0440\u0442\u0438\u0440\u0435 \u043D\u0438\u0436\u0435 \u043D\u043E\u0440\u043C\u0430\u0442\u0438\u0432\u043D\u043E\u0439",dataIndex:`prob3_${Vi[r]}`,key:"prob3",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432 \u043F\u043E\u043C\u0435\u0449\u0435\u043D\u0438\u0438 \u043E\u0431\u0449\u0435\u0433\u043E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u043D\u0438\u0436\u0435 \u043D\u043E\u0440\u043C\u0430\u0442\u0438\u0432\u043D\u043E\u0439",dataIndex:`prob4_${Vi[r]}`,key:"prob4",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0422\u0435\u0447\u044C \u0432 \u0441\u0438\u0441\u0442\u0435\u043C\u0435 \u043E\u0442\u043E\u043F\u043B\u0435\u043D\u0438\u044F",dataIndex:`prob5_${Vi[r]}`,key:"prob5",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0410\u0432\u0430\u0440\u0438\u044F \u043D\u0430 \u0422\u041F",dataIndex:`prob6_${Vi[r]}`,key:"prob6",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0412\u0440\u0435\u043C\u044F \u043E\u0441\u0442\u044B\u0432\u0430\u043D\u0438\u044F, \u0447",dataIndex:`cooling_time_${Vi[r]}`,key:"cooling_time",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442 \u0437\u0434\u0430\u043D\u0438\u044F",dataIndex:`priority_${Vi[r]}`,key:"priority",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D",dataIndex:"wall_materials",key:"wall_materials",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043B\u0430\u0441\u0441 \u044D\u043D\u0435\u0440\u0433\u043E\u044D\u0444\u0444\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438",dataIndex:"fi_energy_class",key:"fi_energy_class",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1}].filter(Boolean),[t==null?void 0:t.normalized,n,r]),[a,c]=mF(`${e}Order`,s.map((p,g)=>({key:p.key,position:g,show:!0})));return E.exports.useEffect(()=>{const g=s.filter(v=>!a.find(b=>b.key===v.key)).map((v,b)=>({key:v.key,position:s.length-b-1,show:!0}));c([...a,...g])},[s]),{columns:E.exports.useMemo(()=>a.flatMap(p=>p.show?s[p.position]:[]).map(p=>i&&i.includes(p==null?void 0:p.key)?{...p,defaultSortOrder:i.includes("-")?"descend":"ascend"}:p).filter(Boolean),[s,a,i]),orderColumns:{defaultColumns:s,order:a,setOrder:c},sort:i,setSort:o}},nke="dzkhTable",rke=({fullWidth:e})=>{const{setClickedPointConfig:t}=Cv(),[n,r]=E.exports.useState(1),[i,o]=E.exports.useState(t_),{columns:s,orderColumns:a,sort:c,setSort:f}=tke(nke),{setPopup:p}=C1(),g=(P,M)=>{P==="ascend"&&f(M),P==="descend"&&f(`-${M}`),P||f(null)},{data:v,isClickedPointLoading:b,isDataLoading:_}=JIe(n,()=>r(1),i,o,c),T=()=>o(t_),I=E.exports.useCallback(P=>{T(),t(null),p(null),r(P)},[]);return A(XIe,{data:v,onPageChange:I,page:n,pageSize:i,isClickedPointLoading:b,columns:s,fullWidth:e,onChange:(P,M,O)=>{g(O.order,O.columnKey)},header:A(Cj,{exportProvider:eke,orderColumns:a}),loading:_})},ike=({fullWidth:e})=>A(rke,{fullWidth:e}),oke=({width:e=24,height:t=24})=>it("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:t,children:[A("polygon",{points:"23.7,4.1 23.7,6.1 0.1,6.2 0.1,4.1 "}),it("g",{children:[A("circle",{cx:"6.3",cy:"5.2",r:"3.1"}),A("circle",{fill:"#fff",cx:"6.3",cy:"5.2",r:"1.4"})]}),A("polygon",{points:"23.6,11.1 23.7,13.1 0,13.1 0,11 "}),it("g",{children:[A("circle",{cx:"18.6",cy:"12.1",r:"3.1"}),A("circle",{fill:"#fff",cx:"18.6",cy:"12.1",r:"1.4"})]}),A("polygon",{points:"23.8,18.2 23.9,20.1 0.2,20.2 0.2,18.2 "}),it("g",{children:[A("circle",{cx:"10.2",cy:"19.1",r:"3.1"}),A("circle",{fill:"#fff",cx:"10.2",cy:"19.1",r:"1.4"})]})]}),ake=({toggleCollapse:e})=>A(Yr,{icon:A(oke,{width:16,height:16}),onClick:e,className:"border-l-0 rounded-bl-none rounded-tl-none absolute top-[100px] flex items-center justify-center"}),ske=A(f2e,{style:{fontSize:14},spin:!0}),Sj=e=>A(dv,{indicator:ske,size:"small",...e}),Ej=({taskId:e,onSuccess:t})=>nu(["tasks",e],async()=>{const{data:n}=await as.get(`/api/task/${e}/`);return n},{enabled:e!==null,refetchInterval:1e3,onSuccess:t}),ym=({text:e,dataType:t,onSuccess:n,onError:r})=>{const[i,o]=E.exports.useState(!1),[s,a]=E.exports.useState(null),[c,f]=E.exports.useState(!1),[p,g]=E.exports.useState(!1),{data:v,isInitialLoading:b,isFetching:_}=Ej({taskId:s,onSuccess:O=>{O.description==="\u0418\u043C\u043F\u043E\u0440\u0442 \u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D"&&(a(null),f(!0),n(t))}}),T=b||_;return it("div",{children:[it("div",{className:"space-x-3",children:[A(ka,{title:"\u041F\u0435\u0440\u0435\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",children:A(xh,{checked:i,onChange:O=>o(O.target.checked)})}),A(rye,{name:"file",accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",customRequest:async O=>{const{file:N}=O;try{g(!0);const F=await C0e(N,t,i);F.task_id&&a(F.task_id)}catch(F){r(t),console.error(F)}finally{g(!1)}},itemRender:()=>null,children:A(Yr,{icon:A(a9,{}),children:e})}),A(Yr,{className:"p-0 text-xs text-grey underline h-auto",type:"text",onClick:async()=>{const O=await w0e(t);await t7(`${t}_template.xlsx`,O)},children:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D"})]}),(()=>{if(!p&&!v&&!c)return null;const N=()=>p?0:c?100:v.progress,F=()=>p?"\u0418\u043C\u043F\u043E\u0440\u0442 \u0434\u0430\u043D\u043D\u044B\u0445":c?"\u0418\u043C\u043F\u043E\u0440\u0442 \u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D":v.description;return it("div",{children:[!c&&A(Sj,{className:"mr-2"}),A(VT,{percent:N(),status:T?"active":null,size:"small",className:"w-[300px]"}),A(cl,{text:F(),className:"text-xs"})]})})()]})},lke=({onClose:e})=>{const[t,n]=E.exports.useState(!1),[r,i]=E.exports.useState(!1),[o,s]=E.exports.useState({odpu:null,asupr:null,moek_scheme:null,events:null,houses:null}),[a,c]=E.exports.useState(null),[f,p]=E.exports.useState(!1),{data:g,isInitialLoading:v,isFetching:b}=Ej({taskId:a,onSuccess:N=>{N.description==="\u041F\u0420\u041E\u0426\u0415\u0421\u0421\u0418\u041D\u0413 \u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D"&&(c(null),p(!0),e())}}),_=v||b,T=N=>s(F=>({...F,[N]:!0})),I=N=>s(F=>({...F,[N]:!1})),P=Object.values(o).some(N=>N===null||N===!1);return A(X8,{open:!0,title:"\u0418\u043C\u043F\u043E\u0440\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",width:400,footer:null,onCancel:e,children:it("div",{className:"text-center space-y-3",children:[A(O$,{message:"\u041E\u0431\u0440\u0430\u0449\u0430\u0435\u043C \u0432\u0430\u0448\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E \u0438\u043C\u043F\u043E\u0440\u0442 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u0438 \u043E\u0442 \u0440\u0430\u0437\u043C\u0435\u0440\u0430 \u0432\u0445\u043E\u0434\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u043C\u043E\u0436\u0435\u0442 \u0437\u0430\u043D\u0438\u043C\u0430\u0442\u044C \u0437\u043D\u0430\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F (\u0434\u043E 10 \u043C\u0438\u043D)",type:"warning",className:"mb-5",showIcon:!0,closable:!0}),A(ym,{dataType:"odpu",text:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B \u0441 \u041E\u0414\u041F\u0423",onSuccess:T,onError:I}),A(ym,{dataType:"asupr",text:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B \u0441 \u0410\u0421\u0423\u041F\u0420",onSuccess:T,onError:I}),A(ym,{dataType:"moek_scheme",text:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B \u0441 \u041C\u041E\u042D\u041A",onSuccess:T,onError:I}),A(ym,{dataType:"events",text:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B \u0441 \u0441\u043E\u0431\u044B\u0442\u0438\u044F\u043C\u0438",onSuccess:T,onError:I}),A(ym,{dataType:"houses",text:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B \u0441 \u0434\u043E\u043C\u0430\u043C\u0438",onSuccess:T,onError:I}),A(Yr,{className:"mt-5",type:"primary",onClick:async()=>{n(!0);try{const N=await S0e();N.task_id&&c(N.task_id)}catch(N){console.error(N),i(!0)}finally{n(!1)}},loading:t,disabled:P||_,children:"\u041D\u0430\u0447\u0430\u0442\u044C \u0430\u043D\u0430\u043B\u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445"},"start-upload"),(()=>{if(!t&&!g&&!f)return null;const F=()=>t?0:f?100:g.progress,$=()=>t?"\u041D\u0430\u0447\u0430\u043B\u043E \u0430\u043D\u0430\u043B\u0438\u0437\u0430":f?"\u0410\u043D\u0430\u043B\u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D":g.description;return it("div",{children:[!f&&A(Sj,{className:"mr-2"}),A(VT,{percent:F(),status:_?"active":null,size:"small",className:"w-[300px]"}),A(cl,{text:$(),className:"text-xs"})]})})(),r&&A("p",{className:"text-red-600",children:"\u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430"})]})})},uke=({onClick:e})=>A("div",{className:"absolute top-[20px] left-[20px]",children:A(ka,{title:"\u0418\u043C\u043F\u043E\u0440\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",placement:"right",children:A(Yr,{type:"primary",icon:A(a9,{}),onClick:e})})}),cke=({disabled:e,fullRange:t,isLoading:n})=>{const{value:r,setValue:i,range:o}=ss();return n?A("div",{className:"flex justify-center items-center",children:A(dv,{})}):A("div",{className:"absolute w-[200px] top-[20px] right-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3 space-y-3",children:A(vI,{title:"\u0422\u0435\u043C\u043F\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u043D\u0430 \u0443\u043B\u0438\u0446\u0435",value:r,onAfterChange:i,min:o[0],max:o[1]})})},gF=({id:e,modalOpen:t,setModalOpen:n})=>{const{data:r,isLoading:i}=Yxe(e);return it("div",{className:"flex flex-col gap-1",children:[A(ad,{className:Id("font-bold"),children:"\u0412 \u0437\u043E\u043D\u0435 \u0430\u0432\u0430\u0440\u0438\u0438 \u043E\u043A\u0430\u0437\u0430\u043B\u043E\u0441\u044C:"}),!td(r==null?void 0:r.potreb_count)&&!td(r==null?void 0:r.potreb_soc_count)&&it(ad,{children:[(r==null?void 0:r.potreb_count)+(r==null?void 0:r.potreb_soc_count)," \u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u0435\u0439 (\u0438\u0437 \u043D\u0438\u0445 ",r==null?void 0:r.potreb_soc_count," - \u0441\u043E\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0435 \u043E\u0431\u044A\u0435\u043A\u0442\u044B)"]}),!td(r==null?void 0:r.total_area)&&it(ad,{children:["\u041E\u0431\u0449\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u044C \u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u0435\u0439 - ",Math.ceil(r==null?void 0:r.total_area)," \u043A\u0432. \u043C\u0435\u0442\u0440\u043E\u0432"]}),!td(r==null?void 0:r.number_of_apartments)&&it(ad,{children:[r==null?void 0:r.number_of_apartments," \u043A\u0432\u0430\u0440\u0442\u0438\u0440"]}),!td(r==null?void 0:r.data_min_cooling_time)&&!td(r==null?void 0:r.min_cooling_time)&&it(ad,{children:["\u0411\u044B\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043E \u043E\u0441\u0442\u044B\u043D\u0435\u0442 \u0437\u0434\u0430\u043D\u0438\u0435 \u043F\u043E \u0430\u0434\u0440\u0435\u0441\u0443 ",r==null?void 0:r.data_min_cooling_time.building_address," (",r==null?void 0:r.min_cooling_time," \u0447\u0430\u0441\u043E\u0432)"]})]})};var Pj={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},vF=Un.createContext&&Un.createContext(Pj),tc=globalThis&&globalThis.__assign||function(){return tc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{selectedSourceConfig:e,setSelectedSourceConfig:t}=Kd(),[n,r]=E.exports.useState(!1);if(!e.pointId)return"";const{pointId:i}=e,o=()=>t({sourceId:null,dispatcherNumber:null});return it(nr,{children:[it("div",{className:"absolute bottom-[20px] left-[20px] text-grey z-10 bg-white-background rounded-xl p-3 text-center",children:[A(cl,{text:`\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0434\u0435\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0430\u0432\u0430\u0440\u0438\u0438 \u043D\u0430 \u0422\u041F ${e==null?void 0:e.sourceId}`}),it("div",{className:"flex justify-center flex-row gap-2",children:[A(Yr,{type:"primary",onClick:o,children:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C"}),!!i&&A(EB,{content:A(gF,{id:i}),children:A(Yr,{className:"flex justify-center items-center",type:"primary",onClick:()=>r(!0),children:A(pke,{className:"w-4 h-4"})})})]})]}),!!i&&A(gF,{id:i,modalOpen:n,setModalOpen:r})]})},yF=[{name:"dispatcherIcon",url:G7}],gke=()=>{const e=E.exports.useRef(null),t=E.exports.useRef(null),n=E.exports.useRef(null),{popup:r,setPopup:i}=C1(),{setClickedPointConfig:o}=Cv(),{tableState:s,openTable:a}=k1(),c=I=>{if(!I.features){i(null),o(null);return}const P=I.features[0];if(!P){i(null),o(null);return}const{lng:M}=I.lngLat;if(P.geometry.type==="Point"){const O=P.geometry.coordinates.slice();for(;Math.abs(M-O[0])>180;)O[0]+=M>O[0]?360:-360;i({features:I.features,coordinates:O})}},f=I=>{!I.features[0]||(e.current.getCanvas().style.cursor="pointer")},p=I=>{!I.features[0]||(e.current.getCanvas().style.cursor="")};E.exports.useEffect(()=>{const I=new ResizeObserver(FSe(()=>{var P;(P=e==null?void 0:e.current)==null||P.resize()},16));return t.current&&I.observe(t.current),()=>{I.disconnect()}},[t.current]),E.exports.useEffect(()=>{s.fullScreen&&!s.isOpened&&a()},[s.fullScreen]);const[g,v]=E.exports.useState(!1),b=()=>v(I=>!I),[_,T]=E.exports.useState(!1);return E.exports.useEffect(()=>{yF.map(I=>{var M,O;const P=new Image(((M=I.size)==null?void 0:M.width)||64,((O=I.size)==null?void 0:O.height)||64);P.src=I.url,P.crossOrigin="Anonymous",P.onload=()=>{e.current.addImage(I.name,P)}})},[yF]),A(Fq,{children:it("div",{className:"w-screen h-screen relative flex overflow-hidden",children:[A(fbe,{isCollapsed:g,ref:n}),it("div",{className:"flex-1 h-screen flex flex-col ",children:[A("div",{ref:t,className:Id(s.fullScreen?"":"flex-1"),children:it($P,{mapLib:Oq,initialViewState:{latitude:55.7558,longitude:37.6173,zoom:12},dragRotate:!1,ref:e,interactiveLayerIds:[Ci.consumer,Ci.source,Ci.dispatcher],onClick:c,onMouseEnter:f,onMouseLeave:p,id:"map",children:[r&&A(vSe,{lat:r.coordinates[1],lng:r.coordinates[0],features:r.features,onClose:()=>{i(null),o(null)}}),A(uke,{onClick:()=>T(!0)}),A(ake,{toggleCollapse:b}),A(cke,{}),A(xSe,{}),A(Dbe,{}),A(BSe,{}),A(mke,{}),_&&A(lke,{onClose:()=>T(!1)})]})}),A("div",{className:"w-full border-solid border-border border-0 border-t-[1px] z-20",children:A(ike,{fullWidth:g})})]})]})})};function vke(){return A(gke,{})}const yke=new $0e;Dxe();function xke(){return A(Q0e,{client:yke,children:A(Dq,{basename:"/",children:A(Rq,{children:A(F5,{path:"/",element:A(vke,{})})})})})}XS.createRoot(document.getElementById("root")).render(A(xke,{}));