var gB=Object.defineProperty;var yB=(e,t,r)=>t in e?gB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var b6=(e,t,r)=>(yB(e,typeof t!="symbol"?t+"":t,r),r);function MI(e,t){for(var r=0;rn[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"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Cl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function LC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}},on={};/** * @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 sv=Symbol.for("react.element"),xB=Symbol.for("react.portal"),_B=Symbol.for("react.fragment"),bB=Symbol.for("react.strict_mode"),wB=Symbol.for("react.profiler"),CB=Symbol.for("react.provider"),SB=Symbol.for("react.context"),EB=Symbol.for("react.forward_ref"),kB=Symbol.for("react.suspense"),TB=Symbol.for("react.memo"),PB=Symbol.for("react.lazy"),w6=Symbol.iterator;function MB(e){return e===null||typeof e!="object"?null:(e=w6&&e[w6]||e["@@iterator"],typeof e=="function"?e:null)}var II={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},RI=Object.assign,OI={};function sh(e,t,r){this.props=e,this.context=t,this.refs=OI,this.updater=r||II}sh.prototype.isReactComponent={};sh.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")};sh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function AI(){}AI.prototype=sh.prototype;function FC(e,t,r){this.props=e,this.context=t,this.refs=OI,this.updater=r||II}var $C=FC.prototype=new AI;$C.constructor=FC;RI($C,sh.prototype);$C.isPureReactComponent=!0;var C6=Array.isArray,NI=Object.prototype.hasOwnProperty,BC={current:null},zI={key:!0,ref:!0,__self:!0,__source:!0};function DI(e,t,r){var n,i={},a=null,u=null;if(t!=null)for(n in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(a=""+t.key),t)NI.call(t,n)&&!zI.hasOwnProperty(n)&&(i[n]=t[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1>>1,ke=oe[Te];if(0>>1;Tei(Ne,Re))Dei(Ve,Ne)?(oe[Te]=Ve,oe[De]=Re,Te=De):(oe[Te]=Ne,oe[Ie]=Re,Te=Ie);else if(Dei(Ve,Re))oe[Te]=Ve,oe[De]=Re,Te=De;else break e}}return ye}function i(oe,ye){var Re=oe.sortIndex-ye.sortIndex;return Re!==0?Re:oe.id-ye.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var f=[],p=[],v=1,y=null,w=3,k=!1,T=!1,R=!1,A=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(oe){for(var ye=r(p);ye!==null;){if(ye.callback===null)n(p);else if(ye.startTime<=oe)n(p),ye.sortIndex=ye.expirationTime,t(f,ye);else break;ye=r(p)}}function L(oe){if(R=!1,N(oe),!T)if(r(f)!==null)T=!0,ne(B);else{var ye=r(p);ye!==null&&de(L,ye.startTime-oe)}}function B(oe,ye){T=!1,R&&(R=!1,I(H),H=-1),k=!0;var Re=w;try{for(N(ye),y=r(f);y!==null&&(!(y.expirationTime>ye)||oe&&!le());){var Te=y.callback;if(typeof Te=="function"){y.callback=null,w=y.priorityLevel;var ke=Te(y.expirationTime<=ye);ye=e.unstable_now(),typeof ke=="function"?y.callback=ke:y===r(f)&&n(f),N(ye)}else n(f);y=r(f)}if(y!==null)var ze=!0;else{var Ie=r(p);Ie!==null&&de(L,Ie.startTime-ye),ze=!1}return ze}finally{y=null,w=Re,k=!1}}var j=!1,G=null,H=-1,te=5,Y=-1;function le(){return!(e.unstable_now()-Yoe||125Te?(oe.sortIndex=Re,t(p,oe),r(f)===null&&oe===r(p)&&(R?(I(H),H=-1):R=!0,de(L,Re-Te))):(oe.sortIndex=ke,t(f,oe),T||k||(T=!0,ne(B))),oe},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(oe){var ye=w;return function(){var Re=w;w=ye;try{return oe.apply(this,arguments)}finally{w=Re}}}})(FI);(function(e){e.exports=FI})(LI);/** * @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 $I=C.exports,ga=LI.exports;function Kt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),G2=Object.prototype.hasOwnProperty,NB=/^[: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]*$/,E6={},k6={};function zB(e){return G2.call(k6,e)?!0:G2.call(E6,e)?!1:NB.test(e)?k6[e]=!0:(E6[e]=!0,!1)}function DB(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function LB(e,t,r,n){if(t===null||typeof t>"u"||DB(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Bo(e,t,r,n,i,a,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=u}var so={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){so[e]=new Bo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];so[t]=new Bo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){so[e]=new Bo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){so[e]=new Bo(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){so[e]=new Bo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){so[e]=new Bo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){so[e]=new Bo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){so[e]=new Bo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){so[e]=new Bo(e,5,!1,e.toLowerCase(),null,!1,!1)});var jC=/[\-:]([a-z])/g;function UC(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(jC,UC);so[t]=new Bo(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(jC,UC);so[t]=new Bo(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(jC,UC);so[t]=new Bo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){so[e]=new Bo(e,1,!1,e.toLowerCase(),null,!1,!1)});so.xlinkHref=new Bo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){so[e]=new Bo(e,1,!1,e.toLowerCase(),null,!0,!0)});function KC(e,t,r,n){var i=so.hasOwnProperty(t)?so[t]:null;(i!==null?i.type!==0:n||!(2o||i[u]!==a[o]){var f=` `+i[u].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=u&&0<=o);break}}}finally{db=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Wp(e):""}function FB(e){switch(e.tag){case 5:return Wp(e.type);case 16:return Wp("Lazy");case 13:return Wp("Suspense");case 19:return Wp("SuspenseList");case 0:case 2:case 15:return e=fb(e.type,!1),e;case 11:return e=fb(e.type.render,!1),e;case 1:return e=fb(e.type,!0),e;default:return""}}function Q2(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 df:return"Fragment";case cf:return"Portal";case Z2:return"Profiler";case HC:return"StrictMode";case X2:return"Suspense";case Y2:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jI:return(e.displayName||"Context")+".Consumer";case VI:return(e._context.displayName||"Context")+".Provider";case WC:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qC:return t=e.displayName||null,t!==null?t:Q2(e.type)||"Memo";case gu:t=e._payload,e=e._init;try{return Q2(e(t))}catch{}}return null}function $B(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 Q2(t);case 8:return t===HC?"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 Uu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BB(e){var t=KI(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(u){n=""+u,a.call(this,u)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(u){n=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yg(e){e._valueTracker||(e._valueTracker=BB(e))}function HI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=KI(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function y0(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 J2(e,t){var r=t.checked;return ui({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r!=null?r:e._wrapperState.initialChecked})}function P6(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Uu(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function WI(e,t){t=t.checked,t!=null&&KC(e,"checked",t,!1)}function ew(e,t){WI(e,t);var r=Uu(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?tw(e,t.type,r):t.hasOwnProperty("defaultValue")&&tw(e,t.type,Uu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function M6(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function tw(e,t,r){(t!=="number"||y0(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var qp=Array.isArray;function Pf(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Qg.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Em(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var im={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},VB=["Webkit","ms","Moz","O"];Object.keys(im).forEach(function(e){VB.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),im[t]=im[e]})});function XI(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||im.hasOwnProperty(e)&&im[e]?(""+t).trim():t+"px"}function YI(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=XI(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var jB=ui({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 iw(e,t){if(t){if(jB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Kt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Kt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Kt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Kt(62))}}function ow(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 aw=null;function GC(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sw=null,Mf=null,If=null;function O6(e){if(e=cv(e)){if(typeof sw!="function")throw Error(Kt(280));var t=e.stateNode;t&&(t=R1(t),sw(e.stateNode,e.type,t))}}function QI(e){Mf?If?If.push(e):If=[e]:Mf=e}function JI(){if(Mf){var e=Mf,t=If;if(If=Mf=null,O6(e),t)for(e=0;e>>=0,e===0?32:31-(JB(e)/eV|0)|0}var Jg=64,ey=4194304;function Gp(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 w0(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,u=r&268435455;if(u!==0){var o=u&~i;o!==0?n=Gp(o):(a&=u,a!==0&&(n=Gp(a)))}else u=r&~i,u!==0?n=Gp(u):a!==0&&(n=Gp(a));if(n===0)return 0;if(t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if((n&4)!==0&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function lv(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gs(t),e[t]=r}function iV(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=am),V6=String.fromCharCode(32),j6=!1;function xR(e,t){switch(e){case"keyup":return OV.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _R(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ff=!1;function NV(e,t){switch(e){case"compositionend":return _R(t);case"keypress":return t.which!==32?null:(j6=!0,V6);case"textInput":return e=t.data,e===V6&&j6?null:e;default:return null}}function zV(e,t){if(ff)return e==="compositionend"||!r3&&xR(e,t)?(e=gR(),Wy=JC=Cu=null,ff=!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:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=W6(r)}}function SR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?SR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ER(){for(var e=window,t=y0();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=y0(e.document)}return t}function n3(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 KV(e){var t=ER(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&SR(r.ownerDocument.documentElement,r)){if(n!==null&&n3(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=q6(r,a);var u=q6(r,n);i&&u&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,hf=null,hw=null,lm=null,pw=!1;function G6(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;pw||hf==null||hf!==y0(n)||(n=hf,"selectionStart"in n&&n3(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),lm&&Rm(lm,n)||(lm=n,n=E0(hw,"onSelect"),0vf||(e.current=_w[vf],_w[vf]=null,vf--)}function Kn(e,t){vf++,_w[vf]=e.current,e.current=t}var Ku={},xo=Ju(Ku),Go=Ju(!1),td=Ku;function Ff(e,t){var r=e.type.contextTypes;if(!r)return Ku;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Zo(e){return e=e.childContextTypes,e!=null}function T0(){Xn(Go),Xn(xo)}function tk(e,t,r){if(xo.current!==Ku)throw Error(Kt(168));Kn(xo,t),Kn(Go,r)}function NR(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Kt(108,$B(e)||"Unknown",i));return ui({},r,n)}function P0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ku,td=xo.current,Kn(xo,e),Kn(Go,Go.current),!0}function rk(e,t,r){var n=e.stateNode;if(!n)throw Error(Kt(169));r?(e=NR(e,t,td),n.__reactInternalMemoizedMergedChildContext=e,Xn(Go),Xn(xo),Kn(xo,e)):Xn(Go),Kn(Go,r)}var xl=null,O1=!1,kb=!1;function zR(e){xl===null?xl=[e]:xl.push(e)}function rj(e){O1=!0,zR(e)}function ec(){if(!kb&&xl!==null){kb=!0;var e=0,t=kn;try{var r=xl;for(kn=1;e>=u,i-=u,Sl=1<<32-gs(t)+i|r<H?(te=G,G=null):te=G.sibling;var Y=w(I,G,N[H],L);if(Y===null){G===null&&(G=te);break}e&&G&&Y.alternate===null&&t(I,G),O=a(Y,O,H),j===null?B=Y:j.sibling=Y,j=Y,G=te}if(H===N.length)return r(I,G),ii&&zc(I,H),B;if(G===null){for(;HH?(te=G,G=null):te=G.sibling;var le=w(I,G,Y.value,L);if(le===null){G===null&&(G=te);break}e&&G&&le.alternate===null&&t(I,G),O=a(le,O,H),j===null?B=le:j.sibling=le,j=le,G=te}if(Y.done)return r(I,G),ii&&zc(I,H),B;if(G===null){for(;!Y.done;H++,Y=N.next())Y=y(I,Y.value,L),Y!==null&&(O=a(Y,O,H),j===null?B=Y:j.sibling=Y,j=Y);return ii&&zc(I,H),B}for(G=n(I,G);!Y.done;H++,Y=N.next())Y=k(G,I,H,Y.value,L),Y!==null&&(e&&Y.alternate!==null&&G.delete(Y.key===null?H:Y.key),O=a(Y,O,H),j===null?B=Y:j.sibling=Y,j=Y);return e&&G.forEach(function(J){return t(I,J)}),ii&&zc(I,H),B}function A(I,O,N,L){if(typeof N=="object"&&N!==null&&N.type===df&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case Xg:e:{for(var B=N.key,j=O;j!==null;){if(j.key===B){if(B=N.type,B===df){if(j.tag===7){r(I,j.sibling),O=i(j,N.props.children),O.return=I,I=O;break e}}else if(j.elementType===B||typeof B=="object"&&B!==null&&B.$$typeof===gu&&uk(B)===j.type){r(I,j.sibling),O=i(j,N.props),O.ref=Ap(I,j,N),O.return=I,I=O;break e}r(I,j);break}else t(I,j);j=j.sibling}N.type===df?(O=Qc(N.props.children,I.mode,L,N.key),O.return=I,I=O):(L=e0(N.type,N.key,N.props,null,I.mode,L),L.ref=Ap(I,O,N),L.return=I,I=L)}return u(I);case cf:e:{for(j=N.key;O!==null;){if(O.key===j)if(O.tag===4&&O.stateNode.containerInfo===N.containerInfo&&O.stateNode.implementation===N.implementation){r(I,O.sibling),O=i(O,N.children||[]),O.return=I,I=O;break e}else{r(I,O);break}else t(I,O);O=O.sibling}O=Nb(N,I.mode,L),O.return=I,I=O}return u(I);case gu:return j=N._init,A(I,O,j(N._payload),L)}if(qp(N))return T(I,O,N,L);if(Pp(N))return R(I,O,N,L);sy(I,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,O!==null&&O.tag===6?(r(I,O.sibling),O=i(O,N),O.return=I,I=O):(r(I,O),O=Ab(N,I.mode,L),O.return=I,I=O),u(I)):r(I,O)}return A}var Bf=UR(!0),KR=UR(!1),dv={},Ks=Ju(dv),zm=Ju(dv),Dm=Ju(dv);function Hc(e){if(e===dv)throw Error(Kt(174));return e}function f3(e,t){switch(Kn(Dm,t),Kn(zm,e),Kn(Ks,dv),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:nw(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=nw(t,e)}Xn(Ks),Kn(Ks,t)}function Vf(){Xn(Ks),Xn(zm),Xn(Dm)}function HR(e){Hc(Dm.current);var t=Hc(Ks.current),r=nw(t,e.type);t!==r&&(Kn(zm,e),Kn(Ks,r))}function h3(e){zm.current===e&&(Xn(Ks),Xn(zm))}var si=Ju(0);function N0(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 Tb=[];function p3(){for(var e=0;er?r:4,e(!0);var n=Pb.transition;Pb.transition={};try{e(!1),t()}finally{kn=r,Pb.transition=n}}function s7(){return qa().memoizedState}function aj(e,t,r){var n=Lu(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},l7(e))u7(t,r);else if(r=$R(e,t,r,n),r!==null){var i=No();ys(r,e,n,i),c7(r,t,n)}}function sj(e,t,r){var n=Lu(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(l7(e))u7(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var u=t.lastRenderedState,o=a(u,r);if(i.hasEagerState=!0,i.eagerState=o,_s(o,u)){var f=t.interleaved;f===null?(i.next=i,c3(t)):(i.next=f.next,f.next=i),t.interleaved=i;return}}catch{}finally{}r=$R(e,t,i,n),r!==null&&(i=No(),ys(r,e,n,i),c7(r,t,n))}}function l7(e){var t=e.alternate;return e===li||t!==null&&t===li}function u7(e,t){um=z0=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function c7(e,t,r){if((r&4194240)!==0){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,XC(e,r)}}var D0={readContext:Wa,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useInsertionEffect:mo,useLayoutEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useMutableSource:mo,useSyncExternalStore:mo,useId:mo,unstable_isNewReconciler:!1},lj={readContext:Wa,useCallback:function(e,t){return Ls().memoizedState=[e,t===void 0?null:t],e},useContext:Wa,useEffect:dk,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xy(4194308,4,r7.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xy(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xy(4,2,e,t)},useMemo:function(e,t){var r=Ls();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ls();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=aj.bind(null,li,e),[n.memoizedState,e]},useRef:function(e){var t=Ls();return e={current:e},t.memoizedState=e},useState:ck,useDebugValue:x3,useDeferredValue:function(e){return Ls().memoizedState=e},useTransition:function(){var e=ck(!1),t=e[0];return e=oj.bind(null,e[1]),Ls().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=li,i=Ls();if(ii){if(r===void 0)throw Error(Kt(407));r=r()}else{if(r=t(),Xi===null)throw Error(Kt(349));(nd&30)!==0||GR(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,dk(XR.bind(null,n,a,e),[e]),n.flags|=2048,$m(9,ZR.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ls(),t=Xi.identifierPrefix;if(ii){var r=El,n=Sl;r=(n&~(1<<32-gs(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Lm++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=u.createElement(r,{is:n.is}):(e=u.createElement(r),r==="select"&&(u=e,n.multiple?u.multiple=!0:n.size&&(u.size=n.size))):e=u.createElementNS(e,r),e[Fs]=t,e[Nm]=n,x7(e,t,!1,!1),t.stateNode=e;e:{switch(u=ow(r,n),r){case"dialog":Wn("cancel",e),Wn("close",e),i=n;break;case"iframe":case"object":case"embed":Wn("load",e),i=n;break;case"video":case"audio":for(i=0;iUf&&(t.flags|=128,n=!0,Np(a,!1),t.lanes=4194304)}else{if(!n)if(e=N0(u),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Np(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ii)return vo(t),null}else 2*wi()-a.renderingStartTime>Uf&&r!==1073741824&&(t.flags|=128,n=!0,Np(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(r=a.last,r!==null?r.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=wi(),t.sibling=null,r=si.current,Kn(si,n?r&1|2:r&1),t):(vo(t),null);case 22:case 23:return E3(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&(t.mode&1)!==0?(da&1073741824)!==0&&(vo(t),t.subtreeFlags&6&&(t.flags|=8192)):vo(t),null;case 24:return null;case 25:return null}throw Error(Kt(156,t.tag))}function vj(e,t){switch(o3(t),t.tag){case 1:return Zo(t.type)&&T0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vf(),Xn(Go),Xn(xo),p3(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return h3(t),null;case 13:if(Xn(si),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Kt(340));$f()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xn(si),null;case 4:return Vf(),null;case 10:return u3(t.type._context),null;case 22:case 23:return E3(),null;case 24:return null;default:return null}}var uy=!1,go=!1,gj=typeof WeakSet=="function"?WeakSet:Set,yr=null;function _f(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){hi(e,t,n)}else r.current=null}function Ow(e,t,r){try{r()}catch(n){hi(e,t,n)}}var _k=!1;function yj(e,t){if(mw=C0,e=ER(),n3(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var u=0,o=-1,f=-1,p=0,v=0,y=e,w=null;t:for(;;){for(var k;y!==r||i!==0&&y.nodeType!==3||(o=u+i),y!==a||n!==0&&y.nodeType!==3||(f=u+n),y.nodeType===3&&(u+=y.nodeValue.length),(k=y.firstChild)!==null;)w=y,y=k;for(;;){if(y===e)break t;if(w===r&&++p===i&&(o=u),w===a&&++v===n&&(f=u),(k=y.nextSibling)!==null)break;y=w,w=y.parentNode}y=k}r=o===-1||f===-1?null:{start:o,end:f}}else r=null}r=r||{start:0,end:0}}else r=null;for(vw={focusedElem:e,selectionRange:r},C0=!1,yr=t;yr!==null;)if(t=yr,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,yr=e;else for(;yr!==null;){t=yr;try{var T=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var R=T.memoizedProps,A=T.memoizedState,I=t.stateNode,O=I.getSnapshotBeforeUpdate(t.elementType===t.type?R:ds(t.type,R),A);I.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var N=t.stateNode.containerInfo;N.nodeType===1?N.textContent="":N.nodeType===9&&N.documentElement&&N.removeChild(N.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Kt(163))}}catch(L){hi(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,yr=e;break}yr=t.return}return T=_k,_k=!1,T}function cm(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Ow(t,r,a)}i=i.next}while(i!==n)}}function z1(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Aw(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function w7(e){var t=e.alternate;t!==null&&(e.alternate=null,w7(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fs],delete t[Nm],delete t[xw],delete t[ej],delete t[tj])),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 C7(e){return e.tag===5||e.tag===3||e.tag===4}function bk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||C7(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 Nw(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=k0));else if(n!==4&&(e=e.child,e!==null))for(Nw(e,t,r),e=e.sibling;e!==null;)Nw(e,t,r),e=e.sibling}function zw(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(zw(e,t,r),e=e.sibling;e!==null;)zw(e,t,r),e=e.sibling}var no=null,fs=!1;function cu(e,t,r){for(r=r.child;r!==null;)S7(e,t,r),r=r.sibling}function S7(e,t,r){if(Us&&typeof Us.onCommitFiberUnmount=="function")try{Us.onCommitFiberUnmount(T1,r)}catch{}switch(r.tag){case 5:go||_f(r,t);case 6:var n=no,i=fs;no=null,cu(e,t,r),no=n,fs=i,no!==null&&(fs?(e=no,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):no.removeChild(r.stateNode));break;case 18:no!==null&&(fs?(e=no,r=r.stateNode,e.nodeType===8?Eb(e.parentNode,r):e.nodeType===1&&Eb(e,r),Mm(e)):Eb(no,r.stateNode));break;case 4:n=no,i=fs,no=r.stateNode.containerInfo,fs=!0,cu(e,t,r),no=n,fs=i;break;case 0:case 11:case 14:case 15:if(!go&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,u=a.destroy;a=a.tag,u!==void 0&&((a&2)!==0||(a&4)!==0)&&Ow(r,t,u),i=i.next}while(i!==n)}cu(e,t,r);break;case 1:if(!go&&(_f(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){hi(r,t,o)}cu(e,t,r);break;case 21:cu(e,t,r);break;case 22:r.mode&1?(go=(n=go)||r.memoizedState!==null,cu(e,t,r),go=n):cu(e,t,r);break;default:cu(e,t,r)}}function wk(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new gj),t.forEach(function(n){var i=Tj.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ls(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=u),n&=~a}if(n=i,n=wi()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*_j(n/1960))-n,10e?16:e,Su===null)var n=!1;else{if(e=Su,Su=null,$0=0,(vn&6)!==0)throw Error(Kt(331));var i=vn;for(vn|=4,yr=e.current;yr!==null;){var a=yr,u=a.child;if((yr.flags&16)!==0){var o=a.deletions;if(o!==null){for(var f=0;fwi()-C3?Yc(e,0):w3|=r),Xo(e,t)}function O7(e,t){t===0&&((e.mode&1)===0?t=1:(t=ey,ey<<=1,(ey&130023424)===0&&(ey=4194304)));var r=No();e=Ol(e,t),e!==null&&(lv(e,t,r),Xo(e,r))}function kj(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),O7(e,r)}function Tj(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Kt(314))}n!==null&&n.delete(t),O7(e,r)}var A7;A7=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Go.current)qo=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return qo=!1,pj(e,t,r);qo=(e.flags&131072)!==0}else qo=!1,ii&&(t.flags&1048576)!==0&&DR(t,I0,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Yy(e,t),e=t.pendingProps;var i=Ff(t,xo.current);Of(t,r),i=v3(null,t,n,e,i,r);var a=g3();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,Zo(n)?(a=!0,P0(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,d3(t),i.updater=A1,t.stateNode=i,i._reactInternals=t,Ew(t,n,e,r),t=Pw(null,t,n,!0,a,r)):(t.tag=0,ii&&a&&i3(t),Ro(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Yy(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Mj(n),e=ds(n,e),i){case 0:t=Tw(null,t,n,e,r);break e;case 1:t=gk(null,t,n,e,r);break e;case 11:t=mk(null,t,n,e,r);break e;case 14:t=vk(null,t,n,ds(n.type,e),r);break e}throw Error(Kt(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ds(n,i),Tw(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ds(n,i),gk(e,t,n,i,r);case 3:e:{if(v7(t),e===null)throw Error(Kt(387));n=t.pendingProps,a=t.memoizedState,i=a.element,BR(e,t),A0(t,n,null,r);var u=t.memoizedState;if(n=u.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=jf(Error(Kt(423)),t),t=yk(e,t,n,r,i);break e}else if(n!==i){i=jf(Error(Kt(424)),t),t=yk(e,t,n,r,i);break e}else for(ha=Nu(t.stateNode.containerInfo.firstChild),va=t,ii=!0,ps=null,r=KR(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($f(),n===i){t=Al(e,t,r);break e}Ro(e,t,n,r)}t=t.child}return t;case 5:return HR(t),e===null&&ww(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,u=i.children,gw(n,i)?u=null:a!==null&&gw(n,a)&&(t.flags|=32),m7(e,t),Ro(e,t,u,r),t.child;case 6:return e===null&&ww(t),null;case 13:return g7(e,t,r);case 4:return f3(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Bf(t,null,n,r):Ro(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ds(n,i),mk(e,t,n,i,r);case 7:return Ro(e,t,t.pendingProps,r),t.child;case 8:return Ro(e,t,t.pendingProps.children,r),t.child;case 12:return Ro(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,u=i.value,Kn(R0,n._currentValue),n._currentValue=u,a!==null)if(_s(a.value,u)){if(a.children===i.children&&!Go.current){t=Al(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){u=a.child;for(var f=o.firstContext;f!==null;){if(f.context===n){if(a.tag===1){f=Tl(-1,r&-r),f.tag=2;var p=a.updateQueue;if(p!==null){p=p.shared;var v=p.pending;v===null?f.next=f:(f.next=v.next,v.next=f),p.pending=f}}a.lanes|=r,f=a.alternate,f!==null&&(f.lanes|=r),Cw(a.return,r,t),o.lanes|=r;break}f=f.next}}else if(a.tag===10)u=a.type===t.type?null:a.child;else if(a.tag===18){if(u=a.return,u===null)throw Error(Kt(341));u.lanes|=r,o=u.alternate,o!==null&&(o.lanes|=r),Cw(u,r,t),u=a.sibling}else u=a.child;if(u!==null)u.return=a;else for(u=a;u!==null;){if(u===t){u=null;break}if(a=u.sibling,a!==null){a.return=u.return,u=a;break}u=u.return}a=u}Ro(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Of(t,r),i=Wa(i),n=n(i),t.flags|=1,Ro(e,t,n,r),t.child;case 14:return n=t.type,i=ds(n,t.pendingProps),i=ds(n.type,i),vk(e,t,n,i,r);case 15:return h7(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ds(n,i),Yy(e,t),t.tag=1,Zo(n)?(e=!0,P0(t)):e=!1,Of(t,r),jR(t,n,i),Ew(t,n,i,r),Pw(null,t,n,!0,e,r);case 19:return y7(e,t,r);case 22:return p7(e,t,r)}throw Error(Kt(156,t.tag))};function N7(e,t){return aR(e,t)}function Pj(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ba(e,t,r,n){return new Pj(e,t,r,n)}function T3(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mj(e){if(typeof e=="function")return T3(e)?1:0;if(e!=null){if(e=e.$$typeof,e===WC)return 11;if(e===qC)return 14}return 2}function Fu(e,t){var r=e.alternate;return r===null?(r=Ba(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function e0(e,t,r,n,i,a){var u=2;if(n=e,typeof e=="function")T3(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case df:return Qc(r.children,i,a,t);case HC:u=8,i|=8;break;case Z2:return e=Ba(12,r,t,i|2),e.elementType=Z2,e.lanes=a,e;case X2:return e=Ba(13,r,t,i),e.elementType=X2,e.lanes=a,e;case Y2:return e=Ba(19,r,t,i),e.elementType=Y2,e.lanes=a,e;case UI:return L1(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case VI:u=10;break e;case jI:u=9;break e;case WC:u=11;break e;case qC:u=14;break e;case gu:u=16,n=null;break e}throw Error(Kt(130,e==null?e:typeof e,""))}return t=Ba(u,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Qc(e,t,r,n){return e=Ba(7,e,n,t),e.lanes=r,e}function L1(e,t,r,n){return e=Ba(22,e,n,t),e.elementType=UI,e.lanes=r,e.stateNode={isHidden:!1},e}function Ab(e,t,r){return e=Ba(6,e,null,t),e.lanes=r,e}function Nb(e,t,r){return t=Ba(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ij(e,t,r,n,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=pb(0),this.expirationTimes=pb(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pb(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function P3(e,t,r,n,i,a,u,o,f){return e=new Ij(e,t,r,o,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ba(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},d3(a),e}function Rj(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}t(),e.exports=ba})(Yu);const ad=LC(Yu.exports),Dj=MI({__proto__:null,default:ad},[Yu.exports]);var Ik=Yu.exports;q2.createRoot=Ik.createRoot,q2.hydrateRoot=Ik.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 Vm(){return Vm=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Fj(){return Math.random().toString(36).substr(2,8)}function Ok(e,t){return{usr:e.state,key:e.key,idx:t}}function Bw(e,t,r,n){return r===void 0&&(r=null),Vm({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ch(t):t,{state:r,key:t&&t.key||n||Fj()})}function j0(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ch(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function $j(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,u=i.history,o=Eu.Pop,f=null,p=v();p==null&&(p=0,u.replaceState(Vm({},u.state,{idx:p}),""));function v(){return(u.state||{idx:null}).idx}function y(){o=Eu.Pop;let A=v(),I=A==null?null:A-p;p=A,f&&f({action:o,location:R.location,delta:I})}function w(A,I){o=Eu.Push;let O=Bw(R.location,A,I);r&&r(O,A),p=v()+1;let N=Ok(O,p),L=R.createHref(O);try{u.pushState(N,"",L)}catch{i.location.assign(L)}a&&f&&f({action:o,location:R.location,delta:1})}function k(A,I){o=Eu.Replace;let O=Bw(R.location,A,I);r&&r(O,A),p=v();let N=Ok(O,p),L=R.createHref(O);u.replaceState(N,"",L),a&&f&&f({action:o,location:R.location,delta:0})}function T(A){let I=i.location.origin!=="null"?i.location.origin:i.location.href,O=typeof A=="string"?A:j0(A);return Ai(I,"No window.location.(origin|href) available to create URL for href: "+O),new URL(O,I)}let R={get action(){return o},get location(){return e(i,u)},listen(A){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(Rk,y),f=A,()=>{i.removeEventListener(Rk,y),f=null}},createHref(A){return t(i,A)},createURL:T,encodeLocation(A){let I=T(A);return{pathname:I.pathname,search:I.search,hash:I.hash}},push:w,replace:k,go(A){return u.go(A)}};return R}var Ak;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ak||(Ak={}));function Bj(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ch(t):t,i=B7(n.pathname||"/",r);if(i==null)return null;let a=F7(e);Vj(a);let u=null;for(let o=0;u==null&&o{let f={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:u,route:a};f.relativePath.startsWith("/")&&(Ai(f.relativePath.startsWith(n),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(n.length));let p=$u([n,f.relativePath]),v=r.concat(f);a.children&&a.children.length>0&&(Ai(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),F7(a.children,t,v,p)),!(a.path==null&&!a.index)&&t.push({path:p,score:Gj(p,a.index),routesMeta:v})};return e.forEach((a,u)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,u);else for(let f of $7(a.path))i(a,u,f)}),t}function $7(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let u=$7(n.join("/")),o=[];return o.push(...u.map(f=>f===""?a:[a,f].join("/"))),i&&o.push(...u),o.map(f=>e.startsWith("/")&&f===""?"/":f)}function Vj(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Zj(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const jj=/^:\w+$/,Uj=3,Kj=2,Hj=1,Wj=10,qj=-2,Nk=e=>e==="*";function Gj(e,t){let r=e.split("/"),n=r.length;return r.some(Nk)&&(n+=qj),t&&(n+=Kj),r.filter(i=>!Nk(i)).reduce((i,a)=>i+(jj.test(a)?Uj:a===""?Hj:Wj),n)}function Zj(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function Xj(e,t){let{routesMeta:r}=e,n={},i="/",a=[];for(let u=0;u{if(v==="*"){let w=o[y]||"";u=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}return p[v]=eU(o[y]||"",v),p},{}),pathname:a,pathnameBase:u,pattern:e}}function Qj(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),O3(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(u,o)=>(n.push(o),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Jj(e){try{return decodeURI(e)}catch(t){return O3(!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 eU(e,t){try{return decodeURIComponent(e)}catch(r){return O3(!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 ("+r+").")),e}}function B7(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function O3(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tU(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?ch(e):e;return{pathname:r?r.startsWith("/")?r:rU(r,t):t,search:iU(n),hash:oU(i)}}function rU(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function zb(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function V7(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function j7(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=ch(e):(i=Vm({},e),Ai(!i.pathname||!i.pathname.includes("?"),zb("?","pathname","search",i)),Ai(!i.pathname||!i.pathname.includes("#"),zb("#","pathname","hash",i)),Ai(!i.search||!i.search.includes("#"),zb("#","search","hash",i)));let a=e===""||i.pathname==="",u=a?"/":i.pathname,o;if(n||u==null)o=r;else{let y=t.length-1;if(u.startsWith("..")){let w=u.split("/");for(;w[0]==="..";)w.shift(),y-=1;i.pathname=w.join("/")}o=y>=0?t[y]:"/"}let f=tU(i,o),p=u&&u!=="/"&&u.endsWith("/"),v=(a||u===".")&&r.endsWith("/");return!f.pathname.endsWith("/")&&(p||v)&&(f.pathname+="/"),f}const $u=e=>e.join("/").replace(/\/\/+/g,"/"),nU=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iU=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oU=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function aU(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const sU=["post","put","patch","delete"];[...sU];var j1={exports:{}},U1={};/** * @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 lU=C.exports,uU=Symbol.for("react.element"),cU=Symbol.for("react.fragment"),dU=Object.prototype.hasOwnProperty,fU=lU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,hU={key:!0,ref:!0,__self:!0,__source:!0};function U7(e,t,r){var n,i={},a=null,u=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(u=t.ref);for(n in t)dU.call(t,n)&&!hU.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:uU,type:e,key:a,ref:u,props:i,_owner:fU.current}}U1.Fragment=cU;U1.jsx=U7;U1.jsxs=U7;(function(e){e.exports=U1})(j1);const Ar=j1.exports.Fragment,S=j1.exports.jsx,Xe=j1.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 Vw(){return Vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t{i.value=n,i.getSnapshot=t,Db(i)&&a({inst:i})},[e,n,t]),gU(()=>(Db(i)&&a({inst:i}),e(()=>{Db(i)&&a({inst:i})})),[e]),xU(n),n}function Db(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!mU(r,n)}catch{return!0}}function bU(e,t,r){return t()}const wU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",CU=!wU,SU=CU?bU:_U;"useSyncExternalStore"in g0&&(e=>e.useSyncExternalStore)(g0);const K7=C.exports.createContext(null),A3=C.exports.createContext(null),K1=C.exports.createContext(null),H1=C.exports.createContext(null),dh=C.exports.createContext({outlet:null,matches:[]}),H7=C.exports.createContext(null);function EU(e,t){let{relative:r}=t===void 0?{}:t;fh()||Ai(!1);let{basename:n,navigator:i}=C.exports.useContext(K1),{hash:a,pathname:u,search:o}=W7(e,{relative:r}),f=u;return n!=="/"&&(f=u==="/"?n:$u([n,u])),i.createHref({pathname:f,search:o,hash:a})}function fh(){return C.exports.useContext(H1)!=null}function fv(){return fh()||Ai(!1),C.exports.useContext(H1).location}function N3(){fh()||Ai(!1);let{basename:e,navigator:t}=C.exports.useContext(K1),{matches:r}=C.exports.useContext(dh),{pathname:n}=fv(),i=JSON.stringify(V7(r).map(o=>o.pathnameBase)),a=C.exports.useRef(!1);return C.exports.useEffect(()=>{a.current=!0}),C.exports.useCallback(function(o,f){if(f===void 0&&(f={}),!a.current)return;if(typeof o=="number"){t.go(o);return}let p=j7(o,JSON.parse(i),n,f.relative==="path");e!=="/"&&(p.pathname=p.pathname==="/"?e:$u([e,p.pathname])),(f.replace?t.replace:t.push)(p,f.state,f)},[e,t,i,n])}function W7(e,t){let{relative:r}=t===void 0?{}:t,{matches:n}=C.exports.useContext(dh),{pathname:i}=fv(),a=JSON.stringify(V7(n).map(u=>u.pathnameBase));return C.exports.useMemo(()=>j7(e,JSON.parse(a),i,r==="path"),[e,a,i,r])}function kU(e,t){fh()||Ai(!1);let{navigator:r}=C.exports.useContext(K1),n=C.exports.useContext(A3),{matches:i}=C.exports.useContext(dh),a=i[i.length-1],u=a?a.params:{};a&&a.pathname;let o=a?a.pathnameBase:"/";a&&a.route;let f=fv(),p;if(t){var v;let R=typeof t=="string"?ch(t):t;o==="/"||((v=R.pathname)==null?void 0:v.startsWith(o))||Ai(!1),p=R}else p=f;let y=p.pathname||"/",w=o==="/"?y:y.slice(o.length)||"/",k=Bj(e,{pathname:w}),T=IU(k&&k.map(R=>Object.assign({},R,{params:Object.assign({},u,R.params),pathname:$u([o,r.encodeLocation?r.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?o:$u([o,r.encodeLocation?r.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),i,n||void 0);return t&&T?S(H1.Provider,{value:{location:Vw({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Eu.Pop},children:T}):T}function TU(){let e=NU(),t=aU(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return Xe(Ar,{children:[S("h2",{children:"Unexpected Application Error!"}),S("h3",{style:{fontStyle:"italic"},children:t}),r?S("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},children:r}):null,null]})}class PU extends C.exports.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location?{error:t.error,location:t.location}:{error:t.error||r.error,location:r.location}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?S(dh.Provider,{value:this.props.routeContext,children:S(H7.Provider,{value:this.state.error,children:this.props.component})}):this.props.children}}function MU(e){let{routeContext:t,match:r,children:n}=e,i=C.exports.useContext(K7);return i&&i.static&&i.staticContext&&r.route.errorElement&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),S(dh.Provider,{value:t,children:n})}function IU(e,t,r){if(t===void 0&&(t=[]),e==null)if(r!=null&&r.errors)e=r.matches;else return null;let n=e,i=r==null?void 0:r.errors;if(i!=null){let a=n.findIndex(u=>u.route.id&&(i==null?void 0:i[u.route.id]));a>=0||Ai(!1),n=n.slice(0,Math.min(n.length,a+1))}return n.reduceRight((a,u,o)=>{let f=u.route.id?i==null?void 0:i[u.route.id]:null,p=r?u.route.errorElement||S(TU,{}):null,v=t.concat(n.slice(0,o+1)),y=()=>S(MU,{match:u,routeContext:{outlet:a,matches:v},children:f?p:u.route.element!==void 0?u.route.element:a});return r&&(u.route.errorElement||o===0)?S(PU,{location:r.location,component:p,error:f,children:y(),routeContext:{outlet:null,matches:v}}):y()},null)}var zk;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(zk||(zk={}));var U0;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(U0||(U0={}));function RU(e){let t=C.exports.useContext(A3);return t||Ai(!1),t}function OU(e){let t=C.exports.useContext(dh);return t||Ai(!1),t}function AU(e){let t=OU(),r=t.matches[t.matches.length-1];return r.route.id||Ai(!1),r.route.id}function NU(){var e;let t=C.exports.useContext(H7),r=RU(U0.UseRouteError),n=AU(U0.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function W1(e){let{to:t,replace:r,state:n,relative:i}=e;fh()||Ai(!1);let a=C.exports.useContext(A3),u=N3();return C.exports.useEffect(()=>{a&&a.navigation.state!=="idle"||u(t,{replace:r,state:n,relative:i})}),null}function Xp(e){Ai(!1)}function zU(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Eu.Pop,navigator:a,static:u=!1}=e;fh()&&Ai(!1);let o=t.replace(/^\/*/,"/"),f=C.exports.useMemo(()=>({basename:o,navigator:a,static:u}),[o,a,u]);typeof n=="string"&&(n=ch(n));let{pathname:p="/",search:v="",hash:y="",state:w=null,key:k="default"}=n,T=C.exports.useMemo(()=>{let R=B7(p,o);return R==null?null:{pathname:R,search:v,hash:y,state:w,key:k}},[o,p,v,y,w,k]);return T==null?null:S(K1.Provider,{value:f,children:S(H1.Provider,{children:r,value:{location:T,navigationType:i}})})}function DU(e){let{children:t,location:r}=e,n=C.exports.useContext(K7),i=n&&!t?n.router.routes:jw(t);return kU(i,r)}var Dk;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(Dk||(Dk={}));new Promise(()=>{});function jw(e,t){t===void 0&&(t=[]);let r=[];return C.exports.Children.forEach(e,(n,i)=>{if(!C.exports.isValidElement(n))return;if(n.type===C.exports.Fragment){r.push.apply(r,jw(n.props.children,t));return}n.type!==Xp&&Ai(!1),!n.props.index||!n.props.children||Ai(!1);let a=[...t,i],u={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,hasErrorBoundary:n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle};n.props.children&&(u.children=jw(n.props.children,a)),r.push(u)}),r}/** * 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 LU(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function FU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $U(e,t){return e.button===0&&(!t||t==="_self")&&!FU(e)}function Uw(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function BU(e,t){let r=Uw(e);if(t)for(let n of t.keys())r.has(n)||t.getAll(n).forEach(i=>{r.append(n,i)});return r}const VU=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function jU(e){let{basename:t,children:r,window:n}=e,i=C.exports.useRef();i.current==null&&(i.current=Lj({window:n,v5Compat:!0}));let a=i.current,[u,o]=C.exports.useState({action:a.action,location:a.location});return C.exports.useLayoutEffect(()=>a.listen(o),[a]),S(zU,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:a})}const UU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Kw=C.exports.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:u,state:o,target:f,to:p,preventScrollReset:v}=t,y=LU(t,VU),w,k=!1;if(UU&&typeof p=="string"&&/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(p)){w=p;let I=new URL(window.location.href),O=p.startsWith("//")?new URL(I.protocol+p):new URL(p);O.origin===I.origin?p=O.pathname+O.search+O.hash:k=!0}let T=EU(p,{relative:i}),R=KU(p,{replace:u,state:o,target:f,preventScrollReset:v,relative:i});function A(I){n&&n(I),I.defaultPrevented||R(I)}return S("a",{...y,href:w||T,onClick:k||a?n:A,ref:r,target:f})});var Lk;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(Lk||(Lk={}));var Fk;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fk||(Fk={}));function KU(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:u}=t===void 0?{}:t,o=N3(),f=fv(),p=W7(e,{relative:u});return C.exports.useCallback(v=>{if($U(v,r)){v.preventDefault();let y=n!==void 0?n:j0(f)===j0(p);o(e,{replace:y,state:i,preventScrollReset:a,relative:u})}},[f,o,p,n,i,r,e,a,u])}function HU(e){let t=C.exports.useRef(Uw(e)),r=C.exports.useRef(!1),n=fv(),i=C.exports.useMemo(()=>BU(n.search,r.current?null:t.current),[n.search]),a=N3(),u=C.exports.useCallback((o,f)=>{const p=Uw(typeof o=="function"?o(i):o);r.current=!0,a("?"+p,f)},[a,i]);return[i,u]}let Lb=0,$k=[];function WU(){return Lb+=1,()=>{if(Lb-=1,Lb===0){let e=$k;$k=[];for(let t of e)t()}}}let fy=Symbol(),qU=(e,t,r,n)=>{let i={...e};i.set=(...u)=>{e[fy]=t,e.set(...u),delete e[fy]},e.setKey&&(i.setKey=(...u)=>{e[fy]=t,e.setKey(...u),delete e[fy]});let a=r(i,...n);if(a instanceof Promise){let u=WU();return a.finally(u)}return a},GU=(e,t,r)=>(...n)=>qU(e,t,r,n),Io=[],hh=(e,t)=>{let r,n=[],i={lc:0,l:t||0,value:e,set(a){i.value=a,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(a){r=n;let u=!Io.length;for(let o=0;o{n===r&&(n=n.slice());let o=n.indexOf(a);~o&&(n.splice(o,2),i.lc--)}},subscribe(a,u){let o=i.listen(a,u);return a(i.value),o},off(){}};return i};function ZU(e,t,r){let n=new Set([...t,void 0]);return e.listen((i,a)=>{n.has(a)&&r(i,a)})}var q1={exports:{}},q7={};/** * @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 Kf=C.exports;function XU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YU=typeof Object.is=="function"?Object.is:XU,QU=Kf.useState,JU=Kf.useEffect,eK=Kf.useLayoutEffect,tK=Kf.useDebugValue;function rK(e,t){var r=t(),n=QU({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return eK(function(){i.value=r,i.getSnapshot=t,Fb(i)&&a({inst:i})},[e,r,t]),JU(function(){return Fb(i)&&a({inst:i}),e(function(){Fb(i)&&a({inst:i})})},[e]),tK(r),r}function Fb(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!YU(e,r)}catch{return!0}}function nK(e,t){return t()}var iK=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?nK:rK;q7.useSyncExternalStore=Kf.useSyncExternalStore!==void 0?Kf.useSyncExternalStore:iK;(function(e){e.exports=q7})(q1);function Hu(e,t={}){let r=C.exports.useCallback(i=>t.keys?ZU(e,t.keys,i):e.listen(i),[t.keys,e]),n=e.get.bind(e);return q1.exports.useSyncExternalStore(r,n,n)}function tt(){return tt=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 Nr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sK(e,t){if(t&&(ar(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nr(e)}function gi(e){var t=aK();return function(){var n=K0(e),i;if(t){var a=K0(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return sK(this,i)}}var Z7={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 r(){for(var n=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{},r=[];return tn.Children.forEach(e,function(n){n==null&&!t.keepEmpty||(Array.isArray(n)?r=r.concat(lo(n)):z3.exports.isFragment(n)&&n.props?r=r.concat(lo(n.props.children,t)):r.push(n))}),r}var Vk={};function hK(e,t){}function pK(e,t,r){!t&&!Vk[r]&&(e(!1,r),Vk[r]=!0)}function Bn(e,t){pK(hK,e,t)}function jk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t0},e.prototype.connect_=function(){!Ww||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),_K?(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(){!Ww||!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 r=t.propertyName,n=r===void 0?"":r,i=xK.some(function(a){return!!~n.indexOf(a)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),J7=function(e,t){for(var r=0,n=Object.keys(t);r"u"||!(Element instanceof Object))){if(!(t instanceof Hf(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new MK(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 Hf(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;!r.has(t)||(r.delete(t),r.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(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new IK(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),tO=typeof WeakMap<"u"?new WeakMap:new Q7,rO=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 r=bK.getInstance(),n=new RK(t,r,this);tO.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){rO.prototype[e]=function(){var t;return(t=tO.get(this))[e].apply(t,arguments)}});var nO=function(){return typeof W0.ResizeObserver<"u"?W0.ResizeObserver:rO}(),ku=new Map;function OK(e){e.forEach(function(t){var r,n=t.target;(r=ku.get(n))===null||r===void 0||r.forEach(function(i){return i(n)})})}var iO=new nO(OK);function AK(e,t){ku.has(e)||(ku.set(e,new Set),iO.observe(e)),ku.get(e).add(t)}function NK(e,t){ku.has(e)&&(ku.get(e).delete(t),ku.get(e).size||(iO.unobserve(e),ku.delete(e)))}var zK=function(e){vi(r,e);var t=gi(r);function r(){return Qn(this,r),t.apply(this,arguments)}return Jn(r,[{key:"render",value:function(){return this.props.children}}]),r}(C.exports.Component),qw=C.exports.createContext(null);function DK(e){var t=e.children,r=e.onBatchResize,n=C.exports.useRef(0),i=C.exports.useRef([]),a=C.exports.useContext(qw),u=C.exports.useCallback(function(o,f,p){n.current+=1;var v=n.current;i.current.push({size:o,element:f,data:p}),Promise.resolve().then(function(){v===n.current&&(r==null||r(i.current),i.current=[])}),a==null||a(o,f,p)},[r,a]);return S(qw.Provider,{value:u,children:t})}function LK(e,t){var r=e.children,n=e.disabled,i=C.exports.useRef(null),a=C.exports.useRef(null),u=C.exports.useContext(qw),o=typeof r=="function",f=o?r(i):r,p=C.exports.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),v=!o&&C.exports.isValidElement(f)&&md(f),y=v?f.ref:null,w=C.exports.useMemo(function(){return ta(y,i)},[y,i]),k=function(){return jm(i.current)||jm(a.current)};C.exports.useImperativeHandle(t,function(){return k()});var T=C.exports.useRef(e);T.current=e;var R=C.exports.useCallback(function(A){var I=T.current,O=I.onResize,N=I.data,L=A.getBoundingClientRect(),B=L.width,j=L.height,G=A.offsetWidth,H=A.offsetHeight,te=Math.floor(B),Y=Math.floor(j);if(p.current.width!==te||p.current.height!==Y||p.current.offsetWidth!==G||p.current.offsetHeight!==H){var le={width:te,height:Y,offsetWidth:G,offsetHeight:H};p.current=le;var J=G===Math.round(B)?B:G,Z=H===Math.round(j)?j:H,Q=ve(ve({},le),{},{offsetWidth:J,offsetHeight:Z});u==null||u(Q,A,N),O&&Promise.resolve().then(function(){O(Q,A)})}},[]);return C.exports.useEffect(function(){var A=k();return A&&!n&&AK(A,R),function(){return NK(A,R)}},[i.current,n]),S(zK,{ref:a,children:v?C.exports.cloneElement(f,{ref:w}):f})}var FK=C.exports.forwardRef(LK),$K="rc-observer-key";function BK(e,t){var r=e.children,n=typeof r=="function"?[r]:lo(r);return n.map(function(i,a){var u=(i==null?void 0:i.key)||"".concat($K,"-").concat(a);return C.exports.createElement(FK,{...e,key:u,ref:a===0?t:void 0},i)})}var Ul=C.exports.forwardRef(BK);Ul.Collection=DK;function Si(e,t){var r=ve({},e);return Array.isArray(t)&&t.forEach(function(n){delete r[n]}),r}var VK=C.exports.createContext({});const $3=VK;function jK(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Mr(e,t){if(e==null)return{};var r=jK(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}function Gw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--ne){var de=this.tryEntries[ne],oe=de.completion;if(de.tryLoc==="root")return ge("end");if(de.tryLoc<=this.prev){var ye=r.call(de,"catchLoc"),Re=r.call(de,"finallyLoc");if(ye&&Re){if(this.prev=0;--ge){var ne=this.tryEntries[ge];if(ne.tryLoc<=this.prev&&r.call(ne,"finallyLoc")&&this.prev=0;--Q){var ge=this.tryEntries[Q];if(ge.finallyLoc===Z)return this.complete(ge.completion,ge.afterLoc),H(ge),y}},catch:function(Z){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var ge=this.tryEntries[Q];if(ge.tryLoc===Z){var ne=ge.completion;if(ne.type==="throw"){var de=ne.arg;H(ge)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(Z,Q,ge){return this.delegate={iterator:Y(Z),resultName:Q,nextLoc:ge},this.method==="next"&&(this.arg=void 0),y}},e}function Kk(e,t,r,n,i,a,u){try{var o=e[a](u),f=o.value}catch(p){r(p);return}o.done?t(f):Promise.resolve(f).then(n,i)}function vd(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function u(f){Kk(a,n,i,u,o,"next",f)}function o(f){Kk(a,n,i,u,o,"throw",f)}u(void 0)})}}function qc(){return qc=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 t0(e,t,r){return WK()?t0=Reflect.construct.bind():t0=function(i,a,u){var o=[null];o.push.apply(o,a);var f=Function.bind.apply(i,o),p=new f;return u&&Um(p,u.prototype),p},t0.apply(null,arguments)}function qK(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Yw(e){var t=typeof Map=="function"?new Map:void 0;return Yw=function(n){if(n===null||!qK(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return t0(n,arguments,Xw(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Um(i,n)},Yw(e)}var GK=/%[sdj%]/g,ZK=function(){};typeof process<"u"&&process.env;function Qw(e){if(!e||!e.length)return null;var t={};return e.forEach(function(r){var n=r.field;t[n]=t[n]||[],t[n].push(r)}),t}function pa(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=a)return o;switch(o){case"%s":return String(r[i++]);case"%d":return Number(r[i++]);case"%j":try{return JSON.stringify(r[i++])}catch{return"[Circular]"}break;default:return o}});return u}return e}function XK(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Vi(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||XK(t)&&typeof e=="string"&&!e)}function YK(e,t,r){var n=[],i=0,a=e.length;function u(o){n.push.apply(n,o||[]),i++,i===a&&r(n)}e.forEach(function(o){t(o,u)})}function Hk(e,t,r){var n=0,i=e.length;function a(u){if(u&&u.length){r(u);return}var o=n;n=n+1,o()\[\]\\.,;:\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},Yp={integer:function(t){return Yp.number(t)&&parseInt(t,10)===t},float:function(t){return Yp.number(t)&&!Yp.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"&&!Yp.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(Zk.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(nH())},hex:function(t){return typeof t=="string"&&!!t.match(Zk.hex)}},iH=function(t,r,n,i,a){if(t.required&&r===void 0){aO(t,r,n,i,a);return}var u=["integer","float","array","regexp","object","method","email","number","date","url","hex"],o=t.type;u.indexOf(o)>-1?Yp[o](r)||i.push(pa(a.messages.types[o],t.fullField,t.type)):o&&typeof r!==t.type&&i.push(pa(a.messages.types[o],t.fullField,t.type))},oH=function(t,r,n,i,a){var u=typeof t.len=="number",o=typeof t.min=="number",f=typeof t.max=="number",p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v=r,y=null,w=typeof r=="number",k=typeof r=="string",T=Array.isArray(r);if(w?y="number":k?y="string":T&&(y="array"),!y)return!1;T&&(v=r.length),k&&(v=r.replace(p,"_").length),u?v!==t.len&&i.push(pa(a.messages[y].len,t.fullField,t.len)):o&&!f&&vt.max?i.push(pa(a.messages[y].max,t.fullField,t.max)):o&&f&&(vt.max)&&i.push(pa(a.messages[y].range,t.fullField,t.min,t.max))},tf="enum",aH=function(t,r,n,i,a){t[tf]=Array.isArray(t[tf])?t[tf]:[],t[tf].indexOf(r)===-1&&i.push(pa(a.messages[tf],t.fullField,t[tf].join(", ")))},sH=function(t,r,n,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(r)||i.push(pa(a.messages.pattern.mismatch,t.fullField,r,t.pattern));else if(typeof t.pattern=="string"){var u=new RegExp(t.pattern);u.test(r)||i.push(pa(a.messages.pattern.mismatch,t.fullField,r,t.pattern))}}},nn={required:aO,whitespace:rH,type:iH,range:oH,enum:aH,pattern:sH},lH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r,"string")&&!t.required)return n();nn.required(t,r,i,u,a,"string"),Vi(r,"string")||(nn.type(t,r,i,u,a),nn.range(t,r,i,u,a),nn.pattern(t,r,i,u,a),t.whitespace===!0&&nn.whitespace(t,r,i,u,a))}n(u)},uH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),r!==void 0&&nn.type(t,r,i,u,a)}n(u)},cH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(r===""&&(r=void 0),Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),r!==void 0&&(nn.type(t,r,i,u,a),nn.range(t,r,i,u,a))}n(u)},dH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),r!==void 0&&nn.type(t,r,i,u,a)}n(u)},fH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),Vi(r)||nn.type(t,r,i,u,a)}n(u)},hH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),r!==void 0&&(nn.type(t,r,i,u,a),nn.range(t,r,i,u,a))}n(u)},pH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),r!==void 0&&(nn.type(t,r,i,u,a),nn.range(t,r,i,u,a))}n(u)},mH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(r==null&&!t.required)return n();nn.required(t,r,i,u,a,"array"),r!=null&&(nn.type(t,r,i,u,a),nn.range(t,r,i,u,a))}n(u)},vH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),r!==void 0&&nn.type(t,r,i,u,a)}n(u)},gH="enum",yH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a),r!==void 0&&nn[gH](t,r,i,u,a)}n(u)},xH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r,"string")&&!t.required)return n();nn.required(t,r,i,u,a),Vi(r,"string")||nn.pattern(t,r,i,u,a)}n(u)},_H=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r,"date")&&!t.required)return n();if(nn.required(t,r,i,u,a),!Vi(r,"date")){var f;r instanceof Date?f=r:f=new Date(r),nn.type(t,f,i,u,a),f&&nn.range(t,f.getTime(),i,u,a)}}n(u)},bH=function(t,r,n,i,a){var u=[],o=Array.isArray(r)?"array":typeof r;nn.required(t,r,i,u,a,o),n(u)},$b=function(t,r,n,i,a){var u=t.type,o=[],f=t.required||!t.required&&i.hasOwnProperty(t.field);if(f){if(Vi(r,u)&&!t.required)return n();nn.required(t,r,i,o,a,u),Vi(r,u)||nn.type(t,r,i,o,a)}n(o)},wH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();nn.required(t,r,i,u,a)}n(u)},hm={string:lH,method:uH,number:cH,boolean:dH,regexp:fH,integer:hH,float:pH,array:mH,object:vH,enum:yH,pattern:xH,date:_H,url:$b,hex:$b,email:$b,required:bH,any:wH};function Jw(){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 e4=Jw(),pv=function(){function e(r){this.rules=null,this._messages=e4,this.define(r)}var t=e.prototype;return t.define=function(n){var i=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(a){var u=n[a];i.rules[a]=Array.isArray(u)?u:[u]})},t.messages=function(n){return n&&(this._messages=Gk(Jw(),n)),this._messages},t.validate=function(n,i,a){var u=this;i===void 0&&(i={}),a===void 0&&(a=function(){});var o=n,f=i,p=a;if(typeof f=="function"&&(p=f,f={}),!this.rules||Object.keys(this.rules).length===0)return p&&p(null,o),Promise.resolve(o);function v(R){var A=[],I={};function O(L){if(Array.isArray(L)){var B;A=(B=A).concat.apply(B,L)}else A.push(L)}for(var N=0;N3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&n&&r===void 0&&!lO(e,t.slice(0,-1))?e:dO(e,t,r,n)}function ox(e){return Array.isArray(e)?EH(e):ar(e)==="object"&&e!==null?SH(e):e}function SH(e){if(Object.getPrototypeOf(e)===Object.prototype){var t={};for(var r in e)t[r]=ox(e[r]);return t}return e}function EH(e){return e.map(function(t){return ox(t)})}function bi(e){return Zw(e)}function Tu(e,t){var r=lO(e,t);return r}function mu(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=CH(e,t,r,n);return i}function Xk(e,t){var r={};return t.forEach(function(n){var i=Tu(e,n);r=mu(r,n,i)}),r}function pm(e,t){return e&&e.some(function(r){return hO(r,t)})}function Yk(e){return ar(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function fO(e,t){var r=Array.isArray(e)?wt(e):ve({},e);return t&&Object.keys(t).forEach(function(n){var i=r[n],a=t[n],u=Yk(i)&&Yk(a);r[n]=u?fO(i,a||{}):ox(a)}),r}function r0(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=n||r<0||r>=n)return e;var i=e[t],a=t-r;return a>0?[].concat(wt(e.slice(0,r)),[i],wt(e.slice(r,t)),wt(e.slice(t+1,n))):a<0?[].concat(wt(e.slice(0,t)),wt(e.slice(t+1,r+1)),[i],wt(e.slice(r+1,n))):e}var PH=pv;function MH(e,t){return e.replace(/\$\{\w+\}/g,function(r){var n=r.slice(2,-1);return t[n]})}var Jk="CODE_LOGIC_ERROR";function t4(e,t,r,n,i){return r4.apply(this,arguments)}function r4(){return r4=vd(Do().mark(function e(t,r,n,i,a){var u,o,f,p,v,y,w,k,T;return Do().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return u=ve({},n),delete u.ruleIndex,u.validator&&(o=u.validator,u.validator=function(){try{return o.apply(void 0,arguments)}catch(I){return console.error(I),Promise.reject(Jk)}}),f=null,u&&u.type==="array"&&u.defaultField&&(f=u.defaultField,delete u.defaultField),p=new PH(se({},t,[u])),v=r0({},sO,i.validateMessages),p.messages(v),y=[],A.prev=9,A.next=12,Promise.resolve(p.validate(se({},t,r),ve({},i)));case 12:A.next=17;break;case 14:A.prev=14,A.t0=A.catch(9),A.t0.errors&&(y=A.t0.errors.map(function(I,O){var N=I.message,L=N===Jk?v.default:N;return C.exports.isValidElement(L)?C.exports.cloneElement(L,{key:"error_".concat(O)}):L}));case 17:if(!(!y.length&&f)){A.next=22;break}return A.next=20,Promise.all(r.map(function(I,O){return t4("".concat(t,".").concat(O),I,f,i,a)}));case 20:return w=A.sent,A.abrupt("return",w.reduce(function(I,O){return[].concat(wt(I),wt(O))},[]));case 22:return k=ve(ve({},n),{},{name:t,enum:(n.enum||[]).join(", ")},a),T=y.map(function(I){return typeof I=="string"?MH(I,k):I}),A.abrupt("return",T);case 25:case"end":return A.stop()}},e,null,[[9,14]])})),r4.apply(this,arguments)}function IH(e,t,r,n,i,a){var u=e.join("."),o=r.map(function(v,y){var w=v.validator,k=ve(ve({},v),{},{ruleIndex:y});return w&&(k.validator=function(T,R,A){var I=!1,O=function(){for(var B=arguments.length,j=new Array(B),G=0;G0&&arguments[0]!==void 0?arguments[0]:Ra;if(i.validatePromise===y){var B;i.validatePromise=null;var j=[],G=[];(B=L.forEach)===null||B===void 0||B.call(L,function(H){var te=H.rule.warningOnly,Y=H.errors,le=Y===void 0?Ra:Y;te?G.push.apply(G,wt(le)):j.push.apply(j,wt(le))}),i.errors=j,i.warnings=G,i.triggerMetaEvent(),i.reRender()}}),N});return i.validatePromise=y,i.dirty=!0,i.errors=Ra,i.warnings=Ra,i.triggerMetaEvent(),i.reRender(),y},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 f=i.props.fieldContext,p=f.getInternalHooks(Wc),v=p.getInitialValue;return v(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 f={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath()};return f},i.getOnlyChild=function(f){if(typeof f=="function"){var p=i.getMeta();return ve(ve({},i.getOnlyChild(f(i.getControlled(),p,i.props.fieldContext))),{},{isFunction:!0})}var v=lo(f);return v.length!==1||!C.exports.isValidElement(v[0])?{child:v,isFunction:!1}:{child:v[0],isFunction:!1}},i.getValue=function(f){var p=i.props.fieldContext.getFieldsValue,v=i.getNamePath();return Tu(f||p(!0),v)},i.getControlled=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=i.props,v=p.trigger,y=p.validateTrigger,w=p.getValueFromEvent,k=p.normalize,T=p.valuePropName,R=p.getValueProps,A=p.fieldContext,I=y!==void 0?y:A.validateTrigger,O=i.getNamePath(),N=A.getInternalHooks,L=A.getFieldsValue,B=N(Wc),j=B.dispatch,G=i.getValue(),H=R||function(J){return se({},T,J)},te=f[v],Y=ve(ve({},f),H(G));Y[v]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var J,Z=arguments.length,Q=new Array(Z),ge=0;ge=0&&te<=Y.length?(p.keys=[].concat(wt(p.keys.slice(0,te)),[p.id],wt(p.keys.slice(te))),O([].concat(wt(Y.slice(0,te)),[H],wt(Y.slice(te))))):(p.keys=[].concat(wt(p.keys),[p.id]),O([].concat(wt(Y),[H]))),p.id+=1},remove:function(H){var te=L(),Y=new Set(Array.isArray(H)?H:[H]);Y.size<=0||(p.keys=p.keys.filter(function(le,J){return!Y.has(J)}),O(te.filter(function(le,J){return!Y.has(J)})))},move:function(H,te){if(H!==te){var Y=L();H<0||H>=Y.length||te<0||te>=Y.length||(p.keys=Qk(p.keys,H,te),O(Qk(Y,H,te)))}}},j=I||[];return Array.isArray(j)||(j=[]),i(j.map(function(G,H){var te=p.keys[H];return te===void 0&&(p.keys[H]=p.id,te=p.keys[H],p.id+=1),{name:H,key:te,isListField:!0}}),B,R)}})})})};function NH(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,u,o=[],f=!0,p=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;f=!1}else for(;!(f=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);f=!0);}catch(v){p=!0,i=v}finally{try{if(!f&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw i}}return o}}function Le(e,t){return uO(e)||NH(e,t)||B3(e,t)||cO()}function zH(e){var t=!1,r=e.length,n=[];return e.length?new Promise(function(i,a){e.forEach(function(u,o){u.catch(function(f){return t=!0,f}).then(function(f){r-=1,n[o]=f,!(r>0)&&(t&&a(n),i(n))})})}):Promise.resolve([])}var vO="__@field_split__";function Bb(e){return e.map(function(t){return"".concat(ar(t),":").concat(t)}).join(vO)}var rf=function(){function e(){Qn(this,e),this.kvs=new Map}return Jn(e,[{key:"set",value:function(r,n){this.kvs.set(Bb(r),n)}},{key:"get",value:function(r){return this.kvs.get(Bb(r))}},{key:"update",value:function(r,n){var i=this.get(r),a=n(i);a?this.set(r,a):this.delete(r)}},{key:"delete",value:function(r){this.kvs.delete(Bb(r))}},{key:"map",value:function(r){return wt(this.kvs.entries()).map(function(n){var i=Le(n,2),a=i[0],u=i[1],o=a.split(vO);return r({key:o.map(function(f){var p=f.match(/^([^:]*):(.*)$/),v=Le(p,3),y=v[1],w=v[2];return y==="number"?Number(w):w}),value:u})})}},{key:"toJSON",value:function(){var r={};return this.map(function(n){var i=n.key,a=n.value;return r[i.join(".")]=a,null}),r}}]),e}(),DH=["name","errors"],LH=Jn(function e(t){var r=this;Qn(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:r.getFieldValue,getFieldsValue:r.getFieldsValue,getFieldError:r.getFieldError,getFieldWarning:r.getFieldWarning,getFieldsError:r.getFieldsError,isFieldsTouched:r.isFieldsTouched,isFieldTouched:r.isFieldTouched,isFieldValidating:r.isFieldValidating,isFieldsValidating:r.isFieldsValidating,resetFields:r.resetFields,setFields:r.setFields,setFieldValue:r.setFieldValue,setFieldsValue:r.setFieldsValue,validateFields:r.validateFields,submit:r.submit,_init:!0,getInternalHooks:r.getInternalHooks}},this.getInternalHooks=function(n){return n===Wc?(r.formHooked=!0,{dispatch:r.dispatch,initEntityValue:r.initEntityValue,registerField:r.registerField,useSubscribe:r.useSubscribe,setInitialValues:r.setInitialValues,destroyForm:r.destroyForm,setCallbacks:r.setCallbacks,setValidateMessages:r.setValidateMessages,getFields:r.getFields,setPreserve:r.setPreserve,getInitialValue:r.getInitialValue,registerWatch:r.registerWatch}):(Bn(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(n){r.subscribable=n},this.prevWithoutPreserves=null,this.setInitialValues=function(n,i){if(r.initialValues=n||{},i){var a,u=r0({},n,r.store);(a=r.prevWithoutPreserves)===null||a===void 0||a.map(function(o){var f=o.key;u=mu(u,f,Tu(n,f))}),r.prevWithoutPreserves=null,r.updateStore(u)}},this.destroyForm=function(){var n=new rf;r.getFieldEntities(!0).forEach(function(i){r.isMergedPreserve(i.isPreserve())||n.set(i.getNamePath(),!0)}),r.prevWithoutPreserves=n},this.getInitialValue=function(n){var i=Tu(r.initialValues,n);return n.length?ox(i):i},this.setCallbacks=function(n){r.callbacks=n},this.setValidateMessages=function(n){r.validateMessages=n},this.setPreserve=function(n){r.preserve=n},this.watchList=[],this.registerWatch=function(n){return r.watchList.push(n),function(){r.watchList=r.watchList.filter(function(i){return i!==n})}},this.notifyWatch=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(r.watchList.length){var i=r.getFieldsValue();r.watchList.forEach(function(a){a(i,n)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(n){r.store=n},this.getFieldEntities=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?r.fieldEntities.filter(function(i){return i.getNamePath().length}):r.fieldEntities},this.getFieldsMap=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new rf;return r.getFieldEntities(n).forEach(function(a){var u=a.getNamePath();i.set(u,a)}),i},this.getFieldEntitiesForNamePathList=function(n){if(!n)return r.getFieldEntities(!0);var i=r.getFieldsMap(!0);return n.map(function(a){var u=bi(a);return i.get(u)||{INVALIDATE_NAME_PATH:bi(a)}})},this.getFieldsValue=function(n,i){if(r.warningUnhooked(),n===!0&&!i)return r.store;var a=r.getFieldEntitiesForNamePathList(Array.isArray(n)?n:null),u=[];return a.forEach(function(o){var f,p="INVALIDATE_NAME_PATH"in o?o.INVALIDATE_NAME_PATH:o.getNamePath();if(!(!n&&((f=o.isListField)===null||f===void 0?void 0:f.call(o))))if(!i)u.push(p);else{var v="getMeta"in o?o.getMeta():null;i(v)&&u.push(p)}}),Xk(r.store,u.map(bi))},this.getFieldValue=function(n){r.warningUnhooked();var i=bi(n);return Tu(r.store,i)},this.getFieldsError=function(n){r.warningUnhooked();var i=r.getFieldEntitiesForNamePathList(n);return i.map(function(a,u){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:bi(n[u]),errors:[],warnings:[]}})},this.getFieldError=function(n){r.warningUnhooked();var i=bi(n),a=r.getFieldsError([i])[0];return a.errors},this.getFieldWarning=function(n){r.warningUnhooked();var i=bi(n),a=r.getFieldsError([i])[0];return a.warnings},this.isFieldsTouched=function(){r.warningUnhooked();for(var n=arguments.length,i=new Array(n),a=0;a0&&arguments[0]!==void 0?arguments[0]:{},i=new rf,a=r.getFieldEntities(!0);a.forEach(function(f){var p=f.props.initialValue,v=f.getNamePath();if(p!==void 0){var y=i.get(v)||new Set;y.add({entity:f,value:p}),i.set(v,y)}});var u=function(p){p.forEach(function(v){var y=v.props.initialValue;if(y!==void 0){var w=v.getNamePath(),k=r.getInitialValue(w);if(k!==void 0)Bn(!1,"Form already set 'initialValues' with path '".concat(w.join("."),"'. Field can not overwrite it."));else{var T=i.get(w);if(T&&T.size>1)Bn(!1,"Multiple Field with path '".concat(w.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(T){var R=r.getFieldValue(w);(!n.skipExist||R===void 0)&&r.updateStore(mu(r.store,w,wt(T)[0].value))}}}})},o;n.entities?o=n.entities:n.namePathList?(o=[],n.namePathList.forEach(function(f){var p=i.get(f);if(p){var v;(v=o).push.apply(v,wt(wt(p).map(function(y){return y.entity})))}})):o=a,u(o)},this.resetFields=function(n){r.warningUnhooked();var i=r.store;if(!n){r.updateStore(r0({},r.initialValues)),r.resetWithFieldInitialValue(),r.notifyObservers(i,null,{type:"reset"}),r.notifyWatch();return}var a=n.map(bi);a.forEach(function(u){var o=r.getInitialValue(u);r.updateStore(mu(r.store,u,o))}),r.resetWithFieldInitialValue({namePathList:a}),r.notifyObservers(i,a,{type:"reset"}),r.notifyWatch(a)},this.setFields=function(n){r.warningUnhooked();var i=r.store,a=[];n.forEach(function(u){var o=u.name;u.errors;var f=Mr(u,DH),p=bi(o);a.push(p),"value"in f&&r.updateStore(mu(r.store,p,f.value)),r.notifyObservers(i,[p],{type:"setField",data:u})}),r.notifyWatch(a)},this.getFields=function(){var n=r.getFieldEntities(!0),i=n.map(function(a){var u=a.getNamePath(),o=a.getMeta(),f=ve(ve({},o),{},{name:u,value:r.getFieldValue(u)});return Object.defineProperty(f,"originRCField",{value:!0}),f});return i},this.initEntityValue=function(n){var i=n.props.initialValue;if(i!==void 0){var a=n.getNamePath(),u=Tu(r.store,a);u===void 0&&r.updateStore(mu(r.store,a,i))}},this.isMergedPreserve=function(n){var i=n!==void 0?n:r.preserve;return i!=null?i:!0},this.registerField=function(n){r.fieldEntities.push(n);var i=n.getNamePath();if(r.notifyWatch([i]),n.props.initialValue!==void 0){var a=r.store;r.resetWithFieldInitialValue({entities:[n],skipExist:!0}),r.notifyObservers(a,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(u,o){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r.fieldEntities=r.fieldEntities.filter(function(y){return y!==n}),!r.isMergedPreserve(o)&&(!u||f.length>1)){var p=u?void 0:r.getInitialValue(i);if(i.length&&r.getFieldValue(i)!==p&&r.fieldEntities.every(function(y){return!hO(y.getNamePath(),i)})){var v=r.store;r.updateStore(mu(v,i,p,!0)),r.notifyObservers(v,[i],{type:"remove"}),r.triggerDependenciesUpdate(v,i)}}r.notifyWatch([i])}},this.dispatch=function(n){switch(n.type){case"updateValue":{var i=n.namePath,a=n.value;r.updateValue(i,a);break}case"validateField":{var u=n.namePath,o=n.triggerName;r.validateFields([u],{triggerName:o});break}}},this.notifyObservers=function(n,i,a){if(r.subscribable){var u=ve(ve({},a),{},{store:r.getFieldsValue(!0)});r.getFieldEntities().forEach(function(o){var f=o.onStoreChange;f(n,i,u)})}else r.forceRootUpdate()},this.triggerDependenciesUpdate=function(n,i){var a=r.getDependencyChildrenFields(i);return a.length&&r.validateFields(a),r.notifyObservers(n,a,{type:"dependenciesUpdate",relatedFields:[i].concat(wt(a))}),a},this.updateValue=function(n,i){var a=bi(n),u=r.store;r.updateStore(mu(r.store,a,i)),r.notifyObservers(u,[a],{type:"valueUpdate",source:"internal"}),r.notifyWatch([a]);var o=r.triggerDependenciesUpdate(u,a),f=r.callbacks.onValuesChange;if(f){var p=Xk(r.store,[a]);f(p,r.getFieldsValue())}r.triggerOnFieldsChange([a].concat(wt(o)))},this.setFieldsValue=function(n){r.warningUnhooked();var i=r.store;if(n){var a=r0(r.store,n);r.updateStore(a)}r.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),r.notifyWatch()},this.setFieldValue=function(n,i){r.setFields([{name:n,value:i}])},this.getDependencyChildrenFields=function(n){var i=new Set,a=[],u=new rf;r.getFieldEntities().forEach(function(f){var p=f.props.dependencies;(p||[]).forEach(function(v){var y=bi(v);u.update(y,function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return w.add(f),w})})});var o=function f(p){var v=u.get(p)||new Set;v.forEach(function(y){if(!i.has(y)){i.add(y);var w=y.getNamePath();y.isFieldDirty()&&w.length&&(a.push(w),f(w))}})};return o(n),a},this.triggerOnFieldsChange=function(n,i){var a=r.callbacks.onFieldsChange;if(a){var u=r.getFields();if(i){var o=new rf;i.forEach(function(p){var v=p.name,y=p.errors;o.set(v,y)}),u.forEach(function(p){p.errors=o.get(p.name)||p.errors})}var f=u.filter(function(p){var v=p.name;return pm(n,v)});a(f,u)}},this.validateFields=function(n,i){r.warningUnhooked();var a=!!n,u=a?n.map(bi):[],o=[];r.getFieldEntities(!0).forEach(function(v){if(a||u.push(v.getNamePath()),(i==null?void 0:i.recursive)&&a){var y=v.getNamePath();y.every(function(T,R){return n[R]===T||n[R]===void 0})&&u.push(y)}if(!(!v.props.rules||!v.props.rules.length)){var w=v.getNamePath();if(!a||pm(u,w)){var k=v.validateRules(ve({validateMessages:ve(ve({},sO),r.validateMessages)},i));o.push(k.then(function(){return{name:w,errors:[],warnings:[]}}).catch(function(T){var R,A=[],I=[];return(R=T.forEach)===null||R===void 0||R.call(T,function(O){var N=O.rule.warningOnly,L=O.errors;N?I.push.apply(I,wt(L)):A.push.apply(A,wt(L))}),A.length?Promise.reject({name:w,errors:A,warnings:I}):{name:w,errors:A,warnings:I}}))}}});var f=zH(o);r.lastValidatePromise=f,f.catch(function(v){return v}).then(function(v){var y=v.map(function(w){var k=w.name;return k});r.notifyObservers(r.store,y,{type:"validateFinish"}),r.triggerOnFieldsChange(y,v)});var p=f.then(function(){return r.lastValidatePromise===f?Promise.resolve(r.getFieldsValue(u)):Promise.reject([])}).catch(function(v){var y=v.filter(function(w){return w&&w.errors.length});return Promise.reject({values:r.getFieldsValue(u),errorFields:y,outOfDate:r.lastValidatePromise!==f})});return p.catch(function(v){return v}),p},this.submit=function(){r.warningUnhooked(),r.validateFields().then(function(n){var i=r.callbacks.onFinish;if(i)try{i(n)}catch(a){console.error(a)}}).catch(function(n){var i=r.callbacks.onFinishFailed;i&&i(n)})},this.forceRootUpdate=t});function K3(e){var t=C.exports.useRef(),r=C.exports.useState({}),n=Le(r,2),i=n[1];if(!t.current)if(e)t.current=e;else{var a=function(){i({})},u=new LH(a);t.current=u.getForm()}return[t.current]}var o4=C.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),H3=function(t){var r=t.validateMessages,n=t.onFormChange,i=t.onFormFinish,a=t.children,u=C.exports.useContext(o4),o=C.exports.useRef({});return S(o4.Provider,{value:ve(ve({},u),{},{validateMessages:ve(ve({},u.validateMessages),r),triggerFormChange:function(p,v){n&&n(p,{changedFields:v,forms:o.current}),u.triggerFormChange(p,v)},triggerFormFinish:function(p,v){i&&i(p,{values:v,forms:o.current}),u.triggerFormFinish(p,v)},registerForm:function(p,v){p&&(o.current=ve(ve({},o.current),{},se({},p,v))),u.registerForm(p,v)},unregisterForm:function(p){var v=ve({},o.current);delete v[p],o.current=v,u.unregisterForm(p)}}),children:a})},FH=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],$H=function(t,r){var n=t.name,i=t.initialValues,a=t.fields,u=t.form,o=t.preserve,f=t.children,p=t.component,v=p===void 0?"form":p,y=t.validateMessages,w=t.validateTrigger,k=w===void 0?"onChange":w,T=t.onValuesChange,R=t.onFieldsChange,A=t.onFinish,I=t.onFinishFailed,O=Mr(t,FH),N=C.exports.useContext(o4),L=K3(u),B=Le(L,1),j=B[0],G=j.getInternalHooks(Wc),H=G.useSubscribe,te=G.setInitialValues,Y=G.setCallbacks,le=G.setValidateMessages,J=G.setPreserve,Z=G.destroyForm;C.exports.useImperativeHandle(r,function(){return j}),C.exports.useEffect(function(){return N.registerForm(n,j),function(){N.unregisterForm(n)}},[N,j,n]),le(ve(ve({},N.validateMessages),y)),Y({onValuesChange:T,onFieldsChange:function(ke){if(N.triggerFormChange(n,ke),R){for(var ze=arguments.length,Ie=new Array(ze>1?ze-1:0),Ne=1;Ne1)&&(e=1),e}function my(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Gc(e){return e.length===1?"0"+e:String(e)}function eW(e,t,r){return{r:oo(e,255)*255,g:oo(t,255)*255,b:oo(r,255)*255}}function iT(e,t,r){e=oo(e,255),t=oo(t,255),r=oo(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=0,o=(n+i)/2;if(n===i)u=0,a=0;else{var f=n-i;switch(u=o>.5?f/(2-n-i):f/(n+i),n){case e:a=(t-r)/f+(t1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function tW(e,t,r){var n,i,a;if(e=oo(e,360),t=oo(t,100),r=oo(r,100),t===0)i=r,a=r,n=r;else{var u=r<.5?r*(1+t):r+t-r*t,o=2*r-u;n=Vb(o,u,e+1/3),i=Vb(o,u,e),a=Vb(o,u,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function G0(e,t,r){e=oo(e,255),t=oo(t,255),r=oo(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=n,o=n-i,f=n===0?0:o/n;if(n===i)a=0;else{switch(n){case e:a=(t-r)/o+(t>16,g:(e&65280)>>8,b:e&255}}var a4={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 ms(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,u=!1,o=!1;return typeof e=="string"&&(e=lW(e)),typeof e=="object"&&(ml(e.r)&&ml(e.g)&&ml(e.b)?(t=eW(e.r,e.g,e.b),u=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ml(e.h)&&ml(e.s)&&ml(e.v)?(n=my(e.s),i=my(e.v),t=rW(e.h,n,i),u=!0,o="hsv"):ml(e.h)&&ml(e.s)&&ml(e.l)&&(n=my(e.s),a=my(e.l),t=tW(e.h,n,a),u=!0,o="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=wO(r),{ok:u,format:e.format||o,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:r}}var aW="[-\\+]?\\d+%?",sW="[-\\+]?\\d*\\.\\d+%?",Pu="(?:".concat(sW,")|(?:").concat(aW,")"),jb="[\\s|\\(]+(".concat(Pu,")[,|\\s]+(").concat(Pu,")[,|\\s]+(").concat(Pu,")\\s*\\)?"),Ub="[\\s|\\(]+(".concat(Pu,")[,|\\s]+(").concat(Pu,")[,|\\s]+(").concat(Pu,")[,|\\s]+(").concat(Pu,")\\s*\\)?"),cs={CSS_UNIT:new RegExp(Pu),rgb:new RegExp("rgb"+jb),rgba:new RegExp("rgba"+Ub),hsl:new RegExp("hsl"+jb),hsla:new RegExp("hsla"+Ub),hsv:new RegExp("hsv"+jb),hsva:new RegExp("hsva"+Ub),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 lW(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(a4[e])e=a4[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=cs.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=cs.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=cs.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=cs.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=cs.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=cs.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=cs.hex8.exec(e),r?{r:ca(r[1]),g:ca(r[2]),b:ca(r[3]),a:oT(r[4]),format:t?"name":"hex8"}:(r=cs.hex6.exec(e),r?{r:ca(r[1]),g:ca(r[2]),b:ca(r[3]),format:t?"name":"hex"}:(r=cs.hex4.exec(e),r?{r:ca(r[1]+r[1]),g:ca(r[2]+r[2]),b:ca(r[3]+r[3]),a:oT(r[4]+r[4]),format:t?"name":"hex8"}:(r=cs.hex3.exec(e),r?{r:ca(r[1]+r[1]),g:ca(r[2]+r[2]),b:ca(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function ml(e){return Boolean(cs.CSS_UNIT.exec(String(e)))}var Kb=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=oW(t)),this.originalInput=t;var i=ms(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=(n=r.format)!==null&&n!==void 0?n:i.format,this.gradientType=r.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(),r,n,i,a=t.r/255,u=t.g/255,o=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),u<=.03928?n=u/12.92:n=Math.pow((u+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=wO(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=G0(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=G0(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=iT(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=iT(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Z0(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),nW(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),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(oo(r,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(r){return Math.round(oo(r,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="#"+Z0(this.r,this.g,this.b,!1),r=0,n=Object.entries(a4);r=0,a=!r&&i&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||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 r=this.toHsl();return r.l+=t/100,r.l=py(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=py(r.l),new e(r)},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 r=this.toHsl();return r.s-=t/100,r.s=py(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=py(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),i=new e(t).toRgb(),a=r/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return new e(u)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),i=360/r,a=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(new e(n));return a},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 r=this.toHsv(),n=r.h,i=r.s,a=r.v,u=[],o=1/t;t--;)u.push(new e({h:n,s:i,v:a})),a=(a+o)%1;return u},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),i=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/i,g:(r.g*r.a+n.g*n.a*(1-r.a))/i,b:(r.b*r.a+n.b*n.a*(1-r.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 r=this.toHsl(),n=r.h,i=[this],a=360/t,u=1;u=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-vy*t:Math.round(e.h)+vy*t:n=r?Math.round(e.h)+vy*t:Math.round(e.h)-vy*t,n<0?n+=360:n>=360&&(n-=360),n}function uT(e,t,r){if(e.h===0&&e.s===0)return e.s;var n;return r?n=e.s-aT*t:t===SO?n=e.s+aT:n=e.s+uW*t,n>1&&(n=1),r&&t===CO&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function cT(e,t,r){var n;return r?n=e.v+cW*t:n=e.v-dW*t,n>1&&(n=1),Number(n.toFixed(2))}function Km(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],n=ms(e),i=CO;i>0;i-=1){var a=sT(n),u=gy(ms({h:lT(a,i,!0),s:uT(a,i,!0),v:cT(a,i,!0)}));r.push(u)}r.push(gy(n));for(var o=1;o<=SO;o+=1){var f=sT(n),p=gy(ms({h:lT(f,o),s:uT(f,o),v:cT(f,o)}));r.push(p)}return t.theme==="dark"?fW.map(function(v){var y=v.index,w=v.opacity,k=gy(hW(ms(t.backgroundColor||"#141414"),ms(r[y]),w*100));return k}):r}var Hb={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"},Wb={},qb={};Object.keys(Hb).forEach(function(e){Wb[e]=Km(Hb[e]),Wb[e].primary=Wb[e][5],qb[e]=Km(Hb[e],{theme:"dark",backgroundColor:"#141414"}),qb[e].primary=qb[e][5]});function Lo(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Jc(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1}var dT="data-rc-order",pW="rc-util-key",s4=new Map;function EO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):pW}function ax(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function mW(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function kO(e){return Array.from((s4.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function TO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Lo())return null;var r=t.csp,n=t.prepend,i=document.createElement("style");i.setAttribute(dT,mW(n)),r!=null&&r.nonce&&(i.nonce=r==null?void 0:r.nonce),i.innerHTML=e;var a=ax(t),u=a.firstChild;if(n){if(n==="queue"){var o=kO(a).filter(function(f){return["prepend","prependQueue"].includes(f.getAttribute(dT))});if(o.length)return a.insertBefore(i,o[o.length-1].nextSibling),i}a.insertBefore(i,u)}else a.appendChild(i);return i}function PO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=ax(t);return kO(r).find(function(n){return n.getAttribute(EO(t))===e})}function fT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=PO(e,t);if(r){var n=ax(t);n.removeChild(r)}}function vW(e,t){var r=s4.get(e);if(!r||!Jc(document,r)){var n=TO("",t),i=n.parentNode;s4.set(e,i),e.removeChild(n)}}function vv(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=ax(r);vW(n,r);var i=PO(t,r);if(i){var a,u;if((a=r.csp)!==null&&a!==void 0&&a.nonce&&i.nonce!==((u=r.csp)===null||u===void 0?void 0:u.nonce)){var o;i.nonce=(o=r.csp)===null||o===void 0?void 0:o.nonce}return i.innerHTML!==e&&(i.innerHTML=e),i}var f=TO(e,r);return f.setAttribute(EO(r),t),f}function gW(e,t){Bn(e,"[@ant-design/icons] ".concat(t))}function hT(e){return ar(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(ar(e.icon)==="object"||typeof e.icon=="function")}function pT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,r){var n=e[r];switch(r){case"class":t.className=n,delete t.class;break;default:t[r]=n}return t},{})}function l4(e,t,r){return r?tn.createElement(e.tag,ve(ve({key:t},pT(e.attrs)),r),(e.children||[]).map(function(n,i){return l4(n,"".concat(t,"-").concat(e.tag,"-").concat(i))})):tn.createElement(e.tag,ve({key:t},pT(e.attrs)),(e.children||[]).map(function(n,i){return l4(n,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function MO(e){return Km(e)[0]}function IO(e){return e?Array.isArray(e)?e:[e]:[]}var yW=` .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); } } `,xW=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yW,r=C.exports.useContext($3),n=r.csp;C.exports.useEffect(function(){vv(t,"@ant-design-icons",{prepend:!0,csp:n})},[])},_W=["icon","className","onClick","style","primaryColor","secondaryColor"],mm={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function bW(e){var t=e.primaryColor,r=e.secondaryColor;mm.primaryColor=t,mm.secondaryColor=r||MO(t),mm.calculated=!!r}function wW(){return ve({},mm)}var sx=function(t){var r=t.icon,n=t.className,i=t.onClick,a=t.style,u=t.primaryColor,o=t.secondaryColor,f=Mr(t,_W),p=mm;if(u&&(p={primaryColor:u,secondaryColor:o||MO(u)}),xW(),gW(hT(r),"icon should be icon definiton, but got ".concat(r)),!hT(r))return null;var v=r;return v&&typeof v.icon=="function"&&(v=ve(ve({},v),{},{icon:v.icon(p.primaryColor,p.secondaryColor)})),l4(v.icon,"svg-".concat(v.name),ve({className:n,onClick:i,style:a,"data-icon":v.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f))};sx.displayName="IconReact";sx.getTwoToneColors=wW;sx.setTwoToneColors=bW;const q3=sx;function RO(e){var t=IO(e),r=Le(t,2),n=r[0],i=r[1];return q3.setTwoToneColors({primaryColor:n,secondaryColor:i})}function CW(){var e=q3.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var SW=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];RO("#1890ff");var lx=C.exports.forwardRef(function(e,t){var r,n=e.className,i=e.icon,a=e.spin,u=e.rotate,o=e.tabIndex,f=e.onClick,p=e.twoToneColor,v=Mr(e,SW),y=C.exports.useContext($3),w=y.prefixCls,k=w===void 0?"anticon":w,T=y.rootClassName,R=Qe(T,k,(r={},se(r,"".concat(k,"-").concat(i.name),!!i.name),se(r,"".concat(k,"-spin"),!!a||i.name==="loading"),r),n),A=o;A===void 0&&f&&(A=-1);var I=u?{msTransform:"rotate(".concat(u,"deg)"),transform:"rotate(".concat(u,"deg)")}:void 0,O=IO(p),N=Le(O,2),L=N[0],B=N[1];return S("span",{...ve(ve({role:"img","aria-label":i.name},v),{},{ref:t,tabIndex:A,onClick:f,className:R}),children:S(q3,{icon:i,primaryColor:L,secondaryColor:B,style:I})})});lx.displayName="AntdIcon";lx.getTwoToneColor=CW;lx.setTwoToneColor=RO;const dn=lx;var OO=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:YH})})};OO.displayName="CheckCircleFilled";const ux=C.exports.forwardRef(OO);var EW={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 kW=EW;var AO=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:kW})})};AO.displayName="CloseCircleFilled";const gd=C.exports.forwardRef(AO);var TW={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 PW=TW;var NO=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:PW})})};NO.displayName="ExclamationCircleFilled";const cx=C.exports.forwardRef(NO);var MW={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 IW=MW;var zO=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:IW})})};zO.displayName="InfoCircleFilled";const DO=C.exports.forwardRef(zO);var RW={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 OW=RW;var LO=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:OW})})};LO.displayName="LoadingOutlined";const Wf=C.exports.forwardRef(LO);var gv=ve({},Dj),AW=gv.version,NW=gv.render,zW=gv.unmountComponentAtNode,dx;try{var DW=Number((AW||"").split(".")[0]);DW>=18&&(dx=gv.createRoot)}catch{}function mT(e){var t=gv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&ar(t)==="object"&&(t.usingClientEntryPoint=e)}var X0="__rc_react_root__";function LW(e,t){mT(!0);var r=t[X0]||dx(t);mT(!1),r.render(e),t[X0]=r}function FW(e,t){NW(e,t)}function FO(e,t){if(dx){LW(e,t);return}FW(e,t)}function $W(e){return u4.apply(this,arguments)}function u4(){return u4=vd(Do().mark(function e(t){return Do().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var i;(i=t[X0])===null||i===void 0||i.unmount(),delete t[X0]}));case 1:case"end":return n.stop()}},e)})),u4.apply(this,arguments)}function BW(e){zW(e)}function $O(e){return c4.apply(this,arguments)}function c4(){return c4=vd(Do().mark(function e(t){return Do().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(dx===void 0){n.next=2;break}return n.abrupt("return",$W(t));case 2:BW(t);case 3:case"end":return n.stop()}},e)})),c4.apply(this,arguments)}function vT(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit".concat(e)]="webkit".concat(t),r["Moz".concat(e)]="moz".concat(t),r["ms".concat(e)]="MS".concat(t),r["O".concat(e)]="o".concat(t.toLowerCase()),r}function VW(e,t){var r={animationend:vT("Animation","AnimationEnd"),transitionend:vT("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete r.animationend.animation,"TransitionEvent"in t||delete r.transitionend.transition),r}var jW=VW(Lo(),typeof window<"u"?window:{}),BO={};if(Lo()){var UW=document.createElement("div");BO=UW.style}var yy={};function VO(e){if(yy[e])return yy[e];var t=jW[e];if(t)for(var r=Object.keys(t),n=r.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:1;bT+=1;var n=bT;function i(a){if(a===0)qO(n),t();else{var u=HO(function(){i(a-1)});Z3.set(n,u)}}return i(r),n};rn.cancel=function(e){var t=Z3.get(e);return qO(t),WO(t)};const KW=function(){var e=C.exports.useRef(null);function t(){rn.cancel(e.current)}function r(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=rn(function(){i<=1?n({isCanceled:function(){return a!==e.current}}):r(n,i-1)});e.current=a}return C.exports.useEffect(function(){return function(){t()}},[]),[r,t]};var GO=Lo()?C.exports.useLayoutEffect:C.exports.useEffect,wT=[_l,wf,Cf,G3],ZO=!1,HW=!0;function XO(e){return e===Cf||e===G3}const WW=function(e,t){var r=Hs(_T),n=Le(r,2),i=n[0],a=n[1],u=KW(),o=Le(u,2),f=o[0],p=o[1];function v(){a(_l,!0)}return GO(function(){if(i!==_T&&i!==G3){var y=wT.indexOf(i),w=wT[y+1],k=t(i);k===ZO?a(w,!0):f(function(T){function R(){T.isCanceled()||a(w,!0)}k===!0?R():Promise.resolve(k).then(R)})}},[e,i]),C.exports.useEffect(function(){return function(){p()}},[]),[v,i]},qW=function(e){var t=C.exports.useRef(),r=C.exports.useRef(e);r.current=e;var n=C.exports.useCallback(function(u){r.current(u)},[]);function i(u){u&&(u.removeEventListener(yT,n),u.removeEventListener(gT,n))}function a(u){t.current&&t.current!==u&&i(t.current),u&&u!==t.current&&(u.addEventListener(yT,n),u.addEventListener(gT,n),t.current=u)}return C.exports.useEffect(function(){return function(){i(t.current)}},[]),[a,i]};function GW(e,t,r,n){var i=n.motionEnter,a=i===void 0?!0:i,u=n.motionAppear,o=u===void 0?!0:u,f=n.motionLeave,p=f===void 0?!0:f,v=n.motionDeadline,y=n.motionLeaveImmediately,w=n.onAppearPrepare,k=n.onEnterPrepare,T=n.onLeavePrepare,R=n.onAppearStart,A=n.onEnterStart,I=n.onLeaveStart,O=n.onAppearActive,N=n.onEnterActive,L=n.onLeaveActive,B=n.onAppearEnd,j=n.onEnterEnd,G=n.onLeaveEnd,H=n.onVisibleChanged,te=Hs(),Y=Le(te,2),le=Y[0],J=Y[1],Z=Hs(lf),Q=Le(Z,2),ge=Q[0],ne=Q[1],de=Hs(null),oe=Le(de,2),ye=oe[0],Re=oe[1],Te=C.exports.useRef(!1),ke=C.exports.useRef(null);function ze(){return r()}var Ie=C.exports.useRef(!1);function Ne(Ct){var Dt=ze();if(!(Ct&&!Ct.deadline&&Ct.target!==Dt)){var lt=Ie.current,dt;ge===xy&<?dt=B==null?void 0:B(Dt,Ct):ge===_y&<?dt=j==null?void 0:j(Dt,Ct):ge===by&<&&(dt=G==null?void 0:G(Dt,Ct)),ge!==lf&<&&dt!==!1&&(ne(lf,!0),Re(null,!0))}}var De=qW(Ne),Ve=Le(De,1),Ge=Ve[0],je=C.exports.useMemo(function(){var Ct,Dt,lt;switch(ge){case xy:return Ct={},se(Ct,_l,w),se(Ct,wf,R),se(Ct,Cf,O),Ct;case _y:return Dt={},se(Dt,_l,k),se(Dt,wf,A),se(Dt,Cf,N),Dt;case by:return lt={},se(lt,_l,T),se(lt,wf,I),se(lt,Cf,L),lt;default:return{}}},[ge]),ct=WW(ge,function(Ct){if(Ct===_l){var Dt=je[_l];return Dt?Dt(ze()):ZO}if(Ye in je){var lt;Re(((lt=je[Ye])===null||lt===void 0?void 0:lt.call(je,ze(),null))||null)}return Ye===Cf&&(Ge(ze()),v>0&&(clearTimeout(ke.current),ke.current=setTimeout(function(){Ne({deadline:!0})},v))),HW}),pt=Le(ct,2),Tt=pt[0],Ye=pt[1],Pt=XO(Ye);Ie.current=Pt,GO(function(){J(t);var Ct=Te.current;if(Te.current=!0,!!e){var Dt;!Ct&&t&&o&&(Dt=xy),Ct&&t&&a&&(Dt=_y),(Ct&&!t&&p||!Ct&&y&&!t&&p)&&(Dt=by),Dt&&(ne(Dt),Tt())}},[t]),C.exports.useEffect(function(){(ge===xy&&!o||ge===_y&&!a||ge===by&&!p)&&ne(lf)},[o,a,p]),C.exports.useEffect(function(){return function(){Te.current=!1,clearTimeout(ke.current)}},[]);var mt=C.exports.useRef(!1);C.exports.useEffect(function(){le&&(mt.current=!0),le!==void 0&&ge===lf&&((mt.current||le)&&(H==null||H(le)),mt.current=!0)},[le,ge]);var It=ye;return je[_l]&&Ye===wf&&(It=ve({transition:"none"},It)),[ge,Ye,It,le!=null?le:t]}var ZW=function(e){vi(r,e);var t=gi(r);function r(){return Qn(this,r),t.apply(this,arguments)}return Jn(r,[{key:"render",value:function(){return this.props.children}}]),r}(C.exports.Component);function XW(e){var t=e;ar(e)==="object"&&(t=e.transitionSupport);function r(i){return!!(i.motionName&&t)}var n=C.exports.forwardRef(function(i,a){var u=i.visible,o=u===void 0?!0:u,f=i.removeOnLeave,p=f===void 0?!0:f,v=i.forceRender,y=i.children,w=i.motionName,k=i.leavedClassName,T=i.eventProps,R=r(i),A=C.exports.useRef(),I=C.exports.useRef();function O(){try{return A.current instanceof HTMLElement?A.current:jm(I.current)}catch{return null}}var N=GW(R,o,O,i),L=Le(N,4),B=L[0],j=L[1],G=L[2],H=L[3],te=C.exports.useRef(H);H&&(te.current=!0);var Y=C.exports.useCallback(function(de){A.current=de,H0(a,de)},[a]),le,J=ve(ve({},T),{},{visible:o});if(!y)le=null;else if(B===lf||!r(i))H?le=y(ve({},J),Y):!p&&te.current&&k?le=y(ve(ve({},J),{},{className:k}),Y):v||!p&&!k?le=y(ve(ve({},J),{},{style:{display:"none"}}),Y):le=null;else{var Z,Q;j===_l?Q="prepare":XO(j)?Q="active":j===wf&&(Q="start"),le=y(ve(ve({},J),{},{className:Qe(xT(w,B),(Z={},se(Z,xT(w,"".concat(B,"-").concat(Q)),Q),se(Z,w,typeof w=="string"),Z)),style:G}),Y)}if(C.exports.isValidElement(le)&&md(le)){var ge=le,ne=ge.ref;ne||(le=C.exports.cloneElement(le,{ref:Y}))}return S(ZW,{ref:I,children:le})});return n.displayName="CSSMotion",n}const Za=XW(KO);var d4="add",f4="keep",h4="remove",Gb="removed";function YW(e){var t;return e&&ar(e)==="object"&&"key"in e?t=e:t={key:e},ve(ve({},t),{},{key:String(t.key)})}function p4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(YW)}function QW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=[],n=0,i=t.length,a=p4(e),u=p4(t);a.forEach(function(p){for(var v=!1,y=n;y1});return f.forEach(function(p){r=r.filter(function(v){var y=v.key,w=v.status;return y!==p||w!==h4}),r.forEach(function(v){v.key===p&&(v.status=f4)})}),r}var JW=["component","children","onVisibleChanged","onAllRemoved"],eq=["status"],tq=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function rq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Za,r=function(n){vi(a,n);var i=gi(a);function a(){var u;Qn(this,a);for(var o=arguments.length,f=new Array(o),p=0;p=w&&(y.key=A[0].notice.key,y.updateMark=ST(),y.userPassKey=v,A.shift()),A.push({notice:y,holderCallback:f})),{notices:A}})},n.remove=function(o){n.setState(function(f){var p=f.notices;return{notices:p.filter(function(v){var y=v.notice,w=y.key,k=y.userPassKey,T=k!=null?k:w;return T!==o})}})},n.noticePropsMap={},n}return Jn(r,[{key:"getTransitionName",value:function(){var i=this.props,a=i.prefixCls,u=i.animation,o=this.props.transitionName;return!o&&u&&(o="".concat(a,"-").concat(u)),o}},{key:"render",value:function(){var i=this,a=this.state.notices,u=this.props,o=u.prefixCls,f=u.className,p=u.closeIcon,v=u.style,y=[];return a.forEach(function(w,k){var T=w.notice,R=w.holderCallback,A=k===a.length-1?T.updateMark:void 0,I=T.key,O=T.userPassKey,N=ve(ve(ve({prefixCls:o,closeIcon:p},T),T.props),{},{key:I,noticeKey:O||I,updateMark:A,onClose:function(B){var j;i.remove(B),(j=T.onClose)===null||j===void 0||j.call(T)},onClick:T.onClick,children:T.content});y.push(I),i.noticePropsMap[I]={props:N,holderCallback:R}}),S("div",{className:Qe(o,f),style:v,children:S(YO,{keys:y,motionName:this.getTransitionName(),onVisibleChanged:function(k,T){var R=T.key;k||delete i.noticePropsMap[R]},children:function(w){var k=w.key,T=w.className,R=w.style,A=w.visible,I=i.noticePropsMap[k],O=I.props,N=I.holderCallback;return N?S("div",{className:Qe(T,"".concat(o,"-hook-holder")),style:ve({},R),ref:function(B){typeof k>"u"||(B?(i.hookRefs.set(k,B),N(B,O)):i.hookRefs.delete(k))}},k):S(X3,{...O,className:Qe(T,O==null?void 0:O.className),style:ve(ve({},R),O==null?void 0:O.style),visible:A})}})})}}]),r}(C.exports.Component);qf.newInstance=void 0;qf.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}};qf.newInstance=function(t,r){var n=t||{},i=n.getContainer,a=Mr(n,nq),u=document.createElement("div");if(i){var o=i();o.appendChild(u)}else document.body.appendChild(u);var f=!1;function p(v){f||(f=!0,r({notice:function(w){v.add(w)},removeNotice:function(w){v.remove(w)},component:v,destroy:function(){$O(u),u.parentNode&&u.parentNode.removeChild(u)},useNotification:function(){return Y3(v)}}))}FO(S(qf,{...a,ref:p}),u)};function oq(e,t){var r=function(){var i,a,u=null,o={add:function(R,A){u==null||u.component.add(R,A)}},f=Y3(o),p=Le(f,2),v=p[0],y=p[1];function w(T){var R=T.prefixCls,A=i("message",R),I=i(),O=T.key||oA(),N=new Promise(function(B){var j=function(){return typeof T.onClose=="function"&&T.onClose(),B(!0)};e(tt(tt({},T),{prefixCls:A,rootPrefixCls:I,getPopupContainer:a}),function(G){var H=G.prefixCls,te=G.instance;u=te,v(t(tt(tt({},T),{key:O,onClose:j}),H))})}),L=function(){u&&u.removeNotice(O)};return L.then=function(B,j){return N.then(B,j)},L.promise=N,L}var k=C.exports.useRef({});return k.current.open=w,lA.forEach(function(T){return cA(k.current,T)}),[k.current,S(tc,{children:function(T){return i=T.getPrefixCls,a=T.getPopupContainer,y}},"holder")]};return r}var Oo,QO=3,JO,aq=1,eA="",m4="move-up",tA=!1,rA,nA,iA=!1;function oA(){return aq++}function sq(e){e.top!==void 0&&(JO=e.top,Oo=null),e.duration!==void 0&&(QO=e.duration),e.prefixCls!==void 0&&(eA=e.prefixCls),e.getContainer!==void 0&&(rA=e.getContainer,Oo=null),e.transitionName!==void 0&&(m4=e.transitionName,Oo=null,tA=!0),e.maxCount!==void 0&&(nA=e.maxCount,Oo=null),e.rtl!==void 0&&(iA=e.rtl)}function aA(e,t){var r=e.prefixCls,n=e.getPopupContainer,i=tS(),a=i.getPrefixCls,u=i.getRootPrefixCls,o=i.getIconPrefixCls,f=a("message",r||eA),p=u(e.rootPrefixCls,f),v=o();if(Oo){t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:Oo});return}var y={prefixCls:f,transitionName:tA?m4:"".concat(p,"-").concat(m4),style:{top:JO},getContainer:rA||n,maxCount:nA};qf.newInstance(y,function(w){if(Oo){t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:Oo});return}Oo=w,t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:w})})}var sA={info:DO,success:ux,error:gd,warning:cx,loading:Wf},lA=Object.keys(sA);function uA(e,t,r){var n,i=e.duration!==void 0?e.duration:QO,a=sA[e.type],u=Qe("".concat(t,"-custom-content"),(n={},se(n,"".concat(t,"-").concat(e.type),e.type),se(n,"".concat(t,"-rtl"),iA===!0),n));return{key:e.key,duration:i,style:e.style||{},className:e.className,content:S(mh,{iconPrefixCls:r,children:Xe("div",{className:u,children:[e.icon||a&&S(a,{}),S("span",{children:e.content})]})}),onClose:e.onClose,onClick:e.onClick}}function lq(e){var t=e.key||oA(),r=new Promise(function(i){var a=function(){return typeof e.onClose=="function"&&e.onClose(),i(!0)};aA(e,function(u){var o=u.prefixCls,f=u.iconPrefixCls,p=u.instance;p.notice(uA(tt(tt({},e),{key:t,onClose:a}),o,f))})}),n=function(){var a;Oo&&(Oo.removeNotice(t),(a=e.onClose)===null||a===void 0||a.call(e))};return n.then=function(i,a){return r.then(i,a)},n.promise=r,n}function uq(e){return Object.prototype.toString.call(e)==="[object Object]"&&!!e.content}var Hm={open:lq,config:sq,destroy:function(t){if(Oo)if(t){var r=Oo,n=r.removeNotice;n(t)}else{var i=Oo,a=i.destroy;a(),Oo=null}}};function cA(e,t){e[t]=function(r,n,i){return uq(r)?e.open(tt(tt({},r),{type:t})):(typeof n=="function"&&(i=n,n=void 0),e.open({content:r,duration:n,type:t,onClose:i}))}}lA.forEach(function(e){return cA(Hm,e)});Hm.warn=Hm.warning;Hm.useMessage=oq(aA,uA);const cq=Hm;var dq={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 fq=dq;var dA=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:fq})})};dA.displayName="CheckCircleOutlined";const Q3=C.exports.forwardRef(dA);var hq={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 pq=hq;var fA=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:pq})})};fA.displayName="CloseCircleOutlined";const J3=C.exports.forwardRef(fA);var mq={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 vq=mq;var hA=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:vq})})};hA.displayName="CloseOutlined";const fx=C.exports.forwardRef(hA);var gq={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 yq=gq;var pA=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:yq})})};pA.displayName="ExclamationCircleOutlined";const hx=C.exports.forwardRef(pA);var xq={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 _q=xq;var mA=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:_q})})};mA.displayName="InfoCircleOutlined";const eS=C.exports.forwardRef(mA);function bq(e,t){var r=function(){var i,a=null,u={add:function(T,R){a==null||a.component.add(T,R)}},o=Y3(u),f=Le(o,2),p=f[0],v=f[1];function y(k){var T=k.prefixCls,R=i("notification",T);e(tt(tt({},k),{prefixCls:R}),function(A){var I=A.prefixCls,O=A.instance;a=O,p(t(k,I))})}var w=C.exports.useRef({});return w.current.open=y,["success","info","warning","error"].forEach(function(k){w.current[k]=function(T){return w.current.open(tt(tt({},T),{type:k}))}}),[w.current,S(tc,{children:function(k){return i=k.getPrefixCls,v}},"holder")]};return r}globalThis&&globalThis.__awaiter;var Vc={},vA=4.5,gA=24,yA=24,xA="",v4="topRight",_A,bA,wA=!1,CA;function wq(e){var t=e.duration,r=e.placement,n=e.bottom,i=e.top,a=e.getContainer,u=e.closeIcon,o=e.prefixCls;o!==void 0&&(xA=o),t!==void 0&&(vA=t),r!==void 0?v4=r:e.rtl&&(v4="topLeft"),n!==void 0&&(yA=n),i!==void 0&&(gA=i),a!==void 0&&(_A=a),u!==void 0&&(bA=u),e.rtl!==void 0&&(wA=e.rtl),e.maxCount!==void 0&&(CA=e.maxCount)}function Cq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gA,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yA,n;switch(e){case"top":n={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":n={left:0,top:t,bottom:"auto"};break;case"topRight":n={right:0,top:t,bottom:"auto"};break;case"bottom":n={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:r};break;case"bottomLeft":n={left:0,top:"auto",bottom:r};break;default:n={right:0,top:"auto",bottom:r};break}return n}function SA(e,t){var r=e.placement,n=r===void 0?v4:r,i=e.top,a=e.bottom,u=e.getContainer,o=u===void 0?_A:u,f=e.prefixCls,p=tS(),v=p.getPrefixCls,y=p.getIconPrefixCls,w=v("notification",f||xA),k=y(),T="".concat(w,"-").concat(n),R=Vc[T];if(R){Promise.resolve(R).then(function(I){t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:k,instance:I})});return}var A=Qe("".concat(w,"-").concat(n),se({},"".concat(w,"-rtl"),wA===!0));Vc[T]=new Promise(function(I){qf.newInstance({prefixCls:w,className:A,style:Cq(n,i,a),getContainer:o,maxCount:CA},function(O){I(O),t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:k,instance:O})})})}var Sq={success:Q3,info:eS,error:J3,warning:hx};function EA(e,t,r){var n=e.duration,i=e.icon,a=e.type,u=e.description,o=e.message,f=e.btn,p=e.onClose,v=e.onClick,y=e.key,w=e.style,k=e.className,T=e.closeIcon,R=T===void 0?bA:T,A=e.props,I=n===void 0?vA:n,O=null;i?O=S("span",{className:"".concat(t,"-icon"),children:e.icon}):a&&(O=C.exports.createElement(Sq[a]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(a)}));var N=S("span",{className:"".concat(t,"-close-x"),children:R||S(fx,{className:"".concat(t,"-close-icon")})}),L=!u&&O?S("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:S(mh,{iconPrefixCls:r,children:Xe("div",{className:O?"".concat(t,"-with-icon"):"",role:"alert",children:[O,Xe("div",{className:"".concat(t,"-message"),children:[L,o]}),S("div",{className:"".concat(t,"-description"),children:u}),f?S("span",{className:"".concat(t,"-btn"),children:f}):null]})}),duration:I,closable:!0,closeIcon:N,onClose:p,onClick:v,key:y,style:w||{},className:Qe(k,se({},"".concat(t,"-").concat(a),!!a)),props:A}}function Eq(e){SA(e,function(t){var r=t.prefixCls,n=t.iconPrefixCls,i=t.instance;i.notice(EA(e,r,n))})}var Gf={open:Eq,close:function(t){Object.keys(Vc).forEach(function(r){return Promise.resolve(Vc[r]).then(function(n){n.removeNotice(t)})})},config:wq,destroy:function(){Object.keys(Vc).forEach(function(t){Promise.resolve(Vc[t]).then(function(r){r.destroy()}),delete Vc[t]})}};["success","info","warning","error"].forEach(function(e){Gf[e]=function(t){return Gf.open(tt(tt({},t),{type:e}))}});Gf.warn=Gf.warning;Gf.useNotification=bq(SA,EA);const kq=Gf;var Tq=function(t,r){return r||(t?"ant-".concat(t):"ant")},zr=C.exports.createContext({getPrefixCls:Tq}),tc=zr.Consumer,Pq="-ant-".concat(Date.now(),"-").concat(Math.random());function Mq(e,t){var r={},n=function(v,y){var w=v.clone();return w=(y==null?void 0:y(w))||w,w.toRgbString()},i=function(v,y){var w=new Kb(v),k=Km(w.toRgbString());r["".concat(y,"-color")]=n(w),r["".concat(y,"-color-disabled")]=k[1],r["".concat(y,"-color-hover")]=k[4],r["".concat(y,"-color-active")]=k[6],r["".concat(y,"-color-outline")]=w.clone().setAlpha(.2).toRgbString(),r["".concat(y,"-color-deprecated-bg")]=k[0],r["".concat(y,"-color-deprecated-border")]=k[2]};if(t.primaryColor){i(t.primaryColor,"primary");var a=new Kb(t.primaryColor),u=Km(a.toRgbString());u.forEach(function(p,v){r["primary-".concat(v+1)]=p}),r["primary-color-deprecated-l-35"]=n(a,function(p){return p.lighten(35)}),r["primary-color-deprecated-l-20"]=n(a,function(p){return p.lighten(20)}),r["primary-color-deprecated-t-20"]=n(a,function(p){return p.tint(20)}),r["primary-color-deprecated-t-50"]=n(a,function(p){return p.tint(50)}),r["primary-color-deprecated-f-12"]=n(a,function(p){return p.setAlpha(p.getAlpha()*.12)});var o=new Kb(u[0]);r["primary-color-active-deprecated-f-30"]=n(o,function(p){return p.setAlpha(p.getAlpha()*.3)}),r["primary-color-active-deprecated-d-02"]=n(o,function(p){return p.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 f=Object.keys(r).map(function(p){return"--".concat(e,"-").concat(p,": ").concat(r[p],";")});return` :root { `.concat(f.join(` `),` } `).trim()}function Iq(e,t){var r=Mq(e,t);Lo()&&vv(r,"".concat(Pq,"-dynamic-theme"))}var g4=C.exports.createContext(!1),kA=function(t){var r=t.children,n=t.disabled,i=C.exports.useContext(g4);return S(g4.Provider,{value:n!=null?n:i,children:r})};const rc=g4;var y4=C.exports.createContext(void 0),TA=function(t){var r=t.children,n=t.size;return S(y4.Consumer,{children:function(i){return S(y4.Provider,{value:n||i,children:r})}})};const Gs=y4;var Rq=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form"],Oq="ant",Aq="anticon",Y0,PA;function i0(){return Y0||Oq}function Nq(){return PA||Aq}var zq=function(t){var r=t.prefixCls,n=t.iconPrefixCls,i=t.theme;r!==void 0&&(Y0=r),n!==void 0&&(PA=n),i&&Iq(i0(),i)},tS=function(){return{getPrefixCls:function(r,n){return n||(r?"".concat(i0(),"-").concat(r):i0())},getIconPrefixCls:Nq,getRootPrefixCls:function(r,n){return r||Y0||(n&&n.includes("-")?n.replace(/^(.*)-[^-]*$/,"$1"):i0())}}},Dq=function(t){var r,n,i=t.children,a=t.csp,u=t.autoInsertSpaceInButton,o=t.form,f=t.locale,p=t.componentSize,v=t.direction,y=t.space,w=t.virtual,k=t.dropdownMatchSelectWidth,T=t.legacyLocale,R=t.parentContext,A=t.iconPrefixCls,I=t.componentDisabled,O=C.exports.useCallback(function(H,te){var Y=t.prefixCls;if(te)return te;var le=Y||R.getPrefixCls("");return H?"".concat(le,"-").concat(H):le},[R.getPrefixCls,t.prefixCls]),N=tt(tt({},R),{csp:a,autoInsertSpaceInButton:u,locale:f||T,direction:v,space:y,virtual:w,dropdownMatchSelectWidth:k,getPrefixCls:O});Rq.forEach(function(H){var te=t[H];te&&(N[H]=te)});var L=hv(function(){return N},N,function(H,te){var Y=Object.keys(H),le=Object.keys(te);return Y.length!==le.length||Y.some(function(J){return H[J]!==te[J]})}),B=C.exports.useMemo(function(){return{prefixCls:A,csp:a}},[A,a]),j=i,G={};return f&&(G=((r=f.Form)===null||r===void 0?void 0:r.defaultValidateMessages)||((n=Nl.Form)===null||n===void 0?void 0:n.defaultValidateMessages)||{}),o&&o.validateMessages&&(G=tt(tt({},G),o.validateMessages)),Object.keys(G).length>0&&(j=S(H3,{validateMessages:G,children:i})),f&&(j=S(GH,{locale:f,_ANT_MARK__:WH,children:j})),(A||a)&&(j=S($3.Provider,{value:B,children:j})),p&&(j=S(TA,{size:p,children:j})),I!==void 0&&(j=S(kA,{disabled:I,children:j})),S(zr.Provider,{value:L,children:j})},mh=function(t){return C.exports.useEffect(function(){t.direction&&(cq.config({rtl:t.direction==="rtl"}),kq.config({rtl:t.direction==="rtl"}))},[t.direction]),S(mv,{children:function(r,n,i){return S(tc,{children:function(a){return S(Dq,{parentContext:a,legacyLocale:i,...t})}})}})};mh.ConfigContext=zr;mh.SizeContext=Gs;mh.config=zq;function kl(e,t,r,n){var i=ad.unstable_batchedUpdates?function(u){ad.unstable_batchedUpdates(r,u)}:r;return e.addEventListener&&e.addEventListener(t,i,n),{remove:function(){e.removeEventListener&&e.removeEventListener(t,i,n)}}}function MA(e){return Object.keys(e).reduce(function(t,r){return(r.startsWith("data-")||r.startsWith("aria-")||r==="role")&&!r.startsWith("data-__")&&(t[r]=e[r]),t},{})}var Yo=C.exports.isValidElement;function IA(e){return e&&Yo(e)&&e.type===C.exports.Fragment}function RA(e,t,r){return Yo(e)?C.exports.cloneElement(e,typeof r=="function"?r(e.props||{}):r):t}function Ni(e,t){return RA(e,e,t)}var Lq=function(e){vi(r,e);var t=gi(r);function r(){var n;return Qn(this,r),n=t.apply(this,arguments),n.state={error:void 0,info:{componentStack:""}},n}return Jn(r,[{key:"componentDidCatch",value:function(i,a){this.setState({error:i,info:a})}},{key:"render",value:function(){var i=this.props,a=i.message,u=i.description,o=i.children,f=this.state,p=f.error,v=f.info,y=v&&v.componentStack?v.componentStack:null,w=typeof a>"u"?(p||"").toString():a,k=typeof u>"u"?y:u;return p?S(px,{type:"error",message:w,description:S("pre",{children:k})}):o}}]),r}(C.exports.Component);const Fq=Lq;var $q=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i"u")return 0;var i=t?"scrollTop":"scrollLeft",a=0;return x4(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[i]:(e instanceof HTMLElement||e)&&(a=e[i]),e&&!x4(e)&&typeof a!="number"&&(a=(n=((r=e.ownerDocument)!==null&&r!==void 0?r:e).documentElement)===null||n===void 0?void 0:n[i]),a}function Hq(e,t,r,n){var i=r-t;return e/=n/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function Wq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.getContainer,n=r===void 0?function(){return window}:r,i=t.callback,a=t.duration,u=a===void 0?450:a,o=n(),f=Kq(o,!0),p=Date.now(),v=function y(){var w=Date.now(),k=w-p,T=Hq(k>u?u:k,f,e,u);x4(o)?o.scrollTo(window.pageXOffset,T):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=T:o.scrollTop=T,k"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 Et={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 r=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||r>=Et.F1&&r<=Et.F12)return!1;switch(r){case Et.ALT:case Et.CAPS_LOCK:case Et.CONTEXT_MENU:case Et.CTRL:case Et.DOWN:case Et.END:case Et.ESC:case Et.HOME:case Et.INSERT:case Et.LEFT:case Et.MAC_FF_META:case Et.META:case Et.NUMLOCK:case Et.NUM_CENTER:case Et.PAGE_DOWN:case Et.PAGE_UP:case Et.PAUSE:case Et.PRINT_SCREEN:case Et.RIGHT:case Et.SHIFT:case Et.UP:case Et.WIN_KEY:case Et.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=Et.ZERO&&t<=Et.NINE||t>=Et.NUM_ZERO&&t<=Et.NUM_MULTIPLY||t>=Et.A&&t<=Et.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case Et.SPACE:case Et.QUESTION_MARK:case Et.NUM_PLUS:case Et.NUM_MINUS:case Et.NUM_PERIOD:case Et.NUM_DIVISION:case Et.SEMICOLON:case Et.DASH:case Et.EQUALS:case Et.COMMA:case Et.PERIOD:case Et.SLASH:case Et.APOSTROPHE:case Et.SINGLE_QUOTE:case Et.OPEN_SQUARE_BRACKET:case Et.BACKSLASH:case Et.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},NA=C.exports.createContext(null);function zA(){return C.exports.useContext(NA)}function qq(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=C.exports.useState(!1),r=Le(t,2),n=r[0],i=r[1],a=C.exports.useRef(null),u=function(){window.clearTimeout(a.current)};C.exports.useEffect(function(){return u},[]);var o=function(p,v){u(),a.current=window.setTimeout(function(){i(p),v&&v()},e)};return[n,o,u]}function DA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=C.exports.useRef(null),r=C.exports.useRef(null);C.exports.useEffect(function(){return function(){window.clearTimeout(r.current)}},[]);function n(i){(i||t.current===null)&&(t.current=i),window.clearTimeout(r.current),r.current=window.setTimeout(function(){t.current=null},e)}return[function(){return t.current},n]}function Gq(e,t,r,n){var i=C.exports.useRef(null);i.current={open:t,triggerOpen:r,customizedTrigger:n},C.exports.useEffect(function(){function a(u){var o;if(!((o=i.current)!==null&&o!==void 0&&o.customizedTrigger)){var f=u.target;f.shadowRoot&&u.composed&&(f=u.composedPath()[0]||f),i.current.open&&e().filter(function(p){return p}).every(function(p){return!p.contains(f)&&p!==f})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",a),function(){return window.removeEventListener("mousedown",a)}},[])}var Zq=`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`,Xq=`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`,Yq="".concat(Zq," ").concat(Xq).split(/[\s\n]+/),Qq="aria-",Jq="data-";function kT(e,t){return e.indexOf(t)===0}function Wu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r;t===!1?r={aria:!0,data:!0,attr:!0}:t===!0?r={aria:!0}:r=ve({},t);var n={};return Object.keys(e).forEach(function(i){(r.aria&&(i==="role"||kT(i,Qq))||r.data&&kT(i,Jq)||r.attr&&Yq.includes(i))&&(n[i]=e[i])}),n}var eG=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],nf=void 0;function tG(e,t){var r=e.prefixCls,n=e.invalidate,i=e.item,a=e.renderItem,u=e.responsive,o=e.responsiveDisabled,f=e.registerSize,p=e.itemKey,v=e.className,y=e.style,w=e.children,k=e.display,T=e.order,R=e.component,A=R===void 0?"div":R,I=Mr(e,eG),O=u&&!k;function N(H){f(p,H)}C.exports.useEffect(function(){return function(){N(null)}},[]);var L=a&&i!==nf?a(i):w,B;n||(B={opacity:O?0:1,height:O?0:nf,overflowY:O?"hidden":nf,order:u?T:nf,pointerEvents:O?"none":nf,position:O?"absolute":nf});var j={};O&&(j["aria-hidden"]=!0);var G=S(A,{className:Qe(!n&&r,v),style:ve(ve({},B),y),...j,...I,ref:t,children:L});return u&&(G=S(Ul,{onResize:function(te){var Y=te.offsetWidth;N(Y)},disabled:o,children:G})),G}var vm=C.exports.forwardRef(tG);vm.displayName="Item";function rG(){var e=Hs({}),t=Le(e,2),r=t[1],n=C.exports.useRef([]),i=0,a=0;function u(o){var f=i;i+=1,n.current.lengthT,qe=C.exports.useMemo(function(){var ot=a;return jt?le===null&&H?ot=a:ot=a.slice(0,Math.min(a.length,Z/v)):typeof T=="number"&&(ot=a.slice(0,T)),ot},[a,v,le,T,jt]),Xt=C.exports.useMemo(function(){return jt?a.slice(Dt+1):a.slice(qe.length)},[a,qe,jt,Dt]),cr=C.exports.useCallback(function(ot,ht){var Ot;return typeof f=="function"?f(ot):(Ot=f&&(ot==null?void 0:ot[f]))!==null&&Ot!==void 0?Ot:ht},[f]),Vt=C.exports.useCallback(u||function(ot){return ot},[u]);function Ut(ot,ht,Ot){It===ot&&(ht===void 0||ht===Tt)||(Ct(ot),Ot||(it(otZ){Ut($t-1,ot-ur-Ge+Ie);break}}I&&qt(0)+Ge>Z&&Ye(null)}},[Z,ne,Ie,Ge,cr,qe]);var or=ut&&!!Xt.length,$r={};Tt!==null&&jt&&($r={position:"absolute",left:Tt,top:0});var Er={prefixCls:ft,responsive:jt,component:L,invalidate:Qt},Lt=o?function(ot,ht){var Ot=cr(ot,ht);return S(Q0.Provider,{value:ve(ve({},Er),{},{order:ht,item:ot,itemKey:Ot,registerSize:xr,display:ht<=Dt}),children:o(ot,ht)},Ot)}:function(ot,ht){var Ot=cr(ot,ht);return C.exports.createElement(vm,{...Er,order:ht,key:Ot,item:ot,renderItem:Vt,itemKey:Ot,registerSize:xr,display:ht<=Dt})},kr,wr={order:or?Dt:Number.MAX_SAFE_INTEGER,className:"".concat(ft,"-rest"),registerSize:Or,display:or};if(A)A&&(kr=S(Q0.Provider,{value:ve(ve({},Er),wr),children:A(Xt)}));else{var fr=R||lG;kr=S(vm,{...Er,...wr,children:typeof fr=="function"?fr(Xt):fr})}var Nt=Xe(N,{className:Qe(!Qt&&n,k),style:w,ref:t,...j,children:[qe.map(Lt),Fe?kr:null,I&&S(vm,{...Er,responsive:Wt,responsiveDisabled:!jt,order:Dt,className:"".concat(ft,"-suffix"),registerSize:_t,display:!0,style:$r,children:I})]});return Wt&&(Nt=S(Ul,{onResize:rr,disabled:!jt,children:Nt})),Nt}var Ws=C.exports.forwardRef(uG);Ws.displayName="Overflow";Ws.Item=LA;Ws.RESPONSIVE=FA;Ws.INVALIDATE=$A;var J0=function(t){var r=t.className,n=t.customizeIcon,i=t.customizeIconProps,a=t.onMouseDown,u=t.onClick,o=t.children,f;return typeof n=="function"?f=n(i):f=n,S("span",{className:r,onMouseDown:function(v){v.preventDefault(),a&&a(v)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:u,"aria-hidden":!0,children:f!==void 0?f:S("span",{className:Qe(r.split(/\s+/).map(function(p){return"".concat(p,"-icon")})),children:o})})},cG=function(t,r){var n,i,a=t.prefixCls,u=t.id,o=t.inputElement,f=t.disabled,p=t.tabIndex,v=t.autoFocus,y=t.autoComplete,w=t.editable,k=t.activeDescendantId,T=t.value,R=t.maxLength,A=t.onKeyDown,I=t.onMouseDown,O=t.onChange,N=t.onPaste,L=t.onCompositionStart,B=t.onCompositionEnd,j=t.open,G=t.attrs,H=o||S("input",{}),te=H,Y=te.ref,le=te.props,J=le.onKeyDown,Z=le.onChange,Q=le.onMouseDown,ge=le.onCompositionStart,ne=le.onCompositionEnd,de=le.style;return"maxLength"in H.props,H=C.exports.cloneElement(H,ve(ve(ve({type:"search"},le),{},{id:u,ref:ta(r,Y),disabled:f,tabIndex:p,autoComplete:y||"off",autoFocus:v,className:Qe("".concat(a,"-selection-search-input"),(n=H)===null||n===void 0||(i=n.props)===null||i===void 0?void 0:i.className),role:"combobox","aria-expanded":j,"aria-haspopup":"listbox","aria-owns":"".concat(u,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(u,"_list"),"aria-activedescendant":k},G),{},{value:w?T:"",maxLength:R,readOnly:!w,unselectable:w?null:"on",style:ve(ve({},de),{},{opacity:w?null:0}),onKeyDown:function(ye){A(ye),J&&J(ye)},onMouseDown:function(ye){I(ye),Q&&Q(ye)},onChange:function(ye){O(ye),Z&&Z(ye)},onCompositionStart:function(ye){L(ye),ge&&ge(ye)},onCompositionEnd:function(ye){B(ye),ne&&ne(ye)},onPaste:N})),H},rS=C.exports.forwardRef(cG);rS.displayName="Input";function BA(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}var dG=typeof window<"u"&&window.document&&window.document.documentElement,fG=dG;function hG(e){return e!=null}function TT(e){return["string","number"].includes(ar(e))}function VA(e){var t=void 0;return e&&(TT(e.title)?t=e.title.toString():TT(e.label)&&(t=e.label.toString())),t}function pG(e,t){fG?C.exports.useLayoutEffect(e,t):C.exports.useEffect(e,t)}function mG(e){var t;return(t=e.key)!==null&&t!==void 0?t:e.value}var PT=function(t){t.preventDefault(),t.stopPropagation()},vG=function(t){var r=t.id,n=t.prefixCls,i=t.values,a=t.open,u=t.searchValue,o=t.autoClearSearchValue,f=t.inputRef,p=t.placeholder,v=t.disabled,y=t.mode,w=t.showSearch,k=t.autoFocus,T=t.autoComplete,R=t.activeDescendantId,A=t.tabIndex,I=t.removeIcon,O=t.maxTagCount,N=t.maxTagTextLength,L=t.maxTagPlaceholder,B=L===void 0?function(Ye){return"+ ".concat(Ye.length," ...")}:L,j=t.tagRender,G=t.onToggleOpen,H=t.onRemove,te=t.onInputChange,Y=t.onInputPaste,le=t.onInputKeyDown,J=t.onInputMouseDown,Z=t.onInputCompositionStart,Q=t.onInputCompositionEnd,ge=C.exports.useRef(null),ne=C.exports.useState(0),de=Le(ne,2),oe=de[0],ye=de[1],Re=C.exports.useState(!1),Te=Le(Re,2),ke=Te[0],ze=Te[1],Ie="".concat(n,"-selection"),Ne=a||y==="multiple"&&o===!1||y==="tags"?u:"",De=y==="tags"||y==="multiple"&&o===!1||w&&(a||ke);pG(function(){ye(ge.current.scrollWidth)},[Ne]);function Ve(Ye,Pt,mt,It,Ct){return Xe("span",{className:Qe("".concat(Ie,"-item"),se({},"".concat(Ie,"-item-disabled"),mt)),title:VA(Ye),children:[S("span",{className:"".concat(Ie,"-item-content"),children:Pt}),It&&S(J0,{className:"".concat(Ie,"-item-remove"),onMouseDown:PT,onClick:Ct,customizeIcon:I,children:"\xD7"})]})}function Ge(Ye,Pt,mt,It,Ct){var Dt=function(dt){PT(dt),G(!a)};return S("span",{onMouseDown:Dt,children:j({label:Pt,value:Ye,disabled:mt,closable:It,onClose:Ct})})}function je(Ye){var Pt=Ye.disabled,mt=Ye.label,It=Ye.value,Ct=!v&&!Pt,Dt=mt;if(typeof N=="number"&&(typeof mt=="string"||typeof mt=="number")){var lt=String(Dt);lt.length>N&&(Dt="".concat(lt.slice(0,N),"..."))}var dt=function(it){it&&it.stopPropagation(),H(Ye)};return typeof j=="function"?Ge(It,Dt,Pt,Ct,dt):Ve(Ye,Dt,Pt,Ct,dt)}function ct(Ye){var Pt=typeof B=="function"?B(Ye):B;return Ve({title:Pt},Pt,!1)}var pt=Xe("div",{className:"".concat(Ie,"-search"),style:{width:oe},onFocus:function(){ze(!0)},onBlur:function(){ze(!1)},children:[S(rS,{ref:f,open:a,prefixCls:n,id:r,inputElement:null,disabled:v,autoFocus:k,autoComplete:T,editable:De,activeDescendantId:R,value:Ne,onKeyDown:le,onMouseDown:J,onChange:te,onPaste:Y,onCompositionStart:Z,onCompositionEnd:Q,tabIndex:A,attrs:Wu(t,!0)}),Xe("span",{ref:ge,className:"".concat(Ie,"-search-mirror"),"aria-hidden":!0,children:[Ne,"\xA0"]})]}),Tt=S(Ws,{prefixCls:"".concat(Ie,"-overflow"),data:i,renderItem:je,renderRest:ct,suffix:pt,itemKey:mG,maxCount:O});return Xe(Ar,{children:[Tt,!i.length&&!Ne&&S("span",{className:"".concat(Ie,"-placeholder"),children:p})]})},gG=function(t){var r=t.inputElement,n=t.prefixCls,i=t.id,a=t.inputRef,u=t.disabled,o=t.autoFocus,f=t.autoComplete,p=t.activeDescendantId,v=t.mode,y=t.open,w=t.values,k=t.placeholder,T=t.tabIndex,R=t.showSearch,A=t.searchValue,I=t.activeValue,O=t.maxLength,N=t.onInputKeyDown,L=t.onInputMouseDown,B=t.onInputChange,j=t.onInputPaste,G=t.onInputCompositionStart,H=t.onInputCompositionEnd,te=C.exports.useState(!1),Y=Le(te,2),le=Y[0],J=Y[1],Z=v==="combobox",Q=Z||R,ge=w[0],ne=A||"";Z&&I&&!le&&(ne=I),C.exports.useEffect(function(){Z&&J(!1)},[Z,I]);var de=v!=="combobox"&&!y&&!R?!1:!!ne,oe=VA(ge),ye=function(){if(ge)return null;var Te=de?{visibility:"hidden"}:void 0;return S("span",{className:"".concat(n,"-selection-placeholder"),style:Te,children:k})};return Xe(Ar,{children:[S("span",{className:"".concat(n,"-selection-search"),children:S(rS,{ref:a,prefixCls:n,id:i,open:y,inputElement:r,disabled:u,autoFocus:o,autoComplete:f,editable:Q,activeDescendantId:p,value:ne,onKeyDown:N,onMouseDown:L,onChange:function(Te){J(!0),B(Te)},onPaste:j,onCompositionStart:G,onCompositionEnd:H,tabIndex:T,attrs:Wu(t,!0),maxLength:Z?O:void 0})}),!Z&&ge&&!de&&S("span",{className:"".concat(n,"-selection-item"),title:oe,children:ge.label}),ye()]})};function yG(e){return![Et.ESC,Et.SHIFT,Et.BACKSPACE,Et.TAB,Et.WIN_KEY,Et.ALT,Et.META,Et.WIN_KEY_RIGHT,Et.CTRL,Et.SEMICOLON,Et.EQUALS,Et.CAPS_LOCK,Et.CONTEXT_MENU,Et.F1,Et.F2,Et.F3,Et.F4,Et.F5,Et.F6,Et.F7,Et.F8,Et.F9,Et.F10,Et.F11,Et.F12].includes(e)}var xG=function(t,r){var n=C.exports.useRef(null),i=C.exports.useRef(!1),a=t.prefixCls,u=t.open,o=t.mode,f=t.showSearch,p=t.tokenWithEnter,v=t.autoClearSearchValue,y=t.onSearch,w=t.onSearchSubmit,k=t.onToggleOpen,T=t.onInputKeyDown,R=t.domRef;C.exports.useImperativeHandle(r,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var A=DA(0),I=Le(A,2),O=I[0],N=I[1],L=function(de){var oe=de.which;(oe===Et.UP||oe===Et.DOWN)&&de.preventDefault(),T&&T(de),oe===Et.ENTER&&o==="tags"&&!i.current&&!u&&(w==null||w(de.target.value)),yG(oe)&&k(!0)},B=function(){N(!0)},j=C.exports.useRef(null),G=function(de){y(de,!0,i.current)!==!1&&k(!0)},H=function(){i.current=!0},te=function(de){i.current=!1,o!=="combobox"&&G(de.target.value)},Y=function(de){var oe=de.target.value;if(p&&j.current&&/[\r\n]/.test(j.current)){var ye=j.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");oe=oe.replace(ye,j.current)}j.current=null,G(oe)},le=function(de){var oe=de.clipboardData,ye=oe.getData("text");j.current=ye},J=function(de){var oe=de.target;if(oe!==n.current){var ye=document.body.style.msTouchAction!==void 0;ye?setTimeout(function(){n.current.focus()}):n.current.focus()}},Z=function(de){var oe=O();de.target!==n.current&&!oe&&o!=="combobox"&&de.preventDefault(),(o!=="combobox"&&(!f||!oe)||!u)&&(u&&v!==!1&&y("",!0,!1),k())},Q={inputRef:n,onInputKeyDown:L,onInputMouseDown:B,onInputChange:Y,onInputPaste:le,onInputCompositionStart:H,onInputCompositionEnd:te},ge=o==="multiple"||o==="tags"?S(vG,{...t,...Q}):S(gG,{...t,...Q});return S("div",{ref:R,className:"".concat(a,"-selector"),onClick:J,onMouseDown:Z,children:ge})},jA=C.exports.forwardRef(xG);jA.displayName="Selector";var _G=C.exports.forwardRef(function(e,t){var r=e.didUpdate,n=e.getContainer,i=e.children,a=C.exports.useRef(),u=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{}});var o=C.exports.useRef(!1);return!o.current&&Lo()&&(u.current=n(),a.current=u.current.parentNode,o.current=!0),C.exports.useEffect(function(){r==null||r(e)}),C.exports.useEffect(function(){return u.current.parentNode===null&&a.current!==null&&a.current.appendChild(u.current),function(){var f,p;(f=u.current)===null||f===void 0||(p=f.parentNode)===null||p===void 0||p.removeChild(u.current)}},[]),u.current?ad.createPortal(i,u.current):null});function bG(e,t,r){return r?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function wG(e,t,r){var n=e[t]||{};return ve(ve({},n),r)}function CG(e,t,r,n){for(var i=r.points,a=Object.keys(e),u=0;u=0&&r.left>=0&&r.bottom>r.top&&r.right>r.left?r:null}function qG(e,t,r,n){var i=Kr.clone(e),a={width:t.width,height:t.height};return n.adjustX&&i.left=r.left&&i.left+a.width>r.right&&(a.width-=i.left+a.width-r.right),n.adjustX&&i.left+a.width>r.right&&(i.left=Math.max(r.right-a.width,r.left)),n.adjustY&&i.top=r.top&&i.top+a.height>r.bottom&&(a.height-=i.top+a.height-r.bottom),n.adjustY&&i.top+a.height>r.bottom&&(i.top=Math.max(r.bottom-a.height,r.top)),Kr.mix(i,a)}function aS(e){var t,r,n;if(!Kr.isWindow(e)&&e.nodeType!==9)t=Kr.offset(e),r=Kr.outerWidth(e),n=Kr.outerHeight(e);else{var i=Kr.getWindow(e);t={left:Kr.getWindowScrollLeft(i),top:Kr.getWindowScrollTop(i)},r=Kr.viewportWidth(i),n=Kr.viewportHeight(i)}return t.width=r,t.height=n,t}function FT(e,t){var r=t.charAt(0),n=t.charAt(1),i=e.width,a=e.height,u=e.left,o=e.top;return r==="c"?o+=a/2:r==="b"&&(o+=a),n==="c"?u+=i/2:n==="r"&&(u+=i),{left:u,top:o}}function Cy(e,t,r,n,i){var a=FT(t,r[1]),u=FT(e,r[0]),o=[u.left-a.left,u.top-a.top];return{left:Math.round(e.left-o[0]+n[0]-i[0]),top:Math.round(e.top-o[1]+n[1]-i[1])}}function $T(e,t,r){return e.leftr.right}function BT(e,t,r){return e.topr.bottom}function GG(e,t,r){return e.left>r.right||e.left+t.widthr.bottom||e.top+t.height=r.right||n.top>=r.bottom}function sS(e,t,r){var n=r.target||t,i=aS(n),a=!XG(n,r.overflow&&r.overflow.alwaysByViewport);return YA(e,i,r,a)}sS.__getOffsetParent=C4;sS.__getVisibleRectForElement=oS;function YG(e,t,r){var n,i,a=Kr.getDocument(e),u=a.defaultView||a.parentWindow,o=Kr.getWindowScrollLeft(u),f=Kr.getWindowScrollTop(u),p=Kr.viewportWidth(u),v=Kr.viewportHeight(u);"pageX"in t?n=t.pageX:n=o+t.clientX,"pageY"in t?i=t.pageY:i=f+t.clientY;var y={left:n,top:i,width:0,height:0},w=n>=0&&n<=o+p&&i>=0&&i<=f+v,k=[r.points[0],"cc"];return YA(e,y,IT(IT({},r),{},{points:k}),w)}function lS(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function i(a,u){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=n.has(a);if(Bn(!f,"Warning: There may be circular references"),f)return!1;if(a===u)return!0;if(r&&o>1)return!1;n.add(a);var p=o+1;if(Array.isArray(a)){if(!Array.isArray(u)||a.length!==u.length)return!1;for(var v=0;v1&&(Tt=S("div",{className:"".concat(n,"-content"),children:u})),S(Za,{visible:r,ref:j,leavedClassName:"".concat(n,"-hidden"),...Ge,onAppearPrepare:je,onEnterPrepare:je,removeOnLeave:p,forceRender:v,children:function(Ye,Pt){var mt=Ye.className,It=Ye.style,Ct=Qe(n,i,te,mt);return S(QA,{target:Ne(),ref:B,monitorWindowResize:!0,disabled:pt,align:y,onAlign:Ve,children:S("div",{ref:Pt,className:Ct,onMouseEnter:A,onMouseLeave:I,onMouseDownCapture:O,onTouchStartCapture:N,onClick:L,style:ve(ve({},It),ct),children:Tt})},"popup")}})});JA.displayName="PopupInner";var eN=C.exports.forwardRef(function(e,t){var r=e.prefixCls,n=e.visible,i=e.zIndex,a=e.children,u=e.mobile;u=u===void 0?{}:u;var o=u.popupClassName,f=u.popupStyle,p=u.popupMotion,v=p===void 0?{}:p,y=u.popupRender,w=e.onClick,k=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return k.current}}});var T=ve({zIndex:i},f),R=a;return C.exports.Children.count(a)>1&&(R=S("div",{className:"".concat(r,"-content"),children:a})),y&&(R=y(R)),S(Za,{visible:n,ref:k,removeOnLeave:!0,...v,children:function(A,I){var O=A.className,N=A.style,L=Qe(r,o,O);return S("div",{ref:I,className:L,onClick:w,style:ve(ve({},N),T),children:R})}})});eN.displayName="MobilePopupInner";var iZ=["visible","mobile"],tN=C.exports.forwardRef(function(e,t){var r=e.visible,n=e.mobile,i=Mr(e,iZ),a=C.exports.useState(r),u=Le(a,2),o=u[0],f=u[1],p=C.exports.useState(!1),v=Le(p,2),y=v[0],w=v[1],k=ve(ve({},i),{},{visible:o});C.exports.useEffect(function(){f(r),r&&n&&w(AA())},[r,n]);var T=y?S(eN,{...k,mobile:n,ref:t}):S(JA,{...k,ref:t});return Xe("div",{children:[S(SG,{...k}),T]})});tN.displayName="Popup";var qT=C.exports.createContext(null);function e2(){}function oZ(){return""}function aZ(e){return e?e.ownerDocument:window.document}var sZ=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function lZ(e){var t=function(r){vi(i,r);var n=gi(i);function i(a){var u;Qn(this,i),u=n.call(this,a),se(Nr(u),"popupRef",C.exports.createRef()),se(Nr(u),"triggerRef",C.exports.createRef()),se(Nr(u),"portalContainer",void 0),se(Nr(u),"attachId",void 0),se(Nr(u),"clickOutsideHandler",void 0),se(Nr(u),"touchOutsideHandler",void 0),se(Nr(u),"contextMenuOutsideHandler1",void 0),se(Nr(u),"contextMenuOutsideHandler2",void 0),se(Nr(u),"mouseDownTimeout",void 0),se(Nr(u),"focusTime",void 0),se(Nr(u),"preClickTime",void 0),se(Nr(u),"preTouchTime",void 0),se(Nr(u),"delayTimer",void 0),se(Nr(u),"hasPopupMouseDown",void 0),se(Nr(u),"onMouseEnter",function(f){var p=u.props.mouseEnterDelay;u.fireEvents("onMouseEnter",f),u.delaySetPopupVisible(!0,p,p?null:f)}),se(Nr(u),"onMouseMove",function(f){u.fireEvents("onMouseMove",f),u.setPoint(f)}),se(Nr(u),"onMouseLeave",function(f){u.fireEvents("onMouseLeave",f),u.delaySetPopupVisible(!1,u.props.mouseLeaveDelay)}),se(Nr(u),"onPopupMouseEnter",function(){u.clearDelayTimer()}),se(Nr(u),"onPopupMouseLeave",function(f){var p;f.relatedTarget&&!f.relatedTarget.setTimeout&&Jc((p=u.popupRef.current)===null||p===void 0?void 0:p.getElement(),f.relatedTarget)||u.delaySetPopupVisible(!1,u.props.mouseLeaveDelay)}),se(Nr(u),"onFocus",function(f){u.fireEvents("onFocus",f),u.clearDelayTimer(),u.isFocusToShow()&&(u.focusTime=Date.now(),u.delaySetPopupVisible(!0,u.props.focusDelay))}),se(Nr(u),"onMouseDown",function(f){u.fireEvents("onMouseDown",f),u.preClickTime=Date.now()}),se(Nr(u),"onTouchStart",function(f){u.fireEvents("onTouchStart",f),u.preTouchTime=Date.now()}),se(Nr(u),"onBlur",function(f){u.fireEvents("onBlur",f),u.clearDelayTimer(),u.isBlurToHide()&&u.delaySetPopupVisible(!1,u.props.blurDelay)}),se(Nr(u),"onContextMenu",function(f){f.preventDefault(),u.fireEvents("onContextMenu",f),u.setPopupVisible(!0,f)}),se(Nr(u),"onContextMenuClose",function(){u.isContextMenuToShow()&&u.close()}),se(Nr(u),"onClick",function(f){if(u.fireEvents("onClick",f),u.focusTime){var p;if(u.preClickTime&&u.preTouchTime?p=Math.min(u.preClickTime,u.preTouchTime):u.preClickTime?p=u.preClickTime:u.preTouchTime&&(p=u.preTouchTime),Math.abs(p-u.focusTime)<20)return;u.focusTime=0}u.preClickTime=0,u.preTouchTime=0,u.isClickToShow()&&(u.isClickToHide()||u.isBlurToHide())&&f&&f.preventDefault&&f.preventDefault();var v=!u.state.popupVisible;(u.isClickToHide()&&!v||v&&u.isClickToShow())&&u.setPopupVisible(!u.state.popupVisible,f)}),se(Nr(u),"onPopupMouseDown",function(){if(u.hasPopupMouseDown=!0,clearTimeout(u.mouseDownTimeout),u.mouseDownTimeout=window.setTimeout(function(){u.hasPopupMouseDown=!1},0),u.context){var f;(f=u.context).onPopupMouseDown.apply(f,arguments)}}),se(Nr(u),"onDocumentClick",function(f){if(!(u.props.mask&&!u.props.maskClosable)){var p=f.target,v=u.getRootDomNode(),y=u.getPopupDomNode();(!Jc(v,p)||u.isContextMenuOnly())&&!Jc(y,p)&&!u.hasPopupMouseDown&&u.close()}}),se(Nr(u),"getRootDomNode",function(){var f=u.props.getTriggerDOMNode;if(f)return f(u.triggerRef.current);try{var p=jm(u.triggerRef.current);if(p)return p}catch{}return ad.findDOMNode(Nr(u))}),se(Nr(u),"getPopupClassNameFromAlign",function(f){var p=[],v=u.props,y=v.popupPlacement,w=v.builtinPlacements,k=v.prefixCls,T=v.alignPoint,R=v.getPopupClassNameFromAlign;return y&&w&&p.push(CG(w,k,f,T)),R&&p.push(R(f)),p.join(" ")}),se(Nr(u),"getComponent",function(){var f=u.props,p=f.prefixCls,v=f.destroyPopupOnHide,y=f.popupClassName,w=f.onPopupAlign,k=f.popupMotion,T=f.popupAnimation,R=f.popupTransitionName,A=f.popupStyle,I=f.mask,O=f.maskAnimation,N=f.maskTransitionName,L=f.maskMotion,B=f.zIndex,j=f.popup,G=f.stretch,H=f.alignPoint,te=f.mobile,Y=f.forceRender,le=f.onPopupClick,J=u.state,Z=J.popupVisible,Q=J.point,ge=u.getPopupAlign(),ne={};return u.isMouseEnterToShow()&&(ne.onMouseEnter=u.onPopupMouseEnter),u.isMouseLeaveToHide()&&(ne.onMouseLeave=u.onPopupMouseLeave),ne.onMouseDown=u.onPopupMouseDown,ne.onTouchStart=u.onPopupMouseDown,S(tN,{prefixCls:p,destroyPopupOnHide:v,visible:Z,point:H&&Q,className:y,align:ge,onAlign:w,animation:T,getClassNameFromAlign:u.getPopupClassNameFromAlign,...ne,stretch:G,getRootDomNode:u.getRootDomNode,style:A,mask:I,zIndex:B,transitionName:R,maskAnimation:O,maskTransitionName:N,maskMotion:L,ref:u.popupRef,motion:k,mobile:te,forceRender:Y,onClick:le,children:typeof j=="function"?j():j})}),se(Nr(u),"attachParent",function(f){rn.cancel(u.attachId);var p=u.props,v=p.getPopupContainer,y=p.getDocument,w=u.getRootDomNode(),k;v?(w||v.length===0)&&(k=v(w)):k=y(u.getRootDomNode()).body,k?k.appendChild(f):u.attachId=rn(function(){u.attachParent(f)})}),se(Nr(u),"getContainer",function(){if(!u.portalContainer){var f=u.props.getDocument,p=f(u.getRootDomNode()).createElement("div");p.style.position="absolute",p.style.top="0",p.style.left="0",p.style.width="100%",u.portalContainer=p}return u.attachParent(u.portalContainer),u.portalContainer}),se(Nr(u),"setPoint",function(f){var p=u.props.alignPoint;!p||!f||u.setState({point:{pageX:f.pageX,pageY:f.pageY}})}),se(Nr(u),"handlePortalUpdate",function(){u.state.prevPopupVisible!==u.state.popupVisible&&u.props.afterPopupVisibleChange(u.state.popupVisible)}),se(Nr(u),"triggerContextValue",{onPopupMouseDown:u.onPopupMouseDown});var o;return"popupVisible"in a?o=!!a.popupVisible:o=!!a.defaultPopupVisible,u.state={prevPopupVisible:o,popupVisible:o},sZ.forEach(function(f){u["fire".concat(f)]=function(p){u.fireEvents(f,p)}}),u}return Jn(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var u=this.props,o=this.state;if(o.popupVisible){var f;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(f=u.getDocument(this.getRootDomNode()),this.clickOutsideHandler=kl(f,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(f=f||u.getDocument(this.getRootDomNode()),this.touchOutsideHandler=kl(f,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(f=f||u.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=kl(f,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=kl(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),rn.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var u;return((u=this.popupRef.current)===null||u===void 0?void 0:u.getElement())||null}},{key:"getPopupAlign",value:function(){var u=this.props,o=u.popupPlacement,f=u.popupAlign,p=u.builtinPlacements;return o&&p?wG(p,o,f):f}},{key:"setPopupVisible",value:function(u,o){var f=this.props.alignPoint,p=this.state.popupVisible;this.clearDelayTimer(),p!==u&&("popupVisible"in this.props||this.setState({popupVisible:u,prevPopupVisible:p}),this.props.onPopupVisibleChange(u)),f&&o&&u&&this.setPoint(o)}},{key:"delaySetPopupVisible",value:function(u,o,f){var p=this,v=o*1e3;if(this.clearDelayTimer(),v){var y=f?{pageX:f.pageX,pageY:f.pageY}:null;this.delayTimer=window.setTimeout(function(){p.setPopupVisible(u,y),p.clearDelayTimer()},v)}else this.setPopupVisible(u,f)}},{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(u){var o=this.props.children.props,f=this.props;return o[u]&&f[u]?this["fire".concat(u)]:o[u]||f[u]}},{key:"isClickToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("click")!==-1||f.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var u=this.props.action;return u==="contextMenu"||u.length===1&&u[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("contextMenu")!==-1||f.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var u=this.props,o=u.action,f=u.hideAction;return o.indexOf("click")!==-1||f.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("hover")!==-1||f.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var u=this.props,o=u.action,f=u.hideAction;return o.indexOf("hover")!==-1||f.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("focus")!==-1||f.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var u=this.props,o=u.action,f=u.hideAction;return o.indexOf("focus")!==-1||f.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var u;(u=this.popupRef.current)===null||u===void 0||u.forceAlign()}}},{key:"fireEvents",value:function(u,o){var f=this.props.children.props[u];f&&f(o);var p=this.props[u];p&&p(o)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var u=this.state.popupVisible,o=this.props,f=o.children,p=o.forceRender,v=o.alignPoint,y=o.className,w=o.autoDestroy,k=C.exports.Children.only(f),T={key:"trigger"};this.isContextMenuToShow()?T.onContextMenu=this.onContextMenu:T.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(T.onClick=this.onClick,T.onMouseDown=this.onMouseDown,T.onTouchStart=this.onTouchStart):(T.onClick=this.createTwoChains("onClick"),T.onMouseDown=this.createTwoChains("onMouseDown"),T.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(T.onMouseEnter=this.onMouseEnter,v&&(T.onMouseMove=this.onMouseMove)):T.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?T.onMouseLeave=this.onMouseLeave:T.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(T.onFocus=this.onFocus,T.onBlur=this.onBlur):(T.onFocus=this.createTwoChains("onFocus"),T.onBlur=this.createTwoChains("onBlur"));var R=Qe(k&&k.props&&k.props.className,y);R&&(T.className=R);var A=ve({},T);md(k)&&(A.ref=ta(this.triggerRef,k.ref));var I=C.exports.cloneElement(k,A),O;return(u||this.popupRef.current||p)&&(O=S(e,{getContainer:this.getContainer,didUpdate:this.handlePortalUpdate,children:this.getComponent()},"portal")),!u&&w&&(O=null),Xe(qT.Provider,{value:this.triggerContextValue,children:[I,O]})}}],[{key:"getDerivedStateFromProps",value:function(u,o){var f=u.popupVisible,p={};return f!==void 0&&o.popupVisible!==f&&(p.popupVisible=f,p.prevPopupVisible=o.popupVisible),p}}]),i}(C.exports.Component);return se(t,"contextType",qT),se(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:oZ,getDocument:aZ,onPopupVisibleChange:e2,afterPopupVisibleChange:e2,onPopupAlign:e2,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 vx=lZ(_G);var uZ=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],cZ=function(t){var r=t===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:r,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:r,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:r,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:r,adjustY:1}}}},dZ=function(t,r){var n=t.prefixCls;t.disabled;var i=t.visible,a=t.children,u=t.popupElement,o=t.containerWidth,f=t.animation,p=t.transitionName,v=t.dropdownStyle,y=t.dropdownClassName,w=t.direction,k=w===void 0?"ltr":w,T=t.placement,R=t.dropdownMatchSelectWidth,A=t.dropdownRender,I=t.dropdownAlign,O=t.getPopupContainer,N=t.empty,L=t.getTriggerDOMNode,B=t.onPopupVisibleChange,j=t.onPopupMouseEnter,G=Mr(t,uZ),H="".concat(n,"-dropdown"),te=u;A&&(te=A(u));var Y=C.exports.useMemo(function(){return cZ(R)},[R]),le=f?"".concat(H,"-").concat(f):p,J=C.exports.useRef(null);C.exports.useImperativeHandle(r,function(){return{getPopupElement:function(){return J.current}}});var Z=ve({minWidth:o},v);return typeof R=="number"?Z.width=R:R&&(Z.width=o),S(vx,{...G,showAction:B?["click"]:[],hideAction:B?["click"]:[],popupPlacement:T||(k==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Y,prefixCls:H,popupTransitionName:le,popup:S("div",{ref:J,onMouseEnter:j,children:te}),popupAlign:I,popupVisible:i,getPopupContainer:O,popupClassName:Qe(y,se({},"".concat(H,"-empty"),N)),popupStyle:Z,getTriggerDOMNode:L,onPopupVisibleChange:B,children:a})},rN=C.exports.forwardRef(dZ);rN.displayName="SelectTrigger";function GT(e,t){var r=e.key,n;return"value"in e&&(n=e.value),r!=null?r:n!==void 0?n:"rc-index-key-".concat(t)}function nN(e,t){var r=e||{},n=r.label,i=r.value,a=r.options;return{label:n||(t?"children":"label"),value:i||"value",options:a||"options"}}function fZ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.fieldNames,n=t.childrenAsData,i=[],a=nN(r,!1),u=a.label,o=a.value,f=a.options;function p(v,y){v.forEach(function(w){var k=w[u];if(y||!(f in w)){var T=w[o];i.push({key:GT(w,i.length),groupOption:y,data:w,label:k,value:T})}else{var R=k;R===void 0&&n&&(R=w.label),i.push({key:GT(w,i.length),group:!0,data:w,label:R}),p(w[f],!0)}})}return p(e,!1),i}function S4(e){var t=ve({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Bn(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function hZ(e,t){if(!t||!t.length)return null;var r=!1;function n(a,u){var o=V3(u),f=o[0],p=o.slice(1);if(!f)return[a];var v=a.split(f);return r=r||v.length>1,v.reduce(function(y,w){return[].concat(wt(y),wt(n(w,p)))},[]).filter(function(y){return y})}var i=n(e,t);return r?i:null}var pZ=["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"],mZ=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function E4(e){return e==="tags"||e==="multiple"}var iN=C.exports.forwardRef(function(e,t){var r,n,i=e.id,a=e.prefixCls,u=e.className,o=e.showSearch,f=e.tagRender,p=e.direction,v=e.omitDomProps,y=e.displayValues,w=e.onDisplayValuesChange,k=e.emptyOptions,T=e.notFoundContent,R=T===void 0?"Not Found":T,A=e.onClear,I=e.mode,O=e.disabled,N=e.loading,L=e.getInputElement,B=e.getRawInputElement,j=e.open,G=e.defaultOpen,H=e.onDropdownVisibleChange,te=e.activeValue,Y=e.onActiveValueChange,le=e.activeDescendantId,J=e.searchValue,Z=e.autoClearSearchValue,Q=e.onSearch,ge=e.onSearchSplit,ne=e.tokenSeparators,de=e.allowClear,oe=e.showArrow,ye=e.inputIcon,Re=e.clearIcon,Te=e.OptionList,ke=e.animation,ze=e.transitionName,Ie=e.dropdownStyle,Ne=e.dropdownClassName,De=e.dropdownMatchSelectWidth,Ve=e.dropdownRender,Ge=e.dropdownAlign,je=e.placement,ct=e.getPopupContainer,pt=e.showAction,Tt=pt===void 0?[]:pt,Ye=e.onFocus,Pt=e.onBlur,mt=e.onKeyUp,It=e.onKeyDown,Ct=e.onMouseDown,Dt=Mr(e,pZ),lt=E4(I),dt=(o!==void 0?o:lt)||I==="combobox",ut=ve({},Dt);mZ.forEach(function(Pr){delete ut[Pr]}),v==null||v.forEach(function(Pr){delete ut[Pr]});var it=C.exports.useState(!1),ft=Le(it,2),xt=ft[0],Wt=ft[1];C.exports.useEffect(function(){Wt(AA())},[]);var jt=C.exports.useRef(null),Qt=C.exports.useRef(null),Fe=C.exports.useRef(null),qe=C.exports.useRef(null),Xt=C.exports.useRef(null),cr=qq(),Vt=Le(cr,3),Ut=Vt[0],rr=Vt[1],xr=Vt[2];C.exports.useImperativeHandle(t,function(){var Pr,Cr;return{focus:(Pr=qe.current)===null||Pr===void 0?void 0:Pr.focus,blur:(Cr=qe.current)===null||Cr===void 0?void 0:Cr.blur,scrollTo:function(ei){var yn;return(yn=Xt.current)===null||yn===void 0?void 0:yn.scrollTo(ei)}}});var Or=C.exports.useMemo(function(){var Pr;if(I!=="combobox")return J;var Cr=(Pr=y[0])===null||Pr===void 0?void 0:Pr.value;return typeof Cr=="string"||typeof Cr=="number"?String(Cr):""},[J,I,y]),_t=I==="combobox"&&typeof L=="function"&&L()||null,qt=typeof B=="function"&&B(),or=Y7(Qt,qt==null||(r=qt.props)===null||r===void 0?void 0:r.ref),$r=Yi(void 0,{defaultValue:G,value:j}),Er=Le($r,2),Lt=Er[0],kr=Er[1],wr=Lt,fr=!R&&k;(O||fr&&wr&&I==="combobox")&&(wr=!1);var Nt=fr?!1:wr,ot=C.exports.useCallback(function(Pr){var Cr=Pr!==void 0?Pr:!wr;O||(kr(Cr),wr!==Cr&&(H==null||H(Cr)))},[O,wr,kr,H]),ht=C.exports.useMemo(function(){return(ne||[]).some(function(Pr){return[` `,`\r `].includes(Pr)})},[ne]),Ot=function(Cr,Rr,ei){var yn=!0,Ur=Cr;Y==null||Y(null);var Lr=ei?null:hZ(Cr,ne);return I!=="combobox"&&Lr&&(Ur="",ge==null||ge(Lr),ot(!1),yn=!1),Q&&Or!==Ur&&Q(Ur,{source:Rr?"typing":"effect"}),yn},$t=function(Cr){!Cr||!Cr.trim()||Q(Cr,{source:"submit"})};C.exports.useEffect(function(){!wr&&!lt&&I!=="combobox"&&Ot("",!1,!1)},[wr]),C.exports.useEffect(function(){Lt&&O&&kr(!1),O&&rr(!1)},[O]);var ur=DA(),Ir=Le(ur,2),qr=Ir[0],Gr=Ir[1],me=function(Cr){var Rr=qr(),ei=Cr.which;if(ei===Et.ENTER&&(I!=="combobox"&&Cr.preventDefault(),wr||ot(!0)),Gr(!!Or),ei===Et.BACKSPACE&&!Rr&<&&!Or&&y.length){for(var yn=wt(y),Ur=null,Lr=yn.length-1;Lr>=0;Lr-=1){var Yr=yn[Lr];if(!Yr.disabled){yn.splice(Lr,1),Ur=Yr;break}}Ur&&w(yn,{type:"remove",values:[Ur]})}for(var wn=arguments.length,Sn=new Array(wn>1?wn-1:0),jn=1;jn1?Rr-1:0),yn=1;yn1?Lr-1:0),wn=1;wn1&&arguments[1]!==void 0?arguments[1]:!1;return lo(e).map(function(r,n){if(!C.exports.isValidElement(r)||!r.type)return null;var i=r,a=i.type.isSelectOptGroup,u=i.key,o=i.props,f=o.children,p=Mr(o,bZ);return t||!a?wZ(r):ve(ve({key:"__RC_SELECT_GRP__".concat(u===null?n:u,"__"),label:u},p),{},{options:aN(f)})}).filter(function(r){return r})}function CZ(e,t,r,n,i){return C.exports.useMemo(function(){var a=e,u=!e;u&&(a=aN(t));var o=new Map,f=new Map,p=function(w,k,T){T&&typeof T=="string"&&w.set(k[T],k)};function v(y){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,k=0;kf},n}return Jn(r,[{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,a=i.dragging,u=i.visible,o=this.props.prefixCls,f=this.getSpinHeight(),p=this.getTop(),v=this.showScroll(),y=v&&u;return S("div",{ref:this.scrollbarRef,className:Qe("".concat(o,"-scrollbar"),se({},"".concat(o,"-scrollbar-show"),v)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:y?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden,children:S("div",{ref:this.thumbRef,className:Qe("".concat(o,"-scrollbar-thumb"),se({},"".concat(o,"-scrollbar-thumb-moving"),a)),style:{width:"100%",height:f,top:p,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown})})}}]),r}(C.exports.Component);function kZ(e){var t=e.children,r=e.setRef,n=C.exports.useCallback(function(i){r(i)},[]);return C.exports.cloneElement(t,{ref:n})}function TZ(e,t,r,n,i,a){var u=a.getKey;return e.slice(t,r+1).map(function(o,f){var p=t+f,v=i(o,p,{}),y=u(o);return S(kZ,{setRef:function(k){return n(o,k)},children:v},y)})}var PZ=function(){function e(){Qn(this,e),this.maps=void 0,this.maps=Object.create(null)}return Jn(e,[{key:"set",value:function(r,n){this.maps[r]=n}},{key:"get",value:function(r){return this.maps[r]}}]),e}();function MZ(e,t,r){var n=C.exports.useState(0),i=Le(n,2),a=i[0],u=i[1],o=C.exports.useRef(new Map),f=C.exports.useRef(new PZ),p=C.exports.useRef();function v(){rn.cancel(p.current)}function y(){v(),p.current=rn(function(){o.current.forEach(function(k,T){if(k&&k.offsetParent){var R=jm(k),A=R.offsetHeight;f.current.get(T)!==A&&f.current.set(T,R.offsetHeight)}}),u(function(k){return k+1})})}function w(k,T){var R=e(k),A=o.current.get(R);T?(o.current.set(R,T),y()):o.current.delete(R),!A!=!T&&(T?t==null||t(k):r==null||r(k))}return C.exports.useEffect(function(){return v},[]),[w,y,f.current,a]}function IZ(e,t,r,n,i,a,u,o){var f=C.exports.useRef();return function(p){if(p==null){o();return}if(rn.cancel(f.current),typeof p=="number")u(p);else if(p&&ar(p)==="object"){var v,y=p.align;"index"in p?v=p.index:v=t.findIndex(function(R){return i(R)===p.key});var w=p.offset,k=w===void 0?0:w,T=function R(A,I){if(!(A<0||!e.current)){var O=e.current.clientHeight,N=!1,L=I;if(O){for(var B=I||y,j=0,G=0,H=0,te=Math.min(t.length,v),Y=0;Y<=te;Y+=1){var le=i(t[Y]);G=j;var J=r.get(le);H=G+(J===void 0?n:J),j=H,Y===v&&J===void 0&&(N=!0)}var Z=null;switch(B){case"top":Z=G-k;break;case"bottom":Z=H-O+k;break;default:{var Q=e.current.scrollTop,ge=Q+O;Gge&&(L="bottom")}}Z!==null&&Z!==e.current.scrollTop&&u(Z)}f.current=rn(function(){N&&a(),R(A-1,L)},2)}};T(3)}}}function RZ(e,t,r){var n=e.length,i=t.length,a,u;if(n===0&&i===0)return null;n"u"?"undefined":ar(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const lN=function(e,t){var r=C.exports.useRef(!1),n=C.exports.useRef(null);function i(){clearTimeout(n.current),r.current=!0,n.current=setTimeout(function(){r.current=!1},50)}var a=C.exports.useRef({top:e,bottom:t});return a.current.top=e,a.current.bottom=t,function(u){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=u<0&&a.current.top||u>0&&a.current.bottom;return o&&f?(clearTimeout(n.current),r.current=!1):(!f||r.current)&&i(),!r.current&&f}};function NZ(e,t,r,n){var i=C.exports.useRef(0),a=C.exports.useRef(null),u=C.exports.useRef(null),o=C.exports.useRef(!1),f=lN(t,r);function p(y){if(!!e){rn.cancel(a.current);var w=y.deltaY;i.current+=w,u.current=w,!f(w)&&(AZ||y.preventDefault(),a.current=rn(function(){var k=o.current?10:1;n(i.current*k),i.current=0}))}}function v(y){!e||(o.current=y.detail===u.current)}return[p,v]}var zZ=14/15;function DZ(e,t,r){var n=C.exports.useRef(!1),i=C.exports.useRef(0),a=C.exports.useRef(null),u=C.exports.useRef(null),o,f=function(w){if(n.current){var k=Math.ceil(w.touches[0].pageY),T=i.current-k;i.current=k,r(T)&&w.preventDefault(),clearInterval(u.current),u.current=setInterval(function(){T*=zZ,(!r(T,!0)||Math.abs(T)<=.1)&&clearInterval(u.current)},16)}},p=function(){n.current=!1,o()},v=function(w){o(),w.touches.length===1&&!n.current&&(n.current=!0,i.current=Math.ceil(w.touches[0].pageY),a.current=w.target,a.current.addEventListener("touchmove",f),a.current.addEventListener("touchend",p))};o=function(){a.current&&(a.current.removeEventListener("touchmove",f),a.current.removeEventListener("touchend",p))},mi(function(){return e&&t.current.addEventListener("touchstart",v),function(){var y;(y=t.current)===null||y===void 0||y.removeEventListener("touchstart",v),o(),clearInterval(u.current)}},[e])}var LZ=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],FZ=[],$Z={overflowY:"auto",overflowAnchor:"none"};function BZ(e,t){var r=e.prefixCls,n=r===void 0?"rc-virtual-list":r,i=e.className,a=e.height,u=e.itemHeight,o=e.fullHeight,f=o===void 0?!0:o,p=e.style,v=e.data,y=e.children,w=e.itemKey,k=e.virtual,T=e.component,R=T===void 0?"div":T,A=e.onScroll,I=e.onVisibleChange,O=e.innerProps,N=Mr(e,LZ),L=!!(k!==!1&&a&&u),B=L&&v&&u*v.length>a,j=C.exports.useState(0),G=Le(j,2),H=G[0],te=G[1],Y=C.exports.useState(!1),le=Le(Y,2),J=le[0],Z=le[1],Q=Qe(n,i),ge=v||FZ,ne=C.exports.useRef(),de=C.exports.useRef(),oe=C.exports.useRef(),ye=C.exports.useCallback(function(Ut){return typeof w=="function"?w(Ut):Ut==null?void 0:Ut[w]},[w]),Re={getKey:ye};function Te(Ut){te(function(rr){var xr;typeof Ut=="function"?xr=Ut(rr):xr=Ut;var Or=dt(xr);return ne.current.scrollTop=Or,Or})}var ke=C.exports.useRef({start:0,end:ge.length}),ze=C.exports.useRef(),Ie=OZ(ge,ye),Ne=Le(Ie,1),De=Ne[0];ze.current=De;var Ve=MZ(ye,null,null),Ge=Le(Ve,4),je=Ge[0],ct=Ge[1],pt=Ge[2],Tt=Ge[3],Ye=C.exports.useMemo(function(){if(!L)return{scrollHeight:void 0,start:0,end:ge.length-1,offset:void 0};if(!B){var Ut;return{scrollHeight:((Ut=de.current)===null||Ut===void 0?void 0:Ut.offsetHeight)||0,start:0,end:ge.length-1,offset:void 0}}for(var rr=0,xr,Or,_t,qt=ge.length,or=0;or=H&&xr===void 0&&(xr=or,Or=rr),kr>H+a&&_t===void 0&&(_t=or),rr=kr}return xr===void 0&&(xr=0,Or=0,_t=Math.ceil(a/u)),_t===void 0&&(_t=ge.length-1),_t=Math.min(_t+1,ge.length),{scrollHeight:rr,start:xr,end:_t,offset:Or}},[B,L,H,ge,Tt,a]),Pt=Ye.scrollHeight,mt=Ye.start,It=Ye.end,Ct=Ye.offset;ke.current.start=mt,ke.current.end=It;var Dt=Pt-a,lt=C.exports.useRef(Dt);lt.current=Dt;function dt(Ut){var rr=Ut;return Number.isNaN(lt.current)||(rr=Math.min(rr,lt.current)),rr=Math.max(rr,0),rr}var ut=H<=0,it=H>=Dt,ft=lN(ut,it);function xt(Ut){var rr=Ut;Te(rr)}function Wt(Ut){var rr=Ut.currentTarget.scrollTop;rr!==H&&Te(rr),A==null||A(Ut)}var jt=NZ(L,ut,it,function(Ut){Te(function(rr){var xr=rr+Ut;return xr})}),Qt=Le(jt,2),Fe=Qt[0],qe=Qt[1];DZ(L,ne,function(Ut,rr){return ft(Ut,rr)?!1:(Fe({preventDefault:function(){},deltaY:Ut}),!0)}),mi(function(){function Ut(rr){L&&rr.preventDefault()}return ne.current.addEventListener("wheel",Fe),ne.current.addEventListener("DOMMouseScroll",qe),ne.current.addEventListener("MozMousePixelScroll",Ut),function(){ne.current&&(ne.current.removeEventListener("wheel",Fe),ne.current.removeEventListener("DOMMouseScroll",qe),ne.current.removeEventListener("MozMousePixelScroll",Ut))}},[L]);var Xt=IZ(ne,ge,pt,u,ye,ct,Te,function(){var Ut;(Ut=oe.current)===null||Ut===void 0||Ut.delayHidden()});C.exports.useImperativeHandle(t,function(){return{scrollTo:Xt}}),mi(function(){if(I){var Ut=ge.slice(mt,It+1);I(Ut,ge)}},[mt,It,ge]);var cr=TZ(ge,mt,It,je,y,Re),Vt=null;return a&&(Vt=ve(se({},f?"height":"maxHeight",a),$Z),L&&(Vt.overflowY="hidden",J&&(Vt.pointerEvents="none"))),Xe("div",{style:ve(ve({},p),{},{position:"relative"}),className:Q,...N,children:[S(R,{className:"".concat(n,"-holder"),style:Vt,ref:ne,onScroll:Wt,children:S(sN,{prefixCls:n,height:Pt,offset:Ct,onInnerResize:ct,ref:de,innerProps:O,children:cr})}),L&&S(EZ,{ref:oe,prefixCls:n,scrollTop:H,height:a,scrollHeight:Pt,count:ge.length,onScroll:xt,onStartMove:function(){Z(!0)},onStopMove:function(){Z(!1)}})]})}var fS=C.exports.forwardRef(BZ);fS.displayName="List";function VZ(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var uN=C.exports.createContext(null),jZ=["disabled","title","children","style","className"];function QT(e){return typeof e=="string"||typeof e=="number"}var UZ=function(t,r){var n=zA(),i=n.prefixCls,a=n.id,u=n.open,o=n.multiple,f=n.mode,p=n.searchValue,v=n.toggleOpen,y=n.notFoundContent,w=n.onPopupScroll,k=C.exports.useContext(uN),T=k.flattenOptions,R=k.onActiveValue,A=k.defaultActiveFirstOption,I=k.onSelect,O=k.menuItemSelectedIcon,N=k.rawValues,L=k.fieldNames,B=k.virtual,j=k.listHeight,G=k.listItemHeight,H="".concat(i,"-item"),te=hv(function(){return T},[u,T],function(Ie,Ne){return Ne[0]&&Ie[1]!==Ne[1]}),Y=C.exports.useRef(null),le=function(Ne){Ne.preventDefault()},J=function(Ne){Y.current&&Y.current.scrollTo(typeof Ne=="number"?{index:Ne}:Ne)},Z=function(Ne){for(var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ve=te.length,Ge=0;Ge1&&arguments[1]!==void 0?arguments[1]:!1;de(Ne);var Ve={source:De?"keyboard":"mouse"},Ge=te[Ne];if(!Ge){R(null,-1,Ve);return}R(Ge.value,Ne,Ve)};C.exports.useEffect(function(){oe(A!==!1?Z(0):-1)},[te.length,p]);var ye=C.exports.useCallback(function(Ie){return N.has(Ie)&&f!=="combobox"},[f,wt(N).toString(),N.size]);C.exports.useEffect(function(){var Ie=setTimeout(function(){if(!o&&u&&N.size===1){var De=Array.from(N)[0],Ve=te.findIndex(function(Ge){var je=Ge.data;return je.value===De});Ve!==-1&&(oe(Ve),J(Ve))}});if(u){var Ne;(Ne=Y.current)===null||Ne===void 0||Ne.scrollTo(void 0)}return function(){return clearTimeout(Ie)}},[u,p]);var Re=function(Ne){Ne!==void 0&&I(Ne,{selected:!N.has(Ne)}),o||v(!1)};if(C.exports.useImperativeHandle(r,function(){return{onKeyDown:function(Ne){var De=Ne.which,Ve=Ne.ctrlKey;switch(De){case Et.N:case Et.P:case Et.UP:case Et.DOWN:{var Ge=0;if(De===Et.UP?Ge=-1:De===Et.DOWN?Ge=1:VZ()&&Ve&&(De===Et.N?Ge=1:De===Et.P&&(Ge=-1)),Ge!==0){var je=Z(ne+Ge,Ge);J(je),oe(je,!0)}break}case Et.ENTER:{var ct=te[ne];ct&&!ct.data.disabled?Re(ct.value):Re(void 0),u&&Ne.preventDefault();break}case Et.ESC:v(!1),u&&Ne.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Ne){J(Ne)}}}),te.length===0)return S("div",{role:"listbox",id:"".concat(a,"_list"),className:"".concat(H,"-empty"),onMouseDown:le,children:y});var Te=Object.keys(L).map(function(Ie){return L[Ie]}),ke=function(Ne){return Ne.label},ze=function(Ne){var De=te[Ne];if(!De)return null;var Ve=De.data||{},Ge=Ve.value,je=De.group,ct=Wu(Ve,!0),pt=ke(De);return De?C.exports.createElement("div",{"aria-label":typeof pt=="string"&&!je?pt:null,...ct,key:Ne,role:je?"presentation":"option",id:"".concat(a,"_list_").concat(Ne),"aria-selected":ye(Ge)},Ge):null};return Xe(Ar,{children:[Xe("div",{role:"listbox",id:"".concat(a,"_list"),style:{height:0,width:0,overflow:"hidden"},children:[ze(ne-1),ze(ne),ze(ne+1)]}),S(fS,{itemKey:"key",ref:Y,data:te,height:j,itemHeight:G,fullHeight:!1,onMouseDown:le,onScroll:w,virtual:B,children:function(Ie,Ne){var De,Ve=Ie.group,Ge=Ie.groupOption,je=Ie.data,ct=Ie.label,pt=Ie.value,Tt=je.key;if(Ve){var Ye,Pt=(Ye=je.title)!==null&&Ye!==void 0?Ye:QT(ct)?ct.toString():void 0;return S("div",{className:Qe(H,"".concat(H,"-group")),title:Pt,children:ct!==void 0?ct:Tt})}var mt=je.disabled,It=je.title;je.children;var Ct=je.style,Dt=je.className,lt=Mr(je,jZ),dt=Si(lt,Te),ut=ye(pt),it="".concat(H,"-option"),ft=Qe(H,it,Dt,(De={},se(De,"".concat(it,"-grouped"),Ge),se(De,"".concat(it,"-active"),ne===Ne&&!mt),se(De,"".concat(it,"-disabled"),mt),se(De,"".concat(it,"-selected"),ut),De)),xt=ke(Ie),Wt=!O||typeof O=="function"||ut,jt=typeof xt=="number"?xt:xt||pt,Qt=QT(jt)?jt.toString():void 0;return It!==void 0&&(Qt=It),Xe("div",{...Wu(dt),"aria-selected":ut,className:ft,title:Qt,onMouseMove:function(){ne===Ne||mt||oe(Ne)},onClick:function(){mt||Re(pt)},style:Ct,children:[S("div",{className:"".concat(it,"-content"),children:jt}),C.exports.isValidElement(O)||ut,Wt&&S(J0,{className:"".concat(H,"-option-state"),customizeIcon:O,customizeIconProps:{isSelected:ut},children:ut?"\u2713":null})]})}})]})},cN=C.exports.forwardRef(UZ);cN.displayName="OptionList";var KZ=["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"],HZ=["inputValue"];function WZ(e){return!e||ar(e)!=="object"}var qZ=C.exports.forwardRef(function(e,t){var r=e.id,n=e.mode,i=e.prefixCls,a=i===void 0?"rc-select":i,u=e.backfill,o=e.fieldNames,f=e.inputValue,p=e.searchValue,v=e.onSearch,y=e.autoClearSearchValue,w=y===void 0?!0:y,k=e.onSelect,T=e.onDeselect,R=e.dropdownMatchSelectWidth,A=R===void 0?!0:R,I=e.filterOption,O=e.filterSort,N=e.optionFilterProp,L=e.optionLabelProp,B=e.options,j=e.children,G=e.defaultActiveFirstOption,H=e.menuItemSelectedIcon,te=e.virtual,Y=e.listHeight,le=Y===void 0?200:Y,J=e.listItemHeight,Z=J===void 0?20:J,Q=e.value,ge=e.defaultValue,ne=e.labelInValue,de=e.onChange,oe=Mr(e,KZ),ye=oN(r),Re=E4(n),Te=!!(!B&&j),ke=C.exports.useMemo(function(){return I===void 0&&n==="combobox"?!1:I},[I,n]),ze=C.exports.useMemo(function(){return nN(o,Te)},[JSON.stringify(o),Te]),Ie=Yi("",{value:p!==void 0?p:f,postState:function(ht){return ht||""}}),Ne=Le(Ie,2),De=Ne[0],Ve=Ne[1],Ge=CZ(B,j,ze,N,L),je=Ge.valueOptions,ct=Ge.labelOptions,pt=Ge.options,Tt=C.exports.useCallback(function(ot){var ht=BA(ot);return ht.map(function(Ot){var $t,ur,Ir,qr,Gr;if(WZ(Ot))$t=Ot;else{var me;Ir=Ot.key,ur=Ot.label,$t=(me=Ot.value)!==null&&me!==void 0?me:Ir}var K=je.get($t);if(K){var q;ur===void 0&&(ur=K==null?void 0:K[L||ze.label]),Ir===void 0&&(Ir=(q=K==null?void 0:K.key)!==null&&q!==void 0?q:$t),qr=K==null?void 0:K.disabled,Gr=K==null?void 0:K.title}return{label:ur,value:$t,key:Ir,disabled:qr,title:Gr}})},[ze,L,je]),Ye=Yi(ge,{value:Q}),Pt=Le(Ye,2),mt=Pt[0],It=Pt[1],Ct=C.exports.useMemo(function(){var ot,ht=Tt(mt);return n==="combobox"&&!((ot=ht[0])!==null&&ot!==void 0&&ot.value)?[]:ht},[mt,Tt,n]),Dt=vZ(Ct,je),lt=Le(Dt,2),dt=lt[0],ut=lt[1],it=C.exports.useMemo(function(){if(!n&&dt.length===1){var ot=dt[0];if(ot.value===null&&(ot.label===null||ot.label===void 0))return[]}return dt.map(function(ht){var Ot;return ve(ve({},ht),{},{label:(Ot=ht.label)!==null&&Ot!==void 0?Ot:ht.value})})},[n,dt]),ft=C.exports.useMemo(function(){return new Set(dt.map(function(ot){return ot.value}))},[dt]);C.exports.useEffect(function(){if(n==="combobox"){var ot,ht=(ot=dt[0])===null||ot===void 0?void 0:ot.value;Ve(hG(ht)?String(ht):"")}},[dt]);var xt=XT(function(ot,ht){var Ot,$t=ht!=null?ht:ot;return Ot={},se(Ot,ze.value,ot),se(Ot,ze.label,$t),Ot}),Wt=C.exports.useMemo(function(){if(n!=="tags")return pt;var ot=wt(pt),ht=function($t){return je.has($t)};return wt(dt).sort(function(Ot,$t){return Ot.value<$t.value?-1:1}).forEach(function(Ot){var $t=Ot.value;ht($t)||ot.push(xt($t,Ot.label))}),ot},[xt,pt,je,dt,n]),jt=gZ(Wt,ze,De,ke,N),Qt=C.exports.useMemo(function(){return n!=="tags"||!De||jt.some(function(ot){return ot[N||"value"]===De})?jt:[xt(De)].concat(wt(jt))},[xt,N,n,jt,De]),Fe=C.exports.useMemo(function(){return O?wt(Qt).sort(function(ot,ht){return O(ot,ht)}):Qt},[Qt,O]),qe=C.exports.useMemo(function(){return fZ(Fe,{fieldNames:ze,childrenAsData:Te})},[Fe,ze,Te]),Xt=function(ht){var Ot=Tt(ht);if(It(Ot),de&&(Ot.length!==dt.length||Ot.some(function(Ir,qr){var Gr;return((Gr=dt[qr])===null||Gr===void 0?void 0:Gr.value)!==(Ir==null?void 0:Ir.value)}))){var $t=ne?Ot:Ot.map(function(Ir){return Ir.value}),ur=Ot.map(function(Ir){return S4(ut(Ir.value))});de(Re?$t:$t[0],Re?ur:ur[0])}},cr=C.exports.useState(null),Vt=Le(cr,2),Ut=Vt[0],rr=Vt[1],xr=C.exports.useState(0),Or=Le(xr,2),_t=Or[0],qt=Or[1],or=G!==void 0?G:n!=="combobox",$r=C.exports.useCallback(function(ot,ht){var Ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$t=Ot.source,ur=$t===void 0?"keyboard":$t;qt(ht),u&&n==="combobox"&&ot!==null&&ur==="keyboard"&&rr(String(ot))},[u,n]),Er=function(ht,Ot,$t){var ur=function(){var Ee,be=ut(ht);return[ne?{label:be==null?void 0:be[ze.label],value:ht,key:(Ee=be==null?void 0:be.key)!==null&&Ee!==void 0?Ee:ht}:ht,S4(be)]};if(Ot&&k){var Ir=ur(),qr=Le(Ir,2),Gr=qr[0],me=qr[1];k(Gr,me)}else if(!Ot&&T&&$t!=="clear"){var K=ur(),q=Le(K,2),ce=q[0],ae=q[1];T(ce,ae)}},Lt=XT(function(ot,ht){var Ot,$t=Re?ht.selected:!0;$t?Ot=Re?[].concat(wt(dt),[ot]):[ot]:Ot=dt.filter(function(ur){return ur.value!==ot}),Xt(Ot),Er(ot,$t),n==="combobox"?rr(""):(!E4||w)&&(Ve(""),rr(""))}),kr=function(ht,Ot){Xt(ht);var $t=Ot.type,ur=Ot.values;($t==="remove"||$t==="clear")&&ur.forEach(function(Ir){Er(Ir.value,!1,$t)})},wr=function(ht,Ot){if(Ve(ht),rr(null),Ot.source==="submit"){var $t=(ht||"").trim();if($t){var ur=Array.from(new Set([].concat(wt(ft),[$t])));Xt(ur),Er($t,!0),Ve("")}return}Ot.source!=="blur"&&(n==="combobox"&&Xt(ht),v==null||v(ht))},fr=function(ht){var Ot=ht;n!=="tags"&&(Ot=ht.map(function(ur){var Ir=ct.get(ur);return Ir==null?void 0:Ir.value}).filter(function(ur){return ur!==void 0}));var $t=Array.from(new Set([].concat(wt(ft),wt(Ot))));Xt($t),$t.forEach(function(ur){Er(ur,!0)})},Nt=C.exports.useMemo(function(){var ot=te!==!1&&A!==!1;return ve(ve({},Ge),{},{flattenOptions:qe,onActiveValue:$r,defaultActiveFirstOption:or,onSelect:Lt,menuItemSelectedIcon:H,rawValues:ft,fieldNames:ze,virtual:ot,listHeight:le,listItemHeight:Z,childrenAsData:Te})},[Ge,qe,$r,or,Lt,H,ft,ze,te,A,le,Z,Te]);return S(uN.Provider,{value:Nt,children:S(iN,{...oe,id:ye,prefixCls:a,ref:t,omitDomProps:HZ,mode:n,displayValues:it,onDisplayValuesChange:kr,searchValue:De,onSearch:wr,autoClearSearchValue:w,onSearchSplit:fr,dropdownMatchSelectWidth:A,OptionList:cN,emptyOptions:!qe.length,activeValue:Ut,activeDescendantId:"".concat(ye,"_list_").concat(_t)})})}),hS=qZ;hS.Option=dS;hS.OptGroup=cS;var GZ=function(){var t=C.exports.useContext(zr),r=t.getPrefixCls,n=r("empty-img-default");return S("svg",{className:n,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg",children:Xe("g",{fill:"none",fillRule:"evenodd",children:[Xe("g",{transform:"translate(24 31.67)",children:[S("ellipse",{className:"".concat(n,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),S("path",{className:"".concat(n,"-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"}),S("path",{className:"".concat(n,"-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)"}),S("path",{className:"".concat(n,"-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"}),S("path",{className:"".concat(n,"-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"})]}),S("path",{className:"".concat(n,"-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"}),Xe("g",{className:"".concat(n,"-g"),transform:"translate(149.65 15.383)",children:[S("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),S("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})]})]})})};const ZZ=GZ;var XZ=function(){var t=C.exports.useContext(zr),r=t.getPrefixCls,n=r("empty-img-simple");return S("svg",{className:n,width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:Xe("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[S("ellipse",{className:"".concat(n,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),Xe("g",{className:"".concat(n,"-g"),fillRule:"nonzero",children:[S("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"}),S("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(n,"-path")})]})]})})};const YZ=XZ;var QZ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=1},subscribe:function(t){return Nc.size||this.register(),i2+=1,Nc.set(i2,t),t(Ty),i2},unsubscribe:function(t){Nc.delete(t),Nc.size||this.unregister()},unregister:function(){var t=this;Object.keys(ky).forEach(function(r){var n=ky[r],i=t.matchHandlers[n];i==null||i.mql.removeListener(i==null?void 0:i.listener)}),Nc.clear()},register:function(){var t=this;Object.keys(ky).forEach(function(r){var n=ky[r],i=function(o){var f=o.matches;t.dispatch(tt(tt({},Ty),se({},r,f)))},a=window.matchMedia(n);a.addListener(i),t.matchHandlers[n]={mql:a,listener:i},i(a)})}};const n1=mX;function kN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=C.exports.useRef({}),r=EN();return C.exports.useEffect(function(){var n=n1.subscribe(function(i){t.current=i,e&&r()});return function(){return n1.unsubscribe(n)}},[]),t.current}var Oa={adjustX:1,adjustY:1},Aa=[0,0],TN={left:{points:["cr","cl"],overflow:Oa,offset:[-4,0],targetOffset:Aa},right:{points:["cl","cr"],overflow:Oa,offset:[4,0],targetOffset:Aa},top:{points:["bc","tc"],overflow:Oa,offset:[0,-4],targetOffset:Aa},bottom:{points:["tc","bc"],overflow:Oa,offset:[0,4],targetOffset:Aa},topLeft:{points:["bl","tl"],overflow:Oa,offset:[0,-4],targetOffset:Aa},leftTop:{points:["tr","tl"],overflow:Oa,offset:[-4,0],targetOffset:Aa},topRight:{points:["br","tr"],overflow:Oa,offset:[0,-4],targetOffset:Aa},rightTop:{points:["tl","tr"],overflow:Oa,offset:[4,0],targetOffset:Aa},bottomRight:{points:["tr","br"],overflow:Oa,offset:[0,4],targetOffset:Aa},rightBottom:{points:["bl","br"],overflow:Oa,offset:[4,0],targetOffset:Aa},bottomLeft:{points:["tl","bl"],overflow:Oa,offset:[0,4],targetOffset:Aa},leftBottom:{points:["br","bl"],overflow:Oa,offset:[-4,0],targetOffset:Aa}};function vX(e){var t=e.showArrow,r=e.arrowContent,n=e.children,i=e.prefixCls,a=e.id,u=e.overlayInnerStyle,o=e.className,f=e.style;return Xe("div",{className:Qe("".concat(i,"-content"),o),style:f,children:[t!==!1&&S("div",{className:"".concat(i,"-arrow"),children:r},"arrow"),S("div",{className:"".concat(i,"-inner"),id:a,role:"tooltip",style:u,children:typeof n=="function"?n():n})]})}var gX=function(t,r){var n=t.overlayClassName,i=t.trigger,a=i===void 0?["hover"]:i,u=t.mouseEnterDelay,o=u===void 0?0:u,f=t.mouseLeaveDelay,p=f===void 0?.1:f,v=t.overlayStyle,y=t.prefixCls,w=y===void 0?"rc-tooltip":y,k=t.children,T=t.onVisibleChange,R=t.afterVisibleChange,A=t.transitionName,I=t.animation,O=t.motion,N=t.placement,L=N===void 0?"right":N,B=t.align,j=B===void 0?{}:B,G=t.destroyTooltipOnHide,H=G===void 0?!1:G,te=t.defaultVisible,Y=t.getTooltipContainer,le=t.overlayInnerStyle,J=t.arrowContent,Z=t.overlay,Q=t.id,ge=t.showArrow,ne=Mr(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),de=C.exports.useRef(null);C.exports.useImperativeHandle(r,function(){return de.current});var oe=ve({},ne);"visible"in t&&(oe.popupVisible=t.visible);var ye=function(){return S(vX,{showArrow:ge,arrowContent:J,prefixCls:w,id:Q,overlayInnerStyle:le,children:Z},"content")},Re=!1,Te=!1;if(typeof H=="boolean")Re=H;else if(H&&ar(H)==="object"){var ke=H.keepParent;Re=ke===!0,Te=ke===!1}return S(vx,{popupClassName:n,prefixCls:w,popup:ye,action:a,builtinPlacements:TN,popupPlacement:L,ref:de,popupAlign:j,getPopupContainer:Y,onPopupVisibleChange:T,afterPopupVisibleChange:R,popupTransitionName:A,popupAnimation:I,popupMotion:O,defaultPopupVisible:te,destroyPopupOnHide:Re,autoDestroy:Te,mouseLeaveDelay:p,popupStyle:v,mouseEnterDelay:o,...oe,children:k})};const yX=C.exports.forwardRef(gX);Sa("success","processing","error","default","warning");var xX=Sa("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"),_X={adjustX:1,adjustY:1},tP={adjustX:0,adjustY:0},bX=[0,0];function rP(e){return typeof e=="boolean"?e?_X:tP:tt(tt({},tP),e)}function PN(e){var t=e.arrowWidth,r=t===void 0?4:t,n=e.horizontalArrowShift,i=n===void 0?16:n,a=e.verticalArrowShift,u=a===void 0?8:a,o=e.autoAdjustOverflow,f=e.arrowPointAtCenter,p={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+r),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(u+r)]},topRight:{points:["br","tc"],offset:[i+r,-4]},rightTop:{points:["tl","cr"],offset:[4,-(u+r)]},bottomRight:{points:["tr","bc"],offset:[i+r,4]},rightBottom:{points:["bl","cr"],offset:[4,u+r]},bottomLeft:{points:["tl","bc"],offset:[-(i+r),4]},leftBottom:{points:["br","cl"],offset:[-4,u+r]}};return Object.keys(p).forEach(function(v){p[v]=f?tt(tt({},p[v]),{overflow:rP(o),targetOffset:bX}):tt(tt({},TN[v]),{overflow:rP(o)}),p[v].ignoreShake=!0}),p}var wX=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1;if(uS(e)){var r=e.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(r)||e.isContentEditable||r==="a"&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),a=Number(i),u=null;return i&&!Number.isNaN(a)?u=a:n&&u===null&&(u=0),n&&e.disabled&&(u=null),u!==null&&(u>=0||t&&u<0)}return!1}function DN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=wt(e.querySelectorAll("*")).filter(function(n){return oP(n,t)});return oP(e,t)&&r.unshift(e),r}var P4=Et.LEFT,M4=Et.RIGHT,I4=Et.UP,o0=Et.DOWN,a0=Et.ENTER,LN=Et.ESC,Lp=Et.HOME,Fp=Et.END,aP=[I4,o0,P4,M4];function NX(e,t,r,n){var i,a,u,o,f="prev",p="next",v="children",y="parent";if(e==="inline"&&n===a0)return{inlineTrigger:!0};var w=(i={},se(i,I4,f),se(i,o0,p),i),k=(a={},se(a,P4,r?p:f),se(a,M4,r?f:p),se(a,o0,v),se(a,a0,v),a),T=(u={},se(u,I4,f),se(u,o0,p),se(u,a0,v),se(u,LN,y),se(u,P4,r?v:y),se(u,M4,r?y:v),u),R={inline:w,horizontal:k,vertical:T,inlineSub:w,horizontalSub:T,verticalSub:T},A=(o=R["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[n];switch(A){case f:return{offset:-1,sibling:!0};case p:return{offset:1,sibling:!0};case y:return{offset:-1,sibling:!1};case v:return{offset:1,sibling:!1};default:return null}}function zX(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function DX(e,t){for(var r=e||document.activeElement;r;){if(t.has(r))return r;r=r.parentElement}return null}function FN(e,t){var r=DN(e,!0);return r.filter(function(n){return t.has(n)})}function sP(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var i=FN(e,t),a=i.length,u=i.findIndex(function(o){return r===o});return n<0?u===-1?u=a-1:u-=1:n>0&&(u+=1),u=(u+a)%a,i[u]}function LX(e,t,r,n,i,a,u,o,f,p){var v=C.exports.useRef(),y=C.exports.useRef();y.current=t;var w=function(){rn.cancel(v.current)};return C.exports.useEffect(function(){return function(){w()}},[]),function(k){var T=k.which;if([].concat(aP,[a0,LN,Lp,Fp]).includes(T)){var R,A,I,O=function(){R=new Set,A=new Map,I=new Map;var ge=a();return ge.forEach(function(ne){var de=document.querySelector("[data-menu-id='".concat(xS(n,ne),"']"));de&&(R.add(de),I.set(de,ne),A.set(ne,de))}),R};O();var N=A.get(t),L=DX(N,R),B=I.get(L),j=NX(e,u(B,!0).length===1,r,T);if(!j&&T!==Lp&&T!==Fp)return;(aP.includes(T)||[Lp,Fp].includes(T))&&k.preventDefault();var G=function(ge){if(ge){var ne=ge,de=ge.querySelector("a");de!=null&&de.getAttribute("href")&&(ne=de);var oe=I.get(ge);o(oe),w(),v.current=rn(function(){y.current===oe&&ne.focus()})}};if([Lp,Fp].includes(T)||j.sibling||!L){var H;!L||e==="inline"?H=i.current:H=zX(L);var te,Y=FN(H,R);T===Lp?te=Y[0]:T===Fp?te=Y[Y.length-1]:te=sP(H,R,L,j.offset),G(te)}else if(j.inlineTrigger)f(B);else if(j.offset>0)f(B,!0),w(),v.current=rn(function(){O();var Q=L.getAttribute("aria-controls"),ge=document.getElementById(Q),ne=sP(ge,R);G(ne)},5);else if(j.offset<0){var le=u(B,!0),J=le[le.length-2],Z=A.get(J);f(J,!1),G(Z)}}p==null||p(k)}}function FX(e){Promise.resolve().then(e)}var bS="__RC_UTIL_PATH_SPLIT__",lP=function(t){return t.join(bS)},$X=function(t){return t.split(bS)},R4="rc-menu-more";function BX(){var e=C.exports.useState({}),t=Le(e,2),r=t[1],n=C.exports.useRef(new Map),i=C.exports.useRef(new Map),a=C.exports.useState([]),u=Le(a,2),o=u[0],f=u[1],p=C.exports.useRef(0),v=C.exports.useRef(!1),y=function(){v.current||r({})},w=C.exports.useCallback(function(N,L){var B=lP(L);i.current.set(B,N),n.current.set(N,B),p.current+=1;var j=p.current;FX(function(){j===p.current&&y()})},[]),k=C.exports.useCallback(function(N,L){var B=lP(L);i.current.delete(B),n.current.delete(N)},[]),T=C.exports.useCallback(function(N){f(N)},[]),R=C.exports.useCallback(function(N,L){var B=n.current.get(N)||"",j=$X(B);return L&&o.includes(j[0])&&j.unshift(R4),j},[o]),A=C.exports.useCallback(function(N,L){return N.some(function(B){var j=R(B,!0);return j.includes(L)})},[R]),I=function(){var L=wt(n.current.keys());return o.length&&L.push(R4),L},O=C.exports.useCallback(function(N){var L="".concat(n.current.get(N)).concat(bS),B=new Set;return wt(i.current.keys()).forEach(function(j){j.startsWith(L)&&B.add(i.current.get(j))}),B},[]);return C.exports.useEffect(function(){return function(){v.current=!0}},[]),{registerPath:w,unregisterPath:k,refreshOverflowKeys:T,isSubPathKey:A,getKeyPath:R,getKeys:I,getSubPathKeys:O}}function uf(e){var t=C.exports.useRef(e);t.current=e;var r=C.exports.useCallback(function(){for(var n,i=arguments.length,a=new Array(i),u=0;u1&&(O.motionAppear=!1);var N=O.onVisibleChanged;return O.onVisibleChanged=function(L){return!w.current&&!L&&A(!0),N==null?void 0:N(L)},R?null:S(Zm,{mode:a,locked:!w.current,children:S(Za,{visible:I,...O,forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(o,"-hidden"),children:function(L){var B=L.className,j=L.style;return S(wS,{id:t,className:B,style:j,children:i})}})})}var iY=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],oY=["active"],aY=function(t){var r,n=t.style,i=t.className,a=t.title,u=t.eventKey;t.warnKey;var o=t.disabled,f=t.internalPopupClose,p=t.children,v=t.itemIcon,y=t.expandIcon,w=t.popupClassName,k=t.popupOffset,T=t.onClick,R=t.onMouseEnter,A=t.onMouseLeave,I=t.onTitleClick,O=t.onTitleMouseEnter,N=t.onTitleMouseLeave,L=Mr(t,iY),B=ON(u),j=C.exports.useContext(bs),G=j.prefixCls,H=j.mode,te=j.openKeys,Y=j.disabled,le=j.overflowDisabled,J=j.activeKey,Z=j.selectedKeys,Q=j.itemIcon,ge=j.expandIcon,ne=j.onItemClick,de=j.onOpenChange,oe=j.onActive,ye=C.exports.useContext(_S),Re=ye._internalRenderSubMenuItem,Te=C.exports.useContext(zN),ke=Te.isSubPathKey,ze=gh(),Ie="".concat(G,"-submenu"),Ne=Y||o,De=C.exports.useRef(),Ve=C.exports.useRef(),Ge=v||Q,je=y||ge,ct=te.includes(u),pt=!le&&ct,Tt=ke(Z,u),Ye=$N(u,Ne,O,N),Pt=Ye.active,mt=Mr(Ye,oY),It=C.exports.useState(!1),Ct=Le(It,2),Dt=Ct[0],lt=Ct[1],dt=function(xr){Ne||lt(xr)},ut=function(xr){dt(!0),R==null||R({key:u,domEvent:xr})},it=function(xr){dt(!1),A==null||A({key:u,domEvent:xr})},ft=C.exports.useMemo(function(){return Pt||(H!=="inline"?Dt||ke([J],u):!1)},[H,Pt,J,Dt,u,ke]),xt=VN(ze.length),Wt=function(xr){Ne||(I==null||I({key:u,domEvent:xr}),H==="inline"&&de(u,!ct))},jt=uf(function(rr){T==null||T(i1(rr)),ne(rr)}),Qt=function(xr){H!=="inline"&&de(u,xr)},Fe=function(){oe(u)},qe=B&&"".concat(B,"-popup"),Xt=Xe("div",{role:"menuitem",style:xt,className:"".concat(Ie,"-title"),tabIndex:Ne?null:-1,ref:De,title:typeof a=="string"?a:null,"data-menu-id":le&&B?null:B,"aria-expanded":pt,"aria-haspopup":!0,"aria-controls":qe,"aria-disabled":Ne,onClick:Wt,onFocus:Fe,...mt,children:[a,S(BN,{icon:H!=="horizontal"?je:null,props:ve(ve({},t),{},{isOpen:pt,isSubMenu:!0}),children:S("i",{className:"".concat(Ie,"-arrow")})})]}),cr=C.exports.useRef(H);if(H!=="inline"&&ze.length>1?cr.current="vertical":cr.current=H,!le){var Vt=cr.current;Xt=S(rY,{mode:Vt,prefixCls:Ie,visible:!f&&pt&&H!=="inline",popupClassName:w,popupOffset:k,popup:S(Zm,{mode:Vt==="horizontal"?"vertical":Vt,children:S(wS,{id:qe,ref:Ve,children:p})}),disabled:Ne,onVisibleChange:Qt,children:Xt})}var Ut=Xe(Ws.Item,{role:"none",...L,component:"li",style:n,className:Qe(Ie,"".concat(Ie,"-").concat(H),i,(r={},se(r,"".concat(Ie,"-open"),pt),se(r,"".concat(Ie,"-active"),ft),se(r,"".concat(Ie,"-selected"),Tt),se(r,"".concat(Ie,"-disabled"),Ne),r)),onMouseEnter:ut,onMouseLeave:it,children:[Xt,!le&&S(nY,{id:qe,open:pt,keyPath:ze,children:p})]});return Re&&(Ut=Re(Ut,t,{selected:Tt,active:ft,open:pt,disabled:Ne})),S(Zm,{onItemClick:jt,mode:H==="horizontal"?"vertical":H,itemIcon:Ge,expandIcon:je,children:Ut})};function bx(e){var t=e.eventKey,r=e.children,n=gh(t),i=CS(r,n),a=xx();C.exports.useEffect(function(){if(a)return a.registerPath(t,n),function(){a.unregisterPath(t,n)}},[n]);var u;return a?u=i:u=S(aY,{...e,children:i}),S(NN.Provider,{value:n,children:u})}var sY=["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"],of=[],lY=C.exports.forwardRef(function(e,t){var r,n,i=e,a=i.prefixCls,u=a===void 0?"rc-menu":a,o=i.rootClassName,f=i.style,p=i.className,v=i.tabIndex,y=v===void 0?0:v,w=i.items,k=i.children,T=i.direction,R=i.id,A=i.mode,I=A===void 0?"vertical":A,O=i.inlineCollapsed,N=i.disabled,L=i.disabledOverflow,B=i.subMenuOpenDelay,j=B===void 0?.1:B,G=i.subMenuCloseDelay,H=G===void 0?.1:G,te=i.forceSubMenuRender,Y=i.defaultOpenKeys,le=i.openKeys,J=i.activeKey,Z=i.defaultActiveFirst,Q=i.selectable,ge=Q===void 0?!0:Q,ne=i.multiple,de=ne===void 0?!1:ne,oe=i.defaultSelectedKeys,ye=i.selectedKeys,Re=i.onSelect,Te=i.onDeselect,ke=i.inlineIndent,ze=ke===void 0?24:ke,Ie=i.motion,Ne=i.defaultMotions,De=i.triggerSubMenuAction,Ve=De===void 0?"hover":De,Ge=i.builtinPlacements,je=i.itemIcon,ct=i.expandIcon,pt=i.overflowedIndicator,Tt=pt===void 0?"...":pt,Ye=i.overflowedIndicatorPopupClassName,Pt=i.getPopupContainer,mt=i.onClick,It=i.onOpenChange,Ct=i.onKeyDown;i.openAnimation,i.openTransitionName;var Dt=i._internalRenderMenuItem,lt=i._internalRenderSubMenuItem,dt=Mr(i,sY),ut=C.exports.useMemo(function(){return QX(k,w,of)},[k,w]),it=C.exports.useState(!1),ft=Le(it,2),xt=ft[0],Wt=ft[1],jt=C.exports.useRef(),Qt=jX(R),Fe=T==="rtl",qe=Yi(Y,{value:le,postState:function(Lr){return Lr||of}}),Xt=Le(qe,2),cr=Xt[0],Vt=Xt[1],Ut=function(Lr){var Yr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function wn(){Vt(Lr),It==null||It(Lr)}Yr?Yu.exports.flushSync(wn):wn()},rr=C.exports.useState(cr),xr=Le(rr,2),Or=xr[0],_t=xr[1],qt=C.exports.useRef(!1),or=C.exports.useMemo(function(){return(I==="inline"||I==="vertical")&&O?["vertical",O]:[I,!1]},[I,O]),$r=Le(or,2),Er=$r[0],Lt=$r[1],kr=Er==="inline",wr=C.exports.useState(Er),fr=Le(wr,2),Nt=fr[0],ot=fr[1],ht=C.exports.useState(Lt),Ot=Le(ht,2),$t=Ot[0],ur=Ot[1];C.exports.useEffect(function(){ot(Er),ur(Lt),qt.current&&(kr?Vt(Or):Ut(of))},[Er,Lt]);var Ir=C.exports.useState(0),qr=Le(Ir,2),Gr=qr[0],me=qr[1],K=Gr>=ut.length-1||Nt!=="horizontal"||L;C.exports.useEffect(function(){kr&&_t(cr)},[cr]),C.exports.useEffect(function(){return qt.current=!0,function(){qt.current=!1}},[]);var q=BX(),ce=q.registerPath,ae=q.unregisterPath,xe=q.refreshOverflowKeys,Ee=q.isSubPathKey,be=q.getKeyPath,Ce=q.getKeys,Ae=q.getSubPathKeys,He=C.exports.useMemo(function(){return{registerPath:ce,unregisterPath:ae}},[ce,ae]),We=C.exports.useMemo(function(){return{isSubPathKey:Ee}},[Ee]);C.exports.useEffect(function(){xe(K?of:ut.slice(Gr+1).map(function(Ur){return Ur.key}))},[Gr,K]);var Be=Yi(J||Z&&((r=ut[0])===null||r===void 0?void 0:r.key),{value:J}),At=Le(Be,2),bt=At[0],Je=At[1],Rt=uf(function(Ur){Je(Ur)}),Bt=uf(function(){Je(void 0)});C.exports.useImperativeHandle(t,function(){return{list:jt.current,focus:function(Lr){var Yr,wn=bt!=null?bt:(Yr=ut.find(function(Gl){return!Gl.props.disabled}))===null||Yr===void 0?void 0:Yr.key;if(wn){var Sn,jn,bo;(Sn=jt.current)===null||Sn===void 0||(jn=Sn.querySelector("li[data-menu-id='".concat(xS(Qt,wn),"']")))===null||jn===void 0||(bo=jn.focus)===null||bo===void 0||bo.call(jn,Lr)}}}});var vr=Yi(oe||[],{value:ye,postState:function(Lr){return Array.isArray(Lr)?Lr:Lr==null?of:[Lr]}}),ir=Le(vr,2),gr=ir[0],Br=ir[1],Jr=function(Lr){if(ge){var Yr=Lr.key,wn=gr.includes(Yr),Sn;de?wn?Sn=gr.filter(function(bo){return bo!==Yr}):Sn=[].concat(wt(gr),[Yr]):Sn=[Yr],Br(Sn);var jn=ve(ve({},Lr),{},{selectedKeys:Sn});wn?Te==null||Te(jn):Re==null||Re(jn)}!de&&cr.length&&Nt!=="inline"&&Ut(of)},Vn=uf(function(Ur){mt==null||mt(i1(Ur)),Jr(Ur)}),an=uf(function(Ur,Lr){var Yr=cr.filter(function(Sn){return Sn!==Ur});if(Lr)Yr.push(Ur);else if(Nt!=="inline"){var wn=Ae(Ur);Yr=Yr.filter(function(Sn){return!wn.has(Sn)})}lS(cr,Yr,!0)||Ut(Yr,!0)}),On=uf(Pt),Pr=function(Lr,Yr){var wn=Yr!=null?Yr:!cr.includes(Lr);an(Lr,wn)},Cr=LX(Nt,bt,Fe,Qt,jt,Ce,be,Je,Pr,Ct);C.exports.useEffect(function(){Wt(!0)},[]);var Rr=C.exports.useMemo(function(){return{_internalRenderMenuItem:Dt,_internalRenderSubMenuItem:lt}},[Dt,lt]),ei=Nt!=="horizontal"||L?ut:ut.map(function(Ur,Lr){return S(Zm,{overflowDisabled:Lr>Gr,children:Ur},Ur.key)}),yn=S(Ws,{id:R,ref:jt,prefixCls:"".concat(u,"-overflow"),component:"ul",itemComponent:_x,className:Qe(u,"".concat(u,"-root"),"".concat(u,"-").concat(Nt),p,(n={},se(n,"".concat(u,"-inline-collapsed"),$t),se(n,"".concat(u,"-rtl"),Fe),n),o),dir:T,style:f,role:"menu",tabIndex:y,data:ei,renderRawItem:function(Lr){return Lr},renderRawRest:function(Lr){var Yr=Lr.length,wn=Yr?ut.slice(-Yr):null;return S(bx,{eventKey:R4,title:Tt,disabled:K,internalPopupClose:Yr===0,popupClassName:Ye,children:wn})},maxCount:Nt!=="horizontal"||L?Ws.INVALIDATE:Ws.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Lr){me(Lr)},onKeyDown:Cr,...dt});return S(_S.Provider,{value:Rr,children:S(RN.Provider,{value:Qt,children:Xe(Zm,{prefixCls:u,rootClassName:o,mode:Nt,openKeys:cr,rtl:Fe,disabled:N,motion:xt?Ie:null,defaultMotions:xt?Ne:null,activeKey:bt,onActive:Rt,onInactive:Bt,selectedKeys:gr,inlineIndent:ze,subMenuOpenDelay:j,subMenuCloseDelay:H,forceSubMenuRender:te,builtinPlacements:Ge,triggerSubMenuAction:Ve,getPopupContainer:On,itemIcon:je,expandIcon:ct,onItemClick:Vn,onOpenChange:an,children:[S(zN.Provider,{value:We,children:yn}),S("div",{style:{display:"none"},"aria-hidden":!0,children:S(AN.Provider,{value:He,children:ut})})]})})})}),uY=["className","title","eventKey","children"],cY=["children"],dY=function(t){var r=t.className,n=t.title;t.eventKey;var i=t.children,a=Mr(t,uY),u=C.exports.useContext(bs),o=u.prefixCls,f="".concat(o,"-item-group");return Xe("li",{role:"presentation",...a,onClick:function(v){return v.stopPropagation()},className:Qe(f,r),children:[S("div",{role:"presentation",className:"".concat(f,"-title"),title:typeof n=="string"?n:void 0,children:n}),S("ul",{role:"group",className:"".concat(f,"-list"),children:i})]})};function wx(e){var t=e.children,r=Mr(e,cY),n=gh(r.eventKey),i=CS(t,n),a=xx();return a?i:S(dY,{...Si(r,["warnKey"]),children:i})}function SS(e){var t=e.className,r=e.style,n=C.exports.useContext(bs),i=n.prefixCls,a=xx();return a?null:S("li",{className:Qe("".concat(i,"-item-divider"),t),style:r})}var _v=lY;_v.Item=_x;_v.SubMenu=bx;_v.ItemGroup=wx;_v.Divider=SS;var fY={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 hY=fY;var UN=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:hY})})};UN.displayName="LeftOutlined";const pY=C.exports.forwardRef(UN);var mY={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 vY=mY;var KN=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:vY})})};KN.displayName="RightOutlined";const ES=C.exports.forwardRef(KN);globalThis&&globalThis.__rest;var HN=C.exports.createContext({}),gY=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i"u"?j=v?A:"":O===!1&&(j="");var G={title:j};!u&&!y&&(G.title=null,G.open=!1);var H=lo(A).length,te=Xe(_x,{...B,className:Qe((a={},se(a,"".concat(p,"-item-danger"),L),se(a,"".concat(p,"-item-only-child"),(N?H+1:H)===1),a),R),title:typeof O=="string"?O:void 0,children:[Ni(N,{className:Qe(Yo(N)?(o=N.props)===null||o===void 0?void 0:o.className:"","".concat(p,"-item-icon"))}),n.renderItemChildren(y)]});return k||(te=S(yo,{...G,placement:w==="rtl"?"left":"right",overlayClassName:"".concat(p,"-inline-collapsed-tooltip"),children:te})),te},n}return Jn(r,[{key:"renderItemChildren",value:function(i){var a=this.context,u=a.prefixCls,o=a.firstLevel,f=this.props,p=f.icon,v=f.children,y=S("span",{className:"".concat(u,"-title-content"),children:v});return(!p||Yo(v)&&v.type==="span")&&v&&i&&o&&typeof v=="string"?S("div",{className:"".concat(u,"-inline-collapsed-noicon"),children:v.charAt(0)}):y}},{key:"render",value:function(){return S(HN.Consumer,{children:this.renderItem})}}]),r}(C.exports.Component);kS.contextType=o1;function qN(e){var t,r=e.popupClassName,n=e.icon,i=e.title,a=e.theme,u=C.exports.useContext(o1),o=u.prefixCls,f=u.inlineCollapsed,p=u.antdMenuTheme,v=gh(),y;if(!n)y=f&&!v.length&&i&&typeof i=="string"?S("div",{className:"".concat(o,"-inline-collapsed-noicon"),children:i.charAt(0)}):S("span",{className:"".concat(o,"-title-content"),children:i});else{var w=Yo(i)&&i.type==="span";y=Xe(Ar,{children:[Ni(n,{className:Qe(Yo(n)?(t=n.props)===null||t===void 0?void 0:t.className:"","".concat(o,"-item-icon"))}),w?i:S("span",{className:"".concat(o,"-title-content"),children:i})]})}var k=C.exports.useMemo(function(){return tt(tt({},u),{firstLevel:!1})},[u]);return S(o1.Provider,{value:k,children:S(bx,{...Si(e,["icon"]),title:y,popupClassName:Qe(o,"".concat(o,"-").concat(a||p),r)})})}var bY=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:1,r=AY++,n=t;function i(){n-=1,n<=0?(e(),delete zf[r]):zf[r]=rn(i)}return zf[r]=rn(i),r}s1.cancel=function(t){t!==void 0&&(rn.cancel(zf[t]),delete zf[t])};s1.ids=zf;var o2;function cP(e){return!e||e.offsetParent===null||e.hidden}function NY(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 zY(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 XN=function(e){vi(r,e);var t=gi(r);function r(){var n;return Qn(this,r),n=t.apply(this,arguments),n.containerRef=C.exports.createRef(),n.animationStart=!1,n.destroyed=!1,n.onClick=function(i,a){var u,o,f=n.props,p=f.insertExtraNode,v=f.disabled;if(!(v||!i||cP(i)||i.className.includes("-leave"))){n.extraNode=document.createElement("div");var y=Nr(n),w=y.extraNode,k=n.context.getPrefixCls;w.className="".concat(k(""),"-click-animating-node");var T=n.getAttributeName();if(i.setAttribute(T,"true"),a&&a!=="#fff"&&a!=="#ffffff"&&a!=="rgb(255, 255, 255)"&&a!=="rgba(255, 255, 255, 1)"&&zY(a)&&!/rgba\((?:\d*, ){3}0\)/.test(a)&&a!=="transparent"){w.style.borderColor=a;var R=((u=i.getRootNode)===null||u===void 0?void 0:u.call(i))||i.ownerDocument,A=(o=NY(R))!==null&&o!==void 0?o:R;o2=vv(` [`.concat(k(""),"-click-animating-without-extra-node='true']::after, .").concat(k(""),`-click-animating-node { --antd-wave-shadow-color: `).concat(a,`; }`),"antd-wave",{csp:n.csp,attachTo:A})}p&&i.appendChild(w),["transition","animation"].forEach(function(I){i.addEventListener("".concat(I,"start"),n.onTransitionStart),i.addEventListener("".concat(I,"end"),n.onTransitionEnd)})}},n.onTransitionStart=function(i){if(!n.destroyed){var a=n.containerRef.current;!i||i.target!==a||n.animationStart||n.resetEffect(a)}},n.onTransitionEnd=function(i){!i||i.animationName!=="fadeEffect"||n.resetEffect(i.target)},n.bindAnimationEvent=function(i){if(!(!i||!i.getAttribute||i.getAttribute("disabled")||i.className.includes("disabled"))){var a=function(o){if(!(o.target.tagName==="INPUT"||cP(o.target))){n.resetEffect(i);var f=getComputedStyle(i).getPropertyValue("border-top-color")||getComputedStyle(i).getPropertyValue("border-color")||getComputedStyle(i).getPropertyValue("background-color");n.clickWaveTimeoutId=window.setTimeout(function(){return n.onClick(i,f)},0),s1.cancel(n.animationStartId),n.animationStart=!0,n.animationStartId=s1(function(){n.animationStart=!1},10)}};return i.addEventListener("click",a,!0),{cancel:function(){i.removeEventListener("click",a,!0)}}}},n.renderWave=function(i){var a=i.csp,u=n.props.children;if(n.csp=a,!C.exports.isValidElement(u))return u;var o=n.containerRef;return md(u)&&(o=ta(u.ref,n.containerRef)),Ni(u,{ref:o})},n}return Jn(r,[{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,a=this.props.insertExtraNode;return a?"".concat(i(""),"-click-animating"):"".concat(i(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(i){var a=this;if(!(!i||i===this.extraNode||!(i instanceof Element))){var u=this.props.insertExtraNode,o=this.getAttributeName();i.setAttribute(o,"false"),o2&&(o2.innerHTML=""),u&&this.extraNode&&i.contains(this.extraNode)&&i.removeChild(this.extraNode),["transition","animation"].forEach(function(f){i.removeEventListener("".concat(f,"start"),a.onTransitionStart),i.removeEventListener("".concat(f,"end"),a.onTransitionEnd)})}}},{key:"render",value:function(){return S(tc,{children:this.renderWave})}}]),r}(C.exports.Component);XN.contextType=zr;const DY=XN;var LY=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&(Z=R.map(function(ne){return typeof ne=="string"||typeof ne=="number"?S(l1,{prefixCls:le,disabled:O,value:ne,checked:p===ne,children:ne},ne.toString()):S(l1,{prefixCls:le,disabled:ne.disabled||O,value:ne.value,checked:p===ne.value,style:ne.style,children:ne.label},"radio-group-value-options-".concat(ne.value))}));var Q=L||u,ge=Qe(J,"".concat(J,"-").concat(I),(r={},se(r,"".concat(J,"-").concat(Q),Q),se(r,"".concat(J,"-rtl"),a==="rtl"),r),T);return S("div",{...MA(e),className:ge,style:B,onMouseEnter:G,onMouseLeave:H,onFocus:te,onBlur:Y,id:j,ref:t,children:S(KQ,{value:{onChange:y,value:p,disabled:e.disabled,name:e.name,optionType:e.optionType},children:Z})})});const XQ=C.exports.memo(ZQ);var YQ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=t||G<0||y&&H>=a}function I(){var j=u2();if(A(j))return O(j);o=setTimeout(I,R(j))}function O(j){return o=void 0,w&&n?k(j):(n=i=void 0,u)}function N(){o!==void 0&&clearTimeout(o),p=0,n=f=i=o=void 0}function L(){return o===void 0?u:O(u2())}function B(){var j=u2(),G=A(j);if(n=arguments,i=this,f=j,G){if(o===void 0)return T(f);if(y)return clearTimeout(o),o=setTimeout(I,t),k(f)}return o===void 0&&(o=setTimeout(I,t)),u}return B.cancel=N,B.flush=L,B}var lJ=sJ;function d9(e,t){var r=new Set;return e.forEach(function(n){t.has(n)||r.add(n)}),r}function uJ(e){var t=e||{},r=t.disabled,n=t.disableCheckbox,i=t.checkable;return!!(r||n)||i===!1}function cJ(e,t,r,n){for(var i=new Set(e),a=new Set,u=0;u<=r;u+=1){var o=t.get(u)||new Set;o.forEach(function(y){var w=y.key,k=y.node,T=y.children,R=T===void 0?[]:T;i.has(w)&&!n(k)&&R.filter(function(A){return!n(A.node)}).forEach(function(A){i.add(A.key)})})}for(var f=new Set,p=r;p>=0;p-=1){var v=t.get(p)||new Set;v.forEach(function(y){var w=y.parent,k=y.node;if(!(n(k)||!y.parent||f.has(y.parent.key))){if(n(y.parent.node)){f.add(w.key);return}var T=!0,R=!1;(w.children||[]).filter(function(A){return!n(A.node)}).forEach(function(A){var I=A.key,O=i.has(I);T&&!O&&(T=!1),!R&&(O||a.has(I))&&(R=!0)}),T&&i.add(w.key),R&&a.add(w.key),f.add(w.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(d9(a,i))}}function dJ(e,t,r,n,i){for(var a=new Set(e),u=new Set(t),o=0;o<=n;o+=1){var f=r.get(o)||new Set;f.forEach(function(w){var k=w.key,T=w.node,R=w.children,A=R===void 0?[]:R;!a.has(k)&&!u.has(k)&&!i(T)&&A.filter(function(I){return!i(I.node)}).forEach(function(I){a.delete(I.key)})})}u=new Set;for(var p=new Set,v=n;v>=0;v-=1){var y=r.get(v)||new Set;y.forEach(function(w){var k=w.parent,T=w.node;if(!(i(T)||!w.parent||p.has(w.parent.key))){if(i(w.parent.node)){p.add(k.key);return}var R=!0,A=!1;(k.children||[]).filter(function(I){return!i(I.node)}).forEach(function(I){var O=I.key,N=a.has(O);R&&!N&&(R=!1),!A&&(N||u.has(O))&&(A=!0)}),R||a.delete(k.key),A&&u.add(k.key),p.add(k.key)}})}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(d9(u,a))}}function Pl(e,t,r,n){var i=[],a;n?a=n:a=uJ;var u=new Set(e.filter(function(v){var y=!!r[v];return y||i.push(v),y})),o=new Map,f=0;Object.keys(r).forEach(function(v){var y=r[v],w=y.level,k=o.get(w);k||(k=new Set,o.set(w,k)),k.add(y),f=Math.max(f,w)}),Bn(!i.length,"Tree missing follow keys: ".concat(i.slice(0,100).map(function(v){return"'".concat(v,"'")}).join(", ")));var p;return t===!0?p=cJ(u,o,f,a):p=dJ(u,t.halfCheckedKeys,o,f,a),p}var AS=C.exports.createContext(null),fJ=function(t){for(var r=t.prefixCls,n=t.level,i=t.isStart,a=t.isEnd,u="".concat(r,"-indent-unit"),o=[],f=0;f=0&&r.splice(n,1),r}function vl(e,t){var r=(e||[]).slice();return r.indexOf(t)===-1&&r.push(t),r}function NS(e){return e.split("-")}function f9(e,t){return"".concat(e,"-").concat(t)}function gJ(e){return e&&e.type&&e.type.isTreeNode}function yJ(e,t){var r=[],n=t[e];function i(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.forEach(function(u){var o=u.key,f=u.children;r.push(o),i(f)})}return i(n.children),r}function xJ(e){if(e.parent){var t=NS(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function _J(e){var t=NS(e.pos);return Number(t[t.length-1])===0}function _P(e,t,r,n,i,a,u,o,f,p){var v,y=e.clientX,w=e.clientY,k=e.target.getBoundingClientRect(),T=k.top,R=k.height,A=(p==="rtl"?-1:1)*(((i==null?void 0:i.x)||0)-y),I=(A-12)/n,O=o[r.props.eventKey];if(w-1.5?a({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1:a({dragNode:J,dropNode:Z,dropPosition:0})?te=0:a({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1:a({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1,{dropPosition:te,dropLevelOffset:Y,dropTargetKey:O.key,dropTargetPos:O.pos,dragOverNodeKey:H,dropContainerKey:te===0?null:((v=O.parent)===null||v===void 0?void 0:v.key)||null,dropAllowed:Q}}function bP(e,t){if(!!e){var r=t.multiple;return r?e.slice():e.length?[e[0]]:e}}function c2(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(ar(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return Bn(!1,"`checkedKeys` is not an array or an object"),null;return t}function D4(e,t){var r=new Set;function n(i){if(!r.has(i)){var a=t[i];if(!!a){r.add(i);var u=a.parent,o=a.node;o.disabled||u&&n(u.key)}}}return(e||[]).forEach(function(i){n(i)}),wt(r)}var bJ=["children"];function Sv(e,t){return e!=null?e:t}function u1(e){var t=e||{},r=t.title,n=t._title,i=t.key,a=t.children,u=r||"title";return{title:u,_title:n||[u],key:i||"key",children:a||"children"}}function h9(e){function t(r){var n=lo(r);return n.map(function(i){if(!gJ(i))return Bn(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var a=i.key,u=i.props,o=u.children,f=Mr(u,bJ),p=ve({key:a},f),v=t(o);return v.length&&(p.children=v),p}).filter(function(i){return i})}return t(e)}function d2(e,t,r){var n=u1(r),i=n._title,a=n.key,u=n.children,o=new Set(t===!0?[]:t),f=[];function p(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return v.map(function(w,k){for(var T=f9(y?y.pos:"0",k),R=Sv(w[a],T),A,I=0;I1&&arguments[1]!==void 0?arguments[1]:{},r=t.initWrapper,n=t.processEntity,i=t.onProcessFinished,a=t.externalGetKey,u=t.childrenPropName,o=t.fieldNames,f=arguments.length>2?arguments[2]:void 0,p=a||f,v={},y={},w={posEntities:v,keyEntities:y};return r&&(w=r(w)||w),wJ(e,function(k){var T=k.node,R=k.index,A=k.pos,I=k.key,O=k.parentPos,N=k.level,L=k.nodes,B={node:T,nodes:L,index:R,key:I,pos:A,level:N},j=Sv(I,A);v[A]=B,y[j]=B,B.parent=v[O],B.parent&&(B.parent.children=B.parent.children||[],B.parent.children.push(B)),n&&n(B,w)},{externalGetKey:p,childrenPropName:u,fieldNames:o}),i&&i(w),w}function gm(e,t){var r=t.expandedKeys,n=t.selectedKeys,i=t.loadedKeys,a=t.loadingKeys,u=t.checkedKeys,o=t.halfCheckedKeys,f=t.dragOverNodeKey,p=t.dropPosition,v=t.keyEntities,y=v[e],w={eventKey:e,expanded:r.indexOf(e)!==-1,selected:n.indexOf(e)!==-1,loaded:i.indexOf(e)!==-1,loading:a.indexOf(e)!==-1,checked:u.indexOf(e)!==-1,halfChecked:o.indexOf(e)!==-1,pos:String(y?y.pos:""),dragOver:f===e&&p===0,dragOverGapTop:f===e&&p===-1,dragOverGapBottom:f===e&&p===1};return w}function Ri(e){var t=e.data,r=e.expanded,n=e.selected,i=e.checked,a=e.loaded,u=e.loading,o=e.halfChecked,f=e.dragOver,p=e.dragOverGapTop,v=e.dragOverGapBottom,y=e.pos,w=e.active,k=e.eventKey,T=ve(ve({},t),{},{expanded:r,selected:n,checked:i,loaded:a,loading:u,halfChecked:o,dragOver:f,dragOverGapTop:p,dragOverGapBottom:v,pos:y,active:w,key:k});return"props"in T||Object.defineProperty(T,"props",{get:function(){return Bn(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),T}var CJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&(i=G().map(function(ne){return S(Sf,{prefixCls:le,disabled:"disabled"in ne?ne.disabled:y.disabled,value:ne.value,checked:I.includes(ne.value),onChange:ne.onChange,className:"".concat(J,"-item"),style:ne.style,children:ne.label},ne.value.toString())}));var Q={toggleOption:Y,value:I,disabled:y.disabled,name:y.name,registerValue:te,cancelValue:H},ge=Qe(J,se({},"".concat(J,"-rtl"),T==="rtl"),f);return S("div",{className:ge,style:p,...Z,ref:r,children:S(p9.Provider,{value:Q,children:i})})},EJ=C.exports.forwardRef(SJ);const kJ=C.exports.memo(EJ);var TJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0){var te=o[0]/2;H.paddingLeft=te,H.paddingRight=te}if(o&&o[1]>0&&!p){var Y=o[1]/2;H.paddingTop=Y,H.paddingBottom=Y}return O&&(H.flex=OJ(O),f===!1&&!H.minWidth&&(H.minWidth=0)),S("div",{...L,style:tt(tt({},H),N),className:G,ref:t,children:I})});const c1=NJ;var zJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0?Q[0]/-2:void 0,oe=Q[1]!=null&&Q[1]>0?Q[1]/-2:void 0;if(de&&(ne.marginLeft=de,ne.marginRight=de),Y){var ye=Le(Q,2);ne.rowGap=ye[1]}else oe&&(ne.marginTop=oe,ne.marginBottom=oe);var Re=Le(Q,2),Te=Re[0],ke=Re[1],ze=C.exports.useMemo(function(){return{gutter:[Te,ke],wrap:y,supportFlexGap:Y}},[Te,ke,y,Y]);return S(m9.Provider,{value:ze,children:S("div",{...w,className:ge,style:tt(tt({},ne),o),ref:t,children:f})})});const v9=DJ;var g9=C.exports.forwardRef(function(e,t){var r,n=e.prefixCls,i=e.forceRender,a=e.className,u=e.style,o=e.children,f=e.isActive,p=e.role,v=C.exports.useState(f||i),y=Le(v,2),w=y[0],k=y[1];return C.exports.useEffect(function(){(i||f)&&k(!0)},[i,f]),w?S("div",{ref:t,className:Qe("".concat(n,"-content"),(r={},se(r,"".concat(n,"-content-active"),f),se(r,"".concat(n,"-content-inactive"),!f),r),a),style:u,role:p,children:S("div",{className:"".concat(n,"-content-box"),children:o})}):null});g9.displayName="PanelContent";var LJ=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],y9=function(e){vi(r,e);var t=gi(r);function r(){var n;Qn(this,r);for(var i=arguments.length,a=new Array(i),u=0;u-1;y?p.splice(v,1):p.push(f)}i.setActiveKey(p)},i.getNewChild=function(f,p){if(!f)return null;var v=i.state.activeKey,y=i.props,w=y.prefixCls,k=y.openMotion,T=y.accordion,R=y.destroyInactivePanel,A=y.expandIcon,I=y.collapsible,O=f.key||String(p),N=f.props,L=N.header,B=N.headerClass,j=N.destroyInactivePanel,G=N.collapsible,H=!1;T?H=v[0]===O:H=v.indexOf(O)>-1;var te=G!=null?G:I,Y={key:O,panelKey:O,header:L,headerClass:B,isActive:H,prefixCls:w,destroyInactivePanel:j!=null?j:R,openMotion:k,accordion:T,children:f.props.children,onItemClick:te==="disabled"?null:i.onClickItem,expandIcon:A,collapsible:te};return typeof f.type=="string"?f:(Object.keys(Y).forEach(function(le){typeof Y[le]>"u"&&delete Y[le]}),C.exports.cloneElement(f,Y))},i.getItems=function(){var f=i.props.children;return lo(f).map(i.getNewChild)},i.setActiveKey=function(f){"activeKey"in i.props||i.setState({activeKey:f}),i.props.onChange(i.props.accordion?f[0]:f)};var a=n.activeKey,u=n.defaultActiveKey,o=u;return"activeKey"in n&&(o=a),i.state={activeKey:CP(o)},i}return Jn(r,[{key:"shouldComponentUpdate",value:function(i,a){return!ld(this.props,i)||!ld(this.state,a)}},{key:"render",value:function(){var i,a=this.props,u=a.prefixCls,o=a.className,f=a.style,p=a.accordion,v=Qe((i={},se(i,u,!0),se(i,o,!!o),i));return S("div",{className:v,style:f,role:p?"tablist":null,children:this.getItems()})}}],[{key:"getDerivedStateFromProps",value:function(i){var a={};return"activeKey"in i&&(a.activeKey=CP(i.activeKey)),a}}]),r}(C.exports.Component);Ev.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1};Ev.Panel=y9;Ev.Panel;var FJ=function(t){var r=C.exports.useContext(zr),n=r.getPrefixCls,i=t.prefixCls,a=t.className,u=a===void 0?"":a,o=t.showArrow,f=o===void 0?!0:o,p=n("collapse",i),v=Qe(se({},"".concat(p,"-no-arrow"),!f),u);return S(Ev.Panel,{...t,prefixCls:p,className:v})};const $J=FJ;var x9=function(t){var r,n=C.exports.useContext(zr),i=n.getPrefixCls,a=n.direction,u=t.prefixCls,o=t.className,f=o===void 0?"":o,p=t.bordered,v=p===void 0?!0:p,y=t.ghost,w=t.expandIconPosition,k=w===void 0?"start":w,T=i("collapse",u),R=C.exports.useMemo(function(){return k==="left"?"start":k==="right"?"end":k},[k]),A=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},j=t.expandIcon,G=j?j(B):S(ES,{rotate:B.isActive?90:void 0});return Ni(G,function(){return{className:Qe(G.props.className,"".concat(T,"-arrow"))}})},I=Qe("".concat(T,"-icon-position-").concat(R),(r={},se(r,"".concat(T,"-borderless"),!v),se(r,"".concat(T,"-rtl"),a==="rtl"),se(r,"".concat(T,"-ghost"),!!y),r),f),O=tt(tt({},Gm),{motionAppear:!1,leavedClassName:"".concat(T,"-content-hidden")}),N=function(){var B=t.children;return lo(B).map(function(j,G){var H;if(!((H=j.props)===null||H===void 0)&&H.disabled){var te=j.key||String(G),Y=j.props,le=Y.disabled,J=Y.collapsible,Z=tt(tt({},Si(j.props,["disabled"])),{key:te,collapsible:J!=null?J:le?"disabled":void 0});return Ni(j,Z)}return j})};return S(Ev,{openMotion:O,...t,expandIcon:A,prefixCls:T,className:I,children:N()})};x9.Panel=$J;const SP=x9;var _9=C.exports.createContext(null),EP=[];function BJ(e,t){var r=C.exports.useState(function(){if(!Lo())return null;var T=document.createElement("div");return T}),n=Le(r,1),i=n[0],a=C.exports.useRef(!1),u=C.exports.useContext(_9),o=C.exports.useState(EP),f=Le(o,2),p=f[0],v=f[1],y=u||(a.current?void 0:function(T){v(function(R){var A=[T].concat(wt(R));return A})});function w(){i.parentElement||document.body.appendChild(i),a.current=!0}function k(){var T;(T=i.parentElement)===null||T===void 0||T.removeChild(i),a.current=!1}return mi(function(){return e?u?u(w):w():k(),k},[e]),mi(function(){p.length&&(p.forEach(function(T){return T()}),v(EP))},[p]),[i,y]}var f2;function d1(e){if(typeof document>"u")return 0;if(e||f2===void 0){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var r=document.createElement("div"),n=r.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",r.appendChild(t),document.body.appendChild(r);var i=t.offsetWidth;r.style.overflow="scroll";var a=t.offsetWidth;i===a&&(a=r.clientWidth),document.body.removeChild(r),f2=i-a}return f2}function kP(e){var t=e.match(/^(.*)px$/),r=Number(t==null?void 0:t[1]);return Number.isNaN(r)?d1():r}function TP(e){if(typeof document>"u"||!e||!(e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),r=t.width,n=t.height;return{width:kP(r),height:kP(n)}}function VJ(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var jJ="rc-util-locker-".concat(Date.now()),PP=0;function UJ(e){var t=!!e,r=C.exports.useState(function(){return PP+=1,"".concat(jJ,"_").concat(PP)}),n=Le(r,1),i=n[0];mi(function(){if(t){var a=d1(),u=VJ();vv(` html body { overflow-y: hidden; `.concat(u?"width: calc(100% - ".concat(a,"px);"):"",` }`),i)}else fT(i);return function(){fT(i)}},[t,i])}var MP=!1;function KJ(e){return typeof e=="boolean"&&(MP=e),MP}var IP=function(t){return t===!1?!1:!Lo()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},HJ=C.exports.forwardRef(function(e,t){var r=e.open,n=e.autoLock,i=e.getContainer;e.debug;var a=e.autoDestroy,u=a===void 0?!0:a,o=e.children,f=C.exports.useState(r),p=Le(f,2),v=p[0],y=p[1],w=v||r;C.exports.useEffect(function(){(u||r)&&y(r)},[r,u]);var k=C.exports.useState(function(){return IP(i)}),T=Le(k,2),R=T[0],A=T[1];C.exports.useEffect(function(){var le=IP(i);A(le!=null?le:null)});var I=BJ(w&&!R),O=Le(I,2),N=O[0],L=O[1],B=R!=null?R:N;UJ(n&&r&&Lo()&&(B===N||B===document.body));var j=null;if(o&&md(o)&&t){var G=o;j=G.ref}var H=Y7(j,t);if(!w||!Lo()||R===void 0)return null;var te=B===!1||KJ(),Y=o;return t&&(Y=C.exports.cloneElement(o,{ref:H})),S(_9.Provider,{value:L,children:te?Y:Yu.exports.createPortal(Y,B)})});function f1(e){var t=C.exports.useState(e),r=Le(t,2),n=r[0],i=r[1];return C.exports.useEffect(function(){var a=setTimeout(function(){i(e)},e.length?0:10);return function(){clearTimeout(a)}},[e]),n}var RP=[];function h2(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof e=="string"?e:"".concat(r,"-").concat(n),error:e,errorStatus:t}}function b9(e){var t=e.help,r=e.helpStatus,n=e.errors,i=n===void 0?RP:n,a=e.warnings,u=a===void 0?RP:a,o=e.className,f=e.fieldId,p=e.onVisibleChanged,v=C.exports.useContext(vS),y=v.prefixCls,w=C.exports.useContext(zr),k=w.getPrefixCls,T="".concat(y,"-item-explain"),R=k(),A=f1(i),I=f1(u),O=C.exports.useMemo(function(){return t!=null?[h2(t,r,"help")]:[].concat(wt(A.map(function(L,B){return h2(L,"error","error",B)})),wt(I.map(function(L,B){return h2(L,"warning","warning",B)})))},[t,r,A,I]),N={};return f&&(N.id="".concat(f,"_help")),S(Za,{motionDeadline:Gm.motionDeadline,motionName:"".concat(R,"-show-help"),visible:!!O.length,onVisibleChanged:p,children:function(L){var B=L.className,j=L.style;return S("div",{...N,className:Qe(T,B,o),style:j,role:"alert",children:S(YO,{keys:O,...Gm,motionName:"".concat(R,"-show-help-item"),component:!1,children:function(G){var H=G.key,te=G.error,Y=G.errorStatus,le=G.className,J=G.style;return S("div",{className:Qe(le,se({},"".concat(T,"-").concat(Y),Y)),style:J,children:te},H)}})})}})}function OP(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function AP(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function p2(e,t){if(e.clientHeightt||a>e&&u=t&&o>=r?a-e-n:u>t&&or?u-t+i:0}var NP=function(e,t){var r=window,n=t.scrollMode,i=t.block,a=t.inline,u=t.boundary,o=t.skipOverflowHiddenElements,f=typeof u=="function"?u:function(Pt){return Pt!==u};if(!OP(e))throw new TypeError("Invalid target");for(var p,v,y=document.scrollingElement||document.documentElement,w=[],k=e;OP(k)&&f(k);){if((k=(v=(p=k).parentElement)==null?p.getRootNode().host||null:v)===y){w.push(k);break}k!=null&&k===document.body&&p2(k)&&!p2(document.documentElement)||k!=null&&p2(k,o)&&w.push(k)}for(var T=r.visualViewport?r.visualViewport.width:innerWidth,R=r.visualViewport?r.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,I=window.scrollY||pageYOffset,O=e.getBoundingClientRect(),N=O.height,L=O.width,B=O.top,j=O.right,G=O.bottom,H=O.left,te=i==="start"||i==="nearest"?B:i==="end"?G:B+N/2,Y=a==="center"?H+L/2:a==="end"?j:H,le=[],J=0;J=0&&H>=0&&G<=R&&j<=T&&B>=de&&G<=ye&&H>=Re&&j<=oe)return le;var Te=getComputedStyle(Z),ke=parseInt(Te.borderLeftWidth,10),ze=parseInt(Te.borderTopWidth,10),Ie=parseInt(Te.borderRightWidth,10),Ne=parseInt(Te.borderBottomWidth,10),De=0,Ve=0,Ge="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-ke-Ie:0,je="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-ze-Ne:0,ct="offsetWidth"in Z?Z.offsetWidth===0?0:ne/Z.offsetWidth:0,pt="offsetHeight"in Z?Z.offsetHeight===0?0:ge/Z.offsetHeight:0;if(y===Z)De=i==="start"?te:i==="end"?te-R:i==="nearest"?My(I,I+R,R,ze,Ne,I+te,I+te+N,N):te-R/2,Ve=a==="start"?Y:a==="center"?Y-T/2:a==="end"?Y-T:My(A,A+T,T,ke,Ie,A+Y,A+Y+L,L),De=Math.max(0,De+I),Ve=Math.max(0,Ve+A);else{De=i==="start"?te-de-ze:i==="end"?te-ye+Ne+je:i==="nearest"?My(de,ye,ge,ze,Ne+je,te,te+N,N):te-(de+ge/2)+je/2,Ve=a==="start"?Y-Re-ke:a==="center"?Y-(Re+ne/2)+Ge/2:a==="end"?Y-oe+Ie+Ge:My(Re,oe,ne,ke,Ie+Ge,Y,Y+L,L);var Tt=Z.scrollLeft,Ye=Z.scrollTop;te+=Ye-(De=Math.max(0,Math.min(Ye+De/pt,Z.scrollHeight-ge/pt+je))),Y+=Tt-(Ve=Math.max(0,Math.min(Tt+Ve/ct,Z.scrollWidth-ne/ct+Ge)))}le.push({el:Z,top:De,left:Ve})}return le};function w9(e){return e===Object(e)&&Object.keys(e).length!==0}function WJ(e,t){t===void 0&&(t="auto");var r="scrollBehavior"in document.body.style;e.forEach(function(n){var i=n.el,a=n.top,u=n.left;i.scroll&&r?i.scroll({top:a,left:u,behavior:t}):(i.scrollTop=a,i.scrollLeft=u)})}function qJ(e){return e===!1?{block:"end",inline:"nearest"}:w9(e)?e:{block:"start",inline:"nearest"}}function GJ(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(w9(t)&&typeof t.behavior=="function")return t.behavior(r?NP(e,t):[]);if(!!r){var n=qJ(t);return WJ(NP(e,n),n.behavior)}}var ZJ=["parentNode"],XJ="form_item";function ym(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function C9(e,t){if(!!e.length){var r=e.join("_");if(t)return"".concat(t,"_").concat(r);var n=ZJ.includes(r);return n?"".concat(XJ,"_").concat(r):r}}function zP(e){var t=ym(e);return t.join("_")}function S9(e){var t=K3(),r=Le(t,1),n=r[0],i=C.exports.useRef({}),a=C.exports.useMemo(function(){return e!=null?e:tt(tt({},n),{__INTERNAL__:{itemRef:function(o){return function(f){var p=zP(o);f?i.current[p]=f:delete i.current[p]}}},scrollToField:function(o){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=ym(o),v=C9(p,a.__INTERNAL__.name),y=v?document.getElementById(v):null;y&&GJ(y,tt({scrollMode:"if-needed",block:"nearest"},f))},getFieldInstance:function(o){var f=zP(o);return i.current[f]}})},[e,n]);return[a]}var YJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0||Ne.length>0||e.extra){var Dt=[];(e.help||Ie.length>0)&&Dt.push("".concat(Ye,"_help")),e.extra&&Dt.push("".concat(Ye,"_extra")),Ct["aria-describedby"]=Dt.join(" ")}Ie.length>0&&(Ct["aria-invalid"]="true"),Pt&&(Ct["aria-required"]="true"),md(o)&&(Ct.ref=De(Tt,o));var lt=new Set([].concat(wt(ym(w)),wt(ym(G))));lt.forEach(function(ut){Ct[ut]=function(){for(var it,ft,xt,Wt,jt,Qt=arguments.length,Fe=new Array(Qt),qe=0;qe"u"||e===null?"":String(e)}var $ee=function(t){var r=t.inputElement,n=t.prefixCls,i=t.prefix,a=t.suffix,u=t.addonBefore,o=t.addonAfter,f=t.className,p=t.style,v=t.affixWrapperClassName,y=t.groupClassName,w=t.wrapperClassName,k=t.disabled,T=t.readOnly,R=t.focused,A=t.triggerFocus,I=t.allowClear,O=t.value,N=t.handleReset,L=t.hidden,B=C.exports.useRef(null),j=function(oe){var ye;(ye=B.current)!==null&&ye!==void 0&&ye.contains(oe.target)&&(A==null||A())},G=function(){var oe;if(!I)return null;var ye=!k&&!T&&O,Re="".concat(n,"-clear-icon"),Te=ar(I)==="object"&&I!==null&&I!==void 0&&I.clearIcon?I.clearIcon:"\u2716";return S("span",{onClick:N,onMouseDown:function(ze){return ze.preventDefault()},className:Qe(Re,(oe={},se(oe,"".concat(Re,"-hidden"),!ye),se(oe,"".concat(Re,"-has-suffix"),!!a),oe)),role:"button",tabIndex:-1,children:Te})},H=C.exports.cloneElement(r,{value:O,hidden:L});if(I9(t)){var te,Y="".concat(n,"-affix-wrapper"),le=Qe(Y,(te={},se(te,"".concat(Y,"-disabled"),k),se(te,"".concat(Y,"-focused"),R),se(te,"".concat(Y,"-readonly"),T),se(te,"".concat(Y,"-input-with-clear-btn"),a&&I&&O),te),!s0(t)&&f,v),J=(a||I)&&Xe("span",{className:"".concat(n,"-suffix"),children:[G(),a]});H=Xe("span",{className:le,style:p,hidden:!s0(t)&&L,onClick:j,ref:B,children:[i&&S("span",{className:"".concat(n,"-prefix"),children:i}),C.exports.cloneElement(r,{style:null,value:O,hidden:null}),J]})}if(s0(t)){var Z="".concat(n,"-group"),Q="".concat(Z,"-addon"),ge=Qe("".concat(n,"-wrapper"),Z,w),ne=Qe("".concat(n,"-group-wrapper"),f,y);return S("span",{className:ne,style:p,hidden:L,children:Xe("span",{className:ge,children:[u&&S("span",{className:Q,children:u}),C.exports.cloneElement(H,{style:null,hidden:null}),o&&S("span",{className:Q,children:o})]})})}return H},Bee=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],Vee=C.exports.forwardRef(function(e,t){var r=e.autoComplete,n=e.onChange,i=e.onFocus,a=e.onBlur,u=e.onPressEnter,o=e.onKeyDown,f=e.prefixCls,p=f===void 0?"rc-input":f,v=e.disabled,y=e.htmlSize,w=e.className,k=e.maxLength,T=e.suffix,R=e.showCount,A=e.type,I=A===void 0?"text":A,O=e.inputClassName,N=Mr(e,Bee),L=Yi(e.defaultValue,{value:e.value}),B=Le(L,2),j=B[0],G=B[1],H=C.exports.useState(!1),te=Le(H,2),Y=te[0],le=te[1],J=C.exports.useRef(null),Z=function(ke){J.current&&Fee(J.current,ke)};C.exports.useImperativeHandle(t,function(){return{focus:Z,blur:function(){var ke;(ke=J.current)===null||ke===void 0||ke.blur()},setSelectionRange:function(ke,ze,Ie){var Ne;(Ne=J.current)===null||Ne===void 0||Ne.setSelectionRange(ke,ze,Ie)},select:function(){var ke;(ke=J.current)===null||ke===void 0||ke.select()},input:J.current}}),C.exports.useEffect(function(){le(function(Te){return Te&&v?!1:Te})},[v]);var Q=function(ke){e.value===void 0&&G(ke.target.value),J.current&&jP(J.current,ke,n)},ge=function(ke){u&&ke.key==="Enter"&&u(ke),o==null||o(ke)},ne=function(ke){le(!0),i==null||i(ke)},de=function(ke){le(!1),a==null||a(ke)},oe=function(ke){G(""),Z(),J.current&&jP(J.current,ke,n)},ye=function(){var ke=Si(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return S("input",{autoComplete:r,...ke,onChange:Q,onFocus:ne,onBlur:de,onKeyDown:ge,className:Qe(p,se({},"".concat(p,"-disabled"),v),O,!s0(e)&&!I9(e)&&w),ref:J,size:y,type:I})},Re=function(){var ke=Number(k)>0;if(T||R){var ze=UP(j),Ie=wt(ze).length,Ne=ar(R)==="object"?R.formatter({value:ze,count:Ie,maxLength:k}):"".concat(Ie).concat(ke?" / ".concat(k):"");return Xe(Ar,{children:[!!R&&S("span",{className:Qe("".concat(p,"-show-count-suffix"),se({},"".concat(p,"-show-count-has-suffix"),!!T)),children:Ne}),T]})}return null};return S($ee,{...N,prefixCls:p,className:w,inputElement:ye(),handleReset:oe,value:UP(j),focused:Y,triggerFocus:Z,suffix:Re(),disabled:v})});function R9(e,t){var r=C.exports.useRef([]),n=function(){r.current.push(setTimeout(function(){var a,u,o,f;((a=e.current)===null||a===void 0?void 0:a.input)&&((u=e.current)===null||u===void 0?void 0:u.input.getAttribute("type"))==="password"&&((o=e.current)===null||o===void 0?void 0:o.input.hasAttribute("value"))&&((f=e.current)===null||f===void 0||f.input.removeAttribute("value"))}))};return C.exports.useEffect(function(){return t&&n(),function(){return r.current.forEach(function(i){i&&clearTimeout(i)})}},[]),n}function jee(e){return!!(e.prefix||e.suffix||e.allowClear)}var Uee=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i"u"||e===null?"":String(e)}function m2(e,t,r,n){if(!!r){var i=t;if(t.type==="click"){var a=e.cloneNode(!0);i=Object.create(t,{target:{value:a},currentTarget:{value:a}}),a.value="",r(i);return}if(n!==void 0){i=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=n,r(i);return}r(i)}}function Hee(e,t){if(!!e){e.focus(t);var r=t||{},n=r.cursor;if(n){var i=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i);break}}}}var Wee=C.exports.forwardRef(function(e,t){var r,n,i,a=e.prefixCls,u=e.bordered,o=u===void 0?!0:u,f=e.status,p=e.size,v=e.disabled,y=e.onBlur,w=e.onFocus,k=e.suffix,T=e.allowClear,R=e.addonAfter,A=e.addonBefore,I=e.className,O=e.onChange,N=Uee(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","onChange"]),L=tn.useContext(zr),B=L.getPrefixCls,j=L.direction,G=L.input,H=B("input",a),te=C.exports.useRef(null),Y=vh(H,j),le=Y.compactSize,J=Y.compactItemClassnames,Z=tn.useContext(Gs),Q=le||p||Z,ge=tn.useContext(rc),ne=v!=null?v:ge,de=C.exports.useContext(ya),oe=de.status,ye=de.hasFeedback,Re=de.feedbackIcon,Te=xv(oe,f),ke=jee(e)||!!ye,ze=C.exports.useRef(ke);C.exports.useEffect(function(){ke&&ze.current,ze.current=ke},[ke]);var Ie=R9(te,!0),Ne=function(pt){Ie(),y==null||y(pt)},De=function(pt){Ie(),w==null||w(pt)},Ve=function(pt){Ie(),O==null||O(pt)},Ge=(ye||k)&&Xe(Ar,{children:[k,ye&&Re]}),je;return ar(T)==="object"&&(T==null?void 0:T.clearIcon)?je=T:T&&(je={clearIcon:S(gd,{})}),S(Vee,{ref:ta(t,te),prefixCls:H,autoComplete:G==null?void 0:G.autoComplete,...N,disabled:ne||void 0,onBlur:Ne,onFocus:De,suffix:Ge,allowClear:je,className:Qe(I,J),onChange:Ve,addonAfter:R&&S(t1,{children:S(k4,{override:!0,status:!0,children:R})}),addonBefore:A&&S(t1,{children:S(k4,{override:!0,status:!0,children:A})}),inputClassName:Qe((r={},se(r,"".concat(H,"-sm"),Q==="small"),se(r,"".concat(H,"-lg"),Q==="large"),se(r,"".concat(H,"-rtl"),j==="rtl"),se(r,"".concat(H,"-borderless"),!o),r),!ke&&Bu(H,Te)),affixWrapperClassName:Qe((n={},se(n,"".concat(H,"-affix-wrapper-sm"),Q==="small"),se(n,"".concat(H,"-affix-wrapper-lg"),Q==="large"),se(n,"".concat(H,"-affix-wrapper-rtl"),j==="rtl"),se(n,"".concat(H,"-affix-wrapper-borderless"),!o),n),Bu("".concat(H,"-affix-wrapper"),Te,ye)),wrapperClassName:Qe(se({},"".concat(H,"-group-rtl"),j==="rtl")),groupClassName:Qe((i={},se(i,"".concat(H,"-group-wrapper-sm"),Q==="small"),se(i,"".concat(H,"-group-wrapper-lg"),Q==="large"),se(i,"".concat(H,"-group-wrapper-rtl"),j==="rtl"),i),Bu("".concat(H,"-group-wrapper"),Te,ye))})});const DS=Wee;var qee={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 Gee=qee;var O9=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:Gee})})};O9.displayName="EyeInvisibleOutlined";const Zee=C.exports.forwardRef(O9);var Xee=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1,r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&v2[r])return v2[r];var n=window.getComputedStyle(e),i=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),a=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),u=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),o=ote.map(function(p){return"".concat(p,":").concat(n.getPropertyValue(p))}).join(";"),f={sizingStyle:o,paddingSize:a,borderSize:u,boxSizing:i};return t&&r&&(v2[r]=f),f}function ste(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Na||(Na=document.createElement("textarea"),Na.setAttribute("tab-index","-1"),Na.setAttribute("aria-hidden","true"),document.body.appendChild(Na)),e.getAttribute("wrap")?Na.setAttribute("wrap",e.getAttribute("wrap")):Na.removeAttribute("wrap");var i=ate(e,t),a=i.paddingSize,u=i.borderSize,o=i.boxSizing,f=i.sizingStyle;Na.setAttribute("style","".concat(f,";").concat(ite)),Na.value=e.value||e.placeholder||"";var p=void 0,v=void 0,y,w=Na.scrollHeight;if(o==="border-box"?w+=u:o==="content-box"&&(w-=a),r!==null||n!==null){Na.value=" ";var k=Na.scrollHeight-a;r!==null&&(p=k*r,o==="border-box"&&(p=p+a+u),w=Math.max(p,w)),n!==null&&(v=k*n,o==="border-box"&&(v=v+a+u),y=w>v?"":"hidden",w=Math.min(v,w))}var T={height:w,overflowY:y,resize:"none"};return p&&(T.minHeight=p),v&&(T.maxHeight=v),T}var lte=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],g2=0,y2=1,x2=2,ute=C.exports.forwardRef(function(e,t){var r=e.prefixCls,n=r===void 0?"rc-textarea":r;e.onPressEnter;var i=e.defaultValue,a=e.value,u=e.autoSize,o=e.onResize,f=e.className,p=e.style,v=e.disabled,y=e.onChange;e.onInternalAutoSize;var w=Mr(e,lte),k=Yi(i,{value:a,postState:function(Ie){return Ie!=null?Ie:""}}),T=Le(k,2),R=T[0],A=T[1],I=function(Ie){A(Ie.target.value),y==null||y(Ie)},O=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{textArea:O.current}});var N=C.exports.useMemo(function(){return u&&ar(u)==="object"?[u.minRows,u.maxRows]:[]},[u]),L=Le(N,2),B=L[0],j=L[1],G=!!u,H=function(){try{if(document.activeElement===O.current){var Ie=O.current,Ne=Ie.selectionStart,De=Ie.selectionEnd,Ve=Ie.scrollTop;O.current.setSelectionRange(Ne,De),O.current.scrollTop=Ve}}catch{}},te=C.exports.useState(x2),Y=Le(te,2),le=Y[0],J=Y[1],Z=C.exports.useState(),Q=Le(Z,2),ge=Q[0],ne=Q[1],de=function(){J(g2)};mi(function(){G&&de()},[a,B,j,G]),mi(function(){if(le===g2)J(y2);else if(le===y2){var ze=ste(O.current,!1,B,j);J(x2),ne(ze)}else H()},[le]);var oe=C.exports.useRef(),ye=function(){rn.cancel(oe.current)},Re=function(Ie){le===x2&&(o==null||o(Ie),u&&(ye(),oe.current=rn(function(){de()})))};C.exports.useEffect(function(){return ye},[]);var Te=G?ge:null,ke=ve(ve({},p),Te);return(le===g2||le===y2)&&(ke.overflowY="hidden",ke.overflowX="hidden"),S(Ul,{onResize:Re,disabled:!(u||o),children:S("textarea",{...w,ref:O,style:ke,className:Qe(n,f,se({},"".concat(n,"-disabled"),v)),disabled:v,value:R,onChange:I})})}),cte=function(e){vi(r,e);var t=gi(r);function r(n){var i;Qn(this,r),i=t.call(this,n),i.resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(u){i.resizableTextArea=u},i.handleChange=function(u){var o=i.props.onChange;i.setValue(u.target.value),o&&o(u)},i.handleKeyDown=function(u){var o=i.props,f=o.onPressEnter,p=o.onKeyDown;u.keyCode===13&&f&&f(u),p&&p(u)};var a=typeof n.value>"u"||n.value===null?n.defaultValue:n.value;return i.state={value:a},i}return Jn(r,[{key:"setValue",value:function(i,a){"value"in this.props||this.setState({value:i},a)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return S(ute,{...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}}]),r}(C.exports.Component),dte=Sa("text","input");function fte(e){return!!(e.addonBefore||e.addonAfter)}var hte=function(e){vi(r,e);var t=gi(r);function r(){return Qn(this,r),t.apply(this,arguments)}return Jn(r,[{key:"renderClearIcon",value:function(i){var a,u=this.props,o=u.value,f=u.disabled,p=u.readOnly,v=u.handleReset,y=u.suffix,w=!f&&!p&&o,k="".concat(i,"-clear-icon");return S(gd,{onClick:v,onMouseDown:function(R){return R.preventDefault()},className:Qe((a={},se(a,"".concat(k,"-hidden"),!w),se(a,"".concat(k,"-has-suffix"),!!y),a),k),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(i,a,u){var o,f=this.props,p=f.value,v=f.allowClear,y=f.className,w=f.style,k=f.direction,T=f.bordered,R=f.hidden,A=f.status,I=u.status,O=u.hasFeedback;if(!v)return Ni(a,{value:p});var N=Qe("".concat(i,"-affix-wrapper"),"".concat(i,"-affix-wrapper-textarea-with-clear-btn"),Bu("".concat(i,"-affix-wrapper"),xv(I,A),O),(o={},se(o,"".concat(i,"-affix-wrapper-rtl"),k==="rtl"),se(o,"".concat(i,"-affix-wrapper-borderless"),!T),se(o,"".concat(y),!fte(this.props)&&y),o));return Xe("span",{className:N,style:w,hidden:R,children:[Ni(a,{style:null,value:p}),this.renderClearIcon(i)]})}},{key:"render",value:function(){var i=this;return S(ya.Consumer,{children:function(a){var u=i.props,o=u.prefixCls,f=u.inputType,p=u.element;if(f===dte[0])return i.renderTextAreaWithClearIcon(o,p,a)}})}}]),r}(C.exports.Component);const pte=hte;var mte=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);in&&(i=t),i}var vte=C.exports.forwardRef(function(e,t){var r,n=e.prefixCls,i=e.bordered,a=i===void 0?!0:i,u=e.showCount,o=u===void 0?!1:u,f=e.maxLength,p=e.className,v=e.style,y=e.size,w=e.disabled,k=e.onCompositionStart,T=e.onCompositionEnd,R=e.onChange,A=e.status,I=mte(e,["prefixCls","bordered","showCount","maxLength","className","style","size","disabled","onCompositionStart","onCompositionEnd","onChange","status"]),O=C.exports.useContext(zr),N=O.getPrefixCls,L=O.direction,B=C.exports.useContext(Gs),j=C.exports.useContext(rc),G=w!=null?w:j,H=C.exports.useContext(ya),te=H.status,Y=H.hasFeedback,le=H.isFormItemInput,J=H.feedbackIcon,Z=xv(te,A),Q=C.exports.useRef(null),ge=C.exports.useRef(null),ne=C.exports.useState(!1),de=Le(ne,2),oe=de[0],ye=de[1],Re=C.exports.useRef(),Te=C.exports.useRef(0),ke=Yi(I.defaultValue,{value:I.value}),ze=Le(ke,2),Ie=ze[0],Ne=ze[1],De=I.hidden,Ve=function(ut,it){I.value===void 0&&(Ne(ut),it==null||it())},Ge=Number(f)>0,je=function(ut){ye(!0),Re.current=Ie,Te.current=ut.currentTarget.selectionStart,k==null||k(ut)},ct=function(ut){var it;ye(!1);var ft=ut.currentTarget.value;if(Ge){var xt=Te.current>=f+1||Te.current===((it=Re.current)===null||it===void 0?void 0:it.length);ft=KP(xt,Re.current,ft,f)}ft!==Ie&&(Ve(ft),m2(ut.currentTarget,ut,R,ft)),T==null||T(ut)},pt=function(ut){var it=ut.target.value;if(!oe&&Ge){var ft=ut.target.selectionStart>=f+1||ut.target.selectionStart===it.length||!ut.target.selectionStart;it=KP(ft,Ie,it,f)}Ve(it),m2(ut.currentTarget,ut,R,it)},Tt=function(ut){var it,ft,xt;Ve(""),(it=Q.current)===null||it===void 0||it.focus(),m2((xt=(ft=Q.current)===null||ft===void 0?void 0:ft.resizableTextArea)===null||xt===void 0?void 0:xt.textArea,ut,R)},Ye=N("input",n);C.exports.useImperativeHandle(t,function(){var dt;return{resizableTextArea:(dt=Q.current)===null||dt===void 0?void 0:dt.resizableTextArea,focus:function(it){var ft,xt;Hee((xt=(ft=Q.current)===null||ft===void 0?void 0:ft.resizableTextArea)===null||xt===void 0?void 0:xt.textArea,it)},blur:function(){var it;return(it=Q.current)===null||it===void 0?void 0:it.blur()}}});var Pt=S(cte,{...Si(I,["allowClear"]),disabled:G,className:Qe((r={},se(r,"".concat(Ye,"-borderless"),!a),se(r,p,p&&!o),se(r,"".concat(Ye,"-sm"),B==="small"||y==="small"),se(r,"".concat(Ye,"-lg"),B==="large"||y==="large"),r),Bu(Ye,Z)),style:o?{resize:v==null?void 0:v.resize}:v,prefixCls:Ye,onCompositionStart:je,onChange:pt,onCompositionEnd:ct,ref:Q}),mt=Kee(Ie);!oe&&Ge&&(I.value===null||I.value===void 0)&&(mt=A9(mt,f));var It=S(pte,{disabled:G,...I,prefixCls:Ye,direction:L,inputType:"text",value:mt,element:Pt,handleReset:Tt,ref:ge,bordered:a,status:A,style:o?void 0:v});if(o||Y){var Ct,Dt=wt(mt).length,lt="";return ar(o)==="object"?lt=o.formatter({value:mt,count:Dt,maxLength:f}):lt="".concat(Dt).concat(Ge?" / ".concat(f):""),Xe("div",{hidden:De,className:Qe("".concat(Ye,"-textarea"),(Ct={},se(Ct,"".concat(Ye,"-textarea-rtl"),L==="rtl"),se(Ct,"".concat(Ye,"-textarea-show-count"),o),se(Ct,"".concat(Ye,"-textarea-in-form-item"),le),Ct),Bu("".concat(Ye,"-textarea"),Z,Y),p),style:v,"data-count":lt,children:[It,Y&&S("span",{className:"".concat(Ye,"-textarea-suffix"),children:J})]})}return It});const N9=vte;var kv=DS;kv.Group=Lee;kv.Search=nte;kv.TextArea=N9;kv.Password=ete;const Iu=kv;var gte={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 yte=gte;var z9=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:yte})})};z9.displayName="DoubleLeftOutlined";const xte=C.exports.forwardRef(z9);var _te={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 bte=_te;var D9=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:bte})})};D9.displayName="DoubleRightOutlined";const wte=C.exports.forwardRef(D9);var Bp=function(t){var r,n="".concat(t.rootPrefixCls,"-item"),i=Qe(n,"".concat(n,"-").concat(t.page),(r={},se(r,"".concat(n,"-active"),t.active),se(r,"".concat(n,"-disabled"),!t.page),se(r,t.className,!!t.className),r)),a=function(){t.onClick(t.page)},u=function(f){t.onKeyPress(f,t.onClick,t.page)};return S("li",{title:t.showTitle?t.page:null,className:i,onClick:a,onKeyPress:u,tabIndex:"0",children:t.itemRender(t.page,"page",S("a",{rel:"nofollow",children:t.page}))})};const Lc={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};var L9=function(e){vi(r,e);var t=gi(r);function r(){var n;Qn(this,r);for(var i=arguments.length,a=new Array(i),u=0;u=0||o.relatedTarget.className.indexOf("".concat(y,"-item"))>=0))&&v(n.getValidValue()))},n.go=function(o){var f=n.state.goInputText;f!==""&&(o.keyCode===Lc.ENTER||o.type==="click")&&(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue()))},n}return Jn(r,[{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,a=i.pageSize,u=i.pageSizeOptions;return u.some(function(o){return o.toString()===a.toString()})?u:u.concat([a.toString()]).sort(function(o,f){var p=isNaN(Number(o))?0:Number(o),v=isNaN(Number(f))?0:Number(f);return p-v})}},{key:"render",value:function(){var i=this,a=this.props,u=a.pageSize,o=a.locale,f=a.rootPrefixCls,p=a.changeSize,v=a.quickGo,y=a.goButton,w=a.selectComponentClass,k=a.buildOptionText,T=a.selectPrefixCls,R=a.disabled,A=this.state.goInputText,I="".concat(f,"-options"),O=w,N=null,L=null,B=null;if(!p&&!v)return null;var j=this.getPageSizeOptions();if(p&&O){var G=j.map(function(H,te){return S(O.Option,{value:H.toString(),children:(k||i.buildOptionText)(H)},te)});N=S(O,{disabled:R,prefixCls:T,showSearch:!1,className:"".concat(I,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(u||j[0]).toString(),onChange:this.changeSize,getPopupContainer:function(te){return te.parentNode},"aria-label":o.page_size,defaultOpen:!1,children:G})}return v&&(y&&(B=typeof y=="boolean"?S("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:R,className:"".concat(I,"-quick-jumper-button"),children:o.jump_to_confirm}):S("span",{onClick:this.go,onKeyUp:this.go,children:y})),L=Xe("div",{className:"".concat(I,"-quick-jumper"),children:[o.jump_to,S("input",{disabled:R,type:"text",value:A,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":o.page}),o.page,B]})),Xe("li",{className:"".concat(I),children:[N,L]})}}]),r}(tn.Component);L9.defaultProps={pageSizeOptions:["10","20","50","100"]};const Cte={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 L4(){}function HP(e){var t=Number(e);return typeof t=="number"&&!isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function Ste(e,t,r){return r}function du(e,t,r){var n=typeof e>"u"?t.pageSize:e;return Math.floor((r.total-1)/n)+1}var F9=function(e){vi(r,e);var t=gi(r);function r(n){var i;Qn(this,r),i=t.call(this,n),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(du(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(p,v){var y=i.props.prefixCls,w=p||S("button",{type:"button","aria-label":v,className:"".concat(y,"-item-link")});return typeof p=="function"&&(w=tn.createElement(p,ve({},i.props))),w},i.savePaginationNode=function(p){i.paginationNode=p},i.isValid=function(p){var v=i.props.total;return HP(p)&&p!==i.state.current&&HP(v)&&v>0},i.shouldDisplayQuickJumper=function(){var p=i.props,v=p.showQuickJumper,y=p.total,w=i.state.pageSize;return y<=w?!1:v},i.handleKeyDown=function(p){(p.keyCode===Lc.ARROW_UP||p.keyCode===Lc.ARROW_DOWN)&&p.preventDefault()},i.handleKeyUp=function(p){var v=i.getValidValue(p),y=i.state.currentInputValue;v!==y&&i.setState({currentInputValue:v}),p.keyCode===Lc.ENTER?i.handleChange(v):p.keyCode===Lc.ARROW_UP?i.handleChange(v-1):p.keyCode===Lc.ARROW_DOWN&&i.handleChange(v+1)},i.handleBlur=function(p){var v=i.getValidValue(p);i.handleChange(v)},i.changePageSize=function(p){var v=i.state.current,y=du(p,i.state,i.props);v=v>y?y:v,y===0&&(v=i.state.current),typeof p=="number"&&("pageSize"in i.props||i.setState({pageSize:p}),"current"in i.props||i.setState({current:v,currentInputValue:v})),i.props.onShowSizeChange(v,p),"onChange"in i.props&&i.props.onChange&&i.props.onChange(v,p)},i.handleChange=function(p){var v=i.props,y=v.disabled,w=v.onChange,k=i.state,T=k.pageSize,R=k.current,A=k.currentInputValue;if(i.isValid(p)&&!y){var I=du(void 0,i.state,i.props),O=p;return p>I?O=I:p<1&&(O=1),"current"in i.props||i.setState({current:O}),O!==A&&i.setState({currentInputValue:O}),w(O,T),O}return R},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.current2?y-2:0),k=2;k=u?f=u:f=Number(a),f}},{key:"getShowSizeChanger",value:function(){var i=this.props,a=i.showSizeChanger,u=i.total,o=i.totalBoundaryShowSizeChanger;return typeof a<"u"?a:u>o}},{key:"renderPrev",value:function(i){var a=this.props,u=a.prevIcon,o=a.itemRender,f=o(i,"prev",this.getItemIcon(u,"prev page")),p=!this.hasPrev();return C.exports.isValidElement(f)?C.exports.cloneElement(f,{disabled:p}):f}},{key:"renderNext",value:function(i){var a=this.props,u=a.nextIcon,o=a.itemRender,f=o(i,"next",this.getItemIcon(u,"next page")),p=!this.hasNext();return C.exports.isValidElement(f)?C.exports.cloneElement(f,{disabled:p}):f}},{key:"render",value:function(){var i=this,a=this.props,u=a.prefixCls,o=a.className,f=a.style,p=a.disabled,v=a.hideOnSinglePage,y=a.total,w=a.locale,k=a.showQuickJumper,T=a.showLessItems,R=a.showTitle,A=a.showTotal,I=a.simple,O=a.itemRender,N=a.showPrevNextJumpers,L=a.jumpPrevIcon,B=a.jumpNextIcon,j=a.selectComponentClass,G=a.selectPrefixCls,H=a.pageSizeOptions,te=this.state,Y=te.current,le=te.pageSize,J=te.currentInputValue;if(v===!0&&y<=le)return null;var Z=du(void 0,this.state,this.props),Q=[],ge=null,ne=null,de=null,oe=null,ye=null,Re=k&&k.goButton,Te=T?1:2,ke=Y-1>0?Y-1:0,ze=Y+1y?y:Y*le])});if(I)return Re&&(typeof Re=="boolean"?ye=S("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:w.jump_to_confirm}):ye=S("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:Re}),ye=S("li",{title:R?"".concat(w.jump_to).concat(Y,"/").concat(Z):null,className:"".concat(u,"-simple-pager"),children:ye})),Xe("ul",{className:Qe(u,"".concat(u,"-simple"),se({},"".concat(u,"-disabled"),p),o),style:f,ref:this.savePaginationNode,...Ie,children:[Ne,S("li",{title:R?w.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:Qe("".concat(u,"-prev"),se({},"".concat(u,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev(),children:this.renderPrev(ke)}),Xe("li",{title:R?"".concat(Y,"/").concat(Z):null,className:"".concat(u,"-simple-pager"),children:[S("input",{type:"text",value:J,disabled:p,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),S("span",{className:"".concat(u,"-slash"),children:"/"}),Z]}),S("li",{title:R?w.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:Qe("".concat(u,"-next"),se({},"".concat(u,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext(),children:this.renderNext(ze)}),ye]});if(Z<=3+Te*2){var De={locale:w,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:R,itemRender:O};Z||Q.push(C.exports.createElement(Bp,{...De,key:"noPager",page:1,className:"".concat(u,"-item-disabled")}));for(var Ve=1;Ve<=Z;Ve+=1){var Ge=Y===Ve;Q.push(C.exports.createElement(Bp,{...De,key:Ve,page:Ve,active:Ge}))}}else{var je=T?w.prev_3:w.prev_5,ct=T?w.next_3:w.next_5;N&&(ge=S("li",{title:R?je:null,onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:Qe("".concat(u,"-jump-prev"),se({},"".concat(u,"-jump-prev-custom-icon"),!!L)),children:O(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(L,"prev page"))},"prev"),ne=S("li",{title:R?ct:null,tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:Qe("".concat(u,"-jump-next"),se({},"".concat(u,"-jump-next-custom-icon"),!!B)),children:O(this.getJumpNextPage(),"jump-next",this.getItemIcon(B,"next page"))},"next")),oe=S(Bp,{locale:w,last:!0,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Z,active:!1,showTitle:R,itemRender:O},Z),de=S(Bp,{locale:w,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:1,active:!1,showTitle:R,itemRender:O},1);var pt=Math.max(1,Y-Te),Tt=Math.min(Y+Te,Z);Y-1<=Te&&(Tt=1+Te*2),Z-Y<=Te&&(pt=Z-Te*2);for(var Ye=pt;Ye<=Tt;Ye+=1){var Pt=Y===Ye;Q.push(S(Bp,{locale:w,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Ye,active:Pt,showTitle:R,itemRender:O},Ye))}Y-1>=Te*2&&Y!==1+2&&(Q[0]=C.exports.cloneElement(Q[0],{className:"".concat(u,"-item-after-jump-prev")}),Q.unshift(ge)),Z-Y>=Te*2&&Y!==Z-2&&(Q[Q.length-1]=C.exports.cloneElement(Q[Q.length-1],{className:"".concat(u,"-item-before-jump-next")}),Q.push(ne)),pt!==1&&Q.unshift(de),Tt!==Z&&Q.push(oe)}var mt=!this.hasPrev()||!Z,It=!this.hasNext()||!Z;return Xe("ul",{className:Qe(u,o,se({},"".concat(u,"-disabled"),p)),style:f,ref:this.savePaginationNode,...Ie,children:[Ne,S("li",{title:R?w.prev_page:null,onClick:this.prev,tabIndex:mt?null:0,onKeyPress:this.runIfEnterPrev,className:Qe("".concat(u,"-prev"),se({},"".concat(u,"-disabled"),mt)),"aria-disabled":mt,children:this.renderPrev(ke)}),Q,S("li",{title:R?w.next_page:null,onClick:this.next,tabIndex:It?null:0,onKeyPress:this.runIfEnterNext,className:Qe("".concat(u,"-next"),se({},"".concat(u,"-disabled"),It)),"aria-disabled":It,children:this.renderNext(ze)}),S(L9,{disabled:p,locale:w,rootPrefixCls:u,selectComponentClass:j,selectPrefixCls:G,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Y,pageSize:le,pageSizeOptions:H,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Re})]})}}],[{key:"getDerivedStateFromProps",value:function(i,a){var u={};if("current"in i&&(u.current=i.current,i.current!==a.current&&(u.currentInputValue=u.current)),"pageSize"in i&&i.pageSize!==a.pageSize){var o=a.current,f=du(i.pageSize,a,i);o=o>f?f:o,"current"in i||(u.current=o,u.currentInputValue=o),u.pageSize=i.pageSize}return u}}]),r}(tn.Component);F9.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:L4,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:L4,locale:Cte,style:{},itemRender:Ste,totalBoundaryShowSizeChanger:50};var $9=function(t){return S(Dl,{...t,size:"small"})},B9=function(t){return S(Dl,{...t,size:"middle"})};$9.Option=Dl.Option;B9.Option=Dl.Option;var Ete=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof R=="number"){var O,N=T[A],L=N+R,B=[];n.forEach(function(Y){B.push(Y.value)}),B.push(e,t),B.push(o(N));var j=R>0?1:-1;I==="unit"?B.push(o(N+j*r)):B.push(o(L)),B=B.filter(function(Y){return Y!==null}).filter(function(Y){return R<0?Y<=N:Y>=N}),I==="unit"&&(B=B.filter(function(Y){return Y!==N}));var G=I==="unit"?N:L;O=B[0];var H=Math.abs(O-G);if(B.forEach(function(Y){var le=Math.abs(Y-G);le1){var te=wt(T);return te[A]=O,k(te,R-j,A,I)}return O}else{if(R==="min")return e;if(R==="max")return t}},v=function(T,R,A){var I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",O=T[A],N=p(T,R,A,I);return{value:N,changed:N!==O}},y=function(T){return a===null&&T===0||typeof a=="number"&&T3&&arguments[3]!==void 0?arguments[3]:"unit",O=T.map(f),N=O[A],L=p(O,R,A,I);if(O[A]=L,i===!1){var B=a||0;A>0&&O[A-1]!==N&&(O[A]=Math.max(O[A],O[A-1]+B)),A0;te-=1)for(var Y=!0;y(O[te]-O[te-1])&&Y;){var le=v(O,-1,te-1);O[te-1]=le.value,Y=le.changed}for(var J=O.length-1;J>0;J-=1)for(var Z=!0;y(O[J]-O[J-1])&&Z;){var Q=v(O,-1,J-1);O[J-1]=Q.value,Z=Q.changed}for(var ge=0;ge=0?J:!1},[J,Ct]),lt=C.exports.useMemo(function(){var me=Object.keys(Ie||{});return me.map(function(K){var q=Ie[K],ce={value:Number(K)};return q&&ar(q)==="object"&&!C.exports.isValidElement(q)&&("label"in q||"style"in q)?(ce.style=q.style,ce.label=q.label):ce.label=q,ce}).filter(function(K){var q=K.label;return q||typeof q=="number"}).sort(function(K,q){return K.value-q.value})},[Ie]),dt=Cre(mt,It,Ct,lt,Y,Dt),ut=Le(dt,2),it=ut[0],ft=ut[1],xt=Yi(N,{value:O}),Wt=Le(xt,2),jt=Wt[0],Qt=Wt[1],Fe=C.exports.useMemo(function(){var me=jt==null?[]:Array.isArray(jt)?jt:[jt],K=Le(me,1),q=K[0],ce=q===void 0?mt:q,ae=jt===null?[]:[ce];if(L){if(ae=wt(me),B||jt===void 0){var xe=B>=0?B+1:2;for(ae=ae.slice(0,xe);ae.length=0&&Tt.current.focus(me)}_t(null)},[Or]);var or=C.exports.useMemo(function(){return Z&&Ct===null?!1:Z},[Z,Ct]),$r=function(){H==null||H(Xt(qe.current))},Er=vre(Ye,Pt,Fe,mt,It,it,cr,$r,ft),Lt=Le(Er,4),kr=Lt[0],wr=Lt[1],fr=Lt[2],Nt=Lt[3],ot=function(K,q){Nt(K,q),G==null||G(Xt(qe.current))},ht=kr!==-1;C.exports.useEffect(function(){if(!ht){var me=Fe.lastIndexOf(wr);Tt.current.focus(me)}},[ht]);var Ot=C.exports.useMemo(function(){return wt(fr).sort(function(me,K){return me-K})},[fr]),$t=C.exports.useMemo(function(){return L?[Ot[0],Ot[Ot.length-1]]:[mt,Ot[0]]},[Ot,L,mt]),ur=Le($t,2),Ir=ur[0],qr=ur[1];C.exports.useImperativeHandle(t,function(){return{focus:function(){Tt.current.focus(0)},blur:function(){var K=document,q=K.activeElement;Ye.current.contains(q)&&(q==null||q.blur())}}}),C.exports.useEffect(function(){p&&Tt.current.focus(0)},[]);var Gr=C.exports.useMemo(function(){return{min:mt,max:It,direction:Pt,disabled:f,step:Ct,included:de,includedStart:Ir,includedEnd:qr,range:L,tabIndex:Ge,ariaLabelForHandle:je,ariaLabelledByForHandle:ct,ariaValueTextFormatterForHandle:pt}},[mt,It,Pt,f,Ct,de,Ir,qr,L,Ge,je,ct,pt]);return S(yd.Provider,{value:Gr,children:Xe("div",{ref:Ye,className:Qe(i,a,(r={},se(r,"".concat(i,"-disabled"),f),se(r,"".concat(i,"-vertical"),ge),se(r,"".concat(i,"-horizontal"),!ge),se(r,"".concat(i,"-with-marks"),lt.length),r)),style:u,onMouseDown:Ut,children:[S("div",{className:"".concat(i,"-rail"),style:Te}),S(yre,{prefixCls:i,style:ye,values:Ot,startPoint:oe,onStartMove:or?ot:null}),S(wre,{prefixCls:i,marks:lt,dots:Ne,style:ke,activeStyle:ze}),S(mre,{ref:Tt,prefixCls:i,style:Re,values:fr,draggingIndex:kr,onStartMove:ot,onOffsetChange:qt,onFocus:v,onBlur:y,handleRender:De}),S(_re,{prefixCls:i,marks:lt,onClick:Vt})]})})}),Ere=C.exports.forwardRef(function(e,t){var r=e.open,n=C.exports.useRef(null),i=C.exports.useRef(null);function a(){rn.cancel(i.current),i.current=null}function u(){i.current=rn(function(){var o;(o=n.current)===null||o===void 0||o.forcePopupAlign(),i.current=null})}return C.exports.useEffect(function(){return r?u():a(),a},[r,e.title]),S(yo,{ref:ta(n,t),...e})});const kre=Ere;var Tre=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=r}function Lre(e){return e&&ar(e)==="object"&&!Array.isArray(e)&&!C.exports.isValidElement(e)}function Fre(e){return typeof e=="string"?!0:md(e)}var $re=function(t){var r=t.ellipsis,n=t.rowType,i=t.children,a,u=r===!0?{showTitle:!0}:r;return u&&(u.showTitle||n==="header")&&(typeof i=="string"||typeof i=="number"?a=i.toString():C.exports.isValidElement(i)&&typeof i.props.children=="string"&&(a=i.props.children)),a};function Bre(e,t){var r,n,i,a=e.prefixCls,u=e.className,o=e.record,f=e.index,p=e.renderIndex,v=e.dataIndex,y=e.render,w=e.children,k=e.component,T=k===void 0?"td":k,R=e.colSpan,A=e.rowSpan,I=e.fixLeft,O=e.fixRight,N=e.firstFixLeft,L=e.lastFixLeft,B=e.firstFixRight,j=e.lastFixRight,G=e.appendNode,H=e.additionalProps,te=H===void 0?{}:H,Y=e.ellipsis,le=e.align,J=e.rowType,Z=e.isSticky,Q=e.hovering,ge=e.onHover,ne="".concat(a,"-cell"),de=C.exports.useContext(rz),oe=C.exports.useContext(ez),ye=C.exports.useContext(Px),Re=ye.allColumnsFixedLeft,Te=C.exports.useMemo(function(){if(B4(w))return[w];var it=J9(o,v),ft=it,xt=void 0;if(y){var Wt=y(it,o,p);Lre(Wt)?(ft=Wt.children,xt=Wt.props,de.renderWithProps=!0):ft=Wt}return[ft,xt]},[de.renderWithProps?Math.random():0,w,v,de,o,y,p]),ke=Le(Te,2),ze=ke[0],Ie=ke[1],Ne=ze;ar(Ne)==="object"&&!Array.isArray(Ne)&&!C.exports.isValidElement(Ne)&&(Ne=null),Y&&(L||B)&&(Ne=S("span",{className:"".concat(ne,"-content"),children:Ne}));var De=Ie||{},Ve=De.colSpan,Ge=De.rowSpan,je=De.style,ct=De.className,pt=Mr(De,zre),Tt=(r=Ve!==void 0?Ve:R)!==null&&r!==void 0?r:1,Ye=(n=Ge!==void 0?Ge:A)!==null&&n!==void 0?n:1;if(Tt===0||Ye===0)return null;var Pt={},mt=typeof I=="number"&&oe,It=typeof O=="number"&&oe;mt&&(Pt.position="sticky",Pt.left=I),It&&(Pt.position="sticky",Pt.right=O);var Ct={};le&&(Ct.textAlign=le);var Dt=function(ft){var xt;o&&ge(f,f+Ye-1),te==null||(xt=te.onMouseEnter)===null||xt===void 0||xt.call(te,ft)},lt=function(ft){var xt;o&&ge(-1,-1),te==null||(xt=te.onMouseLeave)===null||xt===void 0||xt.call(te,ft)},dt=$re({rowType:J,ellipsis:Y,children:ze}),ut=ve(ve(ve({title:dt},pt),te),{},{colSpan:Tt!==1?Tt:null,rowSpan:Ye!==1?Ye:null,className:Qe(ne,u,(i={},se(i,"".concat(ne,"-fix-left"),mt&&oe),se(i,"".concat(ne,"-fix-left-first"),N&&oe),se(i,"".concat(ne,"-fix-left-last"),L&&oe),se(i,"".concat(ne,"-fix-left-all"),L&&Re&&oe),se(i,"".concat(ne,"-fix-right"),It&&oe),se(i,"".concat(ne,"-fix-right-first"),B&&oe),se(i,"".concat(ne,"-fix-right-last"),j&&oe),se(i,"".concat(ne,"-ellipsis"),Y),se(i,"".concat(ne,"-with-append"),G),se(i,"".concat(ne,"-fix-sticky"),(mt||It)&&Z&&oe),se(i,"".concat(ne,"-row-hover"),!Ie&&Q),i),te.className,ct),style:ve(ve(ve(ve({},te.style),Ct),Pt),je),onMouseEnter:Dt,onMouseLeave:lt,ref:Fre(T)?t:null});return Xe(T,{...ut,children:[G,Ne]})}var nz=C.exports.forwardRef(Bre);nz.displayName="Cell";var Vre=["expanded","className","hovering"],jre=C.exports.memo(nz,function(e,t){return t.shouldCellUpdate?Vre.every(function(r){return e[r]===t[r]})&&!t.shouldCellUpdate(t.record,e.record):ld(e,t)}),Mv=C.exports.forwardRef(function(e,t){var r=e.index,n=e.additionalProps,i=n===void 0?{}:n,a=e.colSpan,u=e.rowSpan,o=i.colSpan,f=i.rowSpan,p=a!=null?a:o,v=u!=null?u:f,y=Nre(tz,function(T){var R=Dre(r,v||1,T==null?void 0:T.startRow,T==null?void 0:T.endRow);return{onHover:T==null?void 0:T.onHover,hovering:R}}),w=y.onHover,k=y.hovering;return S(jre,{...e,colSpan:p,rowSpan:v,hovering:k,ref:t,onHover:w})});Mv.displayName="WrappedCell";var Ys=C.exports.createContext(null);function $S(e,t,r,n,i){var a=r[e]||{},u=r[t]||{},o,f;a.fixed==="left"?o=n.left[e]:u.fixed==="right"&&(f=n.right[t]);var p=!1,v=!1,y=!1,w=!1,k=r[t+1],T=r[e-1];if(i==="rtl"){if(o!==void 0){var R=T&&T.fixed==="left";w=!R}else if(f!==void 0){var A=k&&k.fixed==="right";y=!A}}else if(o!==void 0){var I=k&&k.fixed==="left";p=!I}else if(f!==void 0){var O=T&&T.fixed==="right";v=!O}return{fixLeft:o,fixRight:f,lastFixLeft:p,firstFixRight:v,lastFixRight:y,firstFixLeft:w,isSticky:n.isSticky}}function iz(e){var t=e.cells,r=e.stickyOffsets,n=e.flattenColumns,i=e.rowComponent,a=e.cellComponent,u=e.onHeaderRow,o=e.index,f=C.exports.useContext(Ys),p=f.prefixCls,v=f.direction,y;u&&(y=u(t.map(function(k){return k.column}),o));var w=Tx(t.map(function(k){return k.column}));return S(i,{...y,children:t.map(function(k,T){var R=k.column,A=$S(k.colStart,k.colEnd,n,r,v),I;return R&&R.onHeaderCell&&(I=k.column.onHeaderCell(R)),C.exports.createElement(Mv,{...k,ellipsis:R.ellipsis,align:R.align,component:a,prefixCls:p,key:w[T],...A,additionalProps:I,rowType:"header"})})})}iz.displayName="HeaderRow";function Ure(e){var t=[];function r(u,o){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[f]=t[f]||[];var p=o,v=u.filter(Boolean).map(function(y){var w={key:y.key,className:y.className||"",children:y.title,column:y,colStart:p},k=1,T=y.children;return T&&T.length>0&&(k=r(T,p,f+1).reduce(function(R,A){return R+A},0),w.hasSubColumns=!0),"colSpan"in y&&(k=y.colSpan),"rowSpan"in y&&(w.rowSpan=y.rowSpan),w.colSpan=k,w.colEnd=w.colStart+k-1,t[f].push(w),p+=k,k});return v}r(e,0);for(var n=t.length,i=function(o){t[o].forEach(function(f){!("rowSpan"in f)&&!f.hasSubColumns&&(f.rowSpan=n-o)})},a=0;a1?mt-1:0),Ct=1;Ct0?[].concat(wt(t),wt(V4(a).map(function(u){return ve({fixed:i},u)}))):[].concat(wt(t),[ve(ve({},r),{},{fixed:i})])},[])}function Qre(e){return e.map(function(t){var r=t.fixed,n=Mr(t,Yre),i=r;return r==="left"?i="right":r==="right"&&(i="left"),ve({fixed:i},n)})}function Jre(e,t){var r=e.prefixCls,n=e.columns,i=e.children,a=e.expandable,u=e.expandedKeys,o=e.columnTitle,f=e.getRowKey,p=e.onTriggerExpand,v=e.expandIcon,y=e.rowExpandable,w=e.expandIconColumnIndex,k=e.direction,T=e.expandRowByClick,R=e.columnWidth,A=e.fixed,I=C.exports.useMemo(function(){return n||BS(i)},[n,i]),O=C.exports.useMemo(function(){if(a){var B,j=I.slice();if(!j.includes(Fc)){var G=w||0;G>=0&&j.splice(G,0,Fc)}var H=j.indexOf(Fc);j=j.filter(function(J,Z){return J!==Fc||Z===H});var te=I[H],Y;(A==="left"||A)&&!w?Y="left":(A==="right"||A)&&w===I.length?Y="right":Y=te?te.fixed:null;var le=(B={},se(B,xm,{className:"".concat(r,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),se(B,"title",o),se(B,"fixed",Y),se(B,"className","".concat(r,"-row-expand-icon-cell")),se(B,"width",R),se(B,"render",function(Z,Q,ge){var ne=f(Q,ge),de=u.has(ne),oe=y?y(Q):!0,ye=v({prefixCls:r,expanded:de,expandable:oe,record:Q,onExpand:p});return T?S("span",{onClick:function(Te){return Te.stopPropagation()},children:ye}):ye}),B);return j.map(function(J){return J===Fc?le:J})}return I.filter(function(J){return J!==Fc})},[a,I,f,u,v,k]),N=C.exports.useMemo(function(){var B=O;return t&&(B=t(B)),B.length||(B=[{render:function(){return null}}]),B},[t,O,k]),L=C.exports.useMemo(function(){return k==="rtl"?Qre(V4(N)):V4(N)},[N,k]);return[N,L]}function dz(e){var t=C.exports.useRef(e),r=C.exports.useState({}),n=Le(r,2),i=n[1],a=C.exports.useRef(null),u=C.exports.useRef([]);function o(f){u.current.push(f);var p=Promise.resolve();a.current=p,p.then(function(){if(a.current===p){var v=u.current,y=t.current;u.current=[],v.forEach(function(w){t.current=w(t.current)}),a.current=null,y!==t.current&&i({})}})}return C.exports.useEffect(function(){return function(){a.current=null}},[]),[t.current,o]}function ene(e){var t=C.exports.useRef(e||null),r=C.exports.useRef();function n(){window.clearTimeout(r.current)}function i(u){t.current=u,n(),r.current=window.setTimeout(function(){t.current=null,r.current=void 0},100)}function a(){return t.current}return C.exports.useEffect(function(){return n},[]),[i,a]}function tne(e,t,r){var n=C.exports.useMemo(function(){for(var i=[],a=[],u=0,o=0,f=0;f=0;o-=1){var f=t[o],p=r&&r[o],v=p&&p[xm];if(f||v||u){var y=v||{};y.columnType;var w=Mr(y,rne);i.unshift(S("col",{style:{width:f},...w},o)),u=!0}}return S("colgroup",{children:i})}function QP(e){var t=e.className,r=e.children;return S("div",{className:t,children:r})}var hz=C.exports.createContext({});function nne(e){var t=e.className,r=e.index,n=e.children,i=e.colSpan,a=i===void 0?1:i,u=e.rowSpan,o=e.align,f=C.exports.useContext(Ys),p=f.prefixCls,v=f.direction,y=C.exports.useContext(hz),w=y.scrollColumnIndex,k=y.stickyOffsets,T=y.flattenColumns,R=r+a-1,A=R+1===w?a+1:a,I=$S(r,r+A-1,T,k,v);return S(Mv,{className:t,index:r,component:"td",prefixCls:p,record:null,dataIndex:null,align:o,colSpan:A,rowSpan:u,render:function(){return n},...I})}var ine=["children"];function one(e){var t=e.children,r=Mr(e,ine);return S("tr",{...r,children:t})}function Mx(e){var t=e.children;return t}Mx.Row=one;Mx.Cell=nne;function Iy(e){var t=e.children,r=e.stickyOffsets,n=e.flattenColumns,i=C.exports.useContext(Ys),a=i.prefixCls,u=n.length-1,o=n[u],f=C.exports.useMemo(function(){return{stickyOffsets:r,flattenColumns:n,scrollColumnIndex:o!=null&&o.scrollbar?u:null}},[o,n,u,r]);return S(hz.Provider,{value:f,children:S("tfoot",{className:"".concat(a,"-summary"),children:t})})}var pz=Mx;function ane(e){var t,r=e.prefixCls,n=e.record,i=e.onExpand,a=e.expanded,u=e.expandable,o="".concat(r,"-row-expand-icon");if(!u)return S("span",{className:Qe(o,"".concat(r,"-row-spaced"))});var f=function(v){i(n,v),v.stopPropagation()};return S("span",{className:Qe(o,(t={},se(t,"".concat(r,"-row-expanded"),a),se(t,"".concat(r,"-row-collapsed"),!a),t)),onClick:f})}function sne(e,t,r){var n=[];function i(a){(a||[]).forEach(function(u,o){n.push(t(u,o)),i(u[r])})}return i(e),n}var lne=function(t,r){var n,i,a=t.scrollBodyRef,u=t.onScroll,o=t.offsetScroll,f=t.container,p=C.exports.useContext(Ys),v=p.prefixCls,y=((n=a.current)===null||n===void 0?void 0:n.scrollWidth)||0,w=((i=a.current)===null||i===void 0?void 0:i.clientWidth)||0,k=y&&w*(w/y),T=C.exports.useRef(),R=dz({scrollLeft:0,isHiddenScrollBar:!1}),A=Le(R,2),I=A[0],O=A[1],N=C.exports.useRef({delta:0,x:0}),L=C.exports.useState(!1),B=Le(L,2),j=B[0],G=B[1],H=function(){G(!1)},te=function(Q){Q.persist(),N.current.delta=Q.pageX-I.scrollLeft,N.current.x=0,G(!0),Q.preventDefault()},Y=function(Q){var ge,ne=Q||((ge=window)===null||ge===void 0?void 0:ge.event),de=ne.buttons;if(!j||de===0){j&&G(!1);return}var oe=N.current.x+Q.pageX-N.current.x-N.current.delta;oe<=0&&(oe=0),oe+k>=w&&(oe=w-k),u({scrollLeft:oe/w*(y+2)}),N.current.x=Q.pageX},le=function(){if(!!a.current){var Q=LP(a.current).top,ge=Q+a.current.offsetHeight,ne=f===window?document.documentElement.scrollTop+window.innerHeight:LP(f).top+f.clientHeight;ge-d1()<=ne||Q>=ne-o?O(function(de){return ve(ve({},de),{},{isHiddenScrollBar:!0})}):O(function(de){return ve(ve({},de),{},{isHiddenScrollBar:!1})})}},J=function(Q){O(function(ge){return ve(ve({},ge),{},{scrollLeft:Q/y*w||0})})};return C.exports.useImperativeHandle(r,function(){return{setScrollLeft:J}}),C.exports.useEffect(function(){var Z=kl(document.body,"mouseup",H,!1),Q=kl(document.body,"mousemove",Y,!1);return le(),function(){Z.remove(),Q.remove()}},[k,j]),C.exports.useEffect(function(){var Z=kl(f,"scroll",le,!1),Q=kl(window,"resize",le,!1);return function(){Z.remove(),Q.remove()}},[f]),C.exports.useEffect(function(){I.isHiddenScrollBar||O(function(Z){var Q=a.current;return Q?ve(ve({},Z),{},{scrollLeft:Q.scrollLeft/Q.scrollWidth*Q.clientWidth}):Z})},[I.isHiddenScrollBar]),y<=w||!k||I.isHiddenScrollBar?null:S("div",{style:{height:d1(),width:w,bottom:o},className:"".concat(v,"-sticky-scroll"),children:S("div",{onMouseDown:te,ref:T,className:Qe("".concat(v,"-sticky-scroll-bar"),se({},"".concat(v,"-sticky-scroll-bar-active"),j)),style:{width:"".concat(k,"px"),transform:"translate3d(".concat(I.scrollLeft,"px, 0, 0)")}})})};const une=C.exports.forwardRef(lne);var JP=Lo()?window:null;function cne(e,t){var r=ar(e)==="object"?e:{},n=r.offsetHeader,i=n===void 0?0:n,a=r.offsetSummary,u=a===void 0?0:a,o=r.offsetScroll,f=o===void 0?0:o,p=r.getContainer,v=p===void 0?function(){return JP}:p,y=v()||JP;return C.exports.useMemo(function(){var w=!!e;return{isSticky:w,stickyClassName:w?"".concat(t,"-sticky-holder"):"",offsetHeader:i,offsetSummary:u,offsetScroll:f,container:y}},[f,i,u,t,y])}var dne=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function fne(e,t){return C.exports.useMemo(function(){for(var r=[],n=0;n=0})},[a]),Y=a[a.length-1],le={fixed:Y?Y.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(N,"-cell-scrollbar")}}},J=C.exports.useMemo(function(){return j?[].concat(wt(i),[le]):i},[j,i]),Z=C.exports.useMemo(function(){return j?[].concat(wt(a),[le]):a},[j,a]),Q=C.exports.useMemo(function(){var ne=f.right,de=f.left;return ve(ve({},f),{},{left:p==="rtl"?[].concat(wt(de.map(function(oe){return oe+j})),[0]):de,right:p==="rtl"?ne:[].concat(wt(ne.map(function(oe){return oe+j})),[0]),isSticky:B})},[j,f,B]),ge=fne(u,o);return S("div",{style:ve({overflow:"hidden"},B?{top:y,bottom:w}:{}),ref:H,className:Qe(r,se({},k,!!k)),children:Xe("table",{style:{tableLayout:"fixed",visibility:n||ge?null:"hidden"},children:[(!n||!R||te)&&S(fz,{colWidths:ge?[].concat(wt(ge),[j]):[],columCount:o+1,columns:Z}),A(ve(ve({},I),{},{stickyOffsets:Q,columns:J,flattenColumns:Z}))]})})});j4.displayName="FixedHolder";var hne=[],pne={},u0="rc-table-internal-hook",mne=C.exports.memo(function(e){var t=e.children;return t},function(e,t){return ld(e.props,t.props)?e.pingLeft!==t.pingLeft||e.pingRight!==t.pingRight:!1});function xd(e){var t,r=e.prefixCls,n=e.className,i=e.rowClassName,a=e.style,u=e.data,o=e.rowKey,f=e.scroll,p=e.tableLayout,v=e.direction,y=e.title,w=e.footer,k=e.summary,T=e.id,R=e.showHeader,A=e.components,I=e.emptyText,O=e.onRow,N=e.onHeaderRow,L=e.internalHooks,B=e.transformColumns,j=e.internalRefs,G=e.sticky,H=u||hne,te=!!H.length,Y=C.exports.useCallback(function(Fr,Zr){return J9(A||{},Fr)||Zr},[A]),le=C.exports.useMemo(function(){return typeof o=="function"?o:function(Fr){var Zr=Fr&&Fr[o];return Zr}},[o]),J=Zre(e),Z=J.expandIcon,Q=J.expandedRowKeys,ge=J.defaultExpandedRowKeys,ne=J.defaultExpandAllRows,de=J.expandedRowRender,oe=J.columnTitle,ye=J.onExpand,Re=J.onExpandedRowsChange,Te=J.expandRowByClick,ke=J.rowExpandable,ze=J.expandIconColumnIndex,Ie=J.expandedRowClassName,Ne=J.childrenColumnName,De=J.indentSize,Ve=Z||ane,Ge=Ne||"children",je=C.exports.useMemo(function(){return de?"row":e.expandable&&L===u0&&e.expandable.__PARENT_RENDER_ICON__||H.some(function(Fr){return Fr&&ar(Fr)==="object"&&Fr[Ge]})?"nest":!1},[!!de,H]),ct=C.exports.useState(function(){return ge||(ne?sne(H,le,Ge):[])}),pt=Le(ct,2),Tt=pt[0],Ye=pt[1],Pt=C.exports.useMemo(function(){return new Set(Q||Tt||[])},[Q,Tt]),mt=C.exports.useCallback(function(Fr){var Zr=le(Fr,H.indexOf(Fr)),An,Di=Pt.has(Zr);Di?(Pt.delete(Zr),An=wt(Pt)):An=[].concat(wt(Pt),[Zr]),Ye(An),ye&&ye(!Di,Fr),Re&&Re(An)},[le,Pt,H,ye,Re]),It=C.exports.useState(0),Ct=Le(It,2),Dt=Ct[0],lt=Ct[1],dt=Jre(ve(ve(ve({},e),J),{},{expandable:!!de,columnTitle:oe,expandedKeys:Pt,getRowKey:le,onTriggerExpand:mt,expandIcon:Ve,expandIconColumnIndex:ze,direction:v}),L===u0?B:null),ut=Le(dt,2),it=ut[0],ft=ut[1],xt=C.exports.useMemo(function(){return{columns:it,flattenColumns:ft}},[it,ft]),Wt=C.exports.useRef(),jt=C.exports.useRef(),Qt=C.exports.useRef(),Fe=C.exports.useRef(),qe=C.exports.useRef(),Xt=C.exports.useState(!1),cr=Le(Xt,2),Vt=cr[0],Ut=cr[1],rr=C.exports.useState(!1),xr=Le(rr,2),Or=xr[0],_t=xr[1],qt=dz(new Map),or=Le(qt,2),$r=or[0],Er=or[1],Lt=Tx(ft),kr=Lt.map(function(Fr){return $r.get(Fr)}),wr=C.exports.useMemo(function(){return kr},[kr.join("_")]),fr=tne(wr,ft.length,v),Nt=f&&B4(f.y),ot=f&&B4(f.x)||Boolean(J.fixed),ht=ot&&ft.some(function(Fr){var Zr=Fr.fixed;return Zr}),Ot=C.exports.useRef(),$t=cne(G,r),ur=$t.isSticky,Ir=$t.offsetHeader,qr=$t.offsetSummary,Gr=$t.offsetScroll,me=$t.stickyClassName,K=$t.container,q=k==null?void 0:k(H),ce=(Nt||ur)&&C.exports.isValidElement(q)&&q.type===Mx&&q.props.fixed,ae,xe,Ee;Nt&&(xe={overflowY:"scroll",maxHeight:f.y}),ot&&(ae={overflowX:"auto"},Nt||(xe={overflowY:"hidden"}),Ee={width:(f==null?void 0:f.x)===!0?"auto":f==null?void 0:f.x,minWidth:"100%"});var be=C.exports.useCallback(function(Fr,Zr){uS(Wt.current)&&Er(function(An){if(An.get(Fr)!==Zr){var Di=new Map(An);return Di.set(Fr,Zr),Di}return An})},[]),Ce=ene(null),Ae=Le(Ce,2),He=Ae[0],We=Ae[1];function Be(Fr,Zr){!Zr||(typeof Zr=="function"?Zr(Fr):Zr.scrollLeft!==Fr&&(Zr.scrollLeft=Fr))}var At=function(Zr){var An=Zr.currentTarget,Di=Zr.scrollLeft,Es=v==="rtl",Vo=typeof Di=="number"?Di:An.scrollLeft,tl=An||pne;if(!We()||We()===tl){var Ja;He(tl),Be(Vo,jt.current),Be(Vo,Qt.current),Be(Vo,qe.current),Be(Vo,(Ja=Ot.current)===null||Ja===void 0?void 0:Ja.setScrollLeft)}if(An){var xn=An.scrollWidth,es=An.clientWidth;if(xn===es){Ut(!1),_t(!1);return}Es?(Ut(-Vo0)):(Ut(Vo>0),_t(Vo-1}var Fne=Lne,$ne=Ox;function Bne(e,t){var r=this.__data__,n=$ne(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Vne=Bne,jne=Sne,Une=One,Kne=zne,Hne=Fne,Wne=Vne;function yh(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var p=a.get(e),v=a.get(t);if(p&&v)return p==t&&v==e;var y=-1,w=!0,k=r&fae?new lae:void 0;for(a.set(e,t),a.set(t,e);++y-1&&e%1==0&&e-1&&e%1==0&&e<=_se}var wz=bse,wse=wv,Cse=wz,Sse=Cv,Ese="[object Arguments]",kse="[object Array]",Tse="[object Boolean]",Pse="[object Date]",Mse="[object Error]",Ise="[object Function]",Rse="[object Map]",Ose="[object Number]",Ase="[object Object]",Nse="[object RegExp]",zse="[object Set]",Dse="[object String]",Lse="[object WeakMap]",Fse="[object ArrayBuffer]",$se="[object DataView]",Bse="[object Float32Array]",Vse="[object Float64Array]",jse="[object Int8Array]",Use="[object Int16Array]",Kse="[object Int32Array]",Hse="[object Uint8Array]",Wse="[object Uint8ClampedArray]",qse="[object Uint16Array]",Gse="[object Uint32Array]",qn={};qn[Bse]=qn[Vse]=qn[jse]=qn[Use]=qn[Kse]=qn[Hse]=qn[Wse]=qn[qse]=qn[Gse]=!0;qn[Ese]=qn[kse]=qn[Fse]=qn[Tse]=qn[$se]=qn[Pse]=qn[Mse]=qn[Ise]=qn[Rse]=qn[Ose]=qn[Ase]=qn[Nse]=qn[zse]=qn[Dse]=qn[Lse]=!1;function Zse(e){return Sse(e)&&Cse(e.length)&&!!qn[wse(e)]}var Xse=Zse;function Yse(e){return function(t){return e(t)}}var Qse=Yse,U4={exports:{}};(function(e,t){var r=a9,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,u=a&&r.process,o=function(){try{var f=i&&i.require&&i.require("util").types;return f||u&&u.binding&&u.binding("util")}catch{}}();e.exports=o})(U4,U4.exports);var Jse=Xse,ele=Qse,l8=U4.exports,u8=l8&&l8.isTypedArray,tle=u8?ele(u8):Jse,Cz=tle,rle=nse,nle=hse,ile=RS,ole=p1.exports,ale=xse,sle=Cz,lle=Object.prototype,ule=lle.hasOwnProperty;function cle(e,t){var r=ile(e),n=!r&&nle(e),i=!r&&!n&&ole(e),a=!r&&!n&&!i&&sle(e),u=r||n||i||a,o=u?rle(e.length,String):[],f=o.length;for(var p in e)(t||ule.call(e,p))&&!(u&&(p=="length"||i&&(p=="offset"||p=="parent")||a&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||ale(p,f)))&&o.push(p);return o}var dle=cle,fle=Object.prototype;function hle(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fle;return e===r}var ple=hle;function mle(e,t){return function(r){return e(t(r))}}var vle=mle,gle=vle,yle=gle(Object.keys,Object),xle=yle,_le=ple,ble=xle,wle=Object.prototype,Cle=wle.hasOwnProperty;function Sle(e){if(!_le(e))return ble(e);var t=[];for(var r in Object(e))Cle.call(e,r)&&r!="constructor"&&t.push(r);return t}var Ele=Sle,kle=gz,Tle=wz;function Ple(e){return e!=null&&Tle(e.length)&&!kle(e)}var Mle=Ple,Ile=dle,Rle=Ele,Ole=Mle;function Ale(e){return Ole(e)?Ile(e):Rle(e)}var Nle=Ale,zle=Hae,Dle=tse,Lle=Nle;function Fle(e){return zle(e,Lle,Dle)}var $le=Fle,c8=$le,Ble=1,Vle=Object.prototype,jle=Vle.hasOwnProperty;function Ule(e,t,r,n,i,a){var u=r&Ble,o=c8(e),f=o.length,p=c8(t),v=p.length;if(f!=v&&!u)return!1;for(var y=f;y--;){var w=o[y];if(!(u?w in t:jle.call(t,w)))return!1}var k=a.get(e),T=a.get(t);if(k&&T)return k==t&&T==e;var R=!0;a.set(e,t),a.set(t,e);for(var A=u;++y0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=e.length,n=t.length;if(Math.abs(r-n)!==1)return{add:!1,key:null};function i(a,u){var o=new Map;a.forEach(function(p){o.set(p,!0)});var f=u.filter(function(p){return!o.has(p)});return f.length===1?f[0]:null}return r ").concat(t);return t}var Mz=C.exports.forwardRef(function(e,t){var r=e.prefixCls,n=e.data;e.selectable,e.checkable;var i=e.expandedKeys,a=e.selectedKeys,u=e.checkedKeys,o=e.loadedKeys,f=e.loadingKeys,p=e.halfCheckedKeys,v=e.keyEntities,y=e.disabled,w=e.dragging,k=e.dragOverNodeKey,T=e.dropPosition,R=e.motion,A=e.height,I=e.itemHeight,O=e.virtual,N=e.focusable,L=e.activeItem,B=e.focused,j=e.tabIndex,G=e.onKeyDown,H=e.onFocus,te=e.onBlur,Y=e.onActiveChange,le=e.onListChangeStart,J=e.onListChangeEnd,Z=Mr(e,Mue),Q=C.exports.useRef(null),ge=C.exports.useRef(null);C.exports.useImperativeHandle(t,function(){return{scrollTo:function(ut){Q.current.scrollTo(ut)},getIndentWidth:function(){return ge.current.offsetWidth}}});var ne=C.exports.useState(i),de=Le(ne,2),oe=de[0],ye=de[1],Re=C.exports.useState(n),Te=Le(Re,2),ke=Te[0],ze=Te[1],Ie=C.exports.useState(n),Ne=Le(Ie,2),De=Ne[0],Ve=Ne[1],Ge=C.exports.useState([]),je=Le(Ge,2),ct=je[0],pt=je[1],Tt=C.exports.useState(null),Ye=Le(Tt,2),Pt=Ye[0],mt=Ye[1],It=C.exports.useRef(n);It.current=n;function Ct(){var dt=It.current;ze(dt),Ve(dt),pt([]),mt(null),J()}C.exports.useEffect(function(){ye(i);var dt=Pue(oe,i);if(dt.key!==null)if(dt.add){var ut=ke.findIndex(function(Qt){var Fe=Qt.key;return Fe===dt.key}),it=T8(S8(ke,n,dt.key),O,A,I),ft=ke.slice();ft.splice(ut+1,0,k8),Ve(ft),pt(it),mt("show")}else{var xt=n.findIndex(function(Qt){var Fe=Qt.key;return Fe===dt.key}),Wt=T8(S8(n,ke,dt.key),O,A,I),jt=n.slice();jt.splice(xt+1,0,k8),Ve(jt),pt(Wt),mt("hide")}else ke!==n&&(ze(n),Ve(n))},[i,n]),C.exports.useEffect(function(){w||Ct()},[w]);var Dt=R?De:n,lt={expandedKeys:i,selectedKeys:a,loadedKeys:o,loadingKeys:f,checkedKeys:u,halfCheckedKeys:p,dragOverNodeKey:k,dropPosition:T,keyEntities:v};return Xe(Ar,{children:[B&&L&&S("span",{style:E8,"aria-live":"assertive",children:Rue(L)}),S("div",{children:S("input",{style:E8,disabled:N===!1||y,tabIndex:N!==!1?j:null,onKeyDown:G,onFocus:H,onBlur:te,value:"",onChange:Iue,"aria-label":"for screen reader"})}),S("div",{className:"".concat(r,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0},children:S("div",{className:"".concat(r,"-indent"),children:S("div",{ref:ge,className:"".concat(r,"-indent-unit")})})}),S(fS,{...Z,data:Dt,itemKey:P8,height:A,fullHeight:!1,virtual:O,itemHeight:I,prefixCls:"".concat(r,"-list"),ref:Q,onVisibleChange:function(ut,it){var ft=new Set(ut),xt=it.filter(function(Wt){return!ft.has(Wt)});xt.some(function(Wt){return P8(Wt)===cd})&&Ct()},children:function(dt){var ut=dt.pos,it=tt({},(kz(dt.data),dt.data)),ft=dt.title,xt=dt.key,Wt=dt.isStart,jt=dt.isEnd,Qt=Sv(xt,ut);delete it.key,delete it.children;var Fe=gm(Qt,lt);return S(Tue,{...it,...Fe,title:ft,active:!!L&&xt===L.key,pos:ut,data:dt.data,isStart:Wt,isEnd:jt,motion:R,motionNodes:xt===cd?ct:null,motionType:Pt,onMotionStart:le,onMotionEnd:Ct,treeNodeRequiredProps:lt,onMouseMove:function(){Y(null)}})}})]})});Mz.displayName="NodeList";function Oue(e){var t=e.dropPosition,r=e.dropLevelOffset,n=e.indent,i={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:i.top=0,i.left=-r*n;break;case 1:i.bottom=0,i.left=-r*n;break;case 0:i.bottom=0,i.left=n;break}return S("div",{style:i})}var Aue=10,Dx=function(e){vi(r,e);var t=gi(r);function r(){var n;Qn(this,r);for(var i=arguments.length,a=new Array(i),u=0;u2&&arguments[2]!==void 0?arguments[2]:!1,y=n.state,w=y.dragChildrenKeys,k=y.dropPosition,T=y.dropTargetKey,R=y.dropTargetPos,A=y.dropAllowed;if(!!A){var I=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),T!==null){var O=ve(ve({},gm(T,n.getTreeNodeRequiredProps())),{},{active:((p=n.getActiveItem())===null||p===void 0?void 0:p.key)===T,data:n.state.keyEntities[T].node}),N=w.indexOf(T)!==-1;Bn(!N,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var L=NS(R),B={event:o,node:Ri(O),dragNode:n.dragNode?Ri(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(w),dropToGap:k!==0,dropPosition:k+Number(L[L.length-1])};v||I==null||I(B),n.dragNode=null}}},n.cleanDragState=function(){var o=n.state.draggingNodeKey;o!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(o,f){var p=n.state,v=p.expandedKeys,y=p.flattenNodes,w=f.expanded,k=f.key,T=f.isLeaf;if(!(T||o.shiftKey||o.metaKey||o.ctrlKey)){var R=y.filter(function(I){return I.key===k})[0],A=Ri(ve(ve({},gm(k,n.getTreeNodeRequiredProps())),{},{data:R.data}));n.setExpandedKeys(w?Ds(v,k):vl(v,k)),n.onNodeExpand(o,A)}},n.onNodeClick=function(o,f){var p=n.props,v=p.onClick,y=p.expandAction;y==="click"&&n.triggerExpandActionExpand(o,f),v==null||v(o,f)},n.onNodeDoubleClick=function(o,f){var p=n.props,v=p.onDoubleClick,y=p.expandAction;y==="doubleClick"&&n.triggerExpandActionExpand(o,f),v==null||v(o,f)},n.onNodeSelect=function(o,f){var p=n.state.selectedKeys,v=n.state,y=v.keyEntities,w=v.fieldNames,k=n.props,T=k.onSelect,R=k.multiple,A=f.selected,I=f[w.key],O=!A;O?R?p=vl(p,I):p=[I]:p=Ds(p,I);var N=p.map(function(L){var B=y[L];return B?B.node:null}).filter(function(L){return L});n.setUncontrolledState({selectedKeys:p}),T==null||T(p,{event:"select",selected:O,node:f,selectedNodes:N,nativeEvent:o.nativeEvent})},n.onNodeCheck=function(o,f,p){var v=n.state,y=v.keyEntities,w=v.checkedKeys,k=v.halfCheckedKeys,T=n.props,R=T.checkStrictly,A=T.onCheck,I=f.key,O,N={event:"check",node:f,checked:p,nativeEvent:o.nativeEvent};if(R){var L=p?vl(w,I):Ds(w,I),B=Ds(k,I);O={checked:L,halfChecked:B},N.checkedNodes=L.map(function(le){return y[le]}).filter(function(le){return le}).map(function(le){return le.node}),n.setUncontrolledState({checkedKeys:L})}else{var j=Pl([].concat(wt(w),[I]),!0,y),G=j.checkedKeys,H=j.halfCheckedKeys;if(!p){var te=new Set(G);te.delete(I);var Y=Pl(Array.from(te),{checked:!1,halfCheckedKeys:H},y);G=Y.checkedKeys,H=Y.halfCheckedKeys}O=G,N.checkedNodes=[],N.checkedNodesPositions=[],N.halfCheckedKeys=H,G.forEach(function(le){var J=y[le];if(!!J){var Z=J.node,Q=J.pos;N.checkedNodes.push(Z),N.checkedNodesPositions.push({node:Z,pos:Q})}}),n.setUncontrolledState({checkedKeys:G},!1,{halfCheckedKeys:H})}A==null||A(O,N)},n.onNodeLoad=function(o){var f=o.key,p=new Promise(function(v,y){n.setState(function(w){var k=w.loadedKeys,T=k===void 0?[]:k,R=w.loadingKeys,A=R===void 0?[]:R,I=n.props,O=I.loadData,N=I.onLoad;if(!O||T.indexOf(f)!==-1||A.indexOf(f)!==-1)return null;var L=O(o);return L.then(function(){var B=n.state.loadedKeys,j=vl(B,f);N==null||N(j,{event:"load",node:o}),n.setUncontrolledState({loadedKeys:j}),n.setState(function(G){return{loadingKeys:Ds(G.loadingKeys,f)}}),v()}).catch(function(B){if(n.setState(function(G){return{loadingKeys:Ds(G.loadingKeys,f)}}),n.loadingRetryTimes[f]=(n.loadingRetryTimes[f]||0)+1,n.loadingRetryTimes[f]>=Aue){var j=n.state.loadedKeys;Bn(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:vl(j,f)}),v()}y(B)}),{loadingKeys:vl(A,f)}})});return p.catch(function(){}),p},n.onNodeMouseEnter=function(o,f){var p=n.props.onMouseEnter;p==null||p({event:o,node:f})},n.onNodeMouseLeave=function(o,f){var p=n.props.onMouseLeave;p==null||p({event:o,node:f})},n.onNodeContextMenu=function(o,f){var p=n.props.onRightClick;p&&(o.preventDefault(),p({event:o,node:f}))},n.onFocus=function(){var o=n.props.onFocus;n.setState({focused:!0});for(var f=arguments.length,p=new Array(f),v=0;v1&&arguments[1]!==void 0?arguments[1]:!1,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var v=!1,y=!0,w={};Object.keys(o).forEach(function(k){if(k in n.props){y=!1;return}v=!0,w[k]=o[k]}),v&&(!f||y)&&n.setState(ve(ve({},w),p))}},n.scrollTo=function(o){n.listRef.current.scrollTo(o)},n}return Jn(r,[{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,a=this.state,u=a.focused,o=a.flattenNodes,f=a.keyEntities,p=a.draggingNodeKey,v=a.activeKey,y=a.dropLevelOffset,w=a.dropContainerKey,k=a.dropTargetKey,T=a.dropPosition,R=a.dragOverNodeKey,A=a.indent,I=this.props,O=I.prefixCls,N=I.className,L=I.style,B=I.showLine,j=I.focusable,G=I.tabIndex,H=G===void 0?0:G,te=I.selectable,Y=I.showIcon,le=I.icon,J=I.switcherIcon,Z=I.draggable,Q=I.checkable,ge=I.checkStrictly,ne=I.disabled,de=I.motion,oe=I.loadData,ye=I.filterTreeNode,Re=I.height,Te=I.itemHeight,ke=I.virtual,ze=I.titleRender,Ie=I.dropIndicatorRender,Ne=I.onContextMenu,De=I.onScroll,Ve=I.direction,Ge=I.rootClassName,je=I.rootStyle,ct=Wu(this.props,{aria:!0,data:!0}),pt;return Z&&(ar(Z)==="object"?pt=Z:typeof Z=="function"?pt={nodeDraggable:Z}:pt={}),S(AS.Provider,{value:{prefixCls:O,selectable:te,showIcon:Y,icon:le,switcherIcon:J,draggable:pt,draggingNodeKey:p,checkable:Q,checkStrictly:ge,disabled:ne,keyEntities:f,dropLevelOffset:y,dropContainerKey:w,dropTargetKey:k,dropPosition:T,dragOverNodeKey:R,indent:A,direction:Ve,dropIndicatorRender:Ie,loadData:oe,filterTreeNode:ye,titleRender:ze,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:S("div",{role:"tree",className:Qe(O,N,Ge,(i={},se(i,"".concat(O,"-show-line"),B),se(i,"".concat(O,"-focused"),u),se(i,"".concat(O,"-active-focused"),v!==null),i)),style:je,children:S(Mz,{ref:this.listRef,prefixCls:O,style:L,data:o,disabled:ne,selectable:te,checkable:!!Q,motion:de,dragging:p!==null,height:Re,itemHeight:Te,virtual:ke,focusable:j,focused:u,tabIndex:H,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Ne,onScroll:De,...this.getTreeNodeRequiredProps(),...ct})})})}}],[{key:"getDerivedStateFromProps",value:function(i,a){var u=a.prevProps,o={prevProps:i};function f(j){return!u&&j in i||u&&u[j]!==i[j]}var p,v=a.fieldNames;if(f("fieldNames")&&(v=u1(i.fieldNames),o.fieldNames=v),f("treeData")?p=i.treeData:f("children")&&(Bn(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),p=h9(i.children)),p){o.treeData=p;var y=Ex(p,{fieldNames:v});o.keyEntities=ve(se({},cd,Pz),y.keyEntities)}var w=o.keyEntities||a.keyEntities;if(f("expandedKeys")||u&&f("autoExpandParent"))o.expandedKeys=i.autoExpandParent||!u&&i.defaultExpandParent?D4(i.expandedKeys,w):i.expandedKeys;else if(!u&&i.defaultExpandAll){var k=ve({},w);delete k[cd],o.expandedKeys=Object.keys(k).map(function(j){return k[j].key})}else!u&&i.defaultExpandedKeys&&(o.expandedKeys=i.autoExpandParent||i.defaultExpandParent?D4(i.defaultExpandedKeys,w):i.defaultExpandedKeys);if(o.expandedKeys||delete o.expandedKeys,p||o.expandedKeys){var T=d2(p||a.treeData,o.expandedKeys||a.expandedKeys,v);o.flattenNodes=T}if(i.selectable&&(f("selectedKeys")?o.selectedKeys=bP(i.selectedKeys,i):!u&&i.defaultSelectedKeys&&(o.selectedKeys=bP(i.defaultSelectedKeys,i))),i.checkable){var R;if(f("checkedKeys")?R=c2(i.checkedKeys)||{}:!u&&i.defaultCheckedKeys?R=c2(i.defaultCheckedKeys)||{}:p&&(R=c2(i.checkedKeys)||{checkedKeys:a.checkedKeys,halfCheckedKeys:a.halfCheckedKeys}),R){var A=R,I=A.checkedKeys,O=I===void 0?[]:I,N=A.halfCheckedKeys,L=N===void 0?[]:N;if(!i.checkStrictly){var B=Pl(O,!0,w);O=B.checkedKeys,L=B.halfCheckedKeys}o.checkedKeys=O,o.halfCheckedKeys=L}}return f("loadedKeys")&&(o.loadedKeys=i.loadedKeys),o}}]),r}(C.exports.Component);Dx.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:Oue,allowDrop:function(){return!0},expandAction:!1};Dx.TreeNode=ud;var Nue={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 zue=Nue;var Iz=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:zue})})};Iz.displayName="HolderOutlined";const Due=C.exports.forwardRef(Iz);var M8=4;function Lue(e){var t,r=e.dropPosition,n=e.dropLevelOffset,i=e.prefixCls,a=e.indent,u=e.direction,o=u===void 0?"ltr":u,f=o==="ltr"?"left":"right",p=o==="ltr"?"right":"left",v=(t={},se(t,f,-n*a+M8),se(t,p,0),t);switch(r){case-1:v.top=-3;break;case 1:v.bottom=-3;break;default:v.bottom=-3,v[f]=a+M8;break}return S("div",{style:v,className:"".concat(i,"-drop-indicator")})}var Fue={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 $ue=Fue;var Rz=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:$ue})})};Rz.displayName="CaretDownFilled";const Bue=C.exports.forwardRef(Rz);var Vue={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 jue=Vue;var Oz=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:jue})})};Oz.displayName="FileOutlined";const Az=C.exports.forwardRef(Oz);var Uue={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 Kue=Uue;var Nz=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:Kue})})};Nz.displayName="MinusSquareOutlined";const Hue=C.exports.forwardRef(Nz);var Wue={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 que=Wue;var zz=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:que})})};zz.displayName="PlusSquareOutlined";const Gue=C.exports.forwardRef(zz);function Dz(e,t,r,n){var i=n.isLeaf,a=n.expanded,u=n.loading;if(u)return S(Wf,{className:"".concat(e,"-switcher-loading-icon")});var o;if(r&&ar(r)==="object"&&(o=r.showLeafIcon),i){if(!r)return null;if(typeof o!="boolean"&&!!o){var f=typeof o=="function"?o(n):o,p="".concat(e,"-switcher-line-custom-icon");return Yo(f)?Ni(f,{className:Qe(f.props.className||"",p)}):f}return o?S(Az,{className:"".concat(e,"-switcher-line-icon")}):S("span",{className:"".concat(e,"-switcher-leaf-line")})}var v="".concat(e,"-switcher-icon"),y=typeof t=="function"?t(n):t;return Yo(y)?Ni(y,{className:Qe(y.props.className||"",v)}):y||(r?a?S(Hue,{className:"".concat(e,"-switcher-line-icon")}):S(Gue,{className:"".concat(e,"-switcher-line-icon")}):S(Bue,{className:v}))}var Zue=C.exports.forwardRef(function(e,t){var r,n=C.exports.useContext(zr),i=n.getPrefixCls,a=n.direction,u=n.virtual,o=e.prefixCls,f=e.className,p=e.showIcon,v=p===void 0?!1:p,y=e.showLine,w=e.switcherIcon,k=e.blockNode,T=k===void 0?!1:k,R=e.children,A=e.checkable,I=A===void 0?!1:A,O=e.selectable,N=O===void 0?!0:O,L=e.draggable,B=e.motion,j=B===void 0?tt(tt({},Gm),{motionAppear:!1}):B,G=i("tree",o),H=tt(tt({},e),{checkable:I,selectable:N,showIcon:v,motion:j,blockNode:T,showLine:Boolean(y),dropIndicatorRender:Lue}),te=C.exports.useMemo(function(){if(!L)return!1;var Y={};switch(ar(L)){case"function":Y.nodeDraggable=L;break;case"object":Y=tt({},L);break}return Y.icon!==!1&&(Y.icon=Y.icon||S(Due,{})),Y},[L]);return S(Dx,{itemHeight:20,ref:t,virtual:u,...H,prefixCls:G,className:Qe((r={},se(r,"".concat(G,"-icon-hide"),!v),se(r,"".concat(G,"-block-node"),T),se(r,"".concat(G,"-unselectable"),!N),se(r,"".concat(G,"-rtl"),a==="rtl"),r),f),direction:a,checkable:I&&S("span",{className:"".concat(G,"-checkbox-inner")}),selectable:N,switcherIcon:function(le){return Dz(G,w,y,le)},draggable:te,children:R})});const Lz=Zue;var Xue={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 Yue=Xue;var Fz=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:Yue})})};Fz.displayName="FolderOpenOutlined";const Que=C.exports.forwardRef(Fz);var Jue={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 ece=Jue;var $z=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:ece})})};$z.displayName="FolderOutlined";const tce=C.exports.forwardRef($z);var yl;(function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"})(yl||(yl={}));function jS(e,t){function r(n){var i=n.key,a=n.children;t(i,n)!==!1&&jS(a||[],t)}e.forEach(r)}function rce(e){var t=e.treeData,r=e.expandedKeys,n=e.startKey,i=e.endKey,a=[],u=yl.None;if(n&&n===i)return[n];if(!n||!i)return[];function o(f){return f===n||f===i}return jS(t,function(f){if(u===yl.End)return!1;if(o(f)){if(a.push(f),u===yl.None)u=yl.Start;else if(u===yl.Start)return u=yl.End,!1}else u===yl.Start&&a.push(f);return r.includes(f)}),a}function C2(e,t){var r=wt(t),n=[];return jS(e,function(i,a){var u=r.indexOf(i);return u!==-1&&(n.push(a),r.splice(u,1)),!!r.length}),n}var I8=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1},Xt=qe.confirm,cr=qe.closeDropdown;Xt&&pt([]),cr&&J(!1),je(""),oe(B?(j||[]).map(function(Vt){return String(Vt)}):[])},Pt=function(){var qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0},Xt=qe.closeDropdown;Xt&&J(!1),pt(de())},mt=function(qe){qe&&Q!==void 0&&oe(Q||[]),J(qe),!qe&&!i.filterDropdown&&Tt()},It=Qe(se({},"".concat(a,"-menu-without-submenu"),!fce(i.filters||[]))),Ct=function(qe){if(qe.target.checked){var Xt=Df(i==null?void 0:i.filters).map(function(cr){return String(cr)});oe(Xt)}else oe([])},Dt=function Fe(qe){var Xt=qe.filters;return(Xt||[]).map(function(cr,Vt){var Ut=String(cr.value),rr={title:cr.text,key:cr.value!==void 0?Ut:Vt};return cr.children&&(rr.children=Fe({filters:cr.children})),rr})},lt=function Fe(qe){var Xt;return tt(tt({},qe),{text:qe.title,value:qe.key,children:((Xt=qe.children)===null||Xt===void 0?void 0:Xt.map(function(cr){return Fe(cr)}))||[]})},dt;if(typeof i.filterDropdown=="function")dt=i.filterDropdown({prefixCls:"".concat(a,"-custom"),setSelectedKeys:function(qe){return ye({selectedKeys:qe})},selectedKeys:de(),confirm:Pt,clearFilters:Ye,filters:i.filters,visible:Z,close:function(){J(!1)}});else if(i.filterDropdown)dt=i.filterDropdown;else{var ut=de()||[],it=function(){return(i.filters||[]).length===0?S($s,{image:$s.PRESENTED_IMAGE_SIMPLE,description:T.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):p==="tree"?Xe(Ar,{children:[S(O8,{filterSearch:y,value:Ge,onChange:ct,tablePrefixCls:r,locale:T}),Xe("div",{className:"".concat(r,"-filter-dropdown-tree"),children:[o?S(ed,{checked:ut.length===Df(i.filters).length,indeterminate:ut.length>0&&ut.length0?a:e}),w=Math.ceil((a||e)/y.pageSize);y.current>w&&(y.current=w||1);var k=function(A,I){v({current:A!=null?A:1,pageSize:I||y.pageSize})},T=function(A,I){var O;t&&((O=t.onChange)===null||O===void 0||O.call(t,A,I)),k(A,I),r(A,I||(y==null?void 0:y.pageSize))};return t===!1?[{},function(){}]:[tt(tt({},y),{onChange:T}),k]}var vu={},Y4="SELECT_ALL",Q4="SELECT_INVERT",J4="SELECT_NONE",z8=[];function Kz(e,t){var r=[];return(e||[]).forEach(function(n){r.push(n),n&&ar(n)==="object"&&t in n&&(r=[].concat(wt(r),wt(Kz(n[t],t))))}),r}function _ce(e,t){var r=e||{},n=r.preserveSelectedRowKeys,i=r.selectedRowKeys,a=r.defaultSelectedRowKeys,u=r.getCheckboxProps,o=r.onChange,f=r.onSelect,p=r.onSelectAll,v=r.onSelectInvert,y=r.onSelectNone,w=r.onSelectMultiple,k=r.columnWidth,T=r.type,R=r.selections,A=r.fixed,I=r.renderCell,O=r.hideSelectAll,N=r.checkStrictly,L=N===void 0?!0:N,B=t.prefixCls,j=t.data,G=t.pageData,H=t.getRecordByKey,te=t.getRowKey,Y=t.expandType,le=t.childrenColumnName,J=t.locale,Z=t.getPopupContainer,Q=Yi(i||a||z8,{value:i}),ge=Le(Q,2),ne=ge[0],de=ge[1],oe=C.exports.useRef(new Map),ye=C.exports.useCallback(function(lt){if(n){var dt=new Map;lt.forEach(function(ut){var it=H(ut);!it&&oe.current.has(ut)&&(it=oe.current.get(ut)),dt.set(ut,it)}),oe.current=dt}},[H,n]);C.exports.useEffect(function(){ye(ne)},[ne]);var Re=C.exports.useMemo(function(){return L?{keyEntities:null}:Ex(j,{externalGetKey:te,childrenPropName:le})},[j,te,L,le]),Te=Re.keyEntities,ke=C.exports.useMemo(function(){return Kz(G,le)},[G,le]),ze=C.exports.useMemo(function(){var lt=new Map;return ke.forEach(function(dt,ut){var it=te(dt,ut),ft=(u?u(dt):null)||{};lt.set(it,ft)}),lt},[ke,te,u]),Ie=C.exports.useCallback(function(lt){var dt;return!!(!((dt=ze.get(te(lt)))===null||dt===void 0)&&dt.disabled)},[ze,te]),Ne=C.exports.useMemo(function(){if(L)return[ne||[],[]];var lt=Pl(ne,!0,Te,Ie),dt=lt.checkedKeys,ut=lt.halfCheckedKeys;return[dt||[],ut]},[ne,L,Te,Ie]),De=Le(Ne,2),Ve=De[0],Ge=De[1],je=C.exports.useMemo(function(){var lt=T==="radio"?Ve.slice(0,1):Ve;return new Set(lt)},[Ve,T]),ct=C.exports.useMemo(function(){return T==="radio"?new Set:new Set(Ge)},[Ge,T]),pt=C.exports.useState(null),Tt=Le(pt,2),Ye=Tt[0],Pt=Tt[1];C.exports.useEffect(function(){e||de(z8)},[!!e]);var mt=C.exports.useCallback(function(lt,dt){var ut,it;ye(lt),n?(ut=lt,it=lt.map(function(ft){return oe.current.get(ft)})):(ut=[],it=[],lt.forEach(function(ft){var xt=H(ft);xt!==void 0&&(ut.push(ft),it.push(xt))})),de(ut),o==null||o(ut,it,{type:dt})},[de,H,o,n]),It=C.exports.useCallback(function(lt,dt,ut,it){if(f){var ft=ut.map(function(xt){return H(xt)});f(H(lt),dt,ft,it)}mt(ut,"single")},[f,H,mt]),Ct=C.exports.useMemo(function(){if(!R||O)return null;var lt=R===!0?[Y4,Q4,J4]:R;return lt.map(function(dt){return dt===Y4?{key:"all",text:J.selectionAll,onSelect:function(){mt(j.map(function(it,ft){return te(it,ft)}).filter(function(it){var ft=ze.get(it);return!(ft!=null&&ft.disabled)||je.has(it)}),"all")}}:dt===Q4?{key:"invert",text:J.selectInvert,onSelect:function(){var it=new Set(je);G.forEach(function(xt,Wt){var jt=te(xt,Wt),Qt=ze.get(jt);Qt!=null&&Qt.disabled||(it.has(jt)?it.delete(jt):it.add(jt))});var ft=Array.from(it);v&&v(ft),mt(ft,"invert")}}:dt===J4?{key:"none",text:J.selectNone,onSelect:function(){y==null||y(),mt(Array.from(je).filter(function(it){var ft=ze.get(it);return ft==null?void 0:ft.disabled}),"none")}}:dt}).map(function(dt){return tt(tt({},dt),{onSelect:function(){for(var it,ft,xt=arguments.length,Wt=new Array(xt),jt=0;jt2&&arguments[2]!==void 0?arguments[2]:!1,Je=tt(tt({},it),Be);bt&&(it.resetPagination(),Je.pagination.current&&(Je.pagination.current=1),v&&v.onChange&&v.onChange(1,Je.pagination.pageSize)),Y&&Y.scrollToFirstRowOnChange!==!1&&Ct.body.current&&Wq(0,{getContainer:function(){return Ct.body.current}}),O==null||O(Je.pagination,Je.filters,Je.sorter,{currentDataSource:N8(tC(Ge,Je.sorterStates,mt),Je.filterStates),action:At})},xt=function(Be,At){ft({sorter:Be,sorterStates:At},"sort",!1)},Wt=Pce({prefixCls:pt,mergedColumns:oe,onSorterChange:xt,sortDirections:le||["ascend","descend"],tableLocale:Ve,showSorterTooltip:Q}),jt=Le(Wt,4),Qt=jt[0],Fe=jt[1],qe=jt[2],Xt=jt[3],cr=C.exports.useMemo(function(){return tC(Ge,Fe,mt)},[Ge,Fe]);it.sorter=Xt(),it.sorterStates=Fe;var Vt=function(Be,At){ft({filters:Be,filterStates:At},"filter",!0)},Ut=pce({prefixCls:pt,locale:Ve,dropdownPrefixCls:Tt,mergedColumns:oe,onFilterChange:Vt,getPopupContainer:N}),rr=Le(Ut,3),xr=rr[0],Or=rr[1],_t=rr[2],qt=N8(cr,Or);it.filters=_t,it.filterStates=Or;var or=C.exports.useMemo(function(){var We={};return Object.keys(_t).forEach(function(Be){_t[Be]!==null&&(We[Be]=_t[Be])}),tt(tt({},qe),{filters:We})},[qe,_t]),$r=Mce(or),Er=Le($r,1),Lt=Er[0],kr=function(Be,At){ft({pagination:tt(tt({},it.pagination),{current:Be,pageSize:At})},"paginate")},wr=xce(qt.length,v,kr),fr=Le(wr,2),Nt=fr[0],ot=fr[1];it.pagination=v===!1?{}:gce(v,Nt),it.resetPagination=ot;var ht=C.exports.useMemo(function(){if(v===!1||!Nt.pageSize)return qt;var We=Nt.current,Be=We===void 0?1:We,At=Nt.total,bt=Nt.pageSize,Je=bt===void 0?Uz:bt;return qt.lengthJe?qt.slice((Be-1)*Je,Be*Je):qt:qt.slice((Be-1)*Je,Be*Je)},[!!v,qt,Nt&&Nt.current,Nt&&Nt.pageSize,Nt&&Nt.total]),Ot=_ce(y,{prefixCls:pt,data:qt,pageData:ht,getRowKey:Dt,getRecordByKey:ut,expandType:It,childrenColumnName:mt,locale:Ve,getPopupContainer:N}),$t=Le(Ot,2),ur=$t[0],Ir=$t[1],qr=function(Be,At,bt){var Je;return typeof T=="function"?Je=Qe(T(Be,At,bt)):Je=Qe(T),Qe(se({},"".concat(pt,"-row-selected"),Ir.has(Dt(Be,At))),Je)};Ye.__PARENT_RENDER_ICON__=Ye.expandIcon,Ye.expandIcon=Ye.expandIcon||B||yne(Ve),It==="nest"&&Ye.expandIconColumnIndex===void 0?Ye.expandIconColumnIndex=y?1:0:Ye.expandIconColumnIndex>0&&y&&(Ye.expandIconColumnIndex-=1),typeof Ye.indentSize!="number"&&(Ye.indentSize=typeof te=="number"?te:15);var Gr=C.exports.useCallback(function(We){return Lt(ur(xr(Qt(We))))},[Qt,xr,ur]),me,K;if(v!==!1&&(Nt==null?void 0:Nt.total)){var q;Nt.size?q=Nt.size:q=De==="small"||De==="middle"?"small":void 0;var ce=function(Be){return S(Tte,{...Nt,className:Qe("".concat(pt,"-pagination ").concat(pt,"-pagination-").concat(Be),Nt.className),size:q})},ae=Ne==="rtl"?"left":"right",xe=Nt.position;if(xe!==null&&Array.isArray(xe)){var Ee=xe.find(function(We){return We.includes("top")}),be=xe.find(function(We){return We.includes("bottom")}),Ce=xe.every(function(We){return"".concat(We)==="none"});!Ee&&!be&&!Ce&&(K=ce(ae)),Ee&&(me=ce(Ee.toLowerCase().replace("top",""))),be&&(K=ce(be.toLowerCase().replace("bottom","")))}else K=ce(ae)}var Ae;typeof L=="boolean"?Ae={spinning:L}:ar(L)==="object"&&(Ae=tt({spinning:!0},L));var He=Qe("".concat(pt,"-wrapper"),se({},"".concat(pt,"-wrapper-rtl"),Ne==="rtl"),i);return S("div",{ref:t,className:He,style:a,children:Xe(LS,{spinning:!1,...Ae,children:[me,S(xd,{...ye,columns:oe,direction:Ne,expandable:Ye,prefixCls:pt,className:Qe((r={},se(r,"".concat(pt,"-middle"),De==="middle"),se(r,"".concat(pt,"-small"),De==="small"),se(r,"".concat(pt,"-bordered"),o),se(r,"".concat(pt,"-empty"),Ge.length===0),r)),data:ht,rowKey:Dt,rowClassName:qr,emptyText:J&&J.emptyText||(Ie||mS)("Table"),internalHooks:u0,internalRefs:Ct,transformColumns:Gr}),K]})})}var Oce=C.exports.forwardRef(Rce),Hl=Oce;Hl.SELECTION_COLUMN=vu;Hl.EXPAND_COLUMN=xd.EXPAND_COLUMN;Hl.SELECTION_ALL=Y4;Hl.SELECTION_INVERT=Q4;Hl.SELECTION_NONE=J4;Hl.Column=vne;Hl.ColumnGroup=gne;Hl.Summary=pz;const Ace=Hl;var Zz=C.exports.createContext(null),Xz=C.exports.createContext(null);function Nce(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function zce(e){var t=e||{},r=t.label,n=t.value,i=t.children,a=n||"value";return{_title:r?[r]:["title","label"],value:a,key:a,children:i||"children"}}function rC(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function Dce(e,t){var r=[];function n(i){i.forEach(function(a){var u=a[t.children];u&&(r.push(a[t.value]),n(u))})}return n(e),r}function $8(e){return e==null}var Lce={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Fce=function(t,r){var n=zA(),i=n.prefixCls,a=n.multiple,u=n.searchValue,o=n.toggleOpen,f=n.open,p=n.notFoundContent,v=C.exports.useContext(Xz),y=v.virtual,w=v.listHeight,k=v.listItemHeight,T=v.treeData,R=v.fieldNames,A=v.onSelect,I=v.dropdownMatchSelectWidth,O=v.treeExpandAction,N=C.exports.useContext(Zz),L=N.checkable,B=N.checkedKeys,j=N.halfCheckedKeys,G=N.treeExpandedKeys,H=N.treeDefaultExpandAll,te=N.treeDefaultExpandedKeys,Y=N.onTreeExpand,le=N.treeIcon,J=N.showTreeIcon,Z=N.switcherIcon,Q=N.treeLine,ge=N.treeNodeFilterProp,ne=N.loadData,de=N.treeLoadedKeys,oe=N.treeMotion,ye=N.onTreeLoad,Re=N.keyEntities,Te=C.exports.useRef(),ke=hv(function(){return T},[f,T],function(xt,Wt){return Wt[0]&&xt[1]!==Wt[1]}),ze=C.exports.useMemo(function(){return L?{checked:B,halfChecked:j}:null},[L,B,j]);C.exports.useEffect(function(){if(f&&!a&&B.length){var xt;(xt=Te.current)===null||xt===void 0||xt.scrollTo({key:B[0]})}},[f]);var Ie=String(u).toLowerCase(),Ne=function(Wt){return Ie?String(Wt[ge]).toLowerCase().includes(Ie):!1},De=C.exports.useState(te),Ve=Le(De,2),Ge=Ve[0],je=Ve[1],ct=C.exports.useState(null),pt=Le(ct,2),Tt=pt[0],Ye=pt[1],Pt=C.exports.useMemo(function(){return G?wt(G):u?Tt:Ge},[Ge,Tt,G,u]);C.exports.useEffect(function(){u&&Ye(Dce(T,R))},[u]);var mt=function(Wt){je(Wt),Ye(Wt),Y&&Y(Wt)},It=function(Wt){Wt.preventDefault()},Ct=function(Wt,jt){var Qt=jt.node;L&&rC(Qt)||(A(Qt.key,{selected:!B.includes(Qt.key)}),a||o(!1))},Dt=C.exports.useState(null),lt=Le(Dt,2),dt=lt[0],ut=lt[1],it=Re[dt];if(C.exports.useImperativeHandle(r,function(){var xt;return{scrollTo:(xt=Te.current)===null||xt===void 0?void 0:xt.scrollTo,onKeyDown:function(jt){var Qt,Fe=jt.which;switch(Fe){case Et.UP:case Et.DOWN:case Et.LEFT:case Et.RIGHT:(Qt=Te.current)===null||Qt===void 0||Qt.onKeyDown(jt);break;case Et.ENTER:{if(it){var qe=(it==null?void 0:it.node)||{},Xt=qe.selectable,cr=qe.value;Xt!==!1&&Ct(null,{node:{key:dt},selected:!B.includes(cr)})}break}case Et.ESC:o(!1)}},onKeyUp:function(){}}}),ke.length===0)return S("div",{role:"listbox",className:"".concat(i,"-empty"),onMouseDown:It,children:p});var ft={fieldNames:R};return de&&(ft.loadedKeys=de),Pt&&(ft.expandedKeys=Pt),Xe("div",{onMouseDown:It,children:[it&&f&&S("span",{style:Lce,"aria-live":"assertive",children:it.node.value}),S(Dx,{ref:Te,focusable:!1,prefixCls:"".concat(i,"-tree"),treeData:ke,height:w,itemHeight:k,virtual:y!==!1&&I!==!1,multiple:a,icon:le,showIcon:J,switcherIcon:Z,showLine:Q,loadData:u?null:ne,motion:oe,activeKey:dt,checkable:L,checkStrictly:!0,checkedKeys:ze,selectedKeys:L?[]:B,defaultExpandAll:H,...ft,onActiveChange:ut,onSelect:Ct,onCheck:Ct,onExpand:mt,onLoad:ye,filterTreeNode:Ne,expandAction:O})]})},Yz=C.exports.forwardRef(Fce);Yz.displayName="OptionList";var KS=function(){return null},Qz="SHOW_ALL",HS="SHOW_PARENT",Lx="SHOW_CHILD";function B8(e,t,r,n){var i=new Set(e);return t===Lx?e.filter(function(a){var u=r[a];return!(u&&u.children&&u.children.some(function(o){var f=o.node;return i.has(f[n.value])})&&u.children.every(function(o){var f=o.node;return rC(f)||i.has(f[n.value])}))}):t===HS?e.filter(function(a){var u=r[a],o=u?u.parent:null;return!(o&&!rC(o.node)&&i.has(o.key))}):e}var $ce=["children","value"];function Jz(e){return lo(e).map(function(t){if(!C.exports.isValidElement(t)||!t.type)return null;var r=t,n=r.key,i=r.props,a=i.children,u=i.value,o=Mr(i,$ce),f=ve({key:n,value:u},o),p=Jz(a);return p.length&&(f.children=p),f}).filter(function(t){return t})}function nC(e){if(!e)return e;var t=ve({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Bn(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function Bce(e,t,r,n,i,a){var u=null,o=null;function f(){function p(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return v.map(function(k,T){var R="".concat(y,"-").concat(T),A=k[a.value],I=r.includes(A),O=p(k[a.children]||[],R,I),N=S(KS,{...k,children:O.map(function(B){return B.node})});if(t===A&&(u=N),I){var L={pos:R,node:N,children:O};return w||o.push(L),L}return null}).filter(function(k){return k})}o||(o=[],p(n),o.sort(function(v,y){var w=v.node.props.value,k=y.node.props.value,T=r.indexOf(w),R=r.indexOf(k);return T-R}))}Object.defineProperty(e,"triggerNode",{get:function(){return Bn(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),f(),u}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Bn(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),f(),i?o:o.map(function(v){var y=v.node;return y})}})}function Vce(e,t){var r=t.id,n=t.pId,i=t.rootPId,a={},u=[],o=e.map(function(f){var p=ve({},f),v=p[r];return a[v]=p,p.key=p.key||v,p});return o.forEach(function(f){var p=f[n],v=a[p];v&&(v.children=v.children||[],v.children.push(f)),(p===i||!v&&i===null)&&u.push(f)}),u}function jce(e,t,r){return C.exports.useMemo(function(){return e?r?Vce(e,ve({id:"id",pId:"pId",rootPId:null},r!==!0?r:{})):e:Jz(t)},[t,r,e])}const Uce=function(e){var t=C.exports.useRef({valueLabels:new Map});return C.exports.useMemo(function(){var r=t.current.valueLabels,n=new Map,i=e.map(function(a){var u,o=a.value,f=(u=a.label)!==null&&u!==void 0?u:r.get(o);return n.set(o,f),ve(ve({},a),{},{label:f})});return t.current.valueLabels=n,[i]},[e])};function V8(e){var t=C.exports.useRef();t.current=e;var r=C.exports.useCallback(function(){return t.current.apply(t,arguments)},[]);return r}const Kce=function(e,t){return C.exports.useMemo(function(){var r=Ex(e,{fieldNames:t,initWrapper:function(i){return ve(ve({},i),{},{valueEntities:new Map})},processEntity:function(i,a){var u=i.node[t.value];a.valueEntities.set(u,i)}});return r},[e,t])},Hce=function(e,t,r,n){return C.exports.useMemo(function(){var i=e.map(function(f){var p=f.value;return p}),a=t.map(function(f){var p=f.value;return p}),u=i.filter(function(f){return!n[f]});if(r){var o=Pl(i,!0,n);i=o.checkedKeys,a=o.halfCheckedKeys}return[Array.from(new Set([].concat(wt(u),wt(i)))),a]},[e,t,r,n])},Wce=function(e,t,r){var n=r.treeNodeFilterProp,i=r.filterTreeNode,a=r.fieldNames,u=a.children;return C.exports.useMemo(function(){if(!t||i===!1)return e;var o;if(typeof i=="function")o=i;else{var f=t.toUpperCase();o=function(y,w){var k=w[n];return String(k).toUpperCase().includes(f)}}function p(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return v.map(function(w){var k=w[u],T=y||o(t,nC(w)),R=p(k||[],T);return T||R.length?ve(ve({},w),{},se({isLeaf:void 0},u,R)):null}).filter(function(w){return w})}return p(e)},[e,t,u,n,i])};var qce=["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 Gce(e){return!e||ar(e)!=="object"}var Zce=C.exports.forwardRef(function(e,t){var r=e.id,n=e.prefixCls,i=n===void 0?"rc-tree-select":n,a=e.value,u=e.defaultValue,o=e.onChange,f=e.onSelect,p=e.onDeselect,v=e.searchValue,y=e.inputValue,w=e.onSearch,k=e.autoClearSearchValue,T=k===void 0?!0:k,R=e.filterTreeNode,A=e.treeNodeFilterProp,I=A===void 0?"value":A,O=e.showCheckedStrategy,N=O===void 0?Lx:O,L=e.treeNodeLabelProp,B=e.multiple,j=e.treeCheckable,G=e.treeCheckStrictly,H=e.labelInValue,te=e.fieldNames,Y=e.treeDataSimpleMode,le=e.treeData,J=e.children,Z=e.loadData,Q=e.treeLoadedKeys,ge=e.onTreeLoad,ne=e.treeDefaultExpandAll,de=e.treeExpandedKeys,oe=e.treeDefaultExpandedKeys,ye=e.onTreeExpand,Re=e.treeExpandAction,Te=e.virtual,ke=e.listHeight,ze=ke===void 0?200:ke,Ie=e.listItemHeight,Ne=Ie===void 0?20:Ie,De=e.onDropdownVisibleChange,Ve=e.dropdownMatchSelectWidth,Ge=Ve===void 0?!0:Ve,je=e.treeLine,ct=e.treeIcon,pt=e.showTreeIcon,Tt=e.switcherIcon,Ye=e.treeMotion,Pt=Mr(e,qce),mt=oN(r),It=j&&!G,Ct=j||G,Dt=G||H,lt=Ct||B,dt=Yi(u,{value:a}),ut=Le(dt,2),it=ut[0],ft=ut[1],xt=C.exports.useMemo(function(){return zce(te)},[JSON.stringify(te)]),Wt=Yi("",{value:v!==void 0?v:y,postState:function(xe){return xe||""}}),jt=Le(Wt,2),Qt=jt[0],Fe=jt[1],qe=function(xe){Fe(xe),w==null||w(xe)},Xt=jce(le,J,Y),cr=Kce(Xt,xt),Vt=cr.keyEntities,Ut=cr.valueEntities,rr=C.exports.useCallback(function(ae){var xe=[],Ee=[];return ae.forEach(function(be){Ut.has(be)?Ee.push(be):xe.push(be)}),{missingRawValues:xe,existRawValues:Ee}},[Ut]),xr=Wce(Xt,Qt,{fieldNames:xt,treeNodeFilterProp:I,filterTreeNode:R}),Or=C.exports.useCallback(function(ae){if(ae){if(L)return ae[L];for(var xe=xt._title,Ee=0;Ee"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=j8[t.format]||j8.default;window.clipboardData.setData(y,e)}else v.clipboardData.clearData(),v.clipboardData.setData(t.format,e);t.onCopy&&(v.preventDefault(),t.onCopy(v.clipboardData))}),document.body.appendChild(o),a.selectNodeContents(o),u.addRange(a);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");f=!0}catch(v){r&&console.error("unable to copy using execCommand: ",v),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(y){r&&console.error("unable to copy using clipboardData: ",y),r&&console.error("falling back to prompt"),n=lde("message"in t?t.message:sde),window.prompt(n,e)}}finally{u&&(typeof u.removeRange=="function"?u.removeRange(a):u.removeAllRanges()),o&&document.body.removeChild(o),i()}return f}var cde=ude,dde={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 fde=dde;var nD=function(t,r){return S(dn,{...ve(ve({},t),{},{ref:r,icon:fde})})};nD.displayName="EnterOutlined";const hde=C.exports.forwardRef(nD);var pde=function(t){var r=t.prefixCls,n=t["aria-label"],i=t.className,a=t.style,u=t.direction,o=t.maxLength,f=t.autoSize,p=f===void 0?!0:f,v=t.value,y=t.onSave,w=t.onCancel,k=t.onEnd,T=t.component,R=t.enterIcon,A=R===void 0?S(hde,{}):R,I=C.exports.useRef(null),O=C.exports.useRef(!1),N=C.exports.useRef(),L=C.exports.useState(v),B=Le(L,2),j=B[0],G=B[1];C.exports.useEffect(function(){G(v)},[v]),C.exports.useEffect(function(){if(I.current&&I.current.resizableTextArea){var de=I.current.resizableTextArea.textArea;de.focus();var oe=de.value.length;de.setSelectionRange(oe,oe)}},[]);var H=function(oe){var ye=oe.target;G(ye.value.replace(/[\n\r]/g,""))},te=function(){O.current=!0},Y=function(){O.current=!1},le=function(oe){var ye=oe.keyCode;O.current||(N.current=ye)},J=function(){y(j.trim())},Z=function(oe){var ye=oe.keyCode,Re=oe.ctrlKey,Te=oe.altKey,ke=oe.metaKey,ze=oe.shiftKey;N.current===ye&&!O.current&&!Re&&!Te&&!ke&&!ze&&(ye===Et.ENTER?(J(),k==null||k()):ye===Et.ESC&&w())},Q=function(){J()},ge=T?"".concat(r,"-").concat(T):"",ne=Qe(r,"".concat(r,"-edit-content"),se({},"".concat(r,"-rtl"),u==="rtl"),i,ge);return Xe("div",{className:ne,style:a,children:[S(N9,{ref:I,maxLength:o,value:j,onChange:H,onKeyDown:le,onKeyUp:Z,onCompositionStart:te,onCompositionEnd:Y,onBlur:Q,"aria-label":n,rows:1,autoSize:p}),A!==null?Ni(A,{className:"".concat(r,"-edit-content-confirm")}):null]})};const mde=pde;function E2(e,t){return C.exports.useMemo(function(){var r=!!e;return[r,tt(tt({},t),r&&ar(e)==="object"?e:null)]},[e])}var vde=function(t,r){var n=C.exports.useRef(!1);C.exports.useEffect(function(){n.current?t():n.current=!0},r)};const gde=vde;var yde=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);it){var p=t-r;return n.push(String(a).slice(0,p)),n}n.push(a),r=f}return e}var bde=0,Oy=1,K8=2,k2=3,H8=4,wde=function(t){var r=t.enabledMeasure,n=t.children,i=t.text,a=t.width,u=t.fontSize,o=t.rows,f=t.onEllipsis,p=C.exports.useState([0,0,0]),v=Le(p,2),y=Le(v[0],3),w=y[0],k=y[1],T=y[2],R=v[1],A=C.exports.useState(bde),I=Le(A,2),O=I[0],N=I[1],L=C.exports.useState(0),B=Le(L,2),j=B[0],G=B[1],H=C.exports.useRef(null),te=C.exports.useRef(null),Y=C.exports.useMemo(function(){return lo(i)},[i]),le=C.exports.useMemo(function(){return _de(Y)},[Y]),J=C.exports.useMemo(function(){return!r||O!==k2?n(Y,!1):n(U8(Y,k),k1&&ot,ur=function(Je){var Rt;jt(!0),(Rt=Lt.onExpand)===null||Rt===void 0||Rt.call(Lt,Je)},Ir=C.exports.useState(0),qr=Le(Ir,2),Gr=qr[0],me=qr[1],K=C.exports.useState(0),q=Le(K,2),ce=q[0],ae=q[1],xe=function(Je,Rt){var Bt=Je.offsetWidth,vr;me(Bt),ae(parseInt((vr=window.getComputedStyle)===null||vr===void 0?void 0:vr.call(window,Rt).fontSize,10)||0)},Ee=function(Je){var Rt;Xt(Je),qe!==Je&&((Rt=Lt.onEllipsis)===null||Rt===void 0||Rt.call(Lt,Je))};C.exports.useEffect(function(){var bt=B.current;if(Er&&ot&&bt){var Je=$t?bt.offsetHeight"u"||!bt||!ot||!kr)){var Je=new IntersectionObserver(function(){qt(!!bt.offsetParent)});return Je.observe(bt),function(){Je.disconnect()}}},[ot,kr]);var be={};Lt.tooltip===!0?be={title:(r=J.text)!==null&&r!==void 0?r:v}:C.exports.isValidElement(Lt.tooltip)?be={title:Lt.tooltip}:ar(Lt.tooltip)==="object"?be=tt({title:(n=J.text)!==null&&n!==void 0?n:v},Lt.tooltip):be={title:Lt.tooltip};var Ce=C.exports.useMemo(function(){var bt=function(Rt){return["string","number"].includes(ar(Rt))};if(!(!Er||ot)){if(bt(J.text))return J.text;if(bt(v))return v;if(bt(R))return R;if(bt(be.title))return be.title}},[Er,ot,R,be.title,ht]);if(ge)return S(mde,{value:(i=J.text)!==null&&i!==void 0?i:typeof v=="string"?v:"",onSave:Te,onCancel:ke,onEnd:J.onEnd,prefixCls:G,className:u,style:o,direction:N,component:T,maxLength:J.maxLength,autoSize:J.autoSize,enterIcon:J.enterIcon});var Ae=function(){var Je=Lt.expandable,Rt=Lt.symbol;if(!Je)return null;var Bt;return Rt?Bt=Rt:Bt=L.expand,S("a",{className:"".concat(G,"-expand"),onClick:ur,"aria-label":L.expand,children:Bt},"expand")},He=function(){if(!!le){var Je=J.icon,Rt=J.tooltip,Bt=lo(Rt)[0]||L.edit,vr=typeof Bt=="string"?Bt:"";return oe.includes("icon")?S(yo,{title:Rt===!1?"":Bt,children:S(ZP,{ref:j,className:"".concat(G,"-edit"),onClick:Re,"aria-label":vr,children:Je||S(ide,{role:"button"})})},"edit"):null}},We=function(){if(!!Ne){var Je=De.tooltips,Rt=De.icon,Bt=W8(Je),vr=W8(Rt),ir=je?Ay(Bt[1],L.copied):Ay(Bt[0],L.copy),gr=je?L.copied:L.copy,Br=typeof ir=="string"?ir:gr;return S(yo,{title:ir,children:S(ZP,{className:Qe("".concat(G,"-copy"),je&&"".concat(G,"-copy-success")),onClick:Pt,"aria-label":Br,children:je?Ay(vr[1],S(vN,{}),!0):Ay(vr[0],S(tde,{}),!0)})},"copy")}},Be=function(Je){return[Je&&Ae(),He(),We()]},At=function(Je){return[Je&&S("span",{"aria-hidden":!0,children:Pde},"ellipsis"),Lt.suffix,Be(Je)]};return S(Ul,{onResize:xe,disabled:!kr||ot,children:function(bt){var Je;return S(Ede,{tooltipProps:be,enabledEllipsis:kr,isEllipsis:ht,children:S(iD,{className:Qe((Je={},se(Je,"".concat(G,"-").concat(f),f),se(Je,"".concat(G,"-disabled"),p),se(Je,"".concat(G,"-ellipsis"),Er),se(Je,"".concat(G,"-single-line"),kr&&fr===1),se(Je,"".concat(G,"-ellipsis-single-line"),Ot),se(Je,"".concat(G,"-ellipsis-multiple-line"),$t),Je),u),prefixCls:a,style:tt(tt({},o),{WebkitLineClamp:$t?fr:void 0}),component:T,ref:ta(bt,B,t),direction:N,onClick:oe.includes("text")?Re:void 0,"aria-label":Ce==null?void 0:Ce.toString(),title:R,...H,children:S(Cde,{enabledMeasure:kr&&!ot,text:v,rows:fr,width:Gr,fontSize:ce,onEllipsis:Ee,children:function(Rt,Bt){var vr=Rt;Rt.length&&Bt&&Ce&&(vr=S("span",{"aria-hidden":!0,children:vr},"show-content"));var ir=Tde(e,Xe(Ar,{children:[vr,At(Bt)]}));return ir}})})})}})});const Fx=Mde;var Ide=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-Ny*t:Math.round(e.h)+Ny*t:n=r?Math.round(e.h)+Ny*t:Math.round(e.h)-Ny*t,n<0?n+=360:n>=360&&(n-=360),n}function X8(e,t,r){if(e.h===0&&e.s===0)return e.s;var n;return r?n=e.s-q8*t:t===lD?n=e.s+q8:n=e.s+Hde*t,n>1&&(n=1),r&&t===sD&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Y8(e,t,r){var n;return r?n=e.v+Wde*t:n=e.v-qde*t,n>1&&(n=1),Number(n.toFixed(2))}function iC(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],n=ms(e),i=sD;i>0;i-=1){var a=G8(n),u=zy(ms({h:Z8(a,i,!0),s:X8(a,i,!0),v:Y8(a,i,!0)}));r.push(u)}r.push(zy(n));for(var o=1;o<=lD;o+=1){var f=G8(n),p=zy(ms({h:Z8(f,o),s:X8(f,o),v:Y8(f,o)}));r.push(p)}return t.theme==="dark"?Gde.map(function(v){var y=v.index,w=v.opacity,k=zy(Zde(ms(t.backgroundColor||"#141414"),ms(r[y]),w*100));return k}):r}var T2={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"},P2={},M2={};Object.keys(T2).forEach(function(e){P2[e]=iC(T2[e]),P2[e].primary=P2[e][5],M2[e]=iC(T2[e],{theme:"dark",backgroundColor:"#141414"}),M2[e].primary=M2[e][5]});function Xde(e,t){Bn(e,"[@ant-design/icons] ".concat(t))}function Q8(e){return ar(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(ar(e.icon)==="object"||typeof e.icon=="function")}function J8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,r){var n=e[r];switch(r){case"class":t.className=n,delete t.class;break;default:t[r]=n}return t},{})}function oC(e,t,r){return r?tn.createElement(e.tag,ve(ve({key:t},J8(e.attrs)),r),(e.children||[]).map(function(n,i){return oC(n,"".concat(t,"-").concat(e.tag,"-").concat(i))})):tn.createElement(e.tag,ve({key:t},J8(e.attrs)),(e.children||[]).map(function(n,i){return oC(n,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function uD(e){return iC(e)[0]}function cD(e){return e?Array.isArray(e)?e:[e]:[]}var Yde=` .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); } } `,Qde=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yde,r=C.exports.useContext(aD),n=r.csp,i=r.prefixCls,a=t;i&&(a=a.replace(/anticon/g,i)),C.exports.useEffect(function(){vv(a,"@ant-design-icons",{prepend:!0,csp:n})},[])},Jde=["icon","className","onClick","style","primaryColor","secondaryColor"],_m={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function efe(e){var t=e.primaryColor,r=e.secondaryColor;_m.primaryColor=t,_m.secondaryColor=r||uD(t),_m.calculated=!!r}function tfe(){return ve({},_m)}var $x=function(t){var r=t.icon,n=t.className,i=t.onClick,a=t.style,u=t.primaryColor,o=t.secondaryColor,f=Mr(t,Jde),p=_m;if(u&&(p={primaryColor:u,secondaryColor:o||uD(u)}),Qde(),Xde(Q8(r),"icon should be icon definiton, but got ".concat(r)),!Q8(r))return null;var v=r;return v&&typeof v.icon=="function"&&(v=ve(ve({},v),{},{icon:v.icon(p.primaryColor,p.secondaryColor)})),oC(v.icon,"svg-".concat(v.name),ve({className:n,onClick:i,style:a,"data-icon":v.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f))};$x.displayName="IconReact";$x.getTwoToneColors=tfe;$x.setTwoToneColors=efe;const qS=$x;function dD(e){var t=cD(e),r=Le(t,2),n=r[0],i=r[1];return qS.setTwoToneColors({primaryColor:n,secondaryColor:i})}function rfe(){var e=qS.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var nfe=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];dD("#1890ff");var Bx=C.exports.forwardRef(function(e,t){var r,n=e.className,i=e.icon,a=e.spin,u=e.rotate,o=e.tabIndex,f=e.onClick,p=e.twoToneColor,v=Mr(e,nfe),y=C.exports.useContext(aD),w=y.prefixCls,k=w===void 0?"anticon":w,T=y.rootClassName,R=Qe(T,k,(r={},se(r,"".concat(k,"-").concat(i.name),!!i.name),se(r,"".concat(k,"-spin"),!!a||i.name==="loading"),r),n),A=o;A===void 0&&f&&(A=-1);var I=u?{msTransform:"rotate(".concat(u,"deg)"),transform:"rotate(".concat(u,"deg)")}:void 0,O=cD(p),N=Le(O,2),L=N[0],B=N[1];return S("span",{...ve(ve({role:"img","aria-label":i.name},v),{},{ref:t,tabIndex:A,onClick:f,className:R}),children:S(qS,{icon:i,primaryColor:L,secondaryColor:B,style:I})})});Bx.displayName="AntdIcon";Bx.getTwoToneColor=rfe;Bx.setTwoToneColor=dD;const Wl=Bx;var fD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:Gte})})};fD.displayName="ArrowRightOutlined";const hD=C.exports.forwardRef(fD);var pD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:Ude})})};pD.displayName="DownloadOutlined";const ife=C.exports.forwardRef(pD);var ofe={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 afe=ofe;var mD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:afe})})};mD.displayName="FullscreenExitOutlined";const sfe=C.exports.forwardRef(mD);var lfe={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 ufe=lfe;var vD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:ufe})})};vD.displayName="FullscreenOutlined";const cfe=C.exports.forwardRef(vD);var dfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};const ffe=dfe;var gD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:ffe})})};gD.displayName="LockOutlined";const aC=C.exports.forwardRef(gD);var hfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"logout",theme:"outlined"};const pfe=hfe;var yD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:pfe})})};yD.displayName="LogoutOutlined";const mfe=C.exports.forwardRef(yD);var vfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"};const gfe=vfe;var xD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:gfe})})};xD.displayName="MailOutlined";const yfe=C.exports.forwardRef(xD);var _D=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:xN})})};_D.displayName="SearchOutlined";const xfe=C.exports.forwardRef(_D);var _fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"};const bfe=_fe;var bD=function(t,r){return S(Wl,{...ve(ve({},t),{},{ref:r,icon:bfe})})};bD.displayName="UserOutlined";const wD=C.exports.forwardRef(bD);function CD(e,t){return function(){return e.apply(t,arguments)}}const{toString:SD}=Object.prototype,{getPrototypeOf:GS}=Object,ZS=(e=>t=>{const r=SD.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ql=e=>(e=e.toLowerCase(),t=>ZS(t)===e),Vx=e=>t=>typeof t===e,{isArray:Sh}=Array,Xm=Vx("undefined");function wfe(e){return e!==null&&!Xm(e)&&e.constructor!==null&&!Xm(e.constructor)&&Gu(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ED=ql("ArrayBuffer");function Cfe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ED(e.buffer),t}const Sfe=Vx("string"),Gu=Vx("function"),kD=Vx("number"),XS=e=>e!==null&&typeof e=="object",Efe=e=>e===!0||e===!1,d0=e=>{if(ZS(e)!=="object")return!1;const t=GS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},kfe=ql("Date"),Tfe=ql("File"),Pfe=ql("Blob"),Mfe=ql("FileList"),Ife=e=>XS(e)&&Gu(e.pipe),Rfe=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||SD.call(e)===t||Gu(e.toString)&&e.toString()===t)},Ofe=ql("URLSearchParams"),Afe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Av(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Sh(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const PD=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),MD=e=>!Xm(e)&&e!==PD;function sC(){const{caseless:e}=MD(this)&&this||{},t={},r=(n,i)=>{const a=e&&TD(t,i)||i;d0(t[a])&&d0(n)?t[a]=sC(t[a],n):d0(n)?t[a]=sC({},n):Sh(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n(Av(t,(i,a)=>{r&&Gu(i)?e[a]=CD(i,r):e[a]=i},{allOwnKeys:n}),e),zfe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Dfe=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Lfe=(e,t,r,n)=>{let i,a,u;const o={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)u=i[a],(!n||n(u,e,t))&&!o[u]&&(t[u]=e[u],o[u]=!0);e=r!==!1&&GS(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Ffe=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},$fe=e=>{if(!e)return null;if(Sh(e))return e;let t=e.length;if(!kD(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Bfe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&GS(Uint8Array)),Vfe=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},jfe=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Ufe=ql("HTMLFormElement"),Kfe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),eM=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Hfe=ql("RegExp"),ID=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Av(r,(i,a)=>{t(i,a,e)!==!1&&(n[a]=i)}),Object.defineProperties(e,n)},Wfe=e=>{ID(e,(t,r)=>{if(Gu(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(!!Gu(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},qfe=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Sh(e)?n(e):n(String(e).split(t)),r},Gfe=()=>{},Zfe=(e,t)=>(e=+e,Number.isFinite(e)?e:t),I2="abcdefghijklmnopqrstuvwxyz",tM="0123456789",RD={DIGIT:tM,ALPHA:I2,ALPHA_DIGIT:I2+I2.toUpperCase()+tM},Xfe=(e=16,t=RD.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Yfe(e){return!!(e&&Gu(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Qfe=e=>{const t=new Array(10),r=(n,i)=>{if(XS(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=Sh(n)?[]:{};return Av(n,(u,o)=>{const f=r(u,i+1);!Xm(f)&&(a[o]=f)}),t[i]=void 0,a}}return n};return r(e,0)},Mt={isArray:Sh,isArrayBuffer:ED,isBuffer:wfe,isFormData:Rfe,isArrayBufferView:Cfe,isString:Sfe,isNumber:kD,isBoolean:Efe,isObject:XS,isPlainObject:d0,isUndefined:Xm,isDate:kfe,isFile:Tfe,isBlob:Pfe,isRegExp:Hfe,isFunction:Gu,isStream:Ife,isURLSearchParams:Ofe,isTypedArray:Bfe,isFileList:Mfe,forEach:Av,merge:sC,extend:Nfe,trim:Afe,stripBOM:zfe,inherits:Dfe,toFlatObject:Lfe,kindOf:ZS,kindOfTest:ql,endsWith:Ffe,toArray:$fe,forEachEntry:Vfe,matchAll:jfe,isHTMLForm:Ufe,hasOwnProperty:eM,hasOwnProp:eM,reduceDescriptors:ID,freezeMethods:Wfe,toObjectSet:qfe,toCamelCase:Kfe,noop:Gfe,toFiniteNumber:Zfe,findKey:TD,global:PD,isContextDefined:MD,ALPHABET:RD,generateString:Xfe,isSpecCompliantForm:Yfe,toJSONObject:Qfe};function mn(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Mt.inherits(mn,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:Mt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const OD=mn.prototype,AD={};["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=>{AD[e]={value:e}});Object.defineProperties(mn,AD);Object.defineProperty(OD,"isAxiosError",{value:!0});mn.from=(e,t,r,n,i,a)=>{const u=Object.create(OD);return Mt.toFlatObject(e,u,function(f){return f!==Error.prototype},o=>o!=="isAxiosError"),mn.call(u,e.message,t,r,n,i),u.cause=e,u.name=e.name,a&&Object.assign(u,a),u};const Jfe=null;function lC(e){return Mt.isPlainObject(e)||Mt.isArray(e)}function ND(e){return Mt.endsWith(e,"[]")?e.slice(0,-2):e}function rM(e,t,r){return e?e.concat(t).map(function(i,a){return i=ND(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function ehe(e){return Mt.isArray(e)&&!e.some(lC)}const the=Mt.toFlatObject(Mt,{},null,function(t){return/^is[A-Z]/.test(t)});function jx(e,t,r){if(!Mt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=Mt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(R,A){return!Mt.isUndefined(A[R])});const n=r.metaTokens,i=r.visitor||v,a=r.dots,u=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&Mt.isSpecCompliantForm(t);if(!Mt.isFunction(i))throw new TypeError("visitor must be a function");function p(T){if(T===null)return"";if(Mt.isDate(T))return T.toISOString();if(!f&&Mt.isBlob(T))throw new mn("Blob is not supported. Use a Buffer instead.");return Mt.isArrayBuffer(T)||Mt.isTypedArray(T)?f&&typeof Blob=="function"?new Blob([T]):Buffer.from(T):T}function v(T,R,A){let I=T;if(T&&!A&&typeof T=="object"){if(Mt.endsWith(R,"{}"))R=n?R:R.slice(0,-2),T=JSON.stringify(T);else if(Mt.isArray(T)&&ehe(T)||(Mt.isFileList(T)||Mt.endsWith(R,"[]"))&&(I=Mt.toArray(T)))return R=ND(R),I.forEach(function(N,L){!(Mt.isUndefined(N)||N===null)&&t.append(u===!0?rM([R],L,a):u===null?R:R+"[]",p(N))}),!1}return lC(T)?!0:(t.append(rM(A,R,a),p(T)),!1)}const y=[],w=Object.assign(the,{defaultVisitor:v,convertValue:p,isVisitable:lC});function k(T,R){if(!Mt.isUndefined(T)){if(y.indexOf(T)!==-1)throw Error("Circular reference detected in "+R.join("."));y.push(T),Mt.forEach(T,function(I,O){(!(Mt.isUndefined(I)||I===null)&&i.call(t,I,Mt.isString(O)?O.trim():O,R,w))===!0&&k(I,R?R.concat(O):[O])}),y.pop()}}if(!Mt.isObject(e))throw new TypeError("data must be an object");return k(e),t}function nM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function YS(e,t){this._pairs=[],e&&jx(e,this,t)}const zD=YS.prototype;zD.append=function(t,r){this._pairs.push([t,r])};zD.toString=function(t){const r=t?function(n){return t.call(this,n,nM)}:nM;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function rhe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function DD(e,t,r){if(!t)return e;const n=r&&r.encode||rhe,i=r&&r.serialize;let a;if(i?a=i(t,r):a=Mt.isURLSearchParams(t)?t.toString():new YS(t,r).toString(n),a){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class nhe{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Mt.forEach(this.handlers,function(n){n!==null&&t(n)})}}const iM=nhe,LD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ihe=typeof URLSearchParams<"u"?URLSearchParams:YS,ohe=typeof FormData<"u"?FormData:null,ahe=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),she=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),js={isBrowser:!0,classes:{URLSearchParams:ihe,FormData:ohe,Blob},isStandardBrowserEnv:ahe,isStandardBrowserWebWorkerEnv:she,protocols:["http","https","file","blob","url","data"]};function lhe(e,t){return jx(e,new js.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return js.isNode&&Mt.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function uhe(e){return Mt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function che(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return u=!u&&Mt.isArray(i)?i.length:u,f?(Mt.hasOwnProp(i,u)?i[u]=[i[u],n]:i[u]=n,!o):((!i[u]||!Mt.isObject(i[u]))&&(i[u]=[]),t(r,n,i[u],a)&&Mt.isArray(i[u])&&(i[u]=che(i[u])),!o)}if(Mt.isFormData(e)&&Mt.isFunction(e.entries)){const r={};return Mt.forEachEntry(e,(n,i)=>{t(uhe(n),i,r,0)}),r}return null}const dhe={"Content-Type":void 0};function fhe(e,t,r){if(Mt.isString(e))try{return(t||JSON.parse)(e),Mt.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Ux={transitional:LD,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Mt.isObject(t);if(a&&Mt.isHTMLForm(t)&&(t=new FormData(t)),Mt.isFormData(t))return i&&i?JSON.stringify(FD(t)):t;if(Mt.isArrayBuffer(t)||Mt.isBuffer(t)||Mt.isStream(t)||Mt.isFile(t)||Mt.isBlob(t))return t;if(Mt.isArrayBufferView(t))return t.buffer;if(Mt.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return lhe(t,this.formSerializer).toString();if((o=Mt.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return jx(o?{"files[]":t}:t,f&&new f,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),fhe(t)):t}],transformResponse:[function(t){const r=this.transitional||Ux.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(t&&Mt.isString(t)&&(n&&!this.responseType||i)){const u=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(u)throw o.name==="SyntaxError"?mn.from(o,mn.ERR_BAD_RESPONSE,this,null,this.response):o}}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, */*"}}};Mt.forEach(["delete","get","head"],function(t){Ux.headers[t]={}});Mt.forEach(["post","put","patch"],function(t){Ux.headers[t]=Mt.merge(dhe)});const QS=Ux,hhe=Mt.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"]),phe=e=>{const t={};let r,n,i;return e&&e.split(` `).forEach(function(u){i=u.indexOf(":"),r=u.substring(0,i).trim().toLowerCase(),n=u.substring(i+1).trim(),!(!r||t[r]&&hhe[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},oM=Symbol("internals");function Vp(e){return e&&String(e).trim().toLowerCase()}function f0(e){return e===!1||e==null?e:Mt.isArray(e)?e.map(f0):String(e)}function mhe(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}function vhe(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function R2(e,t,r,n,i){if(Mt.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!Mt.isString(t)){if(Mt.isString(n))return t.indexOf(n)!==-1;if(Mt.isRegExp(n))return n.test(t)}}function ghe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function yhe(e,t){const r=Mt.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,u){return this[n].call(this,t,i,a,u)},configurable:!0})})}class Kx{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(o,f,p){const v=Vp(f);if(!v)throw new Error("header name must be a non-empty string");const y=Mt.findKey(i,v);(!y||i[y]===void 0||p===!0||p===void 0&&i[y]!==!1)&&(i[y||f]=f0(o))}const u=(o,f)=>Mt.forEach(o,(p,v)=>a(p,v,f));return Mt.isPlainObject(t)||t instanceof this.constructor?u(t,r):Mt.isString(t)&&(t=t.trim())&&!vhe(t)?u(phe(t),r):t!=null&&a(r,t,n),this}get(t,r){if(t=Vp(t),t){const n=Mt.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return mhe(i);if(Mt.isFunction(r))return r.call(this,i,n);if(Mt.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Vp(t),t){const n=Mt.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||R2(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(u){if(u=Vp(u),u){const o=Mt.findKey(n,u);o&&(!r||R2(n,n[o],o,r))&&(delete n[o],i=!0)}}return Mt.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||R2(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return Mt.forEach(this,(i,a)=>{const u=Mt.findKey(n,a);if(u){r[u]=f0(i),delete r[a];return}const o=t?ghe(a):String(a).trim();o!==a&&delete r[a],r[o]=f0(i),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return Mt.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&Mt.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[oM]=this[oM]={accessors:{}}).accessors,i=this.prototype;function a(u){const o=Vp(u);n[o]||(yhe(i,u),n[o]=!0)}return Mt.isArray(t)?t.forEach(a):a(t),this}}Kx.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Mt.freezeMethods(Kx.prototype);Mt.freezeMethods(Kx);const Ml=Kx;function O2(e,t){const r=this||QS,n=t||r,i=Ml.from(n.headers);let a=n.data;return Mt.forEach(e,function(o){a=o.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function $D(e){return!!(e&&e.__CANCEL__)}function Nv(e,t,r){mn.call(this,e==null?"canceled":e,mn.ERR_CANCELED,t,r),this.name="CanceledError"}Mt.inherits(Nv,mn,{__CANCEL__:!0});function xhe(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new mn("Request failed with status code "+r.status,[mn.ERR_BAD_REQUEST,mn.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const _he=js.isStandardBrowserEnv?function(){return{write:function(r,n,i,a,u,o){const f=[];f.push(r+"="+encodeURIComponent(n)),Mt.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),Mt.isString(a)&&f.push("path="+a),Mt.isString(u)&&f.push("domain="+u),o===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function bhe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function whe(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function BD(e,t){return e&&!bhe(t)?whe(e,t):t}const Che=js.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(a){let u=a;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(u){const o=Mt.isString(u)?i(u):u;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function She(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ehe(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,u;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),v=n[a];u||(u=p),r[i]=f,n[i]=p;let y=a,w=0;for(;y!==i;)w+=r[y++],y=y%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),p-u{const a=i.loaded,u=i.lengthComputable?i.total:void 0,o=a-r,f=n(o),p=a<=u;r=a;const v={loaded:a,total:u,progress:u?a/u:void 0,bytes:o,rate:f||void 0,estimated:f&&u&&p?(u-a)/f:void 0,event:i};v[t?"download":"upload"]=!0,e(v)}}const khe=typeof XMLHttpRequest<"u",The=khe&&function(e){return new Promise(function(r,n){let i=e.data;const a=Ml.from(e.headers).normalize(),u=e.responseType;let o;function f(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}Mt.isFormData(i)&&(js.isStandardBrowserEnv||js.isStandardBrowserWebWorkerEnv)&&a.setContentType(!1);let p=new XMLHttpRequest;if(e.auth){const k=e.auth.username||"",T=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(k+":"+T))}const v=BD(e.baseURL,e.url);p.open(e.method.toUpperCase(),DD(v,e.params,e.paramsSerializer),!0),p.timeout=e.timeout;function y(){if(!p)return;const k=Ml.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),R={data:!u||u==="text"||u==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:k,config:e,request:p};xhe(function(I){r(I),f()},function(I){n(I),f()},R),p=null}if("onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(y)},p.onabort=function(){!p||(n(new mn("Request aborted",mn.ECONNABORTED,e,p)),p=null)},p.onerror=function(){n(new mn("Network Error",mn.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let T=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const R=e.transitional||LD;e.timeoutErrorMessage&&(T=e.timeoutErrorMessage),n(new mn(T,R.clarifyTimeoutError?mn.ETIMEDOUT:mn.ECONNABORTED,e,p)),p=null},js.isStandardBrowserEnv){const k=(e.withCredentials||Che(v))&&e.xsrfCookieName&&_he.read(e.xsrfCookieName);k&&a.set(e.xsrfHeaderName,k)}i===void 0&&a.setContentType(null),"setRequestHeader"in p&&Mt.forEach(a.toJSON(),function(T,R){p.setRequestHeader(R,T)}),Mt.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),u&&u!=="json"&&(p.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&p.addEventListener("progress",aM(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",aM(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=k=>{!p||(n(!k||k.type?new Nv(null,e,p):k),p.abort(),p=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const w=She(v);if(w&&js.protocols.indexOf(w)===-1){n(new mn("Unsupported protocol "+w+":",mn.ERR_BAD_REQUEST,e));return}p.send(i||null)})},h0={http:Jfe,xhr:The};Mt.forEach(h0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Phe={getAdapter:e=>{e=Mt.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;ie instanceof Ml?e.toJSON():e;function Xf(e,t){t=t||{};const r={};function n(p,v,y){return Mt.isPlainObject(p)&&Mt.isPlainObject(v)?Mt.merge.call({caseless:y},p,v):Mt.isPlainObject(v)?Mt.merge({},v):Mt.isArray(v)?v.slice():v}function i(p,v,y){if(Mt.isUndefined(v)){if(!Mt.isUndefined(p))return n(void 0,p,y)}else return n(p,v,y)}function a(p,v){if(!Mt.isUndefined(v))return n(void 0,v)}function u(p,v){if(Mt.isUndefined(v)){if(!Mt.isUndefined(p))return n(void 0,p)}else return n(void 0,v)}function o(p,v,y){if(y in t)return n(p,v);if(y in e)return n(void 0,p)}const f={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:o,headers:(p,v)=>i(lM(p),lM(v),!0)};return Mt.forEach(Object.keys(e).concat(Object.keys(t)),function(v){const y=f[v]||i,w=y(e[v],t[v],v);Mt.isUndefined(w)&&y!==o||(r[v]=w)}),r}const VD="1.3.3",JS={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{JS[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const uM={};JS.transitional=function(t,r,n){function i(a,u){return"[Axios v"+VD+"] Transitional option '"+a+"'"+u+(n?". "+n:"")}return(a,u,o)=>{if(t===!1)throw new mn(i(u," has been removed"+(r?" in "+r:"")),mn.ERR_DEPRECATED);return r&&!uM[u]&&(uM[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,u,o):!0}};function Mhe(e,t,r){if(typeof e!="object")throw new mn("options must be an object",mn.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],u=t[a];if(u){const o=e[a],f=o===void 0||u(o,a,e);if(f!==!0)throw new mn("option "+a+" must be "+f,mn.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new mn("Unknown option "+a,mn.ERR_BAD_OPTION)}}const uC={assertOptions:Mhe,validators:JS},fu=uC.validators;class v1{constructor(t){this.defaults=t,this.interceptors={request:new iM,response:new iM}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Xf(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&uC.assertOptions(n,{silentJSONParsing:fu.transitional(fu.boolean),forcedJSONParsing:fu.transitional(fu.boolean),clarifyTimeoutError:fu.transitional(fu.boolean)},!1),i!==void 0&&uC.assertOptions(i,{encode:fu.function,serialize:fu.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let u;u=a&&Mt.merge(a.common,a[r.method]),u&&Mt.forEach(["delete","get","head","post","put","patch","common"],T=>{delete a[T]}),r.headers=Ml.concat(u,a);const o=[];let f=!0;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(r)===!1||(f=f&&R.synchronous,o.unshift(R.fulfilled,R.rejected))});const p=[];this.interceptors.response.forEach(function(R){p.push(R.fulfilled,R.rejected)});let v,y=0,w;if(!f){const T=[sM.bind(this),void 0];for(T.unshift.apply(T,o),T.push.apply(T,p),w=T.length,v=Promise.resolve(r);y{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const u=new Promise(o=>{n.subscribe(o),a=o}).then(i);return u.cancel=function(){n.unsubscribe(a)},u},t(function(a,u,o){n.reason||(n.reason=new Nv(a,u,o),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new eE(function(i){t=i}),cancel:t}}}const Ihe=eE;function Rhe(e){return function(r){return e.apply(null,r)}}function Ohe(e){return Mt.isObject(e)&&e.isAxiosError===!0}const cC={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(cC).forEach(([e,t])=>{cC[t]=e});const Ahe=cC;function jD(e){const t=new p0(e),r=CD(p0.prototype.request,t);return Mt.extend(r,p0.prototype,t,{allOwnKeys:!0}),Mt.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return jD(Xf(e,i))},r}const ji=jD(QS);ji.Axios=p0;ji.CanceledError=Nv;ji.CancelToken=Ihe;ji.isCancel=$D;ji.VERSION=VD;ji.toFormData=jx;ji.AxiosError=mn;ji.Cancel=ji.CanceledError;ji.all=function(t){return Promise.all(t)};ji.spread=Rhe;ji.isAxiosError=Ohe;ji.mergeConfig=Xf;ji.AxiosHeaders=Ml;ji.formToJSON=e=>FD(Mt.isHTMLForm(e)?new FormData(e):e);ji.HttpStatusCode=Ahe;ji.default=ji;const Nhe=ji;class Eh{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(r=>r!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const Ym=typeof window>"u"||"Deno"in window;function za(){}function zhe(e,t){return typeof e=="function"?e(t):e}function dC(e){return typeof e=="number"&&e>=0&&e!==1/0}function UD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jp(e,t,r){return zv(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Dhe(e,t,r){return zv(e)?typeof t=="function"?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function xu(e,t,r){return zv(e)?[{...t,queryKey:e},r]:[e||{},t]}function cM(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:u,stale:o}=e;if(zv(u)){if(n){if(t.queryHash!==tE(u,t.options))return!1}else if(!g1(t.queryKey,u))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||typeof i<"u"&&i!==t.state.fetchStatus||a&&!a(t))}function dM(e,t){const{exact:r,fetching:n,predicate:i,mutationKey:a}=e;if(zv(a)){if(!t.options.mutationKey)return!1;if(r){if(Zc(t.options.mutationKey)!==Zc(a))return!1}else if(!g1(t.options.mutationKey,a))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||i&&!i(t))}function tE(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zc)(e)}function Zc(e){return JSON.stringify(e,(t,r)=>hC(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function g1(e,t){return KD(e,t)}function KD(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!KD(e[r],t[r])):!1}function HD(e,t){if(e===t)return e;const r=fM(e)&&fM(t);if(r||hC(e)&&hC(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),a=i.length,u=r?[]:{};let o=0;for(let f=0;f"u")return!0;const r=t.prototype;return!(!hM(r)||!r.hasOwnProperty("isPrototypeOf"))}function hM(e){return Object.prototype.toString.call(e)==="[object Object]"}function zv(e){return Array.isArray(e)}function WD(e){return new Promise(t=>{setTimeout(t,e)})}function pM(e){WD(0).then(e)}function Lhe(){if(typeof AbortController=="function")return new AbortController}function pC(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?HD(e,t):t}class Fhe extends Eh{constructor(){super(),this.setup=t=>{if(!Ym&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}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 r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setFocused(n):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 y1=new Fhe;class $he extends Eh{constructor(){super(),this.setup=t=>{if(!Ym&&window.addEventListener){const r=()=>t();return window.addEventListener("online",r,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",r)}}}}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 r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setOnline(n):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 x1=new $he;function Bhe(e){return Math.min(1e3*2**e,3e4)}function Hx(e){return(e!=null?e:"online")==="online"?x1.isOnline():!0}class qD{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function m0(e){return e instanceof qD}function GD(e){let t=!1,r=0,n=!1,i,a,u;const o=new Promise((A,I)=>{a=A,u=I}),f=A=>{n||(k(new qD(A)),e.abort==null||e.abort())},p=()=>{t=!0},v=()=>{t=!1},y=()=>!y1.isFocused()||e.networkMode!=="always"&&!x1.isOnline(),w=A=>{n||(n=!0,e.onSuccess==null||e.onSuccess(A),i==null||i(),a(A))},k=A=>{n||(n=!0,e.onError==null||e.onError(A),i==null||i(),u(A))},T=()=>new Promise(A=>{i=I=>{const O=n||!y();return O&&A(I),O},e.onPause==null||e.onPause()}).then(()=>{i=void 0,n||e.onContinue==null||e.onContinue()}),R=()=>{if(n)return;let A;try{A=e.fn()}catch(I){A=Promise.reject(I)}Promise.resolve(A).then(w).catch(I=>{var O,N;if(n)return;const L=(O=e.retry)!=null?O:3,B=(N=e.retryDelay)!=null?N:Bhe,j=typeof B=="function"?B(r,I):B,G=L===!0||typeof L=="number"&&r{if(y())return T()}).then(()=>{t?k(I):R()})})};return Hx(e.networkMode)?R():T().then(R),{promise:o,cancel:f,continue:()=>(i==null?void 0:i())?o:Promise.resolve(),cancelRetry:p,continueRetry:v}}const rE=console;function Vhe(){let e=[],t=0,r=v=>{v()},n=v=>{v()};const i=v=>{let y;t++;try{y=v()}finally{t--,t||o()}return y},a=v=>{t?e.push(v):pM(()=>{r(v)})},u=v=>(...y)=>{a(()=>{v(...y)})},o=()=>{const v=e;e=[],v.length&&pM(()=>{n(()=>{v.forEach(y=>{r(y)})})})};return{batch:i,batchCalls:u,schedule:a,setNotifyFunction:v=>{r=v},setBatchNotifyFunction:v=>{n=v}}}const pi=Vhe();class ZD{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dC(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:Ym?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class jhe extends ZD{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||rE,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||Uhe(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,r){const n=pC(this.state.data,t,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){this.dispatch({type:"setState",state:t,setStateOptions:r})}cancel(t){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(t),n?n.then(za).catch(za):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||!UD(this.state.dataUpdatedAt,t)}onFocus(){var t;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.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(r=>r!==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,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var a;return(a=this.retryer)==null||a.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(T=>T.options.queryFn);k&&this.setOptions(k.options)}Array.isArray(this.options.queryKey);const u=Lhe(),o={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},f=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>{if(u)return this.abortSignalConsumed=!0,u.signal}})};f(o);const p=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(o)):Promise.reject("Missing queryFn"),v={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:p};if(f(v),(n=this.options.behavior)==null||n.onFetch(v),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=v.fetchOptions)==null?void 0:i.meta)){var y;this.dispatch({type:"fetch",meta:(y=v.fetchOptions)==null?void 0:y.meta})}const w=k=>{if(m0(k)&&k.silent||this.dispatch({type:"error",error:k}),!m0(k)){var T,R;(T=(R=this.cache.config).onError)==null||T.call(R,k,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=GD({fn:v.fetchFn,abort:u==null?void 0:u.abort.bind(u),onSuccess:k=>{var T,R;if(typeof k>"u"){w(new Error("undefined"));return}this.setData(k),(T=(R=this.cache.config).onSuccess)==null||T.call(R,k,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:w,onFail:(k,T)=>{this.dispatch({type:"failed",failureCount:k,error:T})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const r=n=>{var i,a;switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Hx(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(a=t.dataUpdatedAt)!=null?a:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const u=t.error;return m0(u)&&u.revert&&this.revertState?{...this.revertState}:{...n,error:u,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pi.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function Uhe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n!=null?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class Khe extends Eh{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,r,n){var i;const a=r.queryKey,u=(i=r.queryHash)!=null?i:tE(a,r);let o=this.get(u);return o||(o=new jhe({cache:this,logger:t.getLogger(),queryKey:a,queryHash:u,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const r=this.queriesMap[t.queryHash];r&&(t.destroy(),this.queries=this.queries.filter(n=>n!==t),r===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){pi.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=xu(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>cM(n,i))}findAll(t,r){const[n]=xu(t,r);return Object.keys(n).length>0?this.queries.filter(i=>cM(n,i)):this.queries}notify(t){pi.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pi.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){pi.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Hhe extends ZD{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||rE,this.observers=[],this.state=t.state||XD(),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(r=>r!==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,r;return(t=(r=this.retryer)==null?void 0:r.continue())!=null?t:this.execute()}async execute(){const t=()=>{var N;return this.retryer=GD({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(L,B)=>{this.dispatch({type:"failed",failureCount:L,error:B})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(N=this.options.retry)!=null?N:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,a,u,o,f;if(!r){var p,v,y,w;this.dispatch({type:"loading",variables:this.options.variables}),await((p=(v=this.mutationCache.config).onMutate)==null?void 0:p.call(v,this.state.variables,this));const L=await((y=(w=this.options).onMutate)==null?void 0:y.call(w,this.state.variables));L!==this.state.context&&this.dispatch({type:"loading",context:L,variables:this.state.variables})}const N=await t();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,N,this.state.variables,this.state.context,this)),await((a=(u=this.options).onSuccess)==null?void 0:a.call(u,N,this.state.variables,this.state.context)),await((o=(f=this.options).onSettled)==null?void 0:o.call(f,N,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:N}),N}catch(N){try{var k,T,R,A,I,O;throw await((k=(T=this.mutationCache.config).onError)==null?void 0:k.call(T,N,this.state.variables,this.state.context,this)),await((R=(A=this.options).onError)==null?void 0:R.call(A,N,this.state.variables,this.state.context)),await((I=(O=this.options).onSettled)==null?void 0:I.call(O,void 0,N,this.state.variables,this.state.context)),N}finally{this.dispatch({type:"error",error:N})}}}dispatch(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Hx(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...n,...t.state}}};this.state=r(this.state),pi.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function XD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Whe extends Eh{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const i=new Hhe({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?t.getMutationDefaults(r.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(r=>r!==t),this.notify({type:"removed",mutation:t})}clear(){pi.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(r=>dM(t,r))}findAll(t){return this.mutations.filter(r=>dM(t,r))}notify(t){pi.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return pi.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(za)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function qhe(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,i,a,u;const o=(t=e.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,f=(n=e.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,p=f==null?void 0:f.pageParam,v=(f==null?void 0:f.direction)==="forward",y=(f==null?void 0:f.direction)==="backward",w=((a=e.state.data)==null?void 0:a.pages)||[],k=((u=e.state.data)==null?void 0:u.pageParams)||[];let T=k,R=!1;const A=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>{var G;if((G=e.signal)!=null&&G.aborted)R=!0;else{var H;(H=e.signal)==null||H.addEventListener("abort",()=>{R=!0})}return e.signal}})},I=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),O=(j,G,H,te)=>(T=te?[G,...T]:[...T,G],te?[H,...j]:[...j,H]),N=(j,G,H,te)=>{if(R)return Promise.reject("Cancelled");if(typeof H>"u"&&!G&&j.length)return Promise.resolve(j);const Y={queryKey:e.queryKey,pageParam:H,meta:e.options.meta};A(Y);const le=I(Y);return Promise.resolve(le).then(Z=>O(j,H,Z,te))};let L;if(!w.length)L=N([]);else if(v){const j=typeof p<"u",G=j?p:mM(e.options,w);L=N(w,j,G)}else if(y){const j=typeof p<"u",G=j?p:Ghe(e.options,w);L=N(w,j,G,!0)}else{T=[];const j=typeof e.options.getNextPageParam>"u";L=(o&&w[0]?o(w[0],0,w):!0)?N([],j,k[0]):Promise.resolve(O([],k[0],w[0]));for(let H=1;H{if(o&&w[H]?o(w[H],H,w):!0){const le=j?k[H]:mM(e.options,te);return N(te,j,le)}return Promise.resolve(O(te,k[H],w[H]))})}return L.then(j=>({pages:j,pageParams:T}))}}}}function mM(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function Ghe(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class Zhe{constructor(t={}){this.queryCache=t.queryCache||new Khe,this.mutationCache=t.mutationCache||new Whe,this.logger=t.logger||rE,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=y1.subscribe(()=>{y1.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=x1.subscribe(()=>{x1.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,r;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(t,r){const[n]=xu(t,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state.data}ensureQueryData(t,r,n){const i=Jp(t,r,n),a=this.getQueryData(i.queryKey);return a?Promise.resolve(a):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(t,r,n){const i=this.queryCache.find(t),a=i==null?void 0:i.state.data,u=zhe(r,a);if(typeof u>"u")return;const o=Jp(t),f=this.defaultQueryOptions(o);return this.queryCache.build(this,f).setData(u,{...n,manual:!0})}setQueriesData(t,r,n){return pi.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state}removeQueries(t,r){const[n]=xu(t,r),i=this.queryCache;pi.batch(()=>{i.findAll(n).forEach(a=>{i.remove(a)})})}resetQueries(t,r,n){const[i,a]=xu(t,r,n),u=this.queryCache,o={type:"active",...i};return pi.batch(()=>(u.findAll(i).forEach(f=>{f.reset()}),this.refetchQueries(o,a)))}cancelQueries(t,r,n){const[i,a={}]=xu(t,r,n);typeof a.revert>"u"&&(a.revert=!0);const u=pi.batch(()=>this.queryCache.findAll(i).map(o=>o.cancel(a)));return Promise.all(u).then(za).catch(za)}invalidateQueries(t,r,n){const[i,a]=xu(t,r,n);return pi.batch(()=>{var u,o;if(this.queryCache.findAll(i).forEach(p=>{p.invalidate()}),i.refetchType==="none")return Promise.resolve();const f={...i,type:(u=(o=i.refetchType)!=null?o:i.type)!=null?u:"active"};return this.refetchQueries(f,a)})}refetchQueries(t,r,n){const[i,a]=xu(t,r,n),u=pi.batch(()=>this.queryCache.findAll(i).filter(f=>!f.isDisabled()).map(f=>{var p;return f.fetch(void 0,{...a,cancelRefetch:(p=a==null?void 0:a.cancelRefetch)!=null?p:!0,meta:{refetchPage:i.refetchPage}})}));let o=Promise.all(u).then(za);return a!=null&&a.throwOnError||(o=o.catch(za)),o}fetchQuery(t,r,n){const i=Jp(t,r,n),a=this.defaultQueryOptions(i);typeof a.retry>"u"&&(a.retry=!1);const u=this.queryCache.build(this,a);return u.isStaleByTime(a.staleTime)?u.fetch(a):Promise.resolve(u.state.data)}prefetchQuery(t,r,n){return this.fetchQuery(t,r,n).then(za).catch(za)}fetchInfiniteQuery(t,r,n){const i=Jp(t,r,n);return i.behavior=qhe(),this.fetchQuery(i)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then(za).catch(za)}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,r){const n=this.queryDefaults.find(i=>Zc(t)===Zc(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>g1(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(i=>Zc(t)===Zc(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>g1(t,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const r={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=tE(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}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 Xhe extends Eh{constructor(t,r){super(),this.client=t,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),vM(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return mC(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mC(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),fC(n,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=n.queryKey),this.updateQuery();const a=this.hasListeners();a&&gM(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),a&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();a&&(this.currentQuery!==i||this.options.enabled!==n.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(t){const r=this.client.getQueryCache().build(this.client,t);return this.createResult(r,t)}getCurrentResult(){return this.currentResult}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),t[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...r}={}){return this.fetch({...r,meta:{refetchPage:t}})}fetchOptimistic(t){const r=this.client.defaultQueryOptions(t),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){var r;return this.executeFetch({...t,cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let r=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(za)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),Ym||this.currentResult.isStale||!dC(this.options.staleTime))return;const r=UD(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}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,!(Ym||this.options.enabled===!1||!dC(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||y1.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,r){const n=this.currentQuery,i=this.options,a=this.currentResult,u=this.currentResultState,o=this.currentResultOptions,f=t!==n,p=f?t.state:this.currentQueryInitialState,v=f?this.currentResult:this.previousQueryResult,{state:y}=t;let{dataUpdatedAt:w,error:k,errorUpdatedAt:T,fetchStatus:R,status:A}=y,I=!1,O=!1,N;if(r._optimisticResults){const H=this.hasListeners(),te=!H&&vM(t,r),Y=H&&gM(t,n,r,i);(te||Y)&&(R=Hx(t.options.networkMode)?"fetching":"paused",w||(A="loading")),r._optimisticResults==="isRestoring"&&(R="idle")}if(r.keepPreviousData&&!y.dataUpdatedAt&&v!=null&&v.isSuccess&&A!=="error")N=v.data,w=v.dataUpdatedAt,A=v.status,I=!0;else if(r.select&&typeof y.data<"u")if(a&&y.data===(u==null?void 0:u.data)&&r.select===this.selectFn)N=this.selectResult;else try{this.selectFn=r.select,N=r.select(y.data),N=pC(a==null?void 0:a.data,N,r),this.selectResult=N,this.selectError=null}catch(H){this.selectError=H}else N=y.data;if(typeof r.placeholderData<"u"&&typeof N>"u"&&A==="loading"){let H;if(a!=null&&a.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData))H=a.data;else if(H=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof H<"u")try{H=r.select(H),this.selectError=null}catch(te){this.selectError=te}typeof H<"u"&&(A="success",N=pC(a==null?void 0:a.data,H,r),O=!0)}this.selectError&&(k=this.selectError,N=this.selectResult,T=Date.now(),A="error");const L=R==="fetching",B=A==="loading",j=A==="error";return{status:A,fetchStatus:R,isLoading:B,isSuccess:A==="success",isError:j,isInitialLoading:B&&L,data:N,dataUpdatedAt:w,error:k,errorUpdatedAt:T,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>p.dataUpdateCount||y.errorUpdateCount>p.errorUpdateCount,isFetching:L,isRefetching:L&&!B,isLoadingError:j&&y.dataUpdatedAt===0,isPaused:R==="paused",isPlaceholderData:O,isPreviousData:I,isRefetchError:j&&y.dataUpdatedAt!==0,isStale:nE(t,r),refetch:this.refetch,remove:this.remove}}updateResult(t){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,fC(n,r))return;this.currentResult=n;const i={cache:!0},a=()=>{if(!r)return!0;const{notifyOnChangeProps:u}=this.options;if(u==="all"||!u&&!this.trackedProps.size)return!0;const o=new Set(u!=null?u:this.trackedProps);return this.options.useErrorBoundary&&o.add("error"),Object.keys(this.currentResult).some(f=>{const p=f;return this.currentResult[p]!==r[p]&&o.has(p)})};(t==null?void 0:t.listeners)!==!1&&a()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const r={};t.type==="success"?r.onSuccess=!t.manual:t.type==="error"&&!m0(t.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(t){pi.batch(()=>{if(t.onSuccess){var r,n,i,a;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(a=this.options).onSettled)==null||i.call(a,this.currentResult.data,null)}else if(t.onError){var u,o,f,p;(u=(o=this.options).onError)==null||u.call(o,this.currentResult.error),(f=(p=this.options).onSettled)==null||f.call(p,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(v=>{v(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function Yhe(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vM(e,t){return Yhe(e,t)||e.state.dataUpdatedAt>0&&mC(e,t,t.refetchOnMount)}function mC(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&nE(e,t)}return!1}function gM(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&nE(e,r)}function nE(e,t){return e.isStaleByTime(t.staleTime)}class Qhe extends Eh{constructor(t,r){super(),this.client=t,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.client.defaultMutationOptions(t),fC(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const r={listeners:!0};t.type==="success"?r.onSuccess=!0:t.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:XD(),r={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(t){pi.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var r,n,i,a;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(a=this.mutateOptions).onSettled)==null||i.call(a,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var u,o,f,p;(u=(o=this.mutateOptions).onError)==null||u.call(o,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(f=(p=this.mutateOptions).onSettled)==null||f.call(p,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(v=>{v(this.currentResult)})})}}const YD=q1.exports.useSyncExternalStore,yM=C.exports.createContext(void 0),QD=C.exports.createContext(!1);function JD(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=yM),window.ReactQueryClientContext):yM)}const Dv=({context:e}={})=>{const t=C.exports.useContext(JD(e,C.exports.useContext(QD)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Jhe=({client:e,children:t,context:r,contextSharing:n=!1})=>{C.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=JD(r,n);return S(QD.Provider,{value:!r&&n,children:S(i.Provider,{value:e,children:t})})},eL=C.exports.createContext(!1),epe=()=>C.exports.useContext(eL);eL.Provider;function tpe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const rpe=C.exports.createContext(tpe()),npe=()=>C.exports.useContext(rpe);function tL(e,t){return typeof e=="function"?e(...t):!!e}const ipe=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},ope=e=>{C.exports.useEffect(()=>{e.clearReset()},[e])},ape=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&tL(r,[e.error,n]),spe=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},lpe=(e,t)=>e.isLoading&&e.isFetching&&!t,upe=(e,t,r)=>(e==null?void 0:e.suspense)&&lpe(t,r),cpe=(e,t,r)=>t.fetchOptimistic(e).then(({data:n})=>{e.onSuccess==null||e.onSuccess(n),e.onSettled==null||e.onSettled(n,null)}).catch(n=>{r.clearReset(),e.onError==null||e.onError(n),e.onSettled==null||e.onSettled(void 0,n)});function dpe(e,t){const r=Dv({context:e.context}),n=epe(),i=npe(),a=r.defaultQueryOptions(e);a._optimisticResults=n?"isRestoring":"optimistic",a.onError&&(a.onError=pi.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=pi.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=pi.batchCalls(a.onSettled)),spe(a),ipe(a,i),ope(i);const[u]=C.exports.useState(()=>new t(r,a)),o=u.getOptimisticResult(a);if(YD(C.exports.useCallback(f=>n?()=>{}:u.subscribe(pi.batchCalls(f)),[u,n]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.exports.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),upe(a,o,n))throw cpe(a,u,i);if(ape({result:o,errorResetBoundary:i,useErrorBoundary:a.useErrorBoundary,query:u.getCurrentQuery()}))throw o.error;return a.notifyOnChangeProps?o:u.trackResult(o)}function Xa(e,t,r){const n=Jp(e,t,r);return dpe(n,Xhe)}function fpe(e,t,r){const n=Dhe(e,t,r),i=Dv({context:n.context}),[a]=C.exports.useState(()=>new Qhe(i,n));C.exports.useEffect(()=>{a.setOptions(n)},[a,n]);const u=YD(C.exports.useCallback(f=>a.subscribe(pi.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=C.exports.useCallback((f,p)=>{a.mutate(f,p).catch(hpe)},[a]);if(u.error&&tL(a.options.useErrorBoundary,[u.error]))throw u.error;return{...u,mutate:o,mutateAsync:u.mutate}}function hpe(){}const Tr={initial:"initial","initial-match":"initial-match-points","initial-unmatch":"initial-unmatch-points",approve:"approve-points",working:"working-points",filteredWorking:"filtered-working-points",cancelled:"cancelled-points",atd:"atd",pvz:"pvz",other:"other"},un={initial:"Pending",approve:"Installation",working:"Working",cancelled:"Cancelled"},Xc={[un.initial]:"\u041A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E",[un.approve]:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",[un.working]:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",[un.cancelled]:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D"},rL={kiosk:"\u0413\u043E\u0440\u043E\u0434\u0441\u043A\u043E\u0439 \u043A\u0438\u043E\u0441\u043A",mfc:"\u041C\u0424\u0426",library:"\u0411\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430",sport:"\u0421\u043F\u043E\u0440\u0442\u0438\u0432\u043D\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442",retail:"\u0420\u0438\u0442\u0435\u0439\u043B",residential:"\u041F\u043E\u0434\u044A\u0435\u0437\u0434 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dk:"\u0414\u043E\u043C \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B/\u041A\u043B\u0443\u0431"},ppe="\u0424\u0438\u043B\u044C\u0442\u0440 \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D - \u0431\u044B\u043B\u043E \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",$n={INITIAL:"INITIAL",APPROVE_WORKING:"APPROVE_WORKING",WORKING:"WORKING"},mpe={[$n.INITIAL]:[un.initial],[$n.APPROVE_WORKING]:[un.approve,un.working],[$n.WORKING]:[un.working]},vpe={[$n.INITIAL]:[Tr.initial,Tr.working,Tr.cancelled],[$n.APPROVE_WORKING]:[Tr.approve,Tr.working,Tr.cancelled],[$n.WORKING]:[Tr.filteredWorking]},xM=e=>{let t;const r=new Set,n=(f,p)=>{const v=typeof f=="function"?f(t):f;if(!Object.is(v,t)){const y=t;t=(p!=null?p:typeof v!="object")?v:Object.assign({},t,v),r.forEach(w=>w(t,y))}},i=()=>t,o={setState:n,getState:i,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{var f;((f={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:f.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."),r.clear()}};return t=e(n,i,o),o},gpe=e=>e?xM(e):xM;var nL={exports:{}},iL={};/** * @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 Wx=C.exports,ype=q1.exports;function xpe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _pe=typeof Object.is=="function"?Object.is:xpe,bpe=ype.useSyncExternalStore,wpe=Wx.useRef,Cpe=Wx.useEffect,Spe=Wx.useMemo,Epe=Wx.useDebugValue;iL.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=wpe(null);if(a.current===null){var u={hasValue:!1,value:null};a.current=u}else u=a.current;a=Spe(function(){function f(k){if(!p){if(p=!0,v=k,k=n(k),i!==void 0&&u.hasValue){var T=u.value;if(i(T,k))return y=T}return y=k}if(T=y,_pe(v,k))return T;var R=n(k);return i!==void 0&&i(T,R)?T:(v=k,y=R)}var p=!1,v,y,w=r===void 0?null:r;return[function(){return f(t())},w===null?void 0:function(){return f(w())}]},[t,r,n,i]);var o=bpe(e,a[0],a[1]);return Cpe(function(){u.hasValue=!0,u.value=o},[o]),Epe(o),o};(function(e){e.exports=iL})(nL);const kpe=LC(nL.exports),{useSyncExternalStoreWithSelector:Tpe}=kpe;function Ppe(e,t=e.getState,r){const n=Tpe(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return C.exports.useDebugValue(n),n}const _M=e=>{var t;((t={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 r=typeof e=="function"?gpe(e):e,n=(i,a)=>Ppe(r,i,a);return Object.assign(n,r),n},nc=e=>e?_M(e):_M;function Fa(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:iE(e)?2:oE(e)?3:0}function vC(e,t){return kh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Mpe(e,t){return kh(e)===2?e.get(t):e[t]}function oL(e,t,r){var n=kh(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ipe(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function iE(e){return Dpe&&e instanceof Map}function oE(e){return Lpe&&e instanceof Set}function Gi(e){return e.o||e.t}function aE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=$pe(e);delete t[Cn];for(var r=cE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=Rpe),Object.freeze(e),t&&Qf(e,function(r,n){return sE(n,!0)},!0)),e}function Rpe(){Fa(2)}function lE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function qs(e){var t=yC[e];return t||Fa(18,e),t}function Ope(e,t){yC[e]||(yC[e]=t)}function _1(){return Jm}function N2(e,t){t&&(qs("Patches"),e.u=[],e.s=[],e.v=t)}function b1(e){gC(e),e.p.forEach(Ape),e.p=null}function gC(e){e===Jm&&(Jm=e.l)}function bM(e){return Jm={p:[],l:Jm,h:e,m:!0,_:0}}function Ape(e){var t=e[Cn];t.i===0||t.i===1?t.j():t.O=!0}function z2(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.g||qs("ES5").S(t,e,n),n?(r[Cn].P&&(b1(t),Fa(4)),Ll(e)&&(e=w1(t,e),t.l||C1(t,e)),t.u&&qs("Patches").M(r[Cn].t,e,t.u,t.s)):e=w1(t,r,[]),b1(t),t.u&&t.v(t.u,t.s),e!==aL?e:void 0}function w1(e,t,r){if(lE(t))return t;var n=t[Cn];if(!n)return Qf(t,function(o,f){return wM(e,n,t,o,f,r)},!0),t;if(n.A!==e)return t;if(!n.P)return C1(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=aE(n.k):n.o,a=i,u=!1;n.i===3&&(a=new Set(i),i.clear(),u=!0),Qf(a,function(o,f){return wM(e,n,i,o,f,r,u)}),C1(e,i,!1),r&&e.u&&qs("Patches").N(n,r,e.u,e.s)}return n.o}function wM(e,t,r,n,i,a,u){if(Yf(i)){var o=w1(e,i,a&&t&&t.i!==3&&!vC(t.R,n)?a.concat(n):void 0);if(oL(r,n,o),!Yf(o))return;e.m=!1}else u&&r.add(i);if(Ll(i)&&!lE(i)){if(!e.h.D&&e._<1)return;w1(e,i),t&&t.A.l||C1(e,i)}}function C1(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&sE(t,r)}function D2(e,t){var r=e[Cn];return(r?Gi(r):e)[t]}function CM(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function bl(e){e.P||(e.P=!0,e.l&&bl(e.l))}function L2(e){e.o||(e.o=aE(e.t))}function Qm(e,t,r){var n=iE(t)?qs("MapSet").F(t,r):oE(t)?qs("MapSet").T(t,r):e.g?function(i,a){var u=Array.isArray(i),o={i:u?1:0,A:a?a.A:_1(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},f=o,p=xC;u&&(f=[o],p=em);var v=Proxy.revocable(f,p),y=v.revoke,w=v.proxy;return o.k=w,o.j=y,w}(t,r):qs("ES5").J(t,r);return(r?r.A:_1()).p.push(n),n}function Npe(e){return Yf(e)||Fa(22,e),function t(r){if(!Ll(r))return r;var n,i=r[Cn],a=kh(r);if(i){if(!i.P&&(i.i<4||!qs("ES5").K(i)))return i.t;i.I=!0,n=SM(r,a),i.I=!1}else n=SM(r,a);return Qf(n,function(u,o){i&&Mpe(i.t,u)===o||oL(n,u,t(o))}),a===3?new Set(n):n}(e)}function SM(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return aE(e)}function zpe(){function e(o,f){function p(){this.constructor=o}i(o,f),o.prototype=(p.prototype=f.prototype,new p)}function t(o){o.o||(o.R=new Map,o.o=new Map(o.t))}function r(o){o.o||(o.o=new Set,o.t.forEach(function(f){if(Ll(f)){var p=Qm(o.A.h,f,o);o.p.set(f,p),o.o.add(p)}else o.o.add(f)}))}function n(o){o.O&&Fa(3,JSON.stringify(Gi(o)))}var i=function(o,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var y in v)v.hasOwnProperty(y)&&(p[y]=v[y])})(o,f)},a=function(){function o(p,v){return this[Cn]={i:2,l:v,A:v?v.A:_1(),P:!1,I:!1,o:void 0,R:void 0,t:p,k:this,C:!1,O:!1},this}e(o,Map);var f=o.prototype;return Object.defineProperty(f,"size",{get:function(){return Gi(this[Cn]).size}}),f.has=function(p){return Gi(this[Cn]).has(p)},f.set=function(p,v){var y=this[Cn];return n(y),Gi(y).has(p)&&Gi(y).get(p)===v||(t(y),bl(y),y.R.set(p,!0),y.o.set(p,v),y.R.set(p,!0)),this},f.delete=function(p){if(!this.has(p))return!1;var v=this[Cn];return n(v),t(v),bl(v),v.t.has(p)?v.R.set(p,!1):v.R.delete(p),v.o.delete(p),!0},f.clear=function(){var p=this[Cn];n(p),Gi(p).size&&(t(p),bl(p),p.R=new Map,Qf(p.t,function(v){p.R.set(v,!1)}),p.o.clear())},f.forEach=function(p,v){var y=this;Gi(this[Cn]).forEach(function(w,k){p.call(v,y.get(k),k,y)})},f.get=function(p){var v=this[Cn];n(v);var y=Gi(v).get(p);if(v.I||!Ll(y)||y!==v.t.get(p))return y;var w=Qm(v.A.h,y,v);return t(v),v.o.set(p,w),w},f.keys=function(){return Gi(this[Cn]).keys()},f.values=function(){var p,v=this,y=this.keys();return(p={})[Dy]=function(){return v.values()},p.next=function(){var w=y.next();return w.done?w:{done:!1,value:v.get(w.value)}},p},f.entries=function(){var p,v=this,y=this.keys();return(p={})[Dy]=function(){return v.entries()},p.next=function(){var w=y.next();if(w.done)return w;var k=v.get(w.value);return{done:!1,value:[w.value,k]}},p},f[Dy]=function(){return this.entries()},o}(),u=function(){function o(p,v){return this[Cn]={i:3,l:v,A:v?v.A:_1(),P:!1,I:!1,o:void 0,t:p,k:this,p:new Map,O:!1,C:!1},this}e(o,Set);var f=o.prototype;return Object.defineProperty(f,"size",{get:function(){return Gi(this[Cn]).size}}),f.has=function(p){var v=this[Cn];return n(v),v.o?!!v.o.has(p)||!(!v.p.has(p)||!v.o.has(v.p.get(p))):v.t.has(p)},f.add=function(p){var v=this[Cn];return n(v),this.has(p)||(r(v),bl(v),v.o.add(p)),this},f.delete=function(p){if(!this.has(p))return!1;var v=this[Cn];return n(v),r(v),bl(v),v.o.delete(p)||!!v.p.has(p)&&v.o.delete(v.p.get(p))},f.clear=function(){var p=this[Cn];n(p),Gi(p).size&&(r(p),bl(p),p.o.clear())},f.values=function(){var p=this[Cn];return n(p),r(p),p.o.values()},f.entries=function(){var p=this[Cn];return n(p),r(p),p.o.entries()},f.keys=function(){return this.values()},f[Dy]=function(){return this.values()},f.forEach=function(p,v){for(var y=this.values(),w=y.next();!w.done;)p.call(v,w.value,w.value,this),w=y.next()},o}();Ope("MapSet",{F:function(o,f){return new a(o,f)},T:function(o,f){return new u(o,f)}})}var EM,Jm,uE=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Dpe=typeof Map<"u",Lpe=typeof Set<"u",kM=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",aL=uE?Symbol.for("immer-nothing"):((EM={})["immer-nothing"]=!0,EM),TM=uE?Symbol.for("immer-draftable"):"__$immer_draftable",Cn=uE?Symbol.for("immer-state"):"__$immer_state",Dy=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Fpe=""+Object.prototype.constructor,cE=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,$pe=Object.getOwnPropertyDescriptors||function(e){var t={};return cE(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},yC={},xC={get:function(e,t){if(t===Cn)return e;var r=Gi(e);if(!vC(r,t))return function(i,a,u){var o,f=CM(a,u);return f?"value"in f?f.value:(o=f.get)===null||o===void 0?void 0:o.call(i.k):void 0}(e,r,t);var n=r[t];return e.I||!Ll(n)?n:n===D2(e.t,t)?(L2(e),e.o[t]=Qm(e.A.h,n,e)):n},has:function(e,t){return t in Gi(e)},ownKeys:function(e){return Reflect.ownKeys(Gi(e))},set:function(e,t,r){var n=CM(Gi(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=D2(Gi(e),t),a=i==null?void 0:i[Cn];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Ipe(r,i)&&(r!==void 0||vC(e.t,t)))return!0;L2(e),bl(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return D2(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,L2(e),bl(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Gi(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){Fa(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Fa(12)}},em={};Qf(xC,function(e,t){em[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),em.deleteProperty=function(e,t){return em.set.call(this,e,t,void 0)},em.set=function(e,t,r){return xC.set.call(this,e[0],t,r,e[0])};var Bpe=function(){function e(r){var n=this;this.g=kM,this.D=!0,this.produce=function(i,a,u){if(typeof i=="function"&&typeof a!="function"){var o=a;a=i;var f=n;return function(R){var A=this;R===void 0&&(R=o);for(var I=arguments.length,O=Array(I>1?I-1:0),N=1;N1?v-1:0),w=1;w=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var u=qs("Patches").$;return Yf(r)?u(r,n):this.produce(r,function(o){return u(o,n)})},e}(),xa=new Bpe,Vpe=xa.produce;xa.produceWithPatches.bind(xa);xa.setAutoFreeze.bind(xa);xa.setUseProxies.bind(xa);xa.applyPatches.bind(xa);xa.createDraft.bind(xa);xa.finishDraft.bind(xa);const jpe=e=>(t,r,n)=>(n.setState=(i,a,...u)=>{const o=typeof i=="function"?Vpe(i):i;return t(o,a,...u)},e(n.setState,r,n)),ic=jpe,Fl={prediction:[0,0],categories:[],region:null,status:[un.initial],deltaTraffic:[-1e3,1e3],factTraffic:[0,0],age:[0,0]},Upe=e=>({filters:Fl,setPrediction:t=>{e(r=>{r.filters.prediction=t})},setDeltaTraffic:t=>{e(r=>{r.filters.deltaTraffic=t})},setFactTraffic:t=>{e(r=>{r.filters.factTraffic=t})},setAge:t=>{e(r=>{r.filters.age=t})},setCategories:t=>e(r=>{r.filters.categories=t}),setRegion:t=>e(r=>{r.filters.region=t}),setStatus:t=>e(r=>{r.filters.status=t})}),Ui=nc(ic(Upe)),Kpe={included:new Set([]),excluded:new Set([])},Hpe=e=>({selection:Kpe,include:t=>{e(r=>{const{excluded:n}=r.selection;n.has(t)?r.selection.excluded.delete(t):r.selection.included.add(t)})},exclude:t=>{e(r=>{const{included:n}=r.selection;n.has(t)?r.selection.included.delete(t):r.selection.excluded.add(t)})},reset:()=>e(t=>{t.selection.included.clear(),t.selection.excluded.clear()})}),Qs=nc(ic(Hpe)),Wpe=()=>{const{selection:e}=Qs();return C.exports.useMemo(()=>e.included.size||e.excluded.size,[e])},bm="https://postnet-dev.selftech.ru",_a=Nhe.create({baseURL:`${bm}/`,withCredentials:!0,xsrfHeaderName:"X-CSRFToken",xsrfCookieName:"csrftoken"}),sL=(e,t)=>{const r=e||new URLSearchParams;return t&&(t.type==="ao"&&r.append("ao[]",t.id),t.type==="rayon"&&r.append("rayon[]",t.id)),r},Lv=async(e,t)=>{const r=sL(e,t),{data:n}=await _a.get(`/api/placement_points?${r.toString()}`);return n},dE=async(e,t)=>{const r=sL(e,t),{data:n}=await _a.get(`/api/placement_points/to_excel?${r.toString()}`,{responseType:"arraybuffer"});return n},qpe=()=>Xa(["all-initial-count"],async()=>{const e=new URLSearchParams({page:1,page_size:1,"status[]":[un.initial]});return await Lv(e)},{select:e=>e.count}),Gpe=()=>{const{filters:e}=Ui(),{prediction:t,categories:r,region:n}=e,{selection:{included:i}}=Qs(),a=[...i];return Xa(["filtered-points",e,a],async()=>{const u=new URLSearchParams({page:1,page_size:1,"prediction_current[]":t,"status[]":[un.initial],"categories[]":r,"included[]":a});return await Lv(u,n)},{select:u=>u.count,keepPreviousData:!0})},lL=hh(!0),qx=hh(!1),fE=GU(qx,"setAuth",(e,t)=>{e.set(t)});async function Zpe(){try{await _a.get("/accounts/profile/"),fE(!0)}catch{console.log("Not authorized")}finally{lL.set(!1)}}Zpe();class uL extends Error{constructor(r){super("");b6(this,"errors");this.name="DjangoValidationError";const n=[];for(const i in r)n.push({name:i,errors:r[i]});this.errors=n}}const _C=hh(!1),bC=hh(""),Xpe="\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0439\u0442\u0438 \u0441 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u043C\u0438 \u0443\u0447\u0435\u0442\u043D\u044B\u043C\u0438 \u0434\u0430\u043D\u043D\u044B\u043C\u0438.";async function Ype(e){var r,n,i,a;_C.set(!0),bC.set("");try{const{data:u}=await _a.post("accounts/login/",e);return fE(!0),u}catch(u){var t=Xpe;throw(n=(r=u.response)==null?void 0:r.data)!=null&&n.detail&&(t=(a=(i=u.response)==null?void 0:i.data)==null?void 0:a.detail,bC.set(t)),new uL(u.response.data)}finally{_C.set(!1)}}const wC=hh(!1),cL=hh("");async function Qpe(e){var t;wC.set(!0);try{const{data:r}=await _a.post("accounts/register/",e);return r}catch(r){throw(t=r.response.data)!=null&&t.non_field_errors&&cL.set(r.response.data.non_field_errors.join(" ")),new uL(r.response.data)}finally{wC.set(!1)}}function Jpe(){const e=Hu(bC),t=Hu(_C),r=n=>{Ype(n)};return Xe(PS,{direction:"vertical",style:{width:"320px"},children:[e.length>0?S(px,{type:"error",showIcon:!0,closable:!0,description:e}):null,S(WS.Title,{level:4,children:"\u0412\u0445\u043E\u0434"}),Xe(hs,{disabled:t,name:"basic",layout:"vertical",onFinish:r,autoComplete:"off",children:[S(hs.Item,{label:"\u041B\u043E\u0433\u0438\u043D",name:"login",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:S(Iu,{prefix:S(wD,{className:"site-form-item-icon"}),placeholder:"\u043B\u043E\u0433\u0438\u043D"})}),S(hs.Item,{label:"\u041F\u0430\u0440\u043E\u043B\u044C",name:"password",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:S(Iu,{prefix:S(aC,{className:"site-form-item-icon"}),type:"password",placeholder:"\u043F\u0430\u0440\u043E\u043B\u044C"})}),S(hs.Item,{children:S(Rn,{block:!0,type:"primary",htmlType:"submit",children:"\u0412\u043E\u0439\u0442\u0438"})}),S("div",{style:{textAlign:"center"},children:S(Kw,{to:"/register",children:"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F"})})]})]})}function eme(){return Hu(qx)?S(W1,{to:"/",replace:!0}):S("main",{className:"w-screen h-screen flex items-center justify-center",children:S(Jpe,{})})}const tme=e=>{const t=C.exports.useRef(e),r=C.exports.useRef(),n=C.exports.useRef(!1),i=C.exports.useRef(!1),[,a]=C.exports.useState(0);n.current&&(i.current=!0),C.exports.useEffect(()=>(n.current||(r.current=t.current(),n.current=!0),a(u=>u+1),()=>{!i.current||r.current&&r.current()}),[])};function rme(){const[e]=HU(),[t,r]=C.exports.useState(!1);return tme(()=>{async function n(){try{await _a.post("accounts/verify-registration/",{user_id:e.get("user_id"),timestamp:e.get("timestamp"),signature:e.get("signature")})}finally{r(!0)}}n()}),t?S(W1,{to:"/"}):S("div",{children:"Verifying..."})}function nme(e){var t=typeof e;return t==="function"||t==="object"&&!!e}function ime(){const[e]=hs.useForm(),[t,r]=C.exports.useState(""),n=Hu(cL),i=Hu(wC),a=u=>{Qpe(u).then(()=>{r(`\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u043E\u0447\u0442\u0443 ${u.email} \u0434\u043B\u044F \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430.`)}).catch(o=>{nme(o.errors)&&e.setFields(o.errors)})};return t?S(dre,{title:t,status:"success",extra:S(Kw,{to:"/",children:"\u041D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E"})}):Xe(PS,{direction:"vertical",style:{width:"320px"},children:[n.length>0?S(px,{type:"error",showIcon:!0,closable:!0,description:n}):null,S(WS.Title,{level:4,children:"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F"}),Xe(hs,{form:e,disabled:i,name:"basic",layout:"vertical",onFinish:a,children:[S(hs.Item,{name:"username",label:"\u041B\u043E\u0433\u0438\u043D",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:S(Iu,{prefix:S(wD,{className:"site-form-item-icon"}),placeholder:""})}),S(hs.Item,{name:"email",label:"Email",rules:[{required:!0,type:"email",message:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 email"}],children:S(Iu,{type:"email",autoComplete:"email",prefix:S(yfe,{className:"site-form-item-icon"}),placeholder:""})}),S(hs.Item,{name:"password",label:"\u041F\u0430\u0440\u043E\u043B\u044C",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:S(Iu,{prefix:S(aC,{className:"site-form-item-icon"}),type:"password",autoComplete:"new-password",placeholder:""})}),S(hs.Item,{name:"password_confirm",label:"\u041F\u0430\u0440\u043E\u043B\u044C \u0435\u0449\u0435 \u0440\u0430\u0437",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"},({getFieldValue:u})=>({validator(o,f){return!f||u("password")===f?Promise.resolve():Promise.reject(new Error("\u041F\u0430\u0440\u043E\u043B\u0438 \u043D\u0435 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u044E\u0442"))}})],children:S(Iu,{autoComplete:"re-password",prefix:S(aC,{className:"site-form-item-icon"}),type:"password",placeholder:""})}),S(hs.Item,{children:S(Rn,{block:!0,type:"primary",htmlType:"submit",children:"\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F"})}),S("div",{style:{textAlign:"center"},children:S(Kw,{to:"/",children:"\u0423\u0436\u0435 \u0435\u0441\u0442\u044C \u0430\u043A\u043A\u0430\u0443\u043D\u0442"})})]})]})}function ome(){return Hu(qx)?S(W1,{to:"/",replace:!0}):S("main",{className:"h-screen w-screen flex items-center justify-center",children:S(ime,{})})}function ame(e){const t=Hu(qx);return Hu(lL)?S(LS,{className:"user-info-loader"}):t?S(Ar,{children:e.children}):S(W1,{to:"/signin",replace:!0})}var dL={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(Cl,function(){var r,n,i;function a(o,f){if(!r)r=f;else if(!n)n=f;else{var p="var sharedChunk = {}; ("+r+")(sharedChunk); ("+n+")(sharedChunk);",v={};r(v),i=f(v),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([p],{type:"text/javascript"})))}}a(["exports"],function(o){var f=p;function p(c,s,d,m){this.cx=3*c,this.bx=3*(d-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(m-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=s,this.p2x=d,this.p2y=m}function v(c,s,d,m){const _=new f(c,s,d,m);return function(E){return _.solve(E)}}p.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,s){if(s===void 0&&(s=1e-6),c<0)return 0;if(c>1)return 1;for(var d=c,m=0;m<8;m++){var _=this.sampleCurveX(d)-c;if(Math.abs(_)_?M=d:D=d,d=.5*(D-M)+M;return d},solve:function(c,s){return this.sampleCurveY(this.solveCurveX(c,s))}};const y=v(.25,.1,.25,1);function w(c,s,d){return Math.min(d,Math.max(s,c))}function k(c,s,d){const m=d-s,_=((c-s)%m+m)%m+s;return _===s?d:_}function T(c,...s){for(const d of s)for(const m in d)c[m]=d[m];return c}let R=1;function A(c,s){c.forEach(d=>{s[d]&&(s[d]=s[d].bind(s))})}function I(c,s,d){const m={};for(const _ in c)m[_]=s.call(d||this,c[_],_,c);return m}function O(c,s,d){const m={};for(const _ in c)s.call(d||this,c[_],_,c)&&(m[_]=c[_]);return m}function N(c){return Array.isArray(c)?c.map(N):typeof c=="object"&&c?I(c,N):c}const L={};function B(c){L[c]||(typeof console<"u"&&console.warn(c),L[c]=!0)}function j(c,s,d){return(d.y-c.y)*(s.x-c.x)>(s.y-c.y)*(d.x-c.x)}function G(c){let s=0;for(let d,m,_=0,E=c.length,M=E-1;_@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(d,m,_,E)=>{const M=_||E;return s[m]=!M||M.toLowerCase(),""}),s["max-age"]){const d=parseInt(s["max-age"],10);isNaN(d)?delete s["max-age"]:s["max-age"]=d}return s}let Y,le,J=null;function Z(c){if(J==null){const s=c.navigator?c.navigator.userAgent:null;J=!!c.safari||!(!s||!(/\b(iPad|iPhone|iPod)\b/.test(s)||s.match("Safari")&&!s.match("Chrome")))}return J}function Q(c){return typeof ImageBitmap<"u"&&c instanceof ImageBitmap}const ge={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(c){const s=requestAnimationFrame(c);return{cancel:()=>cancelAnimationFrame(s)}},getImageData(c,s=0){const d=window.document.createElement("canvas"),m=d.getContext("2d");if(!m)throw new Error("failed to create canvas 2d context");return d.width=c.width,d.height=c.height,m.drawImage(c,0,0,c.width,c.height),m.getImageData(-s,-s,c.width+2*s,c.height+2*s)},resolveURL:c=>(Y||(Y=document.createElement("a")),Y.href=c,Y.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(le==null&&(le=matchMedia("(prefers-reduced-motion: reduce)")),le.matches)}};var ne=de;function de(c,s){this.x=c,this.y=s}de.prototype={clone:function(){return new de(this.x,this.y)},add:function(c){return this.clone()._add(c)},sub:function(c){return this.clone()._sub(c)},multByPoint:function(c){return this.clone()._multByPoint(c)},divByPoint:function(c){return this.clone()._divByPoint(c)},mult:function(c){return this.clone()._mult(c)},div:function(c){return this.clone()._div(c)},rotate:function(c){return this.clone()._rotate(c)},rotateAround:function(c,s){return this.clone()._rotateAround(c,s)},matMult:function(c){return this.clone()._matMult(c)},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(c){return this.x===c.x&&this.y===c.y},dist:function(c){return Math.sqrt(this.distSqr(c))},distSqr:function(c){var s=c.x-this.x,d=c.y-this.y;return s*s+d*d},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(c){return Math.atan2(this.y-c.y,this.x-c.x)},angleWith:function(c){return this.angleWithSep(c.x,c.y)},angleWithSep:function(c,s){return Math.atan2(this.x*s-this.y*c,this.x*c+this.y*s)},_matMult:function(c){var s=c[2]*this.x+c[3]*this.y;return this.x=c[0]*this.x+c[1]*this.y,this.y=s,this},_add:function(c){return this.x+=c.x,this.y+=c.y,this},_sub:function(c){return this.x-=c.x,this.y-=c.y,this},_mult:function(c){return this.x*=c,this.y*=c,this},_div:function(c){return this.x/=c,this.y/=c,this},_multByPoint:function(c){return this.x*=c.x,this.y*=c.y,this},_divByPoint:function(c){return this.x/=c.x,this.y/=c.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var c=this.y;return this.y=this.x,this.x=-c,this},_rotate:function(c){var s=Math.cos(c),d=Math.sin(c),m=d*this.x+s*this.y;return this.x=s*this.x-d*this.y,this.y=m,this},_rotateAround:function(c,s){var d=Math.cos(c),m=Math.sin(c),_=s.y+m*(this.x-s.x)+d*(this.y-s.y);return this.x=s.x+d*(this.x-s.x)-m*(this.y-s.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},de.convert=function(c){return c instanceof de?c:Array.isArray(c)?new de(c[0],c[1]):c};const oe={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},ye="mapbox-tiles";let Re,Te,ke=500,ze=50;function Ie(){typeof caches>"u"||Re||(Re=caches.open(ye))}let Ne=1/0;const De={supported:!1,testSupport:function(c){!je&&Ge&&(ct?pt(c):Ve=c)}};let Ve,Ge,je=!1,ct=!1;function pt(c){const s=c.createTexture();c.bindTexture(c.TEXTURE_2D,s);try{if(c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,Ge),c.isContextLost())return;De.supported=!0}catch{}c.deleteTexture(s),je=!0}typeof document<"u"&&(Ge=document.createElement("img"),Ge.onload=function(){Ve&&pt(Ve),Ve=null,ct=!0},Ge.onerror=function(){je=!0,Ve=null},Ge.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Tt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Tt);class Ye extends Error{constructor(s,d,m,_){super(`AJAXError: ${d} (${s}): ${m}`),this.status=s,this.statusText=d,this.url=m,this.body=_}}const Pt=H()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function mt(c,s){const d=new AbortController,m=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,referrer:Pt(),signal:d.signal});let _=!1,E=!1;return c.type==="json"&&m.headers.set("Accept","application/json"),((M,D,F)=>{if(E)return;const U=Date.now();fetch(m).then(X=>X.ok?((re,ue,he)=>{(c.type==="arrayBuffer"?re.arrayBuffer():c.type==="json"?re.json():re.text()).then(pe=>{E||(ue&&he&&function(Oe,Me,Ze){if(Ie(),!Re)return;const st={status:Me.status,statusText:Me.statusText,headers:new Headers};Me.headers.forEach((nt,kt)=>st.headers.set(kt,nt));const Ke=te(Me.headers.get("Cache-Control")||"");Ke["no-store"]||(Ke["max-age"]&&st.headers.set("Expires",new Date(Ze+1e3*Ke["max-age"]).toUTCString()),new Date(st.headers.get("Expires")).getTime()-Ze<42e4||function(nt,kt){if(Te===void 0)try{new Response(new ReadableStream),Te=!0}catch{Te=!1}Te?kt(nt.body):nt.blob().then(kt)}(Me,nt=>{const kt=new Response(nt,st);Ie(),Re&&Re.then(St=>St.put(function(lr){const hr=lr.indexOf("?");return hr<0?lr:lr.slice(0,hr)}(Oe.url),kt)).catch(St=>B(St.message))}))}(m,ue,he),_=!0,s(null,pe,re.headers.get("Cache-Control"),re.headers.get("Expires")))}).catch(pe=>{E||s(new Error(pe.message))})})(X,null,U):X.blob().then(re=>s(new Ye(X.status,X.statusText,c.url,re)))).catch(X=>{X.code!==20&&s(new Error(X.message))})})(),{cancel:()=>{E=!0,_||d.abort()}}}const It=function(c,s){if(/:\/\//.test(c.url)&&!/^https?:|^file:/.test(c.url)){if(H()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s);if(!H()){const m=c.url.substring(0,c.url.indexOf("://"));return(oe.REGISTERED_PROTOCOLS[m]||mt)(c,s)}}if(!(/^file:/.test(d=c.url)||/^file:/.test(Pt())&&!/^\w+:/.test(d))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return mt(c,s);if(H()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s,void 0,!0)}var d;return function(m,_){const E=new XMLHttpRequest;E.open(m.method||"GET",m.url,!0),m.type==="arrayBuffer"&&(E.responseType="arraybuffer");for(const M in m.headers)E.setRequestHeader(M,m.headers[M]);return m.type==="json"&&(E.responseType="text",E.setRequestHeader("Accept","application/json")),E.withCredentials=m.credentials==="include",E.onerror=()=>{_(new Error(E.statusText))},E.onload=()=>{if((E.status>=200&&E.status<300||E.status===0)&&E.response!==null){let M=E.response;if(m.type==="json")try{M=JSON.parse(E.response)}catch(D){return _(D)}_(null,M,E.getResponseHeader("Cache-Control"),E.getResponseHeader("Expires"))}else{const M=new Blob([E.response],{type:E.getResponseHeader("Content-Type")});_(new Ye(E.status,E.statusText,m.url,M))}},E.send(m.body),{cancel:()=>E.abort()}}(c,s)},Ct=function(c,s){return It(T(c,{type:"arrayBuffer"}),s)};function Dt(c){const s=window.document.createElement("a");return s.href=c,s.protocol===window.document.location.protocol&&s.host===window.document.location.host}const lt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let dt,ut;dt=[],ut=0;const it=function(c,s){if(De.supported&&(c.headers||(c.headers={}),c.headers.accept="image/webp,*/*"),ut>=oe.MAX_PARALLEL_IMAGE_REQUESTS){const E={requestParameters:c,callback:s,cancelled:!1,cancel(){this.cancelled=!0}};return dt.push(E),E}ut++;let d=!1;const m=()=>{if(!d)for(d=!0,ut--;dt.length&&ut{m(),E?s(E):M&&function(U,X){typeof createImageBitmap=="function"?function(re,ue){const he=new Blob([new Uint8Array(re)],{type:"image/png"});createImageBitmap(he).then(pe=>{ue(null,pe)}).catch(pe=>{ue(new Error(`Could not load image because of ${pe.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(U,X):function(re,ue){const he=new Image;he.onload=()=>{ue(null,he),URL.revokeObjectURL(he.src),he.onload=null,window.requestAnimationFrame(()=>{he.src=lt})},he.onerror=()=>ue(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 pe=new Blob([new Uint8Array(re)],{type:"image/png"});he.src=re.byteLength?URL.createObjectURL(pe):lt}(U,X)}(M,(U,X)=>{U!=null?s(U):X!=null&&s(null,X,{cacheControl:D,expires:F})})});return{cancel:()=>{_.cancel(),m()}}};function ft(c,s,d){d[c]&&d[c].indexOf(s)!==-1||(d[c]=d[c]||[],d[c].push(s))}function xt(c,s,d){if(d&&d[c]){const m=d[c].indexOf(s);m!==-1&&d[c].splice(m,1)}}class Wt{constructor(s,d={}){T(this,d),this.type=s}}class jt extends Wt{constructor(s,d={}){super("error",T({error:s},d))}}class Qt{on(s,d){return this._listeners=this._listeners||{},ft(s,d,this._listeners),this}off(s,d){return xt(s,d,this._listeners),xt(s,d,this._oneTimeListeners),this}once(s,d){return this._oneTimeListeners=this._oneTimeListeners||{},ft(s,d,this._oneTimeListeners),this}fire(s,d){typeof s=="string"&&(s=new Wt(s,d||{}));const m=s.type;if(this.listens(m)){s.target=this;const _=this._listeners&&this._listeners[m]?this._listeners[m].slice():[];for(const D of _)D.call(this,s);const E=this._oneTimeListeners&&this._oneTimeListeners[m]?this._oneTimeListeners[m].slice():[];for(const D of E)xt(m,D,this._oneTimeListeners),D.call(this,s);const M=this._eventedParent;M&&(T(s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),M.fire(s))}else s instanceof jt&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,d){return this._eventedParent=s,this._eventedParentData=d,this}}var Fe={$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 qe{constructor(s,d,m,_){this.message=(s?`${s}: `:"")+m,_&&(this.identifier=_),d!=null&&d.__line__&&(this.line=d.__line__)}}function Xt(c){const s=c.value;return s?[new qe(c.key,s,"constants have been deprecated as of v8")]:[]}function cr(c,...s){for(const d of s)for(const m in d)c[m]=d[m];return c}function Vt(c){return c instanceof Number||c instanceof String||c instanceof Boolean?c.valueOf():c}function Ut(c){if(Array.isArray(c))return c.map(Ut);if(c instanceof Object&&!(c instanceof Number||c instanceof String||c instanceof Boolean)){const s={};for(const d in c)s[d]=Ut(c[d]);return s}return Vt(c)}class rr extends Error{constructor(s,d){super(d),this.message=d,this.key=s}}class xr{constructor(s,d=[]){this.parent=s,this.bindings={};for(const[m,_]of d)this.bindings[m]=_}concat(s){return new xr(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}const Or={kind:"null"},_t={kind:"number"},qt={kind:"string"},or={kind:"boolean"},$r={kind:"color"},Er={kind:"object"},Lt={kind:"value"},kr={kind:"collator"},wr={kind:"formatted"},fr={kind:"padding"},Nt={kind:"resolvedImage"};function ot(c,s){return{kind:"array",itemType:c,N:s}}function ht(c){if(c.kind==="array"){const s=ht(c.itemType);return typeof c.N=="number"?`array<${s}, ${c.N}>`:c.itemType.kind==="value"?"array":`array<${s}>`}return c.kind}const Ot=[Or,_t,qt,or,$r,wr,Er,ot(Lt),fr,Nt];function $t(c,s){if(s.kind==="error")return null;if(c.kind==="array"){if(s.kind==="array"&&(s.N===0&&s.itemType.kind==="value"||!$t(c.itemType,s.itemType))&&(typeof c.N!="number"||c.N===s.N))return null}else{if(c.kind===s.kind)return null;if(c.kind==="value"){for(const d of Ot)if(!$t(d,s))return null}}return`Expected ${ht(c)} but found ${ht(s)} instead.`}function ur(c,s){return s.some(d=>d.kind===c.kind)}function Ir(c,s){return s.some(d=>d==="null"?c===null:d==="array"?Array.isArray(c):d==="object"?c&&!Array.isArray(c)&&typeof c=="object":d===typeof c)}var qr,Gr={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 me(c){return(c=Math.round(c))<0?0:c>255?255:c}function K(c){return me(c[c.length-1]==="%"?parseFloat(c)/100*255:parseInt(c))}function q(c){return(s=c[c.length-1]==="%"?parseFloat(c)/100:parseFloat(c))<0?0:s>1?1:s;var s}function ce(c,s,d){return d<0?d+=1:d>1&&(d-=1),6*d<1?c+(s-c)*d*6:2*d<1?s:3*d<2?c+(s-c)*(2/3-d)*6:c}try{qr={}.parseCSSColor=function(c){var s,d=c.replace(/ /g,"").toLowerCase();if(d in Gr)return Gr[d].slice();if(d[0]==="#")return d.length===4?(s=parseInt(d.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:d.length===7&&(s=parseInt(d.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var m=d.indexOf("("),_=d.indexOf(")");if(m!==-1&&_+1===d.length){var E=d.substr(0,m),M=d.substr(m+1,_-(m+1)).split(","),D=1;switch(E){case"rgba":if(M.length!==4)return null;D=q(M.pop());case"rgb":return M.length!==3?null:[K(M[0]),K(M[1]),K(M[2]),D];case"hsla":if(M.length!==4)return null;D=q(M.pop());case"hsl":if(M.length!==3)return null;var F=(parseFloat(M[0])%360+360)%360/360,U=q(M[1]),X=q(M[2]),re=X<=.5?X*(U+1):X+U-X*U,ue=2*X-re;return[me(255*ce(ue,re,F+1/3)),me(255*ce(ue,re,F)),me(255*ce(ue,re,F-1/3)),D];default:return null}}return null}}catch{}class ae{constructor(s,d,m,_=1){this.r=s,this.g=d,this.b=m,this.a=_}static parse(s){if(!s)return;if(s instanceof ae)return s;if(typeof s!="string")return;const d=qr(s);return d?new ae(d[0]/255*d[3],d[1]/255*d[3],d[2]/255*d[3],d[3]):void 0}toString(){const[s,d,m,_]=this.toArray();return`rgba(${Math.round(s)},${Math.round(d)},${Math.round(m)},${_})`}toArray(){const{r:s,g:d,b:m,a:_}=this;return _===0?[0,0,0,0]:[255*s/_,255*d/_,255*m/_,_]}}ae.black=new ae(0,0,0,1),ae.white=new ae(1,1,1,1),ae.transparent=new ae(0,0,0,0),ae.red=new ae(1,0,0,1);class xe{constructor(s,d,m){this.sensitivity=s?d?"variant":"case":d?"accent":"base",this.locale=m,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,d){return this.collator.compare(s,d)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ee{constructor(s,d,m,_,E){this.text=s,this.image=d,this.scale=m,this.fontStack=_,this.textColor=E}}class be{constructor(s){this.sections=s}static fromString(s){return new be([new Ee(s,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(s=>s.text.length!==0||s.image&&s.image.name.length!==0)}static factory(s){return s instanceof be?s:be.fromString(s)}toString(){return this.sections.length===0?"":this.sections.map(s=>s.text).join("")}}class Ce{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof Ce)return s;if(typeof s=="number")return new Ce([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const d of s)if(typeof d!="number")return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new Ce(s)}}toString(){return JSON.stringify(this.values)}}class Ae{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new Ae({name:s,available:!1}):null}}function He(c,s,d,m){return typeof c=="number"&&c>=0&&c<=255&&typeof s=="number"&&s>=0&&s<=255&&typeof d=="number"&&d>=0&&d<=255?m===void 0||typeof m=="number"&&m>=0&&m<=1?null:`Invalid rgba value [${[c,s,d,m].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof m=="number"?[c,s,d,m]:[c,s,d]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function We(c){if(c===null||typeof c=="string"||typeof c=="boolean"||typeof c=="number"||c instanceof ae||c instanceof xe||c instanceof be||c instanceof Ce||c instanceof Ae)return!0;if(Array.isArray(c)){for(const s of c)if(!We(s))return!1;return!0}if(typeof c=="object"){for(const s in c)if(!We(c[s]))return!1;return!0}return!1}function Be(c){if(c===null)return Or;if(typeof c=="string")return qt;if(typeof c=="boolean")return or;if(typeof c=="number")return _t;if(c instanceof ae)return $r;if(c instanceof xe)return kr;if(c instanceof be)return wr;if(c instanceof Ce)return fr;if(c instanceof Ae)return Nt;if(Array.isArray(c)){const s=c.length;let d;for(const m of c){const _=Be(m);if(d){if(d===_)continue;d=Lt;break}d=_}return ot(d||Lt,s)}return Er}function At(c){const s=typeof c;return c===null?"":s==="string"||s==="number"||s==="boolean"?String(c):c instanceof ae||c instanceof be||c instanceof Ce||c instanceof Ae?c.toString():JSON.stringify(c)}class bt{constructor(s,d){this.type=s,this.value=d}static parse(s,d){if(s.length!==2)return d.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!We(s[1]))return d.error("invalid value");const m=s[1];let _=Be(m);const E=d.expectedType;return _.kind!=="array"||_.N!==0||!E||E.kind!=="array"||typeof E.N=="number"&&E.N!==0||(_=E),new bt(_,m)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Je{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const Rt={string:qt,number:_t,boolean:or,object:Er};class Bt{constructor(s,d){this.type=s,this.args=d}static parse(s,d){if(s.length<2)return d.error("Expected at least one argument.");let m,_=1;const E=s[0];if(E==="array"){let D,F;if(s.length>2){const U=s[1];if(typeof U!="string"||!(U in Rt)||U==="object")return d.error('The item type argument of "array" must be one of string, number, boolean',1);D=Rt[U],_++}else D=Lt;if(s.length>3){if(s[2]!==null&&(typeof s[2]!="number"||s[2]<0||s[2]!==Math.floor(s[2])))return d.error('The length argument to "array" must be a positive integer literal',2);F=s[2],_++}m=ot(D,F)}else{if(!Rt[E])throw new Error(`Types doesn't contain name = ${E}`);m=Rt[E]}const M=[];for(;_s.outputDefined())}}const vr={"to-boolean":or,"to-color":$r,"to-number":_t,"to-string":qt};class ir{constructor(s,d){this.type=s,this.args=d}static parse(s,d){if(s.length<2)return d.error("Expected at least one argument.");const m=s[0];if(!vr[m])throw new Error(`Can't parse ${m} as it is not part of the known types`);if((m==="to-boolean"||m==="to-string")&&s.length!==2)return d.error("Expected one argument.");const _=vr[m],E=[];for(let M=1;M4?`Invalid rbga value ${JSON.stringify(d)}: expected an array containing either three or four numeric values.`:He(d[0],d[1],d[2],d[3]),!m))return new ae(d[0]/255,d[1]/255,d[2]/255,d[3])}throw new Je(m||`Could not parse color from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}if(this.type.kind==="padding"){let d;for(const m of this.args){d=m.evaluate(s);const _=Ce.parse(d);if(_)return _}throw new Je(`Could not parse padding from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}if(this.type.kind==="number"){let d=null;for(const m of this.args){if(d=m.evaluate(s),d===null)return 0;const _=Number(d);if(!isNaN(_))return _}throw new Je(`Could not convert ${JSON.stringify(d)} to number.`)}return this.type.kind==="formatted"?be.fromString(At(this.args[0].evaluate(s))):this.type.kind==="resolvedImage"?Ae.fromString(At(this.args[0].evaluate(s))):At(this.args[0].evaluate(s))}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const gr=["Unknown","Point","LineString","Polygon"];class Br{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"?gr[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(s){let d=this._parseColorCache[s];return d||(d=this._parseColorCache[s]=ae.parse(s)),d}}class Jr{constructor(s,d,m,_){this.name=s,this.type=d,this._evaluate=m,this.args=_}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,d){const m=s[0],_=Jr.definitions[m];if(!_)return d.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0);const E=Array.isArray(_)?_[0]:_.type,M=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,D=M.filter(([U])=>!Array.isArray(U)||U.length===s.length-1);let F=null;for(const[U,X]of D){F=new Es(d.registry,d.path,null,d.scope);const re=[];let ue=!1;for(let he=1;he{return ue=re,Array.isArray(ue)?`(${ue.map(ht).join(", ")})`:`(${ht(ue.type)}...)`;var ue}).join(" | "),X=[];for(let re=1;re=s[2]||c[1]<=s[1]||c[3]>=s[3])}function Cr(c,s){const d=(180+c[0])/360,m=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360)))/360,_=Math.pow(2,s.z);return[Math.round(d*_*an),Math.round(m*_*an)]}function Rr(c,s,d){const m=c[0]-s[0],_=c[1]-s[1],E=c[0]-d[0],M=c[1]-d[1];return m*M-E*_==0&&m*E<=0&&_*M<=0}function ei(c,s){let d=!1;for(let M=0,D=s.length;M(m=c)[1]!=(E=F[U+1])[1]>m[1]&&m[0]<(E[0]-_[0])*(m[1]-_[1])/(E[1]-_[1])+_[0]&&(d=!d)}}var m,_,E;return d}function yn(c,s){for(let d=0;d0&&D<0||M<0&&D>0}function Lr(c,s,d){for(const U of d)for(let X=0;Xd[2]){const _=.5*m;let E=c[0]-d[0]>_?-m:d[0]-c[0]>_?m:0;E===0&&(E=c[0]-d[2]>_?-m:d[2]-c[0]>_?m:0),c[0]+=E}On(s,c)}function Gl(c,s,d,m){const _=Math.pow(2,m.z)*an,E=[m.x*an,m.y*an],M=[];for(const D of c)for(const F of D){const U=[F.x+E[0],F.y+E[1]];bo(U,s,d,_),M.push(U)}return M}function Td(c,s,d,m){const _=Math.pow(2,m.z)*an,E=[m.x*an,m.y*an],M=[];for(const F of c){const U=[];for(const X of F){const re=[X.x+E[0],X.y+E[1]];On(s,re),U.push(re)}M.push(U)}if(s[2]-s[0]<=_/2){(D=s)[0]=D[1]=1/0,D[2]=D[3]=-1/0;for(const F of M)for(const U of F)bo(U,s,d,_)}var D;return M}class Qa{constructor(s,d){this.type=or,this.geojson=s,this.geometries=d}static parse(s,d){if(s.length!==2)return d.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(We(s[1])){const m=s[1];if(m.type==="FeatureCollection")for(let _=0;_{s&&!Fr(d)&&(s=!1)}),s}function Zr(c){if(c instanceof Jr&&c.name==="feature-state")return!1;let s=!0;return c.eachChild(d=>{s&&!Zr(d)&&(s=!1)}),s}function An(c,s){if(c instanceof Jr&&s.indexOf(c.name)>=0)return!1;let d=!0;return c.eachChild(m=>{d&&!An(m,s)&&(d=!1)}),d}class Di{constructor(s,d){this.type=d.type,this.name=s,this.boundExpression=d}static parse(s,d){if(s.length!==2||typeof s[1]!="string")return d.error("'var' expression requires exactly one string literal argument.");const m=s[1];return d.scope.has(m)?new Di(m,d.scope.get(m)):d.error(`Unknown variable "${m}". Make sure "${m}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Es{constructor(s,d=[],m,_=new xr,E=[]){this.registry=s,this.path=d,this.key=d.map(M=>`[${M}]`).join(""),this.scope=_,this.errors=E,this.expectedType=m}parse(s,d,m,_,E={}){return d?this.concat(d,m,_)._parse(s,E):this._parse(s,E)}_parse(s,d){function m(_,E,M){return M==="assert"?new Bt(E,[_]):M==="coerce"?new ir(E,[_]):_}if(s!==null&&typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"||(s=["literal",s]),Array.isArray(s)){if(s.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=s[0];if(typeof _!="string")return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const E=this.registry[_];if(E){let M=E.parse(s,this);if(!M)return null;if(this.expectedType){const D=this.expectedType,F=M.type;if(D.kind!=="string"&&D.kind!=="number"&&D.kind!=="boolean"&&D.kind!=="object"&&D.kind!=="array"||F.kind!=="value")if(D.kind!=="color"&&D.kind!=="formatted"&&D.kind!=="resolvedImage"||F.kind!=="value"&&F.kind!=="string")if(D.kind!=="padding"||F.kind!=="value"&&F.kind!=="number"&&F.kind!=="array"){if(this.checkSubtype(D,F))return null}else M=m(M,D,d.typeAnnotation||"coerce");else M=m(M,D,d.typeAnnotation||"coerce");else M=m(M,D,d.typeAnnotation||"assert")}if(!(M instanceof bt)&&M.type.kind!=="resolvedImage"&&Vo(M)){const D=new Br;try{M=new bt(M.type,M.evaluate(D))}catch(F){return this.error(F.message),null}}return M}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(s===void 0?"'undefined' value invalid. Use null instead.":typeof s=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,d,m){const _=typeof s=="number"?this.path.concat(s):this.path,E=m?this.scope.concat(m):this.scope;return new Es(this.registry,_,d||null,E,this.errors)}error(s,...d){const m=`${this.key}${d.map(_=>`[${_}]`).join("")}`;this.errors.push(new rr(m,s))}checkSubtype(s,d){const m=$t(s,d);return m&&this.error(m),m}}function Vo(c){if(c instanceof Di)return Vo(c.boundExpression);if(c instanceof Jr&&c.name==="error"||c instanceof Vn||c instanceof Qa)return!1;const s=c instanceof ir||c instanceof Bt;let d=!0;return c.eachChild(m=>{d=s?d&&Vo(m):d&&m instanceof bt}),!!d&&Fr(c)&&An(c,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function tl(c,s){const d=c.length-1;let m,_,E=0,M=d,D=0;for(;E<=M;)if(D=Math.floor((E+M)/2),m=c[D],_=c[D+1],m<=s){if(D===d||s<_)return D;E=D+1}else{if(!(m>s))throw new Je("Input is not a number.");M=D-1}return 0}class Ja{constructor(s,d,m){this.type=s,this.input=d,this.labels=[],this.outputs=[];for(const[_,E]of m)this.labels.push(_),this.outputs.push(E)}static parse(s,d){if(s.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return d.error("Expected an even number of arguments.");const m=d.parse(s[1],1,_t);if(!m)return null;const _=[];let E=null;d.expectedType&&d.expectedType.kind!=="value"&&(E=d.expectedType);for(let M=1;M=D)return d.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',U);const re=d.parse(F,X,E);if(!re)return null;E=E||re.type,_.push([D,re])}return new Ja(E,m,_)}evaluate(s){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(s);const _=this.input.evaluate(s);if(_<=d[0])return m[0].evaluate(s);const E=d.length;return _>=d[E-1]?m[E-1].evaluate(s):m[tl(d,_)].evaluate(s)}eachChild(s){s(this.input);for(const d of this.outputs)s(d)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function xn(c,s,d){return c*(1-d)+s*d}var es=Object.freeze({__proto__:null,number:xn,color:function(c,s,d){return new ae(xn(c.r,s.r,d),xn(c.g,s.g,d),xn(c.b,s.b,d),xn(c.a,s.a,d))},array:function(c,s,d){return c.map((m,_)=>xn(m,s[_],d))},padding:function(c,s,d){const m=c.values,_=s.values;return new Ce([xn(m[0],_[0],d),xn(m[1],_[1],d),xn(m[2],_[2],d),xn(m[3],_[3],d)])}});const qv=.95047,Gv=1.08883,Dh=4/29,Pd=6/29,Zv=3*Pd*Pd,a_=Math.PI/180,s_=180/Math.PI;function Lh(c){return c>.008856451679035631?Math.pow(c,1/3):c/Zv+Dh}function Fh(c){return c>Pd?c*c*c:Zv*(c-Dh)}function $h(c){return 255*(c<=.0031308?12.92*c:1.055*Math.pow(c,1/2.4)-.055)}function Bh(c){return(c/=255)<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function sn(c){const s=Bh(c.r),d=Bh(c.g),m=Bh(c.b),_=Lh((.4124564*s+.3575761*d+.1804375*m)/qv),E=Lh((.2126729*s+.7151522*d+.072175*m)/1);return{l:116*E-16,a:500*(_-E),b:200*(E-Lh((.0193339*s+.119192*d+.9503041*m)/Gv)),alpha:c.a}}function Xv(c){let s=(c.l+16)/116,d=isNaN(c.a)?s:s+c.a/500,m=isNaN(c.b)?s:s-c.b/200;return s=1*Fh(s),d=qv*Fh(d),m=Gv*Fh(m),new ae($h(3.2404542*d-1.5371385*s-.4985314*m),$h(-.969266*d+1.8760108*s+.041556*m),$h(.0556434*d-.2040259*s+1.0572252*m),c.alpha)}function l_(c,s,d){const m=s-c;return c+d*(m>180||m<-180?m-360*Math.round(m/360):m)}const lc={forward:sn,reverse:Xv,interpolate:function(c,s,d){return{l:xn(c.l,s.l,d),a:xn(c.a,s.a,d),b:xn(c.b,s.b,d),alpha:xn(c.alpha,s.alpha,d)}}},uc={forward:function(c){const{l:s,a:d,b:m}=sn(c),_=Math.atan2(m,d)*s_;return{h:_<0?_+360:_,c:Math.sqrt(d*d+m*m),l:s,alpha:c.a}},reverse:function(c){const s=c.h*a_,d=c.c;return Xv({l:c.l,a:Math.cos(s)*d,b:Math.sin(s)*d,alpha:c.alpha})},interpolate:function(c,s,d){return{h:l_(c.h,s.h,d),c:xn(c.c,s.c,d),l:xn(c.l,s.l,d),alpha:xn(c.alpha,s.alpha,d)}}};var Yv=Object.freeze({__proto__:null,lab:lc,hcl:uc});class wo{constructor(s,d,m,_,E){this.type=s,this.operator=d,this.interpolation=m,this.input=_,this.labels=[],this.outputs=[];for(const[M,D]of E)this.labels.push(M),this.outputs.push(D)}static interpolationFactor(s,d,m,_){let E=0;if(s.name==="exponential")E=Vh(d,s.base,m,_);else if(s.name==="linear")E=Vh(d,1,m,_);else if(s.name==="cubic-bezier"){const M=s.controlPoints;E=new f(M[0],M[1],M[2],M[3]).solve(Vh(d,1,m,_))}return E}static parse(s,d){let[m,_,E,...M]=s;if(!Array.isArray(_)||_.length===0)return d.error("Expected an interpolation type expression.",1);if(_[0]==="linear")_={name:"linear"};else if(_[0]==="exponential"){const U=_[1];if(typeof U!="number")return d.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:U}}else{if(_[0]!=="cubic-bezier")return d.error(`Unknown interpolation type ${String(_[0])}`,1,0);{const U=_.slice(1);if(U.length!==4||U.some(X=>typeof X!="number"||X<0||X>1))return d.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:U}}}if(s.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return d.error("Expected an even number of arguments.");if(E=d.parse(E,2,_t),!E)return null;const D=[];let F=null;m==="interpolate-hcl"||m==="interpolate-lab"?F=$r:d.expectedType&&d.expectedType.kind!=="value"&&(F=d.expectedType);for(let U=0;U=X)return d.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ue);const pe=d.parse(re,he,F);if(!pe)return null;F=F||pe.type,D.push([X,pe])}return F.kind==="number"||F.kind==="color"||F.kind==="padding"||F.kind==="array"&&F.itemType.kind==="number"&&typeof F.N=="number"?new wo(F,m,_,E,D):d.error(`Type ${ht(F)} is not interpolatable.`)}evaluate(s){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(s);const _=this.input.evaluate(s);if(_<=d[0])return m[0].evaluate(s);const E=d.length;if(_>=d[E-1])return m[E-1].evaluate(s);const M=tl(d,_),D=wo.interpolationFactor(this.interpolation,_,d[M],d[M+1]),F=m[M].evaluate(s),U=m[M+1].evaluate(s);return this.operator==="interpolate"?es[this.type.kind.toLowerCase()](F,U,D):this.operator==="interpolate-hcl"?uc.reverse(uc.interpolate(uc.forward(F),uc.forward(U),D)):lc.reverse(lc.interpolate(lc.forward(F),lc.forward(U),D))}eachChild(s){s(this.input);for(const d of this.outputs)s(d)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Vh(c,s,d,m){const _=m-d,E=c-d;return _===0?0:s===1?E/_:(Math.pow(s,E)-1)/(Math.pow(s,_)-1)}class Md{constructor(s,d){this.type=s,this.args=d}static parse(s,d){if(s.length<2)return d.error("Expectected at least one argument.");let m=null;const _=d.expectedType;_&&_.kind!=="value"&&(m=_);const E=[];for(const D of s.slice(1)){const F=d.parse(D,1+E.length,m,void 0,{typeAnnotation:"omit"});if(!F)return null;m=m||F.type,E.push(F)}if(!m)throw new Error("No output type");const M=_&&E.some(D=>$t(_,D.type));return new Md(M?Lt:m,E)}evaluate(s){let d,m=null,_=0;for(const E of this.args)if(_++,m=E.evaluate(s),m&&m instanceof Ae&&!m.available&&(d||(d=m.name),m=null,_===this.args.length&&(m=d)),m!==null)break;return m}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class Id{constructor(s,d){this.type=d.type,this.bindings=[].concat(s),this.result=d}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const d of this.bindings)s(d[1]);s(this.result)}static parse(s,d){if(s.length<4)return d.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const m=[];for(let E=1;E=m.length)throw new Je(`Array index out of bounds: ${d} > ${m.length-1}.`);if(d!==Math.floor(d))throw new Je(`Array index must be an integer, but found ${d} instead.`);return m[d]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class Uh{constructor(s,d){this.type=or,this.needle=s,this.haystack=d}static parse(s,d){if(s.length!==3)return d.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const m=d.parse(s[1],1,Lt),_=d.parse(s[2],2,Lt);return m&&_?ur(m.type,[or,qt,_t,Or,Lt])?new Uh(m,_):d.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(m.type)} instead`):null}evaluate(s){const d=this.needle.evaluate(s),m=this.haystack.evaluate(s);if(!m)return!1;if(!Ir(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${ht(Be(d))} instead.`);if(!Ir(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${ht(Be(m))} instead.`);return m.indexOf(d)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class Rd{constructor(s,d,m){this.type=_t,this.needle=s,this.haystack=d,this.fromIndex=m}static parse(s,d){if(s.length<=2||s.length>=5)return d.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const m=d.parse(s[1],1,Lt),_=d.parse(s[2],2,Lt);if(!m||!_)return null;if(!ur(m.type,[or,qt,_t,Or,Lt]))return d.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(m.type)} instead`);if(s.length===4){const E=d.parse(s[3],3,_t);return E?new Rd(m,_,E):null}return new Rd(m,_)}evaluate(s){const d=this.needle.evaluate(s),m=this.haystack.evaluate(s);if(!Ir(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${ht(Be(d))} instead.`);if(!Ir(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${ht(Be(m))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(s);return m.indexOf(d,_)}return m.indexOf(d)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class Kh{constructor(s,d,m,_,E,M){this.inputType=s,this.type=d,this.input=m,this.cases=_,this.outputs=E,this.otherwise=M}static parse(s,d){if(s.length<5)return d.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return d.error("Expected an even number of arguments.");let m,_;d.expectedType&&d.expectedType.kind!=="value"&&(_=d.expectedType);const E={},M=[];for(let U=2;UNumber.MAX_SAFE_INTEGER)return ue.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof pe=="number"&&Math.floor(pe)!==pe)return ue.error("Numeric branch labels must be integer values.");if(m){if(ue.checkSubtype(m,Be(pe)))return null}else m=Be(pe);if(E[String(pe)]!==void 0)return ue.error("Branch labels must be unique.");E[String(pe)]=M.length}const he=d.parse(re,U,_);if(!he)return null;_=_||he.type,M.push(he)}const D=d.parse(s[1],1,Lt);if(!D)return null;const F=d.parse(s[s.length-1],s.length-1,_);return F?D.type.kind!=="value"&&d.concat(1).checkSubtype(m,D.type)?null:new Kh(m,_,D,E,M,F):null}evaluate(s){const d=this.input.evaluate(s);return(Be(d)===this.inputType&&this.outputs[this.cases[d]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class Hh{constructor(s,d,m){this.type=s,this.branches=d,this.otherwise=m}static parse(s,d){if(s.length<4)return d.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return d.error("Expected an odd number of arguments.");let m;d.expectedType&&d.expectedType.kind!=="value"&&(m=d.expectedType);const _=[];for(let M=1;Md.outputDefined())&&this.otherwise.outputDefined()}}class Od{constructor(s,d,m,_){this.type=s,this.input=d,this.beginIndex=m,this.endIndex=_}static parse(s,d){if(s.length<=2||s.length>=5)return d.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const m=d.parse(s[1],1,Lt),_=d.parse(s[2],2,_t);if(!m||!_)return null;if(!ur(m.type,[ot(Lt),qt,Lt]))return d.error(`Expected first argument to be of type array or string, but found ${ht(m.type)} instead`);if(s.length===4){const E=d.parse(s[3],3,_t);return E?new Od(m.type,m,_,E):null}return new Od(m.type,m,_)}evaluate(s){const d=this.input.evaluate(s),m=this.beginIndex.evaluate(s);if(!Ir(d,["string","array"]))throw new Je(`Expected first argument to be of type array or string, but found ${ht(Be(d))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(s);return d.slice(m,_)}return d.slice(m)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function Qv(c,s){return c==="=="||c==="!="?s.kind==="boolean"||s.kind==="string"||s.kind==="number"||s.kind==="null"||s.kind==="value":s.kind==="string"||s.kind==="number"||s.kind==="value"}function Jv(c,s,d,m){return m.compare(s,d)===0}function Zl(c,s,d){const m=c!=="=="&&c!=="!=";return class fL{constructor(E,M,D){this.type=or,this.lhs=E,this.rhs=M,this.collator=D,this.hasUntypedArgument=E.type.kind==="value"||M.type.kind==="value"}static parse(E,M){if(E.length!==3&&E.length!==4)return M.error("Expected two or three arguments.");const D=E[0];let F=M.parse(E[1],1,Lt);if(!F)return null;if(!Qv(D,F.type))return M.concat(1).error(`"${D}" comparisons are not supported for type '${ht(F.type)}'.`);let U=M.parse(E[2],2,Lt);if(!U)return null;if(!Qv(D,U.type))return M.concat(2).error(`"${D}" comparisons are not supported for type '${ht(U.type)}'.`);if(F.type.kind!==U.type.kind&&F.type.kind!=="value"&&U.type.kind!=="value")return M.error(`Cannot compare types '${ht(F.type)}' and '${ht(U.type)}'.`);m&&(F.type.kind==="value"&&U.type.kind!=="value"?F=new Bt(U.type,[F]):F.type.kind!=="value"&&U.type.kind==="value"&&(U=new Bt(F.type,[U])));let X=null;if(E.length===4){if(F.type.kind!=="string"&&U.type.kind!=="string"&&F.type.kind!=="value"&&U.type.kind!=="value")return M.error("Cannot use collator to compare non-string types.");if(X=M.parse(E[3],3,kr),!X)return null}return new fL(F,U,X)}evaluate(E){const M=this.lhs.evaluate(E),D=this.rhs.evaluate(E);if(m&&this.hasUntypedArgument){const F=Be(M),U=Be(D);if(F.kind!==U.kind||F.kind!=="string"&&F.kind!=="number")throw new Je(`Expected arguments for "${c}" to be (string, string) or (number, number), but found (${F.kind}, ${U.kind}) instead.`)}if(this.collator&&!m&&this.hasUntypedArgument){const F=Be(M),U=Be(D);if(F.kind!=="string"||U.kind!=="string")return s(E,M,D)}return this.collator?d(E,M,D,this.collator.evaluate(E)):s(E,M,D)}eachChild(E){E(this.lhs),E(this.rhs),this.collator&&E(this.collator)}outputDefined(){return!0}}}const u_=Zl("==",function(c,s,d){return s===d},Jv),c_=Zl("!=",function(c,s,d){return s!==d},function(c,s,d,m){return!Jv(0,s,d,m)}),d_=Zl("<",function(c,s,d){return s",function(c,s,d){return s>d},function(c,s,d,m){return m.compare(s,d)>0}),h_=Zl("<=",function(c,s,d){return s<=d},function(c,s,d,m){return m.compare(s,d)<=0}),p_=Zl(">=",function(c,s,d){return s>=d},function(c,s,d,m){return m.compare(s,d)>=0});class Wh{constructor(s,d,m,_,E){this.type=qt,this.number=s,this.locale=d,this.currency=m,this.minFractionDigits=_,this.maxFractionDigits=E}static parse(s,d){if(s.length!==3)return d.error("Expected two arguments.");const m=d.parse(s[1],1,_t);if(!m)return null;const _=s[2];if(typeof _!="object"||Array.isArray(_))return d.error("NumberFormat options argument must be an object.");let E=null;if(_.locale&&(E=d.parse(_.locale,1,qt),!E))return null;let M=null;if(_.currency&&(M=d.parse(_.currency,1,qt),!M))return null;let D=null;if(_["min-fraction-digits"]&&(D=d.parse(_["min-fraction-digits"],1,_t),!D))return null;let F=null;return _["max-fraction-digits"]&&(F=d.parse(_["max-fraction-digits"],1,_t),!F)?null:new Wh(m,E,M,D,F)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class Ad{constructor(s){this.type=wr,this.sections=s}static parse(s,d){if(s.length<2)return d.error("Expected at least one argument.");const m=s[1];if(!Array.isArray(m)&&typeof m=="object")return d.error("First argument must be an image or text section.");const _=[];let E=!1;for(let M=1;M<=s.length-1;++M){const D=s[M];if(E&&typeof D=="object"&&!Array.isArray(D)){E=!1;let F=null;if(D["font-scale"]&&(F=d.parse(D["font-scale"],1,_t),!F))return null;let U=null;if(D["text-font"]&&(U=d.parse(D["text-font"],1,ot(qt)),!U))return null;let X=null;if(D["text-color"]&&(X=d.parse(D["text-color"],1,$r),!X))return null;const re=_[_.length-1];re.scale=F,re.font=U,re.textColor=X}else{const F=d.parse(s[M],1,Lt);if(!F)return null;const U=F.type.kind;if(U!=="string"&&U!=="value"&&U!=="null"&&U!=="resolvedImage")return d.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");E=!0,_.push({content:F,scale:null,font:null,textColor:null})}}return new Ad(_)}evaluate(s){return new be(this.sections.map(d=>{const m=d.content.evaluate(s);return Be(m)===Nt?new Ee("",m,null,null,null):new Ee(At(m),null,d.scale?d.scale.evaluate(s):null,d.font?d.font.evaluate(s).join(","):null,d.textColor?d.textColor.evaluate(s):null)}))}eachChild(s){for(const d of this.sections)s(d.content),d.scale&&s(d.scale),d.font&&s(d.font),d.textColor&&s(d.textColor)}outputDefined(){return!1}}class qh{constructor(s){this.type=Nt,this.input=s}static parse(s,d){if(s.length!==2)return d.error("Expected two arguments.");const m=d.parse(s[1],1,qt);return m?new qh(m):d.error("No image name provided.")}evaluate(s){const d=this.input.evaluate(s),m=Ae.fromString(d);return m&&s.availableImages&&(m.available=s.availableImages.indexOf(d)>-1),m}eachChild(s){s(this.input)}outputDefined(){return!1}}class Gh{constructor(s){this.type=_t,this.input=s}static parse(s,d){if(s.length!==2)return d.error(`Expected 1 argument, but found ${s.length-1} instead.`);const m=d.parse(s[1],1);return m?m.type.kind!=="array"&&m.type.kind!=="string"&&m.type.kind!=="value"?d.error(`Expected argument of type string or array, but found ${ht(m.type)} instead.`):new Gh(m):null}evaluate(s){const d=this.input.evaluate(s);if(typeof d=="string"||Array.isArray(d))return d.length;throw new Je(`Expected value to be of type string or array, but found ${ht(Be(d))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Xl={"==":u_,"!=":c_,">":f_,"<":d_,">=":p_,"<=":h_,array:Bt,at:jh,boolean:Bt,case:Hh,coalesce:Md,collator:Vn,format:Ad,image:qh,in:Uh,"index-of":Rd,interpolate:wo,"interpolate-hcl":wo,"interpolate-lab":wo,length:Gh,let:Id,literal:bt,match:Kh,number:Bt,"number-format":Wh,object:Bt,slice:Od,step:Ja,string:Bt,"to-boolean":ir,"to-color":ir,"to-number":ir,"to-string":ir,var:Di,within:Qa};function eg(c,[s,d,m,_]){s=s.evaluate(c),d=d.evaluate(c),m=m.evaluate(c);const E=_?_.evaluate(c):1,M=He(s,d,m,E);if(M)throw new Je(M);return new ae(s/255*E,d/255*E,m/255*E,E)}function tg(c,s){return c in s}function Nd(c,s){const d=s[c];return d===void 0?null:d}function rl(c){return{type:c}}function rg(c){return{result:"success",value:c}}function Yl(c){return{result:"error",value:c}}function Pn(c){return c["property-type"]==="data-driven"||c["property-type"]==="cross-faded-data-driven"}function ng(c){return!!c.expression&&c.expression.parameters.indexOf("zoom")>-1}function Xr(c){return!!c.expression&&c.expression.interpolated}function ln(c){return c instanceof Number?"number":c instanceof String?"string":c instanceof Boolean?"boolean":Array.isArray(c)?"array":c===null?"null":typeof c}function En(c){return typeof c=="object"&&c!==null&&!Array.isArray(c)}function Nn(c){return c}function cc(c,s){const d=s.type==="color",m=c.stops&&typeof c.stops[0][0]=="object",_=m||!(m||c.property!==void 0),E=c.type||(Xr(s)?"exponential":"interval");if(d||s.type==="padding"){const U=d?ae.parse:Ce.parse;(c=cr({},c)).stops&&(c.stops=c.stops.map(X=>[X[0],U(X[1])])),c.default=U(c.default?c.default:s.default)}if(c.colorSpace&&c.colorSpace!=="rgb"&&!Yv[c.colorSpace])throw new Error(`Unknown color space: ${c.colorSpace}`);let M,D,F;if(E==="exponential")M=ig;else if(E==="interval")M=v_;else if(E==="categorical"){M=m_,D=Object.create(null);for(const U of c.stops)D[U[0]]=U[1];F=typeof c.stops[0][0]}else{if(E!=="identity")throw new Error(`Unknown function type "${E}"`);M=g_}if(m){const U={},X=[];for(let he=0;hehe[0]),evaluate:({zoom:he},pe)=>ig({stops:re,base:c.base},s,he).evaluate(he,pe)}}if(_){const U=E==="exponential"?{name:"exponential",base:c.base!==void 0?c.base:1}:null;return{kind:"camera",interpolationType:U,interpolationFactor:wo.interpolationFactor.bind(void 0,U),zoomStops:c.stops.map(X=>X[0]),evaluate:({zoom:X})=>M(c,s,X,D,F)}}return{kind:"source",evaluate(U,X){const re=X&&X.properties?X.properties[c.property]:void 0;return re===void 0?Ql(c.default,s.default):M(c,s,re,D,F)}}}function Ql(c,s,d){return c!==void 0?c:s!==void 0?s:d!==void 0?d:void 0}function m_(c,s,d,m,_){return Ql(typeof d===_?m[d]:void 0,c.default,s.default)}function v_(c,s,d){if(ln(d)!=="number")return Ql(c.default,s.default);const m=c.stops.length;if(m===1||d<=c.stops[0][0])return c.stops[0][1];if(d>=c.stops[m-1][0])return c.stops[m-1][1];const _=tl(c.stops.map(E=>E[0]),d);return c.stops[_][1]}function ig(c,s,d){const m=c.base!==void 0?c.base:1;if(ln(d)!=="number")return Ql(c.default,s.default);const _=c.stops.length;if(_===1||d<=c.stops[0][0])return c.stops[0][1];if(d>=c.stops[_-1][0])return c.stops[_-1][1];const E=tl(c.stops.map(X=>X[0]),d),M=function(X,re,ue,he){const pe=he-ue,Oe=X-ue;return pe===0?0:re===1?Oe/pe:(Math.pow(re,Oe)-1)/(Math.pow(re,pe)-1)}(d,m,c.stops[E][0],c.stops[E+1][0]),D=c.stops[E][1],F=c.stops[E+1][1];let U=es[s.type]||Nn;if(c.colorSpace&&c.colorSpace!=="rgb"){const X=Yv[c.colorSpace];U=(re,ue)=>X.reverse(X.interpolate(X.forward(re),X.forward(ue),M))}return typeof D.evaluate=="function"?{evaluate(...X){const re=D.evaluate.apply(void 0,X),ue=F.evaluate.apply(void 0,X);if(re!==void 0&&ue!==void 0)return U(re,ue,M)}}:U(D,F,M)}function g_(c,s,d){switch(s.type){case"color":d=ae.parse(d);break;case"formatted":d=be.fromString(d.toString());break;case"resolvedImage":d=Ae.fromString(d.toString());break;case"padding":d=Ce.parse(d);break;default:ln(d)===s.type||s.type==="enum"&&s.values[d]||(d=void 0)}return Ql(d,c.default,s.default)}Jr.register(Xl,{error:[{kind:"error"},[qt],(c,[s])=>{throw new Je(s.evaluate(c))}],typeof:[qt,[Lt],(c,[s])=>ht(Be(s.evaluate(c)))],"to-rgba":[ot(_t,4),[$r],(c,[s])=>s.evaluate(c).toArray()],rgb:[$r,[_t,_t,_t],eg],rgba:[$r,[_t,_t,_t,_t],eg],has:{type:or,overloads:[[[qt],(c,[s])=>tg(s.evaluate(c),c.properties())],[[qt,Er],(c,[s,d])=>tg(s.evaluate(c),d.evaluate(c))]]},get:{type:Lt,overloads:[[[qt],(c,[s])=>Nd(s.evaluate(c),c.properties())],[[qt,Er],(c,[s,d])=>Nd(s.evaluate(c),d.evaluate(c))]]},"feature-state":[Lt,[qt],(c,[s])=>Nd(s.evaluate(c),c.featureState||{})],properties:[Er,[],c=>c.properties()],"geometry-type":[qt,[],c=>c.geometryType()],id:[Lt,[],c=>c.id()],zoom:[_t,[],c=>c.globals.zoom],"heatmap-density":[_t,[],c=>c.globals.heatmapDensity||0],"line-progress":[_t,[],c=>c.globals.lineProgress||0],accumulated:[Lt,[],c=>c.globals.accumulated===void 0?null:c.globals.accumulated],"+":[_t,rl(_t),(c,s)=>{let d=0;for(const m of s)d+=m.evaluate(c);return d}],"*":[_t,rl(_t),(c,s)=>{let d=1;for(const m of s)d*=m.evaluate(c);return d}],"-":{type:_t,overloads:[[[_t,_t],(c,[s,d])=>s.evaluate(c)-d.evaluate(c)],[[_t],(c,[s])=>-s.evaluate(c)]]},"/":[_t,[_t,_t],(c,[s,d])=>s.evaluate(c)/d.evaluate(c)],"%":[_t,[_t,_t],(c,[s,d])=>s.evaluate(c)%d.evaluate(c)],ln2:[_t,[],()=>Math.LN2],pi:[_t,[],()=>Math.PI],e:[_t,[],()=>Math.E],"^":[_t,[_t,_t],(c,[s,d])=>Math.pow(s.evaluate(c),d.evaluate(c))],sqrt:[_t,[_t],(c,[s])=>Math.sqrt(s.evaluate(c))],log10:[_t,[_t],(c,[s])=>Math.log(s.evaluate(c))/Math.LN10],ln:[_t,[_t],(c,[s])=>Math.log(s.evaluate(c))],log2:[_t,[_t],(c,[s])=>Math.log(s.evaluate(c))/Math.LN2],sin:[_t,[_t],(c,[s])=>Math.sin(s.evaluate(c))],cos:[_t,[_t],(c,[s])=>Math.cos(s.evaluate(c))],tan:[_t,[_t],(c,[s])=>Math.tan(s.evaluate(c))],asin:[_t,[_t],(c,[s])=>Math.asin(s.evaluate(c))],acos:[_t,[_t],(c,[s])=>Math.acos(s.evaluate(c))],atan:[_t,[_t],(c,[s])=>Math.atan(s.evaluate(c))],min:[_t,rl(_t),(c,s)=>Math.min(...s.map(d=>d.evaluate(c)))],max:[_t,rl(_t),(c,s)=>Math.max(...s.map(d=>d.evaluate(c)))],abs:[_t,[_t],(c,[s])=>Math.abs(s.evaluate(c))],round:[_t,[_t],(c,[s])=>{const d=s.evaluate(c);return d<0?-Math.round(-d):Math.round(d)}],floor:[_t,[_t],(c,[s])=>Math.floor(s.evaluate(c))],ceil:[_t,[_t],(c,[s])=>Math.ceil(s.evaluate(c))],"filter-==":[or,[qt,Lt],(c,[s,d])=>c.properties()[s.value]===d.value],"filter-id-==":[or,[Lt],(c,[s])=>c.id()===s.value],"filter-type-==":[or,[qt],(c,[s])=>c.geometryType()===s.value],"filter-<":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m<_}],"filter-id-<":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m>_}],"filter-id->":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d>m}],"filter-<=":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m<=_}],"filter-id-<=":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d<=m}],"filter->=":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m>=_}],"filter-id->=":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d>=m}],"filter-has":[or,[Lt],(c,[s])=>s.value in c.properties()],"filter-has-id":[or,[],c=>c.id()!==null&&c.id()!==void 0],"filter-type-in":[or,[ot(qt)],(c,[s])=>s.value.indexOf(c.geometryType())>=0],"filter-id-in":[or,[ot(Lt)],(c,[s])=>s.value.indexOf(c.id())>=0],"filter-in-small":[or,[qt,ot(Lt)],(c,[s,d])=>d.value.indexOf(c.properties()[s.value])>=0],"filter-in-large":[or,[qt,ot(Lt)],(c,[s,d])=>function(m,_,E,M){for(;E<=M;){const D=E+M>>1;if(_[D]===m)return!0;_[D]>m?M=D-1:E=D+1}return!1}(c.properties()[s.value],d.value,0,d.value.length-1)],all:{type:or,overloads:[[[or,or],(c,[s,d])=>s.evaluate(c)&&d.evaluate(c)],[rl(or),(c,s)=>{for(const d of s)if(!d.evaluate(c))return!1;return!0}]]},any:{type:or,overloads:[[[or,or],(c,[s,d])=>s.evaluate(c)||d.evaluate(c)],[rl(or),(c,s)=>{for(const d of s)if(d.evaluate(c))return!0;return!1}]]},"!":[or,[or],(c,[s])=>!s.evaluate(c)],"is-supported-script":[or,[qt],(c,[s])=>{const d=c.globals&&c.globals.isSupportedScript;return!d||d(s.evaluate(c))}],upcase:[qt,[qt],(c,[s])=>s.evaluate(c).toUpperCase()],downcase:[qt,[qt],(c,[s])=>s.evaluate(c).toLowerCase()],concat:[qt,rl(Lt),(c,s)=>s.map(d=>At(d.evaluate(c))).join("")],"resolved-locale":[qt,[kr],(c,[s])=>s.evaluate(c).resolvedLocale()]});class zd{constructor(s,d){this.expression=s,this._warningHistory={},this._evaluator=new Br,this._defaultValue=d?function(m){return m.type==="color"&&En(m.default)?new ae(0,0,0,0):m.type==="color"?ae.parse(m.default)||null:m.type==="padding"?Ce.parse(m.default)||null:m.default===void 0?null:m.default}(d):null,this._enumValues=d&&d.type==="enum"?d.values:null}evaluateWithoutErrorHandling(s,d,m,_,E,M){return this._evaluator.globals=s,this._evaluator.feature=d,this._evaluator.featureState=m,this._evaluator.canonical=_,this._evaluator.availableImages=E||null,this._evaluator.formattedSection=M,this.expression.evaluate(this._evaluator)}evaluate(s,d,m,_,E,M){this._evaluator.globals=s,this._evaluator.feature=d||null,this._evaluator.featureState=m||null,this._evaluator.canonical=_,this._evaluator.availableImages=E||null,this._evaluator.formattedSection=M||null;try{const D=this.expression.evaluate(this._evaluator);if(D==null||typeof D=="number"&&D!=D)return this._defaultValue;if(this._enumValues&&!(D in this._enumValues))throw new Je(`Expected value to be one of ${Object.keys(this._enumValues).map(F=>JSON.stringify(F)).join(", ")}, but found ${JSON.stringify(D)} instead.`);return D}catch(D){return this._warningHistory[D.message]||(this._warningHistory[D.message]=!0,typeof console<"u"&&console.warn(D.message)),this._defaultValue}}}function dc(c){return Array.isArray(c)&&c.length>0&&typeof c[0]=="string"&&c[0]in Xl}function fc(c,s){const d=new Es(Xl,[],s?function(_){const E={color:$r,string:qt,number:_t,enum:qt,boolean:or,formatted:wr,padding:fr,resolvedImage:Nt};return _.type==="array"?ot(E[_.value]||Lt,_.length):E[_.type]}(s):void 0),m=d.parse(c,void 0,void 0,void 0,s&&s.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?rg(new zd(m,s)):Yl(d.errors)}class hc{constructor(s,d){this.kind=s,this._styleExpression=d,this.isStateDependent=s!=="constant"&&!Zr(d.expression)}evaluateWithoutErrorHandling(s,d,m,_,E,M){return this._styleExpression.evaluateWithoutErrorHandling(s,d,m,_,E,M)}evaluate(s,d,m,_,E,M){return this._styleExpression.evaluate(s,d,m,_,E,M)}}class Zh{constructor(s,d,m,_){this.kind=s,this.zoomStops=m,this._styleExpression=d,this.isStateDependent=s!=="camera"&&!Zr(d.expression),this.interpolationType=_}evaluateWithoutErrorHandling(s,d,m,_,E,M){return this._styleExpression.evaluateWithoutErrorHandling(s,d,m,_,E,M)}evaluate(s,d,m,_,E,M){return this._styleExpression.evaluate(s,d,m,_,E,M)}interpolationFactor(s,d,m){return this.interpolationType?wo.interpolationFactor(this.interpolationType,s,d,m):0}}function og(c,s){const d=fc(c,s);if(d.result==="error")return d;const m=d.value.expression,_=Fr(m);if(!_&&!Pn(s))return Yl([new rr("","data expressions not supported")]);const E=An(m,["zoom"]);if(!E&&!ng(s))return Yl([new rr("","zoom expressions not supported")]);const M=Ld(m);return M||E?M instanceof rr?Yl([M]):M instanceof wo&&!Xr(s)?Yl([new rr("",'"interpolate" expressions cannot be used with this property')]):rg(M?new Zh(_?"camera":"composite",d.value,M.labels,M instanceof wo?M.interpolation:void 0):new hc(_?"constant":"source",d.value)):Yl([new rr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Dd{constructor(s,d){this._parameters=s,this._specification=d,cr(this,cc(this._parameters,this._specification))}static deserialize(s){return new Dd(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function Ld(c){let s=null;if(c instanceof Id)s=Ld(c.result);else if(c instanceof Md){for(const d of c.args)if(s=Ld(d),s)break}else(c instanceof Ja||c instanceof wo)&&c.input instanceof Jr&&c.input.name==="zoom"&&(s=c);return s instanceof rr||c.eachChild(d=>{const m=Ld(d);m instanceof rr?s=m:!s&&m?s=new rr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&m&&s!==m&&(s=new rr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function ra(c){const s=c.key,d=c.value,m=c.valueSpec||{},_=c.objectElementValidators||{},E=c.style,M=c.styleSpec;let D=[];const F=ln(d);if(F!=="object")return[new qe(s,d,`object expected, ${F} found`)];for(const U in d){const X=U.split(".")[0],re=m[X]||m["*"];let ue;if(_[X])ue=_[X];else if(m[X])ue=So;else if(_["*"])ue=_["*"];else{if(!m["*"]){D.push(new qe(s,d[U],`unknown property "${U}"`));continue}ue=So}D=D.concat(ue({key:(s&&`${s}.`)+U,value:d[U],valueSpec:re,style:E,styleSpec:M,object:d,objectKey:U},d))}for(const U in m)_[U]||m[U].required&&m[U].default===void 0&&d[U]===void 0&&D.push(new qe(s,d,`missing required property "${U}"`));return D}function ag(c){const s=c.value,d=c.valueSpec,m=c.style,_=c.styleSpec,E=c.key,M=c.arrayElementValidator||So;if(ln(s)!=="array")return[new qe(E,s,`array expected, ${ln(s)} found`)];if(d.length&&s.length!==d.length)return[new qe(E,s,`array length ${d.length} expected, length ${s.length} found`)];if(d["min-length"]&&s.lengthm.maximum?[new qe(s,d,`${d} is greater than the maximum value ${m.maximum}`)]:[]}function sg(c){const s=c.valueSpec,d=Vt(c.value.type);let m,_,E,M={};const D=d!=="categorical"&&c.value.property===void 0,F=!D,U=ln(c.value.stops)==="array"&&ln(c.value.stops[0])==="array"&&ln(c.value.stops[0][0])==="object",X=ra({key:c.key,value:c.value,valueSpec:c.styleSpec.function,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{stops:function(he){if(d==="identity")return[new qe(he.key,he.value,'identity function may not have a "stops" property')];let pe=[];const Oe=he.value;return pe=pe.concat(ag({key:he.key,value:Oe,valueSpec:he.valueSpec,style:he.style,styleSpec:he.styleSpec,arrayElementValidator:re})),ln(Oe)==="array"&&Oe.length===0&&pe.push(new qe(he.key,Oe,"array must have at least one stop")),pe},default:function(he){return So({key:he.key,value:he.value,valueSpec:s,style:he.style,styleSpec:he.styleSpec})}}});return d==="identity"&&D&&X.push(new qe(c.key,c.value,'missing required property "property"')),d==="identity"||c.value.stops||X.push(new qe(c.key,c.value,'missing required property "stops"')),d==="exponential"&&c.valueSpec.expression&&!Xr(c.valueSpec)&&X.push(new qe(c.key,c.value,"exponential functions not supported")),c.styleSpec.$version>=8&&(F&&!Pn(c.valueSpec)?X.push(new qe(c.key,c.value,"property functions not supported")):D&&!ng(c.valueSpec)&&X.push(new qe(c.key,c.value,"zoom functions not supported"))),d!=="categorical"&&!U||c.value.property!==void 0||X.push(new qe(c.key,c.value,'"property" property is required')),X;function re(he){let pe=[];const Oe=he.value,Me=he.key;if(ln(Oe)!=="array")return[new qe(Me,Oe,`array expected, ${ln(Oe)} found`)];if(Oe.length!==2)return[new qe(Me,Oe,`array length 2 expected, length ${Oe.length} found`)];if(U){if(ln(Oe[0])!=="object")return[new qe(Me,Oe,`object expected, ${ln(Oe[0])} found`)];if(Oe[0].zoom===void 0)return[new qe(Me,Oe,"object stop key must have zoom")];if(Oe[0].value===void 0)return[new qe(Me,Oe,"object stop key must have value")];if(E&&E>Vt(Oe[0].zoom))return[new qe(Me,Oe[0].zoom,"stop zoom values must appear in ascending order")];Vt(Oe[0].zoom)!==E&&(E=Vt(Oe[0].zoom),_=void 0,M={}),pe=pe.concat(ra({key:`${Me}[0]`,value:Oe[0],valueSpec:{zoom:{}},style:he.style,styleSpec:he.styleSpec,objectElementValidators:{zoom:Xh,value:ue}}))}else pe=pe.concat(ue({key:`${Me}[0]`,value:Oe[0],valueSpec:{},style:he.style,styleSpec:he.styleSpec},Oe));return dc(Ut(Oe[1]))?pe.concat([new qe(`${Me}[1]`,Oe[1],"expressions are not allowed in function stops.")]):pe.concat(So({key:`${Me}[1]`,value:Oe[1],valueSpec:s,style:he.style,styleSpec:he.styleSpec}))}function ue(he,pe){const Oe=ln(he.value),Me=Vt(he.value),Ze=he.value!==null?he.value:pe;if(m){if(Oe!==m)return[new qe(he.key,Ze,`${Oe} stop domain type must match previous stop domain type ${m}`)]}else m=Oe;if(Oe!=="number"&&Oe!=="string"&&Oe!=="boolean")return[new qe(he.key,Ze,"stop domain value must be a number, string, or boolean")];if(Oe!=="number"&&d!=="categorical"){let st=`number expected, ${Oe} found`;return Pn(s)&&d===void 0&&(st+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new qe(he.key,Ze,st)]}return d!=="categorical"||Oe!=="number"||isFinite(Me)&&Math.floor(Me)===Me?d!=="categorical"&&Oe==="number"&&_!==void 0&&Me<_?[new qe(he.key,Ze,"stop domain values must appear in ascending order")]:(_=Me,d==="categorical"&&Me in M?[new qe(he.key,Ze,"stop domain values must be unique")]:(M[Me]=!0,[])):[new qe(he.key,Ze,`integer expected, found ${Me}`)]}}function nl(c){const s=(c.expressionContext==="property"?og:fc)(Ut(c.value),c.valueSpec);if(s.result==="error")return s.value.map(m=>new qe(`${c.key}${m.key}`,c.value,m.message));const d=s.value.expression||s.value._styleExpression.expression;if(c.expressionContext==="property"&&c.propertyKey==="text-font"&&!d.outputDefined())return[new qe(c.key,c.value,`Invalid data expression for "${c.propertyKey}". Output values must be contained as literals within the expression.`)];if(c.expressionContext==="property"&&c.propertyType==="layout"&&!Zr(d))return[new qe(c.key,c.value,'"feature-state" data expressions are not supported with layout properties.')];if(c.expressionContext==="filter"&&!Zr(d))return[new qe(c.key,c.value,'"feature-state" data expressions are not supported with filters.')];if(c.expressionContext&&c.expressionContext.indexOf("cluster")===0){if(!An(d,["zoom","feature-state"]))return[new qe(c.key,c.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(c.expressionContext==="cluster-initial"&&!Fr(d))return[new qe(c.key,c.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function pc(c){const s=c.key,d=c.value,m=c.valueSpec,_=[];return Array.isArray(m.values)?m.values.indexOf(Vt(d))===-1&&_.push(new qe(s,d,`expected one of [${m.values.join(", ")}], ${JSON.stringify(d)} found`)):Object.keys(m.values).indexOf(Vt(d))===-1&&_.push(new qe(s,d,`expected one of [${Object.keys(m.values).join(", ")}], ${JSON.stringify(d)} found`)),_}function Jl(c){if(c===!0||c===!1)return!0;if(!Array.isArray(c)||c.length===0)return!1;switch(c[0]){case"has":return c.length>=2&&c[1]!=="$id"&&c[1]!=="$type";case"in":return c.length>=3&&(typeof c[1]!="string"||Array.isArray(c[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return c.length!==3||Array.isArray(c[1])||Array.isArray(c[2]);case"any":case"all":for(const s of c.slice(1))if(!Jl(s)&&typeof s!="boolean")return!1;return!0;default:return!0}}const y_={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Fd(c){if(c==null)return{filter:()=>!0,needGeometry:!1};Jl(c)||(c=mc(c));const s=fc(c,y_);if(s.result==="error")throw new Error(s.value.map(d=>`${d.key}: ${d.message}`).join(", "));return{filter:(d,m,_)=>s.value.evaluate(d,m,{},_),needGeometry:ug(c)}}function lg(c,s){return cs?1:0}function ug(c){if(!Array.isArray(c))return!1;if(c[0]==="within")return!0;for(let s=1;s"||s==="<="||s===">="?Yh(c[1],c[2],s):s==="any"?(d=c.slice(1),["any"].concat(d.map(mc))):s==="all"?["all"].concat(c.slice(1).map(mc)):s==="none"?["all"].concat(c.slice(1).map(mc).map(eu)):s==="in"?$d(c[1],c.slice(2)):s==="!in"?eu($d(c[1],c.slice(2))):s==="has"?vc(c[1]):s==="!has"?eu(vc(c[1])):s!=="within"||c;var d}function Yh(c,s,d){switch(c){case"$type":return[`filter-type-${d}`,s];case"$id":return[`filter-id-${d}`,s];default:return[`filter-${d}`,c,s]}}function $d(c,s){if(s.length===0)return!1;switch(c){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(d=>typeof d!=typeof s[0])?["filter-in-large",c,["literal",s.sort(lg)]]:["filter-in-small",c,["literal",s]]}}function vc(c){switch(c){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",c]}}function eu(c){return["!",c]}function gc(c){return Jl(Ut(c.value))?nl(cr({},c,{expressionContext:"filter",valueSpec:{value:"boolean"}})):cg(c)}function cg(c){const s=c.value,d=c.key;if(ln(s)!=="array")return[new qe(d,s,`array expected, ${ln(s)} found`)];const m=c.styleSpec;let _,E=[];if(s.length<1)return[new qe(d,s,"filter array must have at least 1 element")];switch(E=E.concat(pc({key:`${d}[0]`,value:s[0],valueSpec:m.filter_operator,style:c.style,styleSpec:c.styleSpec})),Vt(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&Vt(s[1])==="$type"&&E.push(new qe(d,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":s.length!==3&&E.push(new qe(d,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(_=ln(s[1]),_!=="string"&&E.push(new qe(`${d}[1]`,s[1],`string expected, ${_} found`)));for(let M=2;M{U in d&&s.push(new qe(m,d[U],`"${U}" is prohibited for ref layers`))}),_.layers.forEach(U=>{Vt(U.id)===D&&(F=U)}),F?F.ref?s.push(new qe(m,d.ref,"ref cannot reference another ref layer")):M=Vt(F.type):s.push(new qe(m,d.ref,`ref layer "${D}" not found`))}else if(M!=="background")if(d.source){const F=_.sources&&_.sources[d.source],U=F&&Vt(F.type);F?U==="vector"&&M==="raster"?s.push(new qe(m,d.source,`layer "${d.id}" requires a raster source`)):U==="raster"&&M!=="raster"?s.push(new qe(m,d.source,`layer "${d.id}" requires a vector source`)):U!=="vector"||d["source-layer"]?U==="raster-dem"&&M!=="hillshade"?s.push(new qe(m,d.source,"raster-dem source can only be used with layer type 'hillshade'.")):M!=="line"||!d.paint||!d.paint["line-gradient"]||U==="geojson"&&F.lineMetrics||s.push(new qe(m,d,`layer "${d.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new qe(m,d,`layer "${d.id}" must specify a "source-layer"`)):s.push(new qe(m,d.source,`source "${d.source}" not found`))}else s.push(new qe(m,d,'missing required property "source"'));return s=s.concat(ra({key:m,value:d,valueSpec:E.layer,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{"*":()=>[],type:()=>So({key:`${m}.type`,value:d.type,valueSpec:E.layer.type,style:c.style,styleSpec:c.styleSpec,object:d,objectKey:"type"}),filter:gc,layout:F=>ra({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":U=>fg(cr({layerType:M},U))}}),paint:F=>ra({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":U=>dg(cr({layerType:M},U))}})}})),s}function tu(c){const s=c.value,d=c.key,m=ln(s);return m!=="string"?[new qe(d,s,`string expected, ${m} found`)]:[]}const pg={promoteId:function({key:c,value:s}){if(ln(s)==="string")return tu({key:c,value:s});{const d=[];for(const m in s)d.push(...tu({key:`${c}.${m}`,value:s[m]}));return d}}};function xc(c){const s=c.value,d=c.key,m=c.styleSpec,_=c.style;if(!s.type)return[new qe(d,s,'"type" is required')];const E=Vt(s.type);let M;switch(E){case"vector":case"raster":case"raster-dem":return M=ra({key:d,value:s,valueSpec:m[`source_${E.replace("-","_")}`],style:c.style,styleSpec:m,objectElementValidators:pg}),M;case"geojson":if(M=ra({key:d,value:s,valueSpec:m.source_geojson,style:_,styleSpec:m,objectElementValidators:pg}),s.cluster)for(const D in s.clusterProperties){const[F,U]=s.clusterProperties[D],X=typeof F=="string"?[F,["accumulated"],["get",D]]:F;M.push(...nl({key:`${d}.${D}.map`,value:U,expressionContext:"cluster-map"})),M.push(...nl({key:`${d}.${D}.reduce`,value:X,expressionContext:"cluster-reduce"}))}return M;case"video":return ra({key:d,value:s,valueSpec:m.source_video,style:_,styleSpec:m});case"image":return ra({key:d,value:s,valueSpec:m.source_image,style:_,styleSpec:m});case"canvas":return[new qe(d,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return pc({key:`${d}.type`,value:s.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,styleSpec:m})}}function _c(c){const s=c.value,d=c.styleSpec,m=d.light,_=c.style;let E=[];const M=ln(s);if(s===void 0)return E;if(M!=="object")return E=E.concat([new qe("light",s,`object expected, ${M} found`)]),E;for(const D in s){const F=D.match(/^(.*)-transition$/);E=E.concat(F&&m[F[1]]&&m[F[1]].transition?So({key:D,value:s[D],valueSpec:d.transition,style:_,styleSpec:d}):m[D]?So({key:D,value:s[D],valueSpec:m[D],style:_,styleSpec:d}):[new qe(D,s[D],`unknown property "${D}"`)])}return E}function Co(c){const s=c.value,d=c.styleSpec,m=d.terrain,_=c.style;let E=[];const M=ln(s);if(s===void 0)return E;if(M!=="object")return E=E.concat([new qe("terrain",s,`object expected, ${M} found`)]),E;for(const D in s)E=E.concat(m[D]?So({key:D,value:s[D],valueSpec:m[D],style:_,styleSpec:d}):[new qe(D,s[D],`unknown property "${D}"`)]);return E}const bc={"*":()=>[],array:ag,boolean:function(c){const s=c.value,d=c.key,m=ln(s);return m!=="boolean"?[new qe(d,s,`boolean expected, ${m} found`)]:[]},number:Xh,color:function(c){const s=c.key,d=c.value,m=ln(d);return m!=="string"?[new qe(s,d,`color expected, ${m} found`)]:qr(d)===null?[new qe(s,d,`color expected, "${d}" found`)]:[]},constants:Xt,enum:pc,filter:gc,function:sg,layer:hg,object:ra,source:xc,light:_c,terrain:Co,string:tu,formatted:function(c){return tu(c).length===0?[]:nl(c)},resolvedImage:function(c){return tu(c).length===0?[]:nl(c)},padding:function(c){const s=c.key,d=c.value;if(ln(d)==="array"){if(d.length<1||d.length>4)return[new qe(s,d,`padding requires 1 to 4 values; ${d.length} values found`)];const m={type:"number"};let _=[];for(let E=0;E[]}})),c.constants&&(d=d.concat(Xt({key:"constants",value:c.constants,style:c,styleSpec:s}))),mg(d)}function mg(c){return[].concat(c).sort((s,d)=>s.line-d.line)}function ts(c){return function(...s){return mg(c.apply(this,s))}}ks.source=ts(xc),ks.light=ts(_c),ks.terrain=ts(Co),ks.layer=ts(hg),ks.filter=ts(gc),ks.paintProperty=ts(dg),ks.layoutProperty=ts(fg);const wc=ks,Qh=wc.light,__=wc.paintProperty,b_=wc.layoutProperty;function Bd(c,s){let d=!1;if(s&&s.length)for(const m of s)c.fire(new jt(new Error(m.message))),d=!0;return d}class Cc{constructor(s,d,m){const _=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;const M=new Int32Array(this.arrayBuffer);s=M[0],this.d=(d=M[1])+2*(m=M[2]);for(let F=0;F=re[pe+0]&&_>=re[pe+1])?(D[he]=!0,M.push(X[he])):D[he]=!1}}}}_forEachCell(s,d,m,_,E,M,D,F){const U=this._convertToCellCoord(s),X=this._convertToCellCoord(d),re=this._convertToCellCoord(m),ue=this._convertToCellCoord(_);for(let he=U;he<=re;he++)for(let pe=X;pe<=ue;pe++){const Oe=this.d*pe+he;if((!F||F(this._convertFromCellCoord(he),this._convertFromCellCoord(pe),this._convertFromCellCoord(he+1),this._convertFromCellCoord(pe+1)))&&E.call(this,s,d,m,_,Oe,M,D,F))return}}_convertFromCellCoord(s){return(s-this.padding)/this.scale}_convertToCellCoord(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const s=this.cells,d=3+this.cells.length+1+1;let m=0;for(let M=0;M=0)continue;const M=c[E];_[E]=rs[m].shallow.indexOf(E)>=0?M:il(M,s)}c instanceof Error&&(_.message=c.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(_.$name=m),_}throw new Error("can't serialize object of type "+typeof c)}function Ts(c){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob||vg(c)||Q(c)||ArrayBuffer.isView(c)||c instanceof ImageData)return c;if(Array.isArray(c))return c.map(Ts);if(typeof c=="object"){const s=c.$name||"Object";if(!rs[s])throw new Error(`can't deserialize unregistered class ${s}`);const{klass:d}=rs[s];if(!d)throw new Error(`can't deserialize unregistered class ${s}`);if(d.deserialize)return d.deserialize(c);const m=Object.create(d.prototype);for(const _ of Object.keys(c)){if(_==="$name")continue;const E=c[_];m[_]=rs[s].shallow.indexOf(_)>=0?E:Ts(E)}return m}throw new Error("can't deserialize object of type "+typeof c)}class Jh{constructor(){this.first=!0}update(s,d){const m=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=m,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=m,!0):(this.lastFloorZoom>m?(this.lastIntegerZoom=m+1,this.lastIntegerZoomTime=d):this.lastFloorZoomc>=128&&c<=255,Arabic:c=>c>=1536&&c<=1791,"Arabic Supplement":c=>c>=1872&&c<=1919,"Arabic Extended-A":c=>c>=2208&&c<=2303,"Hangul Jamo":c=>c>=4352&&c<=4607,"Unified Canadian Aboriginal Syllabics":c=>c>=5120&&c<=5759,Khmer:c=>c>=6016&&c<=6143,"Unified Canadian Aboriginal Syllabics Extended":c=>c>=6320&&c<=6399,"General Punctuation":c=>c>=8192&&c<=8303,"Letterlike Symbols":c=>c>=8448&&c<=8527,"Number Forms":c=>c>=8528&&c<=8591,"Miscellaneous Technical":c=>c>=8960&&c<=9215,"Control Pictures":c=>c>=9216&&c<=9279,"Optical Character Recognition":c=>c>=9280&&c<=9311,"Enclosed Alphanumerics":c=>c>=9312&&c<=9471,"Geometric Shapes":c=>c>=9632&&c<=9727,"Miscellaneous Symbols":c=>c>=9728&&c<=9983,"Miscellaneous Symbols and Arrows":c=>c>=11008&&c<=11263,"CJK Radicals Supplement":c=>c>=11904&&c<=12031,"Kangxi Radicals":c=>c>=12032&&c<=12255,"Ideographic Description Characters":c=>c>=12272&&c<=12287,"CJK Symbols and Punctuation":c=>c>=12288&&c<=12351,Hiragana:c=>c>=12352&&c<=12447,Katakana:c=>c>=12448&&c<=12543,Bopomofo:c=>c>=12544&&c<=12591,"Hangul Compatibility Jamo":c=>c>=12592&&c<=12687,Kanbun:c=>c>=12688&&c<=12703,"Bopomofo Extended":c=>c>=12704&&c<=12735,"CJK Strokes":c=>c>=12736&&c<=12783,"Katakana Phonetic Extensions":c=>c>=12784&&c<=12799,"Enclosed CJK Letters and Months":c=>c>=12800&&c<=13055,"CJK Compatibility":c=>c>=13056&&c<=13311,"CJK Unified Ideographs Extension A":c=>c>=13312&&c<=19903,"Yijing Hexagram Symbols":c=>c>=19904&&c<=19967,"CJK Unified Ideographs":c=>c>=19968&&c<=40959,"Yi Syllables":c=>c>=40960&&c<=42127,"Yi Radicals":c=>c>=42128&&c<=42191,"Hangul Jamo Extended-A":c=>c>=43360&&c<=43391,"Hangul Syllables":c=>c>=44032&&c<=55215,"Hangul Jamo Extended-B":c=>c>=55216&&c<=55295,"Private Use Area":c=>c>=57344&&c<=63743,"CJK Compatibility Ideographs":c=>c>=63744&&c<=64255,"Arabic Presentation Forms-A":c=>c>=64336&&c<=65023,"Vertical Forms":c=>c>=65040&&c<=65055,"CJK Compatibility Forms":c=>c>=65072&&c<=65103,"Small Form Variants":c=>c>=65104&&c<=65135,"Arabic Presentation Forms-B":c=>c>=65136&&c<=65279,"Halfwidth and Fullwidth Forms":c=>c>=65280&&c<=65519};function Vd(c){for(const s of c)if(tp(s.charCodeAt(0)))return!0;return!1}function w_(c){for(const s of c)if(!ep(s.charCodeAt(0)))return!1;return!0}function ep(c){return!(Jt.Arabic(c)||Jt["Arabic Supplement"](c)||Jt["Arabic Extended-A"](c)||Jt["Arabic Presentation Forms-A"](c)||Jt["Arabic Presentation Forms-B"](c))}function tp(c){return!(c!==746&&c!==747&&(c<4352||!(Jt["Bopomofo Extended"](c)||Jt.Bopomofo(c)||Jt["CJK Compatibility Forms"](c)&&!(c>=65097&&c<=65103)||Jt["CJK Compatibility Ideographs"](c)||Jt["CJK Compatibility"](c)||Jt["CJK Radicals Supplement"](c)||Jt["CJK Strokes"](c)||!(!Jt["CJK Symbols and Punctuation"](c)||c>=12296&&c<=12305||c>=12308&&c<=12319||c===12336)||Jt["CJK Unified Ideographs Extension A"](c)||Jt["CJK Unified Ideographs"](c)||Jt["Enclosed CJK Letters and Months"](c)||Jt["Hangul Compatibility Jamo"](c)||Jt["Hangul Jamo Extended-A"](c)||Jt["Hangul Jamo Extended-B"](c)||Jt["Hangul Jamo"](c)||Jt["Hangul Syllables"](c)||Jt.Hiragana(c)||Jt["Ideographic Description Characters"](c)||Jt.Kanbun(c)||Jt["Kangxi Radicals"](c)||Jt["Katakana Phonetic Extensions"](c)||Jt.Katakana(c)&&c!==12540||!(!Jt["Halfwidth and Fullwidth Forms"](c)||c===65288||c===65289||c===65293||c>=65306&&c<=65310||c===65339||c===65341||c===65343||c>=65371&&c<=65503||c===65507||c>=65512&&c<=65519)||!(!Jt["Small Form Variants"](c)||c>=65112&&c<=65118||c>=65123&&c<=65126)||Jt["Unified Canadian Aboriginal Syllabics"](c)||Jt["Unified Canadian Aboriginal Syllabics Extended"](c)||Jt["Vertical Forms"](c)||Jt["Yijing Hexagram Symbols"](c)||Jt["Yi Syllables"](c)||Jt["Yi Radicals"](c))))}function gg(c){return!(tp(c)||function(s){return!!(Jt["Latin-1 Supplement"](s)&&(s===167||s===169||s===174||s===177||s===188||s===189||s===190||s===215||s===247)||Jt["General Punctuation"](s)&&(s===8214||s===8224||s===8225||s===8240||s===8241||s===8251||s===8252||s===8258||s===8263||s===8264||s===8265||s===8273)||Jt["Letterlike Symbols"](s)||Jt["Number Forms"](s)||Jt["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||s===9003||s>=9085&&s<=9114||s>=9150&&s<=9165||s===9167||s>=9169&&s<=9179||s>=9186&&s<=9215)||Jt["Control Pictures"](s)&&s!==9251||Jt["Optical Character Recognition"](s)||Jt["Enclosed Alphanumerics"](s)||Jt["Geometric Shapes"](s)||Jt["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||Jt["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||Jt["CJK Symbols and Punctuation"](s)||Jt.Katakana(s)||Jt["Private Use Area"](s)||Jt["CJK Compatibility Forms"](s)||Jt["Small Form Variants"](s)||Jt["Halfwidth and Fullwidth Forms"](s)||s===8734||s===8756||s===8757||s>=9984&&s<=10087||s>=10102&&s<=10131||s===65532||s===65533)}(c))}function yg(c){return c>=1424&&c<=2303||Jt["Arabic Presentation Forms-A"](c)||Jt["Arabic Presentation Forms-B"](c)}function C_(c,s){return!(!s&&yg(c)||c>=2304&&c<=3583||c>=3840&&c<=4255||Jt.Khmer(c))}function xg(c){for(const s of c)if(yg(s.charCodeAt(0)))return!0;return!1}const rp="deferred",np="loading",ip="loaded";let op=null,uo="unavailable",Ps=null;const _g=function(c){c&&typeof c=="string"&&c.indexOf("NetworkError")>-1&&(uo="error"),op&&op(c)};function ru(){ap.fire(new Wt("pluginStateChange",{pluginStatus:uo,pluginURL:Ps}))}const ap=new Qt,Sc=function(){return uo},bg=function(){if(uo!==rp||!Ps)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");uo=np,ru(),Ps&&Ct({url:Ps},c=>{c?_g(c):(uo=ip,ru())})},jo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>uo===ip||jo.applyArabicShaping!=null,isLoading:()=>uo===np,setState(c){if(!H())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");uo=c.pluginStatus,Ps=c.pluginURL},isParsed(){if(!H())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return jo.applyArabicShaping!=null&&jo.processBidirectionalText!=null&&jo.processStyledBidirectionalText!=null},getPluginURL(){if(!H())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Ps}};class zn{constructor(s,d){this.zoom=s,d?(this.now=d.now,this.fadeDuration=d.fadeDuration,this.zoomHistory=d.zoomHistory,this.transition=d.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Jh,this.transition={})}isSupportedScript(s){return function(d,m){for(const _ of d)if(!C_(_.charCodeAt(0),m))return!1;return!0}(s,jo.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const s=this.zoom,d=s-Math.floor(s),m=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:d+(1-d)*m}:{fromScale:.5,toScale:1,t:1-(1-m)*d}}}class Ec{constructor(s,d){this.property=s,this.value=d,this.expression=function(m,_){if(En(m))return new Dd(m,_);if(dc(m)){const E=og(m,_);if(E.result==="error")throw new Error(E.value.map(M=>`${M.key}: ${M.message}`).join(", "));return E.value}{let E=m;return _.type==="color"&&typeof m=="string"?E=ae.parse(m):_.type!=="padding"||typeof m!="number"&&!Array.isArray(m)||(E=Ce.parse(m)),{kind:"constant",evaluate:()=>E}}}(d===void 0?s.specification.default:d,s.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(s,d,m){return this.property.possiblyEvaluate(this,s,d,m)}}class jd{constructor(s){this.property=s,this.value=new Ec(s,void 0)}transitioned(s,d){return new Cg(this.property,this.value,d,T({},s.transition,this.transition),s.now)}untransitioned(){return new Cg(this.property,this.value,null,{},0)}}class wg{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return N(this._values[s].value.value)}setValue(s,d){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new jd(this._values[s].property)),this._values[s].value=new Ec(this._values[s].property,d===null?void 0:N(d))}getTransition(s){return N(this._values[s].transition)}setTransition(s,d){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new jd(this._values[s].property)),this._values[s].transition=N(d)||void 0}serialize(){const s={};for(const d of Object.keys(this._values)){const m=this.getValue(d);m!==void 0&&(s[d]=m);const _=this.getTransition(d);_!==void 0&&(s[`${d}-transition`]=_)}return s}transitioned(s,d){const m=new Sg(this._properties);for(const _ of Object.keys(this._values))m._values[_]=this._values[_].transitioned(s,d._values[_]);return m}untransitioned(){const s=new Sg(this._properties);for(const d of Object.keys(this._values))s._values[d]=this._values[d].untransitioned();return s}}class Cg{constructor(s,d,m,_,E){this.property=s,this.value=d,this.begin=E+_.delay||0,this.end=this.begin+_.duration||0,s.specification.transition&&(_.delay||_.duration)&&(this.prior=m)}possiblyEvaluate(s,d,m){const _=s.now||0,E=this.value.possiblyEvaluate(s,d,m),M=this.prior;if(M){if(_>this.end)return this.prior=null,E;if(this.value.isDataDriven())return this.prior=null,E;if(_=1)return 1;const U=F*F,X=U*F;return 4*(F<.5?X:3*(F-U)+X-.75)}(D))}}return E}}class Sg{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,d,m){const _=new kc(this._properties);for(const E of Object.keys(this._values))_._values[E]=this._values[E].possiblyEvaluate(s,d,m);return _}hasTransition(){for(const s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class S_{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}getValue(s){return N(this._values[s].value)}setValue(s,d){this._values[s]=new Ec(this._values[s].property,d===null?void 0:N(d))}serialize(){const s={};for(const d of Object.keys(this._values)){const m=this.getValue(d);m!==void 0&&(s[d]=m)}return s}possiblyEvaluate(s,d,m){const _=new kc(this._properties);for(const E of Object.keys(this._values))_._values[E]=this._values[E].possiblyEvaluate(s,d,m);return _}}class Ea{constructor(s,d,m){this.property=s,this.value=d,this.parameters=m}isConstant(){return this.value.kind==="constant"}constantOr(s){return this.value.kind==="constant"?this.value.value:s}evaluate(s,d,m,_){return this.property.evaluate(this.value,this.parameters,s,d,m,_)}}class kc{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class pr{constructor(s){this.specification=s}possiblyEvaluate(s,d){if(s.isDataDriven())throw new Error("Value should not be data driven");return s.expression.evaluate(d)}interpolate(s,d,m){const _=es[this.specification.type];return _?_(s,d,m):s}}class Sr{constructor(s,d){this.specification=s,this.overrides=d}possiblyEvaluate(s,d,m,_){return new Ea(this,s.expression.kind==="constant"||s.expression.kind==="camera"?{kind:"constant",value:s.expression.evaluate(d,null,{},m,_)}:s.expression,d)}interpolate(s,d,m){if(s.value.kind!=="constant"||d.value.kind!=="constant")return s;if(s.value.value===void 0||d.value.value===void 0)return new Ea(this,{kind:"constant",value:void 0},s.parameters);const _=es[this.specification.type];return _?new Ea(this,{kind:"constant",value:_(s.value.value,d.value.value,m)},s.parameters):s}evaluate(s,d,m,_,E,M){return s.kind==="constant"?s.value:s.evaluate(d,m,_,E,M)}}class nu extends Sr{possiblyEvaluate(s,d,m,_){if(s.value===void 0)return new Ea(this,{kind:"constant",value:void 0},d);if(s.expression.kind==="constant"){const E=s.expression.evaluate(d,null,{},m,_),M=s.property.specification.type==="resolvedImage"&&typeof E!="string"?E.name:E,D=this._calculate(M,M,M,d);return new Ea(this,{kind:"constant",value:D},d)}if(s.expression.kind==="camera"){const E=this._calculate(s.expression.evaluate({zoom:d.zoom-1}),s.expression.evaluate({zoom:d.zoom}),s.expression.evaluate({zoom:d.zoom+1}),d);return new Ea(this,{kind:"constant",value:E},d)}return new Ea(this,s.expression,d)}evaluate(s,d,m,_,E,M){if(s.kind==="source"){const D=s.evaluate(d,m,_,E,M);return this._calculate(D,D,D,d)}return s.kind==="composite"?this._calculate(s.evaluate({zoom:Math.floor(d.zoom)-1},m,_),s.evaluate({zoom:Math.floor(d.zoom)},m,_),s.evaluate({zoom:Math.floor(d.zoom)+1},m,_),d):s.value}_calculate(s,d,m,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:d}:{from:m,to:d}}interpolate(s){return s}}class sp{constructor(s){this.specification=s}possiblyEvaluate(s,d,m,_){if(s.value!==void 0){if(s.expression.kind==="constant"){const E=s.expression.evaluate(d,null,{},m,_);return this._calculate(E,E,E,d)}return this._calculate(s.expression.evaluate(new zn(Math.floor(d.zoom-1),d)),s.expression.evaluate(new zn(Math.floor(d.zoom),d)),s.expression.evaluate(new zn(Math.floor(d.zoom+1),d)),d)}}_calculate(s,d,m,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:d}:{from:m,to:d}}interpolate(s){return s}}class Ms{constructor(s){this.specification=s}possiblyEvaluate(s,d,m,_){return!!s.expression.evaluate(d,null,{},m,_)}interpolate(){return!1}}class Li{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const d in s){const m=s[d];m.specification.overridable&&this.overridableProperties.push(d);const _=this.defaultPropertyValues[d]=new Ec(m,void 0),E=this.defaultTransitionablePropertyValues[d]=new jd(m);this.defaultTransitioningPropertyValues[d]=E.untransitioned(),this.defaultPossiblyEvaluatedValues[d]=_.possiblyEvaluate({})}}}dr("DataDrivenProperty",Sr),dr("DataConstantProperty",pr),dr("CrossFadedDataDrivenProperty",nu),dr("CrossFadedProperty",sp),dr("ColorRampProperty",Ms);const Is="-transition";class ka extends Qt{constructor(s,d){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1},s.type!=="custom"&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,s.type!=="background"&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),d.layout&&(this._unevaluatedLayout=new S_(d.layout)),d.paint)){this._transitionablePaint=new wg(d.paint);for(const m in s.paint)this.setPaintProperty(m,s.paint[m],{validate:!1});for(const m in s.layout)this.setLayoutProperty(m,s.layout[m],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new kc(d.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(s){return s==="visibility"?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,d,m={}){d!=null&&this._validate(b_,`layers.${this.id}.layout.${s}`,s,d,m)||(s!=="visibility"?this._unevaluatedLayout.setValue(s,d):this.visibility=d)}getPaintProperty(s){return s.endsWith(Is)?this._transitionablePaint.getTransition(s.slice(0,-Is.length)):this._transitionablePaint.getValue(s)}setPaintProperty(s,d,m={}){if(d!=null&&this._validate(__,`layers.${this.id}.paint.${s}`,s,d,m))return!1;if(s.endsWith(Is))return this._transitionablePaint.setTransition(s.slice(0,-Is.length),d||void 0),!1;{const _=this._transitionablePaint._values[s],E=_.property.specification["property-type"]==="cross-faded-data-driven",M=_.value.isDataDriven(),D=_.value;this._transitionablePaint.setValue(s,d),this._handleSpecialPaintPropertyUpdate(s);const F=this._transitionablePaint._values[s].value;return F.isDataDriven()||M||E||this._handleOverridablePaintPropertyUpdate(s,D,F)}}_handleSpecialPaintPropertyUpdate(s){}_handleOverridablePaintPropertyUpdate(s,d,m){return!1}isHidden(s){return!!(this.minzoom&&s=this.maxzoom)||this.visibility==="none"}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,d){s.getCrossfadeParameters&&(this._crossfadeParameters=s.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,d)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,d)}serialize(){const s={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&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),O(s,(d,m)=>!(d===void 0||m==="layout"&&!Object.keys(d).length||m==="paint"&&!Object.keys(d).length))}_validate(s,d,m,_,E={}){return(!E||E.validate!==!1)&&Bd(this,s.call(wc,{key:d,layerType:this.type,objectKey:m,value:_,styleSpec:Fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const s in this.paint._values){const d=this.paint.get(s);if(d instanceof Ea&&Pn(d.property.specification)&&(d.value.kind==="source"||d.value.kind==="composite")&&d.value.isStateDependent)return!0}return!1}}const Eg={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Rs{constructor(s,d){this._structArray=s,this._pos1=d*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ti{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,d){return s._trim(),d&&(s.isTransferred=!0,d.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){const d=Object.create(this.prototype);return d.arrayBuffer=s.arrayBuffer,d.length=s.length,d.capacity=s.arrayBuffer.byteLength/d.bytesPerElement,d._refreshViews(),d}_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(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const d=this.uint8;this._refreshViews(),d&&this.uint8.set(d)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ci(c,s=1){let d=0,m=0;return{members:c.map(_=>{const E=Eg[_.type].BYTES_PER_ELEMENT,M=d=lp(d,Math.max(s,E)),D=_.components||1;return m=Math.max(m,E),d+=E*D,{name:_.name,type:_.type,components:D,offset:M}}),size:lp(d,Math.max(m,s)),alignment:s}}function lp(c,s){return Math.ceil(c/s)*s}class ol extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d){const m=this.length;return this.resize(m+1),this.emplace(m,s,d)}emplace(s,d,m){const _=2*s;return this.int16[_+0]=d,this.int16[_+1]=m,s}}ol.prototype.bytesPerElement=4,dr("StructArrayLayout2i4",ol);class x extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_){const E=this.length;return this.resize(E+1),this.emplace(E,s,d,m,_)}emplace(s,d,m,_,E){const M=4*s;return this.int16[M+0]=d,this.int16[M+1]=m,this.int16[M+2]=_,this.int16[M+3]=E,s}}x.prototype.bytesPerElement=8,dr("StructArrayLayout4i8",x);class l extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,E,M){const D=this.length;return this.resize(D+1),this.emplace(D,s,d,m,_,E,M)}emplace(s,d,m,_,E,M,D){const F=6*s;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=_,this.int16[F+3]=E,this.int16[F+4]=M,this.int16[F+5]=D,s}}l.prototype.bytesPerElement=12,dr("StructArrayLayout2i4i12",l);class h extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,E,M){const D=this.length;return this.resize(D+1),this.emplace(D,s,d,m,_,E,M)}emplace(s,d,m,_,E,M,D){const F=4*s,U=8*s;return this.int16[F+0]=d,this.int16[F+1]=m,this.uint8[U+4]=_,this.uint8[U+5]=E,this.uint8[U+6]=M,this.uint8[U+7]=D,s}}h.prototype.bytesPerElement=8,dr("StructArrayLayout2i4ub8",h);class g extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d){const m=this.length;return this.resize(m+1),this.emplace(m,s,d)}emplace(s,d,m){const _=2*s;return this.float32[_+0]=d,this.float32[_+1]=m,s}}g.prototype.bytesPerElement=8,dr("StructArrayLayout2f8",g);class b extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,E,M,D,F,U,X){const re=this.length;return this.resize(re+1),this.emplace(re,s,d,m,_,E,M,D,F,U,X)}emplace(s,d,m,_,E,M,D,F,U,X,re){const ue=10*s;return this.uint16[ue+0]=d,this.uint16[ue+1]=m,this.uint16[ue+2]=_,this.uint16[ue+3]=E,this.uint16[ue+4]=M,this.uint16[ue+5]=D,this.uint16[ue+6]=F,this.uint16[ue+7]=U,this.uint16[ue+8]=X,this.uint16[ue+9]=re,s}}b.prototype.bytesPerElement=20,dr("StructArrayLayout10ui20",b);class P extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,E,M,D,F,U,X,re,ue){const he=this.length;return this.resize(he+1),this.emplace(he,s,d,m,_,E,M,D,F,U,X,re,ue)}emplace(s,d,m,_,E,M,D,F,U,X,re,ue,he){const pe=12*s;return this.int16[pe+0]=d,this.int16[pe+1]=m,this.int16[pe+2]=_,this.int16[pe+3]=E,this.uint16[pe+4]=M,this.uint16[pe+5]=D,this.uint16[pe+6]=F,this.uint16[pe+7]=U,this.int16[pe+8]=X,this.int16[pe+9]=re,this.int16[pe+10]=ue,this.int16[pe+11]=he,s}}P.prototype.bytesPerElement=24,dr("StructArrayLayout4i4ui4i24",P);class z extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const E=3*s;return this.float32[E+0]=d,this.float32[E+1]=m,this.float32[E+2]=_,s}}z.prototype.bytesPerElement=12,dr("StructArrayLayout3f12",z);class $ extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){const d=this.length;return this.resize(d+1),this.emplace(d,s)}emplace(s,d){return this.uint32[1*s+0]=d,s}}$.prototype.bytesPerElement=4,dr("StructArrayLayout1ul4",$);class V extends ti{_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(s,d,m,_,E,M,D,F,U){const X=this.length;return this.resize(X+1),this.emplace(X,s,d,m,_,E,M,D,F,U)}emplace(s,d,m,_,E,M,D,F,U,X){const re=10*s,ue=5*s;return this.int16[re+0]=d,this.int16[re+1]=m,this.int16[re+2]=_,this.int16[re+3]=E,this.int16[re+4]=M,this.int16[re+5]=D,this.uint32[ue+3]=F,this.uint16[re+8]=U,this.uint16[re+9]=X,s}}V.prototype.bytesPerElement=20,dr("StructArrayLayout6i1ul2ui20",V);class W extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,E,M){const D=this.length;return this.resize(D+1),this.emplace(D,s,d,m,_,E,M)}emplace(s,d,m,_,E,M,D){const F=6*s;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=_,this.int16[F+3]=E,this.int16[F+4]=M,this.int16[F+5]=D,s}}W.prototype.bytesPerElement=12,dr("StructArrayLayout2i2i2i12",W);class ee extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,E){const M=this.length;return this.resize(M+1),this.emplace(M,s,d,m,_,E)}emplace(s,d,m,_,E,M){const D=4*s,F=8*s;return this.float32[D+0]=d,this.float32[D+1]=m,this.float32[D+2]=_,this.int16[F+6]=E,this.int16[F+7]=M,s}}ee.prototype.bytesPerElement=16,dr("StructArrayLayout2f1f2i16",ee);class ie extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m,_){const E=this.length;return this.resize(E+1),this.emplace(E,s,d,m,_)}emplace(s,d,m,_,E){const M=12*s,D=3*s;return this.uint8[M+0]=d,this.uint8[M+1]=m,this.float32[D+1]=_,this.float32[D+2]=E,s}}ie.prototype.bytesPerElement=12,dr("StructArrayLayout2ub2f12",ie);class fe extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const E=3*s;return this.uint16[E+0]=d,this.uint16[E+1]=m,this.uint16[E+2]=_,s}}fe.prototype.bytesPerElement=6,dr("StructArrayLayout3ui6",fe);class Se extends ti{_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(s,d,m,_,E,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze){const st=this.length;return this.resize(st+1),this.emplace(st,s,d,m,_,E,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze)}emplace(s,d,m,_,E,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st){const Ke=24*s,nt=12*s,kt=48*s;return this.int16[Ke+0]=d,this.int16[Ke+1]=m,this.uint16[Ke+2]=_,this.uint16[Ke+3]=E,this.uint32[nt+2]=M,this.uint32[nt+3]=D,this.uint32[nt+4]=F,this.uint16[Ke+10]=U,this.uint16[Ke+11]=X,this.uint16[Ke+12]=re,this.float32[nt+7]=ue,this.float32[nt+8]=he,this.uint8[kt+36]=pe,this.uint8[kt+37]=Oe,this.uint8[kt+38]=Me,this.uint32[nt+10]=Ze,this.int16[Ke+22]=st,s}}Se.prototype.bytesPerElement=48,dr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Se);class _e extends ti{_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(s,d,m,_,E,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st,Ke,nt,kt,St,lr,hr,er,Zt,Ht,tr){const Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,s,d,m,_,E,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st,Ke,nt,kt,St,lr,hr,er,Zt,Ht,tr)}emplace(s,d,m,_,E,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st,Ke,nt,kt,St,lr,hr,er,Zt,Ht,tr,Yt){const Ft=34*s,br=17*s;return this.int16[Ft+0]=d,this.int16[Ft+1]=m,this.int16[Ft+2]=_,this.int16[Ft+3]=E,this.int16[Ft+4]=M,this.int16[Ft+5]=D,this.int16[Ft+6]=F,this.int16[Ft+7]=U,this.uint16[Ft+8]=X,this.uint16[Ft+9]=re,this.uint16[Ft+10]=ue,this.uint16[Ft+11]=he,this.uint16[Ft+12]=pe,this.uint16[Ft+13]=Oe,this.uint16[Ft+14]=Me,this.uint16[Ft+15]=Ze,this.uint16[Ft+16]=st,this.uint16[Ft+17]=Ke,this.uint16[Ft+18]=nt,this.uint16[Ft+19]=kt,this.uint16[Ft+20]=St,this.uint16[Ft+21]=lr,this.uint16[Ft+22]=hr,this.uint32[br+12]=er,this.float32[br+13]=Zt,this.float32[br+14]=Ht,this.float32[br+15]=tr,this.float32[br+16]=Yt,s}}_e.prototype.bytesPerElement=68,dr("StructArrayLayout8i15ui1ul4f68",_e);class we extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){const d=this.length;return this.resize(d+1),this.emplace(d,s)}emplace(s,d){return this.float32[1*s+0]=d,s}}we.prototype.bytesPerElement=4,dr("StructArrayLayout1f4",we);class $e extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const E=3*s;return this.int16[E+0]=d,this.int16[E+1]=m,this.int16[E+2]=_,s}}$e.prototype.bytesPerElement=6,dr("StructArrayLayout3i6",$e);class Ue extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const E=4*s;return this.uint32[2*s+0]=d,this.uint16[E+2]=m,this.uint16[E+3]=_,s}}Ue.prototype.bytesPerElement=8,dr("StructArrayLayout1ul2ui8",Ue);class et extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d){const m=this.length;return this.resize(m+1),this.emplace(m,s,d)}emplace(s,d,m){const _=2*s;return this.uint16[_+0]=d,this.uint16[_+1]=m,s}}et.prototype.bytesPerElement=4,dr("StructArrayLayout2ui4",et);class Pe extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){const d=this.length;return this.resize(d+1),this.emplace(d,s)}emplace(s,d){return this.uint16[1*s+0]=d,s}}Pe.prototype.bytesPerElement=2,dr("StructArrayLayout1ui2",Pe);class at extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m,_){const E=this.length;return this.resize(E+1),this.emplace(E,s,d,m,_)}emplace(s,d,m,_,E){const M=4*s;return this.float32[M+0]=d,this.float32[M+1]=m,this.float32[M+2]=_,this.float32[M+3]=E,s}}at.prototype.bytesPerElement=16,dr("StructArrayLayout4f16",at);class rt extends Rs{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 ne(this.anchorPointX,this.anchorPointY)}}rt.prototype.size=20;class gt extends V{get(s){return new rt(this,s)}}dr("CollisionBoxArray",gt);class yt extends Rs{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(s){this._structArray.uint8[this._pos1+37]=s}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(s){this._structArray.uint8[this._pos1+38]=s}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(s){this._structArray.uint32[this._pos4+10]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}yt.prototype.size=48;class zt extends Se{get(s){return new yt(this,s)}}dr("PlacedSymbolArray",zt);class vt extends Rs{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(s){this._structArray.uint32[this._pos4+12]=s}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]}}vt.prototype.size=68;class nr extends _e{get(s){return new vt(this,s)}}dr("SymbolInstanceArray",nr);class Gt extends we{getoffsetX(s){return this.float32[1*s+0]}}dr("GlyphOffsetArray",Gt);class sr extends $e{getx(s){return this.int16[3*s+0]}gety(s){return this.int16[3*s+1]}gettileUnitDistanceFromAnchor(s){return this.int16[3*s+2]}}dr("SymbolLineVertexArray",sr);class Dr extends Rs{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]}}Dr.prototype.size=8;class Vr extends Ue{get(s){return new Dr(this,s)}}dr("FeatureIndexArray",Vr);class _r extends ol{}class hn extends ol{}class pn extends ol{}class Qr extends l{}class en extends h{}class gn extends g{}class Ei extends b{}class Ta extends P{}class na extends z{}class Pa extends ${}class Os extends W{}class Uo extends ie{}class co extends fe{}class ns extends et{}const Ud=ci([{name:"a_pos",components:2,type:"Int16"}],4),{members:yi}=Ud;class Hr{constructor(s=[]){this.segments=s}prepareSegment(s,d,m,_){let E=this.segments[this.segments.length-1];return s>Hr.MAX_VERTEX_ARRAY_LENGTH&&B(`Max vertices per segment is ${Hr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!E||E.vertexLength+s>Hr.MAX_VERTEX_ARRAY_LENGTH||E.sortKey!==_)&&(E={vertexOffset:d.length,primitiveOffset:m.length,vertexLength:0,primitiveLength:0},_!==void 0&&(E.sortKey=_),this.segments.push(E)),E}get(){return this.segments}destroy(){for(const s of this.segments)for(const d in s.vaos)s.vaos[d].destroy()}static simpleSegment(s,d,m,_){return new Hr([{vertexOffset:s,primitiveOffset:d,vertexLength:m,primitiveLength:_,vaos:{},sortKey:0}])}}function fn(c,s){return 256*(c=w(Math.floor(c),0,255))+w(Math.floor(s),0,255)}Hr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dr("SegmentVector",Hr);const ki=ci([{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 Ti={exports:{}},Dn={exports:{}};Dn.exports=function(c,s){var d,m,_,E,M,D,F,U;for(m=c.length-(d=3&c.length),_=s,M=3432918353,D=461845907,U=0;U>>16)*M&65535)<<16)&4294967295)<<15|F>>>17))*D+(((F>>>16)*D&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(E>>>16)&65535)<<16);switch(F=0,d){case 3:F^=(255&c.charCodeAt(U+2))<<16;case 2:F^=(255&c.charCodeAt(U+1))<<8;case 1:_^=F=(65535&(F=(F=(65535&(F^=255&c.charCodeAt(U)))*M+(((F>>>16)*M&65535)<<16)&4294967295)<<15|F>>>17))*D+(((F>>>16)*D&65535)<<16)&4294967295}return _^=c.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Ko={exports:{}};Ko.exports=function(c,s){for(var d,m=c.length,_=s^m,E=0;m>=4;)d=1540483477*(65535&(d=255&c.charCodeAt(E)|(255&c.charCodeAt(++E))<<8|(255&c.charCodeAt(++E))<<16|(255&c.charCodeAt(++E))<<24))+((1540483477*(d>>>16)&65535)<<16),_=1540483477*(65535&_)+((1540483477*(_>>>16)&65535)<<16)^(d=1540483477*(65535&(d^=d>>>24))+((1540483477*(d>>>16)&65535)<<16)),m-=4,++E;switch(m){case 3:_^=(255&c.charCodeAt(E+2))<<16;case 2:_^=(255&c.charCodeAt(E+1))<<8;case 1:_=1540483477*(65535&(_^=255&c.charCodeAt(E)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var al=Dn.exports,up=Ko.exports;Ti.exports=al,Ti.exports.murmur3=al,Ti.exports.murmur2=up;class iu{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,d,m,_){this.ids.push(kg(s)),this.positions.push(d,m,_)}getPositions(s){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const d=kg(s);let m=0,_=this.ids.length-1;for(;m<_;){const M=m+_>>1;this.ids[M]>=d?_=M:m=M+1}const E=[];for(;this.ids[m]===d;)E.push({index:this.positions[3*m],start:this.positions[3*m+1],end:this.positions[3*m+2]}),m++;return E}static serialize(s,d){const m=new Float64Array(s.ids),_=new Uint32Array(s.positions);return cp(m,_,0,m.length-1),d&&d.push(m.buffer,_.buffer),{ids:m,positions:_}}static deserialize(s){const d=new iu;return d.ids=s.ids,d.positions=s.positions,d.indexed=!0,d}}function kg(c){const s=+c;return!isNaN(s)&&s<=Number.MAX_SAFE_INTEGER?s:Ti.exports(String(c))}function cp(c,s,d,m){for(;d>1];let E=d-1,M=m+1;for(;;){do E++;while(c[E]<_);do M--;while(c[M]>_);if(E>=M)break;As(c,E,M),As(s,3*E,3*M),As(s,3*E+1,3*M+1),As(s,3*E+2,3*M+2)}M-d`u_${_}`),this.type=m}setUniform(s,d,m){s.set(m.constantOr(this.value))}getBinding(s,d,m){return this.type==="color"?new JE(s,d):new ll(s,d)}}class Hd{constructor(s,d){this.uniformNames=d.map(m=>`u_${m}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(s,d){this.pixelRatioFrom=d.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=d.tlbr,this.patternTo=s.tlbr}setUniform(s,d,m,_){const E=_==="u_pattern_to"?this.patternTo:_==="u_pattern_from"?this.patternFrom:_==="u_pixel_ratio_to"?this.pixelRatioTo:_==="u_pixel_ratio_from"?this.pixelRatioFrom:null;E&&s.set(E)}getBinding(s,d,m){return m.substr(0,9)==="u_pattern"?new Kd(s,d):new ll(s,d)}}class ul{constructor(s,d,m,_){this.expression=s,this.type=m,this.maxValue=0,this.paintVertexAttributes=d.map(E=>({name:`a_${E}`,type:"Float32",components:m==="color"?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(s,d,m,_,E){const M=this.paintVertexArray.length,D=this.expression.evaluate(new zn(0),d,{},_,[],E);this.paintVertexArray.resize(s),this._setPaintValue(M,s,D)}updatePaintArray(s,d,m,_){const E=this.expression.evaluate({zoom:0},m,_);this._setPaintValue(s,d,E)}_setPaintValue(s,d,m){if(this.type==="color"){const _=E_(m);for(let E=s;E`u_${D}_t`),this.type=m,this.useIntegerZoom=_,this.zoom=E,this.maxValue=0,this.paintVertexAttributes=d.map(D=>({name:`a_${D}`,type:"Float32",components:m==="color"?4:2,offset:0})),this.paintVertexArray=new M}populatePaintArray(s,d,m,_,E){const M=this.expression.evaluate(new zn(this.zoom),d,{},_,[],E),D=this.expression.evaluate(new zn(this.zoom+1),d,{},_,[],E),F=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(F,s,M,D)}updatePaintArray(s,d,m,_){const E=this.expression.evaluate({zoom:this.zoom},m,_),M=this.expression.evaluate({zoom:this.zoom+1},m,_);this._setPaintValue(s,d,E,M)}_setPaintValue(s,d,m,_){if(this.type==="color"){const E=E_(m),M=E_(_);for(let D=s;D`#define HAS_UNIFORM_${_}`))}return s}getBinderAttributes(){const s=[];for(const d in this.binders){const m=this.binders[d];if(m instanceof ul||m instanceof is)for(let _=0;_!0){this.programConfigurations={};for(const _ of s)this.programConfigurations[_.id]=new e5(_,d,m);this.needsUpload=!1,this._featureMap=new iu,this._bufferOffset=0}populatePaintArrays(s,d,m,_,E,M){for(const D in this.programConfigurations)this.programConfigurations[D].populatePaintArrays(s,d,_,E,M);d.id!==void 0&&this._featureMap.add(d.id,m,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,d,m,_){for(const E of m)this.needsUpload=this.programConfigurations[E.id].updatePaintArrays(s,this._featureMap,d,E,_)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(const d in this.programConfigurations)this.programConfigurations[d].upload(s);this.needsUpload=!1}}destroy(){for(const s in this.programConfigurations)this.programConfigurations[s].destroy()}}function IF(c,s){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"]}[c]||[c.replace(`${s}-`,"").replace(/-/g,"_")]}function t5(c,s,d){const m={color:{source:g,composite:at},number:{source:we,composite:g}},_=function(E){return{"line-pattern":{source:Ei,composite:Ei},"fill-pattern":{source:Ei,composite:Ei},"fill-extrusion-pattern":{source:Ei,composite:Ei}}[E]}(c);return _&&_[d]||m[s][d]}dr("ConstantBinder",dp),dr("CrossFadedConstantBinder",Hd),dr("SourceExpressionBinder",ul),dr("CrossFadedCompositeBinder",ou),dr("CompositeExpressionBinder",is),dr("ProgramConfiguration",e5,{omit:["_buffers"]}),dr("ProgramConfigurationSet",Tc);var xi=8192;const k_=Math.pow(2,14)-1,r5=-k_-1;function Pc(c){const s=xi/c.extent,d=c.loadGeometry();for(let m=0;mM.x+1||FM.y+1)&&B("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return d}function Mc(c,s){return{type:c.type,id:c.id,properties:c.properties,geometry:s?Pc(c):[]}}function Tg(c,s,d,m,_){c.emplaceBack(2*s+(m+1)/2,2*d+(_+1)/2)}class T_{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(d=>d.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new hn,this.indexArray=new co,this.segments=new Hr,this.programConfigurations=new Tc(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){const _=this.layers[0],E=[];let M=null,D=!1;_.type==="circle"&&(M=_.layout.get("circle-sort-key"),D=!M.isConstant());for(const{feature:F,id:U,index:X,sourceLayerIndex:re}of s){const ue=this.layers[0]._featureFilter.needGeometry,he=Mc(F,ue);if(!this.layers[0]._featureFilter.filter(new zn(this.zoom),he,m))continue;const pe=D?M.evaluate(he,{},m):void 0,Oe={id:U,properties:F.properties,type:F.type,sourceLayerIndex:re,index:X,geometry:ue?he.geometry:Pc(F),patterns:{},sortKey:pe};E.push(Oe)}D&&E.sort((F,U)=>F.sortKey-U.sortKey);for(const F of E){const{geometry:U,index:X,sourceLayerIndex:re}=F,ue=s[X].feature;this.addFeature(F,U,X,m),d.featureIndex.insert(ue,U,X,re,this.index)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,yi),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,d,m,_){for(const E of d)for(const M of E){const D=M.x,F=M.y;if(D<0||D>=xi||F<0||F>=xi)continue;const U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),X=U.vertexLength;Tg(this.layoutVertexArray,D,F,-1,-1),Tg(this.layoutVertexArray,D,F,1,-1),Tg(this.layoutVertexArray,D,F,1,1),Tg(this.layoutVertexArray,D,F,-1,1),this.indexArray.emplaceBack(X,X+1,X+2),this.indexArray.emplaceBack(X,X+3,X+2),U.vertexLength+=4,U.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,m,{},_)}}function n5(c,s){for(let d=0;d1){if(P_(c,s))return!0;for(let m=0;m1?d:d.sub(s)._mult(_)._add(s))}function a5(c,s){let d,m,_,E=!1;for(let M=0;Ms.y!=_.y>s.y&&s.x<(_.x-m.x)*(s.y-m.y)/(_.y-m.y)+m.x&&(E=!E)}return E}function Wd(c,s){let d=!1;for(let m=0,_=c.length-1;ms.y!=M.y>s.y&&s.x<(M.x-E.x)*(s.y-E.y)/(M.y-E.y)+E.x&&(d=!d)}return d}function NF(c,s,d){const m=d[0],_=d[2];if(c.x_.x&&s.x>_.x||c.y_.y&&s.y>_.y)return!1;const E=j(c,s,d[0]);return E!==j(c,s,d[1])||E!==j(c,s,d[2])||E!==j(c,s,d[3])}function fp(c,s,d){const m=s.paint.get(c).value;return m.kind==="constant"?m.value:d.programConfigurations.get(s.id).getMaxValue(c)}function Pg(c){return Math.sqrt(c[0]*c[0]+c[1]*c[1])}function Mg(c,s,d,m,_){if(!s[0]&&!s[1])return c;const E=ne.convert(s)._mult(_);d==="viewport"&&E._rotate(-m);const M=[];for(let D=0;Dc.width||_.height>c.height||d.x>c.width-_.width||d.y>c.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>s.width||_.height>s.height||m.x>s.width-_.width||m.y>s.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const M=c.data,D=s.data;if(M===D)throw new Error("srcData equals dstData, so image is already copied");for(let F=0;F<_.height;F++){const U=((d.y+F)*c.width+d.x)*E,X=((m.y+F)*s.width+m.x)*E;for(let re=0;re<_.width*E;re++)D[X+re]=M[U+re]}return s}class pp{constructor(s,d){R_(this,s,1,d)}resize(s){p5(this,s,1)}clone(){return new pp({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,d,m,_,E){O_(s,d,m,_,E,1)}}class ia{constructor(s,d){R_(this,s,4,d)}resize(s){p5(this,s,4)}replace(s,d){d?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new ia({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,d,m,_,E){O_(s,d,m,_,E,4)}}function m5(c){const s={},d=c.resolution||256,m=c.clips?c.clips.length:1,_=c.image||new ia({width:d,height:m});if(Math.log(d)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${d}`);const E=(M,D,F)=>{s[c.evaluationKey]=F;const U=c.expression.evaluate(s);_.data[M+D+0]=Math.floor(255*U.r/U.a),_.data[M+D+1]=Math.floor(255*U.g/U.a),_.data[M+D+2]=Math.floor(255*U.b/U.a),_.data[M+D+3]=Math.floor(255*U.a)};if(c.clips)for(let M=0,D=0;M80*d){m=E=c[0],_=M=c[1];for(var pe=d;peE&&(E=D),F>M&&(M=F);U=(U=Math.max(E-m,M-_))!==0?32767/U:0}return mp(ue,he,d,m,_,U,0),he}function v5(c,s,d,m,_){var E,M;if(_===z_(c,s,d,m)>0)for(E=s;E=s;E-=m)M=x5(E,c[E],c[E+1],M);return M&&Ag(M,M.next)&&(gp(M),M=M.next),M}function Ic(c,s){if(!c)return c;s||(s=c);var d,m=c;do if(d=!1,m.steiner||!Ag(m,m.next)&&ai(m.prev,m,m.next)!==0)m=m.next;else{if(gp(m),(m=s=m.prev)===m.next)break;d=!0}while(d||m!==s);return s}function mp(c,s,d,m,_,E,M){if(c){!M&&E&&function(X,re,ue,he){var pe=X;do pe.z===0&&(pe.z=A_(pe.x,pe.y,re,ue,he)),pe.prevZ=pe.prev,pe.nextZ=pe.next,pe=pe.next;while(pe!==X);pe.prevZ.nextZ=null,pe.prevZ=null,function(Oe){var Me,Ze,st,Ke,nt,kt,St,lr,hr=1;do{for(Ze=Oe,Oe=null,nt=null,kt=0;Ze;){for(kt++,st=Ze,St=0,Me=0;Me0||lr>0&&st;)St!==0&&(lr===0||!st||Ze.z<=st.z)?(Ke=Ze,Ze=Ze.nextZ,St--):(Ke=st,st=st.nextZ,lr--),nt?nt.nextZ=Ke:Oe=Ke,Ke.prevZ=nt,nt=Ke;Ze=st}nt.nextZ=null,hr*=2}while(kt>1)}(pe)}(c,m,_,E);for(var D,F,U=c;c.prev!==c.next;)if(D=c.prev,F=c.next,E?UF(c,m,_,E):jF(c))s.push(D.i/d|0),s.push(c.i/d|0),s.push(F.i/d|0),gp(c),c=F.next,U=F.next;else if((c=F)===U){M?M===1?mp(c=KF(Ic(c),s,d),s,d,m,_,E,2):M===2&&HF(c,s,d,m,_,E):mp(Ic(c),s,d,m,_,E,1);break}}}function jF(c){var s=c.prev,d=c,m=c.next;if(ai(s,d,m)>=0)return!1;for(var _=s.x,E=d.x,M=m.x,D=s.y,F=d.y,U=m.y,X=_E?_>M?_:M:E>M?E:M,he=D>F?D>U?D:U:F>U?F:U,pe=m.next;pe!==s;){if(pe.x>=X&&pe.x<=ue&&pe.y>=re&&pe.y<=he&&qd(_,D,E,F,M,U,pe.x,pe.y)&&ai(pe.prev,pe,pe.next)>=0)return!1;pe=pe.next}return!0}function UF(c,s,d,m){var _=c.prev,E=c,M=c.next;if(ai(_,E,M)>=0)return!1;for(var D=_.x,F=E.x,U=M.x,X=_.y,re=E.y,ue=M.y,he=DF?D>U?D:U:F>U?F:U,Me=X>re?X>ue?X:ue:re>ue?re:ue,Ze=A_(he,pe,s,d,m),st=A_(Oe,Me,s,d,m),Ke=c.prevZ,nt=c.nextZ;Ke&&Ke.z>=Ze&&nt&&nt.z<=st;){if(Ke.x>=he&&Ke.x<=Oe&&Ke.y>=pe&&Ke.y<=Me&&Ke!==_&&Ke!==M&&qd(D,X,F,re,U,ue,Ke.x,Ke.y)&&ai(Ke.prev,Ke,Ke.next)>=0||(Ke=Ke.prevZ,nt.x>=he&&nt.x<=Oe&&nt.y>=pe&&nt.y<=Me&&nt!==_&&nt!==M&&qd(D,X,F,re,U,ue,nt.x,nt.y)&&ai(nt.prev,nt,nt.next)>=0))return!1;nt=nt.nextZ}for(;Ke&&Ke.z>=Ze;){if(Ke.x>=he&&Ke.x<=Oe&&Ke.y>=pe&&Ke.y<=Me&&Ke!==_&&Ke!==M&&qd(D,X,F,re,U,ue,Ke.x,Ke.y)&&ai(Ke.prev,Ke,Ke.next)>=0)return!1;Ke=Ke.prevZ}for(;nt&&nt.z<=st;){if(nt.x>=he&&nt.x<=Oe&&nt.y>=pe&&nt.y<=Me&&nt!==_&&nt!==M&&qd(D,X,F,re,U,ue,nt.x,nt.y)&&ai(nt.prev,nt,nt.next)>=0)return!1;nt=nt.nextZ}return!0}function KF(c,s,d){var m=c;do{var _=m.prev,E=m.next.next;!Ag(_,E)&&g5(_,m,m.next,E)&&vp(_,E)&&vp(E,_)&&(s.push(_.i/d|0),s.push(m.i/d|0),s.push(E.i/d|0),gp(m),gp(m.next),m=c=E),m=m.next}while(m!==c);return Ic(m)}function HF(c,s,d,m,_,E){var M=c;do{for(var D=M.next.next;D!==M.prev;){if(M.i!==D.i&&XF(M,D)){var F=y5(M,D);return M=Ic(M,M.next),F=Ic(F,F.next),mp(M,s,d,m,_,E,0),void mp(F,s,d,m,_,E,0)}D=D.next}M=M.next}while(M!==c)}function WF(c,s){return c.x-s.x}function qF(c,s){var d=function(_,E){var M,D=E,F=_.x,U=_.y,X=-1/0;do{if(U<=D.y&&U>=D.next.y&&D.next.y!==D.y){var re=D.x+(U-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(re<=F&&re>X&&(X=re,M=D.x=D.x&&D.x>=pe&&F!==D.x&&qd(UM.x||D.x===M.x&&GF(M,D)))&&(M=D,Me=ue)),D=D.next;while(D!==he);return M}(c,s);if(!d)return s;var m=y5(d,c);return Ic(m,m.next),Ic(d,d.next)}function GF(c,s){return ai(c.prev,c,s.prev)<0&&ai(s.next,c,c.next)<0}function A_(c,s,d,m,_){return(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c=(c-d)*_|0)|c<<8))|c<<4))|c<<2))|c<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-m)*_|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function ZF(c){var s=c,d=c;do(s.x=(c-M)*(E-D)&&(c-M)*(m-D)>=(d-M)*(s-D)&&(d-M)*(E-D)>=(_-M)*(m-D)}function XF(c,s){return c.next.i!==s.i&&c.prev.i!==s.i&&!function(d,m){var _=d;do{if(_.i!==d.i&&_.next.i!==d.i&&_.i!==m.i&&_.next.i!==m.i&&g5(_,_.next,d,m))return!0;_=_.next}while(_!==d);return!1}(c,s)&&(vp(c,s)&&vp(s,c)&&function(d,m){var _=d,E=!1,M=(d.x+m.x)/2,D=(d.y+m.y)/2;do _.y>D!=_.next.y>D&&_.next.y!==_.y&&M<(_.next.x-_.x)*(D-_.y)/(_.next.y-_.y)+_.x&&(E=!E),_=_.next;while(_!==d);return E}(c,s)&&(ai(c.prev,c,s.prev)||ai(c,s.prev,s))||Ag(c,s)&&ai(c.prev,c,c.next)>0&&ai(s.prev,s,s.next)>0)}function ai(c,s,d){return(s.y-c.y)*(d.x-s.x)-(s.x-c.x)*(d.y-s.y)}function Ag(c,s){return c.x===s.x&&c.y===s.y}function g5(c,s,d,m){var _=zg(ai(c,s,d)),E=zg(ai(c,s,m)),M=zg(ai(d,m,c)),D=zg(ai(d,m,s));return _!==E&&M!==D||!(_!==0||!Ng(c,d,s))||!(E!==0||!Ng(c,m,s))||!(M!==0||!Ng(d,c,m))||!(D!==0||!Ng(d,s,m))}function Ng(c,s,d){return s.x<=Math.max(c.x,d.x)&&s.x>=Math.min(c.x,d.x)&&s.y<=Math.max(c.y,d.y)&&s.y>=Math.min(c.y,d.y)}function zg(c){return c>0?1:c<0?-1:0}function vp(c,s){return ai(c.prev,c,c.next)<0?ai(c,s,c.next)>=0&&ai(c,c.prev,s)>=0:ai(c,s,c.prev)<0||ai(c,c.next,s)<0}function y5(c,s){var d=new N_(c.i,c.x,c.y),m=new N_(s.i,s.x,s.y),_=c.next,E=s.prev;return c.next=s,s.prev=c,d.next=_,_.prev=d,m.next=d,d.prev=m,E.next=m,m.prev=E,m}function x5(c,s,d,m){var _=new N_(c,s,d);return m?(_.next=m.next,_.prev=m,m.next.prev=_,m.next=_):(_.prev=_,_.next=_),_}function gp(c){c.next.prev=c.prev,c.prev.next=c.next,c.prevZ&&(c.prevZ.nextZ=c.nextZ),c.nextZ&&(c.nextZ.prevZ=c.prevZ)}function N_(c,s,d){this.i=c,this.x=s,this.y=d,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function z_(c,s,d,m){for(var _=0,E=s,M=d-m;Ed;){if(m-d>600){var E=m-d+1,M=s-d+1,D=Math.log(E),F=.5*Math.exp(2*D/3),U=.5*Math.sqrt(D*F*(E-F)/E)*(M-E/2<0?-1:1);_5(c,s,Math.max(d,Math.floor(s-M*F/E+U)),Math.min(m,Math.floor(s+(E-M)*F/E+U)),_)}var X=c[s],re=d,ue=m;for(yp(c,d,s),_(c[m],X)>0&&yp(c,d,m);re0;)ue--}_(c[d],X)===0?yp(c,d,ue):yp(c,++ue,m),ue<=s&&(d=ue+1),s<=ue&&(m=ue-1)}}function yp(c,s,d){var m=c[s];c[s]=c[d],c[d]=m}function QF(c,s){return cs?1:0}function D_(c,s){const d=c.length;if(d<=1)return[c];const m=[];let _,E;for(let M=0;M1)for(let M=0;M0&&d.holes.push(m+=c[_-1].length)}return d};class $_{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(d=>d.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new pn,this.indexArray=new co,this.indexArray2=new ns,this.programConfigurations=new Tc(s.layers,s.zoom),this.segments=new Hr,this.segments2=new Hr,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){this.hasPattern=L_("fill",this.layers,d);const _=this.layers[0].layout.get("fill-sort-key"),E=!_.isConstant(),M=[];for(const{feature:D,id:F,index:U,sourceLayerIndex:X}of s){const re=this.layers[0]._featureFilter.needGeometry,ue=Mc(D,re);if(!this.layers[0]._featureFilter.filter(new zn(this.zoom),ue,m))continue;const he=E?_.evaluate(ue,{},m,d.availableImages):void 0,pe={id:F,properties:D.properties,type:D.type,sourceLayerIndex:X,index:U,geometry:re?ue.geometry:Pc(D),patterns:{},sortKey:he};M.push(pe)}E&&M.sort((D,F)=>D.sortKey-F.sortKey);for(const D of M){const{geometry:F,index:U,sourceLayerIndex:X}=D;if(this.hasPattern){const re=F_("fill",this.layers,D,this.zoom,d);this.patternFeatures.push(re)}else this.addFeature(D,F,U,m,{});d.featureIndex.insert(s[U].feature,F,U,X,this.index)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}addFeatures(s,d,m){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,d,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,VF),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),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(s,d,m,_,E){for(const M of D_(d,500)){let D=0;for(const he of M)D+=he.length;const F=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray),U=F.vertexLength,X=[],re=[];for(const he of M){if(he.length===0)continue;he!==M[0]&&re.push(X.length/2);const pe=this.segments2.prepareSegment(he.length,this.layoutVertexArray,this.indexArray2),Oe=pe.vertexLength;this.layoutVertexArray.emplaceBack(he[0].x,he[0].y),this.indexArray2.emplaceBack(Oe+he.length-1,Oe),X.push(he[0].x),X.push(he[0].y);for(let Me=1;Me>3}if(_--,m===1||m===2)E+=c.readSVarint(),M+=c.readSVarint(),m===1&&(s&&D.push(s),s=[]),s.push(new o$(E,M));else{if(m!==7)throw new Error("unknown command "+m);s&&s.push(s[0].clone())}}return s&&D.push(s),D},Gd.prototype.bbox=function(){var c=this._pbf;c.pos=this._geometry;for(var s=c.readVarint()+c.pos,d=1,m=0,_=0,E=0,M=1/0,D=-1/0,F=1/0,U=-1/0;c.pos>3}if(m--,d===1||d===2)(_+=c.readSVarint())D&&(D=_),(E+=c.readSVarint())U&&(U=E);else if(d!==7)throw new Error("unknown command "+d)}return[M,F,D,U]},Gd.prototype.toGeoJSON=function(c,s,d){var m,_,E=this.extent*Math.pow(2,d),M=this.extent*c,D=this.extent*s,F=this.loadGeometry(),U=Gd.types[this.type];function X(he){for(var pe=0;pe>3;_=M===1?m.readString():M===2?m.readFloat():M===3?m.readDouble():M===4?m.readVarint64():M===5?m.readVarint():M===6?m.readSVarint():M===7?m.readBoolean():null}return _}(d))}C5.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var s=this._pbf.readVarint()+this._pbf.pos;return new l$(this._pbf,s,this.extent,this._keys,this._values)};var c$=w5;function d$(c,s,d){if(c===3){var m=new c$(d,d.readVarint()+d.pos);m.length&&(s[m.name]=m)}}au.VectorTile=function(c,s){this.layers=c.readFields(d$,{},s)},au.VectorTileFeature=b5,au.VectorTileLayer=w5;const f$=au.VectorTileFeature.types,B_=Math.pow(2,13);function xp(c,s,d,m,_,E,M,D){c.emplaceBack(s,d,2*Math.floor(m*B_)+M,_*B_*2,E*B_*2,Math.round(D))}class V_{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(d=>d.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new Qr,this.centroidVertexArray=new _r,this.indexArray=new co,this.programConfigurations=new Tc(s.layers,s.zoom),this.segments=new Hr,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){this.features=[],this.hasPattern=L_("fill-extrusion",this.layers,d);for(const{feature:_,id:E,index:M,sourceLayerIndex:D}of s){const F=this.layers[0]._featureFilter.needGeometry,U=Mc(_,F);if(!this.layers[0]._featureFilter.filter(new zn(this.zoom),U,m))continue;const X={id:E,sourceLayerIndex:D,index:M,geometry:F?U.geometry:Pc(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(F_("fill-extrusion",this.layers,X,this.zoom,d)):this.addFeature(X,X.geometry,M,m,{}),d.featureIndex.insert(_,X.geometry,M,D,this.index,!0)}}addFeatures(s,d,m){for(const _ of this.features){const{geometry:E}=_;this.addFeature(_,E,_.index,d,m)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,i$),this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,n$.members,!0),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(s,d,m,_,E){const M={x:0,y:0,vertexCount:0};for(const D of D_(d,500)){let F=0;for(const pe of D)F+=pe.length;let U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const pe of D){if(pe.length===0||p$(pe))continue;let Oe=0;for(let Me=0;Me=1){const st=pe[Me-1];if(!h$(Ze,st)){U.vertexLength+4>Hr.MAX_VERTEX_ARRAY_LENGTH&&(U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ke=Ze.sub(st)._perp()._unit(),nt=st.dist(Ze);Oe+nt>32768&&(Oe=0),xp(this.layoutVertexArray,Ze.x,Ze.y,Ke.x,Ke.y,0,0,Oe),xp(this.layoutVertexArray,Ze.x,Ze.y,Ke.x,Ke.y,0,1,Oe),M.x+=2*Ze.x,M.y+=2*Ze.y,M.vertexCount+=2,Oe+=nt,xp(this.layoutVertexArray,st.x,st.y,Ke.x,Ke.y,0,0,Oe),xp(this.layoutVertexArray,st.x,st.y,Ke.x,Ke.y,0,1,Oe),M.x+=2*st.x,M.y+=2*st.y,M.vertexCount+=2;const kt=U.vertexLength;this.indexArray.emplaceBack(kt,kt+2,kt+1),this.indexArray.emplaceBack(kt+1,kt+2,kt+3),U.vertexLength+=4,U.primitiveLength+=2}}}}if(U.vertexLength+F>Hr.MAX_VERTEX_ARRAY_LENGTH&&(U=this.segments.prepareSegment(F,this.layoutVertexArray,this.indexArray)),f$[s.type]!=="Polygon")continue;const X=[],re=[],ue=U.vertexLength;for(const pe of D)if(pe.length!==0){pe!==D[0]&&re.push(X.length/2);for(let Oe=0;Oexi)||c.y===s.y&&(c.y<0||c.y>xi)}function p$(c){return c.every(s=>s.x<0)||c.every(s=>s.x>xi)||c.every(s=>s.y<0)||c.every(s=>s.y>xi)}dr("FillExtrusionBucket",V_,{omit:["layers","features"]});var m$={paint:new Li({"fill-extrusion-opacity":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Sr(Fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new nu(Fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Sr(Fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Sr(Fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function _p(c,s){return c.x*s.x+c.y*s.y}function S5(c,s){if(c.length===1){let d=0;const m=s[d++];let _;for(;!_||m.equals(_);)if(_=s[d++],!_)return 1/0;for(;dd.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(d=>{this.gradients[d.id]={}}),this.layoutVertexArray=new en,this.layoutVertexArray2=new gn,this.indexArray=new co,this.programConfigurations=new Tc(s.layers,s.zoom),this.segments=new Hr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){this.hasPattern=L_("line",this.layers,d);const _=this.layers[0].layout.get("line-sort-key"),E=!_.isConstant(),M=[];for(const{feature:D,id:F,index:U,sourceLayerIndex:X}of s){const re=this.layers[0]._featureFilter.needGeometry,ue=Mc(D,re);if(!this.layers[0]._featureFilter.filter(new zn(this.zoom),ue,m))continue;const he=E?_.evaluate(ue,{},m):void 0,pe={id:F,properties:D.properties,type:D.type,sourceLayerIndex:X,index:U,geometry:re?ue.geometry:Pc(D),patterns:{},sortKey:he};M.push(pe)}E&&M.sort((D,F)=>D.sortKey-F.sortKey);for(const D of M){const{geometry:F,index:U,sourceLayerIndex:X}=D;if(this.hasPattern){const re=F_("line",this.layers,D,this.zoom,d);this.patternFeatures.push(re)}else this.addFeature(D,F,U,m,{});d.featureIndex.insert(s[U].feature,F,U,X,this.index)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}addFeatures(s,d,m){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,d,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,x$)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,g$),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,d,m,_,E){const M=this.layers[0].layout,D=M.get("line-join").evaluate(s,{}),F=M.get("line-cap"),U=M.get("line-miter-limit"),X=M.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(const re of d)this.addLine(re,s,D,F,U,X);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,m,E,_)}addLine(s,d,m,_,E,M){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ze=0;Ze=2&&s[F-1].equals(s[F-2]);)F--;let U=0;for(;U0;if(lr&&Ze>U){const Ht=ue.dist(he);if(Ht>2*X){const tr=ue.sub(ue.sub(he)._mult(X/Ht)._round());this.updateDistance(he,tr),this.addCurrentVertex(tr,Oe,0,0,re),he=tr}}const er=he&&pe;let Zt=er?m:D?"butt":_;if(er&&Zt==="round"&&(ktE&&(Zt="bevel"),Zt==="bevel"&&(kt>2&&(Zt="flipbevel"),kt100)st=Me.mult(-1);else{const Ht=kt*Oe.add(Me).mag()/Oe.sub(Me).mag();st._perp()._mult(Ht*(hr?-1:1))}this.addCurrentVertex(ue,st,0,0,re),this.addCurrentVertex(ue,st.mult(-1),0,0,re)}else if(Zt==="bevel"||Zt==="fakeround"){const Ht=-Math.sqrt(kt*kt-1),tr=hr?Ht:0,Yt=hr?0:Ht;if(he&&this.addCurrentVertex(ue,Oe,tr,Yt,re),Zt==="fakeround"){const Ft=Math.round(180*St/Math.PI/20);for(let br=1;br2*X){const tr=ue.add(pe.sub(ue)._mult(X/Ht)._round());this.updateDistance(ue,tr),this.addCurrentVertex(tr,Me,0,0,re),ue=tr}}}}addCurrentVertex(s,d,m,_,E,M=!1){const D=d.y*_-d.x,F=-d.y-d.x*_;this.addHalfVertex(s,d.x+d.y*m,d.y-d.x*m,M,!1,m,E),this.addHalfVertex(s,D,F,M,!0,-_,E),this.distance>E5/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(s,d,m,_,E,M))}addHalfVertex({x:s,y:d},m,_,E,M,D,F){const U=.5*(this.lineClips?this.scaledDistance*(E5-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(E?1:0),(d<<1)+(M?1:0),Math.round(63*m)+128,Math.round(63*_)+128,1+(D===0?0:D<0?-1:1)|(63&U)<<2,U>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const X=F.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,X),F.primitiveLength++),M?this.e2=X:this.e1=X}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(s,d){this.distance+=s.dist(d),this.updateScaledDistance()}}dr("LineBucket",j_,{omit:["layers","patternFeatures"]});const w$=new Li({"line-cap":new pr(Fe.layout_line["line-cap"]),"line-join":new Sr(Fe.layout_line["line-join"]),"line-miter-limit":new pr(Fe.layout_line["line-miter-limit"]),"line-round-limit":new pr(Fe.layout_line["line-round-limit"]),"line-sort-key":new Sr(Fe.layout_line["line-sort-key"])});var k5={paint:new Li({"line-opacity":new Sr(Fe.paint_line["line-opacity"]),"line-color":new Sr(Fe.paint_line["line-color"]),"line-translate":new pr(Fe.paint_line["line-translate"]),"line-translate-anchor":new pr(Fe.paint_line["line-translate-anchor"]),"line-width":new Sr(Fe.paint_line["line-width"]),"line-gap-width":new Sr(Fe.paint_line["line-gap-width"]),"line-offset":new Sr(Fe.paint_line["line-offset"]),"line-blur":new Sr(Fe.paint_line["line-blur"]),"line-dasharray":new sp(Fe.paint_line["line-dasharray"]),"line-pattern":new nu(Fe.paint_line["line-pattern"]),"line-gradient":new Ms(Fe.paint_line["line-gradient"])}),layout:w$};const T5=new class extends Sr{possiblyEvaluate(c,s){return s=new zn(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(c,s)}evaluate(c,s,d,m){return s=T({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(c,s,d,m)}}(k5.paint.properties["line-width"].specification);function P5(c,s){return s>0?s+2*c:c}T5.useIntegerZoom=!0;const C$=ci([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),S$=ci([{name:"a_projected_pos",components:3,type:"Float32"}],4);ci([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const E$=ci([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);ci([{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 M5=ci([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),k$=ci([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function T$(c,s,d){return c.sections.forEach(m=>{m.text=function(_,E,M){const D=E.layout.get("text-transform").evaluate(M,{});return D==="uppercase"?_=_.toLocaleUpperCase():D==="lowercase"&&(_=_.toLocaleLowerCase()),jo.applyArabicShaping&&(_=jo.applyArabicShaping(_)),_}(m.text,s,d)}),c}ci([{name:"triangle",components:3,type:"Uint16"}]),ci([{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"}]),ci([{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"}]),ci([{type:"Float32",name:"offsetX"}]),ci([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const bp={"!":"\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 Fi=24,U_=_n,I5=function(c,s,d,m,_){var E,M,D=8*_-m-1,F=(1<>1,X=-7,re=d?_-1:0,ue=d?-1:1,he=c[s+re];for(re+=ue,E=he&(1<<-X)-1,he>>=-X,X+=D;X>0;E=256*E+c[s+re],re+=ue,X-=8);for(M=E&(1<<-X)-1,E>>=-X,X+=m;X>0;M=256*M+c[s+re],re+=ue,X-=8);if(E===0)E=1-U;else{if(E===F)return M?NaN:1/0*(he?-1:1);M+=Math.pow(2,m),E-=U}return(he?-1:1)*M*Math.pow(2,E-m)},R5=function(c,s,d,m,_,E){var M,D,F,U=8*E-_-1,X=(1<>1,ue=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,he=m?0:E-1,pe=m?1:-1,Oe=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(D=isNaN(s)?1:0,M=X):(M=Math.floor(Math.log(s)/Math.LN2),s*(F=Math.pow(2,-M))<1&&(M--,F*=2),(s+=M+re>=1?ue/F:ue*Math.pow(2,1-re))*F>=2&&(M++,F/=2),M+re>=X?(D=0,M=X):M+re>=1?(D=(s*F-1)*Math.pow(2,_),M+=re):(D=s*Math.pow(2,re-1)*Math.pow(2,_),M=0));_>=8;c[d+he]=255&D,he+=pe,D/=256,_-=8);for(M=M<<_|D,U+=_;U>0;c[d+he]=255&M,he+=pe,M/=256,U-=8);c[d+he-pe]|=128*Oe};function _n(c){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(c)?c:new Uint8Array(c||0),this.pos=0,this.type=0,this.length=this.buf.length}_n.Varint=0,_n.Fixed64=1,_n.Bytes=2,_n.Fixed32=5;var su,K_=4294967296,O5=1/K_,A5=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function cl(c){return c.type===_n.Bytes?c.readVarint()+c.pos:c.pos+1}function Zd(c,s,d){return d?4294967296*s+(c>>>0):4294967296*(s>>>0)+(c>>>0)}function N5(c,s,d){var m=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));d.realloc(m);for(var _=d.pos-1;_>=c;_--)d.buf[_+m]=d.buf[_]}function P$(c,s){for(var d=0;d>>8,c[d+2]=s>>>16,c[d+3]=s>>>24}function z5(c,s){return(c[s]|c[s+1]<<8|c[s+2]<<16)+(c[s+3]<<24)}function L$(c,s,d){c===1&&d.readMessage(F$,s)}function F$(c,s,d){if(c===3){const{id:m,bitmap:_,width:E,height:M,left:D,top:F,advance:U}=d.readMessage($$,{});s.push({id:m,bitmap:new pp({width:E+6,height:M+6},_),metrics:{width:E,height:M,left:D,top:F,advance:U}})}}function $$(c,s,d){c===1?s.id=d.readVarint():c===2?s.bitmap=d.readBytes():c===3?s.width=d.readVarint():c===4?s.height=d.readVarint():c===5?s.left=d.readSVarint():c===6?s.top=d.readSVarint():c===7&&(s.advance=d.readVarint())}function D5(c){let s=0,d=0;for(const M of c)s+=M.w*M.h,d=Math.max(d,M.w);c.sort((M,D)=>D.h-M.h);const m=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),d),h:1/0}];let _=0,E=0;for(const M of c)for(let D=m.length-1;D>=0;D--){const F=m[D];if(!(M.w>F.w||M.h>F.h)){if(M.x=F.x,M.y=F.y,E=Math.max(E,M.y+M.h),_=Math.max(_,M.x+M.w),M.w===F.w&&M.h===F.h){const U=m.pop();D>3,E=this.pos;this.type=7&m,c(_,s,this),this.pos===E&&this.skip(m)}return s},readMessage:function(c,s){return this.readFields(c,s,this.readVarint()+this.pos)},readFixed32:function(){var c=Dg(this.buf,this.pos);return this.pos+=4,c},readSFixed32:function(){var c=z5(this.buf,this.pos);return this.pos+=4,c},readFixed64:function(){var c=Dg(this.buf,this.pos)+Dg(this.buf,this.pos+4)*K_;return this.pos+=8,c},readSFixed64:function(){var c=Dg(this.buf,this.pos)+z5(this.buf,this.pos+4)*K_;return this.pos+=8,c},readFloat:function(){var c=I5(this.buf,this.pos,!0,23,4);return this.pos+=4,c},readDouble:function(){var c=I5(this.buf,this.pos,!0,52,8);return this.pos+=8,c},readVarint:function(c){var s,d,m=this.buf;return s=127&(d=m[this.pos++]),d<128?s:(s|=(127&(d=m[this.pos++]))<<7,d<128?s:(s|=(127&(d=m[this.pos++]))<<14,d<128?s:(s|=(127&(d=m[this.pos++]))<<21,d<128?s:function(_,E,M){var D,F,U=M.buf;if(D=(112&(F=U[M.pos++]))>>4,F<128||(D|=(127&(F=U[M.pos++]))<<3,F<128)||(D|=(127&(F=U[M.pos++]))<<10,F<128)||(D|=(127&(F=U[M.pos++]))<<17,F<128)||(D|=(127&(F=U[M.pos++]))<<24,F<128)||(D|=(1&(F=U[M.pos++]))<<31,F<128))return Zd(_,D,E);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(d=m[this.pos]))<<28,c,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var c=this.readVarint();return c%2==1?(c+1)/-2:c/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var c=this.readVarint()+this.pos,s=this.pos;return this.pos=c,c-s>=12&&A5?function(d,m,_){return A5.decode(d.subarray(m,_))}(this.buf,s,c):function(d,m,_){for(var E="",M=m;M<_;){var D,F,U,X=d[M],re=null,ue=X>239?4:X>223?3:X>191?2:1;if(M+ue>_)break;ue===1?X<128&&(re=X):ue===2?(192&(D=d[M+1]))==128&&(re=(31&X)<<6|63&D)<=127&&(re=null):ue===3?(F=d[M+2],(192&(D=d[M+1]))==128&&(192&F)==128&&((re=(15&X)<<12|(63&D)<<6|63&F)<=2047||re>=55296&&re<=57343)&&(re=null)):ue===4&&(F=d[M+2],U=d[M+3],(192&(D=d[M+1]))==128&&(192&F)==128&&(192&U)==128&&((re=(15&X)<<18|(63&D)<<12|(63&F)<<6|63&U)<=65535||re>=1114112)&&(re=null)),re===null?(re=65533,ue=1):re>65535&&(re-=65536,E+=String.fromCharCode(re>>>10&1023|55296),re=56320|1023&re),E+=String.fromCharCode(re),M+=ue}return E}(this.buf,s,c)},readBytes:function(){var c=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,c);return this.pos=c,s},readPackedVarint:function(c,s){if(this.type!==_n.Bytes)return c.push(this.readVarint(s));var d=cl(this);for(c=c||[];this.pos127;);else if(s===_n.Bytes)this.pos=this.readVarint()+this.pos;else if(s===_n.Fixed32)this.pos+=4;else{if(s!==_n.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(c,s){this.writeVarint(c<<3|s)},realloc:function(c){for(var s=this.length||16;s268435455||c<0?function(s,d){var m,_;if(s>=0?(m=s%4294967296|0,_=s/4294967296|0):(_=~(-s/4294967296),4294967295^(m=~(-s%4294967296))?m=m+1|0:(m=0,_=_+1|0)),s>=18446744073709552e3||s<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");d.realloc(10),function(E,M,D){D.buf[D.pos++]=127&E|128,E>>>=7,D.buf[D.pos++]=127&E|128,E>>>=7,D.buf[D.pos++]=127&E|128,E>>>=7,D.buf[D.pos++]=127&E|128,D.buf[D.pos]=127&(E>>>=7)}(m,0,d),function(E,M){var D=(7&E)<<4;M.buf[M.pos++]|=D|((E>>>=3)?128:0),E&&(M.buf[M.pos++]=127&E|((E>>>=7)?128:0),E&&(M.buf[M.pos++]=127&E|((E>>>=7)?128:0),E&&(M.buf[M.pos++]=127&E|((E>>>=7)?128:0),E&&(M.buf[M.pos++]=127&E|((E>>>=7)?128:0),E&&(M.buf[M.pos++]=127&E)))))}(_,d)}(c,this):(this.realloc(4),this.buf[this.pos++]=127&c|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=c>>>7&127))))},writeSVarint:function(c){this.writeVarint(c<0?2*-c-1:2*c)},writeBoolean:function(c){this.writeVarint(Boolean(c))},writeString:function(c){c=String(c),this.realloc(4*c.length),this.pos++;var s=this.pos;this.pos=function(m,_,E){for(var M,D,F=0;F<_.length;F++){if((M=_.charCodeAt(F))>55295&&M<57344){if(!D){M>56319||F+1===_.length?(m[E++]=239,m[E++]=191,m[E++]=189):D=M;continue}if(M<56320){m[E++]=239,m[E++]=191,m[E++]=189,D=M;continue}M=D-55296<<10|M-56320|65536,D=null}else D&&(m[E++]=239,m[E++]=191,m[E++]=189,D=null);M<128?m[E++]=M:(M<2048?m[E++]=M>>6|192:(M<65536?m[E++]=M>>12|224:(m[E++]=M>>18|240,m[E++]=M>>12&63|128),m[E++]=M>>6&63|128),m[E++]=63&M|128)}return E}(this.buf,c,this.pos);var d=this.pos-s;d>=128&&N5(s,d,this),this.pos=s-1,this.writeVarint(d),this.pos+=d},writeFloat:function(c){this.realloc(4),R5(this.buf,c,this.pos,!0,23,4),this.pos+=4},writeDouble:function(c){this.realloc(8),R5(this.buf,c,this.pos,!0,52,8),this.pos+=8},writeBytes:function(c){var s=c.length;this.writeVarint(s),this.realloc(s);for(var d=0;d=128&&N5(d,m,this),this.pos=d-1,this.writeVarint(m),this.pos+=m},writeMessage:function(c,s,d){this.writeTag(c,_n.Bytes),this.writeRawMessage(s,d)},writePackedVarint:function(c,s){s.length&&this.writeMessage(c,P$,s)},writePackedSVarint:function(c,s){s.length&&this.writeMessage(c,M$,s)},writePackedBoolean:function(c,s){s.length&&this.writeMessage(c,O$,s)},writePackedFloat:function(c,s){s.length&&this.writeMessage(c,I$,s)},writePackedDouble:function(c,s){s.length&&this.writeMessage(c,R$,s)},writePackedFixed32:function(c,s){s.length&&this.writeMessage(c,A$,s)},writePackedSFixed32:function(c,s){s.length&&this.writeMessage(c,N$,s)},writePackedFixed64:function(c,s){s.length&&this.writeMessage(c,z$,s)},writePackedSFixed64:function(c,s){s.length&&this.writeMessage(c,D$,s)},writeBytesField:function(c,s){this.writeTag(c,_n.Bytes),this.writeBytes(s)},writeFixed32Field:function(c,s){this.writeTag(c,_n.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(c,s){this.writeTag(c,_n.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(c,s){this.writeTag(c,_n.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(c,s){this.writeTag(c,_n.Fixed64),this.writeSFixed64(s)},writeVarintField:function(c,s){this.writeTag(c,_n.Varint),this.writeVarint(s)},writeSVarintField:function(c,s){this.writeTag(c,_n.Varint),this.writeSVarint(s)},writeStringField:function(c,s){this.writeTag(c,_n.Bytes),this.writeString(s)},writeFloatField:function(c,s){this.writeTag(c,_n.Fixed32),this.writeFloat(s)},writeDoubleField:function(c,s){this.writeTag(c,_n.Fixed64),this.writeDouble(s)},writeBooleanField:function(c,s){this.writeVarintField(c,Boolean(s))}};class H_{constructor(s,{pixelRatio:d,version:m,stretchX:_,stretchY:E,content:M}){this.paddedRect=s,this.pixelRatio=d,this.stretchX=_,this.stretchY=E,this.content=M,this.version=m}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 L5{constructor(s,d){const m={},_={};this.haveRenderCallbacks=[];const E=[];this.addImages(s,m,E),this.addImages(d,_,E);const{w:M,h:D}=D5(E),F=new ia({width:M||1,height:D||1});for(const U in s){const X=s[U],re=m[U].paddedRect;ia.copy(X.data,F,{x:0,y:0},{x:re.x+1,y:re.y+1},X.data)}for(const U in d){const X=d[U],re=_[U].paddedRect,ue=re.x+1,he=re.y+1,pe=X.data.width,Oe=X.data.height;ia.copy(X.data,F,{x:0,y:0},{x:ue,y:he},X.data),ia.copy(X.data,F,{x:0,y:Oe-1},{x:ue,y:he-1},{width:pe,height:1}),ia.copy(X.data,F,{x:0,y:0},{x:ue,y:he+Oe},{width:pe,height:1}),ia.copy(X.data,F,{x:pe-1,y:0},{x:ue-1,y:he},{width:1,height:Oe}),ia.copy(X.data,F,{x:0,y:0},{x:ue+pe,y:he},{width:1,height:Oe})}this.image=F,this.iconPositions=m,this.patternPositions=_}addImages(s,d,m){for(const _ in s){const E=s[_],M={x:0,y:0,w:E.data.width+2,h:E.data.height+2};m.push(M),d[_]=new H_(M,E),E.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(s,d){s.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const m in s.updatedImages)this.patchUpdatedImage(this.iconPositions[m],s.getImage(m),d),this.patchUpdatedImage(this.patternPositions[m],s.getImage(m),d)}patchUpdatedImage(s,d,m){if(!s||!d||s.version===d.version)return;s.version=d.version;const[_,E]=s.tl;m.update(d.data,void 0,{x:_,y:E})}}dr("ImagePosition",H_),dr("ImageAtlas",L5),o.WritingMode=void 0,(su=o.WritingMode||(o.WritingMode={}))[su.none=0]="none",su[su.horizontal=1]="horizontal",su[su.vertical=2]="vertical",su[su.horizontalOnly=3]="horizontalOnly";const Lg=-17;class wp{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(s,d){const m=new wp;return m.scale=s||1,m.fontStack=d,m}static forImage(s){const d=new wp;return d.imageName=s,d}}class Yd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(s,d){const m=new Yd;for(let _=0;_=0&&m>=s&&$g[this.text.charCodeAt(m)];m--)d--;this.text=this.text.substring(s,d),this.sectionIndex=this.sectionIndex.slice(s,d)}substring(s,d){const m=new Yd;return m.text=this.text.substring(s,d),m.sectionIndex=this.sectionIndex.slice(s,d),m.sections=this.sections,m}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,d)=>Math.max(s,this.sections[d].scale),0)}addTextSection(s,d){this.text+=s.text,this.sections.push(wp.forText(s.scale,s.fontStack||d));const m=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Fg(c,s,d,m,_,E,M,D,F,U,X,re,ue,he,pe,Oe){const Me=Yd.fromFeature(c,_);let Ze;re===o.WritingMode.vertical&&Me.verticalizePunctuation();const{processBidirectionalText:st,processStyledBidirectionalText:Ke}=jo;if(st&&Me.sections.length===1){Ze=[];const St=st(Me.toString(),W_(Me,U,E,s,m,he,pe));for(const lr of St){const hr=new Yd;hr.text=lr,hr.sections=Me.sections;for(let er=0;er0&&hl>To&&(To=hl)}else{const sa=hr[Wr.fontStack],Po=sa&&sa[qi];if(Po&&Po.rect)os=Po.rect,Ma=Po.metrics;else{const hl=lr[Wr.fontStack],Ep=hl&&hl[qi];if(!Ep)continue;Ma=Ep.metrics}ro=(Wi-Wr.scale)*Fi}Ia?(St.verticalizable=!0,ko.push({glyph:qi,imageName:as,x:Mn,y:Ln+ro,vertical:Ia,scale:Wr.scale,fontStack:Wr.fontStack,sectionIndex:Ho,metrics:Ma,rect:os}),Mn+=fl*Wr.scale+br):(ko.push({glyph:qi,imageName:as,x:Mn,y:Ln+ro,vertical:Ia,scale:Wr.scale,fontStack:Wr.fontStack,sectionIndex:Ho,metrics:Ma,rect:os}),Mn+=Ma.advance*Wr.scale+br)}ko.length!==0&&(_i=Math.max(Mn-br,_i),j$(ko,0,ko.length-1,Ki,To)),Mn=0;const Un=Ht*Wi+To;po.lineOffset=Math.max(To,to),Ln+=Un,aa=Math.max(Un,aa),++di}var Pi;const Hi=Ln-Lg,{horizontalAlign:eo,verticalAlign:Eo}=q_(tr);(function(fi,Wi,to,po,ko,To,Un,Mi,Wr){const Ho=(Wi-to)*ko;let qi=0;qi=To!==Un?-Mi*po-Lg:(-po*Wr+.5)*Un;for(const ro of fi)for(const Ma of ro.positionedGlyphs)Ma.x+=Ho,Ma.y+=qi})(St.positionedLines,Ki,eo,Eo,_i,aa,Ht,Hi,Zt.length),St.top+=-Eo*Hi,St.bottom=St.top+Hi,St.left+=-eo*_i,St.right=St.left+_i}(kt,s,d,m,Ze,M,D,F,re,U,ue,Oe),!function(St){for(const lr of St)if(lr.positionedGlyphs.length!==0)return!1;return!0}(nt)&&kt}const $g={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},B$={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 F5(c,s,d,m,_,E){if(s.imageName){const M=m[s.imageName];return M?M.displaySize[0]*s.scale*Fi/E+_:0}{const M=d[s.fontStack],D=M&&M[c];return D?D.metrics.advance*s.scale+_:0}}function $5(c,s,d,m){const _=Math.pow(c-s,2);return m?c=0;let X=0;for(let ue=0;ue-d/2;){if(M--,M<0)return!1;D-=c[M].dist(E),E=c[M]}D+=c[M].dist(c[M+1]),M++;const F=[];let U=0;for(;Dm;)U-=F.shift().angleDelta;if(U>_)return!1;M++,D+=X.dist(re)}return!0}function H5(c){let s=0;for(let d=0;dU){const pe=(U-F)/he,Oe=xn(re.x,ue.x,pe),Me=xn(re.y,ue.y,pe),Ze=new lu(Oe,Me,ue.angleTo(re),X);return Ze._round(),!M||K5(c,Ze,D,M,s)?Ze:void 0}F+=he}}function H$(c,s,d,m,_,E,M,D,F){const U=W5(m,E,M),X=q5(m,_),re=X*M,ue=c[0].x===0||c[0].x===F||c[0].y===0||c[0].y===F;return s-re=0&&nt=0&&kt=0&&ue+U<=X){const St=new lu(nt,kt,st,pe);St._round(),m&&!K5(c,St,E,m,_)||he.push(St)}}re+=Ze}return D||he.length||M||(he=G5(c,re/2,d,m,_,E,M,!0,F)),he}function Z5(c,s,d,m,_){const E=[];for(let M=0;M=m&&re.x>=m||(X.x>=m?X=new ne(m,X.y+(m-X.x)/(re.x-X.x)*(re.y-X.y))._round():re.x>=m&&(re=new ne(m,X.y+(m-X.x)/(re.x-X.x)*(re.y-X.y))._round()),X.y>=_&&re.y>=_||(X.y>=_?X=new ne(X.x+(_-X.y)/(re.y-X.y)*(re.x-X.x),_)._round():re.y>=_&&(re=new ne(X.x+(_-X.y)/(re.y-X.y)*(re.x-X.x),_)._round()),F&&X.equals(F[F.length-1])||(F=[X],E.push(F)),F.push(re)))))}}return E}function X5(c,s,d,m){const _=[],E=c.image,M=E.pixelRatio,D=E.paddedRect.w-2,F=E.paddedRect.h-2,U=c.right-c.left,X=c.bottom-c.top,re=E.stretchX||[[0,D]],ue=E.stretchY||[[0,F]],he=(Ht,tr)=>Ht+tr[1]-tr[0],pe=re.reduce(he,0),Oe=ue.reduce(he,0),Me=D-pe,Ze=F-Oe;let st=0,Ke=pe,nt=0,kt=Oe,St=0,lr=Me,hr=0,er=Ze;if(E.content&&m){const Ht=E.content;st=Bg(re,0,Ht[0]),nt=Bg(ue,0,Ht[1]),Ke=Bg(re,Ht[0],Ht[2]),kt=Bg(ue,Ht[1],Ht[3]),St=Ht[0]-st,hr=Ht[1]-nt,lr=Ht[2]-Ht[0]-Ke,er=Ht[3]-Ht[1]-kt}const Zt=(Ht,tr,Yt,Ft)=>{const br=Vg(Ht.stretch-st,Ke,U,c.left),mr=jg(Ht.fixed-St,lr,Ht.stretch,pe),jr=Vg(tr.stretch-nt,kt,X,c.top),Mn=jg(tr.fixed-hr,er,tr.stretch,Oe),Ln=Vg(Yt.stretch-st,Ke,U,c.left),_i=jg(Yt.fixed-St,lr,Yt.stretch,pe),aa=Vg(Ft.stretch-nt,kt,X,c.top),Ki=jg(Ft.fixed-hr,er,Ft.stretch,Oe),di=new ne(br,jr),Pi=new ne(Ln,jr),Hi=new ne(Ln,aa),eo=new ne(br,aa),Eo=new ne(mr/M,Mn/M),fi=new ne(_i/M,Ki/M),Wi=s*Math.PI/180;if(Wi){const ko=Math.sin(Wi),To=Math.cos(Wi),Un=[To,-ko,ko,To];di._matMult(Un),Pi._matMult(Un),eo._matMult(Un),Hi._matMult(Un)}const to=Ht.stretch+Ht.fixed,po=tr.stretch+tr.fixed;return{tl:di,tr:Pi,bl:eo,br:Hi,tex:{x:E.paddedRect.x+1+to,y:E.paddedRect.y+1+po,w:Yt.stretch+Yt.fixed-to,h:Ft.stretch+Ft.fixed-po},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Eo,pixelOffsetBR:fi,minFontScaleX:lr/M/U,minFontScaleY:er/M/X,isSDF:d}};if(m&&(E.stretchX||E.stretchY)){const Ht=Y5(re,Me,pe),tr=Y5(ue,Ze,Oe);for(let Yt=0;Yt0&&(pe=Math.max(10,pe),this.circleDiameter=pe)}else{let re=M.top*D-F[0],ue=M.bottom*D+F[2],he=M.left*D-F[3],pe=M.right*D+F[1];const Oe=M.collisionPadding;if(Oe&&(he-=Oe[0]*D,re-=Oe[1]*D,pe+=Oe[2]*D,ue+=Oe[3]*D),X){const Me=new ne(he,re),Ze=new ne(pe,re),st=new ne(he,ue),Ke=new ne(pe,ue),nt=X*Math.PI/180;Me._rotate(nt),Ze._rotate(nt),st._rotate(nt),Ke._rotate(nt),he=Math.min(Me.x,Ze.x,st.x,Ke.x),pe=Math.max(Me.x,Ze.x,st.x,Ke.x),re=Math.min(Me.y,Ze.y,st.y,Ke.y),ue=Math.max(Me.y,Ze.y,st.y,Ke.y)}s.emplaceBack(d.x,d.y,he,re,pe,ue,m,_,E)}this.boxEndIndex=s.length}}class W${constructor(s=[],d=q$){if(this.data=s,this.length=this.data.length,this.compare=d,this.length>0)for(let m=(this.length>>1)-1;m>=0;m--)this._down(m)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const s=this.data[0],d=this.data.pop();return this.length--,this.length>0&&(this.data[0]=d,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:d,compare:m}=this,_=d[s];for(;s>0;){const E=s-1>>1,M=d[E];if(m(_,M)>=0)break;d[s]=M,s=E}d[s]=_}_down(s){const{data:d,compare:m}=this,_=this.length>>1,E=d[s];for(;s<_;){let M=1+(s<<1),D=d[M];const F=M+1;if(F=0)break;d[s]=D,s=M}d[s]=E}}function q$(c,s){return cs?1:0}function G$(c,s=1,d=!1){let m=1/0,_=1/0,E=-1/0,M=-1/0;const D=c[0];for(let he=0;heE)&&(E=pe.x),(!he||pe.y>M)&&(M=pe.y)}const F=Math.min(E-m,M-_);let U=F/2;const X=new W$([],Z$);if(F===0)return new ne(m,_);for(let he=m;here.d||!re.d)&&(re=he,d&&console.log("found best %d after %d probes",Math.round(1e4*he.d)/1e4,ue)),he.max-re.d<=s||(U=he.h/2,X.push(new Qd(he.p.x-U,he.p.y-U,U,c)),X.push(new Qd(he.p.x+U,he.p.y-U,U,c)),X.push(new Qd(he.p.x-U,he.p.y+U,U,c)),X.push(new Qd(he.p.x+U,he.p.y+U,U,c)),ue+=4)}return d&&(console.log(`num probes: ${ue}`),console.log(`best distance: ${re.d}`)),re.p}function Z$(c,s){return s.max-c.max}function Qd(c,s,d,m){this.p=new ne(c,s),this.h=d,this.d=function(_,E){let M=!1,D=1/0;for(let F=0;F_.y!=pe.y>_.y&&_.x<(pe.x-he.x)*(_.y-he.y)/(pe.y-he.y)+he.x&&(M=!M),D=Math.min(D,o5(_,he,pe))}}return(M?1:-1)*Math.sqrt(D)}(this.p,m),this.max=this.d+this.h*Math.SQRT2}const G_=Number.POSITIVE_INFINITY;function Q5(c,s){return s[1]!==G_?function(d,m,_){let E=0,M=0;switch(m=Math.abs(m),_=Math.abs(_),d){case"top-right":case"top-left":case"top":M=_-7;break;case"bottom-right":case"bottom-left":case"bottom":M=7-_}switch(d){case"top-right":case"bottom-right":case"right":E=-m;break;case"top-left":case"bottom-left":case"left":E=m}return[E,M]}(c,s[0],s[1]):function(d,m){let _=0,E=0;m<0&&(m=0);const M=m/Math.sqrt(2);switch(d){case"top-right":case"top-left":E=M-7;break;case"bottom-right":case"bottom-left":E=7-M;break;case"bottom":E=7-m;break;case"top":E=m-7}switch(d){case"top-right":case"bottom-right":_=-M;break;case"top-left":case"bottom-left":_=M;break;case"left":_=m;break;case"right":_=-m}return[_,E]}(c,s[0])}function Z_(c){switch(c){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function X$(c,s,d,m,_,E,M,D,F,U,X){let re=E.textMaxSize.evaluate(s,{});re===void 0&&(re=M);const ue=c.layers[0].layout,he=ue.get("icon-offset").evaluate(s,{},X),pe=e6(d.horizontal),Oe=M/24,Me=c.tilePixelRatio*Oe,Ze=c.tilePixelRatio*re/24,st=c.tilePixelRatio*D,Ke=c.tilePixelRatio*ue.get("symbol-spacing"),nt=ue.get("text-padding")*c.tilePixelRatio,kt=function(Ft,br,mr,jr=1){const Mn=Ft.get("icon-padding").evaluate(br,{},mr),Ln=Mn&&Mn.values;return[Ln[0]*jr,Ln[1]*jr,Ln[2]*jr,Ln[3]*jr]}(ue,s,X,c.tilePixelRatio),St=ue.get("text-max-angle")/180*Math.PI,lr=ue.get("text-rotation-alignment")!=="viewport"&&ue.get("symbol-placement")!=="point",hr=ue.get("icon-rotation-alignment")==="map"&&ue.get("symbol-placement")!=="point",er=ue.get("symbol-placement"),Zt=Ke/2,Ht=ue.get("icon-text-fit");let tr;m&&Ht!=="none"&&(c.allowVerticalPlacement&&d.vertical&&(tr=j5(m,d.vertical,Ht,ue.get("icon-text-fit-padding"),he,Oe)),pe&&(m=j5(m,pe,Ht,ue.get("icon-text-fit-padding"),he,Oe)));const Yt=(Ft,br)=>{br.x<0||br.x>=xi||br.y<0||br.y>=xi||function(mr,jr,Mn,Ln,_i,aa,Ki,di,Pi,Hi,eo,Eo,fi,Wi,to,po,ko,To,Un,Mi,Wr,Ho,qi,ro,Ma){const os=mr.addToLineVertexArray(jr,Mn);let as,fl,Ia,sa,Po=0,hl=0,Ep=0,v6=0,ob=-1,ab=-1;const pl={};let g6=Ti.exports(""),sb=0,lb=0;if(di._unevaluatedLayout.getValue("text-radial-offset")===void 0?[sb,lb]=di.layout.get("text-offset").evaluate(Wr,{},ro).map(Mo=>Mo*Fi):(sb=di.layout.get("text-radial-offset").evaluate(Wr,{},ro)*Fi,lb=G_),mr.allowVerticalPlacement&&Ln.vertical){const Mo=di.layout.get("text-rotate").evaluate(Wr,{},ro)+90;Ia=new Ug(Pi,jr,Hi,eo,Eo,Ln.vertical,fi,Wi,to,Mo),Ki&&(sa=new Ug(Pi,jr,Hi,eo,Eo,Ki,ko,To,to,Mo))}if(_i){const Mo=di.layout.get("icon-rotate").evaluate(Wr,{}),Ns=di.layout.get("icon-text-fit")!=="none",kp=X5(_i,Mo,qi,Ns),Tp=Ki?X5(Ki,Mo,qi,Ns):void 0;fl=new Ug(Pi,jr,Hi,eo,Eo,_i,ko,To,!1,Mo),Po=4*kp.length;const _6=mr.iconSizeData;let Oc=null;_6.kind==="source"?(Oc=[dl*di.layout.get("icon-size").evaluate(Wr,{})],Oc[0]>uu&&B(`${mr.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):_6.kind==="composite"&&(Oc=[dl*Ho.compositeIconSizes[0].evaluate(Wr,{},ro),dl*Ho.compositeIconSizes[1].evaluate(Wr,{},ro)],(Oc[0]>uu||Oc[1]>uu)&&B(`${mr.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),mr.addSymbols(mr.icon,kp,Oc,Mi,Un,Wr,o.WritingMode.none,jr,os.lineStartIndex,os.lineLength,-1,ro),ob=mr.icon.placedSymbolArray.length-1,Tp&&(hl=4*Tp.length,mr.addSymbols(mr.icon,Tp,Oc,Mi,Un,Wr,o.WritingMode.vertical,jr,os.lineStartIndex,os.lineLength,-1,ro),ab=mr.icon.placedSymbolArray.length-1)}const y6=Object.keys(Ln.horizontal);for(const Mo of y6){const Ns=Ln.horizontal[Mo];if(!as){g6=Ti.exports(Ns.text);const Tp=di.layout.get("text-rotate").evaluate(Wr,{},ro);as=new Ug(Pi,jr,Hi,eo,Eo,Ns,fi,Wi,to,Tp)}const kp=Ns.positionedLines.length===1;if(Ep+=J5(mr,jr,Ns,aa,di,to,Wr,po,os,Ln.vertical?o.WritingMode.horizontal:o.WritingMode.horizontalOnly,kp?y6:[Mo],pl,ob,Ho,ro),kp)break}Ln.vertical&&(v6+=J5(mr,jr,Ln.vertical,aa,di,to,Wr,po,os,o.WritingMode.vertical,["vertical"],pl,ab,Ho,ro));const uB=as?as.boxStartIndex:mr.collisionBoxArray.length,cB=as?as.boxEndIndex:mr.collisionBoxArray.length,dB=Ia?Ia.boxStartIndex:mr.collisionBoxArray.length,fB=Ia?Ia.boxEndIndex:mr.collisionBoxArray.length,hB=fl?fl.boxStartIndex:mr.collisionBoxArray.length,pB=fl?fl.boxEndIndex:mr.collisionBoxArray.length,mB=sa?sa.boxStartIndex:mr.collisionBoxArray.length,vB=sa?sa.boxEndIndex:mr.collisionBoxArray.length;let ss=-1;const Gg=(Mo,Ns)=>Mo&&Mo.circleDiameter?Math.max(Mo.circleDiameter,Ns):Ns;ss=Gg(as,ss),ss=Gg(Ia,ss),ss=Gg(fl,ss),ss=Gg(sa,ss);const x6=ss>-1?1:0;x6&&(ss*=Ma/Fi),mr.glyphOffsetArray.length>=Jd.MAX_GLYPHS&&B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Wr.sortKey!==void 0&&mr.addToSortKeyRanges(mr.symbolInstances.length,Wr.sortKey),mr.symbolInstances.emplaceBack(jr.x,jr.y,pl.right>=0?pl.right:-1,pl.center>=0?pl.center:-1,pl.left>=0?pl.left:-1,pl.vertical||-1,ob,ab,g6,uB,cB,dB,fB,hB,pB,mB,vB,Hi,Ep,v6,Po,hl,x6,0,fi,sb,lb,ss)}(c,br,Ft,d,m,_,tr,c.layers[0],c.collisionBoxArray,s.index,s.sourceLayerIndex,c.index,Me,[nt,nt,nt,nt],lr,F,st,kt,hr,he,s,E,U,X,M)};if(er==="line")for(const Ft of Z5(s.geometry,0,0,xi,xi)){const br=H$(Ft,Ke,St,d.vertical||pe,m,24,Ze,c.overscaling,xi);for(const mr of br){const jr=pe;jr&&Y$(c,jr.text,Zt,mr)||Yt(Ft,mr)}}else if(er==="line-center"){for(const Ft of s.geometry)if(Ft.length>1){const br=K$(Ft,St,d.vertical||pe,m,24,Ze);br&&Yt(Ft,br)}}else if(s.type==="Polygon")for(const Ft of D_(s.geometry,0)){const br=G$(Ft,16);Yt(Ft[0],new lu(br.x,br.y,0))}else if(s.type==="LineString")for(const Ft of s.geometry)Yt(Ft,new lu(Ft[0].x,Ft[0].y,0));else if(s.type==="Point")for(const Ft of s.geometry)for(const br of Ft)Yt([br],new lu(br.x,br.y,0))}const uu=32640;function J5(c,s,d,m,_,E,M,D,F,U,X,re,ue,he,pe){const Oe=function(st,Ke,nt,kt,St,lr,hr,er){const Zt=kt.layout.get("text-rotate").evaluate(lr,{})*Math.PI/180,Ht=[];for(const tr of Ke.positionedLines)for(const Yt of tr.positionedGlyphs){if(!Yt.rect)continue;const Ft=Yt.rect||{};let br=4,mr=!0,jr=1,Mn=0;const Ln=(St||er)&&Yt.vertical,_i=Yt.metrics.advance*Yt.scale/2;if(er&&Ke.verticalizable){const Un=(Yt.scale-1)*Fi,Mi=(Fi-Yt.metrics.width*Yt.scale)/2;Mn=tr.lineOffset/2-(Yt.imageName?-Mi:Un)}if(Yt.imageName){const Un=hr[Yt.imageName];mr=Un.sdf,jr=Un.pixelRatio,br=1/jr}const aa=St?[Yt.x+_i,Yt.y]:[0,0];let Ki=St?[0,0]:[Yt.x+_i+nt[0],Yt.y+nt[1]-Mn],di=[0,0];Ln&&(di=Ki,Ki=[0,0]);const Pi=(Yt.metrics.left-br)*Yt.scale-_i+Ki[0],Hi=(-Yt.metrics.top-br)*Yt.scale+Ki[1],eo=Pi+Ft.w*Yt.scale/jr,Eo=Hi+Ft.h*Yt.scale/jr,fi=new ne(Pi,Hi),Wi=new ne(eo,Hi),to=new ne(Pi,Eo),po=new ne(eo,Eo);if(Ln){const Un=new ne(-_i,_i-Lg),Mi=-Math.PI/2,Wr=12-_i,Ho=new ne(22-Wr,-(Yt.imageName?Wr:0)),qi=new ne(...di);fi._rotateAround(Mi,Un)._add(Ho)._add(qi),Wi._rotateAround(Mi,Un)._add(Ho)._add(qi),to._rotateAround(Mi,Un)._add(Ho)._add(qi),po._rotateAround(Mi,Un)._add(Ho)._add(qi)}if(Zt){const Un=Math.sin(Zt),Mi=Math.cos(Zt),Wr=[Mi,-Un,Un,Mi];fi._matMult(Wr),Wi._matMult(Wr),to._matMult(Wr),po._matMult(Wr)}const ko=new ne(0,0),To=new ne(0,0);Ht.push({tl:fi,tr:Wi,bl:to,br:po,tex:Ft,writingMode:Ke.writingMode,glyphOffset:aa,sectionIndex:Yt.sectionIndex,isSDF:mr,pixelOffsetTL:ko,pixelOffsetBR:To,minFontScaleX:0,minFontScaleY:0})}return Ht}(0,d,D,_,E,M,m,c.allowVerticalPlacement),Me=c.textSizeData;let Ze=null;Me.kind==="source"?(Ze=[dl*_.layout.get("text-size").evaluate(M,{})],Ze[0]>uu&&B(`${c.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):Me.kind==="composite"&&(Ze=[dl*he.compositeTextSizes[0].evaluate(M,{},pe),dl*he.compositeTextSizes[1].evaluate(M,{},pe)],(Ze[0]>uu||Ze[1]>uu)&&B(`${c.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),c.addSymbols(c.text,Oe,Ze,D,E,M,U,s,F.lineStartIndex,F.lineLength,ue,pe);for(const st of X)re[st]=c.text.placedSymbolArray.length-1;return 4*Oe.length}function e6(c){for(const s in c)return c[s];return null}function Y$(c,s,d,m){const _=c.compareText;if(s in _){const E=_[s];for(let M=E.length-1;M>=0;M--)if(m.dist(E[M])M.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=I_([]),this.placementViewportMatrix=I_([]);const d=this.layers[0]._unevaluatedLayout._values;this.textSizeData=U5(this.zoom,d["text-size"]),this.iconSizeData=U5(this.zoom,d["icon-size"]);const m=this.layers[0].layout,_=m.get("symbol-sort-key"),E=m.get("symbol-z-order");this.canOverlap=eb(m,"text-overlap","text-allow-overlap")!=="never"||eb(m,"icon-overlap","icon-allow-overlap")!=="never"||m.get("text-ignore-placement")||m.get("icon-ignore-placement"),this.sortFeaturesByKey=E!=="viewport-y"&&!_.isConstant(),this.sortFeaturesByY=(E==="viewport-y"||E==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,m.get("symbol-placement")==="point"&&(this.writingModes=m.get("text-writing-mode").map(M=>o.WritingMode[M])),this.stateDependentLayerIds=this.layers.filter(M=>M.isStateDependent()).map(M=>M.id),this.sourceID=s.sourceID}createArrays(){this.text=new Y_(new Tc(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new Y_(new Tc(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new Gt,this.lineVertexArray=new sr,this.symbolInstances=new nr}calculateGlyphDependencies(s,d,m,_,E){for(let M=0;M0)&&(M.value.kind!=="constant"||M.value.value.length>0),X=F.value.kind!=="constant"||!!F.value.value||Object.keys(F.parameters).length>0,re=E.get("symbol-sort-key");if(this.features=[],!U&&!X)return;const ue=d.iconDependencies,he=d.glyphDependencies,pe=d.availableImages,Oe=new zn(this.zoom);for(const{feature:Me,id:Ze,index:st,sourceLayerIndex:Ke}of s){const nt=_._featureFilter.needGeometry,kt=Mc(Me,nt);if(!_._featureFilter.filter(Oe,kt,m))continue;let St,lr;if(nt||(kt.geometry=Pc(Me)),U){const er=_.getValueAndResolveTokens("text-field",kt,m,pe),Zt=be.factory(er);eB(Zt)&&(this.hasRTLText=!0),(!this.hasRTLText||Sc()==="unavailable"||this.hasRTLText&&jo.isParsed())&&(St=T$(Zt,_,kt))}if(X){const er=_.getValueAndResolveTokens("icon-image",kt,m,pe);lr=er instanceof Ae?er:Ae.fromString(er)}if(!St&&!lr)continue;const hr=this.sortFeaturesByKey?re.evaluate(kt,{},m):void 0;if(this.features.push({id:Ze,text:St,icon:lr,index:st,sourceLayerIndex:Ke,geometry:kt.geometry,properties:Me.properties,type:Q$[Me.type],sortKey:hr}),lr&&(ue[lr.name]=!0),St){const er=M.evaluate(kt,{},m).join(","),Zt=E.get("text-rotation-alignment")!=="viewport"&&E.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.WritingMode.vertical)>=0;for(const Ht of St.sections)if(Ht.image)ue[Ht.image.name]=!0;else{const tr=Vd(St.toString()),Yt=Ht.fontStack||er,Ft=he[Yt]=he[Yt]||{};this.calculateGlyphDependencies(Ht.text,Ft,Zt,this.allowVerticalPlacement,tr)}}}E.get("symbol-placement")==="line"&&(this.features=function(Me){const Ze={},st={},Ke=[];let nt=0;function kt(er){Ke.push(Me[er]),nt++}function St(er,Zt,Ht){const tr=st[er];return delete st[er],st[Zt]=tr,Ke[tr].geometry[0].pop(),Ke[tr].geometry[0]=Ke[tr].geometry[0].concat(Ht[0]),tr}function lr(er,Zt,Ht){const tr=Ze[Zt];return delete Ze[Zt],Ze[er]=tr,Ke[tr].geometry[0].shift(),Ke[tr].geometry[0]=Ht[0].concat(Ke[tr].geometry[0]),tr}function hr(er,Zt,Ht){const tr=Ht?Zt[0][Zt[0].length-1]:Zt[0][0];return`${er}:${tr.x}:${tr.y}`}for(let er=0;erer.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Me,Ze)=>Me.sortKey-Ze.sortKey)}update(s,d,m){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,d,this.layers,m),this.icon.programConfigurations.updatePaintArrays(s,d,this.layers,m))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,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(s,d){const m=this.lineVertexArray.length;if(s.segment!==void 0){let _=s.dist(d[s.segment+1]),E=s.dist(d[s.segment]);const M={};for(let D=s.segment+1;D=0;D--)M[D]={x:d[D].x,y:d[D].y,tileUnitDistanceFromAnchor:E},D>0&&(E+=d[D-1].dist(d[D]));for(let D=0;D0}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(s,d){const m=s.placedSymbolArray.get(d),_=m.vertexStartIndex+4*m.numGlyphs;for(let E=m.vertexStartIndex;E<_;E+=4)s.indexArray.emplaceBack(E,E+1,E+2),s.indexArray.emplaceBack(E+1,E+2,E+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const d=Math.sin(s),m=Math.cos(s),_=[],E=[],M=[];for(let D=0;D_[D]-_[F]||E[F]-E[D]),M}addToSortKeyRanges(s,d){const m=this.sortKeyRanges[this.sortKeyRanges.length-1];m&&m.sortKey===d?m.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:d,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const d of this.symbolInstanceIndexes){const m=this.symbolInstances.get(d);this.featureSortOrder.push(m.featureIndex),[m.rightJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.leftJustifiedTextSymbolIndex].forEach((_,E,M)=>{_>=0&&M.indexOf(_)===E&&this.addIndicesForPlacedSymbol(this.text,_)}),m.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,m.verticalPlacedTextSymbolIndex),m.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,m.placedIconSymbolIndex),m.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,m.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dr("SymbolBucket",Jd,{omit:["layers","collisionBoxArray","features","compareText"]}),Jd.MAX_GLYPHS=65535,Jd.addDynamicAttributes=X_;const tB=new Li({"symbol-placement":new pr(Fe.layout_symbol["symbol-placement"]),"symbol-spacing":new pr(Fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new pr(Fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Sr(Fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new pr(Fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new pr(Fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new pr(Fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new pr(Fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new pr(Fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new pr(Fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Sr(Fe.layout_symbol["icon-size"]),"icon-text-fit":new pr(Fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new pr(Fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Sr(Fe.layout_symbol["icon-image"]),"icon-rotate":new Sr(Fe.layout_symbol["icon-rotate"]),"icon-padding":new Sr(Fe.layout_symbol["icon-padding"]),"icon-keep-upright":new pr(Fe.layout_symbol["icon-keep-upright"]),"icon-offset":new Sr(Fe.layout_symbol["icon-offset"]),"icon-anchor":new Sr(Fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new pr(Fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new pr(Fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new pr(Fe.layout_symbol["text-rotation-alignment"]),"text-field":new Sr(Fe.layout_symbol["text-field"]),"text-font":new Sr(Fe.layout_symbol["text-font"]),"text-size":new Sr(Fe.layout_symbol["text-size"]),"text-max-width":new Sr(Fe.layout_symbol["text-max-width"]),"text-line-height":new pr(Fe.layout_symbol["text-line-height"]),"text-letter-spacing":new Sr(Fe.layout_symbol["text-letter-spacing"]),"text-justify":new Sr(Fe.layout_symbol["text-justify"]),"text-radial-offset":new Sr(Fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new pr(Fe.layout_symbol["text-variable-anchor"]),"text-anchor":new Sr(Fe.layout_symbol["text-anchor"]),"text-max-angle":new pr(Fe.layout_symbol["text-max-angle"]),"text-writing-mode":new pr(Fe.layout_symbol["text-writing-mode"]),"text-rotate":new Sr(Fe.layout_symbol["text-rotate"]),"text-padding":new pr(Fe.layout_symbol["text-padding"]),"text-keep-upright":new pr(Fe.layout_symbol["text-keep-upright"]),"text-transform":new Sr(Fe.layout_symbol["text-transform"]),"text-offset":new Sr(Fe.layout_symbol["text-offset"]),"text-allow-overlap":new pr(Fe.layout_symbol["text-allow-overlap"]),"text-overlap":new pr(Fe.layout_symbol["text-overlap"]),"text-ignore-placement":new pr(Fe.layout_symbol["text-ignore-placement"]),"text-optional":new pr(Fe.layout_symbol["text-optional"])});var J_={paint:new Li({"icon-opacity":new Sr(Fe.paint_symbol["icon-opacity"]),"icon-color":new Sr(Fe.paint_symbol["icon-color"]),"icon-halo-color":new Sr(Fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Sr(Fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Sr(Fe.paint_symbol["icon-halo-blur"]),"icon-translate":new pr(Fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new pr(Fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Sr(Fe.paint_symbol["text-opacity"]),"text-color":new Sr(Fe.paint_symbol["text-color"],{runtimeType:$r,getOverride:c=>c.textColor,hasOverride:c=>!!c.textColor}),"text-halo-color":new Sr(Fe.paint_symbol["text-halo-color"]),"text-halo-width":new Sr(Fe.paint_symbol["text-halo-width"]),"text-halo-blur":new Sr(Fe.paint_symbol["text-halo-blur"]),"text-translate":new pr(Fe.paint_symbol["text-translate"]),"text-translate-anchor":new pr(Fe.paint_symbol["text-translate-anchor"])}),layout:tB};class t6{constructor(s){if(s.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=s.property.overrides?s.property.overrides.runtimeType:Or,this.defaultValue=s}evaluate(s){if(s.formattedSection){const d=this.defaultValue.property.overrides;if(d&&d.hasOverride(s.formattedSection))return d.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}dr("FormatSectionOverride",t6,{omit:["defaultValue"]});class Hg extends ka{constructor(s){super(s,J_)}recalculate(s,d){if(super.recalculate(s,d),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 m=this.layout.get("text-writing-mode");if(m){const _=[];for(const E of m)_.indexOf(E)<0&&_.push(E);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(s,d,m,_){const E=this.layout.get(s).evaluate(d,{},m,_),M=this._unevaluatedLayout._values[s];return M.isDataDriven()||dc(M.value)||!E?E:function(D,F){return F.replace(/{([^{}]+)}/g,(U,X)=>X in D?String(D[X]):"")}(d.properties,E)}createBucket(s){return new Jd(s)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const s of J_.paint.overridableProperties){if(!Hg.hasPaintOverride(this.layout,s))continue;const d=this.paint.get(s),m=new t6(d),_=new zd(m,d.property.specification);let E=null;E=d.value.kind==="constant"||d.value.kind==="source"?new hc("source",_):new Zh("composite",_,d.value.zoomStops),this.paint._values[s]=new Ea(d.property,E,d.parameters)}}_handleOverridablePaintPropertyUpdate(s,d,m){return!(!this.layout||d.isDataDriven()||m.isDataDriven())&&Hg.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,d){const m=s.get("text-field"),_=J_.paint.properties[d];let E=!1;const M=D=>{for(const F of D)if(_.overrides&&_.overrides.hasOverride(F))return void(E=!0)};if(m.value.kind==="constant"&&m.value.value instanceof be)M(m.value.value.sections);else if(m.value.kind==="source"){const D=U=>{E||(U instanceof bt&&Be(U.value)===wr?M(U.value.sections):U instanceof Ad?M(U.sections):U.eachChild(D))},F=m.value;F._styleExpression&&D(F._styleExpression.expression)}return E}}function eb(c,s,d){let m="never";const _=c.get(s);return _?m=_:c.get(d)&&(m="always"),m}var rB={paint:new Li({"background-color":new pr(Fe.paint_background["background-color"]),"background-pattern":new sp(Fe.paint_background["background-pattern"]),"background-opacity":new pr(Fe.paint_background["background-opacity"])})},nB={paint:new Li({"raster-opacity":new pr(Fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new pr(Fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new pr(Fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new pr(Fe.paint_raster["raster-brightness-max"]),"raster-saturation":new pr(Fe.paint_raster["raster-saturation"]),"raster-contrast":new pr(Fe.paint_raster["raster-contrast"]),"raster-resampling":new pr(Fe.paint_raster["raster-resampling"]),"raster-fade-duration":new pr(Fe.paint_raster["raster-fade-duration"])})};class iB extends ka{constructor(s){super(s,{}),this.onAdd=d=>{this.implementation.onAdd&&this.implementation.onAdd(d,d.painter.context.gl)},this.onRemove=d=>{this.implementation.onRemove&&this.implementation.onRemove(d,d.painter.context.gl)},this.implementation=s}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 oB={circle:class extends ka{constructor(c){super(c,DF)}createBucket(c){return new T_(c)}queryRadius(c){const s=c;return fp("circle-radius",this,s)+fp("circle-stroke-width",this,s)+Pg(this.paint.get("circle-translate"))}queryIntersectsFeature(c,s,d,m,_,E,M,D){const F=Mg(c,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),E.angle,M),U=this.paint.get("circle-radius").evaluate(s,d)+this.paint.get("circle-stroke-width").evaluate(s,d),X=this.paint.get("circle-pitch-alignment")==="map",re=X?F:function(he,pe){return he.map(Oe=>f5(Oe,pe))}(F,D),ue=X?U*M:U;for(const he of m)for(const pe of he){const Oe=X?pe:f5(pe,D);let Me=ue;const Ze=Ig([],[pe.x,pe.y,0,1],D);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Me*=Ze[3]/E.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Me*=E.cameraToCenterDistance/Ze[3]),RF(re,Oe,Me))return!0}return!1}},heatmap:class extends ka{constructor(c){super(c,FF),this._updateColorRamp()}createBucket(c){return new h5(c)}_handleSpecialPaintPropertyUpdate(c){c==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=m5({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 ka{constructor(c){super(c,$F)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends ka{constructor(c){super(c,t$)}recalculate(c,s){super.recalculate(c,s);const d=this.paint._values["fill-outline-color"];d.value.kind==="constant"&&d.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(c){return new $_(c)}queryRadius(){return Pg(this.paint.get("fill-translate"))}queryIntersectsFeature(c,s,d,m,_,E,M){return i5(Mg(c,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),E.angle,M),m)}isTileClipped(){return!0}},"fill-extrusion":class extends ka{constructor(c){super(c,m$)}createBucket(c){return new V_(c)}queryRadius(){return Pg(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(c,s,d,m,_,E,M,D){const F=Mg(c,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),E.angle,M),U=this.paint.get("fill-extrusion-height").evaluate(s,d),X=this.paint.get("fill-extrusion-base").evaluate(s,d),re=function(he,pe,Oe,Me){const Ze=[];for(const st of he){const Ke=[st.x,st.y,0,1];Ig(Ke,Ke,pe),Ze.push(new ne(Ke[0]/Ke[3],Ke[1]/Ke[3]))}return Ze}(F,D),ue=function(he,pe,Oe,Me){const Ze=[],st=[],Ke=Me[8]*pe,nt=Me[9]*pe,kt=Me[10]*pe,St=Me[11]*pe,lr=Me[8]*Oe,hr=Me[9]*Oe,er=Me[10]*Oe,Zt=Me[11]*Oe;for(const Ht of he){const tr=[],Yt=[];for(const Ft of Ht){const br=Ft.x,mr=Ft.y,jr=Me[0]*br+Me[4]*mr+Me[12],Mn=Me[1]*br+Me[5]*mr+Me[13],Ln=Me[2]*br+Me[6]*mr+Me[14],_i=Me[3]*br+Me[7]*mr+Me[15],aa=Ln+kt,Ki=_i+St,di=jr+lr,Pi=Mn+hr,Hi=Ln+er,eo=_i+Zt,Eo=new ne((jr+Ke)/Ki,(Mn+nt)/Ki);Eo.z=aa/Ki,tr.push(Eo);const fi=new ne(di/eo,Pi/eo);fi.z=Hi/eo,Yt.push(fi)}Ze.push(tr),st.push(Yt)}return[Ze,st]}(m,X,U,D);return function(he,pe,Oe){let Me=1/0;i5(Oe,pe)&&(Me=S5(Oe,pe[0]));for(let Ze=0;Ze=3){for(let Oe=0;Oe{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 r6=63710088e-1;class ri{constructor(s,d){if(isNaN(s)||isNaN(d))throw new Error(`Invalid LngLat object: (${s}, ${d})`);if(this.lng=+s,this.lat=+d,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ri(k(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){const d=Math.PI/180,m=this.lat*d,_=s.lat*d,E=Math.sin(m)*Math.sin(_)+Math.cos(m)*Math.cos(_)*Math.cos((s.lng-this.lng)*d);return r6*Math.acos(Math.min(E,1))}toBounds(s=0){const d=360*s/40075017,m=d/Math.cos(Math.PI/180*this.lat);return new Rc(new ri(this.lng-m,this.lat-d),new ri(this.lng+m,this.lat+d))}static convert(s){if(s instanceof ri)return s;if(Array.isArray(s)&&(s.length===2||s.length===3))return new ri(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&typeof s=="object"&&s!==null)return new ri(Number("lng"in s?s.lng:s.lon),Number(s.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 Rc{constructor(s,d){s&&(d?this.setSouthWest(s).setNorthEast(d):s.length===4?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1]))}setNorthEast(s){return this._ne=s instanceof ri?new ri(s.lng,s.lat):ri.convert(s),this}setSouthWest(s){return this._sw=s instanceof ri?new ri(s.lng,s.lat):ri.convert(s),this}extend(s){const d=this._sw,m=this._ne;let _,E;if(s instanceof ri)_=s,E=s;else{if(!(s instanceof Rc))return Array.isArray(s)?s.length===4||s.every(Array.isArray)?this.extend(Rc.convert(s)):this.extend(ri.convert(s)):this;if(_=s._sw,E=s._ne,!_||!E)return this}return d||m?(d.lng=Math.min(_.lng,d.lng),d.lat=Math.min(_.lat,d.lat),m.lng=Math.max(E.lng,m.lng),m.lat=Math.max(E.lat,m.lat)):(this._sw=new ri(_.lng,_.lat),this._ne=new ri(E.lng,E.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(s){const{lng:d,lat:m}=ri.convert(s);let _=this._sw.lng<=d&&d<=this._ne.lng;return this._sw.lng>this._ne.lng&&(_=this._sw.lng>=d&&d>=this._ne.lng),this._sw.lat<=m&&m<=this._ne.lat&&_}static convert(s){return s instanceof Rc?s:s&&new Rc(s)}}const n6=2*Math.PI*r6;function i6(c){return n6*Math.cos(c*Math.PI/180)}function o6(c){return(180+c)/360}function a6(c){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360}function s6(c,s){return c/i6(s)}function tb(c){return 360/Math.PI*Math.atan(Math.exp((180-360*c)*Math.PI/180))-90}class Wg{constructor(s,d,m=0){this.x=+s,this.y=+d,this.z=+m}static fromLngLat(s,d=0){const m=ri.convert(s);return new Wg(o6(m.lng),a6(m.lat),s6(d,m.lat))}toLngLat(){return new ri(360*this.x-180,tb(this.y))}toAltitude(){return this.z*i6(tb(this.y))}meterInMercatorCoordinateUnits(){return 1/n6*(s=tb(this.y),1/Math.cos(s*Math.PI/180));var s}}function l6(c,s,d){var m=2*Math.PI*6378137/256/Math.pow(2,d);return[c*m-2*Math.PI*6378137/2,s*m-2*Math.PI*6378137/2]}class rb{constructor(s,d,m){if(s<0||s>25||m<0||m>=Math.pow(2,s)||d<0||d>=Math.pow(2,s))throw new Error(`x=${d}, y=${m}, z=${s} outside of bounds. 0<=x<${Math.pow(2,s)}, 0<=y<${Math.pow(2,s)} 0<=z<=25 `);this.z=s,this.x=d,this.y=m,this.key=Cp(0,s,s,d,m)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,d,m){const _=(M=this.y,D=this.z,F=l6(256*(E=this.x),256*(M=Math.pow(2,D)-M-1),D),U=l6(256*(E+1),256*(M+1),D),F[0]+","+F[1]+","+U[0]+","+U[1]);var E,M,D,F,U;const X=function(re,ue,he){let pe,Oe="";for(let Me=re;Me>0;Me--)pe=1<1?"@2x":"").replace(/{quadkey}/g,X).replace(/{bbox-epsg-3857}/g,_)}isChildOf(s){const d=this.z-s.z;return d>0&&s.x===this.x>>d&&s.y===this.y>>d}getTilePoint(s){const d=Math.pow(2,this.z);return new ne((s.x*d-this.x)*xi,(s.y*d-this.y)*xi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class u6{constructor(s,d){this.wrap=s,this.canonical=d,this.key=Cp(s,d.z,d.z,d.x,d.y)}}class oa{constructor(s,d,m,_,E){if(s= z; overscaledZ = ${s}; z = ${m}`);this.overscaledZ=s,this.wrap=d,this.canonical=new rb(m,+_,+E),this.key=Cp(d,s,m,_,E)}clone(){return new oa(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const d=this.canonical.z-s;return s>this.canonical.z?new oa(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new oa(s,this.wrap,s,this.canonical.x>>d,this.canonical.y>>d)}calculateScaledKey(s,d){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const m=this.canonical.z-s;return s>this.canonical.z?Cp(this.wrap*+d,s,this.canonical.z,this.canonical.x,this.canonical.y):Cp(this.wrap*+d,s,s,this.canonical.x>>m,this.canonical.y>>m)}isChildOf(s){if(s.wrap!==this.wrap)return!1;const d=this.canonical.z-s.canonical.z;return s.overscaledZ===0||s.overscaledZ>d&&s.canonical.y===this.canonical.y>>d}children(s){if(this.overscaledZ>=s)return[new oa(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const d=this.canonical.z+1,m=2*this.canonical.x,_=2*this.canonical.y;return[new oa(d,this.wrap,d,m,_),new oa(d,this.wrap,d,m+1,_),new oa(d,this.wrap,d,m,_+1),new oa(d,this.wrap,d,m+1,_+1)]}isLessThan(s){return this.wraps.wrap)&&(this.overscaledZs.overscaledZ)&&(this.canonical.xs.canonical.x)&&this.canonical.ythis.max&&(this.max=D),D=this.dim+1||d<-1||d>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(d+1)*this.stride+(s+1)}_unpackMapbox(s,d,m){return(256*s*256+256*d+m)/10-1e4}_unpackTerrarium(s,d,m){return 256*s+d+m/256-32768}getPixels(){return new ia({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(s,d,m){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let _=d*this.dim,E=d*this.dim+this.dim,M=m*this.dim,D=m*this.dim+this.dim;switch(d){case-1:_=E-1;break;case 1:E=_+1}switch(m){case-1:M=D-1;break;case 1:D=M+1}const F=-d*this.dim,U=-m*this.dim;for(let X=M;X=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${s} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[s]}}class f6{constructor(s,d,m,_,E){this.type="Feature",this._vectorTileFeature=s,s._z=d,s._x=m,s._y=_,this.properties=s.properties,this.id=E}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(s){this._geometry=s}toJSON(){const s={geometry:this.geometry};for(const d in this)d!=="_geometry"&&d!=="_vectorTileFeature"&&(s[d]=this[d]);return s}}class h6{constructor(s,d){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new Cc(xi,16,0),this.grid3D=new Cc(xi,16,0),this.featureIndexArray=new Vr,this.promoteId=d}insert(s,d,m,_,E,M){const D=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(m,_,E);const F=M?this.grid3D:this.grid;for(let U=0;U=0&&re[3]>=0&&F.insert(D,re[0],re[1],re[2],re[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new au.VectorTile(new U_(this.rawTileData)).layers,this.sourceLayerCoder=new d6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(s,d,m,_){this.loadVTLayers();const E=s.params||{},M=xi/s.tileSize/s.scale,D=Fd(E.filter),F=s.queryGeometry,U=s.queryPadding*M,X=m6(F),re=this.grid.query(X.minX-U,X.minY-U,X.maxX+U,X.maxY+U),ue=m6(s.cameraQueryGeometry),he=this.grid3D.query(ue.minX-U,ue.minY-U,ue.maxX+U,ue.maxY+U,(Me,Ze,st,Ke)=>function(nt,kt,St,lr,hr){for(const Zt of nt)if(kt<=Zt.x&&St<=Zt.y&&lr>=Zt.x&&hr>=Zt.y)return!0;const er=[new ne(kt,St),new ne(kt,hr),new ne(lr,hr),new ne(lr,St)];if(nt.length>2){for(const Zt of er)if(Wd(nt,Zt))return!0}for(let Zt=0;Zt(Ke||(Ke=Pc(nt)),kt.queryIntersectsFeature(F,nt,St,Ke,this.z,s.transform,M,s.pixelPosMatrix)))}return pe}loadMatchingFeature(s,d,m,_,E,M,D,F,U,X,re){const ue=this.bucketLayerIDs[d];if(M&&!function(Me,Ze){for(let st=0;st=0)return!0;return!1}(M,ue))return;const he=this.sourceLayerCoder.decode(m),pe=this.vtLayers[he].feature(_);if(E.needGeometry){const Me=Mc(pe,!0);if(!E.filter(new zn(this.tileID.overscaledZ),Me,this.tileID.canonical))return}else if(!E.filter(new zn(this.tileID.overscaledZ),pe))return;const Oe=this.getId(pe,he);for(let Me=0;Me{const D=s instanceof kc?s.get(M):null;return D&&D.evaluate?D.evaluate(d,m,_):D})}function m6(c){let s=1/0,d=1/0,m=-1/0,_=-1/0;for(const E of c)s=Math.min(s,E.x),d=Math.min(d,E.y),m=Math.max(m,E.x),_=Math.max(_,E.y);return{minX:s,minY:d,maxX:m,maxY:_}}function sB(c,s){return s-c}var nb;dr("FeatureIndex",h6,{omit:["rawTileData","sourceLayerCoder"]}),o.PerformanceMarkers=void 0,(nb=o.PerformanceMarkers||(o.PerformanceMarkers={})).create="create",nb.load="load",nb.fullLoad="fullLoad";let qg=null,Sp=[];const ib=1e3/30,lB={mark(c){performance.mark(c)},frame(c){const s=c;qg!=null&&Sp.push(s-qg),qg=s},clearMetrics(){qg=null,Sp=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const c in o.PerformanceMarkers)performance.clearMarks(o.PerformanceMarkers[c])},getPerformanceMetrics(){performance.measure("loadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.load),performance.measure("fullLoadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.fullLoad);const c=performance.getEntriesByName("loadTime")[0].duration,s=performance.getEntriesByName("fullLoadTime")[0].duration,d=Sp.length,m=1/(Sp.reduce((E,M)=>E+M,0)/d/1e3),_=Sp.filter(E=>E>ib).reduce((E,M)=>E+(M-ib)/ib,0);return{loadTime:c,fullLoadTime:s,fps:m,percentDroppedFrames:_/(d+_)*100}}};o.AJAXError=Ye,o.ARRAY_TYPE=ho,o.Actor=class{constructor(c,s,d){this.target=c,this.parent=s,this.mapId=d,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},A(["receive","process"],this),this.invoker=new aB(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=H()?c:window}send(c,s,d,m,_=!1){const E=Math.round(1e18*Math.random()).toString(36).substring(0,10);d&&(this.callbacks[E]=d);const M=Z(this.globalScope)?void 0:[];return this.target.postMessage({id:E,type:c,hasCallback:!!d,targetMapId:m,mustQueue:_,sourceMapId:this.mapId,data:il(s,M)},M),{cancel:()=>{d&&delete this.callbacks[E],this.target.postMessage({id:E,type:"",targetMapId:m,sourceMapId:this.mapId})}}}receive(c){const s=c.data,d=s.id;if(d&&(!s.targetMapId||this.mapId===s.targetMapId))if(s.type===""){delete this.tasks[d];const m=this.cancelCallbacks[d];delete this.cancelCallbacks[d],m&&m()}else H()||s.mustQueue?(this.tasks[d]=s,this.taskQueue.push(d),this.invoker.trigger()):this.processTask(d,s)}process(){if(!this.taskQueue.length)return;const c=this.taskQueue.shift(),s=this.tasks[c];delete this.tasks[c],this.taskQueue.length&&this.invoker.trigger(),s&&this.processTask(c,s)}processTask(c,s){if(s.type===""){const d=this.callbacks[c];delete this.callbacks[c],d&&(s.error?d(Ts(s.error)):d(null,Ts(s.data)))}else{let d=!1;const m=Z(this.globalScope)?void 0:[],_=s.hasCallback?(D,F)=>{d=!0,delete this.cancelCallbacks[c],this.target.postMessage({id:c,type:"",sourceMapId:this.mapId,error:D?il(D):null,data:il(F,m)},m)}:D=>{d=!0};let E=null;const M=Ts(s.data);if(this.parent[s.type])E=this.parent[s.type](s.sourceMapId,M,_);else if(this.parent.getWorkerSource){const D=s.type.split(".");E=this.parent.getWorkerSource(s.sourceMapId,D[0],M.source)[D[1]](M,_)}else _(new Error(`Could not find function ${s.type}`));!d&&E&&E.cancel&&(this.cancelCallbacks[c]=E.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.AlphaImage=pp,o.CanonicalTileID=rb,o.CollisionBoxArray=gt,o.CollisionCircleLayoutArray=class extends ee{},o.Color=ae,o.DEMData=c6,o.DataConstantProperty=pr,o.DictionaryCoder=d6,o.EXTENT=xi,o.ErrorEvent=jt,o.EvaluationParameters=zn,o.Event=Wt,o.Evented=Qt,o.FeatureIndex=h6,o.FillBucket=$_,o.FillExtrusionBucket=V_,o.GeoJSONFeature=f6,o.ImageAtlas=L5,o.ImagePosition=H_,o.LineBucket=j_,o.LineStripIndexArray=class extends Pe{},o.LngLat=ri,o.LngLatBounds=Rc,o.MercatorCoordinate=Wg,o.ONE_EM=Fi,o.OverscaledTileID=oa,o.PerformanceUtils=lB,o.PosArray=_r,o.Properties=Li,o.QuadTriangleArray=class extends fe{},o.RGBAImage=ia,o.RasterBoundsArray=class extends x{},o.RequestPerformance=class{constructor(c){this._marks={start:[c.url,"start"].join("#"),end:[c.url,"end"].join("#"),measure:c.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let c=performance.getEntriesByName(this._marks.measure);return c.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),c=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),c}},o.ResourceType=Tt,o.SegmentVector=Hr,o.SymbolBucket=Jd,o.Transitionable=wg,o.TriangleIndexArray=co,o.Uniform1f=ll,o.Uniform1i=class extends sl{constructor(c,s){super(c,s),this.current=0}set(c){this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))}},o.Uniform2f=class extends sl{constructor(c,s){super(c,s),this.current=[0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]||(this.current=c,this.gl.uniform2f(this.location,c[0],c[1]))}},o.Uniform3f=class extends sl{constructor(c,s){super(c,s),this.current=[0,0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]||(this.current=c,this.gl.uniform3f(this.location,c[0],c[1],c[2]))}},o.Uniform4f=Kd,o.UniformColor=JE,o.UniformMatrix4f=class extends sl{constructor(c,s){super(c,s),this.current=MF}set(c){if(c[12]!==this.current[12]||c[0]!==this.current[0])return this.current=c,void this.gl.uniformMatrix4fv(this.location,!1,c);for(let s=1;s<16;s++)if(c[s]!==this.current[s]){this.current=c,this.gl.uniformMatrix4fv(this.location,!1,c);break}}},o.UnwrappedTileID=u6,o.ValidationError=qe,o.ZoomHistory=Jh,o.add=function(c,s,d){return c[0]=s[0]+d[0],c[1]=s[1]+d[1],c[2]=s[2]+d[2],c},o.addDynamicAttributes=X_,o.asyncAll=function(c,s,d){if(!c.length)return d(null,[]);let m=c.length;const _=new Array(c.length);let E=null;c.forEach((M,D)=>{s(M,(F,U)=>{F&&(E=F),_[D]=U,--m==0&&d(E,_)})})},o.bezier=v,o.bindAll=A,o.cacheEntryPossiblyAdded=function(c){Ne++,Ne>ze&&(c.getActor().send("enforceCacheSizeLimit",ke),Ne=0)},o.clamp=w,o.clearTileCache=function(c){const s=caches.delete(ye);c&&s.catch(c).then(()=>c())},o.clipLine=Z5,o.clone=function(c){var s=new ho(16);return s[0]=c[0],s[1]=c[1],s[2]=c[2],s[3]=c[3],s[4]=c[4],s[5]=c[5],s[6]=c[6],s[7]=c[7],s[8]=c[8],s[9]=c[9],s[10]=c[10],s[11]=c[11],s[12]=c[12],s[13]=c[13],s[14]=c[14],s[15]=c[15],s},o.clone$1=N,o.clone$2=function(c){var s=new ho(3);return s[0]=c[0],s[1]=c[1],s[2]=c[2],s},o.collisionCircleLayout=k$,o.config=oe,o.copy=function(c,s){return c[0]=s[0],c[1]=s[1],c[2]=s[2],c[3]=s[3],c[4]=s[4],c[5]=s[5],c[6]=s[6],c[7]=s[7],c[8]=s[8],c[9]=s[9],c[10]=s[10],c[11]=s[11],c[12]=s[12],c[13]=s[13],c[14]=s[14],c[15]=s[15],c},o.create=function(){var c=new ho(16);return ho!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=0,c[12]=0,c[13]=0,c[14]=0),c[0]=1,c[5]=1,c[10]=1,c[15]=1,c},o.create$1=s5,o.createExpression=fc,o.createFilter=Fd,o.createLayout=ci,o.createStyleLayer=function(c){return c.type==="custom"?new iB(c):new oB[c.type](c)},o.cross=function(c,s,d){var m=s[0],_=s[1],E=s[2],M=d[0],D=d[1],F=d[2];return c[0]=_*F-E*D,c[1]=E*M-m*F,c[2]=m*D-_*M,c},o.dot=function(c,s){return c[0]*s[0]+c[1]*s[1]+c[2]*s[2]},o.dot$1=function(c,s){return c[0]*s[0]+c[1]*s[1]+c[2]*s[2]+c[3]*s[3]},o.ease=y,o.emitValidationErrors=Bd,o.enforceCacheSizeLimit=function(c){Ie(),Re&&Re.then(s=>{s.keys().then(d=>{for(let m=0;m{}}},o.identity=I_,o.invert=function(c,s){var d=s[0],m=s[1],_=s[2],E=s[3],M=s[4],D=s[5],F=s[6],U=s[7],X=s[8],re=s[9],ue=s[10],he=s[11],pe=s[12],Oe=s[13],Me=s[14],Ze=s[15],st=d*D-m*M,Ke=d*F-_*M,nt=d*U-E*M,kt=m*F-_*D,St=m*U-E*D,lr=_*U-E*F,hr=X*Oe-re*pe,er=X*Me-ue*pe,Zt=X*Ze-he*pe,Ht=re*Me-ue*Oe,tr=re*Ze-he*Oe,Yt=ue*Ze-he*Me,Ft=st*Yt-Ke*tr+nt*Ht+kt*Zt-St*er+lr*hr;return Ft?(c[0]=(D*Yt-F*tr+U*Ht)*(Ft=1/Ft),c[1]=(_*tr-m*Yt-E*Ht)*Ft,c[2]=(Oe*lr-Me*St+Ze*kt)*Ft,c[3]=(ue*St-re*lr-he*kt)*Ft,c[4]=(F*Zt-M*Yt-U*er)*Ft,c[5]=(d*Yt-_*Zt+E*er)*Ft,c[6]=(Me*nt-pe*lr-Ze*Ke)*Ft,c[7]=(X*lr-ue*nt+he*Ke)*Ft,c[8]=(M*tr-D*Zt+U*hr)*Ft,c[9]=(m*Zt-d*tr-E*hr)*Ft,c[10]=(pe*St-Oe*nt+Ze*st)*Ft,c[11]=(re*nt-X*St-he*st)*Ft,c[12]=(D*er-M*Ht-F*hr)*Ft,c[13]=(d*Ht-m*er+_*hr)*Ft,c[14]=(Oe*Ke-pe*kt-Me*st)*Ft,c[15]=(X*kt-re*Ke+ue*st)*Ft,c):null},o.isImageBitmap=Q,o.isSafari=Z,o.isWorker=H,o.keysDifference=function(c,s){const d=[];for(const m in c)m in s||d.push(m);return d},o.lazyLoadRTLTextPlugin=function(){jo.isLoading()||jo.isLoaded()||Sc()!=="deferred"||bg()},o.makeRequest=It,o.mapObject=I,o.mercatorXfromLng=o6,o.mercatorYfromLat=a6,o.mercatorZfromAltitude=s6,o.mul=LF,o.mul$1=function(c,s,d){return c[0]=s[0]*d[0],c[1]=s[1]*d[1],c[2]=s[2]*d[2],c[3]=s[3]*d[3],c},o.multiply=l5,o.nextPowerOfTwo=function(c){return c<=1?1:Math.pow(2,Math.ceil(Math.log(c)/Math.LN2))},o.normalize=function(c,s){var d=s[0],m=s[1],_=s[2],E=d*d+m*m+_*_;return E>0&&(E=1/Math.sqrt(E)),c[0]=s[0]*E,c[1]=s[1]*E,c[2]=s[2]*E,c},o.number=xn,o.ortho=function(c,s,d,m,_,E,M){var D=1/(s-d),F=1/(m-_),U=1/(E-M);return c[0]=-2*D,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=-2*F,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=2*U,c[11]=0,c[12]=(s+d)*D,c[13]=(_+m)*F,c[14]=(M+E)*U,c[15]=1,c},o.parseCacheControl=te,o.parseGlyphPbf=function(c){return new U_(c).readFields(L$,[])},o.pbf=U_,o.performSymbolLayout=function(c){c.bucket.createArrays(),c.bucket.tilePixelRatio=xi/(512*c.bucket.overscaling),c.bucket.compareText={},c.bucket.iconsNeedLinear=!1;const s=c.bucket.layers[0].layout,d=c.bucket.layers[0]._unevaluatedLayout._values,m={layoutIconSize:d["icon-size"].possiblyEvaluate(new zn(c.bucket.zoom+1),c.canonical),layoutTextSize:d["text-size"].possiblyEvaluate(new zn(c.bucket.zoom+1),c.canonical),textMaxSize:d["text-size"].possiblyEvaluate(new zn(18))};if(c.bucket.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:U}=c.bucket.textSizeData;m.compositeTextSizes=[d["text-size"].possiblyEvaluate(new zn(F),c.canonical),d["text-size"].possiblyEvaluate(new zn(U),c.canonical)]}if(c.bucket.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:U}=c.bucket.iconSizeData;m.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new zn(F),c.canonical),d["icon-size"].possiblyEvaluate(new zn(U),c.canonical)]}const _=s.get("text-line-height")*Fi,E=s.get("text-rotation-alignment")!=="viewport"&&s.get("symbol-placement")!=="point",M=s.get("text-keep-upright"),D=s.get("text-size");for(const F of c.bucket.features){const U=s.get("text-font").evaluate(F,{},c.canonical).join(","),X=D.evaluate(F,{},c.canonical),re=m.layoutTextSize.evaluate(F,{},c.canonical),ue=m.layoutIconSize.evaluate(F,{},c.canonical),he={horizontal:{},vertical:void 0},pe=F.text;let Oe,Me=[0,0];if(pe){const Ke=pe.toString(),nt=s.get("text-letter-spacing").evaluate(F,{},c.canonical)*Fi,kt=w_(Ke)?nt:0,St=s.get("text-anchor").evaluate(F,{},c.canonical),lr=s.get("text-variable-anchor");if(!lr){const tr=s.get("text-radial-offset").evaluate(F,{},c.canonical);Me=tr?Q5(St,[tr*Fi,G_]):s.get("text-offset").evaluate(F,{},c.canonical).map(Yt=>Yt*Fi)}let hr=E?"center":s.get("text-justify").evaluate(F,{},c.canonical);const er=s.get("symbol-placement"),Zt=er==="point"?s.get("text-max-width").evaluate(F,{},c.canonical)*Fi:0,Ht=()=>{c.bucket.allowVerticalPlacement&&Vd(Ke)&&(he.vertical=Fg(pe,c.glyphMap,c.glyphPositions,c.imagePositions,U,Zt,_,St,"left",kt,Me,o.WritingMode.vertical,!0,er,re,X))};if(!E&&lr){const tr=hr==="auto"?lr.map(Ft=>Z_(Ft)):[hr];let Yt=!1;for(let Ft=0;Ftthis._layers[We.id]),Ee=xe[0];if(Ee.visibility==="none")continue;const be=Ee.source||"";let Ce=this.familiesBySource[be];Ce||(Ce=this.familiesBySource[be]={});const Ae=Ee.sourceLayer||"_geojsonTileLayer";let He=Ce[Ae];He||(He=Ce[Ae]=[]),He.push(xe)}}}class y{constructor(K){const q={},ce=[];for(const be in K){const Ce=K[be],Ae=q[be]={};for(const He in Ce){const We=Ce[+He];if(!We||We.bitmap.width===0||We.bitmap.height===0)continue;const Be={x:0,y:0,w:We.bitmap.width+2,h:We.bitmap.height+2};ce.push(Be),Ae[He]={rect:Be,metrics:We.metrics}}}const{w:ae,h:xe}=o.potpack(ce),Ee=new o.AlphaImage({width:ae||1,height:xe||1});for(const be in K){const Ce=K[be];for(const Ae in Ce){const He=Ce[+Ae];if(!He||He.bitmap.width===0||He.bitmap.height===0)continue;const We=q[be][Ae].rect;o.AlphaImage.copy(He.bitmap,Ee,{x:0,y:0},{x:We.x+1,y:We.y+1},He.bitmap)}}this.image=Ee,this.positions=q}}o.register("GlyphAtlas",y);class w{constructor(K){this.tileID=new o.OverscaledTileID(K.tileID.overscaledZ,K.tileID.wrap,K.tileID.canonical.z,K.tileID.canonical.x,K.tileID.canonical.y),this.uid=K.uid,this.zoom=K.zoom,this.pixelRatio=K.pixelRatio,this.tileSize=K.tileSize,this.source=K.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=K.showCollisionBoxes,this.collectResourceTiming=!!K.collectResourceTiming,this.returnDependencies=!!K.returnDependencies,this.promoteId=K.promoteId}parse(K,q,ce,ae,xe){this.status="parsing",this.data=K,this.collisionBoxArray=new o.CollisionBoxArray;const Ee=new o.DictionaryCoder(Object.keys(K.layers).sort()),be=new o.FeatureIndex(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Ce={},Ae={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:ce},He=q.familiesBySource[this.source];for(const ir in He){const gr=K.layers[ir];if(!gr)continue;gr.version===1&&o.warnOnce(`Vector tile source "${this.source}" layer "${ir}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Br=Ee.encode(ir),Jr=[];for(let Vn=0;Vn=an.maxzoom||an.visibility!=="none"&&(k(Vn,this.zoom,ce),(Ce[an.id]=an.createBucket({index:be.bucketLayerIDs.length,layers:Vn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Br,sourceID:this.source})).populate(Jr,Ae,this.tileID.canonical),be.bucketLayerIDs.push(Vn.map(On=>On.id)))}}let We,Be,At,bt;const Je=o.mapObject(Ae.glyphDependencies,ir=>Object.keys(ir).map(Number));Object.keys(Je).length?ae.send("getGlyphs",{uid:this.uid,stacks:Je},(ir,gr)=>{We||(We=ir,Be=gr,vr.call(this))}):Be={};const Rt=Object.keys(Ae.iconDependencies);Rt.length?ae.send("getImages",{icons:Rt,source:this.source,tileID:this.tileID,type:"icons"},(ir,gr)=>{We||(We=ir,At=gr,vr.call(this))}):At={};const Bt=Object.keys(Ae.patternDependencies);function vr(){if(We)return xe(We);if(Be&&At&&bt){const ir=new y(Be),gr=new o.ImageAtlas(At,bt);for(const Br in Ce){const Jr=Ce[Br];Jr instanceof o.SymbolBucket?(k(Jr.layers,this.zoom,ce),o.performSymbolLayout({bucket:Jr,glyphMap:Be,glyphPositions:ir.positions,imageMap:At,imagePositions:gr.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Jr.hasPattern&&(Jr instanceof o.LineBucket||Jr instanceof o.FillBucket||Jr instanceof o.FillExtrusionBucket)&&(k(Jr.layers,this.zoom,ce),Jr.addFeatures(Ae,this.tileID.canonical,gr.patternPositions))}this.status="done",xe(null,{buckets:Object.values(Ce).filter(Br=>!Br.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ir.image,imageAtlas:gr,glyphMap:this.returnDependencies?Be:null,iconMap:this.returnDependencies?At:null,glyphPositions:this.returnDependencies?ir.positions:null})}}Bt.length?ae.send("getImages",{icons:Bt,source:this.source,tileID:this.tileID,type:"patterns"},(ir,gr)=>{We||(We=ir,bt=gr,vr.call(this))}):bt={},vr.call(this)}}function k(me,K,q){const ce=new o.EvaluationParameters(K);for(const ae of me)ae.recalculate(ce,q)}function T(me,K){const q=o.getArrayBuffer(me.request,(ce,ae,xe,Ee)=>{ce?K(ce):ae&&K(null,{vectorTile:new o.vectorTile.VectorTile(new o.pbf(ae)),rawData:ae,cacheControl:xe,expires:Ee})});return()=>{q.cancel(),K()}}class R{constructor(K,q,ce,ae){this.actor=K,this.layerIndex=q,this.availableImages=ce,this.loadVectorData=ae||T,this.loading={},this.loaded={}}loadTile(K,q){const ce=K.uid;this.loading||(this.loading={});const ae=!!(K&&K.request&&K.request.collectResourceTiming)&&new o.RequestPerformance(K.request),xe=this.loading[ce]=new w(K);xe.abort=this.loadVectorData(K,(Ee,be)=>{if(delete this.loading[ce],Ee||!be)return xe.status="done",this.loaded[ce]=xe,q(Ee);const Ce=be.rawData,Ae={};be.expires&&(Ae.expires=be.expires),be.cacheControl&&(Ae.cacheControl=be.cacheControl);const He={};if(ae){const We=ae.finish();We&&(He.resourceTiming=JSON.parse(JSON.stringify(We)))}xe.vectorTile=be.vectorTile,xe.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor,(We,Be)=>{if(We||!Be)return q(We);q(null,o.extend({rawTileData:Ce.slice(0)},Be,Ae,He))}),this.loaded=this.loaded||{},this.loaded[ce]=xe})}reloadTile(K,q){const ce=this.loaded,ae=K.uid,xe=this;if(ce&&ce[ae]){const Ee=ce[ae];Ee.showCollisionBoxes=K.showCollisionBoxes;const be=(Ce,Ae)=>{const He=Ee.reloadCallback;He&&(delete Ee.reloadCallback,Ee.parse(Ee.vectorTile,xe.layerIndex,this.availableImages,xe.actor,He)),q(Ce,Ae)};Ee.status==="parsing"?Ee.reloadCallback=be:Ee.status==="done"&&(Ee.vectorTile?Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor,be):be())}}abortTile(K,q){const ce=this.loading,ae=K.uid;ce&&ce[ae]&&ce[ae].abort&&(ce[ae].abort(),delete ce[ae]),q()}removeTile(K,q){const ce=this.loaded,ae=K.uid;ce&&ce[ae]&&delete ce[ae],q()}}class A{constructor(){this.loaded={}}loadTile(K,q){const{uid:ce,encoding:ae,rawImageData:xe}=K,Ee=o.isImageBitmap(xe)?this.getImageData(xe):xe,be=new o.DEMData(ce,Ee,ae);this.loaded=this.loaded||{},this.loaded[ce]=be,q(null,be)}getImageData(K){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(K.width,K.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=K.width,this.offscreenCanvas.height=K.height,this.offscreenCanvasContext.drawImage(K,0,0,K.width,K.height);const q=this.offscreenCanvasContext.getImageData(-1,-1,K.width+2,K.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new o.RGBAImage({width:q.width,height:q.height},q.data)}removeTile(K){const q=this.loaded,ce=K.uid;q&&q[ce]&&delete q[ce]}}var I=function me(K,q){var ce,ae=K&&K.type;if(ae==="FeatureCollection")for(ce=0;ce=Math.abs(be)?q-Ce+be:be-Ce+q,q=Ce}q+ce>=0!=!!K&&me.reverse()}const L=o.vectorTile.VectorTileFeature.prototype.toGeoJSON;class B{constructor(K){this._feature=K,this.extent=o.EXTENT,this.type=K.type,this.properties=K.tags,"id"in K&&!isNaN(K.id)&&(this.id=parseInt(K.id,10))}loadGeometry(){if(this._feature.type===1){const K=[];for(const q of this._feature.geometry)K.push([new o.pointGeometry(q[0],q[1])]);return K}{const K=[];for(const q of this._feature.geometry){const ce=[];for(const ae of q)ce.push(new o.pointGeometry(ae[0],ae[1]));K.push(ce)}return K}}toGeoJSON(K,q,ce){return L.call(this,K,q,ce)}}class j{constructor(K){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=K.length,this._features=K}feature(K){return new B(this._features[K])}}var G={exports:{}},H=o.pointGeometry,te=o.vectorTile.VectorTileFeature,Y=le;function le(me,K){this.options=K||{},this.features=me,this.length=me.length}function J(me,K){this.id=typeof me.id=="number"?me.id:void 0,this.type=me.type,this.rawGeometry=me.type===1?[me.geometry]:me.geometry,this.properties=me.tags,this.extent=K||4096}le.prototype.feature=function(me){return new J(this.features[me],this.options.extent)},J.prototype.loadGeometry=function(){var me=this.rawGeometry;this.geometry=[];for(var K=0;K>31}function Te(me,K){for(var q=me.loadGeometry(),ce=me.type,ae=0,xe=0,Ee=q.length,be=0;be>1;Ie(me,K,Ee,ce,ae,xe%2),ze(me,K,q,ce,Ee-1,xe+1),ze(me,K,q,Ee+1,ae,xe+1)}function Ie(me,K,q,ce,ae,xe){for(;ae>ce;){if(ae-ce>600){const Ae=ae-ce+1,He=q-ce+1,We=Math.log(Ae),Be=.5*Math.exp(2*We/3),At=.5*Math.sqrt(We*Be*(Ae-Be)/Ae)*(He-Ae/2<0?-1:1);Ie(me,K,q,Math.max(ce,Math.floor(q-He*Be/Ae+At)),Math.min(ae,Math.floor(q+(Ae-He)*Be/Ae+At)),xe)}const Ee=K[2*q+xe];let be=ce,Ce=ae;for(Ne(me,K,ce,q),K[2*ae+xe]>Ee&&Ne(me,K,ce,ae);beEe;)Ce--}K[2*ce+xe]===Ee?Ne(me,K,ce,Ce):(Ce++,Ne(me,K,Ce,ae)),Ce<=q&&(ce=Ce+1),q<=Ce&&(ae=Ce-1)}}function Ne(me,K,q,ce){De(me,q,ce),De(K,2*q,2*ce),De(K,2*q+1,2*ce+1)}function De(me,K,q){const ce=me[K];me[K]=me[q],me[q]=ce}function Ve(me,K,q,ce){const ae=me-q,xe=K-ce;return ae*ae+xe*xe}G.exports=ge,G.exports.fromVectorTileJs=ge,G.exports.fromGeojsonVt=function(me,K){K=K||{};var q={};for(var ce in me)q[ce]=new Q(me[ce].features,K),q[ce].name=ce,q[ce].version=K.version,q[ce].extent=K.extent;return ge({layers:q})},G.exports.GeoJSONWrapper=Q;const Ge=me=>me[0],je=me=>me[1];class ct{constructor(K,q=Ge,ce=je,ae=64,xe=Float64Array){this.nodeSize=ae,this.points=K;const Ee=K.length<65536?Uint16Array:Uint32Array,be=this.ids=new Ee(K.length),Ce=this.coords=new xe(2*K.length);for(let Ae=0;Ae=be&&bt<=Ae&&Je>=Ce&&Je<=He&&At.push(xe[Br]);continue}const ir=Math.floor((vr+Bt)/2);bt=Ee[2*ir],Je=Ee[2*ir+1],bt>=be&&bt<=Ae&&Je>=Ce&&Je<=He&&At.push(xe[ir]);const gr=(Rt+1)%2;(Rt===0?be<=bt:Ce<=Je)&&(Be.push(vr),Be.push(ir-1),Be.push(gr)),(Rt===0?Ae>=bt:He>=Je)&&(Be.push(ir+1),Be.push(Bt),Be.push(gr))}return At}(this.ids,this.coords,K,q,ce,ae,this.nodeSize)}within(K,q,ce){return function(ae,xe,Ee,be,Ce,Ae){const He=[0,ae.length-1,0],We=[],Be=Ce*Ce;for(;He.length;){const At=He.pop(),bt=He.pop(),Je=He.pop();if(bt-Je<=Ae){for(let gr=Je;gr<=bt;gr++)Ve(xe[2*gr],xe[2*gr+1],Ee,be)<=Be&&We.push(ae[gr]);continue}const Rt=Math.floor((Je+bt)/2),Bt=xe[2*Rt],vr=xe[2*Rt+1];Ve(Bt,vr,Ee,be)<=Be&&We.push(ae[Rt]);const ir=(At+1)%2;(At===0?Ee-Ce<=Bt:be-Ce<=vr)&&(He.push(Je),He.push(Rt-1),He.push(ir)),(At===0?Ee+Ce>=Bt:be+Ce>=vr)&&(He.push(Rt+1),He.push(bt),He.push(ir))}return We}(this.ids,this.coords,K,q,ce,this.nodeSize)}}const pt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:me=>me},Tt=Math.fround||(Ye=new Float32Array(1),me=>(Ye[0]=+me,Ye[0]));var Ye;class Pt{constructor(K){this.options=it(Object.create(pt),K),this.trees=new Array(this.options.maxZoom+1)}load(K){const{log:q,minZoom:ce,maxZoom:ae,nodeSize:xe}=this.options;q&&console.time("total time");const Ee=`prepare ${K.length} points`;q&&console.time(Ee),this.points=K;let be=[];for(let Ce=0;Ce=ce;Ce--){const Ae=+Date.now();be=this._cluster(be,Ce),this.trees[Ce]=new ct(be,ft,xt,xe,Float32Array),q&&console.log("z%d: %d clusters in %dms",Ce,be.length,+Date.now()-Ae)}return q&&console.timeEnd("total time"),this}getClusters(K,q){let ce=((K[0]+180)%360+360)%360-180;const ae=Math.max(-90,Math.min(90,K[1]));let xe=K[2]===180?180:((K[2]+180)%360+360)%360-180;const Ee=Math.max(-90,Math.min(90,K[3]));if(K[2]-K[0]>=360)ce=-180,xe=180;else if(ce>xe){const He=this.getClusters([ce,ae,180,Ee],q),We=this.getClusters([-180,ae,xe,Ee],q);return He.concat(We)}const be=this.trees[this._limitZoom(q)],Ce=be.range(lt(ce),dt(Ee),lt(xe),dt(ae)),Ae=[];for(const He of Ce){const We=be.points[He];Ae.push(We.numPoints?Ct(We):this.points[We.index])}return Ae}getChildren(K){const q=this._getOriginId(K),ce=this._getOriginZoom(K),ae="No cluster with the specified id.",xe=this.trees[ce];if(!xe)throw new Error(ae);const Ee=xe.points[q];if(!Ee)throw new Error(ae);const be=this.options.radius/(this.options.extent*Math.pow(2,ce-1)),Ce=xe.within(Ee.x,Ee.y,be),Ae=[];for(const He of Ce){const We=xe.points[He];We.parentId===K&&Ae.push(We.numPoints?Ct(We):this.points[We.index])}if(Ae.length===0)throw new Error(ae);return Ae}getLeaves(K,q,ce){const ae=[];return this._appendLeaves(ae,K,q=q||10,ce=ce||0,0),ae}getTile(K,q,ce){const ae=this.trees[this._limitZoom(K)],xe=Math.pow(2,K),{extent:Ee,radius:be}=this.options,Ce=be/Ee,Ae=(ce-Ce)/xe,He=(ce+1+Ce)/xe,We={features:[]};return this._addTileFeatures(ae.range((q-Ce)/xe,Ae,(q+1+Ce)/xe,He),ae.points,q,ce,xe,We),q===0&&this._addTileFeatures(ae.range(1-Ce/xe,Ae,1,He),ae.points,xe,ce,xe,We),q===xe-1&&this._addTileFeatures(ae.range(0,Ae,Ce/xe,He),ae.points,-1,ce,xe,We),We.features.length?We:null}getClusterExpansionZoom(K){let q=this._getOriginZoom(K)-1;for(;q<=this.options.maxZoom;){const ce=this.getChildren(K);if(q++,ce.length!==1)break;K=ce[0].properties.cluster_id}return q}_appendLeaves(K,q,ce,ae,xe){const Ee=this.getChildren(q);for(const be of Ee){const Ce=be.properties;if(Ce&&Ce.cluster?xe+Ce.point_count<=ae?xe+=Ce.point_count:xe=this._appendLeaves(K,Ce.cluster_id,ce,ae,xe):xeq&&(bt+=Rt.numPoints||1)}if(bt>At&&bt>=be){let Je=He.x*At,Rt=He.y*At,Bt=Ee&&At>1?this._map(He,!0):null;const vr=(Ae<<5)+(q+1)+this.points.length;for(const ir of Be){const gr=We.points[ir];if(gr.zoom<=q)continue;gr.zoom=q;const Br=gr.numPoints||1;Je+=gr.x*Br,Rt+=gr.y*Br,gr.parentId=vr,Ee&&(Bt||(Bt=this._map(He,!0)),Ee(Bt,this._map(gr)))}He.parentId=vr,ce.push(mt(Je/bt,Rt/bt,vr,bt,Bt))}else if(ce.push(He),bt>1)for(const Je of Be){const Rt=We.points[Je];Rt.zoom<=q||(Rt.zoom=q,ce.push(Rt))}}return ce}_getOriginId(K){return K-this.points.length>>5}_getOriginZoom(K){return(K-this.points.length)%32}_map(K,q){if(K.numPoints)return q?it({},K.properties):K.properties;const ce=this.points[K.index].properties,ae=this.options.map(ce);return q&&ae===ce?it({},ae):ae}}function mt(me,K,q,ce,ae){return{x:Tt(me),y:Tt(K),zoom:1/0,id:q,parentId:-1,numPoints:ce,properties:ae}}function It(me,K){const[q,ce]=me.geometry.coordinates;return{x:Tt(lt(q)),y:Tt(dt(ce)),zoom:1/0,index:K,parentId:-1}}function Ct(me){return{type:"Feature",id:me.id,properties:Dt(me),geometry:{type:"Point",coordinates:[(K=me.x,360*(K-.5)),ut(me.y)]}};var K}function Dt(me){const K=me.numPoints,q=K>=1e4?`${Math.round(K/1e3)}k`:K>=1e3?Math.round(K/100)/10+"k":K;return it(it({},me.properties),{cluster:!0,cluster_id:me.id,point_count:K,point_count_abbreviated:q})}function lt(me){return me/360+.5}function dt(me){const K=Math.sin(me*Math.PI/180),q=.5-.25*Math.log((1+K)/(1-K))/Math.PI;return q<0?0:q>1?1:q}function ut(me){const K=(180-360*me)*Math.PI/180;return 360*Math.atan(Math.exp(K))/Math.PI-90}function it(me,K){for(const q in K)me[q]=K[q];return me}function ft(me){return me.x}function xt(me){return me.y}function Wt(me,K,q,ce){for(var ae,xe=ce,Ee=q-K>>1,be=q-K,Ce=me[K],Ae=me[K+1],He=me[q],We=me[q+1],Be=K+3;Bexe)ae=Be,xe=At;else if(At===xe){var bt=Math.abs(Be-Ee);btce&&(ae-K>3&&Wt(me,K,ae,ce),me[ae+2]=xe,q-ae>3&&Wt(me,ae,q,ce))}function jt(me,K,q,ce,ae,xe){var Ee=ae-q,be=xe-ce;if(Ee!==0||be!==0){var Ce=((me-q)*Ee+(K-ce)*be)/(Ee*Ee+be*be);Ce>1?(q=ae,ce=xe):Ce>0&&(q+=Ee*Ce,ce+=be*Ce)}return(Ee=me-q)*Ee+(be=K-ce)*be}function Qt(me,K,q,ce){var ae={id:me===void 0?null:me,type:K,geometry:q,tags:ce,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(xe){var Ee=xe.geometry,be=xe.type;if(be==="Point"||be==="MultiPoint"||be==="LineString")Fe(xe,Ee);else if(be==="Polygon"||be==="MultiLineString")for(var Ce=0;Ce0&&(Ee+=ce?(ae*Ae-Ce*xe)/2:Math.sqrt(Math.pow(Ce-ae,2)+Math.pow(Ae-xe,2))),ae=Ce,xe=Ae}var He=K.length-3;K[2]=1,Wt(K,0,He,q),K[He+2]=1,K.size=Math.abs(Ee),K.start=0,K.end=K.size}function Vt(me,K,q,ce){for(var ae=0;ae1?1:q}function xr(me,K,q,ce,ae,xe,Ee,be){if(ce/=K,xe>=(q/=K)&&Ee=ce)return null;for(var Ce=[],Ae=0;Ae=q&&bt=ce)){var Je=[];if(Be==="Point"||Be==="MultiPoint")Or(We,Je,q,ce,ae);else if(Be==="LineString")_t(We,Je,q,ce,ae,!1,be.lineMetrics);else if(Be==="MultiLineString")or(We,Je,q,ce,ae,!1);else if(Be==="Polygon")or(We,Je,q,ce,ae,!0);else if(Be==="MultiPolygon")for(var Rt=0;Rt=q&&Ee<=ce&&(K.push(me[xe]),K.push(me[xe+1]),K.push(me[xe+2]))}}function _t(me,K,q,ce,ae,xe,Ee){for(var be,Ce,Ae=qt(me),He=ae===0?Er:Lt,We=me.start,Be=0;Beq&&(Ce=He(Ae,At,bt,Rt,Bt,q),Ee&&(Ae.start=We+be*Ce)):vr>ce?ir=q&&(Ce=He(Ae,At,bt,Rt,Bt,q),gr=!0),ir>ce&&vr<=ce&&(Ce=He(Ae,At,bt,Rt,Bt,ce),gr=!0),!xe&&gr&&(Ee&&(Ae.end=We+be*Ce),K.push(Ae),Ae=qt(me)),Ee&&(We+=be)}var Br=me.length-3;At=me[Br],bt=me[Br+1],Je=me[Br+2],(vr=ae===0?At:bt)>=q&&vr<=ce&&$r(Ae,At,bt,Je),Br=Ae.length-3,xe&&Br>=3&&(Ae[Br]!==Ae[0]||Ae[Br+1]!==Ae[1])&&$r(Ae,Ae[0],Ae[1],Ae[2]),Ae.length&&K.push(Ae)}function qt(me){var K=[];return K.size=me.size,K.start=me.start,K.end=me.end,K}function or(me,K,q,ce,ae,xe){for(var Ee=0;EeEe.maxX&&(Ee.maxX=He),We>Ee.maxY&&(Ee.maxY=We)}return Ee}function ht(me,K,q,ce){var ae=K.geometry,xe=K.type,Ee=[];if(xe==="Point"||xe==="MultiPoint")for(var be=0;be0&&K.size<(ae?Ee:ce))q.numPoints+=K.length/3;else{for(var be=[],Ce=0;CeEe)&&(q.numSimplified++,be.push(K[Ce]),be.push(K[Ce+1])),q.numPoints++;ae&&function(Ae,He){for(var We=0,Be=0,At=Ae.length,bt=At-2;Be0===He)for(Be=0,At=Ae.length;Be24)throw new Error("maxZoom should be in the 0-24 range");if(K.promoteId&&K.generateId)throw new Error("promoteId and generateId cannot be used together.");var ce=function(ae,xe){var Ee=[];if(ae.type==="FeatureCollection")for(var be=0;be1&&console.time("creation"),Be=this.tiles[We]=ot(me,K,q,ce,Ce),this.tileCoords.push({z:K,x:q,y:ce}),Ae)){Ae>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",K,q,ce,Be.numFeatures,Be.numPoints,Be.numSimplified),console.timeEnd("creation"));var At="z"+K;this.stats[At]=(this.stats[At]||0)+1,this.total++}if(Be.source=me,ae){if(K===Ce.maxZoom||K===ae)continue;var bt=1<1&&console.time("clipping");var Je,Rt,Bt,vr,ir,gr,Br=.5*Ce.buffer/Ce.extent,Jr=.5-Br,Vn=.5+Br,an=1+Br;Je=Rt=Bt=vr=null,ir=xr(me,He,q-Br,q+Vn,0,Be.minX,Be.maxX,Ce),gr=xr(me,He,q+Jr,q+an,0,Be.minX,Be.maxX,Ce),me=null,ir&&(Je=xr(ir,He,ce-Br,ce+Vn,1,Be.minY,Be.maxY,Ce),Rt=xr(ir,He,ce+Jr,ce+an,1,Be.minY,Be.maxY,Ce),ir=null),gr&&(Bt=xr(gr,He,ce-Br,ce+Vn,1,Be.minY,Be.maxY,Ce),vr=xr(gr,He,ce+Jr,ce+an,1,Be.minY,Be.maxY,Ce),gr=null),Ae>1&&console.timeEnd("clipping"),be.push(Je||[],K+1,2*q,2*ce),be.push(Rt||[],K+1,2*q,2*ce+1),be.push(Bt||[],K+1,2*q+1,2*ce),be.push(vr||[],K+1,2*q+1,2*ce+1)}}},$t.prototype.getTile=function(me,K,q){var ce=this.options,ae=ce.extent,xe=ce.debug;if(me<0||me>24)return null;var Ee=1<1&&console.log("drilling down to z%d-%d-%d",me,K,q);for(var Ce,Ae=me,He=K,We=q;!Ce&&Ae>0;)Ae--,He=Math.floor(He/2),We=Math.floor(We/2),Ce=this.tiles[ur(Ae,He,We)];return Ce&&Ce.source?(xe>1&&console.log("found parent tile z%d-%d-%d",Ae,He,We),xe>1&&console.time("drilling down"),this.splitTile(Ce.source,Ae,He,We,me,K,q),xe>1&&console.timeEnd("drilling down"),this.tiles[be]?fr(this.tiles[be],ae):null):null};class qr extends R{constructor(K,q,ce,ae){super(K,q,ce,Ir),ae&&(this.loadGeoJSON=ae)}loadData(K,q){var ce;(ce=this._pendingRequest)===null||ce===void 0||ce.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ae=!!(K&&K.request&&K.request.collectResourceTiming)&&new o.RequestPerformance(K.request);this._pendingCallback=q,this._pendingRequest=this.loadGeoJSON(K,(xe,Ee)=>{if(delete this._pendingCallback,delete this._pendingRequest,xe||!Ee)return q(xe);if(typeof Ee!="object")return q(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`));{I(Ee,!0);try{if(K.filter){const Ce=o.createExpression(K.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ce.result==="error")throw new Error(Ce.value.map(He=>`${He.key}: ${He.message}`).join(", "));Ee={type:"FeatureCollection",features:Ee.features.filter(He=>Ce.value.evaluate({zoom:0},He))}}this._geoJSONIndex=K.cluster?new Pt(function({superclusterOptions:Ce,clusterProperties:Ae}){if(!Ae||!Ce)return Ce;const He={},We={},Be={accumulated:null,zoom:0},At={properties:null},bt=Object.keys(Ae);for(const Je of bt){const[Rt,Bt]=Ae[Je],vr=o.createExpression(Bt),ir=o.createExpression(typeof Rt=="string"?[Rt,["accumulated"],["get",Je]]:Rt);He[Je]=vr.value,We[Je]=ir.value}return Ce.map=Je=>{At.properties=Je;const Rt={};for(const Bt of bt)Rt[Bt]=He[Bt].evaluate(Be,At);return Rt},Ce.reduce=(Je,Rt)=>{At.properties=Rt;for(const Bt of bt)Be.accumulated=Je[Bt],Je[Bt]=We[Bt].evaluate(Be,At)},Ce}(K)).load(Ee.features):function(Ce,Ae){return new $t(Ce,Ae)}(Ee,K.geojsonVtOptions)}catch(Ce){return q(Ce)}this.loaded={};const be={};if(ae){const Ce=ae.finish();Ce&&(be.resourceTiming={},be.resourceTiming[K.source]=JSON.parse(JSON.stringify(Ce)))}q(null,be)}})}reloadTile(K,q){const ce=this.loaded;return ce&&ce[K.uid]?super.reloadTile(K,q):this.loadTile(K,q)}loadGeoJSON(K,q){if(K.request)return o.getJSON(K.request,q);if(typeof K.data=="string")try{q(null,JSON.parse(K.data))}catch{q(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`))}else q(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(K,q){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),q()}getClusterExpansionZoom(K,q){try{q(null,this._geoJSONIndex.getClusterExpansionZoom(K.clusterId))}catch(ce){q(ce)}}getClusterChildren(K,q){try{q(null,this._geoJSONIndex.getChildren(K.clusterId))}catch(ce){q(ce)}}getClusterLeaves(K,q){try{q(null,this._geoJSONIndex.getLeaves(K.clusterId,K.limit,K.offset))}catch(ce){q(ce)}}}class Gr{constructor(K){this.self=K,this.actor=new o.Actor(K,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:R,geojson:qr},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(q,ce)=>{if(this.workerSourceTypes[q])throw new Error(`Worker source with name "${q}" already registered.`);this.workerSourceTypes[q]=ce},this.self.registerRTLTextPlugin=q=>{if(o.plugin.isParsed())throw new Error("RTL text plugin already registered.");o.plugin.applyArabicShaping=q.applyArabicShaping,o.plugin.processBidirectionalText=q.processBidirectionalText,o.plugin.processStyledBidirectionalText=q.processStyledBidirectionalText}}setReferrer(K,q){this.referrer=q}setImages(K,q,ce){this.availableImages[K]=q;for(const ae in this.workerSources[K]){const xe=this.workerSources[K][ae];for(const Ee in xe)xe[Ee].availableImages=q}ce()}setLayers(K,q,ce){this.getLayerIndex(K).replace(q),ce()}updateLayers(K,q,ce){this.getLayerIndex(K).update(q.layers,q.removedIds),ce()}loadTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).loadTile(q,ce)}loadDEMTile(K,q,ce){this.getDEMWorkerSource(K,q.source).loadTile(q,ce)}reloadTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).reloadTile(q,ce)}abortTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).abortTile(q,ce)}removeTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).removeTile(q,ce)}removeDEMTile(K,q){this.getDEMWorkerSource(K,q.source).removeTile(q)}removeSource(K,q,ce){if(!this.workerSources[K]||!this.workerSources[K][q.type]||!this.workerSources[K][q.type][q.source])return;const ae=this.workerSources[K][q.type][q.source];delete this.workerSources[K][q.type][q.source],ae.removeSource!==void 0?ae.removeSource(q,ce):ce()}loadWorkerSource(K,q,ce){try{this.self.importScripts(q.url),ce()}catch(ae){ce(ae.toString())}}syncRTLPluginState(K,q,ce){try{o.plugin.setState(q);const ae=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&ae!=null){this.self.importScripts(ae);const xe=o.plugin.isParsed();ce(xe?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ae}`),xe)}}catch(ae){ce(ae.toString())}}getAvailableImages(K){let q=this.availableImages[K];return q||(q=[]),q}getLayerIndex(K){let q=this.layerIndexes[K];return q||(q=this.layerIndexes[K]=new v),q}getWorkerSource(K,q,ce){if(this.workerSources[K]||(this.workerSources[K]={}),this.workerSources[K][q]||(this.workerSources[K][q]={}),!this.workerSources[K][q][ce]){const ae={send:(xe,Ee,be)=>{this.actor.send(xe,Ee,be,K)}};this.workerSources[K][q][ce]=new this.workerSourceTypes[q](ae,this.getLayerIndex(K),this.getAvailableImages(K))}return this.workerSources[K][q][ce]}getDEMWorkerSource(K,q){return this.demWorkerSources[K]||(this.demWorkerSources[K]={}),this.demWorkerSources[K][q]||(this.demWorkerSources[K][q]=new A),this.demWorkerSources[K][q]}enforceCacheSizeLimit(K,q){o.enforceCacheSizeLimit(q)}}return o.isWorker()&&(self.worker=new Gr(self)),Gr}),a(["./shared"],function(o){var f=p;function p(x){return!function(l){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 g,b,P=new Blob([""],{type:"text/javascript"}),z=URL.createObjectURL(P);try{b=new Worker(z),g=!0}catch{g=!1}return b&&b.terminate(),URL.revokeObjectURL(z),g}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var g=document.createElement("canvas");g.width=g.height=1;var b=g.getContext("2d");if(!b)return!1;var P=b.getImageData(0,0,1,1);return P&&P.width===g.width}()?(v[h=l&&l.failIfMajorPerformanceCaveat]===void 0&&(v[h]=function(g){var b,P=function(z){var $=document.createElement("canvas"),V=Object.create(p.webGLContextAttributes);return V.failIfMajorPerformanceCaveat=z,$.getContext("webgl",V)||$.getContext("experimental-webgl",V)}(g);if(!P)return!1;try{b=P.createShader(P.VERTEX_SHADER)}catch{return!1}return!(!b||P.isContextLost())&&(P.shaderSource(b,"void main() {}"),P.compileShader(b),P.getShaderParameter(b,P.COMPILE_STATUS)===!0)}(h)),v[h]?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 h}(x)}var v={};function y(x,l){if(Array.isArray(x)){if(!Array.isArray(l)||x.length!==l.length)return!1;for(let h=0;h{window.removeEventListener("click",w.suppressClickInternal,!0)},0)}static mousePos(l,h){const g=l.getBoundingClientRect();return new o.pointGeometry(h.clientX-g.left-l.clientLeft,h.clientY-g.top-l.clientTop)}static touchPos(l,h){const g=l.getBoundingClientRect(),b=[];for(let P=0;P-1);V++,P[V]=$,z[V]=W,z[V+1]=O}for(let $=0,V=0;${let $=this.entries[b];$||($=this.entries[b]={glyphs:{},requests:{},ranges:{}});let V=$.glyphs[P];if(V!==void 0)return void z(null,{stack:b,id:P,glyph:V});if(V=this._tinySDF($,b,P),V)return $.glyphs[P]=V,void z(null,{stack:b,id:P,glyph:V});const W=Math.floor(P/256);if(256*W>65535)return void z(new Error("glyphs > 65535 not supported"));if($.ranges[W])return void z(null,{stack:b,id:P,glyph:V});let ee=$.requests[W];ee||(ee=$.requests[W]=[],B.loadGlyphRange(b,W,this.url,this.requestManager,(ie,fe)=>{if(fe){for(const Se in fe)this._doesCharSupportLocalGlyph(+Se)||($.glyphs[+Se]=fe[+Se]);$.ranges[W]=!0}for(const Se of ee)Se(ie,fe);delete $.requests[W]})),ee.push((ie,fe)=>{ie?z(ie):fe&&z(null,{stack:b,id:P,glyph:fe[P]||null})})},(b,P)=>{if(b)h(b);else if(P){const z={};for(const{stack:$,id:V,glyph:W}of P)(z[$]||(z[$]={}))[V]=W&&{id:W.id,bitmap:W.bitmap.clone(),metrics:W.metrics};h(null,z)}})}_doesCharSupportLocalGlyph(l){return!!this.localIdeographFontFamily&&(o.unicodeBlockLookup["CJK Unified Ideographs"](l)||o.unicodeBlockLookup["Hangul Syllables"](l)||o.unicodeBlockLookup.Hiragana(l)||o.unicodeBlockLookup.Katakana(l))}_tinySDF(l,h,g){const b=this.localIdeographFontFamily;if(!b||!this._doesCharSupportLocalGlyph(g))return;let P=l.tinySDF;if(!P){let $="400";/bold/i.test(h)?$="900":/medium/i.test(h)?$="500":/light/i.test(h)&&($="200"),P=l.tinySDF=new B.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:b,fontWeight:$})}const z=P.draw(String.fromCharCode(g));return{id:g,bitmap:new o.AlphaImage({width:z.width||30,height:z.height||30},z.data),metrics:{width:z.glyphWidth||24,height:z.glyphHeight||24,left:z.glyphLeft||0,top:z.glyphTop-27||-8,advance:z.glyphAdvance||24}}}}B.loadGlyphRange=function(x,l,h,g,b){const P=256*l,z=P+255,$=g.transformRequest(h.replace("{fontstack}",x).replace("{range}",`${P}-${z}`),o.ResourceType.Glyphs);o.getArrayBuffer($,(V,W)=>{if(V)b(V);else if(W){const ee={};for(const ie of o.parseGlyphPbf(W))ee[ie.id]=ie;b(null,ee)}})},B.TinySDF=class{constructor({fontSize:x=24,buffer:l=3,radius:h=8,cutoff:g=.25,fontFamily:b="sans-serif",fontWeight:P="normal",fontStyle:z="normal"}={}){this.buffer=l,this.cutoff=g,this.radius=h;const $=this.size=x+4*l,V=this._createCanvas($),W=this.ctx=V.getContext("2d",{willReadFrequently:!0});W.font=`${z} ${P} ${x}px ${b}`,W.textBaseline="alphabetic",W.textAlign="left",W.fillStyle="black",this.gridOuter=new Float64Array($*$),this.gridInner=new Float64Array($*$),this.f=new Float64Array($),this.z=new Float64Array($+1),this.v=new Uint16Array($)}_createCanvas(x){const l=document.createElement("canvas");return l.width=l.height=x,l}draw(x){const{width:l,actualBoundingBoxAscent:h,actualBoundingBoxDescent:g,actualBoundingBoxLeft:b,actualBoundingBoxRight:P}=this.ctx.measureText(x),z=Math.ceil(h),$=Math.min(this.size-this.buffer,Math.ceil(P-b)),V=Math.min(this.size-this.buffer,z+Math.ceil(g)),W=$+2*this.buffer,ee=V+2*this.buffer,ie=Math.max(W*ee,0),fe=new Uint8ClampedArray(ie),Se={data:fe,width:W,height:ee,glyphWidth:$,glyphHeight:V,glyphTop:z,glyphLeft:0,glyphAdvance:l};if($===0||V===0)return Se;const{ctx:_e,buffer:we,gridInner:$e,gridOuter:Ue}=this;_e.clearRect(we,we,$,V),_e.fillText(x,we,we+z);const et=_e.getImageData(we,we,$,V);Ue.fill(O,0,ie),$e.fill(0,0,ie);for(let Pe=0;Pe0?yt*yt:0,$e[gt]=yt<0?yt*yt:0}}N(Ue,0,0,W,ee,W,this.f,this.v,this.z),N($e,we,we,$,V,W,this.f,this.v,this.z);for(let Pe=0;Pe1&&(V=l[++$]);const ee=Math.abs(W-V.left),ie=Math.abs(W-V.right),fe=Math.min(ee,ie);let Se;const _e=P/g*(b+1);if(V.isDash){const we=b-Math.abs(_e);Se=Math.sqrt(fe*fe+we*we)}else Se=b-Math.sqrt(fe*fe+_e*_e);this.data[z+W]=Math.max(0,Math.min(255,Se+128))}}}addRegularDash(l){for(let $=l.length-1;$>=0;--$){const V=l[$],W=l[$+1];V.zeroLength?l.splice($,1):W&&W.isDash===V.isDash&&(W.left=V.left,l.splice($,1))}const h=l[0],g=l[l.length-1];h.isDash===g.isDash&&(h.left=g.left-this.width,g.right=h.right+this.width);const b=this.width*this.nextRow;let P=0,z=l[P];for(let $=0;$1&&(z=l[++P]);const V=Math.abs($-z.left),W=Math.abs($-z.right),ee=Math.min(V,W);this.data[b+$]=Math.max(0,Math.min(255,(z.isDash?ee:-ee)+128))}}addDash(l,h){const g=h?7:0,b=2*g+1;if(this.nextRow+b>this.height)return o.warnOnce("LineAtlas out of space"),null;let P=0;for(let $=0;${b.send(l,h,P)},g=g||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(l=>{l.remove()}),this.actors=[],this.workerPool.release(this.id)}}function le(x,l,h){const g=function(b,P){if(b)return h(b);if(P){const z=o.pick(o.extend(P,x),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);P.vector_layers&&(z.vectorLayers=P.vector_layers,z.vectorLayerIds=z.vectorLayers.map($=>$.id)),h(null,z)}};return x.url?o.getJSON(l.transformRequest(x.url,o.ResourceType.Source),g):o.exported.frame(()=>g(null,x))}Y.Actor=o.Actor;class J{constructor(l,h,g){this.bounds=o.LngLatBounds.convert(this.validateBounds(l)),this.minzoom=h||0,this.maxzoom=g||24}validateBounds(l){return Array.isArray(l)&&l.length===4?[Math.max(-180,l[0]),Math.max(-90,l[1]),Math.min(180,l[2]),Math.min(90,l[3])]:[-180,-90,180,90]}contains(l){const h=Math.pow(2,l.z),g=Math.floor(o.mercatorXfromLng(this.bounds.getWest())*h),b=Math.floor(o.mercatorYfromLat(this.bounds.getNorth())*h),P=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*h),z=Math.ceil(o.mercatorYfromLat(this.bounds.getSouth())*h);return l.x>=g&&l.x=b&&l.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),l?this.fire(new o.ErrorEvent(l)):h&&(o.extend(this,h),h.bounds&&(this.tileBounds=new J(h.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}onAdd(l){this.map=l,this.load()}setSourceProperty(l){this._tileJSONRequest&&this._tileJSONRequest.cancel(),l(),this.load()}setTiles(l){return this.setSourceProperty(()=>{this._options.tiles=l}),this}setUrl(l){return this.setSourceProperty(()=>{this.url=l,this._options.url=l}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}loadTile(l,h){const g=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),b={request:this.map._requestManager.transformRequest(g,o.ResourceType.Tile),uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,tileSize:this.tileSize*l.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function P(z,$){return delete l.request,l.aborted?h(null):z&&z.status!==404?h(z):($&&$.resourceTiming&&(l.resourceTiming=$.resourceTiming),this.map._refreshExpiredTiles&&$&&l.setExpiryData($),l.loadVectorData($,this.map.painter),o.cacheEntryPossiblyAdded(this.dispatcher),h(null),void(l.reloadCallback&&(this.loadTile(l,l.reloadCallback),l.reloadCallback=null)))}b.request.collectResourceTiming=this._collectResourceTiming,l.actor&&l.state!=="expired"?l.state==="loading"?l.reloadCallback=h:l.request=l.actor.send("reloadTile",b,P.bind(this)):(l.actor=this.dispatcher.getActor(),l.request=l.actor.send("loadTile",b,P.bind(this)))}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.actor&&l.actor.send("abortTile",{uid:l.uid,type:this.type,source:this.id},void 0)}unloadTile(l){l.unloadVectorData(),l.actor&&l.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Q extends o.Evented{constructor(l,h,g,b){super(),this.id=l,this.dispatcher=g,this.setEventedParent(b),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.extend({type:"raster"},h),o.extend(this,o.pick(h,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=le(this._options,this.map._requestManager,(l,h)=>{this._tileJSONRequest=null,this._loaded=!0,l?this.fire(new o.ErrorEvent(l)):h&&(o.extend(this,h),h.bounds&&(this.tileBounds=new J(h.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(l){this.map=l,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,h){const g=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);l.request=o.getImage(this.map._requestManager.transformRequest(g,o.ResourceType.Tile),(b,P,z)=>{if(delete l.request,l.aborted)l.state="unloaded",h(null);else if(b)l.state="errored",h(b);else if(P){this.map._refreshExpiredTiles&&l.setExpiryData(z);const $=this.map.painter.context,V=$.gl;l.texture=this.map.painter.getTileTexture(P.width),l.texture?l.texture.update(P,{useMipmap:!0}):(l.texture=new R($,P,V.RGBA,{useMipmap:!0}),l.texture.bind(V.LINEAR,V.CLAMP_TO_EDGE,V.LINEAR_MIPMAP_NEAREST),$.extTextureFilterAnisotropic&&V.texParameterf(V.TEXTURE_2D,$.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$.extTextureFilterAnisotropicMax)),l.state="loaded",o.cacheEntryPossiblyAdded(this.dispatcher),h(null)}})}abortTile(l,h){l.request&&(l.request.cancel(),delete l.request),h()}unloadTile(l,h){l.texture&&this.map.painter.saveTileTexture(l.texture),h()}hasTransition(){return!1}}let ge;class ne extends Q{constructor(l,h,g,b){super(l,h,g,b),this.type="raster-dem",this.maxzoom=22,this._options=o.extend({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(l,h){const g=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function b(P,z){P&&(l.state="errored",h(P)),z&&(l.dem=z,l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0,l.state="loaded",h(null))}l.request=o.getImage(this.map._requestManager.transformRequest(g,o.ResourceType.Tile),function(P,z){if(delete l.request,l.aborted)l.state="unloaded",h(null);else if(P)l.state="errored",h(P);else if(z){this.map._refreshExpiredTiles&&l.setExpiryData(z),delete z.cacheControl,delete z.expires;const $=o.isImageBitmap(z)&&(ge==null&&(ge=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ge)?z:o.exported.getImageData(z,1),V={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:$,encoding:this.encoding};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",V,b.bind(this)))}}.bind(this)),l.neighboringTiles=this._getNeighboringTiles(l.tileID)}_getNeighboringTiles(l){const h=l.canonical,g=Math.pow(2,h.z),b=(h.x-1+g)%g,P=h.x===0?l.wrap-1:l.wrap,z=(h.x+1+g)%g,$=h.x+1===g?l.wrap+1:l.wrap,V={};return V[new o.OverscaledTileID(l.overscaledZ,P,h.z,b,h.y).key]={backfilled:!1},V[new o.OverscaledTileID(l.overscaledZ,$,h.z,z,h.y).key]={backfilled:!1},h.y>0&&(V[new o.OverscaledTileID(l.overscaledZ,P,h.z,b,h.y-1).key]={backfilled:!1},V[new o.OverscaledTileID(l.overscaledZ,l.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},V[new o.OverscaledTileID(l.overscaledZ,$,h.z,z,h.y-1).key]={backfilled:!1}),h.y+1{if(this._pendingLoads--,this._removed||P&&P.abandoned)return void this.fire(new o.Event("dataabort",{dataType:"source",sourceDataType:l}));let z=null;if(P&&P.resourceTiming&&P.resourceTiming[this.id]&&(z=P.resourceTiming[this.id].slice(0)),b)return void this.fire(new o.ErrorEvent(b));const $={dataType:"source",sourceDataType:l};this._collectResourceTiming&&z&&z.length>0&&o.extend($,{resourceTiming:z}),this.fire(new o.Event("data",$))})}loaded(){return this._pendingLoads===0}loadTile(l,h){const g=l.actor?"reloadTile":"loadTile";l.actor=this.actor;const b={type:this.type,uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};l.request=this.actor.send(g,b,(P,z)=>(delete l.request,l.unloadVectorData(),l.aborted?h(null):P?h(P):(l.loadVectorData(z,this.map.painter,g==="reloadTile"),h(null))))}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return o.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var oe=o.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class ye extends o.Evented{constructor(l,h,g,b){super(),this.id=l,this.dispatcher=g,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(b),this.options=h}load(l,h){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this.url=this.options.url,o.getImage(this.map._requestManager.transformRequest(this.url,o.ResourceType.Image),(g,b)=>{this._loaded=!0,g?this.fire(new o.ErrorEvent(g)):b&&(this.image=b,l&&(this.coordinates=l),h&&h(),this._finishLoading())})}loaded(){return this._loaded}updateImage(l){return this.image&&l.url?(this.options.url=l.url,this.load(l.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(l){this.map=l,this.load()}setCoordinates(l){this.coordinates=l;const h=l.map(o.MercatorCoordinate.fromLngLat);this.tileID=function(b){let P=1/0,z=1/0,$=-1/0,V=-1/0;for(const fe of b)P=Math.min(P,fe.x),z=Math.min(z,fe.y),$=Math.max($,fe.x),V=Math.max(V,fe.y);const W=Math.max($-P,V-z),ee=Math.max(0,Math.floor(-Math.log(W)/Math.LN2)),ie=Math.pow(2,ee);return new o.CanonicalTileID(ee,Math.floor((P+$)/2*ie),Math.floor((z+V)/2*ie))}(h),this.minzoom=this.maxzoom=this.tileID.z;const g=h.map(b=>this.tileID.getTilePoint(b)._round());return this._boundsArray=new o.RasterBoundsArray,this._boundsArray.emplaceBack(g[0].x,g[0].y,0,0),this._boundsArray.emplaceBack(g[1].x,g[1].y,o.EXTENT,0),this._boundsArray.emplaceBack(g[3].x,g[3].y,0,o.EXTENT),this._boundsArray.emplaceBack(g[2].x,g[2].y,o.EXTENT,o.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const l=this.map.painter.context,h=l.gl;this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new R(l,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture)}}loadTile(l,h){this.tileID&&this.tileID.equals(l.tileID.canonical)?(this.tiles[String(l.tileID.wrap)]=l,l.buckets={},h(null)):(l.state="errored",h(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Re extends ye{constructor(l,h,g,b){super(l,h,g,b),this.roundZoom=!0,this.type="video",this.options=h}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const h of l.urls)this.urls.push(this.map._requestManager.transformRequest(h,o.ResourceType.Source).url);o.getVideo(this.urls,(h,g)=>{this._loaded=!0,h?this.fire(new o.ErrorEvent(h)):g&&(this.video=g,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(l){if(this.video){const h=this.video.seekable;lh.end(0)?this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,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 l=this.map.painter.context,h=l.gl;this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new R(l,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Te extends ye{constructor(l,h,g,b){super(l,h,g,b),h.coordinates?Array.isArray(h.coordinates)&&h.coordinates.length===4&&!h.coordinates.some(P=>!Array.isArray(P)||P.length!==2||P.some(z=>typeof z!="number"))||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),h.animate&&typeof h.animate!="boolean"&&this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),h.canvas?typeof h.canvas=="string"||h.canvas instanceof HTMLCanvasElement||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,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 o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=h,this.animate=h.animate===void 0||h.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 o.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(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const h=this.map.painter.context,g=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new R(h,this.canvas,g.RGBA,{premultiply:!0});for(const b in this.tiles){const P=this.tiles[b];P.state!=="loaded"&&(P.state="loaded",P.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}}const ke={vector:Z,raster:Q,"raster-dem":ne,geojson:de,video:Re,image:ye,canvas:Te};function ze(x,l){const h=o.create();return o.translate(h,h,[1,1,0]),o.scale(h,h,[.5*x.width,.5*x.height,1]),o.multiply(h,h,x.calculatePosMatrix(l.toUnwrapped()))}function Ie(x,l,h,g,b,P){const z=function(ie,fe,Se){if(ie)for(const _e of ie){const we=fe[_e];if(we&&we.source===Se&&we.type==="fill-extrusion")return!0}else for(const _e in fe){const we=fe[_e];if(we.source===Se&&we.type==="fill-extrusion")return!0}return!1}(b&&b.layers,l,x.id),$=P.maxPitchScaleFactor(),V=x.tilesIn(g,$,z);V.sort(Ne);const W=[];for(const ie of V)W.push({wrappedTileID:ie.tileID.wrapped().key,queryResults:ie.tile.queryRenderedFeatures(l,h,x._state,ie.queryGeometry,ie.cameraQueryGeometry,ie.scale,b,P,$,ze(x.transform,ie.tileID))});const ee=function(ie){const fe={},Se={};for(const _e of ie){const we=_e.queryResults,$e=_e.wrappedTileID,Ue=Se[$e]=Se[$e]||{};for(const et in we){const Pe=we[et],at=Ue[et]=Ue[et]||{},rt=fe[et]=fe[et]||[];for(const gt of Pe)at[gt.featureIndex]||(at[gt.featureIndex]=!0,rt.push(gt))}}return fe}(W);for(const ie in ee)ee[ie].forEach(fe=>{const Se=fe.feature,_e=x.getFeatureState(Se.layer["source-layer"],Se.id);Se.source=Se.layer.source,Se.layer["source-layer"]&&(Se.sourceLayer=Se.layer["source-layer"]),Se.state=_e});return ee}function Ne(x,l){const h=x.tileID,g=l.tileID;return h.overscaledZ-g.overscaledZ||h.canonical.y-g.canonical.y||h.wrap-g.wrap||h.canonical.x-g.canonical.x}class De{constructor(l,h){this.tileID=l,this.uid=o.uniqueId(),this.uses=0,this.tileSize=h,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(l){const h=l+this.timeAdded;hl.saveTileTexture(h)),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(l,h,g){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",l){l.featureIndex&&(this.latestFeatureIndex=l.featureIndex,l.rawTileData?(this.latestRawTileData=l.rawTileData,this.latestFeatureIndex.rawTileData=l.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=l.collisionBoxArray,this.buckets=function(b,P){const z={};if(!P)return z;for(const $ of b){const V=$.layerIds.map(W=>P.getLayer(W)).filter(Boolean);if(V.length!==0){$.layers=V,$.stateDependentLayerIds&&($.stateDependentLayers=$.stateDependentLayerIds.map(W=>V.filter(ee=>ee.id===W)[0]));for(const W of V)z[W.id]=$}}return z}(l.buckets,h.style),this.hasSymbolBuckets=!1;for(const b in this.buckets){const P=this.buckets[b];if(P instanceof o.SymbolBucket){if(this.hasSymbolBuckets=!0,!g)break;P.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const b in this.buckets){const P=this.buckets[b];if(P instanceof o.SymbolBucket&&P.hasRTLText){this.hasRTLText=!0,o.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const b in this.buckets){const P=this.buckets[b];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(b).queryRadius(P))}l.imageAtlas&&(this.imageAtlas=l.imageAtlas),l.glyphAtlasImage&&(this.glyphAtlasImage=l.glyphAtlasImage)}else this.collisionBoxArray=new o.CollisionBoxArray}unloadVectorData(){for(const l in this.buckets)this.buckets[l].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(l){return this.buckets[l.id]}upload(l){for(const g in this.buckets){const b=this.buckets[g];b.uploadPending()&&b.upload(l)}const h=l.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new R(l,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new R(l,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(l){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(l,this.imageAtlasTexture)}queryRenderedFeatures(l,h,g,b,P,z,$,V,W,ee){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:b,cameraQueryGeometry:P,scale:z,tileSize:this.tileSize,pixelPosMatrix:ee,transform:V,params:$,queryPadding:this.queryPadding*W},l,h,g):{}}querySourceFeatures(l,h){const g=this.latestFeatureIndex;if(!g||!g.rawTileData)return;const b=g.loadVTLayers(),P=h?h.sourceLayer:"",z=b._geojsonTileLayer||b[P];if(!z)return;const $=o.createFilter(h&&h.filter),{z:V,x:W,y:ee}=this.tileID.canonical,ie={z:V,x:W,y:ee};for(let fe=0;feg)b=!1;else if(h)if(this.expirationTime{this.remove(l,P)},g)),this.data[b].push(P),this.order.push(b),this.order.length>this.max){const z=this._getAndRemoveByKey(this.order[0]);z&&this.onRemove(z)}return this}has(l){return l.wrapped().key in this.data}getAndRemove(l){return this.has(l)?this._getAndRemoveByKey(l.wrapped().key):null}_getAndRemoveByKey(l){const h=this.data[l].shift();return h.timeout&&clearTimeout(h.timeout),this.data[l].length===0&&delete this.data[l],this.order.splice(this.order.indexOf(l),1),h.value}getByKey(l){const h=this.data[l];return h?h[0].value:null}get(l){return this.has(l)?this.data[l.wrapped().key][0].value:null}remove(l,h){if(!this.has(l))return this;const g=l.wrapped().key,b=h===void 0?0:this.data[g].indexOf(h),P=this.data[g][b];return this.data[g].splice(b,1),P.timeout&&clearTimeout(P.timeout),this.data[g].length===0&&delete this.data[g],this.onRemove(P.value),this.order.splice(this.order.indexOf(g),1),this}setMaxSize(l){for(this.max=l;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(l){const h=[];for(const g in this.data)for(const b of this.data[g])l(b.value)||h.push(b);for(const g of h)this.remove(g.value.tileID,g)}}class Ge{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(l,h,g){const b=String(h);if(this.stateChanges[l]=this.stateChanges[l]||{},this.stateChanges[l][b]=this.stateChanges[l][b]||{},o.extend(this.stateChanges[l][b],g),this.deletedStates[l]===null){this.deletedStates[l]={};for(const P in this.state[l])P!==b&&(this.deletedStates[l][P]=null)}else if(this.deletedStates[l]&&this.deletedStates[l][b]===null){this.deletedStates[l][b]={};for(const P in this.state[l][b])g[P]||(this.deletedStates[l][b][P]=null)}else for(const P in g)this.deletedStates[l]&&this.deletedStates[l][b]&&this.deletedStates[l][b][P]===null&&delete this.deletedStates[l][b][P]}removeFeatureState(l,h,g){if(this.deletedStates[l]===null)return;const b=String(h);if(this.deletedStates[l]=this.deletedStates[l]||{},g&&h!==void 0)this.deletedStates[l][b]!==null&&(this.deletedStates[l][b]=this.deletedStates[l][b]||{},this.deletedStates[l][b][g]=null);else if(h!==void 0)if(this.stateChanges[l]&&this.stateChanges[l][b])for(g in this.deletedStates[l][b]={},this.stateChanges[l][b])this.deletedStates[l][b][g]=null;else this.deletedStates[l][b]=null;else this.deletedStates[l]=null}getState(l,h){const g=String(h),b=o.extend({},(this.state[l]||{})[g],(this.stateChanges[l]||{})[g]);if(this.deletedStates[l]===null)return{};if(this.deletedStates[l]){const P=this.deletedStates[l][h];if(P===null)return{};for(const z in P)delete b[z]}return b}initializeTileState(l,h){l.setFeatureState(this.state,h)}coalesceChanges(l,h){const g={};for(const b in this.stateChanges){this.state[b]=this.state[b]||{};const P={};for(const z in this.stateChanges[b])this.state[b][z]||(this.state[b][z]={}),o.extend(this.state[b][z],this.stateChanges[b][z]),P[z]=this.state[b][z];g[b]=P}for(const b in this.deletedStates){this.state[b]=this.state[b]||{};const P={};if(this.deletedStates[b]===null)for(const z in this.state[b])P[z]={},this.state[b][z]={};else for(const z in this.deletedStates[b]){if(this.deletedStates[b][z]===null)this.state[b][z]={};else for(const $ of Object.keys(this.deletedStates[b][z]))delete this.state[b][z][$];P[z]=this.state[b][z]}g[b]=g[b]||{},o.extend(g[b],P)}if(this.stateChanges={},this.deletedStates={},Object.keys(g).length!==0)for(const b in l)l[b].setFeatureState(g,h)}}class je extends o.Evented{constructor(l,h,g){super(),this.id=l,this.dispatcher=g,this.on("data",b=>{b.dataType==="source"&&b.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&b.dataType==="source"&&b.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(b,P,z,$){const V=new ke[P.type](b,P,z,$);if(V.id!==b)throw new Error(`Expected Source id to be ${b} instead of ${V.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],V),V}(l,h,g,this),this._tiles={},this._cache=new Ve(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ge}onAdd(l){this.map=l,this._maxTileCacheSize=l?l._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(l)}onRemove(l){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(l)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const l in this._tiles){const h=this._tiles[l];if(h.state!=="loaded"&&h.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const l=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,l&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(l,h){return this._source.loadTile(l,h)}_unloadTile(l){if(this._source.unloadTile)return this._source.unloadTile(l,()=>{})}_abortTile(l){this._source.abortTile&&this._source.abortTile(l,()=>{}),this._source.fire(new o.Event("dataabort",{tile:l,coord:l.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(l){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const g=this._tiles[h];g.upload(l),g.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(l=>l.tileID).sort(ct).map(l=>l.key)}getRenderableIds(l){const h=[];for(const g in this._tiles)this._isIdRenderable(g,l)&&h.push(this._tiles[g]);return l?h.sort((g,b)=>{const P=g.tileID,z=b.tileID,$=new o.pointGeometry(P.canonical.x,P.canonical.y)._rotate(this.transform.angle),V=new o.pointGeometry(z.canonical.x,z.canonical.y)._rotate(this.transform.angle);return P.overscaledZ-z.overscaledZ||V.y-$.y||V.x-$.x}).map(g=>g.tileID.key):h.map(g=>g.tileID).sort(ct).map(g=>g.key)}hasRenderableParent(l){const h=this.findLoadedParent(l,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(l,h){return this._tiles[l]&&this._tiles[l].hasData()&&!this._coveredTiles[l]&&(h||!this._tiles[l].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const l in this._tiles)this._tiles[l].state!=="errored"&&this._reloadTile(l,"reloading")}}_reloadTile(l,h){const g=this._tiles[l];g&&(g.state!=="loading"&&(g.state=h),this._loadTile(g,this._tileLoaded.bind(this,g,l,h)))}_tileLoaded(l,h,g,b){if(b)return l.state="errored",void(b.status!==404?this._source.fire(new o.ErrorEvent(b,{tile:l})):this.update(this.transform,this.terrain));l.timeAdded=o.exported.now(),g==="expired"&&(l.refreshedUponExpiration=!0),this._setTileReloadTimer(h,l),this.getSource().type==="raster-dem"&&l.dem&&this._backfillDEM(l),this._state.initializeTileState(l,this.map?this.map.painter:null),l.aborted||this._source.fire(new o.Event("data",{dataType:"source",tile:l,coord:l.tileID}))}_backfillDEM(l){const h=this.getRenderableIds();for(let b=0;b1||(Math.abs(z)>1&&(Math.abs(z+V)===1?z+=V:Math.abs(z-V)===1&&(z-=V)),P.dem&&b.dem&&(b.dem.backfillBorder(P.dem,z,$),b.neighboringTiles&&b.neighboringTiles[W]&&(b.neighboringTiles[W].backfilled=!0)))}}getTile(l){return this.getTileByID(l.key)}getTileByID(l){return this._tiles[l]}_retainLoadedChildren(l,h,g,b){for(const P in this._tiles){let z=this._tiles[P];if(b[P]||!z.hasData()||z.tileID.overscaledZ<=h||z.tileID.overscaledZ>g)continue;let $=z.tileID;for(;z&&z.tileID.overscaledZ>h+1;){const W=z.tileID.scaledTo(z.tileID.overscaledZ-1);z=this._tiles[W.key],z&&z.hasData()&&($=W)}let V=$;for(;V.overscaledZ>h;)if(V=V.scaledTo(V.overscaledZ-1),l[V.key]){b[$.key]=$;break}}}findLoadedParent(l,h){if(l.key in this._loadedParentTiles){const g=this._loadedParentTiles[l.key];return g&&g.tileID.overscaledZ>=h?g:null}for(let g=l.overscaledZ-1;g>=h;g--){const b=l.scaledTo(g),P=this._getLoadedTile(b);if(P)return P}}_getLoadedTile(l){const h=this._tiles[l.key];return h&&h.hasData()?h:this._cache.getByKey(l.wrapped().key)}updateCacheSize(l){const h=Math.ceil(l.width/this._source.tileSize)+1,g=Math.ceil(l.height/this._source.tileSize)+1,b=Math.floor(h*g*5),P=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,b):b;this._cache.setMaxSize(P)}handleWrapJump(l){const h=Math.round((l-(this._prevLng===void 0?l:this._prevLng))/360);if(this._prevLng=l,h){const g={};for(const b in this._tiles){const P=this._tiles[b];P.tileID=P.tileID.unwrapTo(P.tileID.wrap+h),g[P.tileID.key]=P}this._tiles=g;for(const b in this._timers)clearTimeout(this._timers[b]),delete this._timers[b];for(const b in this._tiles)this._setTileReloadTimer(b,this._tiles[b])}}update(l,h){if(this.transform=l,this.terrain=h,!this._sourceLoaded||this._paused)return;let g;this.updateCacheSize(l),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?g=l.getVisibleUnwrappedCoordinates(this._source.tileID).map(W=>new o.OverscaledTileID(W.canonical.z,W.wrap,W.canonical.z,W.canonical.x,W.canonical.y)):(g=l.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:h}),this._source.hasTile&&(g=g.filter(W=>this._source.hasTile(W)))):g=[];const b=l.coveringZoomLevel(this._source),P=Math.max(b-je.maxOverzooming,this._source.minzoom),z=Math.max(b+je.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const W={};for(const ee of g)if(ee.canonical.z>this._source.minzoom){const ie=ee.scaledTo(ee.canonical.z-1);W[ie.key]=ie;const fe=ee.scaledTo(Math.max(this._source.minzoom,Math.min(ee.canonical.z,5)));W[fe.key]=fe}g=g.concat(Object.values(W))}const $=this._updateRetainedTiles(g,b);if(pt(this._source.type)){const W={},ee={},ie=Object.keys($);for(const fe of ie){const Se=$[fe],_e=this._tiles[fe];if(!_e||_e.fadeEndTime&&_e.fadeEndTime<=o.exported.now())continue;const we=this.findLoadedParent(Se,P);we&&(this._addTile(we.tileID),W[we.tileID.key]=we.tileID),ee[fe]=Se}this._retainLoadedChildren(ee,b,z,$);for(const fe in W)$[fe]||(this._coveredTiles[fe]=!0,$[fe]=W[fe]);if(h){const fe={},Se={};for(const _e of g)this._tiles[_e.key].hasData()?fe[_e.key]=_e:Se[_e.key]=_e;for(const _e in Se){const we=Se[_e].children(this._source.maxzoom);this._tiles[we[0].key]&&this._tiles[we[1].key]&&this._tiles[we[2].key]&&this._tiles[we[3].key]&&(fe[we[0].key]=$[we[0].key]=we[0],fe[we[1].key]=$[we[1].key]=we[1],fe[we[2].key]=$[we[2].key]=we[2],fe[we[3].key]=$[we[3].key]=we[3],delete Se[_e])}for(const _e in Se){const we=this.findLoadedParent(Se[_e],this._source.minzoom);if(we){fe[we.tileID.key]=$[we.tileID.key]=we.tileID;for(const $e in fe)fe[$e].isChildOf(we.tileID)&&delete fe[$e]}}for(const _e in this._tiles)fe[_e]||(this._coveredTiles[_e]=!0)}}for(const W in $)this._tiles[W].clearFadeHold();const V=o.keysDifference(this._tiles,$);for(const W of V){const ee=this._tiles[W];ee.hasSymbolBuckets&&!ee.holdingForFade()?ee.setHoldDuration(this.map._fadeDuration):ee.hasSymbolBuckets&&!ee.symbolFadeFinished()||this._removeTile(W)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const l in this._tiles)this._tiles[l].holdingForFade()&&this._removeTile(l)}_updateRetainedTiles(l,h){const g={},b={},P=Math.max(h-je.maxOverzooming,this._source.minzoom),z=Math.max(h+je.maxUnderzooming,this._source.minzoom),$={};for(const V of l){const W=this._addTile(V);g[V.key]=V,W.hasData()||hthis._source.maxzoom){const ie=V.children(this._source.maxzoom)[0],fe=this.getTile(ie);if(fe&&fe.hasData()){g[ie.key]=ie;continue}}else{const ie=V.children(this._source.maxzoom);if(g[ie[0].key]&&g[ie[1].key]&&g[ie[2].key]&&g[ie[3].key])continue}let ee=W.wasRequested();for(let ie=V.overscaledZ-1;ie>=P;--ie){const fe=V.scaledTo(ie);if(b[fe.key]||(b[fe.key]=!0,W=this.getTile(fe),!W&&ee&&(W=this._addTile(fe)),W&&(g[fe.key]=fe,ee=W.wasRequested(),W.hasData())))break}}return g}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const l in this._tiles){const h=[];let g,b=this._tiles[l].tileID;for(;b.overscaledZ>0;){if(b.key in this._loadedParentTiles){g=this._loadedParentTiles[b.key];break}h.push(b.key);const P=b.scaledTo(b.overscaledZ-1);if(g=this._getLoadedTile(P),g)break;b=P}for(const P of h)this._loadedParentTiles[P]=g}}_addTile(l){let h=this._tiles[l.key];if(h)return h;h=this._cache.getAndRemove(l),h&&(this._setTileReloadTimer(l.key,h),h.tileID=l,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[l.key]&&(clearTimeout(this._cacheTimers[l.key]),delete this._cacheTimers[l.key],this._setTileReloadTimer(l.key,h)));const g=h;return h||(h=new De(l,this._source.tileSize*l.overscaleFactor()),this._loadTile(h,this._tileLoaded.bind(this,h,l.key,h.state))),h.uses++,this._tiles[l.key]=h,g||this._source.fire(new o.Event("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(l,h){l in this._timers&&(clearTimeout(this._timers[l]),delete this._timers[l]);const g=h.getExpiryTimeout();g&&(this._timers[l]=setTimeout(()=>{this._reloadTile(l,"expired"),delete this._timers[l]},g))}_removeTile(l){const h=this._tiles[l];h&&(h.uses--,delete this._tiles[l],this._timers[l]&&(clearTimeout(this._timers[l]),delete this._timers[l]),h.uses>0||(h.hasData()&&h.state!=="reloading"?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const l in this._tiles)this._removeTile(l);this._cache.reset()}tilesIn(l,h,g){const b=[],P=this.transform;if(!P)return b;const z=g?P.getCameraQueryGeometry(l):l,$=l.map(_e=>P.pointCoordinate(_e,this.terrain)),V=z.map(_e=>P.pointCoordinate(_e,this.terrain)),W=this.getIds();let ee=1/0,ie=1/0,fe=-1/0,Se=-1/0;for(const _e of V)ee=Math.min(ee,_e.x),ie=Math.min(ie,_e.y),fe=Math.max(fe,_e.x),Se=Math.max(Se,_e.y);for(let _e=0;_e=0&&Pe[1].y+et>=0){const at=$.map(gt=>$e.getTilePoint(gt)),rt=V.map(gt=>$e.getTilePoint(gt));b.push({tile:we,tileID:$e,queryGeometry:at,cameraQueryGeometry:rt,scale:Ue})}}return b}getVisibleCoordinates(l){const h=this.getRenderableIds(l).map(g=>this._tiles[g].tileID);for(const g of h)g.posMatrix=this.transform.calculatePosMatrix(g.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(pt(this._source.type))for(const l in this._tiles){const h=this._tiles[l];if(h.fadeEndTime!==void 0&&h.fadeEndTime>=o.exported.now())return!0}return!1}setFeatureState(l,h,g){this._state.updateState(l=l||"_geojsonTileLayer",h,g)}removeFeatureState(l,h,g){this._state.removeFeatureState(l=l||"_geojsonTileLayer",h,g)}getFeatureState(l,h){return this._state.getState(l=l||"_geojsonTileLayer",h)}setDependencies(l,h,g){const b=this._tiles[l];b&&b.setDependencies(h,g)}reloadTilesForDependencies(l,h){for(const g in this._tiles)this._tiles[g].hasDependency(l,h)&&this._reloadTile(g,"reloading");this._cache.filter(g=>!g.hasDependency(l,h))}}function ct(x,l){const h=Math.abs(2*x.wrap)-+(x.wrap<0),g=Math.abs(2*l.wrap)-+(l.wrap<0);return x.overscaledZ-l.overscaledZ||g-h||l.canonical.y-x.canonical.y||l.canonical.x-x.canonical.x}function pt(x){return x==="raster"||x==="image"||x==="video"}je.maxOverzooming=10,je.maxUnderzooming=3;const Tt="mapboxgl_preloaded_worker_pool";class Ye{constructor(){this.active={}}acquire(l){if(!this.workers)for(this.workers=[];this.workers.length{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Tt]}numActive(){return Object.keys(this.active).length}}const Pt=Math.floor(o.exported.hardwareConcurrency/2);let mt;function It(){return mt||(mt=new Ye),mt}function Ct(x,l){const h={};for(const g in x)g!=="ref"&&(h[g]=x[g]);return o.refProperties.forEach(g=>{g in l&&(h[g]=l[g])}),h}function Dt(x){x=x.slice();const l=Object.create(null);for(let h=0;h0?(b-z)/$:0;return this.points[P].mult(1-V).add(this.points[h].mult(V))}}function Fe(x,l){let h=!0;return x==="always"||x!=="never"&&l!=="never"||(h=!1),h}class qe{constructor(l,h,g){const b=this.boxCells=[],P=this.circleCells=[];this.xCellCount=Math.ceil(l/g),this.yCellCount=Math.ceil(h/g);for(let z=0;zthis.width||b<0||h>this.height)return[];const V=[];if(l<=0&&h<=0&&this.width<=g&&this.height<=b){if(P)return[{key:null,x1:l,y1:h,x2:g,y2:b}];for(let W=0;W0}hitTestCircle(l,h,g,b,P){const z=l-g,$=l+g,V=h-g,W=h+g;if($<0||z>this.width||W<0||V>this.height)return!1;const ee=[];return this._forEachCell(z,V,$,W,this._queryCellCircle,ee,{hitTest:!0,overlapMode:b,circle:{x:l,y:h,radius:g},seenUids:{box:{},circle:{}}},P),ee.length>0}_queryCell(l,h,g,b,P,z,$,V){const{seenUids:W,hitTest:ee,overlapMode:ie}=$,fe=this.boxCells[P];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!W.box[we]){W.box[we]=!0;const $e=4*we,Ue=this.boxKeys[we];if(l<=_e[$e+2]&&h<=_e[$e+3]&&g>=_e[$e+0]&&b>=_e[$e+1]&&(!V||V(Ue))&&(!ee||!Fe(ie,Ue.overlapMode))&&(z.push({key:Ue,x1:_e[$e],y1:_e[$e+1],x2:_e[$e+2],y2:_e[$e+3]}),ee))return!0}}const Se=this.circleCells[P];if(Se!==null){const _e=this.circles;for(const we of Se)if(!W.circle[we]){W.circle[we]=!0;const $e=3*we,Ue=this.circleKeys[we];if(this._circleAndRectCollide(_e[$e],_e[$e+1],_e[$e+2],l,h,g,b)&&(!V||V(Ue))&&(!ee||!Fe(ie,Ue.overlapMode))){const et=_e[$e],Pe=_e[$e+1],at=_e[$e+2];if(z.push({key:Ue,x1:et-at,y1:Pe-at,x2:et+at,y2:Pe+at}),ee)return!0}}}return!1}_queryCellCircle(l,h,g,b,P,z,$,V){const{circle:W,seenUids:ee,overlapMode:ie}=$,fe=this.boxCells[P];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!ee.box[we]){ee.box[we]=!0;const $e=4*we,Ue=this.boxKeys[we];if(this._circleAndRectCollide(W.x,W.y,W.radius,_e[$e+0],_e[$e+1],_e[$e+2],_e[$e+3])&&(!V||V(Ue))&&!Fe(ie,Ue.overlapMode))return z.push(!0),!0}}const Se=this.circleCells[P];if(Se!==null){const _e=this.circles;for(const we of Se)if(!ee.circle[we]){ee.circle[we]=!0;const $e=3*we,Ue=this.circleKeys[we];if(this._circlesCollide(_e[$e],_e[$e+1],_e[$e+2],W.x,W.y,W.radius)&&(!V||V(Ue))&&!Fe(ie,Ue.overlapMode))return z.push(!0),!0}}}_forEachCell(l,h,g,b,P,z,$,V){const W=this._convertToXCellCoord(l),ee=this._convertToYCellCoord(h),ie=this._convertToXCellCoord(g),fe=this._convertToYCellCoord(b);for(let Se=W;Se<=ie;Se++)for(let _e=ee;_e<=fe;_e++)if(P.call(this,l,h,g,b,this.xCellCount*_e+Se,z,$,V))return}_convertToXCellCoord(l){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(l*this.xScale)))}_convertToYCellCoord(l){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(l*this.yScale)))}_circlesCollide(l,h,g,b,P,z){const $=b-l,V=P-h,W=g+z;return W*W>$*$+V*V}_circleAndRectCollide(l,h,g,b,P,z,$){const V=(z-b)/2,W=Math.abs(l-(b+V));if(W>V+g)return!1;const ee=($-P)/2,ie=Math.abs(h-(P+ee));if(ie>ee+g)return!1;if(W<=V||ie<=ee)return!0;const fe=W-V,Se=ie-ee;return fe*fe+Se*Se<=g*g}}function Xt(x,l,h,g,b){const P=o.create();return l?(o.scale(P,P,[1/b,1/b,1]),h||o.rotateZ(P,P,g.angle)):o.multiply(P,g.labelPlaneMatrix,x),P}function cr(x,l,h,g,b){if(l){const P=o.clone(x);return o.scale(P,P,[b,b,1]),h||o.rotateZ(P,P,-g.angle),P}return g.glCoordMatrix}function Vt(x,l,h){let g;h?(g=[x.x,x.y,h(x.x,x.y),1],o.transformMat4(g,g,l)):(g=[x.x,x.y,0,1],kr(g,g,l));const b=g[3];return{point:new o.pointGeometry(g[0]/b,g[1]/b),signedDistanceFromCamera:b}}function Ut(x,l){return .5+x/l*.5}function rr(x,l){const h=x[0]/x[3],g=x[1]/x[3];return h>=-l[0]&&h<=l[0]&&g>=-l[1]&&g<=l[1]}function xr(x,l,h,g,b,P,z,$,V,W){const ee=g?x.textSizeData:x.iconSizeData,ie=o.evaluateSizeForZoom(ee,h.transform.zoom),fe=[256/h.width*2+1,256/h.height*2+1],Se=g?x.text.dynamicLayoutVertexArray:x.icon.dynamicLayoutVertexArray;Se.clear();const _e=x.lineVertexArray,we=g?x.text.placedSymbolArray:x.icon.placedSymbolArray,$e=h.transform.width/h.transform.height;let Ue=!1;for(let et=0;etMath.abs(h.x-l.x)*g?{useVertical:!0}:(x===o.WritingMode.vertical?l.yh.x)?{needsFlipping:!0}:null}function qt(x,l,h,g,b,P,z,$,V,W,ee,ie,fe,Se,_e,we){const $e=l/24,Ue=x.lineOffsetX*$e,et=x.lineOffsetY*$e;let Pe;if(x.numGlyphs>1){const at=x.glyphStartIndex+x.numGlyphs,rt=x.lineStartIndex,gt=x.lineStartIndex+x.lineLength,yt=Or($e,$,Ue,et,h,ee,ie,x,V,P,fe,_e,we);if(!yt)return{notEnoughRoom:!0};const zt=Vt(yt.first.point,z,we).point,vt=Vt(yt.last.point,z,we).point;if(g&&!h){const nr=_t(x.writingMode,zt,vt,Se);if(nr)return nr}Pe=[yt.first];for(let nr=x.glyphStartIndex+1;nr0?zt.point:or(ie,yt,rt,1,b,we),nr=_t(x.writingMode,rt,vt,Se);if(nr)return nr}const at=$r($e*$.getoffsetX(x.glyphStartIndex),Ue,et,h,ee,ie,x.segment,x.lineStartIndex,x.lineStartIndex+x.lineLength,V,P,fe,_e,we);if(!at)return{notEnoughRoom:!0};Pe=[at]}for(const at of Pe)o.addDynamicAttributes(W,at.point,at.angle);return{}}function or(x,l,h,g,b,P){const z=Vt(x.add(x.sub(l)._unit()),b,P).point,$=h.sub(z);return h.add($._mult(g/$.mag()))}function $r(x,l,h,g,b,P,z,$,V,W,ee,ie,fe,Se){const _e=g?x-l:x+l;let we=_e>0?1:-1,$e=0;g&&(we*=-1,$e=Math.PI),we<0&&($e+=Math.PI);let Ue=we>0?$+z:$+z+1,et=b,Pe=b,at=0,rt=0;const gt=Math.abs(_e),yt=[];for(;at+rt<=gt;){if(Ue+=we,Ue<$||Ue>=V)return null;if(Pe=et,yt.push(et),et=ie[Ue],et===void 0){const sr=new o.pointGeometry(W.getx(Ue),W.gety(Ue)),Dr=Vt(sr,ee,Se);if(Dr.signedDistanceFromCamera>0)et=ie[Ue]=Dr.point;else{const Vr=Ue-we;et=or(at===0?P:new o.pointGeometry(W.getx(Vr),W.gety(Vr)),sr,Pe,gt-at+1,ee,Se)}}at+=rt,rt=Pe.dist(et)}const zt=(gt-at)/rt,vt=et.sub(Pe),nr=vt.mult(zt)._add(Pe);nr._add(vt._unit()._perp()._mult(h*we));const Gt=$e+Math.atan2(et.y-Pe.y,et.x-Pe.x);return yt.push(nr),{point:nr,angle:fe?Gt:0,path:yt}}const Er=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Lt(x,l){for(let h=0;h=1;Qr--)_r.push(Dr.path[Qr]);for(let Qr=1;QrVt(en,V,_e));_r=Qr.some(en=>en.signedDistanceFromCamera<=0)?[]:Qr.map(en=>en.point)}let pn=[];if(_r.length>0){const Qr=_r[0].clone(),en=_r[0].clone();for(let gn=1;gn<_r.length;gn++)Qr.x=Math.min(Qr.x,_r[gn].x),Qr.y=Math.min(Qr.y,_r[gn].y),en.x=Math.max(en.x,_r[gn].x),en.y=Math.max(en.y,_r[gn].y);pn=Qr.x>=nr.x&&en.x<=Gt.x&&Qr.y>=nr.y&&en.y<=Gt.y?[_r]:en.xGt.x||en.yGt.y?[]:o.clipLine([_r],nr.x,nr.y,Gt.x,Gt.y)}for(const Qr of pn){sr.reset(Qr,.25*vt);let en=0;en=sr.length<=.5*vt?1:Math.ceil(sr.paddedLength/hn)+1;for(let gn=0;gn=this.screenRightBoundary||bthis.screenBottomBoundary}isInsideGrid(l,h,g,b){return g>=0&&l=0&&hg.collisionGroupID===h}}return this.collisionGroups[l]}}function qr(x,l,h,g,b){const{horizontalAlign:P,verticalAlign:z}=o.getAnchorAlignment(x),$=-(P-.5)*l,V=-(z-.5)*h,W=o.evaluateVariableOffset(x,g);return new o.pointGeometry($+W[0]*b,V+W[1]*b)}function Gr(x,l,h,g,b,P){const{x1:z,x2:$,y1:V,y2:W,anchorPointX:ee,anchorPointY:ie}=x,fe=new o.pointGeometry(l,h);return g&&fe._rotate(b?P:-P),{x1:z+fe.x,y1:V+fe.y,x2:$+fe.x,y2:W+fe.y,anchorPointX:ee,anchorPointY:ie}}class me{constructor(l,h,g,b,P){this.transform=l.clone(),this.terrain=h,this.collisionIndex=new fr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=g,this.retainedQueryData={},this.collisionGroups=new Ir(b),this.collisionCircleArrays={},this.prevPlacement=P,P&&(P.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(l,h,g,b){const P=g.getBucket(h),z=g.latestFeatureIndex;if(!P||!z||h.id!==P.layerIds[0])return;const $=g.collisionBoxArray,V=P.layers[0].layout,W=Math.pow(2,this.transform.zoom-g.tileID.overscaledZ),ee=g.tileSize/o.EXTENT,ie=this.transform.calculatePosMatrix(g.tileID.toUnwrapped()),fe=V.get("text-pitch-alignment")==="map",Se=V.get("text-rotation-alignment")==="map",_e=Nt(g,1,this.transform.zoom),we=Xt(ie,fe,Se,this.transform,_e);let $e=null;if(fe){const et=cr(ie,fe,Se,this.transform,_e);$e=o.multiply([],this.transform.labelPlaneMatrix,et)}this.retainedQueryData[P.bucketInstanceId]=new ur(P.bucketInstanceId,z,P.sourceLayerIndex,P.index,g.tileID);const Ue={bucket:P,layout:V,posMatrix:ie,textLabelPlaneMatrix:we,labelToScreenMatrix:$e,scale:W,textPixelRatio:ee,holdingForFade:g.holdingForFade(),collisionBoxArray:$,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(P.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(P.sourceID)};if(b)for(const et of P.sortKeyRanges){const{sortKey:Pe,symbolInstanceStart:at,symbolInstanceEnd:rt}=et;l.push({sortKey:Pe,symbolInstanceStart:at,symbolInstanceEnd:rt,parameters:Ue})}else l.push({symbolInstanceStart:0,symbolInstanceEnd:P.symbolInstances.length,parameters:Ue})}attemptAnchorPlacement(l,h,g,b,P,z,$,V,W,ee,ie,fe,Se,_e,we,$e){const Ue=[fe.textOffset0,fe.textOffset1],et=qr(l,g,b,Ue,P),Pe=this.collisionIndex.placeCollisionBox(Gr(h,et.x,et.y,z,$,this.transform.angle),ie,V,W,ee.predicate,$e);if((!we||this.collisionIndex.placeCollisionBox(Gr(we,et.x,et.y,z,$,this.transform.angle),ie,V,W,ee.predicate,$e).box.length!==0)&&Pe.box.length>0){let at;if(this.prevPlacement&&this.prevPlacement.variableOffsets[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID].text&&(at=this.prevPlacement.variableOffsets[fe.crossTileID].anchor),fe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[fe.crossTileID]={textOffset:Ue,width:g,height:b,anchor:l,textBoxScale:P,prevAnchor:at},this.markUsedJustification(Se,l,fe,_e),Se.allowVerticalPlacement&&(this.markUsedOrientation(Se,_e,fe),this.placedOrientations[fe.crossTileID]=_e),{shift:et,placedGlyphBoxes:Pe}}}placeLayerBucketPart(l,h,g){const{bucket:b,layout:P,posMatrix:z,textLabelPlaneMatrix:$,labelToScreenMatrix:V,textPixelRatio:W,holdingForFade:ee,collisionBoxArray:ie,partiallyEvaluatedTextSize:fe,collisionGroup:Se}=l.parameters,_e=P.get("text-optional"),we=P.get("icon-optional"),$e=o.getOverlapMode(P,"text-overlap","text-allow-overlap"),Ue=$e==="always",et=o.getOverlapMode(P,"icon-overlap","icon-allow-overlap"),Pe=et==="always",at=P.get("text-rotation-alignment")==="map",rt=P.get("text-pitch-alignment")==="map",gt=P.get("icon-text-fit")!=="none",yt=P.get("symbol-z-order")==="viewport-y",zt=Ue&&(Pe||!b.hasIconData()||we),vt=Pe&&(Ue||!b.hasTextData()||_e);!b.collisionArrays&&ie&&b.deserializeCollisionBoxes(ie);const nr=(Gt,sr)=>{if(h[Gt.crossTileID])return;if(ee)return void(this.placements[Gt.crossTileID]=new Ot(!1,!1,!1));let Dr=!1,Vr=!1,_r=!0,hn=null,pn={box:null,offscreen:null},Qr={box:null,offscreen:null},en=null,gn=null,Ei=null,Ta=0,na=0,Pa=0;sr.textFeatureIndex?Ta=sr.textFeatureIndex:Gt.useRuntimeCollisionCircles&&(Ta=Gt.featureIndex),sr.verticalTextFeatureIndex&&(na=sr.verticalTextFeatureIndex);const Os=this.retainedQueryData[b.bucketInstanceId].tileID,Uo=this.terrain?(yi,Hr)=>this.terrain.getElevation(Os,yi,Hr):null;for(const yi of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const Hr=sr[yi];Hr&&(Hr.elevation=Uo?Uo(Hr.anchorPointX,Hr.anchorPointY):0)}const co=sr.textBox;if(co){const yi=fn=>{let ki=o.WritingMode.horizontal;if(b.allowVerticalPlacement&&!fn&&this.prevPlacement){const Ti=this.prevPlacement.placedOrientations[Gt.crossTileID];Ti&&(this.placedOrientations[Gt.crossTileID]=Ti,ki=Ti,this.markUsedOrientation(b,ki,Gt))}return ki},Hr=(fn,ki)=>{if(b.allowVerticalPlacement&&Gt.numVerticalGlyphVertices>0&&sr.verticalTextBox){for(const Ti of b.writingModes)if(Ti===o.WritingMode.vertical?(pn=ki(),Qr=pn):pn=fn(),pn&&pn.box&&pn.box.length)break}else pn=fn()};if(P.get("text-variable-anchor")){let fn=P.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Gt.crossTileID]){const Dn=this.prevPlacement.variableOffsets[Gt.crossTileID];fn.indexOf(Dn.anchor)>0&&(fn=fn.filter(Ko=>Ko!==Dn.anchor),fn.unshift(Dn.anchor))}const ki=(Dn,Ko,al)=>{const up=Dn.x2-Dn.x1,iu=Dn.y2-Dn.y1,kg=Gt.textBoxScale,cp=gt&&et==="never"?Ko:null;let As={box:[],offscreen:!1};const sl=$e!=="never"?2*fn.length:fn.length;for(let ll=0;ll=fn.length?$e:"never",Gt,b,al,cp,Uo);if(Kd&&(As=Kd.placedGlyphBoxes,As&&As.box&&As.box.length)){Dr=!0,hn=Kd.shift;break}}return As};Hr(()=>ki(co,sr.iconBox,o.WritingMode.horizontal),()=>{const Dn=sr.verticalTextBox;return b.allowVerticalPlacement&&!(pn&&pn.box&&pn.box.length)&&Gt.numVerticalGlyphVertices>0&&Dn?ki(Dn,sr.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null}}),pn&&(Dr=pn.box,_r=pn.offscreen);const Ti=yi(pn&&pn.box);if(!Dr&&this.prevPlacement){const Dn=this.prevPlacement.variableOffsets[Gt.crossTileID];Dn&&(this.variableOffsets[Gt.crossTileID]=Dn,this.markUsedJustification(b,Dn.anchor,Gt,Ti))}}else{const fn=(ki,Ti)=>{const Dn=this.collisionIndex.placeCollisionBox(ki,$e,W,z,Se.predicate,Uo);return Dn&&Dn.box&&Dn.box.length&&(this.markUsedOrientation(b,Ti,Gt),this.placedOrientations[Gt.crossTileID]=Ti),Dn};Hr(()=>fn(co,o.WritingMode.horizontal),()=>{const ki=sr.verticalTextBox;return b.allowVerticalPlacement&&Gt.numVerticalGlyphVertices>0&&ki?fn(ki,o.WritingMode.vertical):{box:null,offscreen:null}}),yi(pn&&pn.box&&pn.box.length)}}if(en=pn,Dr=en&&en.box&&en.box.length>0,_r=en&&en.offscreen,Gt.useRuntimeCollisionCircles){const yi=b.text.placedSymbolArray.get(Gt.centerJustifiedTextSymbolIndex),Hr=o.evaluateSizeForFeature(b.textSizeData,fe,yi),fn=P.get("text-padding");gn=this.collisionIndex.placeCollisionCircles($e,yi,b.lineVertexArray,b.glyphOffsetArray,Hr,z,$,V,g,rt,Se.predicate,Gt.collisionCircleDiameter,fn,Uo),gn.circles.length&&gn.collisionDetected&&!g&&o.warnOnce("Collisions detected, but collision boxes are not shown"),Dr=Ue||gn.circles.length>0&&!gn.collisionDetected,_r=_r&&gn.offscreen}if(sr.iconFeatureIndex&&(Pa=sr.iconFeatureIndex),sr.iconBox){const yi=Hr=>{const fn=gt&&hn?Gr(Hr,hn.x,hn.y,at,rt,this.transform.angle):Hr;return this.collisionIndex.placeCollisionBox(fn,et,W,z,Se.predicate,Uo)};Qr&&Qr.box&&Qr.box.length&&sr.verticalIconBox?(Ei=yi(sr.verticalIconBox),Vr=Ei.box.length>0):(Ei=yi(sr.iconBox),Vr=Ei.box.length>0),_r=_r&&Ei.offscreen}const ns=_e||Gt.numHorizontalGlyphVertices===0&&Gt.numVerticalGlyphVertices===0,Ud=we||Gt.numIconVertices===0;if(ns||Ud?Ud?ns||(Vr=Vr&&Dr):Dr=Vr&&Dr:Vr=Dr=Vr&&Dr,Dr&&en&&en.box&&this.collisionIndex.insertCollisionBox(en.box,$e,P.get("text-ignore-placement"),b.bucketInstanceId,Qr&&Qr.box&&na?na:Ta,Se.ID),Vr&&Ei&&this.collisionIndex.insertCollisionBox(Ei.box,et,P.get("icon-ignore-placement"),b.bucketInstanceId,Pa,Se.ID),gn&&(Dr&&this.collisionIndex.insertCollisionCircles(gn.circles,$e,P.get("text-ignore-placement"),b.bucketInstanceId,Ta,Se.ID),g)){const yi=b.bucketInstanceId;let Hr=this.collisionCircleArrays[yi];Hr===void 0&&(Hr=this.collisionCircleArrays[yi]=new $t);for(let fn=0;fn=0;--sr){const Dr=Gt[sr];nr(b.symbolInstances.get(Dr),b.collisionArrays[Dr])}}else for(let Gt=l.symbolInstanceStart;Gt=0&&(l.text.placedSymbolArray.get($).crossTileID=P>=0&&$!==P?0:g.crossTileID)}markUsedOrientation(l,h,g){const b=h===o.WritingMode.horizontal||h===o.WritingMode.horizontalOnly?h:0,P=h===o.WritingMode.vertical?h:0,z=[g.leftJustifiedTextSymbolIndex,g.centerJustifiedTextSymbolIndex,g.rightJustifiedTextSymbolIndex];for(const $ of z)l.text.placedSymbolArray.get($).placedOrientation=b;g.verticalPlacedTextSymbolIndex&&(l.text.placedSymbolArray.get(g.verticalPlacedTextSymbolIndex).placedOrientation=P)}commit(l){this.commitTime=l,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let g=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const b=h?h.symbolFadeChange(l):1,P=h?h.opacities:{},z=h?h.variableOffsets:{},$=h?h.placedOrientations:{};for(const V in this.placements){const W=this.placements[V],ee=P[V];ee?(this.opacities[V]=new ht(ee,b,W.text,W.icon),g=g||W.text!==ee.text.placed||W.icon!==ee.icon.placed):(this.opacities[V]=new ht(null,b,W.text,W.icon,W.skipFade),g=g||W.text||W.icon)}for(const V in P){const W=P[V];if(!this.opacities[V]){const ee=new ht(W,b,!1,!1);ee.isHidden()||(this.opacities[V]=ee,g=g||W.text.placed||W.icon.placed)}}for(const V in z)this.variableOffsets[V]||!this.opacities[V]||this.opacities[V].isHidden()||(this.variableOffsets[V]=z[V]);for(const V in $)this.placedOrientations[V]||!this.opacities[V]||this.opacities[V].isHidden()||(this.placedOrientations[V]=$[V]);if(h&&h.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");g?this.lastPlacementChangeTime=l:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:l)}updateLayerOpacities(l,h){const g={};for(const b of h){const P=b.getBucket(l);P&&b.latestFeatureIndex&&l.id===P.layerIds[0]&&this.updateBucketOpacities(P,g,b.collisionBoxArray)}}updateBucketOpacities(l,h,g){l.hasTextData()&&l.text.opacityVertexArray.clear(),l.hasIconData()&&l.icon.opacityVertexArray.clear(),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexArray.clear(),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexArray.clear();const b=l.layers[0].layout,P=new ht(null,0,!1,!1,!0),z=b.get("text-allow-overlap"),$=b.get("icon-allow-overlap"),V=b.get("text-variable-anchor"),W=b.get("text-rotation-alignment")==="map",ee=b.get("text-pitch-alignment")==="map",ie=b.get("icon-text-fit")!=="none",fe=new ht(null,0,z&&($||!l.hasIconData()||b.get("icon-optional")),$&&(z||!l.hasTextData()||b.get("text-optional")),!0);!l.collisionArrays&&g&&(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData())&&l.deserializeCollisionBoxes(g);const Se=(_e,we,$e)=>{for(let Ue=0;Ue0,rt=this.placedOrientations[we.crossTileID],gt=rt===o.WritingMode.vertical,yt=rt===o.WritingMode.horizontal||rt===o.WritingMode.horizontalOnly;if($e>0||Ue>0){const zt=Ae(Pe.text);Se(l.text,$e,gt?He:zt),Se(l.text,Ue,yt?He:zt);const vt=Pe.text.isHidden();[we.rightJustifiedTextSymbolIndex,we.centerJustifiedTextSymbolIndex,we.leftJustifiedTextSymbolIndex].forEach(sr=>{sr>=0&&(l.text.placedSymbolArray.get(sr).hidden=vt||gt?1:0)}),we.verticalPlacedTextSymbolIndex>=0&&(l.text.placedSymbolArray.get(we.verticalPlacedTextSymbolIndex).hidden=vt||yt?1:0);const nr=this.variableOffsets[we.crossTileID];nr&&this.markUsedJustification(l,nr.anchor,we,rt);const Gt=this.placedOrientations[we.crossTileID];Gt&&(this.markUsedJustification(l,"left",we,Gt),this.markUsedOrientation(l,Gt,we))}if(at){const zt=Ae(Pe.icon),vt=!(ie&&we.verticalPlacedIconSymbolIndex&>);we.placedIconSymbolIndex>=0&&(Se(l.icon,we.numIconVertices,vt?zt:He),l.icon.placedSymbolArray.get(we.placedIconSymbolIndex).hidden=Pe.icon.isHidden()),we.verticalPlacedIconSymbolIndex>=0&&(Se(l.icon,we.numVerticalIconVertices,vt?He:zt),l.icon.placedSymbolArray.get(we.verticalPlacedIconSymbolIndex).hidden=Pe.icon.isHidden())}if(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData()){const zt=l.collisionArrays[_e];if(zt){let vt=new o.pointGeometry(0,0);if(zt.textBox||zt.verticalTextBox){let Gt=!0;if(V){const sr=this.variableOffsets[et];sr?(vt=qr(sr.anchor,sr.width,sr.height,sr.textOffset,sr.textBoxScale),W&&vt._rotate(ee?this.transform.angle:-this.transform.angle)):Gt=!1}zt.textBox&&K(l.textCollisionBox.collisionVertexArray,Pe.text.placed,!Gt||gt,vt.x,vt.y),zt.verticalTextBox&&K(l.textCollisionBox.collisionVertexArray,Pe.text.placed,!Gt||yt,vt.x,vt.y)}const nr=Boolean(!yt&&zt.verticalIconBox);zt.iconBox&&K(l.iconCollisionBox.collisionVertexArray,Pe.icon.placed,nr,ie?vt.x:0,ie?vt.y:0),zt.verticalIconBox&&K(l.iconCollisionBox.collisionVertexArray,Pe.icon.placed,!nr,ie?vt.x:0,ie?vt.y:0)}}}if(l.sortFeatures(this.transform.angle),this.retainedQueryData[l.bucketInstanceId]&&(this.retainedQueryData[l.bucketInstanceId].featureSortOrder=l.featureSortOrder),l.hasTextData()&&l.text.opacityVertexBuffer&&l.text.opacityVertexBuffer.updateData(l.text.opacityVertexArray),l.hasIconData()&&l.icon.opacityVertexBuffer&&l.icon.opacityVertexBuffer.updateData(l.icon.opacityVertexArray),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexBuffer&&l.iconCollisionBox.collisionVertexBuffer.updateData(l.iconCollisionBox.collisionVertexArray),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexBuffer&&l.textCollisionBox.collisionVertexBuffer.updateData(l.textCollisionBox.collisionVertexArray),l.text.opacityVertexArray.length!==l.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${l.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${l.text.layoutVertexArray.length}) / 4`);if(l.icon.opacityVertexArray.length!==l.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${l.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${l.icon.layoutVertexArray.length}) / 4`);if(l.bucketInstanceId in this.collisionCircleArrays){const _e=this.collisionCircleArrays[l.bucketInstanceId];l.placementInvProjMatrix=_e.invProjMatrix,l.placementViewportMatrix=_e.viewportMatrix,l.collisionCircleArray=_e.circles,delete this.collisionCircleArrays[l.bucketInstanceId]}}symbolFadeChange(l){return this.fadeDuration===0?1:(l-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(l){return Math.max(0,(this.transform.zoom-l)/1.5)}hasTransitions(l){return this.stale||l-this.lastPlacementChangeTimel}setStale(){this.stale=!0}}function K(x,l,h,g,b){x.emplaceBack(l?1:0,h?1:0,g||0,b||0),x.emplaceBack(l?1:0,h?1:0,g||0,b||0),x.emplaceBack(l?1:0,h?1:0,g||0,b||0),x.emplaceBack(l?1:0,h?1:0,g||0,b||0)}const q=Math.pow(2,25),ce=Math.pow(2,24),ae=Math.pow(2,17),xe=Math.pow(2,16),Ee=Math.pow(2,9),be=Math.pow(2,8),Ce=Math.pow(2,1);function Ae(x){if(x.opacity===0&&!x.placed)return 0;if(x.opacity===1&&x.placed)return 4294967295;const l=x.placed?1:0,h=Math.floor(127*x.opacity);return h*q+l*ce+h*ae+l*xe+h*Ee+l*be+h*Ce+l}const He=0;class We{constructor(l){this._sortAcrossTiles=l.layout.get("symbol-z-order")!=="viewport-y"&&!l.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(l,h,g,b,P){const z=this._bucketParts;for(;this._currentTileIndex$.sortKey-V.sortKey));this._currentPartIndex{const z=o.exported.now()-b;return!this._forceFullPlacement&&z>2};for(;this._currentPlacementIndex>=0;){const z=h[l[this._currentPlacementIndex]],$=this.placement.collisionIndex.transform.zoom;if(z.type==="symbol"&&(!z.minzoom||z.minzoom<=$)&&(!z.maxzoom||z.maxzoom>$)){if(this._inProgressLayer||(this._inProgressLayer=new We(z)),this._inProgressLayer.continuePlacement(g[z.source],this.placement,this._showCollisionBoxes,z,P))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(l){return this.placement.commit(l),this.placement}}const At=512/o.EXTENT/2;class bt{constructor(l,h,g){this.tileID=l,this.indexedSymbolInstances={},this.bucketInstanceId=g;for(let b=0;bl.overscaledZ)for(const $ in z){const V=z[$];V.tileID.isChildOf(l)&&V.findMatches(h.symbolInstances,l,b)}else{const $=z[l.scaledTo(Number(P)).key];$&&$.findMatches(h.symbolInstances,l,b)}}for(let P=0;P{h[g]=!0});for(const g in this.layerIndexes)h[g]||delete this.layerIndexes[g]}}var vr=o.createLayout([{name:"a_pos",type:"Int16",components:2}]);class ir extends o.Evented{constructor(l){super(),this.sourceCache=l,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=l._cache.max,l.usedForTerrain=!0,l.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(const l in this._tiles){const h=this._tiles[l];h.textures.forEach(g=>g.destroy()),h.textures=[]}}update(l,h){this.sourceCache.update(l,h),this._renderableTilesKeys=[];for(const g of l.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),o.ortho(g.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),this._tiles[g.key]=new De(g,this.tileSize))}removeOutdated(l){const h={};this.renderHistory=this.renderHistory.filter((g,b)=>this.renderHistory.indexOf(g)===b).slice(0,this.renderHistorySize);for(const g of this._renderableTilesKeys)h[g]=!0;for(const g of this.renderHistory)h[g]=!0;for(const g in this._tiles)h[g]||(this._tiles[g].clearTextures(l),delete this._tiles[g])}getRenderableTiles(){return this._renderableTilesKeys.map(l=>this.getTileByID(l))}getTileByID(l){return this._tiles[l]}getTerrainCoords(l){const h={};for(const g of this._renderableTilesKeys){const b=this._tiles[g].tileID;if(b.canonical.equals(l.canonical)){const P=l.clone();P.posMatrix=new Float64Array(16),o.ortho(P.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),h[g]=P}else if(b.canonical.isChildOf(l.canonical)){const P=l.clone();P.posMatrix=new Float64Array(16);const z=b.canonical.z-l.canonical.z,$=b.canonical.x-(b.canonical.x>>z<>z<>z;o.ortho(P.posMatrix,0,W,0,W,0,1),o.translate(P.posMatrix,P.posMatrix,[-$*W,-V*W,0]),h[g]=P}else if(l.canonical.isChildOf(b.canonical)){const P=l.clone();P.posMatrix=new Float64Array(16);const z=l.canonical.z-b.canonical.z,$=l.canonical.x-(l.canonical.x>>z<>z<>z;o.ortho(P.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),o.translate(P.posMatrix,P.posMatrix,[$*W,V*W,0]),o.scale(P.posMatrix,P.posMatrix,[1/2**z,1/2**z,0]),h[g]=P}}return h}getSourceTile(l,h){const g=this.sourceCache._source;let b=l.overscaledZ-this.deltaZoom;if(b>g.maxzoom&&(b=g.maxzoom),b=g.minzoom&&(!P||!P.dem);)P=this.sourceCache.getTileByID(l.scaledTo(b--).key);return P}tilesAfterTime(l=Date.now()){return Object.values(this._tiles).filter(h=>h.timeLoaded>=l)}}class gr{constructor(l,h,g){this.style=l,this.sourceCache=new ir(h),this.options=g,this.exaggeration=typeof g.exaggeration=="number"?g.exaggeration:1,this.elevationOffset=typeof g.elevationOffset=="number"?g.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(l,h,g,b=o.EXTENT){if(!(h>=0&&h=0&&gl.canonical.z&&(l.canonical.z>=b?P=l.canonical.z-b:o.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const z=l.canonical.x-(l.canonical.x>>P<>P<>8<<4|P>>8,h[z+3]=0;const g=new o.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),b=new R(l,g,l.gl.RGBA,{premultiply:!1});return b.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._coordsTexture=b,b}pointCoordinate(l){const h=new Uint8Array(4),g=this.style.map.painter,b=g.context,P=b.gl;b.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),P.readPixels(l.x,g.height/devicePixelRatio-l.y-1,1,1,P.RGBA,P.UNSIGNED_BYTE,h),b.bindFramebuffer.set(null);const z=h[0]+(h[2]>>4<<8),$=h[1]+((15&h[2])<<8),V=this.coordsIndex[255-h[3]],W=V&&this.sourceCache.getTileByID(V);if(!W)return null;const ee=this._coordsTextureSize,ie=(1<o.emitValidationErrors(x,l&&l.filter(h=>h.identifier!=="source.canvas")),Jr=o.pick(lt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Vn=o.pick(lt,["setCenter","setZoom","setBearing","setPitch"]),an=function(){const x={},l=o.spec.$version;for(const h in o.spec.$root){const g=o.spec.$root[h];if(g.required){let b=null;b=h==="version"?l:g.type==="array"?[]:{},b!=null&&(x[h]=b)}}return x}();class On extends o.Evented{constructor(l,h={}){super(),this.map=l,this.dispatcher=new Y(It(),this),this.imageManager=new I,this.imageManager.setEventedParent(this),this.glyphManager=new B(l._requestManager,h.localIdeographFontFamily),this.lineAtlas=new te(256,512),this.crossTileSymbolIndex=new Bt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.getReferrer());const g=this;this._rtlTextPluginCallback=On.registerForPluginStateChange(b=>{g.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:b.pluginStatus,pluginURL:b.pluginURL},(P,z)=>{if(o.triggerPluginCompletionEvent(P),z&&z.every($=>$))for(const $ in g.sourceCaches)g.sourceCaches[$].reload()})}),this.on("data",b=>{if(b.dataType!=="source"||b.sourceDataType!=="metadata")return;const P=this.sourceCaches[b.sourceId];if(!P)return;const z=P.getSource();if(z&&z.vectorLayerIds)for(const $ in this._layers){const V=this._layers[$];V.source===z.id&&this._validateLayer(V)}})}loadURL(l,h={}){this.fire(new o.Event("dataloading",{dataType:"style"}));const g=typeof h.validate!="boolean"||h.validate,b=this.map._requestManager.transformRequest(l,o.ResourceType.Style);this._request=o.getJSON(b,(P,z)=>{this._request=null,P?this.fire(new o.ErrorEvent(P)):z&&this._load(z,g)})}loadJSON(l,h={}){this.fire(new o.Event("dataloading",{dataType:"style"})),this._request=o.exported.frame(()=>{this._request=null,this._load(l,h.validate!==!1)})}loadEmpty(){this.fire(new o.Event("dataloading",{dataType:"style"})),this._load(an,!1)}_load(l,h){if(h&&Br(this,o.validateStyle(l)))return;this._loaded=!0,this.stylesheet=l;for(const b in l.sources)this.addSource(b,l.sources[b],{validate:!1});l.sprite?this._loadSprite(l.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(l.glyphs);const g=Dt(this.stylesheet.layers);this._order=g.map(b=>b.id),this._layers={},this._serializedLayers={};for(let b of g)b=o.createStyleLayer(b),b.setEventedParent(this,{layer:{id:b.id}}),this._layers[b.id]=b,this._serializedLayers[b.id]=b.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new H(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new o.Event("data",{dataType:"style"})),this.fire(new o.Event("style.load"))}_loadSprite(l){this._spriteRequest=function(h,g,b,P){let z,$,V;const W=b>1?"@2x":"";let ee=o.getJSON(g.transformRequest(g.normalizeSpriteURL(h,W,".json"),o.ResourceType.SpriteJSON),(Se,_e)=>{ee=null,V||(V=Se,z=_e,fe())}),ie=o.getImage(g.transformRequest(g.normalizeSpriteURL(h,W,".png"),o.ResourceType.SpriteImage),(Se,_e)=>{ie=null,V||(V=Se,$=_e,fe())});function fe(){if(V)P(V);else if(z&&$){const Se=o.exported.getImageData($),_e={};for(const we in z){const{width:$e,height:Ue,x:et,y:Pe,sdf:at,pixelRatio:rt,stretchX:gt,stretchY:yt,content:zt}=z[we],vt=new o.RGBAImage({width:$e,height:Ue});o.RGBAImage.copy(Se,vt,{x:et,y:Pe},{x:0,y:0},{width:$e,height:Ue}),_e[we]={data:vt,pixelRatio:rt,sdf:at,stretchX:gt,stretchY:yt,content:zt}}P(null,_e)}}return{cancel(){ee&&(ee.cancel(),ee=null),ie&&(ie.cancel(),ie=null)}}}(l,this.map._requestManager,this.map.getPixelRatio(),(h,g)=>{if(this._spriteRequest=null,h)this.fire(new o.ErrorEvent(h));else if(g)for(const b in g)this.imageManager.addImage(b,g[b]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))})}_validateLayer(l){const h=this.sourceCaches[l.source];if(!h)return;const g=l.sourceLayer;if(!g)return;const b=h.getSource();(b.type==="geojson"||b.vectorLayerIds&&b.vectorLayerIds.indexOf(g)===-1)&&this.fire(new o.ErrorEvent(new Error(`Source layer "${g}" does not exist on source "${b.id}" as specified by style layer "${l.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const l in this.sourceCaches)if(!this.sourceCaches[l].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(l){const h=[];for(const g of l){const b=this._layers[g];b.type!=="custom"&&h.push(b.serialize())}return h}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const l in this.sourceCaches)if(this.sourceCaches[l].hasTransition())return!0;for(const l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(l){if(!this._loaded)return;const h=this._changed;if(this._changed){const b=Object.keys(this._updatedLayers),P=Object.keys(this._removedLayers);(b.length||P.length)&&this._updateWorkerLayers(b,P);for(const z in this._updatedSources){const $=this._updatedSources[z];if($==="reload")this._reloadSource(z);else{if($!=="clear")throw new Error(`Invalid action ${$}`);this._clearSource(z)}}this._updateTilesForChangedImages();for(const z in this._updatedPaintProps)this._layers[z].updateTransitions(l);this.light.updateTransitions(l),this._resetUpdates()}const g={};for(const b in this.sourceCaches){const P=this.sourceCaches[b];g[b]=P.used,P.used=!1}for(const b of this._order){const P=this._layers[b];P.recalculate(l,this._availableImages),!P.isHidden(l.zoom)&&P.source&&(this.sourceCaches[P.source].used=!0)}for(const b in g){const P=this.sourceCaches[b];g[b]!==P.used&&P.fire(new o.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:b}))}this.light.recalculate(l),this.z=l.zoom,h&&this.fire(new o.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const l=Object.keys(this._changedImages);if(l.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],l);this._changedImages={}}}_updateWorkerLayers(l,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(l),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(l){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),l){const h=this.sourceCaches[l.source];if(!h)throw new Error(`cannot load terrain, because there exists no source with ID: ${l.source}`);this.terrain=new gr(this,h,l),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=g=>{g.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=g=>{g.tile&&(g.sourceId===l.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(g.sourceId,g.tile.tileID)):g.source.type==="geojson"&&this.terrain.rememberForRerender(g.sourceId,g.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 o.Event("terrain",{terrain:l}))}setState(l){if(this._checkLoaded(),Br(this,o.validateStyle(l)))return!1;(l=o.clone$1(l)).layers=Dt(l.layers);const h=function(b,P){if(!b)return[{command:lt.setStyle,args:[P]}];let z=[];try{if(!y(b.version,P.version))return[{command:lt.setStyle,args:[P]}];y(b.center,P.center)||z.push({command:lt.setCenter,args:[P.center]}),y(b.zoom,P.zoom)||z.push({command:lt.setZoom,args:[P.zoom]}),y(b.bearing,P.bearing)||z.push({command:lt.setBearing,args:[P.bearing]}),y(b.pitch,P.pitch)||z.push({command:lt.setPitch,args:[P.pitch]}),y(b.sprite,P.sprite)||z.push({command:lt.setSprite,args:[P.sprite]}),y(b.glyphs,P.glyphs)||z.push({command:lt.setGlyphs,args:[P.glyphs]}),y(b.transition,P.transition)||z.push({command:lt.setTransition,args:[P.transition]}),y(b.light,P.light)||z.push({command:lt.setLight,args:[P.light]});const $={},V=[];(function(ee,ie,fe,Se){let _e;for(_e in ie=ie||{},ee=ee||{})Object.prototype.hasOwnProperty.call(ee,_e)&&(Object.prototype.hasOwnProperty.call(ie,_e)||ut(_e,fe,Se));for(_e in ie)Object.prototype.hasOwnProperty.call(ie,_e)&&(Object.prototype.hasOwnProperty.call(ee,_e)?y(ee[_e],ie[_e])||(ee[_e].type==="geojson"&&ie[_e].type==="geojson"&&ft(ee,ie,_e)?fe.push({command:lt.setGeoJSONSourceData,args:[_e,ie[_e].data]}):it(_e,ie,fe,Se)):dt(_e,ie,fe))})(b.sources,P.sources,V,$);const W=[];b.layers&&b.layers.forEach(ee=>{$[ee.source]?z.push({command:lt.removeLayer,args:[ee.id]}):W.push(ee)}),z=z.concat(V),function(ee,ie,fe){ie=ie||[];const Se=(ee=ee||[]).map(Wt),_e=ie.map(Wt),we=ee.reduce(jt,{}),$e=ie.reduce(jt,{}),Ue=Se.slice(),et=Object.create(null);let Pe,at,rt,gt,yt,zt,vt;for(Pe=0,at=0;Pe!(b.command in Vn));if(h.length===0)return!1;const g=h.filter(b=>!(b.command in Jr));if(g.length>0)throw new Error(`Unimplemented: ${g.map(b=>b.command).join(", ")}.`);return h.forEach(b=>{b.command!=="setTransition"&&this[b.command].apply(this,b.args)}),this.stylesheet=l,!0}addImage(l,h){if(this.getImage(l))return this.fire(new o.ErrorEvent(new Error(`An image named "${l}" already exists.`)));this.imageManager.addImage(l,h),this._afterImageUpdated(l)}updateImage(l,h){this.imageManager.updateImage(l,h)}getImage(l){return this.imageManager.getImage(l)}removeImage(l){if(!this.getImage(l))return this.fire(new o.ErrorEvent(new Error(`An image named "${l}" does not exist.`)));this.imageManager.removeImage(l),this._afterImageUpdated(l)}_afterImageUpdated(l){this._availableImages=this.imageManager.listImages(),this._changedImages[l]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(l,h,g={}){if(this._checkLoaded(),this.sourceCaches[l]!==void 0)throw new Error(`Source "${l}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(o.validateStyle.source,`sources.${l}`,h,null,g))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const b=this.sourceCaches[l]=new je(l,h,this.dispatcher);b.style=this,b.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:b.serialize(),sourceId:l})),b.onAdd(this.map),this._changed=!0}removeSource(l){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error("There is no source with this ID");for(const g in this._layers)if(this._layers[g].source===l)return this.fire(new o.ErrorEvent(new Error(`Source "${l}" cannot be removed while layer "${g}" is using it.`)));const h=this.sourceCaches[l];delete this.sourceCaches[l],delete this._updatedSources[l],h.fire(new o.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:l})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(l,h){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error(`There is no source with this ID=${l}`);const g=this.sourceCaches[l].getSource();if(g.type!=="geojson")throw new Error(`geojsonSource.type is ${g.type}, which is !== 'geojson`);g.setData(h),this._changed=!0}getSource(l){return this.sourceCaches[l]&&this.sourceCaches[l].getSource()}addLayer(l,h,g={}){this._checkLoaded();const b=l.id;if(this.getLayer(b))return void this.fire(new o.ErrorEvent(new Error(`Layer "${b}" already exists on this map.`)));let P;if(l.type==="custom"){if(Br(this,o.validateCustomStyleLayer(l)))return;P=o.createStyleLayer(l)}else{if(typeof l.source=="object"&&(this.addSource(b,l.source),l=o.clone$1(l),l=o.extend(l,{source:b})),this._validate(o.validateStyle.layer,`layers.${b}`,l,{arrayIndex:-1},g))return;P=o.createStyleLayer(l),this._validateLayer(P),P.setEventedParent(this,{layer:{id:b}}),this._serializedLayers[P.id]=P.serialize()}const z=h?this._order.indexOf(h):this._order.length;if(h&&z===-1)this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${b}" before non-existing layer "${h}".`)));else{if(this._order.splice(z,0,b),this._layerOrderChanged=!0,this._layers[b]=P,this._removedLayers[b]&&P.source&&P.type!=="custom"){const $=this._removedLayers[b];delete this._removedLayers[b],$.type!==P.type?this._updatedSources[P.source]="clear":(this._updatedSources[P.source]="reload",this.sourceCaches[P.source].pause())}this._updateLayer(P),P.onAdd&&P.onAdd(this.map)}}moveLayer(l,h){if(this._checkLoaded(),this._changed=!0,!this._layers[l])return void this.fire(new o.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be moved.`)));if(l===h)return;const g=this._order.indexOf(l);this._order.splice(g,1);const b=h?this._order.indexOf(h):this._order.length;h&&b===-1?this.fire(new o.ErrorEvent(new Error(`Cannot move layer "${l}" before non-existing layer "${h}".`))):(this._order.splice(b,0,l),this._layerOrderChanged=!0)}removeLayer(l){this._checkLoaded();const h=this._layers[l];if(!h)return void this.fire(new o.ErrorEvent(new Error(`Cannot remove non-existing layer "${l}".`)));h.setEventedParent(null);const g=this._order.indexOf(l);this._order.splice(g,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[l]=h,delete this._layers[l],delete this._serializedLayers[l],delete this._updatedLayers[l],delete this._updatedPaintProps[l],h.onRemove&&h.onRemove(this.map)}getLayer(l){return this._layers[l]}hasLayer(l){return l in this._layers}setLayerZoomRange(l,h,g){this._checkLoaded();const b=this.getLayer(l);b?b.minzoom===h&&b.maxzoom===g||(h!=null&&(b.minzoom=h),g!=null&&(b.maxzoom=g),this._updateLayer(b)):this.fire(new o.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${l}".`)))}setFilter(l,h,g={}){this._checkLoaded();const b=this.getLayer(l);if(b){if(!y(b.filter,h))return h==null?(b.filter=void 0,void this._updateLayer(b)):void(this._validate(o.validateStyle.filter,`layers.${b.id}.filter`,h,null,g)||(b.filter=o.clone$1(h),this._updateLayer(b)))}else this.fire(new o.ErrorEvent(new Error(`Cannot filter non-existing layer "${l}".`)))}getFilter(l){return o.clone$1(this.getLayer(l).filter)}setLayoutProperty(l,h,g,b={}){this._checkLoaded();const P=this.getLayer(l);P?y(P.getLayoutProperty(h),g)||(P.setLayoutProperty(h,g,b),this._updateLayer(P)):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${l}".`)))}getLayoutProperty(l,h){const g=this.getLayer(l);if(g)return g.getLayoutProperty(h);this.fire(new o.ErrorEvent(new Error(`Cannot get style of non-existing layer "${l}".`)))}setPaintProperty(l,h,g,b={}){this._checkLoaded();const P=this.getLayer(l);P?y(P.getPaintProperty(h),g)||(P.setPaintProperty(h,g,b)&&this._updateLayer(P),this._changed=!0,this._updatedPaintProps[l]=!0):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${l}".`)))}getPaintProperty(l,h){return this.getLayer(l).getPaintProperty(h)}setFeatureState(l,h){this._checkLoaded();const g=l.source,b=l.sourceLayer,P=this.sourceCaches[g];if(P===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)));const z=P.getSource().type;z==="geojson"&&b?this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):z!=="vector"||b?(l.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),P.setFeatureState(b,l.id,h)):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(l,h){this._checkLoaded();const g=l.source,b=this.sourceCaches[g];if(b===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)));const P=b.getSource().type,z=P==="vector"?l.sourceLayer:void 0;P!=="vector"||z?h&&typeof l.id!="string"&&typeof l.id!="number"?this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):b.removeFeatureState(z,l.id,h):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(l){this._checkLoaded();const h=l.source,g=l.sourceLayer,b=this.sourceCaches[h];if(b!==void 0)return b.getSource().type!=="vector"||g?(l.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),b.getFeatureState(g,l.id)):void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return o.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return o.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:o.mapObject(this.sourceCaches,l=>l.serialize()),layers:this._serializeLayers(this._order)},l=>l!==void 0)}_updateLayer(l){this._updatedLayers[l.id]=!0,l.source&&!this._updatedSources[l.source]&&this.sourceCaches[l.source].getSource().type!=="raster"&&(this._updatedSources[l.source]="reload",this.sourceCaches[l.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(l){const h=z=>this._layers[z].type==="fill-extrusion",g={},b=[];for(let z=this._order.length-1;z>=0;z--){const $=this._order[z];if(h($)){g[$]=z;for(const V of l){const W=V[$];if(W)for(const ee of W)b.push(ee)}}}b.sort((z,$)=>$.intersectionZ-z.intersectionZ);const P=[];for(let z=this._order.length-1;z>=0;z--){const $=this._order[z];if(h($))for(let V=b.length-1;V>=0;V--){const W=b[V].feature;if(g[W.layer.id]{const yt=$e.featureSortOrder;if(yt){const zt=yt.indexOf(rt.featureIndex);return yt.indexOf(gt.featureIndex)-zt}return gt.featureIndex-rt.featureIndex});for(const rt of at)Pe.push(rt)}}for(const $e in Se)Se[$e].forEach(Ue=>{const et=Ue.feature,Pe=V[z[$e].source].getFeatureState(et.layer["source-layer"],et.id);et.source=et.layer.source,et.layer["source-layer"]&&(et.sourceLayer=et.layer["source-layer"]),et.state=Pe});return Se}(this._layers,this._serializedLayers,this.sourceCaches,l,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(P)}querySourceFeatures(l,h){h&&h.filter&&this._validate(o.validateStyle.filter,"querySourceFeatures.filter",h.filter,null,h);const g=this.sourceCaches[l];return g?function(b,P){const z=b.getRenderableIds().map(W=>b.getTileByID(W)),$=[],V={};for(let W=0;Wfe.getTileByID(Se)).sort((Se,_e)=>_e.tileID.overscaledZ-Se.tileID.overscaledZ||(Se.tileID.isLessThan(_e.tileID)?-1:1))}const ie=this.crossTileSymbolIndex.addLayer(ee,V[ee.source],l.center.lng);z=z||ie}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((P=P||this._layerOrderChanged||g===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),l.zoom))&&(this.pauseablePlacement=new Be(l,this.terrain,this._order,P,h,g,b,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,V),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),$=!0),z&&this.pauseablePlacement.placement.setStale()),$||z)for(const W of this._order){const ee=this._layers[W];ee.type==="symbol"&&this.placement.updateLayerOpacities(ee,V[ee.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.exported.now())}_releaseSymbolFadeTiles(){for(const l in this.sourceCaches)this.sourceCaches[l].releaseSymbolFadeTiles()}getImages(l,h,g){this.imageManager.getImages(h.icons,g),this._updateTilesForChangedImages();const b=this.sourceCaches[h.source];b&&b.setDependencies(h.tileID.key,h.type,h.icons)}getGlyphs(l,h,g){this.glyphManager.getGlyphs(h.stacks,g)}getResource(l,h,g){return o.makeRequest(h,g)}}On.getSourceType=function(x){return ke[x]},On.setSourceType=function(x,l){ke[x]=l},On.registerForPluginStateChange=o.registerForPluginStateChange;var Pr="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 Cr={prelude:Rr(`#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:Rr(`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:Rr(`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:Rr(`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:Rr("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:Rr(`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:Rr(`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:Rr("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:Rr("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:Rr("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:Rr(`#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:Rr(`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:Rr(`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:Rr(`#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:Rr(`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:Rr(`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:Rr(`#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:Rr(`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:Rr(`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:Rr(`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:Rr(`#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:Rr(`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:Rr(`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:Rr(`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:Rr(`#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:Rr(`#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:Rr("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Pr),terrainDepth:Rr("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);}",Pr),terrainCoords:Rr("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);}",Pr)};function Rr(x,l){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,g=l.match(/attribute ([\w]+) ([\w]+)/g),b=x.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),P=l.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),z=P?P.concat(b):b,$={};return{fragmentSource:x=x.replace(h,(V,W,ee,ie,fe)=>($[fe]=!0,W==="define"?` #ifndef HAS_UNIFORM_u_${fe} varying ${ee} ${ie} ${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:` #ifdef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = u_${fe}; #endif `)),vertexSource:l=l.replace(h,(V,W,ee,ie,fe)=>{const Se=ie==="float"?"vec2":"vec4",_e=fe.match(/color/)?"color":Se;return $[fe]?W==="define"?` #ifndef HAS_UNIFORM_u_${fe} uniform lowp float u_${fe}_t; attribute ${ee} ${Se} a_${fe}; varying ${ee} ${ie} ${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${fe} = a_${fe}; #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:W==="define"?` #ifndef HAS_UNIFORM_u_${fe} uniform lowp float u_${fe}_t; attribute ${ee} ${Se} a_${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = a_${fe}; #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${ee} ${ie} ${fe} = u_${fe}; #endif `}),staticAttributes:g,staticUniforms:z}}class ei{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(l,h,g,b,P,z,$,V,W){this.context=l;let ee=this.boundPaintVertexBuffers.length!==b.length;for(let ie=0;!ee&&ie({u_depth:new o.Uniform1i(yt,zt.u_depth),u_terrain:new o.Uniform1i(yt,zt.u_terrain),u_terrain_dim:new o.Uniform1f(yt,zt.u_terrain_dim),u_terrain_matrix:new o.UniformMatrix4f(yt,zt.u_terrain_matrix),u_terrain_unpack:new o.Uniform4f(yt,zt.u_terrain_unpack),u_terrain_offset:new o.Uniform1f(yt,zt.u_terrain_offset),u_terrain_exaggeration:new o.Uniform1f(yt,zt.u_terrain_exaggeration)}))(l,gt),this.binderUniforms=b?b.getUniforms(l,gt):[]}draw(l,h,g,b,P,z,$,V,W,ee,ie,fe,Se,_e,we,$e,Ue,et){const Pe=l.gl;if(this.failedToCreate)return;if(l.program.set(this.program),l.setDepthMode(g),l.setStencilMode(b),l.setColorMode(P),l.setCullFace(z),V){l.activeTexture.set(Pe.TEXTURE2),Pe.bindTexture(Pe.TEXTURE_2D,V.depthTexture),l.activeTexture.set(Pe.TEXTURE3),Pe.bindTexture(Pe.TEXTURE_2D,V.texture);for(const rt in this.terrainUniforms)this.terrainUniforms[rt].set(V[rt])}for(const rt in this.fixedUniforms)this.fixedUniforms[rt].set($[rt]);we&&we.setUniforms(l,this.binderUniforms,Se,{zoom:_e});let at=0;switch(h){case Pe.LINES:at=2;break;case Pe.TRIANGLES:at=3;break;case Pe.LINE_STRIP:at=1}for(const rt of fe.get()){const gt=rt.vaos||(rt.vaos={});(gt[W]||(gt[W]=new ei)).bind(l,this,ee,we?we.getPaintVertexBuffers():[],ie,rt.vertexOffset,$e,Ue,et),Pe.drawElements(h,rt.primitiveLength*at,Pe.UNSIGNED_SHORT,rt.primitiveOffset*at*2)}}}function Lr(x,l,h){const g=1/Nt(h,1,l.transform.tileZoom),b=Math.pow(2,h.tileID.overscaledZ),P=h.tileSize*Math.pow(2,l.transform.tileZoom)/b,z=P*(h.tileID.canonical.x+h.tileID.wrap*b),$=P*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[g,x.fromScale,x.toScale],u_fade:x.t,u_pixel_coord_upper:[z>>16,$>>16],u_pixel_coord_lower:[65535&z,65535&$]}}const Yr=(x,l,h,g)=>{const b=l.style.light,P=b.properties.get("position"),z=[P.x,P.y,P.z],$=o.create$1();b.properties.get("anchor")==="viewport"&&o.fromRotation($,-l.transform.angle),o.transformMat3(z,z,$);const V=b.properties.get("color");return{u_matrix:x,u_lightpos:z,u_lightintensity:b.properties.get("intensity"),u_lightcolor:[V.r,V.g,V.b],u_vertical_gradient:+h,u_opacity:g}},wn=(x,l,h,g,b,P,z)=>o.extend(Yr(x,l,h,g),Lr(P,l,z),{u_height_factor:-Math.pow(2,b.overscaledZ)/z.tileSize/8}),Sn=x=>({u_matrix:x}),jn=(x,l,h,g)=>o.extend(Sn(x),Lr(h,l,g)),bo=(x,l)=>({u_matrix:x,u_world:l}),Gl=(x,l,h,g,b)=>o.extend(jn(x,l,h,g),{u_world:b}),Td=(x,l,h,g)=>{const b=x.transform;let P,z;if(g.paint.get("circle-pitch-alignment")==="map"){const $=Nt(h,1,b.zoom);P=!0,z=[$,$]}else P=!1,z=b.pixelsToGLUnits;return{u_camera_to_center_distance:b.cameraToCenterDistance,u_scale_with_map:+(g.paint.get("circle-pitch-scale")==="map"),u_matrix:x.translatePosMatrix(l.posMatrix,h,g.paint.get("circle-translate"),g.paint.get("circle-translate-anchor")),u_pitch_with_map:+P,u_device_pixel_ratio:x.pixelRatio,u_extrude_scale:z}},Qa=(x,l,h)=>{const g=Nt(h,1,l.zoom),b=Math.pow(2,l.zoom-h.tileID.overscaledZ),P=h.tileID.overscaleFactor();return{u_matrix:x,u_camera_to_center_distance:l.cameraToCenterDistance,u_pixels_to_tile_units:g,u_extrude_scale:[l.pixelsToGLUnits[0]/(g*b),l.pixelsToGLUnits[1]/(g*b)],u_overscale_factor:P}},Fr=(x,l,h=1)=>({u_matrix:x,u_color:l,u_overlay:0,u_overlay_scale:h}),Zr=x=>({u_matrix:x}),An=(x,l,h,g)=>({u_matrix:x,u_extrude_scale:Nt(l,1,h),u_intensity:g});function Di(x,l){const h=Math.pow(2,l.canonical.z),g=l.canonical.y;return[new o.MercatorCoordinate(0,g/h).toLngLat().lat,new o.MercatorCoordinate(0,(g+1)/h).toLngLat().lat]}const Es=(x,l,h,g)=>{const b=x.transform;return{u_matrix:es(x,l,h,g),u_ratio:1/Nt(l,1,b.zoom),u_device_pixel_ratio:x.pixelRatio,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},Vo=(x,l,h,g,b)=>o.extend(Es(x,l,h,b),{u_image:0,u_image_height:g}),tl=(x,l,h,g,b)=>{const P=x.transform,z=xn(l,P);return{u_matrix:es(x,l,h,b),u_texsize:l.imageAtlasTexture.size,u_ratio:1/Nt(l,1,P.zoom),u_device_pixel_ratio:x.pixelRatio,u_image:0,u_scale:[z,g.fromScale,g.toScale],u_fade:g.t,u_units_to_pixels:[1/P.pixelsToGLUnits[0],1/P.pixelsToGLUnits[1]]}},Ja=(x,l,h,g,b,P)=>{const z=x.lineAtlas,$=xn(l,x.transform),V=h.layout.get("line-cap")==="round",W=z.getDash(g.from,V),ee=z.getDash(g.to,V),ie=W.width*b.fromScale,fe=ee.width*b.toScale;return o.extend(Es(x,l,h,P),{u_patternscale_a:[$/ie,-W.height/2],u_patternscale_b:[$/fe,-ee.height/2],u_sdfgamma:z.width/(256*Math.min(ie,fe)*x.pixelRatio)/2,u_image:0,u_tex_y_a:W.y,u_tex_y_b:ee.y,u_mix:b.t})};function xn(x,l){return 1/Nt(x,1,l.tileZoom)}function es(x,l,h,g){return x.translatePosMatrix(g?g.posMatrix:l.tileID.posMatrix,l,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const qv=(x,l,h,g,b)=>{return{u_matrix:x,u_tl_parent:l,u_scale_parent:h,u_buffer_scale:1,u_fade_t:g.mix,u_opacity:g.opacity*b.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:b.paint.get("raster-brightness-min"),u_brightness_high:b.paint.get("raster-brightness-max"),u_saturation_factor:(z=b.paint.get("raster-saturation"),z>0?1-1/(1.001-z):-z),u_contrast_factor:(P=b.paint.get("raster-contrast"),P>0?1/(1-P):1+P),u_spin_weights:Gv(b.paint.get("raster-hue-rotate"))};var P,z};function Gv(x){x*=Math.PI/180;const l=Math.sin(x),h=Math.cos(x);return[(2*h+1)/3,(-Math.sqrt(3)*l-h+1)/3,(Math.sqrt(3)*l-h+1)/3]}const Dh=(x,l,h,g,b,P,z,$,V,W)=>{const ee=b.transform;return{u_is_size_zoom_constant:+(x==="constant"||x==="source"),u_is_size_feature_constant:+(x==="constant"||x==="camera"),u_size_t:l?l.uSizeT:0,u_size:l?l.uSize:0,u_camera_to_center_distance:ee.cameraToCenterDistance,u_pitch:ee.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:ee.width/ee.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:P,u_label_plane_matrix:z,u_coord_matrix:$,u_is_text:+V,u_pitch_with_map:+g,u_texsize:W,u_texture:0}},Pd=(x,l,h,g,b,P,z,$,V,W,ee)=>{const ie=b.transform;return o.extend(Dh(x,l,h,g,b,P,z,$,V,W),{u_gamma_scale:g?Math.cos(ie._pitch)*ie.cameraToCenterDistance:1,u_device_pixel_ratio:b.pixelRatio,u_is_halo:+ee})},Zv=(x,l,h,g,b,P,z,$,V,W)=>o.extend(Pd(x,l,h,g,b,P,z,$,!0,V,!0),{u_texsize_icon:W,u_texture_icon:1}),a_=(x,l,h)=>({u_matrix:x,u_opacity:l,u_color:h}),s_=(x,l,h,g,b,P)=>o.extend(function(z,$,V,W){const ee=V.imageManager.getPattern(z.from.toString()),ie=V.imageManager.getPattern(z.to.toString()),{width:fe,height:Se}=V.imageManager.getPixelSize(),_e=Math.pow(2,W.tileID.overscaledZ),we=W.tileSize*Math.pow(2,V.transform.tileZoom)/_e,$e=we*(W.tileID.canonical.x+W.tileID.wrap*_e),Ue=we*W.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ee.tl,u_pattern_br_a:ee.br,u_pattern_tl_b:ie.tl,u_pattern_br_b:ie.br,u_texsize:[fe,Se],u_mix:$.t,u_pattern_size_a:ee.displaySize,u_pattern_size_b:ie.displaySize,u_scale_a:$.fromScale,u_scale_b:$.toScale,u_tile_units_to_pixels:1/Nt(W,1,V.transform.tileZoom),u_pixel_coord_upper:[$e>>16,Ue>>16],u_pixel_coord_lower:[65535&$e,65535&Ue]}}(g,P,h,b),{u_matrix:x,u_opacity:l}),Lh={fillExtrusion:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_lightpos:new o.Uniform3f(x,l.u_lightpos),u_lightintensity:new o.Uniform1f(x,l.u_lightintensity),u_lightcolor:new o.Uniform3f(x,l.u_lightcolor),u_vertical_gradient:new o.Uniform1f(x,l.u_vertical_gradient),u_opacity:new o.Uniform1f(x,l.u_opacity)}),fillExtrusionPattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_lightpos:new o.Uniform3f(x,l.u_lightpos),u_lightintensity:new o.Uniform1f(x,l.u_lightintensity),u_lightcolor:new o.Uniform3f(x,l.u_lightcolor),u_vertical_gradient:new o.Uniform1f(x,l.u_vertical_gradient),u_height_factor:new o.Uniform1f(x,l.u_height_factor),u_image:new o.Uniform1i(x,l.u_image),u_texsize:new o.Uniform2f(x,l.u_texsize),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade),u_opacity:new o.Uniform1f(x,l.u_opacity)}),fill:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),fillPattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_image:new o.Uniform1i(x,l.u_image),u_texsize:new o.Uniform2f(x,l.u_texsize),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade)}),fillOutline:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_world:new o.Uniform2f(x,l.u_world)}),fillOutlinePattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_world:new o.Uniform2f(x,l.u_world),u_image:new o.Uniform1i(x,l.u_image),u_texsize:new o.Uniform2f(x,l.u_texsize),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade)}),circle:(x,l)=>({u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_scale_with_map:new o.Uniform1i(x,l.u_scale_with_map),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_extrude_scale:new o.Uniform2f(x,l.u_extrude_scale),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),collisionBox:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pixels_to_tile_units:new o.Uniform1f(x,l.u_pixels_to_tile_units),u_extrude_scale:new o.Uniform2f(x,l.u_extrude_scale),u_overscale_factor:new o.Uniform1f(x,l.u_overscale_factor)}),collisionCircle:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_inv_matrix:new o.UniformMatrix4f(x,l.u_inv_matrix),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_viewport_size:new o.Uniform2f(x,l.u_viewport_size)}),debug:(x,l)=>({u_color:new o.UniformColor(x,l.u_color),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_overlay:new o.Uniform1i(x,l.u_overlay),u_overlay_scale:new o.Uniform1f(x,l.u_overlay_scale)}),clippingMask:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),heatmap:(x,l)=>({u_extrude_scale:new o.Uniform1f(x,l.u_extrude_scale),u_intensity:new o.Uniform1f(x,l.u_intensity),u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),heatmapTexture:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_world:new o.Uniform2f(x,l.u_world),u_image:new o.Uniform1i(x,l.u_image),u_color_ramp:new o.Uniform1i(x,l.u_color_ramp),u_opacity:new o.Uniform1f(x,l.u_opacity)}),hillshade:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_image:new o.Uniform1i(x,l.u_image),u_latrange:new o.Uniform2f(x,l.u_latrange),u_light:new o.Uniform2f(x,l.u_light),u_shadow:new o.UniformColor(x,l.u_shadow),u_highlight:new o.UniformColor(x,l.u_highlight),u_accent:new o.UniformColor(x,l.u_accent)}),hillshadePrepare:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_image:new o.Uniform1i(x,l.u_image),u_dimension:new o.Uniform2f(x,l.u_dimension),u_zoom:new o.Uniform1f(x,l.u_zoom),u_unpack:new o.Uniform4f(x,l.u_unpack)}),line:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels)}),lineGradient:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels),u_image:new o.Uniform1i(x,l.u_image),u_image_height:new o.Uniform1f(x,l.u_image_height)}),linePattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_texsize:new o.Uniform2f(x,l.u_texsize),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_image:new o.Uniform1i(x,l.u_image),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade)}),lineSDF:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels),u_patternscale_a:new o.Uniform2f(x,l.u_patternscale_a),u_patternscale_b:new o.Uniform2f(x,l.u_patternscale_b),u_sdfgamma:new o.Uniform1f(x,l.u_sdfgamma),u_image:new o.Uniform1i(x,l.u_image),u_tex_y_a:new o.Uniform1f(x,l.u_tex_y_a),u_tex_y_b:new o.Uniform1f(x,l.u_tex_y_b),u_mix:new o.Uniform1f(x,l.u_mix)}),raster:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_tl_parent:new o.Uniform2f(x,l.u_tl_parent),u_scale_parent:new o.Uniform1f(x,l.u_scale_parent),u_buffer_scale:new o.Uniform1f(x,l.u_buffer_scale),u_fade_t:new o.Uniform1f(x,l.u_fade_t),u_opacity:new o.Uniform1f(x,l.u_opacity),u_image0:new o.Uniform1i(x,l.u_image0),u_image1:new o.Uniform1i(x,l.u_image1),u_brightness_low:new o.Uniform1f(x,l.u_brightness_low),u_brightness_high:new o.Uniform1f(x,l.u_brightness_high),u_saturation_factor:new o.Uniform1f(x,l.u_saturation_factor),u_contrast_factor:new o.Uniform1f(x,l.u_contrast_factor),u_spin_weights:new o.Uniform3f(x,l.u_spin_weights)}),symbolIcon:(x,l)=>({u_is_size_zoom_constant:new o.Uniform1i(x,l.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(x,l.u_is_size_feature_constant),u_size_t:new o.Uniform1f(x,l.u_size_t),u_size:new o.Uniform1f(x,l.u_size),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pitch:new o.Uniform1f(x,l.u_pitch),u_rotate_symbol:new o.Uniform1i(x,l.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(x,l.u_aspect_ratio),u_fade_change:new o.Uniform1f(x,l.u_fade_change),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(x,l.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(x,l.u_coord_matrix),u_is_text:new o.Uniform1i(x,l.u_is_text),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_texsize:new o.Uniform2f(x,l.u_texsize),u_texture:new o.Uniform1i(x,l.u_texture)}),symbolSDF:(x,l)=>({u_is_size_zoom_constant:new o.Uniform1i(x,l.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(x,l.u_is_size_feature_constant),u_size_t:new o.Uniform1f(x,l.u_size_t),u_size:new o.Uniform1f(x,l.u_size),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pitch:new o.Uniform1f(x,l.u_pitch),u_rotate_symbol:new o.Uniform1i(x,l.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(x,l.u_aspect_ratio),u_fade_change:new o.Uniform1f(x,l.u_fade_change),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(x,l.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(x,l.u_coord_matrix),u_is_text:new o.Uniform1i(x,l.u_is_text),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_texsize:new o.Uniform2f(x,l.u_texsize),u_texture:new o.Uniform1i(x,l.u_texture),u_gamma_scale:new o.Uniform1f(x,l.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(x,l.u_is_halo)}),symbolTextAndIcon:(x,l)=>({u_is_size_zoom_constant:new o.Uniform1i(x,l.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(x,l.u_is_size_feature_constant),u_size_t:new o.Uniform1f(x,l.u_size_t),u_size:new o.Uniform1f(x,l.u_size),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pitch:new o.Uniform1f(x,l.u_pitch),u_rotate_symbol:new o.Uniform1i(x,l.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(x,l.u_aspect_ratio),u_fade_change:new o.Uniform1f(x,l.u_fade_change),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(x,l.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(x,l.u_coord_matrix),u_is_text:new o.Uniform1i(x,l.u_is_text),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_texsize:new o.Uniform2f(x,l.u_texsize),u_texsize_icon:new o.Uniform2f(x,l.u_texsize_icon),u_texture:new o.Uniform1i(x,l.u_texture),u_texture_icon:new o.Uniform1i(x,l.u_texture_icon),u_gamma_scale:new o.Uniform1f(x,l.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(x,l.u_is_halo)}),background:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_opacity:new o.Uniform1f(x,l.u_opacity),u_color:new o.UniformColor(x,l.u_color)}),backgroundPattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_opacity:new o.Uniform1f(x,l.u_opacity),u_image:new o.Uniform1i(x,l.u_image),u_pattern_tl_a:new o.Uniform2f(x,l.u_pattern_tl_a),u_pattern_br_a:new o.Uniform2f(x,l.u_pattern_br_a),u_pattern_tl_b:new o.Uniform2f(x,l.u_pattern_tl_b),u_pattern_br_b:new o.Uniform2f(x,l.u_pattern_br_b),u_texsize:new o.Uniform2f(x,l.u_texsize),u_mix:new o.Uniform1f(x,l.u_mix),u_pattern_size_a:new o.Uniform2f(x,l.u_pattern_size_a),u_pattern_size_b:new o.Uniform2f(x,l.u_pattern_size_b),u_scale_a:new o.Uniform1f(x,l.u_scale_a),u_scale_b:new o.Uniform1f(x,l.u_scale_b),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_tile_units_to_pixels:new o.Uniform1f(x,l.u_tile_units_to_pixels)}),terrain:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_texture:new o.Uniform1i(x,l.u_texture)}),terrainDepth:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),terrainCoords:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_texture:new o.Uniform1i(x,l.u_texture),u_terrain_coords_id:new o.Uniform1f(x,l.u_terrain_coords_id)})};class Fh{constructor(l,h,g){this.context=l;const b=l.gl;this.buffer=b.createBuffer(),this.dynamicDraw=Boolean(g),this.context.unbindVAO(),l.bindElementBuffer.set(this.buffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(l){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,l.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const $h={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Bh{constructor(l,h,g,b){this.length=h.length,this.attributes=g,this.itemSize=h.bytesPerElement,this.dynamicDraw=b,this.context=l;const P=l.gl;this.buffer=P.createBuffer(),l.bindVertexBuffer.set(this.buffer),P.bufferData(P.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?P.DYNAMIC_DRAW:P.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(l){if(l.length!==this.length)throw new Error(`Length of new data is ${l.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,l.arrayBuffer)}enableAttributes(l,h){for(let g=0;g0){const nr=o.create(),Gt=yt;o.mul(nr,gt.placementInvProjMatrix,x.transform.glCoordMatrix),o.mul(nr,nr,gt.placementViewportMatrix),ee.push({circleArray:vt,circleOffset:fe,transform:Gt,invTransform:nr,coord:at}),ie+=vt.length/4,fe=ie}zt&&W.draw($,V.LINES,Xr.disabled,En.disabled,x.colorModeForRenderPass(),Nn.disabled,Qa(yt,x.transform,rt),x.style.terrain&&x.style.terrain.getTerrainData(at),h.id,zt.layoutVertexBuffer,zt.indexBuffer,zt.segments,null,x.transform.zoom,null,null,zt.collisionVertexBuffer)}if(!z||!ee.length)return;const Se=x.useProgram("collisionCircle"),_e=new o.CollisionCircleLayoutArray;_e.resize(4*ie),_e._trim();let we=0;for(const Pe of ee)for(let at=0;at=0&&(_e[$e.associatedIconIndex]={shiftedAnchor:Dr,angle:Vr})}else Lt($e.numGlyphs,fe)}if(W){Se.clear();const we=x.icon.placedSymbolArray;for(let $e=0;$ex.style.terrain.getElevation(zt,up,iu):null,al=h.layout.get("text-rotation-alignment")==="map";xr(nr,zt.posMatrix,x,b,Uo,co,$e,W,al,Ko)}const yi=x.translatePosMatrix(zt.posMatrix,vt,P,z),Hr=Ue||b&>||Ud?m_:Uo,fn=x.translatePosMatrix(co,vt,P,z,!0),ki=Dr&&h.paint.get(b?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ti;Ti=Dr?nr.iconsInText?Zv(Vr.kind,pn,et,$e,x,yi,Hr,fn,en,na):Pd(Vr.kind,pn,et,$e,x,yi,Hr,fn,b,en,!0):Dh(Vr.kind,pn,et,$e,x,yi,Hr,fn,b,en);const Dn={program:hn,buffers:Gt,uniformValues:Ti,atlasTexture:gn,atlasTextureIcon:Pa,atlasInterpolation:Ei,atlasInterpolationIcon:Ta,isSDF:Dr,hasHalo:ki};if(Pe&&nr.canOverlap){at=!0;const Ko=Gt.segments.get();for(const al of Ko)yt.push({segments:new o.SegmentVector([al]),sortKey:al.sortKey,state:Dn,terrainData:Qr})}else yt.push({segments:Gt.segments,sortKey:0,state:Dn,terrainData:Qr})}at&&yt.sort((zt,vt)=>zt.sortKey-vt.sortKey);for(const zt of yt){const vt=zt.state;if(fe.activeTexture.set(Se.TEXTURE0),vt.atlasTexture.bind(vt.atlasInterpolation,Se.CLAMP_TO_EDGE),vt.atlasTextureIcon&&(fe.activeTexture.set(Se.TEXTURE1),vt.atlasTextureIcon&&vt.atlasTextureIcon.bind(vt.atlasInterpolationIcon,Se.CLAMP_TO_EDGE)),vt.isSDF){const nr=vt.uniformValues;vt.hasHalo&&(nr.u_is_halo=1,dc(vt.buffers,zt.segments,h,x,vt.program,rt,ee,ie,nr,zt.terrainData)),nr.u_is_halo=0}dc(vt.buffers,zt.segments,h,x,vt.program,rt,ee,ie,vt.uniformValues,zt.terrainData)}}function dc(x,l,h,g,b,P,z,$,V,W){const ee=g.context;b.draw(ee,ee.gl.TRIANGLES,P,z,$,Nn.disabled,V,W,h.id,x.layoutVertexBuffer,x.indexBuffer,l,h.paint,g.transform.zoom,x.programConfigurations.get(h.id),x.dynamicLayoutVertexBuffer,x.opacityVertexBuffer)}function fc(x,l,h,g,b,P,z){const $=x.context.gl,V=h.paint.get("fill-pattern"),W=V&&V.constantOr(1),ee=h.getCrossfadeParameters();let ie,fe,Se,_e,we;z?(fe=W&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ie=$.LINES):(fe=W?"fillPattern":"fill",ie=$.TRIANGLES);for(const $e of g){const Ue=l.getTile($e);if(W&&!Ue.patternsLoaded())continue;const et=Ue.getBucket(h);if(!et)continue;const Pe=et.programConfigurations.get(h.id),at=x.useProgram(fe,Pe),rt=x.style.terrain&&x.style.terrain.getTerrainData($e);W&&(x.context.activeTexture.set($.TEXTURE0),Ue.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),Pe.updatePaintBuffers(ee));const gt=V.constantOr(null);if(gt&&Ue.imageAtlas){const vt=Ue.imageAtlas,nr=vt.patternPositions[gt.to.toString()],Gt=vt.patternPositions[gt.from.toString()];nr&&Gt&&Pe.setConstantPatternPositions(nr,Gt)}const yt=rt?$e:null,zt=x.translatePosMatrix(yt?yt.posMatrix:$e.posMatrix,Ue,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(z){_e=et.indexBuffer2,we=et.segments2;const vt=[$.drawingBufferWidth,$.drawingBufferHeight];Se=fe==="fillOutlinePattern"&&W?Gl(zt,x,ee,Ue,vt):bo(zt,vt)}else _e=et.indexBuffer,we=et.segments,Se=W?jn(zt,x,ee,Ue):Sn(zt);at.draw(x.context,ie,b,x.stencilModeForClipping($e),P,Nn.disabled,Se,rt,h.id,et.layoutVertexBuffer,_e,we,h.paint,x.transform.zoom,Pe)}}function hc(x,l,h,g,b,P,z){const $=x.context,V=$.gl,W=h.paint.get("fill-extrusion-pattern"),ee=W.constantOr(1),ie=h.getCrossfadeParameters(),fe=h.paint.get("fill-extrusion-opacity");for(const Se of g){const _e=l.getTile(Se),we=_e.getBucket(h);if(!we)continue;const $e=x.style.terrain&&x.style.terrain.getTerrainData(Se),Ue=we.programConfigurations.get(h.id),et=x.useProgram(ee?"fillExtrusionPattern":"fillExtrusion",Ue);ee&&(x.context.activeTexture.set(V.TEXTURE0),_e.imageAtlasTexture.bind(V.LINEAR,V.CLAMP_TO_EDGE),Ue.updatePaintBuffers(ie));const Pe=W.constantOr(null);if(Pe&&_e.imageAtlas){const yt=_e.imageAtlas,zt=yt.patternPositions[Pe.to.toString()],vt=yt.patternPositions[Pe.from.toString()];zt&&vt&&Ue.setConstantPatternPositions(zt,vt)}const at=x.translatePosMatrix(Se.posMatrix,_e,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),rt=h.paint.get("fill-extrusion-vertical-gradient"),gt=ee?wn(at,x,rt,fe,Se,ie,_e):Yr(at,x,rt,fe);et.draw($,$.gl.TRIANGLES,b,P,z,Nn.backCCW,gt,$e,h.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,h.paint,x.transform.zoom,Ue,x.style.terrain&&we.centroidVertexBuffer)}}function Zh(x,l,h,g,b,P,z){const $=x.context,V=$.gl,W=h.fbo;if(!W)return;const ee=x.useProgram("hillshade"),ie=x.style.terrain&&x.style.terrain.getTerrainData(l);$.activeTexture.set(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,W.colorAttachment.get()),ee.draw($,V.TRIANGLES,b,P,z,Nn.disabled,((fe,Se,_e,we)=>{const $e=_e.paint.get("hillshade-shadow-color"),Ue=_e.paint.get("hillshade-highlight-color"),et=_e.paint.get("hillshade-accent-color");let Pe=_e.paint.get("hillshade-illumination-direction")*(Math.PI/180);_e.paint.get("hillshade-illumination-anchor")==="viewport"&&(Pe-=fe.transform.angle);const at=!fe.options.moving;return{u_matrix:we?we.posMatrix:fe.transform.calculatePosMatrix(Se.tileID.toUnwrapped(),at),u_image:0,u_latrange:Di(0,Se.tileID),u_light:[_e.paint.get("hillshade-exaggeration"),Pe],u_shadow:$e,u_highlight:Ue,u_accent:et}})(x,h,g,ie?l:null),ie,g.id,x.rasterBoundsBuffer,x.quadTriangleIndexBuffer,x.rasterBoundsSegments)}function og(x,l,h,g,b,P){const z=x.context,$=z.gl,V=l.dem;if(V&&V.data){const W=V.dim,ee=V.stride,ie=V.getPixels();if(z.activeTexture.set($.TEXTURE1),z.pixelStoreUnpackPremultiplyAlpha.set(!1),l.demTexture=l.demTexture||x.getTileTexture(ee),l.demTexture){const Se=l.demTexture;Se.update(ie,{premultiply:!1}),Se.bind($.NEAREST,$.CLAMP_TO_EDGE)}else l.demTexture=new R(z,ie,$.RGBA,{premultiply:!1}),l.demTexture.bind($.NEAREST,$.CLAMP_TO_EDGE);z.activeTexture.set($.TEXTURE0);let fe=l.fbo;if(!fe){const Se=new R(z,{width:W,height:W,data:null},$.RGBA);Se.bind($.LINEAR,$.CLAMP_TO_EDGE),fe=l.fbo=z.createFramebuffer(W,W,!0),fe.colorAttachment.set(Se.texture)}z.bindFramebuffer.set(fe.framebuffer),z.viewport.set([0,0,W,W]),x.useProgram("hillshadePrepare").draw(z,$.TRIANGLES,g,b,P,Nn.disabled,((Se,_e)=>{const we=_e.stride,$e=o.create();return o.ortho($e,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate($e,$e,[0,-o.EXTENT,0]),{u_matrix:$e,u_image:1,u_dimension:[we,we],u_zoom:Se.overscaledZ,u_unpack:_e.getUnpackVector()}})(l.tileID,V),null,h.id,x.rasterBoundsBuffer,x.quadTriangleIndexBuffer,x.rasterBoundsSegments),l.needsHillshadePrepare=!1}}function Dd(x,l,h,g,b,P){const z=g.paint.get("raster-fade-duration");if(!P&&z>0){const $=o.exported.now(),V=($-x.timeAdded)/z,W=l?($-l.timeAdded)/z:-1,ee=h.getSource(),ie=b.coveringZoomLevel({tileSize:ee.tileSize,roundZoom:ee.roundZoom}),fe=!l||Math.abs(l.tileID.overscaledZ-ie)>Math.abs(x.tileID.overscaledZ-ie),Se=fe&&x.refreshedUponExpiration?1:o.clamp(fe?V:1-W,0,1);return x.refreshedUponExpiration&&V>=1&&(x.refreshedUponExpiration=!1),l?{opacity:1,mix:1-Se}:{opacity:Se,mix:0}}return{opacity:1,mix:0}}const Ld=new o.Color(1,0,0,1),ra=new o.Color(0,1,0,1),ag=new o.Color(0,0,1,1),Xh=new o.Color(1,0,1,1),sg=new o.Color(0,1,1,1);function nl(x,l,h,g){Jl(x,0,l+h/2,x.transform.width,h,g)}function pc(x,l,h,g){Jl(x,l-h/2,0,h,x.transform.height,g)}function Jl(x,l,h,g,b,P){const z=x.context,$=z.gl;$.enable($.SCISSOR_TEST),$.scissor(l*x.pixelRatio,h*x.pixelRatio,g*x.pixelRatio,b*x.pixelRatio),z.clear({color:P}),$.disable($.SCISSOR_TEST)}function y_(x,l,h){const g=x.context,b=g.gl,P=h.posMatrix,z=x.useProgram("debug"),$=Xr.disabled,V=En.disabled,W=x.colorModeForRenderPass(),ee="$debug",ie=x.style.terrain&&x.style.terrain.getTerrainData(h);g.activeTexture.set(b.TEXTURE0),x.emptyTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE);const fe=l.getTileByID(h.key).latestRawTileData,Se=Math.floor((fe&&fe.byteLength||0)/1024),_e=l.getTile(h).tileSize,we=512/Math.min(_e,512)*(h.overscaledZ/x.transform.zoom)*.5;let $e=h.canonical.toString();h.overscaledZ!==h.canonical.z&&($e+=` => ${h.overscaledZ}`),function(Ue,et){Ue.initDebugOverlayCanvas();const Pe=Ue.debugOverlayCanvas,at=Ue.context.gl,rt=Ue.debugOverlayCanvas.getContext("2d");rt.clearRect(0,0,Pe.width,Pe.height),rt.shadowColor="white",rt.shadowBlur=2,rt.lineWidth=1.5,rt.strokeStyle="white",rt.textBaseline="top",rt.font="bold 36px Open Sans, sans-serif",rt.fillText(et,5,5),rt.strokeText(et,5,5),Ue.debugOverlayTexture.update(Pe),Ue.debugOverlayTexture.bind(at.LINEAR,at.CLAMP_TO_EDGE)}(x,`${$e} ${Se}kB`),z.draw(g,b.TRIANGLES,$,V,Pn.alphaBlended,Nn.disabled,Fr(P,o.Color.transparent,we),null,ee,x.debugBuffer,x.quadTriangleIndexBuffer,x.debugSegments),z.draw(g,b.LINE_STRIP,$,V,W,Nn.disabled,Fr(P,o.Color.red),ie,ee,x.debugBuffer,x.tileBorderIndexBuffer,x.debugSegments)}function Fd(x,l,h){const g=x.context,b=g.gl,P=x.colorModeForRenderPass(),z=new Xr(b.LEQUAL,Xr.ReadWrite,x.depthRangeFor3D),$=x.useProgram("terrain"),V=l.getTerrainMesh(),W=l.getTerrainData(h.tileID);g.bindFramebuffer.set(null),g.viewport.set([0,0,x.width,x.height]),g.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l.getRTTFramebuffer().colorAttachment.get());const ee=x.transform.calculatePosMatrix(h.tileID.toUnwrapped());$.draw(g,b.TRIANGLES,z,En.disabled,P,Nn.backCCW,{u_matrix:ee,u_texture:0},W,"terrain",V.vertexBuffer,V.indexBuffer,V.segments)}function lg(x,l,h,g){const b=x.context,P=h.tileSize*l.qualityFactor;h.textures[g]||(h.textures[g]=x.getTileTexture(P)||new R(b,{width:P,height:P,data:null},b.gl.RGBA),h.textures[g].bind(b.gl.LINEAR,b.gl.CLAMP_TO_EDGE),g===0&&l.sourceCache.renderHistory.unshift(h.tileID.key));const z=l.getRTTFramebuffer();z.colorAttachment.set(h.textures[g].texture),b.bindFramebuffer.set(z.framebuffer),b.viewport.set([0,0,P,P])}class ug{constructor(l){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=l,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=l.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){const l=this.painter.style,h=l.terrain;for(const g in l.sourceCaches){this._coordsDescendingInv[g]={};const b=l.sourceCaches[g].getVisibleCoordinates();for(const P of b){const z=h.sourceCache.getTerrainCoords(P);for(const $ in z)this._coordsDescendingInv[g][$]||(this._coordsDescendingInv[g][$]=[]),this._coordsDescendingInv[g][$].push(z[$])}}for(const g of l._order){const b=l._layers[g],P=b.source;if(this._renderToTexture[b.type]&&!this._coordsDescendingInvStr[P]){this._coordsDescendingInvStr[P]={};for(const z in this._coordsDescendingInv[P])this._coordsDescendingInvStr[P][z]=this._coordsDescendingInv[P][z].map($=>$.key).sort().join()}}return this._renderableTiles.forEach(g=>{for(const b in this._coordsDescendingInvStr){const P=this._coordsDescendingInvStr[b][g.tileID.key];P&&P!==g.textureCoords[b]&&g.clearTextures(this.painter),h.needsRerender(b,g.tileID)&&g.clearTextures(this.painter)}this._rerender[g.tileID.key]=!g.textures.length}),h.clearRerenderCache(),h.sourceCache.removeOutdated(this.painter),this}renderLayer(l){const h=l.type,g=this.painter,b=g.style._order,P=g.currentLayer,z=P+1===b.length;if(this._renderToTexture[h]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(b[P]),!z))return!0;if(this._renderToTexture[this._prevType]||h==="hillshade"||this._renderToTexture[h]&&z){this._prevType=h;const $=this._stacks.length-1,V=this._stacks[$]||[];for(const W of this._renderableTiles){if(lg(g,g.style.terrain,W,$),this._rerender[W.tileID.key]){g.context.clear({color:o.Color.transparent});for(let ee=0;eeV.style.terrain.getElevation(Ue,vt,nr):null)}}}(g,x,h,l,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),b),h.paint.get("icon-opacity").constantOr(1)!==0&&zd(x,l,h,g,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),P,z),h.paint.get("text-opacity").constantOr(1)!==0&&zd(x,l,h,g,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),P,z),l.map.showCollisionBoxes&&(Ql(x,l,h,g,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Ql(x,l,h,g,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))},circle:function(x,l,h,g){if(x.renderPass!=="translucent")return;const b=h.paint.get("circle-opacity"),P=h.paint.get("circle-stroke-width"),z=h.paint.get("circle-stroke-opacity"),$=!h.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(P.constantOr(1)===0||z.constantOr(1)===0))return;const V=x.context,W=V.gl,ee=x.depthModeForSublayer(0,Xr.ReadOnly),ie=En.disabled,fe=x.colorModeForRenderPass(),Se=[];for(let _e=0;_e_e.sortKey-we.sortKey);for(const _e of Se){const{programConfiguration:we,program:$e,layoutVertexBuffer:Ue,indexBuffer:et,uniformValues:Pe,terrainData:at}=_e.state;$e.draw(V,W.TRIANGLES,ee,ie,fe,Nn.disabled,Pe,at,h.id,Ue,et,_e.segments,h.paint,x.transform.zoom,we)}},heatmap:function(x,l,h,g){if(h.paint.get("heatmap-opacity")!==0)if(x.renderPass==="offscreen"){const b=x.context,P=b.gl,z=En.disabled,$=new Pn([P.ONE,P.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(V,W,ee){const ie=V.gl;V.activeTexture.set(ie.TEXTURE1),V.viewport.set([0,0,W.width/4,W.height/4]);let fe=ee.heatmapFbo;if(fe)ie.bindTexture(ie.TEXTURE_2D,fe.colorAttachment.get()),V.bindFramebuffer.set(fe.framebuffer);else{const Se=ie.createTexture();ie.bindTexture(ie.TEXTURE_2D,Se),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_WRAP_S,ie.CLAMP_TO_EDGE),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_WRAP_T,ie.CLAMP_TO_EDGE),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_MIN_FILTER,ie.LINEAR),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_MAG_FILTER,ie.LINEAR),fe=ee.heatmapFbo=V.createFramebuffer(W.width/4,W.height/4,!1),function(_e,we,$e,Ue){const et=_e.gl;et.texImage2D(et.TEXTURE_2D,0,et.RGBA,we.width/4,we.height/4,0,et.RGBA,_e.extRenderToTextureHalfFloat?_e.extTextureHalfFloat.HALF_FLOAT_OES:et.UNSIGNED_BYTE,null),Ue.colorAttachment.set($e)}(V,W,Se,fe)}})(b,x,h),b.clear({color:o.Color.transparent});for(let V=0;V{const _e=o.create();o.ortho(_e,0,ee.width,ee.height,0,0,1);const we=ee.context.gl;return{u_matrix:_e,u_world:[we.drawingBufferWidth,we.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ie.paint.get("heatmap-opacity")}})(b,P),null,P.id,b.viewportBuffer,b.quadTriangleIndexBuffer,b.viewportSegments,P.paint,b.transform.zoom)}(x,h))},line:function(x,l,h,g){if(x.renderPass!=="translucent")return;const b=h.paint.get("line-opacity"),P=h.paint.get("line-width");if(b.constantOr(1)===0||P.constantOr(1)===0)return;const z=x.depthModeForSublayer(0,Xr.ReadOnly),$=x.colorModeForRenderPass(),V=h.paint.get("line-dasharray"),W=h.paint.get("line-pattern"),ee=W.constantOr(1),ie=h.paint.get("line-gradient"),fe=h.getCrossfadeParameters(),Se=ee?"linePattern":V?"lineSDF":ie?"lineGradient":"line",_e=x.context,we=_e.gl;let $e=!0;for(const Ue of g){const et=l.getTile(Ue);if(ee&&!et.patternsLoaded())continue;const Pe=et.getBucket(h);if(!Pe)continue;const at=Pe.programConfigurations.get(h.id),rt=x.context.program.get(),gt=x.useProgram(Se,at),yt=$e||gt.program!==rt,zt=x.style.terrain&&x.style.terrain.getTerrainData(Ue),vt=W.constantOr(null);if(vt&&et.imageAtlas){const sr=et.imageAtlas,Dr=sr.patternPositions[vt.to.toString()],Vr=sr.patternPositions[vt.from.toString()];Dr&&Vr&&at.setConstantPatternPositions(Dr,Vr)}const nr=zt?Ue:null,Gt=ee?tl(x,et,h,fe,nr):V?Ja(x,et,h,V,fe,nr):ie?Vo(x,et,h,Pe.lineClipsArray.length,nr):Es(x,et,h,nr);if(ee)_e.activeTexture.set(we.TEXTURE0),et.imageAtlasTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE),at.updatePaintBuffers(fe);else if(V&&(yt||x.lineAtlas.dirty))_e.activeTexture.set(we.TEXTURE0),x.lineAtlas.bind(_e);else if(ie){const sr=Pe.gradients[h.id];let Dr=sr.texture;if(h.gradientVersion!==sr.version){let Vr=256;if(h.stepInterpolant){const _r=l.getSource().maxzoom,hn=Ue.canonical.z===_r?Math.ceil(1<256&&this.clearStencil(),g.setColorMode(Pn.disabled),g.setDepthMode(Xr.disabled);const P=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const z of h){const $=this._tileClippingMaskIDs[z.key]=this.nextStencilID++,V=this.style.terrain&&this.style.terrain.getTerrainData(z);P.draw(g,b.TRIANGLES,Xr.disabled,new En({func:b.ALWAYS,mask:0},$,255,b.KEEP,b.KEEP,b.REPLACE),Pn.disabled,Nn.disabled,Zr(z.posMatrix),V,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const l=this.nextStencilID++,h=this.context.gl;return new En({func:h.NOTEQUAL,mask:255},l,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(l){const h=this.context.gl;return new En({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[l.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(l){const h=this.context.gl,g=l.sort((z,$)=>$.overscaledZ-z.overscaledZ),b=g[g.length-1].overscaledZ,P=g[0].overscaledZ-b+1;if(P>1){this.currentStencilSource=void 0,this.nextStencilID+P>256&&this.clearStencil();const z={};for(let $=0;$=0;this.currentLayer--){const W=this.style._layers[g[this.currentLayer]],ee=b[W.source],ie=z[W.source];this._renderTileClippingMasks(W,ie),this.renderLayer(this,ee,W,ie)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer{ie.source&&!ie.isHidden(this.transform.zoom)&&(ie.source!==(ee&&ee.id)&&(ee=this.style.sourceCaches[ie.source]),(!W||W.getSource().maxzoom0?h.pop():null}isPatternMissing(l){if(!l)return!1;if(!l.from||!l.to)return!0;const h=this.imageManager.getPattern(l.from.toString()),g=this.imageManager.getPattern(l.to.toString());return!h||!g}useProgram(l,h){this.cache=this.cache||{};const g=l+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[g]||(this.cache[g]=new Ur(this.context,l,Cr[l],h,Lh[l],this._showOverdrawInspector,this.style.terrain)),this.cache[g]}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 l=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(l.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new R(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class $d{constructor(l,h){this.points=l,this.planes=h}static fromInvProjectionMatrix(l,h,g){const b=Math.pow(2,g),P=[[-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($=>{const V=1/($=o.transformMat4([],$,l))[3]/h*b;return o.mul$1($,$,[V,V,1/$[3],V])}),z=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map($=>{const V=o.sub([],P[$[0]],P[$[1]]),W=o.sub([],P[$[2]],P[$[1]]),ee=o.normalize([],o.cross([],V,W)),ie=-o.dot(ee,P[$[1]]);return ee.concat(ie)});return new $d(P,z)}}class vc{constructor(l,h){this.min=l,this.max=h,this.center=o.scale$1([],o.add([],this.min,this.max),.5)}quadrant(l){const h=[l%2==0,l<2],g=o.clone$2(this.min),b=o.clone$2(this.max);for(let P=0;P=0&&z++;if(z===0)return 0;z!==h.length&&(g=!1)}if(g)return 2;for(let b=0;b<3;b++){let P=Number.MAX_VALUE,z=-Number.MAX_VALUE;for(let $=0;$this.max[b]-this.min[b])return 0}return 1}}class eu{constructor(l=0,h=0,g=0,b=0){if(isNaN(l)||l<0||isNaN(h)||h<0||isNaN(g)||g<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=l,this.bottom=h,this.left=g,this.right=b}interpolate(l,h,g){return h.top!=null&&l.top!=null&&(this.top=o.number(l.top,h.top,g)),h.bottom!=null&&l.bottom!=null&&(this.bottom=o.number(l.bottom,h.bottom,g)),h.left!=null&&l.left!=null&&(this.left=o.number(l.left,h.left,g)),h.right!=null&&l.right!=null&&(this.right=o.number(l.right,h.right,g)),this}getCenter(l,h){const g=o.clamp((this.left+l-this.right)/2,0,l),b=o.clamp((this.top+h-this.bottom)/2,0,h);return new o.pointGeometry(g,b)}equals(l){return this.top===l.top&&this.bottom===l.bottom&&this.left===l.left&&this.right===l.right}clone(){return new eu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class gc{constructor(l,h,g,b,P){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=P===void 0||!!P,this._minZoom=l||0,this._maxZoom=h||22,this._minPitch=g==null?0:g,this._maxPitch=b==null?60:b,this.setMaxBounds(),this.width=0,this.height=0,this._center=new o.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new eu,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const l=new gc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return l.tileSize=this.tileSize,l.latRange=this.latRange,l.width=this.width,l.height=this.height,l._center=this._center,l._elevation=this._elevation,l.zoom=this.zoom,l.angle=this.angle,l._fov=this._fov,l._pitch=this._pitch,l._unmodified=this._unmodified,l._edgeInsets=this._edgeInsets.clone(),l._calcMatrices(),l}get minZoom(){return this._minZoom}set minZoom(l){this._minZoom!==l&&(this._minZoom=l,this.zoom=Math.max(this.zoom,l))}get maxZoom(){return this._maxZoom}set maxZoom(l){this._maxZoom!==l&&(this._maxZoom=l,this.zoom=Math.min(this.zoom,l))}get minPitch(){return this._minPitch}set minPitch(l){this._minPitch!==l&&(this._minPitch=l,this.pitch=Math.max(this.pitch,l))}get maxPitch(){return this._maxPitch}set maxPitch(l){this._maxPitch!==l&&(this._maxPitch=l,this.pitch=Math.min(this.pitch,l))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(l){l===void 0?l=!0:l===null&&(l=!1),this._renderWorldCopies=l}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(l){const h=-o.wrap(l,-180,180)*Math.PI/180;var g;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(g=new o.ARRAY_TYPE(4),o.ARRAY_TYPE!=Float32Array&&(g[1]=0,g[2]=0),g[0]=1,g[3]=1,g),function(b,P,z){var $=P[0],V=P[1],W=P[2],ee=P[3],ie=Math.sin(z),fe=Math.cos(z);b[0]=$*fe+W*ie,b[1]=V*fe+ee*ie,b[2]=$*-ie+W*fe,b[3]=V*-ie+ee*fe}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(l){const h=o.clamp(l,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(l){l=Math.max(.01,Math.min(60,l)),this._fov!==l&&(this._unmodified=!1,this._fov=l/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(l){const h=Math.min(Math.max(l,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.scale=this.zoomScale(h),this.tileZoom=Math.floor(h),this.zoomFraction=h-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(l){l.lat===this._center.lat&&l.lng===this._center.lng||(this._unmodified=!1,this._center=l,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(l){l!==this._elevation&&(this._elevation=l,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(l){this._edgeInsets.equals(l)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,l,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(l){return this._edgeInsets.equals(l)}interpolatePadding(l,h,g){this._unmodified=!1,this._edgeInsets.interpolate(l,h,g),this._constrain(),this._calcMatrices()}coveringZoomLevel(l){const h=(l.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/l.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(l){const h=[new o.UnwrappedTileID(0,l)];if(this._renderWorldCopies){const g=this.pointCoordinate(new o.pointGeometry(0,0)),b=this.pointCoordinate(new o.pointGeometry(this.width,0)),P=this.pointCoordinate(new o.pointGeometry(this.width,this.height)),z=this.pointCoordinate(new o.pointGeometry(0,this.height)),$=Math.floor(Math.min(g.x,b.x,P.x,z.x)),V=Math.floor(Math.max(g.x,b.x,P.x,z.x)),W=1;for(let ee=$-W;ee<=V+W;ee++)ee!==0&&h.push(new o.UnwrappedTileID(ee,l))}return h}coveringTiles(l){var h,g;let b=this.coveringZoomLevel(l);const P=b;if(l.minzoom!==void 0&&bl.maxzoom&&(b=l.maxzoom);const z=this.pointCoordinate(this.getCameraPoint()),$=o.MercatorCoordinate.fromLngLat(this.center),V=Math.pow(2,b),W=[V*z.x,V*z.y,0],ee=[V*$.x,V*$.y,0],ie=$d.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,b);let fe=l.minzoom||0;!l.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(fe=b);const Se=l.terrain?2/Math.min(this.tileSize,l.tileSize)*this.tileSize:3,_e=Pe=>({aabb:new vc([Pe*V,0,0],[(Pe+1)*V,V,0]),zoom:0,x:0,y:0,wrap:Pe,fullyVisible:!1}),we=[],$e=[],Ue=b,et=l.reparseOverscaled?P:b;if(this._renderWorldCopies)for(let Pe=1;Pe<=3;Pe++)we.push(_e(-Pe)),we.push(_e(Pe));for(we.push(_e(0));we.length>0;){const Pe=we.pop(),at=Pe.x,rt=Pe.y;let gt=Pe.fullyVisible;if(!gt){const sr=Pe.aabb.intersects(ie);if(sr===0)continue;gt=sr===2}const yt=l.terrain?W:ee,zt=Pe.aabb.distanceX(yt),vt=Pe.aabb.distanceY(yt),nr=Math.max(Math.abs(zt),Math.abs(vt)),Gt=Se+(1<Gt&&Pe.zoom>=fe){const sr=Ue-Pe.zoom,Dr=W[0]-.5-(at<>1),_r=Pe.zoom+1;let hn=Pe.aabb.quadrant(sr);if(l.terrain){const pn=new o.OverscaledTileID(_r,Pe.wrap,_r,Dr,Vr),Qr=l.terrain.getMinMaxElevation(pn),en=(h=Qr.minElevation)!==null&&h!==void 0?h:this.elevation,gn=(g=Qr.maxElevation)!==null&&g!==void 0?g:this.elevation;hn=new vc([hn.min[0],hn.min[1],en],[hn.max[0],hn.max[1],gn])}we.push({aabb:hn,zoom:_r,x:Dr,y:Vr,wrap:Pe.wrap,fullyVisible:gt})}}return $e.sort((Pe,at)=>Pe.distanceSq-at.distanceSq).map(Pe=>Pe.tileID)}resize(l,h){this.width=l,this.height=h,this.pixelsToGLUnits=[2/l,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(l){return Math.pow(2,l)}scaleZoom(l){return Math.log(l)/Math.LN2}project(l){const h=o.clamp(l.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.pointGeometry(o.mercatorXfromLng(l.lng)*this.worldSize,o.mercatorYfromLat(h)*this.worldSize)}unproject(l){return new o.MercatorCoordinate(l.x/this.worldSize,l.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(l){this.freezeElevation||(this.elevation=l?this.getElevation(this._center,l):0)}getElevation(l,h){const g=o.MercatorCoordinate.fromLngLat(l),b=(1<z&&(b=z-_e)}if(this.lngRange){const Se=($+V)/2,_e=o.wrap(ie.x,Se-this.worldSize/2,Se+this.worldSize/2),we=W.x/2;_e-we<$&&(g=$+we),_e+we>V&&(g=V-we)}g===void 0&&b===void 0||(this.center=this.unproject(new o.pointGeometry(g!==void 0?g:ie.x,b!==void 0?b:ie.y)).wrap()),this._unmodified=ee,this._constraining=!1}_calcMatrices(){if(!this.height)return;const l=this.centerOffset,h=this.point.x,g=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=o.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let b=o.identity(new Float64Array(16));o.scale(b,b,[this.width/2,-this.height/2,1]),o.translate(b,b,[1,-1,0]),this.labelPlaneMatrix=b,b=o.identity(new Float64Array(16)),o.scale(b,b,[1,-1,1]),o.translate(b,b,[-1,-1,0]),o.scale(b,b,[2/this.width,2/this.height,1]),this.glCoordMatrix=b,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const P=Math.PI/2+this._pitch,z=this._fov*(.5+l.y/this.height),$=Math.sin(z)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-P-z,.01,Math.PI-.01)),V=this.getHorizon(),W=2*Math.atan(V/this.cameraToCenterDistance)*(.5+l.y/(2*V)),ee=Math.sin(W)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-P-W,.01,Math.PI-.01)),ie=Math.cos(Math.PI/2-this._pitch)*$+this.cameraToSeaLevelDistance,fe=Math.cos(Math.PI/2-this._pitch)*ee+this.cameraToSeaLevelDistance,Se=1.01*Math.min(ie,fe),_e=this.height/50;b=new Float64Array(16),o.perspective(b,this._fov,this.width/this.height,_e,Se),b[8]=2*-l.x/this.width,b[9]=2*l.y/this.height,o.scale(b,b,[1,-1,1]),o.translate(b,b,[0,0,-this.cameraToCenterDistance]),o.rotateX(b,b,this._pitch),o.rotateZ(b,b,this.angle),o.translate(b,b,[-h,-g,0]),this.mercatorMatrix=o.scale([],b,[this.worldSize,this.worldSize,this.worldSize]),o.scale(b,b,[1,1,this._pixelPerMeter]),this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatrix,b),o.translate(b,b,[0,0,-this.elevation]),this.projMatrix=b,this.invProjMatrix=o.invert([],b),this.pixelMatrix3D=o.multiply(new Float64Array(16),this.labelPlaneMatrix,b);const we=this.width%2/2,$e=this.height%2/2,Ue=Math.cos(this.angle),et=Math.sin(this.angle),Pe=h-Math.round(h)+Ue*we+et*$e,at=g-Math.round(g)+Ue*$e+et*we,rt=new Float64Array(b);if(o.translate(rt,rt,[Pe>.5?Pe-1:Pe,at>.5?at-1:at,0]),this.alignedProjMatrix=rt,b=o.invert(new Float64Array(16),this.pixelMatrix),!b)throw new Error("failed to invert matrix");this.pixelMatrixInverse=b,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const l=this.pointCoordinate(new o.pointGeometry(0,0)),h=[l.x*this.worldSize,l.y*this.worldSize,0,1];return o.transformMat4(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const l=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.pointGeometry(0,l))}getCameraQueryGeometry(l){const h=this.getCameraPoint();if(l.length===1)return[l[0],h];{let g=h.x,b=h.y,P=h.x,z=h.y;for(const $ of l)g=Math.min(g,$.x),b=Math.min(b,$.y),P=Math.max(P,$.x),z=Math.max(z,$.y);return[new o.pointGeometry(g,b),new o.pointGeometry(P,b),new o.pointGeometry(P,z),new o.pointGeometry(g,z),new o.pointGeometry(g,b)]}}}class cg{constructor(l){this._hashName=l&&encodeURIComponent(l),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(h,g){let b=!1,P=null;const z=()=>{P=null,b&&(h(),P=setTimeout(z,300),b=!1)};return()=>(b=!0,P||z(),P)}(this._updateHashUnthrottled.bind(this))}addTo(l){return this._map=l,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(l){const h=this._map.getCenter(),g=Math.round(100*this._map.getZoom())/100,b=Math.ceil((g*Math.LN2+Math.log(512/360/.5))/Math.LN10),P=Math.pow(10,b),z=Math.round(h.lng*P)/P,$=Math.round(h.lat*P)/P,V=this._map.getBearing(),W=this._map.getPitch();let ee="";if(ee+=l?`/${z}/${$}/${g}`:`${g}/${$}/${z}`,(V||W)&&(ee+="/"+Math.round(10*V)/10),W&&(ee+=`/${Math.round(W)}`),this._hashName){const ie=this._hashName;let fe=!1;const Se=window.location.hash.slice(1).split("&").map(_e=>{const we=_e.split("=")[0];return we===ie?(fe=!0,`${we}=${ee}`):_e}).filter(_e=>_e);return fe||Se.push(`${ie}=${ee}`),`#${Se.join("&")}`}return`#${ee}`}_getCurrentHash(){const l=window.location.hash.replace("#","");if(this._hashName){let h;return l.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(h=g)}),(h&&h[1]||"").split("/")}return l.split("/")}_onHashChange(){const l=this._getCurrentHash();if(l.length>=3&&!l.some(h=>isNaN(h))){const h=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(l[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+l[2],+l[1]],zoom:+l[0],bearing:h,pitch:+(l[4]||0)}),!0}return!1}_updateHashUnthrottled(){const l=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,l)}catch{}}}const yc={linearity:.3,easing:o.bezier(0,0,.3,1)},dg=o.extend({deceleration:2500,maxSpeed:1400},yc),fg=o.extend({deceleration:20,maxSpeed:1400},yc),hg=o.extend({deceleration:1e3,maxSpeed:360},yc),tu=o.extend({deceleration:1e3,maxSpeed:90},yc);class pg{constructor(l){this._map=l,this.clear()}clear(){this._inertiaBuffer=[]}record(l){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.exported.now(),settings:l})}_drainInertiaBuffer(){const l=this._inertiaBuffer,h=o.exported.now();for(;l.length>0&&h-l[0].time>160;)l.shift()}_onMoveEnd(l){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new o.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:P}of this._inertiaBuffer)h.zoom+=P.zoomDelta||0,h.bearing+=P.bearingDelta||0,h.pitch+=P.pitchDelta||0,P.panDelta&&h.pan._add(P.panDelta),P.around&&(h.around=P.around),P.pinchAround&&(h.pinchAround=P.pinchAround);const g=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,b={};if(h.pan.mag()){const P=_c(h.pan.mag(),g,o.extend({},dg,l||{}));b.offset=h.pan.mult(P.amount/h.pan.mag()),b.center=this._map.transform.center,xc(b,P)}if(h.zoom){const P=_c(h.zoom,g,fg);b.zoom=this._map.transform.zoom+P.amount,xc(b,P)}if(h.bearing){const P=_c(h.bearing,g,hg);b.bearing=this._map.transform.bearing+o.clamp(P.amount,-179,179),xc(b,P)}if(h.pitch){const P=_c(h.pitch,g,tu);b.pitch=this._map.transform.pitch+P.amount,xc(b,P)}if(b.zoom||b.bearing){const P=h.pinchAround===void 0?h.around:h.pinchAround;b.around=P?this._map.unproject(P):this._map.getCenter()}return this.clear(),o.extend(b,{noMoveStart:!0})}}function xc(x,l){(!x.duration||x.durationh.unproject(V)),$=P.reduce((V,W,ee,ie)=>V.add(W.div(ie.length)),new o.pointGeometry(0,0));super(l,{points:P,point:$,lngLats:z,lngLat:h.unproject($),originalEvent:g}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class So extends o.Event{constructor(l,h,g){super(l,{originalEvent:g}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class x_{constructor(l,h){this._map=l,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(l){return this._firePreventable(new So(l.type,this._map,l))}mousedown(l,h){return this._mousedownPos=h,this._firePreventable(new Co(l.type,this._map,l))}mouseup(l){this._map.fire(new Co(l.type,this._map,l))}click(l,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Co(l.type,this._map,l))}dblclick(l){return this._firePreventable(new Co(l.type,this._map,l))}mouseover(l){this._map.fire(new Co(l.type,this._map,l))}mouseout(l){this._map.fire(new Co(l.type,this._map,l))}touchstart(l){return this._firePreventable(new bc(l.type,this._map,l))}touchmove(l){this._map.fire(new bc(l.type,this._map,l))}touchend(l){this._map.fire(new bc(l.type,this._map,l))}touchcancel(l){this._map.fire(new bc(l.type,this._map,l))}_firePreventable(l){if(this._map.fire(l),l.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ks{constructor(l){this._map=l}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(l){this._map.fire(new Co(l.type,this._map,l))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Co("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(l){this._delayContextMenu?this._contextMenuEvent=l:this._ignoreContextMenu||this._map.fire(new Co(l.type,this._map,l)),this._map.listens("contextmenu")&&l.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class mg{constructor(l,h){this._map=l,this._el=l.getCanvasContainer(),this._container=l.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(l,h){this.isEnabled()&&l.shiftKey&&l.button===0&&(w.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(l,h){if(!this._active)return;const g=h;if(this._lastPos.equals(g)||!this._box&&g.dist(this._startPos)P.fitScreenCoordinates(g,b,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",l)}keydown(l){this._active&&l.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",l))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(w.remove(this._box),this._box=null),w.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(l,h){return this._map.fire(new o.Event(l,{originalEvent:h}))}}function ts(x,l){if(x.length!==l.length)throw new Error(`The number of touches and points are not equal - touches ${x.length}, points ${l.length}`);const h={};for(let g=0;gthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=l.timeStamp),g.length===this.numTouches&&(this.centroid=function(b){const P=new o.pointGeometry(0,0);for(const z of b)P._add(z);return P.div(b.length)}(h),this.touches=ts(g,h)))}touchmove(l,h,g){if(this.aborted||!this.centroid)return;const b=ts(g,h);for(const P in this.touches){const z=this.touches[P],$=b[P];(!$||$.dist(z)>30)&&(this.aborted=!0)}}touchend(l,h,g){if((!this.centroid||l.timeStamp-this.startTime>500)&&(this.aborted=!0),g.length===0){const b=!this.aborted&&this.centroid;if(this.reset(),b)return b}}}class Qh{constructor(l){this.singleTap=new wc(l),this.numTaps=l.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(l,h,g){this.singleTap.touchstart(l,h,g)}touchmove(l,h,g){this.singleTap.touchmove(l,h,g)}touchend(l,h,g){const b=this.singleTap.touchend(l,h,g);if(b){const P=l.timeStamp-this.lastTime<500,z=!this.lastTap||this.lastTap.dist(b)<30;if(P&&z||this.reset(),this.count++,this.lastTime=l.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}class __{constructor(){this._zoomIn=new Qh({numTouches:1,numTaps:2}),this._zoomOut=new Qh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(l,h,g){this._zoomIn.touchstart(l,h,g),this._zoomOut.touchstart(l,h,g)}touchmove(l,h,g){this._zoomIn.touchmove(l,h,g),this._zoomOut.touchmove(l,h,g)}touchend(l,h,g){const b=this._zoomIn.touchend(l,h,g),P=this._zoomOut.touchend(l,h,g);return b?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:z=>z.easeTo({duration:300,zoom:z.getZoom()+1,around:z.unproject(b)},{originalEvent:l})}):P?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:z=>z.easeTo({duration:300,zoom:z.getZoom()-1,around:z.unproject(P)},{originalEvent:l})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const b_={0:1,2:2};class Bd{constructor(l){this.reset(),this._clickTolerance=l.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(l,h){return!1}_move(l,h){return{}}mousedown(l,h){if(this._lastPoint)return;const g=w.mouseButton(l);this._correctButton(l,g)&&(this._lastPoint=h,this._eventButton=g)}mousemoveWindow(l,h){const g=this._lastPoint;if(g){if(l.preventDefault(),function(b,P){const z=b_[P];return b.buttons===void 0||(b.buttons&z)!==z}(l,this._eventButton))this.reset();else if(this._moved||!(h.dist(g){this._cancelCooperativeMessage=!1},200)}touchstart(l,h,g){return this._calculateTransform(l,h,g)}touchmove(l,h,g){if(this._map._cooperativeGestures&&(this._minTouches===2&&g.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(l,!1,g.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(g.length0&&(this._active=!0);const b=ts(g,h),P=new o.pointGeometry(0,0),z=new o.pointGeometry(0,0);let $=0;for(const W in b){const ee=b[W],ie=this._touches[W];ie&&(P._add(ee),z._add(ee.sub(ie)),$++,b[W]=ee)}if(this._touches=b,$Math.abs(x.x)}class tp extends il{constructor(l){super(),this._map=l}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(l,h,g){super.touchstart(l,h,g),this._currentTouchCount=g.length}_start(l){this._lastPoints=l,ep(l[0].sub(l[1]))&&(this._valid=!1)}_move(l,h,g){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const b=l[0].sub(this._lastPoints[0]),P=l[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(b,P,g.timeStamp),this._valid?(this._lastPoints=l,this._active=!0,{pitchDelta:(b.y+P.y)/2*-.5}):void 0}gestureBeginsVertically(l,h,g){if(this._valid!==void 0)return this._valid;const b=l.mag()>=2,P=h.mag()>=2;if(!b&&!P)return;if(!b||!P)return this._firstMove===void 0&&(this._firstMove=g),g-this._firstMove<100&&void 0;const z=l.y>0==h.y>0;return ep(l)&&ep(h)&&z}}const gg={panStep:100,bearingStep:15,pitchStep:10};class yg{constructor(){const l=gg;this._panStep=l.panStep,this._bearingStep=l.bearingStep,this._pitchStep=l.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(l){if(l.altKey||l.ctrlKey||l.metaKey)return;let h=0,g=0,b=0,P=0,z=0;switch(l.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:l.shiftKey?g=-1:(l.preventDefault(),P=-1);break;case 39:l.shiftKey?g=1:(l.preventDefault(),P=1);break;case 38:l.shiftKey?b=1:(l.preventDefault(),z=-1);break;case 40:l.shiftKey?b=-1:(l.preventDefault(),z=1);break;default:return}return this._rotationDisabled&&(g=0,b=0),{cameraAnimation:$=>{const V=$.getZoom();$.easeTo({duration:300,easeId:"keyboardHandler",easing:C_,zoom:h?Math.round(V)+h*(l.shiftKey?2:1):V,bearing:$.getBearing()+g*this._bearingStep,pitch:$.getPitch()+b*this._pitchStep,offset:[-P*this._panStep,-z*this._panStep],center:$.getCenter()},{originalEvent:l})}}}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 C_(x){return x*(2-x)}const xg=4.000244140625;class rp{constructor(l,h){this._map=l,this._el=l.getCanvasContainer(),this._handler=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,o.bindAll(["_onTimeout"],this)}setZoomRate(l){this._defaultZoomRate=l}setWheelZoomRate(l){this._wheelZoomRate=l}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(l){this.isEnabled()||(this._enabled=!0,this._aroundCenter=l&&l.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(l){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;l.preventDefault()}let h=l.deltaMode===WheelEvent.DOM_DELTA_LINE?40*l.deltaY:l.deltaY;const g=o.exported.now(),b=g-(this._lastWheelEventTime||0);this._lastWheelEventTime=g,h!==0&&h%xg==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":b>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,l)):this._type||(this._type=Math.abs(b*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),l.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=l,this._delta-=h,this._active||this._start(l)),l.preventDefault()}_onTimeout(l){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(l)}_start(l){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 h=w.mousePos(this._el,l);this._around=o.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(h)),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 l=this._map.transform;if(this._delta!==0){const $=this._type==="wheel"&&Math.abs(this._delta)>xg?this._wheelZoomRate:this._defaultZoomRate;let V=2/(1+Math.exp(-Math.abs(this._delta*$)));this._delta<0&&V!==0&&(V=1/V);const W=typeof this._targetZoom=="number"?l.zoomScale(this._targetZoom):l.scale;this._targetZoom=Math.min(l.maxZoom,Math.max(l.minZoom,l.scaleZoom(W*V))),this._type==="wheel"&&(this._startZoom=l.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:l.zoom,g=this._startZoom,b=this._easing;let P,z=!1;if(this._type==="wheel"&&g&&b){const $=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),V=b($);P=o.number(g,h,V),$<1?this._frameId||(this._frameId=!0):z=!0}else P=h,z=!0;return this._active=!0,z&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!z,zoomDelta:P-l.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(l){let h=o.ease;if(this._prevEase){const g=this._prevEase,b=(o.exported.now()-g.start)/g.duration,P=g.easing(b+.01)-g.easing(b),z=.27/Math.sqrt(P*P+1e-4)*.01,$=Math.sqrt(.0729-z*z);h=o.bezier(z,$,.25,1)}return this._prevEase={start:o.exported.now(),duration:l,easing:h},h}reset(){this._active=!1}}class np{constructor(l,h){this._clickZoom=l,this._tapZoom=h}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 ip{constructor(){this.reset()}reset(){this._active=!1}dblclick(l,h){return l.preventDefault(),{cameraAnimation:g=>{g.easeTo({duration:300,zoom:g.getZoom()+(l.shiftKey?-1:1),around:g.unproject(h)},{originalEvent:l})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class op{constructor(){this._tap=new Qh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(l,h,g){this._swipePoint||(this._tapTime&&l.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?g.length>0&&(this._swipePoint=h[0],this._swipeTouch=g[0].identifier):this._tap.touchstart(l,h,g))}touchmove(l,h,g){if(this._tapTime){if(this._swipePoint){if(g[0].identifier!==this._swipeTouch)return;const b=h[0],P=b.y-this._swipePoint.y;return this._swipePoint=b,l.preventDefault(),this._active=!0,{zoomDelta:P/128}}}else this._tap.touchmove(l,h,g)}touchend(l,h,g){this._tapTime?this._swipePoint&&g.length===0&&this.reset():this._tap.touchend(l,h,g)&&(this._tapTime=l.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class uo{constructor(l,h,g){this._el=l,this._mousePan=h,this._touchPan=g}enable(l){this._inertiaOptions=l||{},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 Ps{constructor(l,h,g){this._pitchWithRotate=l.pitchWithRotate,this._mouseRotate=h,this._mousePitch=g}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 _g{constructor(l,h,g,b){this._el=l,this._touchZoom=h,this._touchRotate=g,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0}enable(l){this._touchZoom.enable(l),this._rotationDisabled||this._touchRotate.enable(l),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 ru=x=>x.zoom||x.drag||x.pitch||x.rotate;class ap extends o.Event{}function Sc(x){return x.panDelta&&x.panDelta.mag()||x.zoomDelta||x.bearingDelta||x.pitchDelta}class bg{constructor(l,h){this._map=l,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new pg(l),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h),o.bindAll(["handleEvent","handleWindowEvent"],this);const g=this._el;this._listeners=[[g,"touchstart",{passive:!0}],[g,"touchmove",{passive:!1}],[g,"touchend",void 0],[g,"touchcancel",void 0],[g,"mousedown",void 0],[g,"mousemove",void 0],[g,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[g,"mouseover",void 0],[g,"mouseout",void 0],[g,"dblclick",void 0],[g,"click",void 0],[g,"keydown",{capture:!1}],[g,"keyup",void 0],[g,"wheel",{passive:!1}],[g,"contextmenu",void 0],[window,"blur",void 0]];for(const[b,P,z]of this._listeners)w.addEventListener(b,P,b===document?this.handleWindowEvent:this.handleEvent,z)}destroy(){for(const[l,h,g]of this._listeners)w.removeEventListener(l,h,l===document?this.handleWindowEvent:this.handleEvent,g)}_addDefaultHandlers(l){const h=this._map,g=h.getCanvasContainer();this._add("mapEvent",new x_(h,l));const b=h.boxZoom=new mg(h,l);this._add("boxZoom",b);const P=new __,z=new ip;h.doubleClickZoom=new np(z,P),this._add("tapZoom",P),this._add("clickZoom",z);const $=new op;this._add("tapDragZoom",$);const V=h.touchPitch=new tp(h);this._add("touchPitch",V);const W=new rs(l),ee=new dr(l);h.dragRotate=new Ps(l,W,ee),this._add("mouseRotate",W,["mousePitch"]),this._add("mousePitch",ee,["mouseRotate"]);const ie=new Cc(l),fe=new vg(l,h);h.dragPan=new uo(g,ie,fe),this._add("mousePan",ie),this._add("touchPan",fe,["touchZoom","touchRotate"]);const Se=new w_,_e=new Jt;h.touchZoomRotate=new _g(g,_e,Se,$),this._add("touchRotate",Se,["touchPan","touchZoom"]),this._add("touchZoom",_e,["touchPan","touchRotate"]);const we=h.scrollZoom=new rp(h,this);this._add("scrollZoom",we,["mousePan"]);const $e=h.keyboard=new yg;this._add("keyboard",$e),this._add("blockableMapEvent",new ks(h));for(const Ue of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])l.interactive&&l[Ue]&&h[Ue].enable(l[Ue])}_add(l,h,g){this._handlers.push({handlerName:l,handler:h,allowed:g}),this._handlersById[l]=h}stop(l){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},l),this._changes=[]}}isActive(){for(const{handler:l}of this._handlers)if(l.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(ru(this._eventsInProgress))||this.isZooming()}_blockedByActive(l,h,g){for(const b in l)if(b!==g&&(!h||h.indexOf(b)<0))return!0;return!1}handleWindowEvent(l){this.handleEvent(l,`${l.type}Window`)}_getMapTouches(l){const h=[];for(const g of l)this._el.contains(g.target)&&h.push(g);return h}handleEvent(l,h){if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const g=l.type==="renderFrame"?void 0:l,b={needsRenderFrame:!1},P={},z={},$=l.touches,V=$?this._getMapTouches($):void 0,W=V?w.touchPos(this._el,V):w.mousePos(this._el,l);for(const{handlerName:fe,handler:Se,allowed:_e}of this._handlers){if(!Se.isEnabled())continue;let we;this._blockedByActive(z,_e,fe)?Se.reset():Se[h||l.type]&&(we=Se[h||l.type](l,W,V),this.mergeHandlerResult(b,P,we,fe,g),we&&we.needsRenderFrame&&this._triggerRenderFrame()),(we||Se.isActive())&&(z[fe]=Se)}const ee={};for(const fe in this._previousActiveHandlers)z[fe]||(ee[fe]=g);this._previousActiveHandlers=z,(Object.keys(ee).length||Sc(b))&&(this._changes.push([b,P,ee]),this._triggerRenderFrame()),(Object.keys(z).length||Sc(b))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ie}=b;ie&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ie(this._map))}mergeHandlerResult(l,h,g,b,P){if(!g)return;o.extend(l,g);const z={handlerName:b,originalEvent:g.originalEvent||P};g.zoomDelta!==void 0&&(h.zoom=z),g.panDelta!==void 0&&(h.drag=z),g.pitchDelta!==void 0&&(h.pitch=z),g.bearingDelta!==void 0&&(h.rotate=z)}_applyChanges(){const l={},h={},g={};for(const[b,P,z]of this._changes)b.panDelta&&(l.panDelta=(l.panDelta||new o.pointGeometry(0,0))._add(b.panDelta)),b.zoomDelta&&(l.zoomDelta=(l.zoomDelta||0)+b.zoomDelta),b.bearingDelta&&(l.bearingDelta=(l.bearingDelta||0)+b.bearingDelta),b.pitchDelta&&(l.pitchDelta=(l.pitchDelta||0)+b.pitchDelta),b.around!==void 0&&(l.around=b.around),b.pinchAround!==void 0&&(l.pinchAround=b.pinchAround),b.noInertia&&(l.noInertia=b.noInertia),o.extend(h,P),o.extend(g,z);this._updateMapTransform(l,h,g),this._changes=[]}_updateMapTransform(l,h,g){const b=this._map,P=b.transform,z=b.style&&b.style.terrain;if(!(Sc(l)||z&&this._drag))return this._fireEvents(h,g,!0);let{panDelta:$,zoomDelta:V,bearingDelta:W,pitchDelta:ee,around:ie,pinchAround:fe}=l;fe!==void 0&&(ie=fe),b._stop(!0),ie=ie||b.transform.centerPoint;const Se=P.pointLocation($?ie.sub($):ie);W&&(P.bearing+=W),ee&&(P.pitch+=ee),V&&(P.zoom+=V),z?h.drag&&!this._drag?(this._drag={center:P.centerPoint,lngLat:P.pointLocation(ie),point:ie,handlerName:h.drag.handlerName},b.fire(new o.Event("freezeElevation",{freeze:!0}))):this._drag&&g[this._drag.handlerName]?(b.fire(new o.Event("freezeElevation",{freeze:!1})),this._drag=null):h.drag&&this._drag&&(P.center=P.pointLocation(P.centerPoint.sub($))):P.setLocationAtPoint(Se,ie),this._map._update(),l.noInertia||this._inertia.record(l),this._fireEvents(h,g,!0)}_fireEvents(l,h,g){const b=ru(this._eventsInProgress),P=ru(l),z={};for(const ee in l){const{originalEvent:ie}=l[ee];this._eventsInProgress[ee]||(z[`${ee}start`]=ie),this._eventsInProgress[ee]=l[ee]}!b&&P&&this._fireEvent("movestart",P.originalEvent);for(const ee in z)this._fireEvent(ee,z[ee]);P&&this._fireEvent("move",P.originalEvent);for(const ee in l){const{originalEvent:ie}=l[ee];this._fireEvent(ee,ie)}const $={};let V;for(const ee in this._eventsInProgress){const{handlerName:ie,originalEvent:fe}=this._eventsInProgress[ee];this._handlersById[ie].isActive()||(delete this._eventsInProgress[ee],V=h[ie]||fe,$[`${ee}end`]=V)}for(const ee in $)this._fireEvent(ee,$[ee]);const W=ru(this._eventsInProgress);if(g&&(b||P)&&!W){this._updatingCamera=!0;const ee=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=fe=>fe!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ap("renderFrame",{timeStamp:l})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const jo={extend:(x,...l)=>o.extend(x,...l),run(x){x()},logToElement(x,l=!1,h="log"){const g=window.document.getElementById(h);g&&(l&&(g.innerHTML=""),g.innerHTML+=`
${x}`)}};class zn extends o.Evented{constructor(l,h){super(),this._moving=!1,this._zooming=!1,this.transform=l,this._bearingSnap=h.bearingSnap,o.bindAll(["_renderFrameCallback"],this)}getCenter(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(l,h){return this.jumpTo({center:l},h)}panBy(l,h,g){return l=o.pointGeometry.convert(l).mult(-1),this.panTo(this.transform.center,o.extend({offset:l},h),g)}panTo(l,h,g){return this.easeTo(o.extend({center:l},h),g)}getZoom(){return this.transform.zoom}setZoom(l,h){return this.jumpTo({zoom:l},h),this}zoomTo(l,h,g){return this.easeTo(o.extend({zoom:l},h),g)}zoomIn(l,h){return this.zoomTo(this.getZoom()+1,l,h),this}zoomOut(l,h){return this.zoomTo(this.getZoom()-1,l,h),this}getBearing(){return this.transform.bearing}setBearing(l,h){return this.jumpTo({bearing:l},h),this}getPadding(){return this.transform.padding}setPadding(l,h){return this.jumpTo({padding:l},h),this}rotateTo(l,h,g){return this.easeTo(o.extend({bearing:l},h),g)}resetNorth(l,h){return this.rotateTo(0,o.extend({duration:1e3},l),h),this}resetNorthPitch(l,h){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},l),h),this}snapToNorth(l,h){return Math.abs(this.getBearing()){if(this._zooming&&(g.zoom=o.number(b,V,gt)),this._rotating&&(g.bearing=o.number(P,W,gt)),this._pitching&&(g.pitch=o.number(z,ee,gt)),this._padding&&(g.interpolatePadding($,ie,gt),Se=g.centerPoint.add(fe)),Pe)g.setLocationAtPoint(Pe,at);else{const yt=g.zoomScale(g.zoom-b),zt=V>b?Math.min(2,et):Math.max(.5,et),vt=Math.pow(zt,1-gt),nr=g.unproject($e.add(Ue.mult(gt*vt)).mult(yt));g.setLocationAtPoint(g.renderWorldCopies?nr.wrap():nr,Se)}this._fireMoveEvents(h)},gt=>{this._afterEase(h,gt)},l),this}_prepareEase(l,h,g={}){this._moving=!0,this.fire(new o.Event("freezeElevation",{freeze:!0})),h||g.moving||this.fire(new o.Event("movestart",l)),this._zooming&&!g.zooming&&this.fire(new o.Event("zoomstart",l)),this._rotating&&!g.rotating&&this.fire(new o.Event("rotatestart",l)),this._pitching&&!g.pitching&&this.fire(new o.Event("pitchstart",l))}_fireMoveEvents(l){this.fire(new o.Event("move",l)),this._zooming&&this.fire(new o.Event("zoom",l)),this._rotating&&this.fire(new o.Event("rotate",l)),this._pitching&&this.fire(new o.Event("pitch",l))}_afterEase(l,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId,this.fire(new o.Event("freezeElevation",{freeze:!1}));const g=this._zooming,b=this._rotating,P=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,g&&this.fire(new o.Event("zoomend",l)),b&&this.fire(new o.Event("rotateend",l)),P&&this.fire(new o.Event("pitchend",l)),this.fire(new o.Event("moveend",l))}flyTo(l,h){if(!l.essential&&o.exported.prefersReducedMotion){const _r=o.pick(l,["center","zoom","bearing","pitch","around"]);return this.jumpTo(_r,h)}this.stop(),l=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},l);const g=this.transform,b=this.getZoom(),P=this.getBearing(),z=this.getPitch(),$=this.getPadding(),V="zoom"in l?o.clamp(+l.zoom,g.minZoom,g.maxZoom):b,W="bearing"in l?this._normalizeBearing(l.bearing,P):P,ee="pitch"in l?+l.pitch:z,ie="padding"in l?l.padding:g.padding,fe=g.zoomScale(V-b),Se=o.pointGeometry.convert(l.offset);let _e=g.centerPoint.add(Se);const we=g.pointLocation(_e),$e=o.LngLat.convert(l.center||we);this._normalizeCenter($e);const Ue=g.project(we),et=g.project($e).sub(Ue);let Pe=l.curve;const at=Math.max(g.width,g.height),rt=at/fe,gt=et.mag();if("minZoom"in l){const _r=o.clamp(Math.min(l.minZoom,b,V),g.minZoom,g.maxZoom),hn=at/g.zoomScale(_r-b);Pe=Math.sqrt(hn/gt*2)}const yt=Pe*Pe;function zt(_r){const hn=(rt*rt-at*at+(_r?-1:1)*yt*yt*gt*gt)/(2*(_r?rt:at)*yt*gt);return Math.log(Math.sqrt(hn*hn+1)-hn)}function vt(_r){return(Math.exp(_r)-Math.exp(-_r))/2}function nr(_r){return(Math.exp(_r)+Math.exp(-_r))/2}const Gt=zt(0);let sr=function(_r){return nr(Gt)/nr(Gt+Pe*_r)},Dr=function(_r){return at*((nr(Gt)*(vt(hn=Gt+Pe*_r)/nr(hn))-vt(Gt))/yt)/gt;var hn},Vr=(zt(1)-Gt)/Pe;if(Math.abs(gt)<1e-6||!isFinite(Vr)){if(Math.abs(at-rt)<1e-6)return this.easeTo(l,h);const _r=rtl.maxDuration&&(l.duration=0),this._zooming=!0,this._rotating=P!==W,this._pitching=ee!==z,this._padding=!g.isPaddingEqual(ie),this._prepareEase(h,!1),this._ease(_r=>{const hn=_r*Vr,pn=1/sr(hn);g.zoom=_r===1?V:b+g.scaleZoom(pn),this._rotating&&(g.bearing=o.number(P,W,_r)),this._pitching&&(g.pitch=o.number(z,ee,_r)),this._padding&&(g.interpolatePadding($,ie,_r),_e=g.centerPoint.add(Se));const Qr=_r===1?$e:g.unproject(Ue.add(et.mult(Dr(hn))).mult(pn));g.setLocationAtPoint(g.renderWorldCopies?Qr.wrap():Qr,_e),this._fireMoveEvents(h)},()=>this._afterEase(h),l),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(l,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const g=this._onEaseEnd;delete this._onEaseEnd,g.call(this,h)}if(!l){const g=this.handlers;g&&g.stop(!1)}return this}_ease(l,h,g){g.animate===!1||g.duration===0?(l(1),h()):(this._easeStart=o.exported.now(),this._easeOptions=g,this._onEaseFrame=l,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const l=Math.min((o.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(l,h){l=o.wrap(l,-180,180);const g=Math.abs(l-h);return Math.abs(l-360-h)180?-360:g<-180?360:0}}class Ec{constructor(l={}){this.options=l,o.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(l){return this._map=l,this._compact=this.options&&this.options.compact,this._container=w.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=w.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=w.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(){w.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(l,h){const g=this._map._getUIString(`AttributionControl.${h}`);l.title=g,l.setAttribute("aria-label",g)}_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(l){!l||l.sourceDataType!=="metadata"&&l.sourceDataType!=="visibility"&&l.dataType!=="style"&&l.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let l=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?l=l.concat(this.options.customAttribution.map(b=>typeof b!="string"?"":b)):typeof this.options.customAttribution=="string"&&l.push(this.options.customAttribution)),this._map.style.stylesheet){const b=this._map.style.stylesheet;this.styleOwner=b.owner,this.styleId=b.id}const h=this._map.style.sourceCaches;for(const b in h){const P=h[b];if(P.used||P.usedForTerrain){const z=P.getSource();z.attribution&&l.indexOf(z.attribution)<0&&l.push(z.attribution)}}l=l.filter(b=>String(b).trim()),l.sort((b,P)=>b.length-P.length),l=l.filter((b,P)=>{for(let z=P+1;z=0)return!1;return!0});const g=l.join(" | ");g!==this._attribHTML&&(this._attribHTML=g,l.length?(this._innerContainer.innerHTML=g,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 jd{constructor(l={}){this.options=l,o.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(l){this._map=l,this._compact=this.options&&this.options.compact,this._container=w.create("div","maplibregl-ctrl mapboxgl-ctrl");const h=w.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){w.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const l=this._container.children;if(l.length){const h=l[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&h.classList.add("maplibregl-compact","mapboxgl-compact"):h.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class wg{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(l){const h=++this._id;return this._queue.push({callback:l,id:h,cancelled:!1}),h}remove(l){const h=this._currentlyRunning,g=h?this._queue.concat(h):this._queue;for(const b of g)if(b.id===l)return void(b.cancelled=!0)}run(l=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const g of h)if(!g.cancelled&&(g.callback(l),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Cg={"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"},Sg={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},S_={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ea{constructor(l,h,g=!1){this._clickTolerance=10,this.element=h,this.mouseRotate=new rs({clickTolerance:l.dragRotate._mouseRotate._clickTolerance}),this.map=l,g&&(this.mousePitch=new dr({clickTolerance:l.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),w.addEventListener(h,"mousedown",this.mousedown),w.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),w.addEventListener(h,"touchmove",this.touchmove),w.addEventListener(h,"touchend",this.touchend),w.addEventListener(h,"touchcancel",this.reset)}down(l,h){this.mouseRotate.mousedown(l,h),this.mousePitch&&this.mousePitch.mousedown(l,h),w.disableDrag()}move(l,h){const g=this.map,b=this.mouseRotate.mousemoveWindow(l,h);if(b&&b.bearingDelta&&g.setBearing(g.getBearing()+b.bearingDelta),this.mousePitch){const P=this.mousePitch.mousemoveWindow(l,h);P&&P.pitchDelta&&g.setPitch(g.getPitch()+P.pitchDelta)}}off(){const l=this.element;w.removeEventListener(l,"mousedown",this.mousedown),w.removeEventListener(l,"touchstart",this.touchstart,{passive:!1}),w.removeEventListener(l,"touchmove",this.touchmove),w.removeEventListener(l,"touchend",this.touchend),w.removeEventListener(l,"touchcancel",this.reset),this.offTemp()}offTemp(){w.enableDrag(),w.removeEventListener(window,"mousemove",this.mousemove),w.removeEventListener(window,"mouseup",this.mouseup)}mousedown(l){this.down(o.extend({},l,{ctrlKey:!0,preventDefault:()=>l.preventDefault()}),w.mousePos(this.element,l)),w.addEventListener(window,"mousemove",this.mousemove),w.addEventListener(window,"mouseup",this.mouseup)}mousemove(l){this.move(l,w.mousePos(this.element,l))}mouseup(l){this.mouseRotate.mouseupWindow(l),this.mousePitch&&this.mousePitch.mouseupWindow(l),this.offTemp()}touchstart(l){l.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=w.touchPos(this.element,l.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>l.preventDefault()},this._startPos))}touchmove(l){l.targetTouches.length!==1?this.reset():(this._lastPos=w.touchPos(this.element,l.targetTouches)[0],this.move({preventDefault:()=>l.preventDefault()},this._lastPos))}touchend(l){l.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const g=h.locationPoint(x);if(g.x>=0&&g.y>=0&&g.x<=h.width&&g.y<=h.height)break;x.lng>h.center.lng?x.lng-=360:x.lng+=360}return x}const pr={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 Sr(x,l,h){const g=x.classList;for(const b in pr)g.remove(`maplibregl-${h}-anchor-${b}`,`mapboxgl-${h}-anchor-${b}`);g.add(`maplibregl-${h}-anchor-${l}`,`mapboxgl-${h}-anchor-${l}`)}class nu extends o.Evented{constructor(l,h){if(super(),(l instanceof HTMLElement||h)&&(l=o.extend({element:l},h)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=l&&l.anchor||"center",this._color=l&&l.color||"#3FB1CE",this._scale=l&&l.scale||1,this._draggable=l&&l.draggable||!1,this._clickTolerance=l&&l.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=l&&l.rotation||0,this._rotationAlignment=l&&l.rotationAlignment||"auto",this._pitchAlignment=l&&l.pitchAlignment&&l.pitchAlignment!=="auto"?l.pitchAlignment:this._rotationAlignment,l&&l.element)this._element=l.element,this._offset=o.pointGeometry.convert(l&&l.offset||[0,0]);else{this._defaultMarker=!0,this._element=w.create("div"),this._element.setAttribute("aria-label","Map marker");const g=w.createNS("http://www.w3.org/2000/svg","svg"),b=41,P=27;g.setAttributeNS(null,"display","block"),g.setAttributeNS(null,"height",`${b}px`),g.setAttributeNS(null,"width",`${P}px`),g.setAttributeNS(null,"viewBox",`0 0 ${P} ${b}`);const z=w.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"stroke","none"),z.setAttributeNS(null,"stroke-width","1"),z.setAttributeNS(null,"fill","none"),z.setAttributeNS(null,"fill-rule","evenodd");const $=w.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"fill-rule","nonzero");const V=w.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(3.0, 29.0)"),V.setAttributeNS(null,"fill","#000000");const W=[{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 et of W){const Pe=w.createNS("http://www.w3.org/2000/svg","ellipse");Pe.setAttributeNS(null,"opacity","0.04"),Pe.setAttributeNS(null,"cx","10.5"),Pe.setAttributeNS(null,"cy","5.80029008"),Pe.setAttributeNS(null,"rx",et.rx),Pe.setAttributeNS(null,"ry",et.ry),V.appendChild(Pe)}const ee=w.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"fill",this._color);const ie=w.createNS("http://www.w3.org/2000/svg","path");ie.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"),ee.appendChild(ie);const fe=w.createNS("http://www.w3.org/2000/svg","g");fe.setAttributeNS(null,"opacity","0.25"),fe.setAttributeNS(null,"fill","#000000");const Se=w.createNS("http://www.w3.org/2000/svg","path");Se.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"),fe.appendChild(Se);const _e=w.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_e.setAttributeNS(null,"fill","#FFFFFF");const we=w.createNS("http://www.w3.org/2000/svg","g");we.setAttributeNS(null,"transform","translate(8.0, 8.0)");const $e=w.createNS("http://www.w3.org/2000/svg","circle");$e.setAttributeNS(null,"fill","#000000"),$e.setAttributeNS(null,"opacity","0.25"),$e.setAttributeNS(null,"cx","5.5"),$e.setAttributeNS(null,"cy","5.5"),$e.setAttributeNS(null,"r","5.4999962");const Ue=w.createNS("http://www.w3.org/2000/svg","circle");Ue.setAttributeNS(null,"fill","#FFFFFF"),Ue.setAttributeNS(null,"cx","5.5"),Ue.setAttributeNS(null,"cy","5.5"),Ue.setAttributeNS(null,"r","5.4999962"),we.appendChild($e),we.appendChild(Ue),$.appendChild(V),$.appendChild(ee),$.appendChild(fe),$.appendChild(_e),$.appendChild(we),g.appendChild($),g.setAttributeNS(null,"height",b*this._scale+"px"),g.setAttributeNS(null,"width",P*this._scale+"px"),this._element.appendChild(g),this._offset=o.pointGeometry.convert(l&&l.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",g=>{g.preventDefault()}),this._element.addEventListener("mousedown",g=>{g.preventDefault()}),Sr(this._element,this._anchor,"marker"),this._popup=null}addTo(l){return this.remove(),this._map=l,l.getCanvasContainer().appendChild(this._element),l.on("move",this._update),l.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),w.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(l){return this._lngLat=o.LngLat.convert(l),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(l){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),l){if(!("offset"in l.options)){const b=Math.sqrt(Math.pow(13.5,2)/2);l.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[b,-1*(38.1-13.5+b)],"bottom-right":[-b,-1*(38.1-13.5+b)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=l,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(l){const h=l.code,g=l.charCode||l.keyCode;h!=="Space"&&h!=="Enter"&&g!==32&&g!==13||this.togglePopup()}_onMapClick(l){const h=l.originalEvent.target,g=this._element;this._popup&&(h===g||g.contains(h))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const l=this._popup;return l?(l.isOpen()?l.remove():l.addTo(this._map),this):this}_update(l){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=kc(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let h="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?h=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let g="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?g="rotateX(0deg)":this._pitchAlignment==="map"&&(g=`rotateX(${this._map.getPitch()}deg)`),l&&l.type!=="moveend"||(this._pos=this._pos.round()),w.setTransform(this._element,`${pr[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${g} ${h}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const b=this._map.unproject(this._pos),P=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=b.distanceTo(this._lngLat)>20*P?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(l){return this._offset=o.pointGeometry.convert(l),this._update(),this}_onMove(l){if(!this._isDragging){const h=this._clickTolerance||this._map._clickTolerance;this._isDragging=l.point.dist(this._pointerdownPos)>=h}this._isDragging&&(this._pos=l.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 o.Event("dragstart"))),this.fire(new o.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 o.Event("dragend")),this._state="inactive"}_addDragHandler(l){this._element.contains(l.originalEvent.target)&&(l.preventDefault(),this._positionDelta=l.point.sub(this._pos).add(this._offset),this._pointerdownPos=l.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(l){return this._draggable=!!l,this._map&&(l?(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(l){return this._rotation=l||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(l){return this._rotationAlignment=l||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(l){return this._pitchAlignment=l&&l!=="auto"?l:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const sp={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ms,Li=0,Is=!1;const ka={maxWidth:100,unit:"metric"};function Eg(x,l,h){const g=h&&h.maxWidth||100,b=x._container.clientHeight/2,P=x.unproject([0,b]),z=x.unproject([g,b]),$=P.distanceTo(z);if(h&&h.unit==="imperial"){const V=3.2808*$;V>5280?Rs(l,g,V/5280,x._getUIString("ScaleControl.Miles")):Rs(l,g,V,x._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?Rs(l,g,$/1852,x._getUIString("ScaleControl.NauticalMiles")):$>=1e3?Rs(l,g,$/1e3,x._getUIString("ScaleControl.Kilometers")):Rs(l,g,$,x._getUIString("ScaleControl.Meters"))}function Rs(x,l,h,g){const b=function(P){const z=Math.pow(10,`${Math.floor(P)}`.length-1);let $=P/z;return $=$>=10?10:$>=5?5:$>=3?3:$>=2?2:$>=1?1:function(V){const W=Math.pow(10,Math.ceil(-Math.log(V)/Math.LN10));return Math.round(V*W)/W}($),z*$}(h);x.style.width=l*(b/h)+"px",x.innerHTML=`${b} ${g}`}const ti={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ci=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function lp(x){if(x){if(typeof x=="number"){const l=Math.round(Math.sqrt(.5*Math.pow(x,2)));return{center:new o.pointGeometry(0,0),top:new o.pointGeometry(0,x),"top-left":new o.pointGeometry(l,l),"top-right":new o.pointGeometry(-l,l),bottom:new o.pointGeometry(0,-x),"bottom-left":new o.pointGeometry(l,-l),"bottom-right":new o.pointGeometry(-l,-l),left:new o.pointGeometry(x,0),right:new o.pointGeometry(-x,0)}}if(x instanceof o.pointGeometry||Array.isArray(x)){const l=o.pointGeometry.convert(x);return{center:l,top:l,"top-left":l,"top-right":l,bottom:l,"bottom-left":l,"bottom-right":l,left:l,right:l}}return{center:o.pointGeometry.convert(x.center||[0,0]),top:o.pointGeometry.convert(x.top||[0,0]),"top-left":o.pointGeometry.convert(x["top-left"]||[0,0]),"top-right":o.pointGeometry.convert(x["top-right"]||[0,0]),bottom:o.pointGeometry.convert(x.bottom||[0,0]),"bottom-left":o.pointGeometry.convert(x["bottom-left"]||[0,0]),"bottom-right":o.pointGeometry.convert(x["bottom-right"]||[0,0]),left:o.pointGeometry.convert(x.left||[0,0]),right:o.pointGeometry.convert(x.right||[0,0])}}return lp(new o.pointGeometry(0,0))}const ol={supported:f,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends zn{constructor(x){var l;if(o.PerformanceUtils.mark(o.PerformanceMarkers.create),(x=o.extend({},Sg,x)).minZoom!=null&&x.maxZoom!=null&&x.minZoom>x.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(x.minPitch!=null&&x.maxPitch!=null&&x.minPitch>x.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(x.minPitch!=null&&x.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(x.maxPitch!=null&&x.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new gc(x.minZoom,x.maxZoom,x.minPitch,x.maxPitch,x.renderWorldCopies),{bearingSnap:x.bearingSnap}),this._interactive=x.interactive,this._cooperativeGestures=x.cooperativeGestures,this._maxTileCacheSize=x.maxTileCacheSize,this._failIfMajorPerformanceCaveat=x.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=x.preserveDrawingBuffer,this._antialias=x.antialias,this._trackResize=x.trackResize,this._bearingSnap=x.bearingSnap,this._refreshExpiredTiles=x.refreshExpiredTiles,this._fadeDuration=x.fadeDuration,this._crossSourceCollisions=x.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=x.collectResourceTiming,this._renderTaskQueue=new wg,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},Cg,x.locale),this._clickTolerance=x.clickTolerance,this._pixelRatio=(l=x.pixelRatio)!==null&&l!==void 0?l:devicePixelRatio,this._requestManager=new k(x.transformRequest),typeof x.container=="string"){if(this._container=document.getElementById(x.container),!this._container)throw new Error(`Container '${x.container}' not found.`)}else{if(!(x.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=x.container}if(x.maxBounds&&this.setMaxBounds(x.maxBounds),o.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 bg(this,x),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=x.hash&&new cg(typeof x.hash=="string"&&x.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:x.center,zoom:x.zoom,bearing:x.bearing,pitch:x.pitch}),x.bounds&&(this.resize(),this.fitBounds(x.bounds,o.extend({},x.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=x.localIdeographFontFamily,x.style&&this.setStyle(x.style,{localIdeographFontFamily:x.localIdeographFontFamily}),x.attributionControl&&this.addControl(new Ec({customAttribution:x.customAttribution})),x.maplibreLogo&&this.addControl(new jd,x.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update(h.dataType==="style"),this.fire(new o.Event(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new o.Event(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new o.Event("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(x,l){if(l===void 0&&(l=x.getDefaultPosition?x.getDefaultPosition():"top-right"),!x||!x.onAdd)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=x.onAdd(this);this._controls.push(x);const g=this._controlPositions[l];return l.indexOf("bottom")!==-1?g.insertBefore(h,g.firstChild):g.appendChild(h),this}removeControl(x){if(!x||!x.onRemove)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const l=this._controls.indexOf(x);return l>-1&&this._controls.splice(l,1),x.onRemove(this),this}hasControl(x){return this._controls.indexOf(x)>-1}calculateCameraOptionsFromTo(x,l,h,g){return g==null&&this.style.terrain&&(g=this.transform.getElevation(h,this.style.terrain)),super.calculateCameraOptionsFromTo(x,l,h,g)}resize(x){const l=this._containerDimensions(),h=l[0],g=l[1];this._resizeCanvas(h,g,this.getPixelRatio()),this.transform.resize(h,g),this.painter.resize(h,g,this.getPixelRatio());const b=!this._moving;return b&&(this.stop(),this.fire(new o.Event("movestart",x)).fire(new o.Event("move",x))),this.fire(new o.Event("resize",x)),b&&this.fire(new o.Event("moveend",x)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(x){const[l,h]=this._containerDimensions();this._pixelRatio=x,this._resizeCanvas(l,h,x),this.painter.resize(l,h,x)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(x){return this.transform.setMaxBounds(o.LngLatBounds.convert(x)),this._update()}setMinZoom(x){if((x=x==null?-2:x)>=-2&&x<=this.transform.maxZoom)return this.transform.minZoom=x,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=x,this._update(),this.getZoom()>x&&this.setZoom(x),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(x){if((x=x==null?0:x)<0)throw new Error("minPitch must be greater than or equal to 0");if(x>=0&&x<=this.transform.maxPitch)return this.transform.minPitch=x,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(x>=this.transform.minPitch)return this.transform.maxPitch=x,this._update(),this.getPitch()>x&&this.setPitch(x),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(x){return this.transform.renderWorldCopies=x,this._update()}project(x){return this.transform.locationPoint(o.LngLat.convert(x),this.style&&this.style.terrain)}unproject(x){return this.transform.pointLocation(o.pointGeometry.convert(x),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(x,l,h){if(x==="mouseenter"||x==="mouseover"){let g=!1;return{layer:l,listener:h,delegates:{mousemove:P=>{const z=this.getLayer(l)?this.queryRenderedFeatures(P.point,{layers:[l]}):[];z.length?g||(g=!0,h.call(this,new Co(x,this,P.originalEvent,{features:z}))):g=!1},mouseout:()=>{g=!1}}}}if(x==="mouseleave"||x==="mouseout"){let g=!1;return{layer:l,listener:h,delegates:{mousemove:z=>{(this.getLayer(l)?this.queryRenderedFeatures(z.point,{layers:[l]}):[]).length?g=!0:g&&(g=!1,h.call(this,new Co(x,this,z.originalEvent)))},mouseout:z=>{g&&(g=!1,h.call(this,new Co(x,this,z.originalEvent)))}}}}{const g=b=>{const P=this.getLayer(l)?this.queryRenderedFeatures(b.point,{layers:[l]}):[];P.length&&(b.features=P,h.call(this,b),delete b.features)};return{layer:l,listener:h,delegates:{[x]:g}}}}on(x,l,h){if(h===void 0)return super.on(x,l);const g=this._createDelegatedListener(x,l,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[x]=this._delegatedListeners[x]||[],this._delegatedListeners[x].push(g);for(const b in g.delegates)this.on(b,g.delegates[b]);return this}once(x,l,h){if(h===void 0)return super.once(x,l);const g=this._createDelegatedListener(x,l,h);for(const b in g.delegates)this.once(b,g.delegates[b]);return this}off(x,l,h){return h===void 0?super.off(x,l):(this._delegatedListeners&&this._delegatedListeners[x]&&(g=>{const b=this._delegatedListeners[x];for(let P=0;P{g?this.fire(new o.ErrorEvent(g)):b&&this._updateDiff(b,l)})}else typeof x=="object"&&this._updateDiff(x,l)}_updateDiff(x,l){try{this.style.setState(x)&&this._update(!0)}catch(h){o.warnOnce(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(x,l)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.warnOnce("There is no style added to the map.")}addSource(x,l){return this._lazyInitEmptyStyle(),this.style.addSource(x,l),this._update(!0)}isSourceLoaded(x){const l=this.style&&this.style.sourceCaches[x];if(l!==void 0)return l.loaded();this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${x}'`)))}setTerrain(x){return this.style.setTerrain(x),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){const x=this.style&&this.style.sourceCaches;for(const l in x){const h=x[l]._tiles;for(const g in h){const b=h[g];if(b.state!=="loaded"&&b.state!=="errored")return!1}}return!0}addSourceType(x,l,h){return this._lazyInitEmptyStyle(),this.style.addSourceType(x,l,h)}removeSource(x){return this.style.removeSource(x),this._update(!0)}getSource(x){return this.style.getSource(x)}addImage(x,l,{pixelRatio:h=1,sdf:g=!1,stretchX:b,stretchY:P,content:z}={}){if(this._lazyInitEmptyStyle(),l instanceof HTMLImageElement||o.isImageBitmap(l)){const{width:$,height:V,data:W}=o.exported.getImageData(l);this.style.addImage(x,{data:new o.RGBAImage({width:$,height:V},W),pixelRatio:h,stretchX:b,stretchY:P,content:z,sdf:g,version:0})}else{if(l.width===void 0||l.height===void 0)return this.fire(new o.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:$,height:V,data:W}=l,ee=l;this.style.addImage(x,{data:new o.RGBAImage({width:$,height:V},new Uint8Array(W)),pixelRatio:h,stretchX:b,stretchY:P,content:z,sdf:g,version:0,userImage:ee}),ee.onAdd&&ee.onAdd(this,x)}}}updateImage(x,l){const h=this.style.getImage(x);if(!h)return this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const g=l instanceof HTMLImageElement||o.isImageBitmap(l)?o.exported.getImageData(l):l,{width:b,height:P,data:z}=g;if(b===void 0||P===void 0)return this.fire(new o.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(b!==h.data.width||P!==h.data.height)return this.fire(new o.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const $=!(l instanceof HTMLImageElement||o.isImageBitmap(l));h.data.replace(z,$),this.style.updateImage(x,h)}hasImage(x){return x?!!this.style.getImage(x):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(x){this.style.removeImage(x)}loadImage(x,l){o.getImage(this._requestManager.transformRequest(x,o.ResourceType.Image),l)}listImages(){return this.style.listImages()}addLayer(x,l){return this._lazyInitEmptyStyle(),this.style.addLayer(x,l),this._update(!0)}moveLayer(x,l){return this.style.moveLayer(x,l),this._update(!0)}removeLayer(x){return this.style.removeLayer(x),this._update(!0)}getLayer(x){return this.style.getLayer(x)}setLayerZoomRange(x,l,h){return this.style.setLayerZoomRange(x,l,h),this._update(!0)}setFilter(x,l,h={}){return this.style.setFilter(x,l,h),this._update(!0)}getFilter(x){return this.style.getFilter(x)}setPaintProperty(x,l,h,g={}){return this.style.setPaintProperty(x,l,h,g),this._update(!0)}getPaintProperty(x,l){return this.style.getPaintProperty(x,l)}setLayoutProperty(x,l,h,g={}){return this.style.setLayoutProperty(x,l,h,g),this._update(!0)}getLayoutProperty(x,l){return this.style.getLayoutProperty(x,l)}setLight(x,l={}){return this._lazyInitEmptyStyle(),this.style.setLight(x,l),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(x,l){return this.style.setFeatureState(x,l),this._update()}removeFeatureState(x,l){return this.style.removeFeatureState(x,l),this._update()}getFeatureState(x){return this.style.getFeatureState(x)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let x=0,l=0;return this._container&&(x=this._container.clientWidth||400,l=this._container.clientHeight||300),[x,l]}_setupContainer(){const x=this._container;x.classList.add("maplibregl-map","mapboxgl-map");const l=this._canvasContainer=w.create("div","maplibregl-canvas-container mapboxgl-canvas-container",x);this._interactive&&l.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=w.create("canvas","maplibregl-canvas mapboxgl-canvas",l),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 h=this._containerDimensions();this._resizeCanvas(h[0],h[1],this.getPixelRatio());const g=this._controlContainer=w.create("div","maplibregl-control-container mapboxgl-control-container",x),b=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(P=>{b[P]=w.create("div",`maplibregl-ctrl-${P} mapboxgl-ctrl-${P}`,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const x=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=w.create("div","maplibregl-cooperative-gesture-screen",x);let l="Control",h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",l="Meta"),this._cooperativeGesturesScreen.innerHTML=`
${h}
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
`,document.addEventListener("keydown",g=>{g.key===l&&(this._metaPress=!0)}),document.addEventListener("keyup",g=>{g.key===l&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",g=>{this._onCooperativeGesture(g,this._metaPress,1)},!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(x,l,h){this._canvas.width=h*x,this._canvas.height=h*l,this._canvas.style.width=`${x}px`,this._canvas.style.height=`${l}px`}_setupPainter(){const x=o.extend({},f.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),l=this._canvas.getContext("webgl",x)||this._canvas.getContext("experimental-webgl",x);l?(this.painter=new Yh(l,this.transform),o.exported$1.testSupport(l)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(x){x.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:x}))}_contextRestored(x){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:x}))}_onMapScroll(x){if(x.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(x,l,h){return!l&&h<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(x){return this.style?(this._styleDirty=this._styleDirty||x,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(x){return this._update(),this._renderTaskQueue.add(x)}_cancelRenderFrame(x){this._renderTaskQueue.remove(x)}_render(x){let l,h=0;const g=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(l=g.createQueryEXT(),g.beginQueryEXT(g.TIME_ELAPSED_EXT,l),h=o.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(x),this._removed)return;let b=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const z=this.transform.zoom,$=o.exported.now();this.style.zoomHistory.update(z,$);const V=new o.EvaluationParameters(z,{now:$,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),W=V.crossFadingFactor();W===1&&W===this._crossFadingFactor||(b=!0,this._crossFadingFactor=W),this.style.update(V)}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 o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.load),this.fire(new o.Event("load"))),this.style&&(this.style.hasTransitions()||b)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const z=o.exported.now()-h;g.endQueryEXT(g.TIME_ELAPSED_EXT,l),setTimeout(()=>{const $=g.getQueryObjectEXT(l,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(l),this.fire(new o.Event("gpu-timing-frame",{cpuTime:z,gpuTime:$}))},50)}if(this.listens("gpu-timing-layer")){const z=this.painter.collectGpuTimers();setTimeout(()=>{const $=this.painter.queryGpuTimers(z);this.fire(new o.Event("gpu-timing-layer",{layerTimes:$}))},50)}const P=this._sourcesDirty||this._styleDirty||this._placementDirty;return P||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||P||(this._fullyLoaded=!0,o.PerformanceUtils.mark(o.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 l of this._controls)l.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 x=this.painter.context.gl.getExtension("WEBGL_lose_context");x&&x.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),w.remove(this._canvasContainer),w.remove(this._controlContainer),this._cooperativeGestures&&w.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),o.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new o.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=o.exported.frame(x=>{o.PerformanceUtils.frame(x),this._frame=null,this._render(x)}))}_onWindowOnline(){this._update()}_onWindowResize(x){this._trackResize&&this.resize({originalEvent:x})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(x){this._showTileBoundaries!==x&&(this._showTileBoundaries=x,this._update())}get showPadding(){return!!this._showPadding}set showPadding(x){this._showPadding!==x&&(this._showPadding=x,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(x){this._showCollisionBoxes!==x&&(this._showCollisionBoxes=x,x?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(x){this._showOverdrawInspector!==x&&(this._showOverdrawInspector=x,this._update())}get repaint(){return!!this._repaint}set repaint(x){this._repaint!==x&&(this._repaint=x,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(x){this._vertices=x,this._update()}_setCacheLimits(x,l){o.setCacheLimits(x,l)}get version(){return"2.4.0"}},NavigationControl:class{constructor(x){this.options=o.extend({},S_,x),this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",l=>l.preventDefault()),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",l=>this._map.zoomIn({},{originalEvent:l})),w.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",l=>this._map.zoomOut({},{originalEvent:l})),w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",l=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:l}):this._map.resetNorth({},{originalEvent:l})}),this._compassIcon=w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const x=this._map.getZoom(),l=x===this._map.getMaxZoom(),h=x===this._map.getMinZoom();this._zoomInButton.disabled=l,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",l.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const x=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=x}onAdd(x){return this._map=x,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 Ea(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){w.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(x,l){const h=w.create("button",x,this._container);return h.type="button",h.addEventListener("click",l),h}_setButtonTitle(x,l){const h=this._map._getUIString(`NavigationControl.${l}`);x.title=h,x.setAttribute("aria-label",h)}},GeolocateControl:class extends o.Evented{constructor(x){super(),this.options=o.extend({},sp,x),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(x){var l;return this._map=x,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),l=this._setupUI,Ms!==void 0?l(Ms):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(h=>{Ms=h.state!=="denied",l(Ms)}):(Ms=!!window.navigator.geolocation,l(Ms)),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(),w.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Li=0,Is=!1}_isOutOfMapMaxBounds(x){const l=this._map.getMaxBounds(),h=x.coords;return l&&(h.longitudel.getEast()||h.latitudel.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(x){if(this._map){if(this._isOutOfMapMaxBounds(x))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",x)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=x,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(x),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(x),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",x)),this._finish()}}_updateCamera(x){const l=new o.LngLat(x.coords.longitude,x.coords.latitude),h=x.coords.accuracy,g=this._map.getBearing(),b=o.extend({bearing:g},this.options.fitBoundsOptions);this._map.fitBounds(l.toBounds(h),b,{geolocateSource:!0})}_updateMarker(x){if(x){const l=new o.LngLat(x.coords.longitude,x.coords.latitude);this._accuracyCircleMarker.setLngLat(l).addTo(this._map),this._userLocationDotMarker.setLngLat(l).addTo(this._map),this._accuracy=x.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const x=this._map._container.clientHeight/2,l=this._map.unproject([0,x]),h=this._map.unproject([1,x]),g=l.distanceTo(h),b=Math.ceil(2*this._accuracy/g);this._circleElement.style.width=`${b}px`,this._circleElement.style.height=`${b}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(x){if(this._map){if(this.options.trackUserLocation)if(x.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 l=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=l,this._geolocateButton.setAttribute("aria-label",l),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(x.code===3&&Is)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 o.Event("error",x)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(x){if(this._container.addEventListener("contextmenu",l=>l.preventDefault()),this._geolocateButton=w.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",x===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const l=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=l,this._geolocateButton.setAttribute("aria-label",l)}else{const l=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=l,this._geolocateButton.setAttribute("aria-label",l)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=w.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new nu(this._dotElement),this._circleElement=w.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new nu({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",l=>{l.geolocateSource||this._watchState!=="ACTIVE_LOCK"||l.originalEvent&&l.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 o.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return o.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 o.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Li--,Is=!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 o.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 o.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 x;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Li++,Li>1?(x={maximumAge:6e5,timeout:0},Is=!0):(x=this.options.positionOptions,Is=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,x)}}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:Ec,LogoControl:jd,ScaleControl:class{constructor(x){this.options=o.extend({},ka,x),o.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Eg(this._map,this._container,this.options)}onAdd(x){return this._map=x,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",x.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){w.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(x){this.options.unit=x,Eg(this._map,this._container,this.options)}},FullscreenControl:class{constructor(x){this._fullscreen=!1,x&&x.container&&(x.container instanceof HTMLElement?this._container=x.container:o.warnOnce("Full screen control 'container' must be a DOM element.")),o.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(x){return this._map=x,this._container||(this._container=this._map.getContainer()),this._controlContainer=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){w.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 x=this._fullscreenButton=w.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",x).setAttribute("aria-hidden","true"),x.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const x=this._getTitle();this._fullscreenButton.setAttribute("aria-label",x),this._fullscreenButton.title=x}_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(x){this.options=x,o.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(x){return this._map=x,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=w.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),w.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(){w.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 o.Evented{constructor(x){super(),this.options=o.extend(Object.create(ti),x),o.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(x){return this._map&&this.remove(),this._map=x,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 o.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&w.remove(this._content),this._container&&(w.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 o.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(x){return this._lngLat=o.LngLat.convert(x),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(x){return this.setDOMContent(document.createTextNode(x))}setHTML(x){const l=document.createDocumentFragment(),h=document.createElement("body");let g;for(h.innerHTML=x;g=h.firstChild,g;)l.appendChild(g);return this.setDOMContent(l)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(x){return this.options.maxWidth=x,this._update(),this}setDOMContent(x){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=w.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(x),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(x){this._container&&this._container.classList.add(x)}removeClassName(x){this._container&&this._container.classList.remove(x)}setOffset(x){return this.options.offset=x,this._update(),this}toggleClassName(x){if(this._container)return this._container.classList.toggle(x)}_createCloseButton(){this.options.closeButton&&(this._closeButton=w.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(x){this._update(x.point)}_onMouseMove(x){this._update(x.point)}_onDrag(x){this._update(x.point)}_update(x){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=w.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=w.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(P=>this._container.classList.add(P)),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=kc(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!x))return;const l=this._pos=this._trackPointer&&x?x:this._map.project(this._lngLat);let h=this.options.anchor;const g=lp(this.options.offset);if(!h){const P=this._container.offsetWidth,z=this._container.offsetHeight;let $;$=l.y+g.bottom.ythis._map.transform.height-z?["bottom"]:[],l.x

this._map.transform.width-P/2&&$.push("right"),h=$.length===0?"bottom":$.join("-")}const b=l.add(g[h]).round();w.setTransform(this._container,`${pr[h]} translate(${b.x}px,${b.y}px)`),Sr(this._container,h,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const x=this._container.querySelector(ci);x&&x.focus()}_onClose(){this.remove()}},Marker:nu,Style:On,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.pointGeometry,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,AJAXError:o.AJAXError,config:o.config,CanvasSource:Te,GeoJSONSource:de,ImageSource:ye,RasterDEMTileSource:ne,RasterTileSource:Q,VectorTileSource:Z,VideoSource:Re,prewarm:function(){It().acquire(Tt)},clearPrewarmedResources:function(){const x=mt;x&&(x.isPreloaded()&&x.numActive()===1?(x.release(Tt),mt=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 Ye.workerCount},set workerCount(x){Ye.workerCount=x},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(x){o.config.MAX_PARALLEL_IMAGE_REQUESTS=x},clearStorage(x){o.clearTileCache(x)},workerUrl:"",addProtocol(x,l){o.config.REGISTERED_PROTOCOLS[x]=l},removeProtocol(x){delete o.config.REGISTERED_PROTOCOLS[x]}};return jo.extend(ol,{isSafari:o.isSafari,getPerformanceMetrics:o.PerformanceUtils.getPerformanceMetrics}),ol});var u=i;return u})})(dL);const sme=dL.exports,lme="modulepreload",ume=function(e){return"/"+e},PM={},cme=function(t,r,n){if(!r||r.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=ume(a),a in PM)return;PM[a]=!0;const u=a.endsWith(".css"),o=u?'[rel="stylesheet"]':"";if(!!n)for(let v=i.length-1;v>=0;v--){const y=i[v];if(y.href===a&&(!u||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":lme,u||(p.as="script",p.crossOrigin=""),p.href=a,document.head.appendChild(p),u)return new Promise((v,y)=>{p.addEventListener("load",v),p.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())},hE=C.exports.createContext(null),dme=e=>{const[t,r]=C.exports.useState({}),n=C.exports.useCallback((a,u="default")=>{r(o=>{if(u==="current")throw new Error("'current' cannot be used as map id");if(o[u])throw new Error(`Multiple maps with the same id: ${u}`);return{...o,[u]:a}})},[]),i=C.exports.useCallback((a="default")=>{r(u=>{if(u[a]){const o={...u};return delete o[a],o}return u})},[]);return S(hE.Provider,{value:{maps:t,onMapMount:n,onMapUnmount:i},children:e.children})};function pE(){var e;const t=(e=C.exports.useContext(hE))===null||e===void 0?void 0:e.maps,r=C.exports.useContext(_d);return C.exports.useMemo(()=>({...t,current:r==null?void 0:r.map}),[t,r])}function fme(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function MM(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function IM(e,t){const r=t.viewState||t;let n=!1;if("longitude"in r&&"latitude"in r){const i=e.center;e.center=new i.constructor(r.longitude,r.latitude),n=n||i!==e.center}if("zoom"in r){const i=e.zoom;e.zoom=r.zoom,n=n||i!==e.zoom}if("bearing"in r){const i=e.bearing;e.bearing=r.bearing,n=n||i!==e.bearing}if("pitch"in r){const i=e.pitch;e.pitch=r.pitch,n=n||i!==e.pitch}return r.padding&&!e.isPaddingEqual(r.padding)&&(n=!0,e.padding=r.padding),n}const hme=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function RM(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const n of e.layers)t[n.id]=n;const r=e.layers.map(n=>{const i=t[n.ref];let a=null;if("interactive"in n&&(a={...n},delete a.interactive),i){a=a||{...n},delete a.ref;for(const u of hme)u in i&&(a[u]=i[u])}return a||n});return{...e,layers:r}}function pme(e,t){const r=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,a=Array.isArray(t)?t[1]:t?t.y:0;return r===i&&n===a}function $a(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 r=0;r{const a=this.props[AM[i.type]];a&&a(i)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const a=this.props[OM[i.type]];if(a){if(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"){const u=this._hoveredFeatures||this._map.queryRenderedFeatures(i.point,{layers:this.props.interactiveLayerIds});i.features=u}a(i),delete i.features}},this._onCameraEvent=i=>{if(!this._internalUpdate){const a=this.props[F2[i.type]];a&&a(i)}i.type in this._deferredEvents&&(this._deferredEvents[i.type]=!1)},this._MapClass=t,this.props=r,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const r=this.props;this.props=t;const n=this._updateSettings(t,r);n&&this._createShadowTransform(this._map);const i=this._updateSize(t),a=this._updateViewState(t,!0);this._updateStyle(t,r),this._updateStyleComponents(t,r),this._updateHandlers(t,r),(n||i||a&&!this._map.isMoving())&&this.redraw()}static reuse(t,r){const n=Jf.savedMaps.pop();if(!n)return null;const i=n.map,a=i.getContainer();for(r.className=a.className;a.childNodes.length>0;)r.appendChild(a.childNodes[0]);i._container=r,n.setProps({...t,styleDiffing:!1}),i.resize();const{initialViewState:u}=t;return u&&(u.bounds?i.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):n._updateViewState(u,!1)),i.isStyleLoaded()?i.fire("load"):i.once("styledata",()=>i.fire("load")),n}_initialize(t){const{props:r}=this,n={...r,...r.initialViewState,accessToken:r.mapboxAccessToken||gme()||null,container:t,style:RM(r.mapStyle)},i=n.initialViewState||n.viewState||n;if(Object.assign(n,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),r.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,r.gl)}const a=new this._MapClass(n);i.padding&&a.setPadding(i.padding),r.cursor&&(a.getCanvas().style.cursor=r.cursor),this._createShadowTransform(a);const u=a._render;a._render=p=>{this._inRender=!0,u.call(a,p),this._inRender=!1};const o=a._renderTaskQueue.run;a._renderTaskQueue.run=p=>{o.call(a._renderTaskQueue,p),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const f=a.fire;a.fire=this._fireEvent.bind(this,f),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>this._updateStyleComponents(this.props,{})),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in OM)a.on(p,this._onPointerEvent);for(const p in F2)a.on(p,this._onCameraEvent);for(const p in AM)a.on(p,this._onEvent);this._map=a}recycle(){const r=this.map.getContainer().querySelector("[mapboxgl-children]");r==null||r.remove(),Jf.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 r=fme(t.transform);t.painter.transform=r,this._renderTransform=r}_updateSize(t){const{viewState:r}=t;if(r){const n=this._map;if(r.width!==n.transform.width||r.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,r){if(this._internalUpdate)return!1;const n=this._map,i=this._renderTransform,{zoom:a,pitch:u,bearing:o}=i,f=n.isMoving();f&&(i.cameraElevationReference="sea");const p=IM(i,{...MM(n.transform),...t});if(f&&(i.cameraElevationReference="ground"),p&&r){const v=this._deferredEvents;v.move=!0,v.zoom||(v.zoom=a!==i.zoom),v.rotate||(v.rotate=o!==i.bearing),v.pitch||(v.pitch=u!==i.pitch)}return f||IM(n.transform,t),p}_updateSettings(t,r){const n=this._map;let i=!1;for(const a of mme)a in t&&!$a(t[a],r[a])&&(i=!0,n[`set${a[0].toUpperCase()}${a.slice(1)}`](t[a]));return i}_updateStyle(t,r){if(t.cursor!==r.cursor&&(this._map.getCanvas().style.cursor=t.cursor),t.mapStyle!==r.mapStyle){const n={diff:t.styleDiffing};return"localIdeographFontFamily"in t&&(n.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(RM(t.mapStyle),n),!0}return!1}_updateStyleComponents(t,r){const n=this._map;let i=!1;return n.style.loaded()&&("light"in t&&!$a(t.light,r.light)&&(i=!0,n.setLight(t.light)),"fog"in t&&!$a(t.fog,r.fog)&&(i=!0,n.setFog(t.fog)),"terrain"in t&&!$a(t.terrain,r.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(i=!0,n.setTerrain(t.terrain))),i}_updateHandlers(t,r){const n=this._map;let i=!1;for(const a of vme){const u=t[a];$a(u,r[a])||(i=!0,u?n[a].enable(u):n[a].disable())}return i}_updateHover(t){var r;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const a=t.type,u=((r=this._hoveredFeatures)===null||r===void 0?void 0:r.length)>0;let o;if(a==="mousemove")try{o=this._map.queryRenderedFeatures(t.point,{layers:n.interactiveLayerIds})}catch{o=[]}else o=[];const f=o.length>0;!f&&u&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=o,f&&!u&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=a}else this._hoveredFeatures=null}_fireEvent(t,r,n){const i=this._map,a=i.transform,u=typeof r=="string"?r:r.type;return u==="move"&&this._updateViewState(this.props,!1),u in F2&&(typeof r=="object"&&(r.viewState=MM(a)),this._map.isMoving())?(i.transform=this._renderTransform,t.call(i,r,n),i.transform=a,i):(t.call(i,r,n),i)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const r=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=r}}}Jf.savedMaps=[];function gme(){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 yme=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function xme(e,t){if(!e)return null;const r=e.map,n={getMap:()=>r,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,a)=>{const u=r.transform;r.transform=e.transform;const o=r.queryTerrainElevation(i,a);return r.transform=u,o}};for(const i of _me(r))!(i in n)&&!yme.includes(i)&&(n[i]=r[i].bind(r));return n}function _me(e){const t=new Set;let r=e;for(;r;){for(const n of Object.getOwnPropertyNames(r))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);r=Object.getPrototypeOf(r)}return Array.from(t)}const bme=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect,wme=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Cme(e,t){for(const r of wme)r in t&&(e[r]=t[r]);t.RTLTextPlugin&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(t.RTLTextPlugin,r=>{r&&console.error(r)},!1)}const _d=C.exports.createContext(null),Sme={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"},mE=C.exports.forwardRef((e,t)=>{const r=C.exports.useContext(hE),[n,i]=C.exports.useState(null),a=C.exports.useRef(),{current:u}=C.exports.useRef({mapLib:null,map:null});C.exports.useEffect(()=>{const f=e.mapLib;let p=!0,v;return Promise.resolve(f||cme(()=>import("./index.764e1a39.js").then(y=>y.i),[])).then(y=>{if(!!p){if(y.Map||(y=y.default),!y||!y.Map)throw new Error("Invalid mapLib");if(y.supported(e))Cme(y,e),e.reuseMaps&&(v=Jf.reuse(e,a.current)),v||(v=new Jf(y.Map,e,a.current)),u.map=xme(v,y),u.mapLib=y,i(v),r==null||r.onMapMount(u.map,e.id);else throw new Error("Map is not supported by this browser")}}).catch(y=>{e.onError({type:"error",target:null,originalEvent:null,error:y})}),()=>{p=!1,v&&(r==null||r.onMapUnmount(e.id),e.reuseMaps?v.recycle():v.destroy())}},[]),bme(()=>{n&&n.setProps(e)}),C.exports.useImperativeHandle(t,()=>u.map,[n]);const o=C.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]);return S("div",{id:e.id,ref:a,style:o,children:n&&S(_d.Provider,{value:u,children:S("div",{"mapboxgl-children":"",children:e.children})})})});mE.displayName="Map";mE.defaultProps=Sme;const Eme=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function bd(e,t){if(!e||!t)return;const r=e.style;for(const n in t){const i=t[n];Number.isFinite(i)&&!Eme.test(n)?r[n]=`${i}px`:r[n]=i}}const kme={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function hL(e){const{map:t,mapLib:r}=C.exports.useContext(_d),n=C.exports.useRef({props:e});n.current.props=e;const i=C.exports.useMemo(()=>{let a=!1;C.exports.Children.forEach(e.children,f=>{f&&(a=!0)});const u={...e,element:a?document.createElement("div"):null},o=new r.Marker(u).setLngLat([e.longitude,e.latitude]);return o.getElement().addEventListener("click",f=>{var p,v;(v=(p=n.current.props).onClick)===null||v===void 0||v.call(p,{type:"click",target:o,originalEvent:f})}),o.on("dragstart",f=>{var p,v;const y=f;y.lngLat=i.getLngLat(),(v=(p=n.current.props).onDragStart)===null||v===void 0||v.call(p,y)}),o.on("drag",f=>{var p,v;const y=f;y.lngLat=i.getLngLat(),(v=(p=n.current.props).onDrag)===null||v===void 0||v.call(p,y)}),o.on("dragend",f=>{var p,v;const y=f;y.lngLat=i.getLngLat(),(v=(p=n.current.props).onDragEnd)===null||v===void 0||v.call(p,y)}),o},[]);return C.exports.useEffect(()=>(i.addTo(t.getMap()),()=>{i.remove()}),[]),C.exports.useEffect(()=>{bd(i.getElement(),e.style)},[e.style]),(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!pme(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),Yu.exports.createPortal(e.children,i.getElement())}hL.defaultProps=kme;C.exports.memo(hL);function NM(e){return new Set(e?e.trim().split(/\s+/):[])}function Tme(e){const{map:t,mapLib:r}=C.exports.useContext(_d),n=C.exports.useMemo(()=>document.createElement("div"),[]),i=C.exports.useRef({props:e});i.current.props=e;const a=C.exports.useMemo(()=>{const u={...e},o=new r.Popup(u).setLngLat([e.longitude,e.latitude]);return o.once("open",f=>{var p,v;(v=(p=i.current.props).onOpen)===null||v===void 0||v.call(p,f)}),o},[]);if(C.exports.useEffect(()=>{const u=o=>{var f,p;(p=(f=i.current.props).onClose)===null||p===void 0||p.call(f,o)};return a.on("close",u),a.setDOMContent(n).addTo(t.getMap()),()=>{a.off("close",u),a.isOpen()&&a.remove()}},[]),C.exports.useEffect(()=>{bd(a.getElement(),e.style)},[e.style]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!$a(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const u=NM(a.options.className),o=NM(e.className);for(const f of u)o.has(f)||a.removeClassName(f);for(const f of o)u.has(f)||a.addClassName(f);a.options.className=e.className}return Yu.exports.createPortal(e.children,n)}const Pme=C.exports.memo(Tme);function Fv(e,t,r,n){const i=C.exports.useContext(_d),a=C.exports.useMemo(()=>e(i),[]);return C.exports.useEffect(()=>{const u=n||r||t,o=typeof t=="function"&&typeof r=="function"?t:null,f=typeof r=="function"?r:typeof t=="function"?t:null,{map:p}=i;return p.hasControl(a)||(p.addControl(a,u==null?void 0:u.position),o&&o(i)),()=>{f&&f(i),p.hasControl(a)&&p.removeControl(a)}},[]),a}function Mme(e){const t=Fv(({mapLib:r})=>new r.AttributionControl(e),{position:e.position});return C.exports.useEffect(()=>{bd(t._container,e.style)},[e.style]),null}C.exports.memo(Mme);function Ime(e){const t=Fv(({mapLib:r})=>new r.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return C.exports.useEffect(()=>{bd(t._controlContainer,e.style)},[e.style]),null}C.exports.memo(Ime);const pL=C.exports.forwardRef((e,t)=>{const r=C.exports.useRef({props:e}),n=Fv(({mapLib:i})=>{const a=new i.GeolocateControl(e),u=a._setupUI;return a._setupUI=o=>{a._container.hasChildNodes()||u(o)},a.on("geolocate",o=>{var f,p;(p=(f=r.current.props).onGeolocate)===null||p===void 0||p.call(f,o)}),a.on("error",o=>{var f,p;(p=(f=r.current.props).onError)===null||p===void 0||p.call(f,o)}),a.on("outofmaxbounds",o=>{var f,p;(p=(f=r.current.props).onOutOfMaxBounds)===null||p===void 0||p.call(f,o)}),a.on("trackuserlocationstart",o=>{var f,p;(p=(f=r.current.props).onTrackUserLocationStart)===null||p===void 0||p.call(f,o)}),a.on("trackuserlocationend",o=>{var f,p;(p=(f=r.current.props).onTrackUserLocationEnd)===null||p===void 0||p.call(f,o)}),a},{position:e.position});return r.current.props=e,C.exports.useImperativeHandle(t,()=>({trigger:()=>n.trigger()}),[]),C.exports.useEffect(()=>{bd(n._container,e.style)},[e.style]),null});pL.displayName="GeolocateControl";C.exports.memo(pL);function Rme(e){const t=Fv(({mapLib:r})=>new r.NavigationControl(e),{position:e.position});return C.exports.useEffect(()=>{bd(t._container,e.style)},[e.style]),null}C.exports.memo(Rme);const Ome={unit:"metric",maxWidth:100};function mL(e){const t=Fv(({mapLib:r})=>new r.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)),C.exports.useEffect(()=>{bd(t._container,e.style)},[e.style]),null}mL.defaultProps=Ome;C.exports.memo(mL);function S1(e,t){if(!e)throw new Error(t)}let Ame=0;function Nme(e,t,r){if(e.style&&e.style._loaded){const n={...r};return delete n.id,delete n.children,e.addSource(t,n),e.getSource(t)}return null}function zme(e,t,r){S1(t.id===r.id,"source id changed"),S1(t.type===r.type,"source type changed");let n="",i=0;for(const u in t)u!=="children"&&u!=="id"&&!$a(r[u],t[u])&&(n=u,i++);if(!i)return;const a=t.type;if(a==="geojson")e.setData(t.data);else if(a==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((a==="canvas"||a==="video")&&i===1&&n==="coordinates")e.setCoordinates(t.coordinates);else if(a==="vector"&&"setUrl"in e)switch(n){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles);break}else console.warn(`Unable to update prop: ${n}`)}function Tf(e){const t=C.exports.useContext(_d).map.getMap(),r=C.exports.useRef(e),[,n]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-source-${Ame++}`,[]);C.exports.useEffect(()=>{if(t){const u=()=>setTimeout(()=>n(o=>o+1),0);return t.on("styledata",u),u(),()=>{var o;if(t.off("styledata",u),t.style&&t.style._loaded&&t.getSource(i)){const f=(o=t.getStyle())===null||o===void 0?void 0:o.layers;if(f)for(const p of f)p.source===i&&t.removeLayer(p.id);t.removeSource(i)}}}},[t]);let a=t&&t.style&&t.getSource(i);return a?zme(a,e,r.current):a=Nme(t,i,e),r.current=e,a&&C.exports.Children.map(e.children,u=>u&&C.exports.cloneElement(u,{source:i}))||null}function Dme(e,t,r,n){if(S1(r.id===n.id,"layer id changed"),S1(r.type===n.type,"layer type changed"),r.type==="custom"||n.type==="custom")return;const{layout:i={},paint:a={},filter:u,minzoom:o,maxzoom:f,beforeId:p}=r;if(p!==n.beforeId&&e.moveLayer(t,p),i!==n.layout){const v=n.layout||{};for(const y in i)$a(i[y],v[y])||e.setLayoutProperty(t,y,i[y]);for(const y in v)i.hasOwnProperty(y)||e.setLayoutProperty(t,y,void 0)}if(a!==n.paint){const v=n.paint||{};for(const y in a)$a(a[y],v[y])||e.setPaintProperty(t,y,a[y]);for(const y in v)a.hasOwnProperty(y)||e.setPaintProperty(t,y,void 0)}$a(u,n.filter)||e.setFilter(t,u),(o!==n.minzoom||f!==n.maxzoom)&&e.setLayerZoomRange(t,o,f)}function Lme(e,t,r){if(e.style&&e.style._loaded&&(!("source"in r)||e.getSource(r.source))){const n={...r,id:t};delete n.beforeId,e.addLayer(n,r.beforeId)}}let Fme=0;function Ha(e){const t=C.exports.useContext(_d).map.getMap(),r=C.exports.useRef(e),[,n]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-layer-${Fme++}`,[]);if(C.exports.useEffect(()=>{if(t){const u=()=>n(o=>o+1);return t.on("styledata",u),u(),()=>{t.off("styledata",u),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{Dme(t,i,e,r.current)}catch(u){console.warn(u)}else Lme(t,i,e);return r.current=e,null}const $me=e=>({updateCounter:-1,toggleUpdateCounter:()=>{e(t=>{t.updateCounter=t.updateCounter===-1?1:-1})}}),vL=nc(ic($me)),vE=({onSuccess:e})=>{const{toggleUpdateCounter:t}=vL();return fpe({mutationFn:r=>_a.put(`/api/placement_points/update_status?${r.toString()}`),onSuccess:()=>{t(),e()}})};function Bme(){for(var e=0,t,r,n="";ee&&(t=0,n=r,r=new Map)}return{get:function(u){var o=r.get(u);if(o!==void 0)return o;if((o=n.get(u))!==void 0)return i(u,o),o},set:function(u,o){r.has(u)?r.set(u,o):i(u,o)}}}var xL="!";function qme(e){var t=e.separator||":";return function(n){for(var i=0,a=[],u=0,o=0;oS("div",{className:dd("mb-1",t),children:S(fve,{type:"secondary",className:dd("uppercase text-xs",r),children:e})}),hve=()=>{const{filters:e}=Ui(),{prediction:t,categories:r,region:n}=e,{selection:i}=Qs(),a=Dv(),[u,o]=C.exports.useState(!1),[f,p]=C.exports.useState(!1),{mutate:v}=vE({onSuccess:()=>{a.invalidateQueries(["table",1,e]),o(!1),p(!0)}});return Xe(Ar,{children:[S(yS,{trigger:"click",open:u,onOpenChange:o,content:Xe("div",{className:"p-2",children:[S($l,{text:"\u0423\u0432\u0435\u0440\u0435\u043D\u044B, \u0447\u0442\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u0432\u0437\u044F\u0442\u044C \u043E\u0442\u043E\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438 \u0432 \u0440\u0430\u0431\u043E\u0442\u0443?"}),Xe("div",{className:"flex items-center justify-center gap-x-4",children:[S(Rn,{onClick:()=>o(!1),children:"\u041E\u0442\u043C\u0435\u043D\u0430"}),S(Rn,{type:"primary",onClick:()=>{const w=new URLSearchParams({status:un.approve,"prediction_current[]":t,"categories[]":r,"included[]":[...i.included],"excluded[]":[...i.excluded]});n&&(n.type==="ao"&&w.append("ao[]",n.id),n.type==="rayon"&&w.append("rayon[]",n.id)),v(w)},children:"\u0414\u0430"})]})]}),children:Xe(Rn,{type:"primary",block:!0,className:"mt-2",children:[S("span",{className:"mr-1",children:"\u0412\u0437\u044F\u0442\u044C \u0432 \u0440\u0430\u0431\u043E\u0442\u0443"}),S(hD,{})]})}),S(Wte,{title:" ",centered:!0,open:f,footer:[S(Rn,{type:"primary",onClick:()=>p(!1),children:"\u0425\u043E\u0440\u043E\u0448\u043E"},"ok-button")],children:S(px,{message:"\u0423\u0441\u043F\u0435\u0448\u043D\u043E",description:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435. \u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043D\u0430 \u043D\u0438\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E \u0432\u0442\u043E\u0440\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435",type:"success",showIcon:!0})})]})};function pve(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function mve(e,t,r){r===void 0&&(r={});for(var n=0,i=e;nr[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]e?e.reduce((t,r)=>(t[r.id]=r,t[r.id].type="ao",r.rayons&&r.rayons.forEach(n=>{t[n.id]=n,t[n.id].type="rayon"}),t),{}):{},gve=({disabled:e})=>{const{map:t}=pE(),{filters:{region:r},setRegion:n}=Ui(),[i,a]=C.exports.useState([]),u=C.exports.useMemo(()=>vve(i),[i]),[o,f]=C.exports.useState(!1);C.exports.useEffect(()=>{(async()=>{f(!0);try{const w=await _a.get("/api/ao_rayons");a(w.data)}catch(w){console.error(w)}finally{f(!1)}})()},[]);const p=y=>{if(!y)return;const w=u[y],k=Th.exports(w.polygon),T=mve(k.coordinates[0]),R=SC(T);n({id:y,geometry:T,type:w.type}),t.fitBounds([[R[0],R[1]],[R[2],R[3]]],{padding:20})},v=()=>n(null);return Xe("div",{children:[S($l,{text:"\u0410\u041E / \u0440\u0430\u0439\u043E\u043D"}),S(eD,{showSearch:!0,style:{width:"100%"},value:r==null?void 0:r.id,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:p,loading:o,treeNodeFilterProp:"title",onClear:v,notFoundContent:S($s,{image:$s.PRESENTED_IMAGE_SIMPLE,description:"\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"}),disabled:e,children:i==null?void 0:i.map(y=>{var w;return S(BM,{value:y.id,title:y.name,children:(w=y.rayons)==null?void 0:w.map(k=>S(BM,{value:k.id,title:k.name},k.id))},y.id)})})]})},yve=Object.entries(rL).map(([e,t])=>({value:t,label:t})),xve=({disabled:e})=>{const{filters:t,setCategories:r}=Ui();return Xe("div",{children:[S($l,{text:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438"}),S(Dl,{mode:"tags",style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439",onChange:r,options:yve,allowClear:!0,value:t.categories,disabled:e})]})},wl=({value:e})=>S("span",{className:"text-grey text-xs",children:e}),VM=(e,t)=>{if(Array.isArray(t)){const[r,n]=t;return{...e,[r]:S(wl,{value:r}),[n]:S(wl,{value:n})}}else return{...e,[t]:S(wl,{value:t})}},Gx=({title:e,value:t,onChange:r,onAfterChange:n,min:i=0,max:a=100,range:u=!1,step:o=1,disabled:f=!1,onMouseEnter:p,onMouseLeave:v,showZeroMark:y=!1})=>{const w={[i]:S(wl,{value:i}),[a]:S(wl,{value:a})},[k,T]=C.exports.useState(t),[R,A]=C.exports.useState(VM(w,t));C.exports.useEffect(()=>{T(t),A(VM(w,t))},[t]);const I=L=>{if(Array.isArray(L)){const[B,j]=L;A({...w,[B]:S(wl,{value:B}),[j]:S(wl,{value:j})})}else A({...w,[L]:S(wl,{value:L})});n==null||n(L)},O=L=>{T(L),r==null||r(L)},N=y?{...R,0:S(wl,{value:0})}:R;return Xe("div",{onMouseEnter:p,onMouseLeave:v,children:[S($l,{text:e}),S(Mre,{range:u,value:k,marks:N,onChange:O,onAfterChange:I,min:i,max:a,step:o,disabled:f})]})},_ve=({disabled:e,fullRange:t})=>{const{filters:{prediction:r},setPrediction:n}=Ui(),i=a=>n(a);return C.exports.useEffect(()=>{if(!t)return;const a=t.prediction_current[0],u=t.prediction_current[1];r[0]===Fl.prediction[0]&&r[1]===Fl.prediction[1]&&n([a,u])},[t]),S(Gx,{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:r,onAfterChange:i,min:t==null?void 0:t.prediction_current[0],max:t==null?void 0:t.prediction_current[1],range:!0,disabled:e})},bve=e=>({mode:$n.INITIAL,setMode:t=>{e(r=>{r.mode=t})}}),oc=nc(ic(bve)),wve=({fullRange:e})=>{const{filters:{deltaTraffic:t},setDeltaTraffic:r}=Ui(),n=i=>r(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.delta_current[0],a=e.delta_current[1];t[0]===Fl.deltaTraffic[0]&&t[1]===Fl.deltaTraffic[1]&&r([i,a])},[e,t]),S(Gx,{title:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0444\u0430\u043A\u0442\u0430 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C, %",value:t,onAfterChange:n,min:e==null?void 0:e.delta_current[0],max:e==null?void 0:e.delta_current[1],range:!0,showZeroMark:!0})},Cve=({fullRange:e})=>{const{filters:{factTraffic:t},setFactTraffic:r}=Ui(),n=i=>r(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.fact[0],a=e.fact[1];t[0]===Fl.factTraffic[0]&&t[1]===Fl.factTraffic[1]&&r([i,a])},[e,t]),S(Gx,{title:"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:t,onAfterChange:n,min:e==null?void 0:e.fact[0],max:e==null?void 0:e.fact[1],range:!0})},Sve=({fullRange:e})=>{const{filters:{age:t},setAge:r}=Ui(),n=i=>r(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.age_day[0],a=e.age_day[1];t[0]===Fl.age[0]&&t[1]===Fl.age[1]&&r([i,a])},[e,t]),S(Gx,{title:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430, \u0434\u043D\u0435\u0439",value:t,onAfterChange:n,min:e==null?void 0:e.age_day[0],max:e==null?void 0:e.age_day[1],range:!0})},Eve=({disabled:e})=>{const[t,r]=C.exports.useState(!1),{mode:n}=oc();C.exports.useEffect(()=>{const o=setTimeout(()=>r(!1),1500);return()=>clearTimeout(o)},[t]);const{data:i}=Xa(["max-min"],async()=>{const{data:o}=await _a.get("/api/placement_points/filters/");return o});return S(yo,{title:ppe,placement:"right",open:e&&t,onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},children:Xe("div",{className:"space-y-5",children:[S(gve,{disabled:e}),n===$n.INITIAL&&Xe(Ar,{children:[S(xve,{disabled:e}),S(_ve,{disabled:e,fullRange:i})]}),n===$n.WORKING&&Xe("div",{className:"space-y-12",children:[S(wve,{fullRange:i}),S(Cve,{fullRange:i}),S(Sve,{fullRange:i})]})]})})},kve=()=>{const{data:e,isInitialLoading:t}=qpe(),{data:r,isInitialLoading:n}=Gpe(),i=t||n,{selection:{excluded:a}}=Qs();return Xe("div",{className:"flex items-center justify-between",children:[S("span",{children:"\u041E\u0442\u043E\u0431\u0440\u0430\u043D\u043E \u043B\u043E\u043A\u0430\u0446\u0438\u0439"}),i?S(LS,{}):S("span",{children:`${r-a.size} / ${e}`})]})},Tve={[Tr.initial]:!0,[Tr.approve]:!1,[Tr.working]:!1,[Tr.filteredWorking]:!1,[Tr.cancelled]:!1,[Tr.pvz]:!0,[Tr.other]:!0},Pve=[Tr.pvz,Tr.other],Mve=e=>({isVisible:Tve,toggleVisibility:t=>e(r=>{r.isVisible[t]=!r.isVisible[t]}),setLayersVisibility:t=>e(r=>{t.forEach(i=>{r.isVisible[i]=!0}),Object.keys(r.isVisible).filter(i=>!t.includes(i)&&!Pve.includes(i)).forEach(i=>{r.isVisible[i]=!1})})}),Js=nc(ic(Mve)),Ive=C.exports.forwardRef(({isCollapsed:e},t)=>{const r=Wpe(),{mode:n}=oc(),{reset:i}=Qs(),{isVisible:a,toggleVisibility:u}=Js();return S("div",{className:dd("h-screen p-3 overflow-y-auto shrink-0 border-solid border-border border-0 border-r-[1px] flex flex-col transition-all pt-20",e?"basis-0 px-0 -translate-x-[320px]":"basis-[320px]"),ref:t,children:Xe("div",{className:"space-y-5 flex flex-col justify-between flex-1",children:[Xe("div",{children:[S(Eve,{disabled:r}),n===$n.APPROVE_WORKING&&Xe("div",{className:"mt-4",children:[S($l,{text:"\u0421\u0442\u0430\u0442\u0443\u0441\u044B"}),Xe("div",{className:"flex flex-col space-y-2",children:[S(ed,{onChange:()=>u(Tr.approve),checked:a[Tr.approve],children:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430"}),S(ed,{className:"!ml-0",onChange:()=>u(Tr.working),checked:a[Tr.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"}),S(ed,{className:"!ml-0",onChange:()=>u(Tr.cancelled),checked:a[Tr.cancelled],children:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D"})]})]}),n===$n.INITIAL&&r?S(Rn,{block:!0,className:"mt-2",onClick:i,children:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435"}):null]}),S("div",{children:n===$n.INITIAL&&Xe(Ar,{children:[S(kve,{}),S(hve,{})]})})]})})}),Rve=5,Ove=3,EL="#001cd2",EC="#CC2222",kL="#ff7d00",kC="#006e01",Ave="#b4b4b4",TL="#da11b2",PL="#26a2a2",jM={type:"circle",paint:{"circle-stroke-width":.4,"circle-stroke-color":"#fff","circle-opacity":.8}},Cd=(e=EL,t=Rve)=>({...jM,paint:{...jM.paint,"circle-color":e,"circle-radius":t}}),Kp=Cd(),Nve=Cd(Ave,Ove),zve=Cd(kL),ML=Cd(kC),Dve=Cd(EC),Lve=Cd(TL),Fve=Cd(PL),IL="#676767",UM={id:"ao",type:"line",source:"ao","source-layer":"public.service_ao",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":IL,"line-width":1.5,"line-opacity":.8}},KM={id:"rayon",type:"line",source:"rayon","source-layer":"public.service_rayon",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":IL,"line-width":.5,"line-opacity":.8}},HM={id:"selected-region",type:"line",source:"selected-region",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#CC2222","line-width":4}},$ve={ao:"okrug_id",rayon:"rayon_id"},$v=()=>{const{filters:{region:e}}=Ui();return C.exports.useMemo(()=>e?["==",["get",$ve[e.type]],e.id]:null,[e])},WM=["==",["get","status"],un.initial],Bve=()=>{const{filters:e}=Ui(),{prediction:t,categories:r,region:n}=e,{selection:i}=Qs(),a=[...i.included],u=[...i.excluded],o=$v(),f=["in",["get","id"],["literal",a]],p=["in",["get","id"],["literal",u]],v=[[">=",["get","prediction_current"],t[0]],["<=",["get","prediction_current"],t[1]]],y=r.length>0?["in",["get","category"],["literal",r]]:!0,w=["all",WM,["!",p],["any",n?["all",...v,y,o]:["all",...v,y],f]],k=["all",WM,["!",f],["any",["!",n?["all",...v,y,o]:["all",...v,y]],p]];return{match:w,unmatch:k}},Vve=()=>{const{isVisible:e}=Js(),{match:t,unmatch:r}=Bve();return Xe(Ar,{children:[S(Ha,{...Kp,id:Tr["initial-unmatch"],source:"points","source-layer":"public.service_placementpoint",layout:{...Kp.layout,visibility:e[Tr.initial]?"visible":"none"},filter:r,paint:Nve.paint}),S(Ha,{...Kp,id:Tr["initial-match"],source:"points","source-layer":"public.service_placementpoint",layout:{...Kp.layout,visibility:e[Tr.initial]?"visible":"none"},filter:t,paint:Kp.paint})]})},qM=["==",["get","status"],un.approve],jve=()=>{const{isVisible:e}=Js(),t=$v(),r=t?["all",qM,t]:qM;return S(Ar,{children:S(Ha,{...zve,id:Tr.approve,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[Tr.approve]?"visible":"none"},filter:r})})},GM=["==",["get","status"],un.working],Uve=()=>{const{isVisible:e}=Js(),t=$v(),r=t?["all",GM,t]:["all",GM];return S(Ar,{children:S(Ha,{...ML,id:Tr.working,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[Tr.working]?"visible":"none"},filter:r})})},ZM=["==",["get","status"],un.working],Kve=()=>{const{isVisible:e}=Js(),t=$v(),{filters:{deltaTraffic:r,factTraffic:n,age:i}}=Ui(),a=[[">=",["get","delta_current"],r[0]],["<=",["get","delta_current"],r[1]]],u=[[">=",["get","fact"],n[0]],["<=",["get","fact"],n[1]]],o=[[">=",["get","age_day"],i[0]],["<=",["get","age_day"],i[1]]],f=t?["all",ZM,...a,...u,...o,t]:["all",ZM,...a,...u,...o];return S(Ar,{children:S(Ha,{...ML,id:Tr.filteredWorking,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[Tr.filteredWorking]?"visible":"none"},filter:f})})},XM=["==",["get","status"],un.cancelled],Hve=()=>{const{isVisible:e}=Js(),t=$v(),r=t?["all",XM,t]:XM;return S(Ar,{children:S(Ha,{...Dve,id:Tr.cancelled,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[Tr.cancelled]?"visible":"none"},filter:r})})},Wve=()=>{const{updateCounter:e}=vL();return S(Ar,{children:Xe(Tf,{id:"points",type:"vector",tiles:[`${bm}/martin/public.service_placementpoint/{z}/{x}/{y}.pbf`],children:[S(Vve,{}),S(jve,{}),S(Uve,{}),S(Kve,{}),S(Hve,{})]},`points-${e}`)})},qve=()=>{const{isVisible:e}=Js();return S(Ar,{children:S(Ha,{...Lve,id:Tr.pvz,source:"rivals","source-layer":"public.service_rivals",layout:{visibility:e[Tr.pvz]?"visible":"none"}})})},Gve=()=>{const{isVisible:e}=Js();return S(Ar,{children:S(Ha,{...Fve,id:Tr.other,source:"rivals","source-layer":"public.service_rivals",layout:{visibility:e[Tr.other]?"visible":"none"}})})},Zve=()=>{const{filters:{prediction:e,region:t}}=Ui();return Xe(Ar,{children:[S(Tf,{id:"ao",type:"vector",tiles:[`${bm}/martin/public.service_ao/{z}/{x}/{y}.pbf`],children:S(Ha,{...UM,layout:{...UM.layout}})}),S(Tf,{id:"rayon",type:"vector",tiles:[`${bm}/martin/public.service_rayon/{z}/{x}/{y}.pbf`],children:S(Ha,{...KM,layout:{...KM.layout}})}),t&&t.geometry&&S(Tf,{id:"selected-region",type:"geojson",data:t.geometry,children:S(Ha,{...HM,layout:{...HM.layout,visibility:t?"visible":"none"}})}),S(Wve,{prediction:e}),Xe(Tf,{id:"rivals",type:"vector",tiles:[`${bm}/martin/public.service_rivals/{z}/{x}/{y}.pbf`],children:[S(qve,{}),S(Gve,{})]})]})},Xve=({lat:e,lng:t,onClose:r,children:n})=>S(Pme,{longitude:t,latitude:e,onClose:r,closeOnClick:!1,style:{minWidth:"300px"},children:n}),Yve=e=>({clickedPointConfig:null,setClickedPointConfig:(t,r=!0)=>{e(n=>{if(t===null)return n.clickedPointConfig=null,n;n.clickedPointConfig={id:t,shouldSelect:r}})}}),ac=nc(ic(Yve)),Qve=[{name:"Id",field:"id"},{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"rayon_id"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"okrug_id"},{name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",field:"name"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category"},{name:"\u0421\u0442\u0430\u0442\u0443\u0441",field:"status",render:e=>Xc[e]},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"}],Jve=[{name:"Id",field:"id"},{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"rayon_id"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"okrug_id"},{name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",field:"name"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category"},{name:"\u0421\u0442\u0430\u0442\u0443\u0441",field:"status",render:e=>Xc[e]},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"},{name:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440",field:"flat_cnt"},{name:"\u0413\u043E\u0434 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438",field:"year_bld"},{name:"\u041A\u043E\u043B-\u0432\u043E \u044D\u0442\u0430\u0436\u0435\u0439",field:"levels"},{name:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D",field:"mat_nes"}],ege=[{name:"\u0424\u0430\u043A\u0442",field:"fact"},{name:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C",field:"delta_current"},{name:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C",field:"age_day"}],ev=({feature:e,dynamicStatus:t})=>{const r=e.properties.category===rL.residential,n=e.properties.status===un.working,i=r?Jve:Qve,a=n?[...i,...ege]:i;return S("div",{children:a.map(({field:u,name:o,render:f})=>{const p=t&&u==="status"?t:e.properties[u],v=f?f(p):p;return Xe(v9,{className:dd("p-1"),children:[S(c1,{className:"font-semibold",span:12,children:o}),S(c1,{span:12,children:v})]},u)})})},tge=({feature:e})=>{const{include:t,selection:r,exclude:n}=Qs(),{setClickedPointConfig:i}=ac(),a=e.layer.id===Tr["initial-match"],u=e.properties.id;C.exports.useEffect(()=>i(u,a),[e]);const o=(a||r.included.has(u))&&!r.excluded.has(u);return Xe(Ar,{children:[S(ev,{feature:e}),S(Rn,{type:"primary",className:"mt-2 mx-auto",block:!0,onClick:()=>{o?n(u):t(u)},children:o?"\u0418\u0441\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u0437 \u0432\u044B\u0431\u043E\u0440\u043A\u0438":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0432\u044B\u0431\u043E\u0440\u043A\u0443"})]})},rge=[{label:Xc[un.initial],value:un.initial},{label:Xc[un.approve],value:un.approve},{label:Xc[un.working],value:un.working},{label:Xc[un.cancelled],value:un.cancelled}],RL=({value:e,onChange:t,disabled:r})=>S(Dl,{style:{width:250},value:e,onChange:a=>{t(a)},options:rge,disabled:r,placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441",onClick:a=>a.stopPropagation()}),nge=({feature:e})=>{const t=e.properties.id,{setClickedPointConfig:r}=ac(),[n,i]=C.exports.useState(e.properties.status);C.exports.useEffect(()=>r(t,!1),[e]);const a=Dv(),{mutate:u}=vE({onSuccess:()=>{a.invalidateQueries(["approve-working-points"])}});return Xe(Ar,{children:[S(ev,{feature:e,dynamicStatus:n}),S("div",{className:"flex justify-center mt-4",children:Xe("div",{className:"flex flex-col items-center",children:[S($l,{text:"\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"}),S(RL,{value:n,onChange:f=>{i(f);const p=new URLSearchParams({status:f,"location_ids[]":[t]});u(p)}})]})})]})},ige=({feature:e})=>{const t=e.properties.id,{setClickedPointConfig:r}=ac();return C.exports.useEffect(()=>r(t,!1),[e]),S(ev,{feature:e})},YM=({feature:e})=>{const{mode:t}=oc(),r=e.layer.id===Tr.pvz||e.layer.id===Tr.other,n=e.layer.id===Tr["initial-match"]||e.layer.id===Tr["initial-unmatch"];return r?S(ev,{feature:e}):t===$n.APPROVE_WORKING?S(nge,{feature:e}):t===$n.WORKING?S(ige,{feature:e}):t===$n.INITIAL&&n?S(tge,{feature:e}):S(ev,{feature:e})},oge=({features:e,onSelect:t})=>S("div",{className:"space-y-2 p-1",children:e.map(r=>Xe(Rn,{type:r.layer.id===Tr["initial-match"]?"primary":"",className:"flex items-center gap-x-1",block:!0,onClick:()=>t(r),children:[S("span",{children:r.properties.id}),S("span",{children:r.properties.category})]},r.properties.id))}),age=({features:e,lat:t,lng:r,onClose:n})=>{const[i,a]=C.exports.useState(null);return S(Xve,{lat:t,lng:r,onClose:n,children:(()=>e.length===1?S(YM,{feature:e[0]}):i?S(YM,{feature:i}):S(oge,{features:e,onSelect:a}))()})},sge="https://api.mapbox.com/styles/v1/ghermant/cla2nwk5f00el14nxvtjlsi6z/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiZ2hlcm1hbnQiLCJhIjoiY2xhMm5zZ3ZrMDF4MDN2bzc5Yjd0ZjZ1dCJ9.fqnvrEqKKBoguR7R6DR7Yw",lge=()=>S(Tf,{type:"raster",id:"basemap",tiles:[sge],tileSize:256,children:S(Ha,{type:"raster",source:"basemap",id:"basemap-layer",paint:{}})});function uge(){const e=async()=>{await _a.post("accounts/logout/"),fE(!1)},{data:t}=Xa(["profile"],async()=>{const{data:r}=await _a.get("/accounts/profile");return r});return S("div",{className:"absolute top-[20px] right-[20px]",children:S(yS,{content:Xe(Ar,{children:[S($l,{text:t==null?void 0:t.email,classNameText:"lowercase"}),Xe(Rn,{type:"primary",block:!0,onClick:e,children:[S("span",{className:"mr-1",children:"\u0412\u044B\u0439\u0442\u0438"}),S(hD,{})]})]}),trigger:"click",placement:"bottomRight",children:S(yo,{title:"\u0412\u044B\u0439\u0442\u0438",placement:"left",children:S(Rn,{icon:S(mfe,{}),type:"primary",size:"large"})})})})}var cge="Expected a function",QM=0/0,dge="[object Symbol]",fge=/^\s+|\s+$/g,hge=/^[-+]0x[0-9a-f]+$/i,pge=/^0b[01]+$/i,mge=/^0o[0-7]+$/i,vge=parseInt,gge=typeof Cl=="object"&&Cl&&Cl.Object===Object&&Cl,yge=typeof self=="object"&&self&&self.Object===Object&&self,xge=gge||yge||Function("return this")(),_ge=Object.prototype,bge=_ge.toString,wge=Math.max,Cge=Math.min,B2=function(){return xge.Date.now()};function Sge(e,t,r){var n,i,a,u,o,f,p=0,v=!1,y=!1,w=!0;if(typeof e!="function")throw new TypeError(cge);t=JM(t)||0,TC(r)&&(v=!!r.leading,y="maxWait"in r,a=y?wge(JM(r.maxWait)||0,t):a,w="trailing"in r?!!r.trailing:w);function k(j){var G=n,H=i;return n=i=void 0,p=j,u=e.apply(H,G),u}function T(j){return p=j,o=setTimeout(I,t),v?k(j):u}function R(j){var G=j-f,H=j-p,te=t-G;return y?Cge(te,a-H):te}function A(j){var G=j-f,H=j-p;return f===void 0||G>=t||G<0||y&&H>=a}function I(){var j=B2();if(A(j))return O(j);o=setTimeout(I,R(j))}function O(j){return o=void 0,w&&n?k(j):(n=i=void 0,u)}function N(){o!==void 0&&clearTimeout(o),p=0,n=f=i=o=void 0}function L(){return o===void 0?u:O(B2())}function B(){var j=B2(),G=A(j);if(n=arguments,i=this,f=j,G){if(o===void 0)return T(f);if(y)return o=setTimeout(I,t),k(f)}return o===void 0&&(o=setTimeout(I,t)),u}return B.cancel=N,B.flush=L,B}function TC(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ege(e){return!!e&&typeof e=="object"}function kge(e){return typeof e=="symbol"||Ege(e)&&bge.call(e)==dge}function JM(e){if(typeof e=="number")return e;if(kge(e))return QM;if(TC(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=TC(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(fge,"");var r=pge.test(e);return r||mge.test(e)?vge(e.slice(2),r?2:8):hge.test(e)?QM:+e}var Tge=Sge;const Pge=e=>({popup:null,setPopup:t=>{e(r=>{if(!t)return r.popup=null,r;r.popup=t})}}),OL=nc(ic(Pge)),pu=({color:e,name:t})=>Xe("div",{className:"flex gap-2 items-center",children:[S("span",{className:"rounded-xl w-3 h-3 inline-block",style:{backgroundColor:e}}),S("span",{children:t})]});function Mge(){const{mode:e}=oc();return Xe("div",{className:"absolute bottom-[20px] left-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3 space-y-3",children:[e!==$n.WORKING&&Xe("div",{children:[S($l,{text:"\u0421\u0442\u0430\u0442\u0443\u0441 \u043B\u043E\u043A\u0430\u0446\u0438\u0438",className:"text-center"}),Xe("div",{className:"space-y-1",children:[e===$n.INITIAL&&Xe(Ar,{children:[S(pu,{name:"\u041A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E",color:EL}),S(pu,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",color:kC}),S(pu,{name:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D",color:EC})]}),e===$n.APPROVE_WORKING&&Xe(Ar,{children:[S(pu,{name:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",color:kL}),S(pu,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",color:kC}),S(pu,{name:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D",color:EC})]})]})]}),Xe("div",{children:[S($l,{text:"\u041F\u0440\u043E\u0447\u0435\u0435",className:"text-center"}),Xe("div",{className:"space-y-1",children:[S(pu,{name:"\u041F\u0412\u0417",color:TL}),S(pu,{name:"\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B \u043F\u0440\u043E\u0447\u0438\u0445 \u0441\u0435\u0442\u0435\u0439",color:PL})]})]})]})}let eI=e=>typeof e=="object"&&e!=null&&e.nodeType===1,tI=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",V2=(e,t)=>{if(e.clientHeight{let i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!i&&(i.clientHeightat||a>e&&u=t&&o>=r?a-e-n:u>t&&or?u-t+i:0,Ige=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},rI=(e,t)=>{var r,n,i,a;if(typeof document>"u")return[];let{scrollMode:u,block:o,inline:f,boundary:p,skipOverflowHiddenElements:v}=t,y=typeof p=="function"?p:J=>J!==p;if(!eI(e))throw new TypeError("Invalid target");let w=document.scrollingElement||document.documentElement,k=[],T=e;for(;eI(T)&&y(T);){if(T=Ige(T),T===w){k.push(T);break}T!=null&&T===document.body&&V2(T)&&!V2(document.documentElement)||T!=null&&V2(T,v)&&k.push(T)}let R=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,A=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:I,scrollY:O}=window,{height:N,width:L,top:B,right:j,bottom:G,left:H}=e.getBoundingClientRect(),te=o==="start"||o==="nearest"?B:o==="end"?G:B+N/2,Y=f==="center"?H+L/2:f==="end"?j:H,le=[];for(let J=0;J=0&&H>=0&&G<=A&&j<=R&&B>=ne&&G<=oe&&H>=ye&&j<=de)return le;let Re=getComputedStyle(Z),Te=parseInt(Re.borderLeftWidth,10),ke=parseInt(Re.borderTopWidth,10),ze=parseInt(Re.borderRightWidth,10),Ie=parseInt(Re.borderBottomWidth,10),Ne=0,De=0,Ve="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-Te-ze:0,Ge="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-ke-Ie:0,je="offsetWidth"in Z?Z.offsetWidth===0?0:ge/Z.offsetWidth:0,ct="offsetHeight"in Z?Z.offsetHeight===0?0:Q/Z.offsetHeight:0;if(w===Z)Ne=o==="start"?te:o==="end"?te-A:o==="nearest"?Ly(O,O+A,A,ke,Ie,O+te,O+te+N,N):te-A/2,De=f==="start"?Y:f==="center"?Y-R/2:f==="end"?Y-R:Ly(I,I+R,R,Te,ze,I+Y,I+Y+L,L),Ne=Math.max(0,Ne+O),De=Math.max(0,De+I);else{Ne=o==="start"?te-ne-ke:o==="end"?te-oe+Ie+Ge:o==="nearest"?Ly(ne,oe,Q,ke,Ie+Ge,te,te+N,N):te-(ne+Q/2)+Ge/2,De=f==="start"?Y-ye-Te:f==="center"?Y-(ye+ge/2)+Ve/2:f==="end"?Y-de+ze+Ve:Ly(ye,de,ge,Te,ze+Ve,Y,Y+L,L);let{scrollLeft:pt,scrollTop:Tt}=Z;Ne=Math.max(0,Math.min(Tt+Ne/ct,Z.scrollHeight-Q/ct+Ge)),De=Math.max(0,Math.min(pt+De/je,Z.scrollWidth-ge/je+Ve)),te+=Tt-Ne,Y+=pt-De}le.push({el:Z,top:Ne,left:De})}return le},Rge=e=>typeof e=="object"&&typeof e.behavior=="function",Oge=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Age(e,t){if(!e.isConnected||!e.ownerDocument.documentElement.contains(e))return;if(Rge(t))return t.behavior(rI(e,t));let r=typeof t=="boolean"||t==null?void 0:t.behavior;for(let{el:n,top:i,left:a}of rI(e,Oge(t)))n.scroll({top:i,left:a,behavior:r})}function Nge(e,t){const r=window.document.createElement("a");r.href=window.URL.createObjectURL(new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}const yE=e=>{Nge("postamates.xlsx",e)},zge=({provider:e})=>{const[t,r]=C.exports.useState(!1);return e(t,()=>r(!1)),S(yo,{title:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",children:S(Rn,{onClick:i=>{i.stopPropagation(),r(!0)},loading:t,disabled:t,children:S(ife,{})})})},Dge={isOpened:!1,fullScreen:!1},Lge=e=>({tableState:Dge,toggleOpened:t=>{e(r=>{r.tableState.isOpened=t[0]==="opened"})},toggleFullScreen:()=>{e(t=>{t.tableState.fullScreen=!t.tableState.fullScreen})},openTable:()=>{e(t=>{t.tableState.isOpened=!0})}}),xE=nc(ic(Lge)),Fge=()=>{const{tableState:{fullScreen:e},toggleFullScreen:t}=xE(),[r,n]=C.exports.useState(!1);return C.exports.useEffect(()=>{const o=setTimeout(()=>n(!1),1500);return()=>clearTimeout(o)},[r]),S(yo,{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:r,children:S(Rn,{onClick:o=>{o.stopPropagation(),t()},onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},children:e?S(sfe,{}):S(cfe,{})})})},Zx=({leftColumn:e,rightColumn:t,exportProvider:r,classes:n})=>Xe("div",{className:"flex items-center w-full justify-between",children:[Xe("div",{className:n==null?void 0:n.leftColumn,children:[S("span",{className:"py-[5px]",children:"\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432"}),e]}),Xe("div",{className:n==null?void 0:n.rightColumn,children:[t,Xe("div",{className:"flex items-center gap-x-1",children:[r&&S(zge,{provider:r}),S(Fge,{})]})]})]}),_E=tn.memo(({rowSelection:e,data:t,pageSize:r,isClickedPointLoading:n,page:i,onPageChange:a,columns:u,header:o,fullWidth:f,loading:p})=>{const{clickedPointConfig:v}=ac(),{map:y}=pE(),{tableState:w,toggleOpened:k}=xE(),T={y:w.fullScreen?"calc(100vh - 136px)":"200px",x:"max-content"};return C.exports.useEffect(()=>{if(v===null||n)return;const R=document.querySelector(".scroll-row");R&&Age(R,{behavior:"smooth"})},[v,t]),S(SP,{bordered:!1,onChange:k,activeKey:w.isOpened?"opened":null,children:S(SP.Panel,{header:o||S(Zx,{}),collapsible:w.fullScreen?"disabled":void 0,children:S(Ace,{size:"small",locale:{emptyText:S($s,{description:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"})},pagination:{pageSize:r,current:i,onChange:a,total:t==null?void 0:t.count,showSizeChanger:!1,position:"bottomCenter"},dataSource:t==null?void 0:t.results,columns:u,rowKey:"id",scroll:T,sticky:!0,onRow:R=>({onClick:()=>{const A=Th.exports(R.geometry);y.flyTo({center:[A.coordinates[0],A.coordinates[1]],zoom:13,essential:!0})}}),rowSelection:e,rowClassName:R=>dd("cursor-pointer",R.id===(v==null?void 0:v.id)&&"scroll-row"),"data-fullwidth":f,loading:p})},"opened")})}),Xx=30,$ge=(e,t)=>{const{clickedPointConfig:r}=ac(),{data:n,isInitialLoading:i,isFetching:a}=Xa(["clicked-point",r==null?void 0:r.id],async()=>{const u=new URLSearchParams({"location_ids[]":[r.id]}),{data:o}=await _a.get(`/api/placement_points?${u.toString()}`);return o},{enabled:e,onSuccess:t});return{data:n,isLoading:i||a}},bE=(e,t)=>{const[r,n]=C.exports.useState(),[i,a]=C.exports.useState(!1),{data:u,isLoading:o}=$ge(i,()=>a(!1)),{clickedPointConfig:f}=ac();return C.exports.useEffect(()=>{!e||n(e)},[e]),C.exports.useEffect(()=>{!e||f===null||e.results.find(v=>v.id===f.id)||a(!0)},[e,f]),C.exports.useEffect(()=>{!u||(t(p=>p+1),n(p=>{if(p)return{...p,count:p.count+1,results:[u.results[0],...p.results]}}))},[u]),C.exports.useEffect(()=>{f===null&&(t(Xx),n(e))},[f,e]),{data:r,isClickedPointLoading:o}},Bge=(e,t)=>{const[r,n]=C.exports.useState(Xx),{filters:i}=Ui(),{prediction:a,categories:u,region:o}=i,{selection:{included:f}}=Qs(),p=[...f],{data:v,isInitialLoading:y}=Xa(["table",e,i,p],async()=>{const T=new URLSearchParams({page:e,page_size:r,"prediction_current[]":a,"status[]":[un.initial],"categories[]":u,"included[]":p});return await Lv(T,o)},{keepPreviousData:!0,onError:T=>{T.response.data.detail==="\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430"&&t()}}),{data:w,isClickedPointLoading:k}=bE(v,n);return{data:w,pageSize:r,isClickedPointLoading:k,isDataLoading:y}},AL=[{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"rayon",key:"rayon",width:"120px",ellipsis:!0},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"okrug",key:"okrug",width:"120px",ellipsis:!0},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0},{title:"\u0421\u0442\u0430\u0442\u0443\u0441",dataIndex:"status",key:"status",width:"120px",ellipsis:!0,render:(e,t)=>Xc[t.status]},{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",dataIndex:"prediction_current",key:"prediction_current",width:"120px",ellipsis:!0}],Vge=(e,t)=>{const{filters:r}=Ui(),{prediction:n,status:i,categories:a,region:u}=r,{selection:o}=Qs();return Xa(["export-initial",r,o],async()=>{const f=new URLSearchParams({"prediction_current[]":n,"status[]":i,"categories[]":a,"included[]":[...o.included],"excluded[]":[...o.excluded]});return await dE(f,u)},{enabled:e,onSuccess:yE,onSettled:t})},jge=({fullWidth:e})=>{const{selection:t,include:r,exclude:n}=Qs(),{clickedPointConfig:i}=ac(),[a,u]=C.exports.useState(1),{data:o,pageSize:f,isClickedPointLoading:p,isDataLoading:v}=Bge(a,()=>u(1)),w={selectedRowKeys:C.exports.useCallback(()=>{var O;const T=(O=o==null?void 0:o.results.map(N=>N.id))!=null?O:[],R=o==null?void 0:o.results.find(N=>N.id===(i==null?void 0:i.id)),A=N=>t.excluded.has(N),I=N=>N===(R==null?void 0:R.id)&&(i==null?void 0:i.shouldSelect)===!1;return[...T.filter(N=>!A(N)&&!I(N)),...t.included]},[o,i,t])(),onSelect:(T,R)=>{const{id:A}=T;R?r(A):n(A)},hideSelectAll:!0},k=C.exports.useCallback(T=>u(T),[]);return S(_E,{rowSelection:w,data:o,onPageChange:k,page:a,pageSize:f,isClickedPointLoading:p,columns:AL,fullWidth:e,header:S(Zx,{exportProvider:Vge}),loading:v})},Uge=(e,t)=>{const{filters:{region:r}}=Ui();return Xa(["export-approve-working",r],async()=>{const n=new URLSearchParams({"status[]":[un.approve,un.working]});return await dE(n,r)},{enabled:e,onSuccess:yE,onSettled:t})},Kge=({selectedIds:e,selectedStatus:t})=>{const r=Dv(),{setPopup:n}=OL(),{mutate:i}=vE({onSuccess:()=>{r.invalidateQueries(["approve-working-points"]),n(null)}});return S(Rn,{type:"primary",onClick:u=>{u.stopPropagation();const o=new URLSearchParams({status:t,"location_ids[]":e});i(o)},children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"})},Hge=({selectedIds:e,onClearSelected:t})=>{const[r,n]=C.exports.useState(un.initial),i=a=>{a.stopPropagation(),t()};return S(Zx,{leftColumn:e.length>0&&Xe(Ar,{children:[S(RL,{value:r,onChange:n}),S(Kge,{selectedIds:e,selectedStatus:r})]}),rightColumn:e.length>0&&S(Rn,{onClick:i,children:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435"}),classes:{leftColumn:"flex items-center gap-x-4",rightColumn:"flex item-center gap-x-4"},exportProvider:Uge})},Wge=({fullWidth:e})=>{const[t,r]=C.exports.useState(Xx),[n,i]=C.exports.useState(1),[a,u]=C.exports.useState([]),{filters:{region:o}}=Ui(),f=()=>u([]),{data:p,isInitialLoading:v}=Xa(["approve-working-points",n,o],async()=>{const R=new URLSearchParams({page:n,page_size:t,"status[]":[un.approve,un.working,un.cancelled]});return await Lv(R,o)},{keepPreviousData:!0}),{data:y,isClickedPointLoading:w}=bE(p,r),k=C.exports.useCallback(R=>i(R),[]);return S(_E,{header:S(Hge,{selectedIds:a,onClearSelected:f}),rowSelection:{selectedRowKeys:a,onChange:R=>u(R),hideSelectAll:!0},data:y,onPageChange:k,page:n,pageSize:t,isClickedPointLoading:w,columns:AL,fullWidth:e,loading:v})},qge=(e,t)=>{const{filters:{region:r,deltaTraffic:n,factTraffic:i,age:a}}=Ui();return Xa(["export-working",r,n,i,a],async()=>{const u=new URLSearchParams({"status[]":[un.working],"delta_current[]":n,"fact[]":i,"age_day[]":a});return await dE(u,r)},{enabled:e,onSuccess:yE,onSettled:t})},Gge=[{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"rayon",key:"rayon",width:"120px",ellipsis:!0},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"okrug",key:"okrug",width:"120px",ellipsis:!0},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0},{title:"\u0424\u0430\u043A\u0442",dataIndex:"fact",key:"fact",width:"120px",ellipsis:!0},{title:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C",dataIndex:"delta_current",key:"delta_current",width:"120px",ellipsis:!0},{title:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C",dataIndex:"age_day",key:"age_day",width:"120px",ellipsis:!0}],Zge=({fullWidth:e})=>{const[t,r]=C.exports.useState(Xx),[n,i]=C.exports.useState(1),{filters:{region:a,deltaTraffic:u,factTraffic:o,age:f}}=Ui(),{data:p,isInitialLoading:v}=Xa(["working-points",n,a,u,o,f],async()=>{const T=new URLSearchParams({page:n,page_size:t,"status[]":[un.working],"delta_current[]":u,"fact[]":o,"age_day[]":f});return await Lv(T,a)},{keepPreviousData:!0}),{data:y,isClickedPointLoading:w}=bE(p,r),k=C.exports.useCallback(T=>i(T),[]);return S(_E,{data:y,onPageChange:k,page:n,pageSize:t,isClickedPointLoading:w,columns:Gge,fullWidth:e,header:S(Zx,{exportProvider:qge}),loading:v})},Xge=({fullWidth:e})=>{const{mode:t}=oc();return t===$n.APPROVE_WORKING?S(Wge,{fullWidth:e}):t===$n.WORKING?S(Zge,{fullWidth:e}):S(jge,{fullWidth:e})},Yge=({width:e=24,height:t=24})=>Xe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:t,children:[S("polygon",{points:"23.7,4.1 23.7,6.1 0.1,6.2 0.1,4.1 "}),Xe("g",{children:[S("circle",{cx:"6.3",cy:"5.2",r:"3.1"}),S("circle",{fill:"#fff",cx:"6.3",cy:"5.2",r:"1.4"})]}),S("polygon",{points:"23.6,11.1 23.7,13.1 0,13.1 0,11 "}),Xe("g",{children:[S("circle",{cx:"18.6",cy:"12.1",r:"3.1"}),S("circle",{fill:"#fff",cx:"18.6",cy:"12.1",r:"1.4"})]}),S("polygon",{points:"23.8,18.2 23.9,20.1 0.2,20.2 0.2,18.2 "}),Xe("g",{children:[S("circle",{cx:"10.2",cy:"19.1",r:"3.1"}),S("circle",{fill:"#fff",cx:"10.2",cy:"19.1",r:"1.4"})]})]}),Qge=({toggleCollapse:e})=>S(Rn,{icon:S(Yge,{width:16,height:16}),onClick:e,className:"border-l-0 rounded-bl-none rounded-tl-none absolute top-[100px] flex items-center justify-center"});var NL={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},nI=tn.createContext&&tn.createContext(NL),Vu=globalThis&&globalThis.__assign||function(){return Vu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{const{toggleVisibility:e,isVisible:t}=Js(),{mode:r}=oc();return Xe("div",{className:"space-y-1 flex flex-col",children:[r===$n.INITIAL&&Xe(Ar,{children:[S(Sf,{className:"!ml-0",onChange:()=>e(Tr.working),checked:t[Tr.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"}),S(Sf,{className:"!ml-0",onChange:()=>e(Tr.cancelled),checked:t[Tr.cancelled],children:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438"})]}),S(Sf,{className:"!ml-0",onChange:()=>e(Tr.pvz),checked:t[Tr.pvz],children:"\u041F\u0412\u0417"}),S(Sf,{className:"!ml-0",onChange:()=>e(Tr.other),checked:t[Tr.other],children:"\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B \u043F\u0440\u043E\u0447\u0438\u0445 \u0441\u0435\u0442\u0435\u0439"})]})},iye=()=>S(yS,{content:S(nye,{}),trigger:"click",placement:"leftBottom",children:S(yo,{title:"\u0421\u043B\u043E\u0438",children:S(Rn,{className:"absolute bottom-[20px] right-[20px] flex items-center justify-center p-3",children:S(rye,{className:"w-4 h-4"})})})}),oye=({width:e=40,height:t=40})=>S("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:Xe("g",{children:[S("polygon",{style:{fill:"#3B555E"},points:"19.6,24 21.4,24 22.5,23.9 23,23.8 23.5,23.4 23.8,22.9 24,22.3 24,20.4 24,1.9 23.9,1.4 23.6,0.8 23.3,0.4 22.9,0.1 22.3,0 14.2,0 8.9,0 11.2,4.6 19.5,4.5 19.6,4.5 "}),S("polygon",{style:{fill:"#E63941"},points:"13.6,6.4 17.7,6.4 16.2,9.4 14.1,14.2 12.3,18.4 11.7,18.4 9.8,14.5 6.8,8.8 4.5,4.5 4.7,23.9 1.7,24 1,23.8 0.5,23.2 0.2,22.7 0,22.1 0,1.8 0.1,1.3 0.4,0.8 0.8,0.4 1.1,0.2 1.4,0.1 2,0.1 7,0.1 11.9,10.6 "})]})});function aye(e,t){const[r,n]=C.exports.useState(e);return C.exports.useEffect(()=>{const i=setTimeout(()=>n(e),t||500);return()=>{clearTimeout(i)}},[e,t]),r}const sye=()=>{const{map:e}=pE(),[t,r]=C.exports.useState(""),n=aye(t),{data:i}=Xa(["address",n],async()=>(await _a.get(`/api/placement_points/search_address?page_size=100&address=${n}`)).data),a=C.exports.useMemo(()=>i?i.results.map(f=>({label:f.address,value:`${f.address}$${f.id}`,item:f})):[],[i]);return S("div",{children:S(pX,{options:a,style:{width:300},value:t,onChange:f=>{r(f&&f.split("$")[0])},onSelect:(f,p)=>{const v=Th.exports(p.item.geometry);e.flyTo({center:[v.coordinates[0],v.coordinates[1]],zoom:15,speed:5})},allowClear:!0,onClear:()=>r(""),children:S(Iu,{prefix:S(xfe,{}),placeholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438",className:"text-ellipsis"})})})},lye=({width:e=24,height:t=24})=>Xe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:[S("polygon",{className:"ai-st0",points:"11.4,3.1 11.4,4.6 11.4,17.8 11.1,18.6 10.9,19.2 10.4,19.8 9.9,20.1 9.2,20.3 8.6,20.3 8.2,20.3 7.6,20.3 7,19.8 6.6,19.3 6.2,18.7 5.4,18.7 4.9,18.4 4.4,18 4.1,17.6 3.9,17.1 3.9,16 3.4,15.4 3,14.9 2,13.4 1.8,12.6 1.4,11.8 1.4,9.9 1.4,9 1.9,8.3 2.5,7.7 3,7.3 2.9,6.5 2.8,5.7 3,5.1 3.4,4.7 4.1,4.3 5,4.1 5.6,4 5.6,3.3 5.8,2.7 6.4,1.9 7,1.3 7.6,1.1 8.4,0.9 8.9,0.9 9.4,1.1 10.1,1.5 10.8,2.1 "}),S("polyline",{className:"ai-st0",points:"17.4,3 16.1,4.7 11.5,4.6 "}),S("polyline",{className:"ai-st0",points:"11.2,8.7 16,8.6 19.8,12.3 "}),S("line",{className:"ai-st0",x1:"11.2",y1:"12.2",x2:"13.4",y2:"12.2"}),S("polyline",{className:"ai-st0",points:"11.4,16.6 14.8,16.6 16.4,18.2 "}),Xe("g",{children:[S("circle",{className:"ai-st1",cx:"18.1",cy:"2",r:"1.9"}),S("circle",{className:"ai-st2",cx:"18.1",cy:"1.9",r:"1.1"})]}),Xe("g",{children:[S("circle",{className:"ai-st1",cx:"18.5",cy:"6.5",r:"1.9"}),S("circle",{className:"ai-st2",cx:"18.5",cy:"6.4",r:"1.1"})]}),Xe("g",{children:[S("circle",{className:"ai-st1",cx:"20.8",cy:"13.3",r:"1.9"}),S("circle",{className:"ai-st2",cx:"20.9",cy:"13.3",r:"1.1"})]}),Xe("g",{children:[S("circle",{className:"ai-st1",cx:"15",cy:"12.2",r:"1.9"}),S("circle",{className:"ai-st2",cx:"15",cy:"12.1",r:"1.1"})]}),Xe("g",{children:[S("circle",{className:"ai-st1",cx:"17.4",cy:"19.2",r:"1.9"}),S("circle",{className:"ai-st2",cx:"17.4",cy:"19.2",r:"1.1"})]}),Xe("g",{children:[S("circle",{className:"ai-st1",cx:"13",cy:"22",r:"1.9"}),S("circle",{className:"ai-st2",cx:"13.1",cy:"22",r:"1.1"})]}),S("polyline",{className:"ai-st0",points:"5.9,8.1 4.5,9.5 4.4,11.2 4.8,12.4 6.5,14.8 "})]});const uye=({width:e=24,height:t=24})=>Xe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,className:"ml-[2px] mt-[2px]",children:[S("polyline",{className:"approve-st0",points:"-273.7,390.2 -273.7,388.3 -274,387.5 -274.7,387 -275.8,387 -290.4,387 -291.1,387.2 -291.8,387.6 -292.2,388.3 -292.3,403.6 -292.2,404.4 -291.9,404.9 -291.3,405.2 -290.8,405.3 -275.9,405.3 -275.1,405.2 -274.3,404.9 -273.8,404.3 -273.8,402.3 "}),S("path",{className:"approve-st1",d:"M-287.2,397h-1.2c-0.4,0-0.7-0.3-0.7-0.7v-1.2c0-0.4,0.3-0.7,0.7-0.7h1.2c0.4,0,0.7,0.3,0.7,0.7v1.2 C-286.6,396.7-286.9,397-287.2,397z"}),S("path",{className:"approve-st1",d:"M-287.2,400.5h-1.2c-0.4,0-0.7-0.3-0.7-0.7v-1.2c0-0.4,0.3-0.7,0.7-0.7h1.2c0.4,0,0.7,0.3,0.7,0.7v1.2 C-286.5,400.2-286.8,400.5-287.2,400.5z"}),S("polygon",{className:"approve-st2",points:"-288.7,390.7 -288.3,391.2 -288.2,391.3 -288,391.3 -287.6,391.2 -287.2,390.7 -286.7,390.3 -286.5,390.3 -286.2,390.3 -286,390.5 -285.9,390.9 -286,391.1 -286.4,391.6 -287.9,392.9 -288.1,392.9 -288.3,392.9 -288.6,392.6 -289.6,391.6 -289.8,391.4 -289.8,391 -289.6,390.7 -289.4,390.6 -289.1,390.5 -288.9,390.5 "}),S("polygon",{className:"approve-st3",points:"-283.9,390.9 -279.1,390.9 -278.8,391.1 -278.7,391.3 -278.6,391.8 -278.7,392 -279,392.4 -279.2,392.5 -279.6,392.5 -284,392.5 -284.2,392.5 -284.5,392.3 -284.7,391.9 -284.7,391.7 -284.6,391.5 -284.3,391.1 -284.1,390.9 "}),S("polygon",{className:"approve-st3",points:"-284,394.4 -280,394.4 -279.8,394.6 -279.7,394.8 -279.6,395.2 -279.7,395.5 -279.9,395.9 -280.1,396 -280.4,396 -284.1,396 -284.3,395.9 -284.5,395.7 -284.7,395.4 -284.7,395.2 -284.6,394.9 -284.4,394.6 -284.2,394.4 "}),S("polygon",{className:"approve-st3",points:"-284.1,397.9 -280.9,397.9 -280.7,398.1 -280.6,398.3 -280.6,398.7 -280.6,399 -280.8,399.4 -280.9,399.5 -281.2,399.5 -284.2,399.5 -284.3,399.4 -284.5,399.2 -284.7,398.9 -284.7,398.7 -284.6,398.4 -284.4,398.1 -284.3,397.9 "}),S("polygon",{className:"approve-st2",points:"-274.2,391.7 -273.4,391.6 -273.1,391.7 -273,392.7 -272.6,392.8 -272.1,393 -271.6,393.2 -271.1,392.6 -270.7,392.8 -270.4,393.1 -270.1,393.5 -270,393.7 -270.6,394.2 -270.5,394.6 -270.4,394.9 -270.3,395.4 -269.5,395.4 -269.4,395.7 -269.4,396.2 -269.4,396.4 -269.6,396.7 -269.6,396.9 -270.4,396.8 -270.5,397.3 -270.6,397.7 -270.8,397.9 -270.1,398.6 -270.3,398.9 -270.6,399.2 -271.1,399.5 -271.2,399.6 -271.7,399 -271.7,398.9 -272.1,399 -272.4,399.1 -272.8,399.2 -273,399.3 -273,400 -273.2,400.2 -274.2,400.2 -274.4,400 -274.4,399.3 -274.4,399.1 -275,398.9 -275.5,398.7 -275.9,399.4 -276.2,399.5 -276.5,399.3 -277.1,398.8 -277,398.5 -276.4,397.9 -276.8,397.5 -276.9,397.2 -277.1,396.8 -277.9,396.8 -278,396.3 -278,395.6 -277.8,395.3 -277,395.3 -276.7,394.6 -276.6,394.2 -276.9,393.9 -277.1,393.6 -277.2,393.5 -277.1,393.2 -276.7,392.7 -276.5,392.6 -276.2,392.7 -275.4,393.2 -275.1,392.9 -274.7,392.8 -274.5,392.7 -274.5,391.8 "}),S("circle",{className:"approve-st4",cx:"-273.8",cy:"396",r:"1.8"})]}),cye=({width:e=24,height:t=24})=>Xe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,children:[S("path",{className:"working-st0",d:"M-279.1,402.7"}),S("polyline",{className:"working-st1",points:"-275,391.8 -275,390.5 -275.3,389.9 -276,389.6 -277,389.5 -290.8,389.6 -291.4,389.7 -292.1,390 -292.5,390.4 -292.5,401.4 -292.5,401.9 -292.1,402.3 -291.6,402.5 -291.1,402.6 -280,402.5 "}),S("polyline",{className:"working-st2",points:"-290.8,396 -289.3,396 -288.7,398.4 -287.6,394.3 -286.1,399.7 -285.1,392 -284.2,397 -283.2,395.9 -281.8,396 "}),S("circle",{className:"working-st3",cx:"-277",cy:"397.6",r:"4.6"}),S("circle",{className:"working-st4",cx:"-277.1",cy:"397.5",r:"2.9"}),S("polygon",{className:"working-st3",points:"-270.9,405.7 -269,403.8 -273.5,399.6 -275.4,401 "})]}),dye=()=>{const{mode:e,setMode:t}=oc(),r=i=>{t(i)},n=i=>i===e?"primary":"default";return Xe(Ar,{children:[S(yo,{title:"\u041E\u0442\u0431\u043E\u0440 \u043B\u043E\u043A\u0430\u0446\u0438\u0439 \u0434\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B",children:S(Rn,{icon:S(lye,{}),type:n($n.INITIAL),onClick:()=>r($n.INITIAL),className:"flex items-center justify-center",size:"large"})}),S(yo,{title:"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430\u043C\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439",children:S(Rn,{icon:S(uye,{}),type:n($n.APPROVE_WORKING),onClick:()=>r($n.APPROVE_WORKING),className:"flex items-center justify-center",size:"large"})}),S(yo,{title:"\u041C\u043E\u043D\u0438\u0442\u043E\u0440\u0438\u043D\u0433 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0445 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432",className:"text-center",children:S(Rn,{icon:S(cye,{}),type:n($n.WORKING),onClick:()=>r($n.WORKING),className:"flex items-center justify-center",size:"large"})})]})},fye=()=>Xe("div",{className:"absolute top-[20px] left-[19px] flex items-center z-10",children:[Xe("div",{className:dd("flex items-center gap-x-20"),children:[S(oye,{}),S("div",{className:"flex items-center gap-x-3",children:S(dye,{})})]}),S("div",{className:"ml-[71px]",children:S(sye,{})})]}),hye=8,pye="Voyager",mye={},vye={carto:{type:"vector",url:"https://tiles.basemaps.cartocdn.com/vector/carto.streets/v1/tiles.json"}},gye="https://tiles.basemaps.cartocdn.com/gl/voyager-gl-style/sprite",yye="https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf",xye=[{id:"background",type:"background",layout:{visibility:"visible"},paint:{"background-color":"#fbf8f3","background-opacity":1}},{id:"landcover",type:"fill",source:"carto","source-layer":"landcover",filter:["any",["==","class","wood"],["==","class","grass"],["==","subclass","recreation_ground"]],paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]},"fill-opacity":1}},{id:"park_national_park",type:"fill",source:"carto","source-layer":"park",minzoom:9,filter:["all",["==","class","national_park"]],layout:{visibility:"visible"},paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]},"fill-opacity":1,"fill-translate-anchor":"map"}},{id:"park_nature_reserve",type:"fill",source:"carto","source-layer":"park",minzoom:0,filter:["all",["==","class","nature_reserve"]],layout:{visibility:"visible"},paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]},"fill-antialias":!0,"fill-opacity":{stops:[[6,.7],[9,.9]]}}},{id:"landuse_residential",type:"fill",source:"carto","source-layer":"landuse",minzoom:6,filter:["any",["==","class","residential"]],paint:{"fill-color":{stops:[[5,"rgba(243, 234, 220, 0.5)"],[8,"rgba(243, 234, 220, 0.45)"],[9,"rgba(243, 234, 220, 0.4)"],[11,"rgba(243, 234, 220, 0.35)"],[13,"rgba(243, 234, 220, 0.3)"],[15,"rgba(243, 234, 220, 0.25)"],[16,"rgba(243, 234, 220, 0.15)"]]},"fill-opacity":{stops:[[6,.6],[9,1]]}}},{id:"landuse",type:"fill",source:"carto","source-layer":"landuse",filter:["any",["==","class","cemetery"],["==","class","stadium"]],paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]}}},{id:"waterway",type:"line",source:"carto","source-layer":"waterway",paint:{"line-color":"#cce7ea","line-width":{stops:[[8,.5],[9,1],[15,2],[16,3]]}}},{id:"boundary_county",type:"line",source:"carto","source-layer":"boundary",minzoom:9,maxzoom:24,filter:["all",["==","admin_level",6],["==","maritime",0]],paint:{"line-color":{stops:[[4,"#d4d5d6"],[5,"#d4d5d6"],[6,"#e1c5c7"]]},"line-width":{stops:[[4,.5],[7,1]]},"line-dasharray":{stops:[[6,[1]],[7,[2,2]]]}},layout:{visibility:"none"}},{id:"boundary_state",type:"line",source:"carto","source-layer":"boundary",minzoom:4,filter:["all",["==","admin_level",4],["==","maritime",0]],paint:{"line-color":{stops:[[4,"#d4d5d6"],[5,"#d4d5d6"],[6,"#e1c5c7"]]},"line-width":{stops:[[4,.5],[7,1],[8,1],[9,1.2]]},"line-dasharray":{stops:[[6,[1]],[7,[2,2]]]}},layout:{visibility:"none"}},{id:"water",type:"fill",source:"carto","source-layer":"water",minzoom:0,maxzoom:24,filter:["all",["==","$type","Polygon"]],layout:{visibility:"visible"},paint:{"fill-color":"#b0d0d6","fill-antialias":!0,"fill-translate-anchor":"map","fill-opacity":1}},{id:"water_shadow",type:"fill",source:"carto","source-layer":"water",minzoom:0,filter:["all",["==","$type","Polygon"]],layout:{visibility:"visible"},paint:{"fill-color":"rgba(203, 225, 228, 1)","fill-antialias":!0,"fill-translate-anchor":"map","fill-opacity":1,"fill-translate":{stops:[[0,[0,2]],[6,[0,1]],[14,[0,1]],[17,[0,2]]]}}},{id:"aeroway-runway",type:"line",source:"carto","source-layer":"aeroway",minzoom:12,filter:["all",["==","class","runway"]],layout:{"line-cap":"square"},paint:{"line-width":{stops:[[11,1],[13,4],[14,6],[15,8],[16,10]]},"line-color":"#e8e8e8"}},{id:"aeroway-taxiway",type:"line",source:"carto","source-layer":"aeroway",minzoom:13,filter:["all",["==","class","taxiway"]],paint:{"line-color":"#e8e8e8","line-width":{stops:[[13,.5],[14,1],[15,2],[16,4]]}}},{id:"waterway_label",type:"symbol",source:"carto","source-layer":"waterway",filter:["all",["has","name"],["==","class","river"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Regular Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"symbol-placement":"line","symbol-spacing":300,"symbol-avoid-edges":!1,"text-size":{stops:[[9,8],[10,9]]},"text-padding":2,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-offset":{stops:[[6,[0,-.2]],[11,[0,-.4]],[12,[0,-.6]]]},"text-letter-spacing":0,"text-keep-upright":!0},paint:{"text-color":"#51909c","text-halo-color":"#e2eef0","text-halo-width":1}},{id:"tunnel_service_case",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,1],[16,3],[17,6],[18,8]]},"line-opacity":1,"line-color":"#e6dfcb"}},{id:"tunnel_minor_case",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-width":{stops:[[11,.5],[12,.5],[14,2],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#e6dfcb"}},{id:"tunnel_sec_case",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,.5],[12,1],[13,2],[14,5],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#e6dfcb"}},{id:"tunnel_pri_case",type:"line",source:"carto","source-layer":"transportation",minzoom:8,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":"#e6dfcb"}},{id:"tunnel_trunk_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":"#fbdb98"}},{id:"tunnel_mot_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[12,4],[13,5],[14,7],[15,9],[16,11],[17,13],[18,22]]},"line-opacity":{stops:[[6,.5],[7,1]]},"line-color":"#fbdb98"}},{id:"tunnel_path",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","path"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,.5],[16,1],[18,3]]},"line-opacity":1,"line-color":"#d7d7d7","line-dasharray":{stops:[[15,[2,2]],[18,[3,3]]]}}},{id:"tunnel_service_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,2],[16,2],[17,4],[18,6]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_minor_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[15,3],[16,4],[17,8],[18,12]]},"line-opacity":1,"line-color":"rgba(238, 238, 238, 1)"}},{id:"tunnel_sec_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,2],[13,2],[14,3],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_pri_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_trunk_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_mot_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[10,1],[12,2],[13,3],[14,5],[15,7],[16,9],[17,11],[18,20]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_rail",type:"line",source:"carto","source-layer":"transportation",minzoom:13,filter:["all",["==","class","rail"],["==","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#dddddd","line-width":{base:1.3,stops:[[13,.5],[14,1],[15,1],[16,3],[21,7]]},"line-opacity":.5}},{id:"tunnel_rail_dash",type:"line",source:"carto","source-layer":"transportation",minzoom:15,filter:["all",["==","class","rail"],["==","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#ffffff","line-width":{base:1.3,stops:[[15,.5],[16,1],[20,5]]},"line-dasharray":{stops:[[15,[5,5]],[16,[6,6]]]},"line-opacity":.5}},{id:"road_service_case",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,1],[16,3],[17,6],[18,8]]},"line-opacity":1,"line-color":"#fdebce"}},{id:"road_minor_case",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["==","class","minor"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,.5],[12,.5],[14,2],[15,3],[16,4.3],[17,10],[18,14]]},"line-opacity":1,"line-color":{stops:[[13,"#ffffff"],[15.7,"#ffffff"],[16,"#fdebce"]]}}},{id:"road_pri_case_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","primary"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,2],[13,3],[14,4],[15,5],[16,8],[17,10]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":"#ffeabb"}},{id:"road_trunk_case_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","trunk"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,2],[13,3],[14,4],[15,5],[16,8],[17,10]]},"line-opacity":1,"line-color":{stops:[[12,"#fbdb98"],[14,"#fbdb98"]]}}},{id:"road_mot_case_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","motorway"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,2],[13,3],[14,4],[15,5],[16,8],[17,10]]},"line-opacity":1,"line-color":{stops:[[12,"#fbdb98"],[14,"#fbdb98"]]}}},{id:"road_sec_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,.5],[12,1.5],[13,3],[14,5],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":{stops:[[11,"#fffef9"],[12.99,"#fffef9"],[13,"#ffedc0"]]}}},{id:"road_pri_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:7,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[7,"#ffe7b7"],[12,"#ffeabb"]]}}},{id:"road_trunk_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[5,"#ffe7b7"],[12,"#fbdb98"]]}}},{id:"road_mot_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.7],[8,.8],[11,3],[12,4],[13,5],[14,7],[15,9],[16,11],[17,13],[18,22]]},"line-opacity":{stops:[[6,.5],[7,1]]},"line-color":{stops:[[5,"#fbdb98"],[12,"#fbdb98"]]}}},{id:"road_path",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["in","class","path","track"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,.5],[16,1],[18,3]]},"line-opacity":1,"line-color":"#d7d7d7","line-dasharray":{stops:[[15,[2,2]],[18,[3,3]]]}}},{id:"road_service_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,2],[16,2],[17,4],[18,6]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"road_minor_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","minor"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,3],[16,4],[17,8],[18,12]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"road_pri_fill_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","primary"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,1],[13,1.5],[14,2],[15,3],[16,6],[17,8]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"road_trunk_fill_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","trunk"],["==","ramp",1]],layout:{"line-cap":"square","line-join":"round"},paint:{"line-width":{stops:[[12,1],[13,1.5],[14,2],[15,3],[16,6],[17,8]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"road_mot_fill_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","motorway"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,1],[13,1.5],[14,2],[15,3],[16,6],[17,8]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"road_sec_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,2],[13,2],[14,3],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"road_pri_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[10,.3],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"road_trunk_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"road_mot_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[10,1],[12,2],[13,3],[14,5],[15,7],[16,9],[17,11],[18,20]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"rail",type:"line",source:"carto","source-layer":"transportation",minzoom:13,filter:["all",["==","class","rail"],["!=","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#dddddd","line-width":{base:1.3,stops:[[13,.5],[14,1],[15,1],[16,3],[21,7]]}}},{id:"rail_dash",type:"line",source:"carto","source-layer":"transportation",minzoom:15,filter:["all",["==","class","rail"],["!=","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#ffffff","line-width":{base:1.3,stops:[[15,.5],[16,1],[20,5]]},"line-dasharray":{stops:[[15,[5,5]],[16,[6,6]]]}}},{id:"bridge_service_case",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[15,1],[16,3],[17,6],[18,8]]},"line-opacity":1,"line-color":"#fdebce"}},{id:"bridge_minor_case",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-width":{stops:[[11,.5],[12,.5],[14,2],[15,3],[16,4.3],[17,10],[18,14]]},"line-opacity":1,"line-color":{stops:[[13,"#ffffff"],[15.7,"#ffffff"],[16,"#fdebce"]]}}},{id:"bridge_sec_case",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-width":{stops:[[11,.5],[12,1.5],[13,3],[14,5],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":{stops:[[11,"#fffef9"],[12.99,"#fffef9"],[13,"#ffedc0"]]}}},{id:"bridge_pri_case",type:"line",source:"carto","source-layer":"transportation",minzoom:8,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[8,"#ffe7b7"],[12,"#ffeabb"]]}}},{id:"bridge_trunk_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[5,"#fbdb98"],[12,"#fbdb98"]]}}},{id:"bridge_mot_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[12,4],[13,5],[14,7],[15,9],[16,11],[17,13],[18,22]]},"line-opacity":{stops:[[6,.5],[7,1]]},"line-color":{stops:[[5,"#fbdb98"],[10,"#fbdb98"]]}}},{id:"bridge_path",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","path"],["==","brunnel","bridge"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,.5],[16,1],[18,3]]},"line-opacity":1,"line-color":"#d7d7d7","line-dasharray":{stops:[[15,[2,2]],[18,[3,3]]]}}},{id:"bridge_service_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","bridge"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,2],[16,2],[17,4],[18,6]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"bridge_minor_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[15,3],[16,4],[17,8],[18,12]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"bridge_sec_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","bridge"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,2],[13,2],[14,3],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"bridge_pri_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"bridge_trunk_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"bridge_mot_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[10,1],[12,2],[13,3],[14,5],[15,7],[16,9],[17,11],[18,20]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"building",type:"fill",source:"carto","source-layer":"building",layout:{visibility:"visible"},paint:{"fill-color":{base:1,stops:[[15.5,"#e4dcd0"],[16,"#e4dcd0"]]},"fill-antialias":!0}},{id:"building-top",type:"fill",source:"carto","source-layer":"building",layout:{visibility:"visible"},paint:{"fill-translate":{base:1,stops:[[14,[0,0]],[16,[-2,-2]]]},"fill-outline-color":"#e9d8be","fill-color":"#f3eadc","fill-opacity":{base:1,stops:[[13,0],[16,1]]}}},{id:"boundary_country_outline",type:"line",source:"carto","source-layer":"boundary",minzoom:6,maxzoom:24,filter:["all",["==","admin_level",2],["==","maritime",0]],layout:{"line-cap":"round","line-join":"round",visibility:"none"},paint:{"line-color":"#f3efed","line-opacity":.5,"line-width":8,"line-offset":0}},{id:"boundary_country_inner",type:"line",source:"carto","source-layer":"boundary",minzoom:0,filter:["all",["==","admin_level",2],["==","maritime",0]],layout:{"line-cap":"round","line-join":"round",visibility:"none"},paint:{"line-color":{stops:[[4,"#ead5d7"],[5,"#ebd6d8"],[6,"#ebd6d8"]]},"line-opacity":1,"line-width":{stops:[[3,1],[6,1.5]]},"line-offset":0}},{id:"watername_ocean",type:"symbol",source:"carto","source-layer":"water_name",minzoom:0,maxzoom:5,filter:["all",["has","name"],["==","$type","Point"],["==","class","ocean"]],layout:{"text-field":"{name}","symbol-placement":"point","text-size":{stops:[[0,13],[2,14],[4,18]]},"text-font":["Montserrat Medium Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-line-height":1.2,"text-padding":2,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-max-width":6,"text-letter-spacing":.1},paint:{"text-color":"#ffffff","text-halo-color":"#98c2ca","text-halo-width":1,"text-halo-blur":0}},{id:"watername_sea",type:"symbol",source:"carto","source-layer":"water_name",minzoom:5,filter:["all",["has","name"],["==","$type","Point"],["==","class","sea"]],layout:{"text-field":"{name}","symbol-placement":"point","text-size":12,"text-font":["Montserrat Medium Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-line-height":1.2,"text-padding":2,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-max-width":6,"text-letter-spacing":.1},paint:{"text-color":"#ffffff","text-halo-color":"#98c2ca","text-halo-width":1,"text-halo-blur":0}},{id:"watername_lake",type:"symbol",source:"carto","source-layer":"water_name",minzoom:4,filter:["all",["has","name"],["==","$type","Point"],["==","class","lake"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"symbol-placement":"point","text-size":{stops:[[13,9],[14,10],[15,11],[16,12],[17,13]]},"text-font":["Montserrat Regular Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-line-height":1.2,"text-padding":2,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-pitch-alignment":"auto","text-rotation-alignment":"auto"},paint:{"text-color":"#51909c","text-halo-color":"#e2eef0","text-halo-width":1,"text-halo-blur":1}},{id:"watername_lake_line",type:"symbol",source:"carto","source-layer":"water_name",filter:["all",["has","name"],["==","$type","LineString"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"symbol-placement":"line","text-size":{stops:[[13,9],[14,10],[15,11],[16,12],[17,13]]},"text-font":["Montserrat Regular Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"symbol-spacing":350,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-line-height":1.2},paint:{"text-color":"#51909c","text-halo-color":"#e2eef0","text-halo-width":1,"text-halo-blur":1}},{id:"place_hamlet",type:"symbol",source:"carto","source-layer":"place",minzoom:12,maxzoom:16,filter:["any",["==","class","neighbourhood"],["==","class","hamlet"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[14,"{name}"]]},"text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[13,8],[14,10],[16,11]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":{stops:[[12,"none"],[14,"uppercase"]]}},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_suburbs",type:"symbol",source:"carto","source-layer":"place",minzoom:12,maxzoom:16,filter:["all",["==","class","suburb"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[12,9],[13,10],[14,11],[15,12],[16,13]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":{stops:[[8,"none"],[12,"uppercase"]]}},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_villages",type:"symbol",source:"carto","source-layer":"place",minzoom:10,maxzoom:16,filter:["all",["==","class","village"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[10,9],[12,10],[13,11],[14,12],[16,13]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"none"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_town",type:"symbol",source:"carto","source-layer":"place",minzoom:8,maxzoom:14,filter:["all",["==","class","town"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[8,10],[9,10],[10,11],[13,14],[14,15]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"none"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_country_2",type:"symbol",source:"carto","source-layer":"place",minzoom:3,maxzoom:10,filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[3,10],[5,11],[6,12],[7,13],[8,14]]},"text-transform":"uppercase"},paint:{"text-color":{stops:[[3,"#6b7d91"],[5,"#8894a3"],[6,"#a3abb5"]]},"text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"place_country_1",type:"symbol",source:"carto","source-layer":"place",minzoom:2,maxzoom:7,filter:["all",["==","class","country"],["<=","rank",2]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[3,11],[4,12],[5,13],[6,14]]},"text-transform":"uppercase","text-max-width":{stops:[[2,6],[3,6],[4,9],[5,12]]}},paint:{"text-color":{stops:[[3,"#6b7d91"],[5,"#8894a3"],[6,"#a3abb5"]]},"text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"place_state",type:"symbol",source:"carto","source-layer":"place",minzoom:5,maxzoom:10,filter:["all",["==","class","state"],["<=","rank",4]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[5,12],[7,14]]},"text-transform":"uppercase","text-max-width":9},paint:{"text-color":"#7c8a9b","text-halo-color":"#fbf8f3","text-halo-width":0}},{id:"place_continent",type:"symbol",source:"carto","source-layer":"place",minzoom:0,maxzoom:2,filter:["all",["==","class","continent"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-transform":"uppercase","text-size":14,"text-letter-spacing":.1,"text-max-width":9,"text-justify":"center","text-keep-upright":!1},paint:{"text-color":"#405c78","text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"place_city_r6",type:"symbol",source:"carto","source-layer":"place",minzoom:8,maxzoom:15,filter:["all",["==","class","city"],[">=","rank",6]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[8,12],[9,13],[10,14],[13,17],[14,20]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"uppercase"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_r5",type:"symbol",source:"carto","source-layer":"place",minzoom:8,maxzoom:15,filter:["all",["==","class","city"],[">=","rank",0],["<=","rank",5]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[8,14],[10,16],[13,19],[14,22]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"uppercase"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_r7",type:"symbol",source:"carto","source-layer":"place",minzoom:6,maxzoom:7,filter:["all",["==","class","city"],["<=","rank",7]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_r4",type:"symbol",source:"carto","source-layer":"place",minzoom:5,maxzoom:7,filter:["all",["==","class","city"],["<=","rank",4]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_r2",type:"symbol",source:"carto","source-layer":"place",minzoom:4,maxzoom:7,filter:["all",["==","class","city"],["<=","rank",2]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_z7",type:"symbol",source:"carto","source-layer":"place",minzoom:7,maxzoom:8,filter:["all",["!has","capital"],["!in","class","country","state"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_capital_dot_z7",type:"symbol",source:"carto","source-layer":"place",minzoom:7,maxzoom:8,filter:["all",[">","capital",0]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"uppercase"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"poi_stadium",type:"symbol",source:"carto","source-layer":"poi",minzoom:15,filter:["all",["in","class","stadium","cemetery","attraction"],["<=","rank",3]],layout:{"text-field":"{name}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[15,8],[17,9],[18,10]]},"text-transform":"uppercase"},paint:{"text-color":"#666666","text-halo-color":"rgba(255,255,255,0.15)","text-halo-width":1}},{id:"poi_park",type:"symbol",source:"carto","source-layer":"poi",minzoom:15,filter:["all",["==","class","park"]],layout:{"text-field":"{name}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[15,8],[17,9],[18,10]]},"text-transform":"uppercase"},paint:{"text-color":"#666666","text-halo-color":"rgba(255,255,255,0.15)","text-halo-width":1}},{id:"roadname_minor",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:16,filter:["all",["in","class","minor","service"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":9,"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":200,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center"},paint:{"text-color":"#87919e","text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"roadname_sec",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:15,filter:["all",["in","class","secondary","tertiary"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[15,9],[16,11],[18,12]]},"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":200,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center"},paint:{"text-color":"#87919e","text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"roadname_pri",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:14,filter:["all",["in","class","primary"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[14,10],[15,10],[16,11],[18,12]]},"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":{stops:[[6,200],[16,250]]},"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center","text-letter-spacing":{stops:[[14,0],[16,.2]]}},paint:{"text-color":"#798493","text-halo-color":"#fefde1","text-halo-width":1}},{id:"roadname_major",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:13,filter:["all",["in","class","trunk","motorway"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[14,10],[15,10],[16,11],[18,12]]},"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":{stops:[[6,200],[16,250]]},"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center","text-letter-spacing":{stops:[[13,0],[16,.2]]}},paint:{"text-color":"#798493","text-halo-color":"#fff0c4","text-halo-width":1}},{id:"housenumber",type:"symbol",source:"carto","source-layer":"housenumber",minzoom:17,maxzoom:24,layout:{"text-field":"{housenumber}","text-size":{stops:[[17,9],[18,11]]},"text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"]},paint:{"text-halo-color":"rgba(255,255,255,0.15)","text-color":"#d2b17d","text-halo-width":.75}}],_ye="voyager",bye="Carto",wye={version:hye,name:pye,metadata:mye,sources:vye,sprite:gye,glyphs:yye,layers:xye,id:_ye,owner:bye};var Bv="delete",Gn=5,Va=1<>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?eh(e)+t:t}function DL(){return!0}function Yx(e,t,r){return(e===0&&!FL(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function Vv(e,t){return LL(e,t,0)}function Qx(e,t){return LL(e,t,t)}function LL(e,t,r){return e===void 0?r:FL(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function FL(e){return e<0||e===0&&1/e===-1/0}var $L="@@__IMMUTABLE_ITERABLE__@@";function Qo(e){return Boolean(e&&e[$L])}var BL="@@__IMMUTABLE_KEYED__@@";function Zn(e){return Boolean(e&&e[BL])}var VL="@@__IMMUTABLE_INDEXED__@@";function zo(e){return Boolean(e&&e[VL])}function Jx(e){return Zn(e)||zo(e)}var Ci=function(t){return Qo(t)?t:ea(t)},Ya=function(e){function t(r){return Zn(r)?r:sc(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ci),Sd=function(e){function t(r){return zo(r)?r:Ss(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ci),Ph=function(e){function t(r){return Qo(r)&&!Jx(r)?r:Oh(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ci);Ci.Keyed=Ya;Ci.Indexed=Sd;Ci.Set=Ph;var jL="@@__IMMUTABLE_SEQ__@@";function CE(e){return Boolean(e&&e[jL])}var UL="@@__IMMUTABLE_RECORD__@@";function Mh(e){return Boolean(e&&e[UL])}function Cs(e){return Qo(e)||Mh(e)}var Ih="@@__IMMUTABLE_ORDERED__@@";function xs(e){return Boolean(e&&e[Ih])}var jv=0,ws=1,Ga=2,MC=typeof Symbol=="function"&&Symbol.iterator,KL="@@iterator",e_=MC||KL,bn=function(t){this.next=t};bn.prototype.toString=function(){return"[Iterator]"};bn.KEYS=jv;bn.VALUES=ws;bn.ENTRIES=Ga;bn.prototype.inspect=bn.prototype.toSource=function(){return this.toString()};bn.prototype[e_]=function(){return this};function oi(e,t,r,n){var i=e===0?t:e===1?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function Jo(){return{value:void 0,done:!0}}function SE(e){return Array.isArray(e)?!0:!!t_(e)}function iI(e){return e&&typeof e.next=="function"}function IC(e){var t=t_(e);return t&&t.call(e)}function t_(e){var t=e&&(MC&&e[MC]||e[KL]);if(typeof t=="function")return t}function Cye(e){var t=t_(e);return t&&t===e.entries}function Sye(e){var t=t_(e);return t&&t===e.keys}var Rh=Object.prototype.hasOwnProperty;function EE(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var ea=function(e){function t(r){return r==null?TE():Cs(r)?r.toSeq():kye(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,i){var a=this._cache;if(a){for(var u=a.length,o=0;o!==u;){var f=a[i?u-++o:o++];if(n(f[1],f[0],this)===!1)break}return o}return this.__iterateUncached(n,i)},t.prototype.__iterator=function(n,i){var a=this._cache;if(a){var u=a.length,o=0;return new bn(function(){if(o===u)return Jo();var f=a[i?u-++o:o++];return oi(n,f[0],f[1])})}return this.__iteratorUncached(n,i)},t}(Ci),sc=function(e){function t(r){return r==null?TE().toKeyedSeq():Qo(r)?Zn(r)?r.toSeq():r.fromEntrySeq():Mh(r)?r.toSeq():PE(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(ea),Ss=function(e){function t(r){return r==null?TE():Qo(r)?Zn(r)?r.entrySeq():r.toIndexedSeq():Mh(r)?r.toSeq().entrySeq():HL(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(ea),Oh=function(e){function t(r){return(Qo(r)&&!Jx(r)?r:Ss(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(ea);ea.isSeq=CE;ea.Keyed=sc;ea.Set=Oh;ea.Indexed=Ss;ea.prototype[jL]=!0;var fd=function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this.has(n)?this._array[Zu(this,n)]:i},t.prototype.__iterate=function(n,i){for(var a=this._array,u=a.length,o=0;o!==u;){var f=i?u-++o:o++;if(n(a[f],f,this)===!1)break}return o},t.prototype.__iterator=function(n,i){var a=this._array,u=a.length,o=0;return new bn(function(){if(o===u)return Jo();var f=i?u-++o:o++;return oi(n,f,a[f])})},t}(Ss),kE=function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return i!==void 0&&!this.has(n)?i:this._object[n]},t.prototype.has=function(n){return Rh.call(this._object,n)},t.prototype.__iterate=function(n,i){for(var a=this._object,u=this._keys,o=u.length,f=0;f!==o;){var p=u[i?o-++f:f++];if(n(a[p],p,this)===!1)break}return f},t.prototype.__iterator=function(n,i){var a=this._object,u=this._keys,o=u.length,f=0;return new bn(function(){if(f===o)return Jo();var p=u[i?o-++f:f++];return oi(n,p,a[p])})},t}(sc);kE.prototype[Ih]=!0;var Eye=function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(i)return this.cacheResult().__iterate(n,i);var a=this._collection,u=IC(a),o=0;if(iI(u))for(var f;!(f=u.next()).done&&n(f.value,o++,this)!==!1;);return o},t.prototype.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var a=this._collection,u=IC(a);if(!iI(u))return new bn(Jo);var o=0;return new bn(function(){var f=u.next();return f.done?f:oi(n,o++,f.value)})},t}(Ss),oI;function TE(){return oI||(oI=new fd([]))}function PE(e){var t=ME(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new kE(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function HL(e){var t=ME(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function kye(e){var t=ME(e);if(t)return Cye(e)?t.fromEntrySeq():Sye(e)?t.toSetSeq():t;if(typeof e=="object")return new kE(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function ME(e){return EE(e)?new fd(e):SE(e)?new Eye(e):void 0}var WL="@@__IMMUTABLE_MAP__@@";function IE(e){return Boolean(e&&e[WL])}function qL(e){return IE(e)&&xs(e)}function aI(e){return Boolean(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function ma(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(aI(e)&&aI(t)&&e.equals(t))}var Hp=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,i=r&65535;return n*i+((t>>>16)*i+n*(r>>>16)<<16>>>0)|0};function r_(e){return e>>>1&1073741824|e&3221225471}var Tye=Object.prototype.valueOf;function fa(e){if(e==null)return sI(e);if(typeof e.hashCode=="function")return r_(e.hashCode(e));var t=Aye(e);if(t==null)return sI(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return Pye(t);case"string":return t.length>Nye?Mye(t):RC(t);case"object":case"function":return Rye(t);case"symbol":return Iye(t);default:if(typeof t.toString=="function")return RC(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function sI(e){return e===null?1108378658:1108378659}function Pye(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return r_(t)}function Mye(e){var t=K2[e];return t===void 0&&(t=RC(e),U2===zye&&(U2=0,K2={}),U2++,K2[e]=t),t}function RC(e){for(var t=0,r=0;r0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function Aye(e){return e.valueOf!==Tye&&typeof e.valueOf=="function"?e.valueOf(e):e}function GL(){var e=++j2;return j2&1073741824&&(j2=0),e}var OC=typeof WeakMap=="function",AC;OC&&(AC=new WeakMap);var cI=Object.create(null),j2=0,jc="__immutablehash__";typeof Symbol=="function"&&(jc=Symbol(jc));var Nye=16,zye=255,U2=0,K2={},n_=function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this._iter.get(n,i)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,i=RE(this,!0);return this._useKeys||(i.valueSeq=function(){return n._iter.toSeq().reverse()}),i},t.prototype.map=function(n,i){var a=this,u=JL(this,n,i);return this._useKeys||(u.valueSeq=function(){return a._iter.toSeq().map(n,i)}),u},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(u,o){return n(u,o,a)},i)},t.prototype.__iterator=function(n,i){return this._iter.__iterator(n,i)},t}(sc);n_.prototype[Ih]=!0;var ZL=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var a=this,u=0;return i&&eh(this),this._iter.__iterate(function(o){return n(o,i?a.size-++u:u++,a)},i)},t.prototype.__iterator=function(n,i){var a=this,u=this._iter.__iterator(ws,i),o=0;return i&&eh(this),new bn(function(){var f=u.next();return f.done?f:oi(n,i?a.size-++o:o++,f.value,f)})},t}(Ss),XL=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(u){return n(u,u,a)},i)},t.prototype.__iterator=function(n,i){var a=this._iter.__iterator(ws,i);return new bn(function(){var u=a.next();return u.done?u:oi(n,u.value,u.value,u)})},t}(Oh),YL=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(u){if(u){fI(u);var o=Qo(u);return n(o?u.get(1):u[1],o?u.get(0):u[0],a)}},i)},t.prototype.__iterator=function(n,i){var a=this._iter.__iterator(ws,i);return new bn(function(){for(;;){var u=a.next();if(u.done)return u;var o=u.value;if(o){fI(o);var f=Qo(o);return oi(n,f?o.get(0):o[0],f?o.get(1):o[1],u)}}})},t}(sc);ZL.prototype.cacheResult=n_.prototype.cacheResult=XL.prototype.cacheResult=YL.prototype.cacheResult=NE;function QL(e){var t=el(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=NE,t.__iterateUncached=function(r,n){var i=this;return e.__iterate(function(a,u){return r(u,a,i)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===Ga){var i=e.__iterator(r,n);return new bn(function(){var a=i.next();if(!a.done){var u=a.value[0];a.value[0]=a.value[1],a.value[1]=u}return a})}return e.__iterator(r===ws?jv:ws,n)},t}function JL(e,t,r){var n=el(e);return n.size=e.size,n.has=function(i){return e.has(i)},n.get=function(i,a){var u=e.get(i,cn);return u===cn?a:t.call(r,u,i,e)},n.__iterateUncached=function(i,a){var u=this;return e.__iterate(function(o,f,p){return i(t.call(r,o,f,p),f,u)!==!1},a)},n.__iteratorUncached=function(i,a){var u=e.__iterator(Ga,a);return new bn(function(){var o=u.next();if(o.done)return o;var f=o.value,p=f[0];return oi(i,p,t.call(r,f[1],p,e),o)})},n}function RE(e,t){var r=this,n=el(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var i=QL(e);return i.reverse=function(){return e.flip()},i}),n.get=function(i,a){return e.get(t?i:-1-i,a)},n.has=function(i){return e.has(t?i:-1-i)},n.includes=function(i){return e.includes(i)},n.cacheResult=NE,n.__iterate=function(i,a){var u=this,o=0;return a&&eh(e),e.__iterate(function(f,p){return i(f,t?p:a?u.size-++o:o++,u)},!a)},n.__iterator=function(i,a){var u=0;a&&eh(e);var o=e.__iterator(Ga,!a);return new bn(function(){var f=o.next();if(f.done)return f;var p=f.value;return oi(i,t?p[0]:a?r.size-++u:u++,p[1],f)})},n}function eF(e,t,r,n){var i=el(e);return n&&(i.has=function(a){var u=e.get(a,cn);return u!==cn&&!!t.call(r,u,a,e)},i.get=function(a,u){var o=e.get(a,cn);return o!==cn&&t.call(r,o,a,e)?o:u}),i.__iterateUncached=function(a,u){var o=this,f=0;return e.__iterate(function(p,v,y){if(t.call(r,p,v,y))return f++,a(p,n?v:f-1,o)},u),f},i.__iteratorUncached=function(a,u){var o=e.__iterator(Ga,u),f=0;return new bn(function(){for(;;){var p=o.next();if(p.done)return p;var v=p.value,y=v[0],w=v[1];if(t.call(r,w,y,e))return oi(a,n?y:f++,w,p)}})},i}function Dye(e,t,r){var n=Nh().asMutable();return e.__iterate(function(i,a){n.update(t.call(r,i,a,e),0,function(u){return u+1})}),n.asImmutable()}function Lye(e,t,r){var n=Zn(e),i=(xs(e)?Vl():Nh()).asMutable();e.__iterate(function(u,o){i.update(t.call(r,u,o,e),function(f){return f=f||[],f.push(n?[o,u]:u),f})});var a=AE(e);return i.map(function(u){return Fn(e,a(u))}).asImmutable()}function Fye(e,t,r){var n=Zn(e),i=[[],[]];e.__iterate(function(u,o){i[t.call(r,u,o,e)?1:0].push(n?[o,u]:u)});var a=AE(e);return i.map(function(u){return Fn(e,a(u))})}function OE(e,t,r,n){var i=e.size;if(Yx(t,r,i))return e;var a=Vv(t,i),u=Qx(r,i);if(a!==a||u!==u)return OE(e.toSeq().cacheResult(),t,r,n);var o=u-a,f;o===o&&(f=o<0?0:o);var p=el(e);return p.size=f===0?f:e.size&&f||void 0,!n&&CE(e)&&f>=0&&(p.get=function(v,y){return v=Zu(this,v),v>=0&&vf)return Jo();var R=w.next();return n||v===ws||R.done?R:v===jv?oi(v,T-1,void 0,R):oi(v,T-1,R.value[1],R)})},p}function $ye(e,t,r){var n=el(e);return n.__iterateUncached=function(i,a){var u=this;if(a)return this.cacheResult().__iterate(i,a);var o=0;return e.__iterate(function(f,p,v){return t.call(r,f,p,v)&&++o&&i(f,p,u)}),o},n.__iteratorUncached=function(i,a){var u=this;if(a)return this.cacheResult().__iterator(i,a);var o=e.__iterator(Ga,a),f=!0;return new bn(function(){if(!f)return Jo();var p=o.next();if(p.done)return p;var v=p.value,y=v[0],w=v[1];return t.call(r,w,y,u)?i===Ga?p:oi(i,y,w,p):(f=!1,Jo())})},n}function tF(e,t,r,n){var i=el(e);return i.__iterateUncached=function(a,u){var o=this;if(u)return this.cacheResult().__iterate(a,u);var f=!0,p=0;return e.__iterate(function(v,y,w){if(!(f&&(f=t.call(r,v,y,w))))return p++,a(v,n?y:p-1,o)}),p},i.__iteratorUncached=function(a,u){var o=this;if(u)return this.cacheResult().__iterator(a,u);var f=e.__iterator(Ga,u),p=!0,v=0;return new bn(function(){var y,w,k;do{if(y=f.next(),y.done)return n||a===ws?y:a===jv?oi(a,v++,void 0,y):oi(a,v++,y.value[1],y);var T=y.value;w=T[0],k=T[1],p&&(p=t.call(r,k,w,o))}while(p);return a===Ga?y:oi(a,w,k,y)})},i}function Bye(e,t){var r=Zn(e),n=[e].concat(t).map(function(u){return Qo(u)?r&&(u=Ya(u)):u=r?PE(u):HL(Array.isArray(u)?u:[u]),u}).filter(function(u){return u.size!==0});if(n.length===0)return e;if(n.length===1){var i=n[0];if(i===e||r&&Zn(i)||zo(e)&&zo(i))return i}var a=new fd(n);return r?a=a.toKeyedSeq():zo(e)||(a=a.toSetSeq()),a=a.flatten(!0),a.size=n.reduce(function(u,o){if(u!==void 0){var f=o.size;if(f!==void 0)return u+f}},0),a}function rF(e,t,r){var n=el(e);return n.__iterateUncached=function(i,a){if(a)return this.cacheResult().__iterate(i,a);var u=0,o=!1;function f(p,v){p.__iterate(function(y,w){return(!t||v0}function $y(e,t,r,n){var i=el(e),a=new fd(r).map(function(u){return u.size});return i.size=n?a.max():a.min(),i.__iterate=function(u,o){for(var f=this.__iterator(ws,o),p,v=0;!(p=f.next()).done&&u(p.value,v++,this)!==!1;);return v},i.__iteratorUncached=function(u,o){var f=r.map(function(y){return y=Ci(y),IC(o?y.reverse():y)}),p=0,v=!1;return new bn(function(){var y;return v||(y=f.map(function(w){return w.next()}),v=n?y.every(function(w){return w.done}):y.some(function(w){return w.done})),v?Jo():oi(u,p++,t.apply(null,y.map(function(w){return w.value})))})},i}function Fn(e,t){return e===t?e:CE(e)?t:e.constructor(t)}function fI(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function AE(e){return Zn(e)?Ya:zo(e)?Sd:Ph}function el(e){return Object.create((Zn(e)?sc:zo(e)?Ss:Oh).prototype)}function NE(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):ea.prototype.cacheResult.call(this)}function nF(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return dF(this,t,e)}function dF(e,t,r){for(var n=[],i=0;i0;)t[r]=arguments[r+1];return BE(this,t,e)}function jE(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ah(this,e,vs(),function(n){return VE(n,t)})}function UE(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ah(this,e,vs(),function(n){return BE(n,t)})}function Uv(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Kv(){return this.__ownerID?this:this.__ensureOwner(new wE)}function Hv(){return this.__ensureOwner()}function KE(){return this.__altered}var Nh=function(e){function t(r){return r==null?vs():IE(r)&&!xs(r)?r:vs().withMutations(function(n){var i=e(r);Ua(i.size),i.forEach(function(a,u){return n.set(u,a)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return vs().withMutations(function(a){for(var u=0;u=n.length)throw new Error("Missing value for key: "+n[u]);a.set(n[u],n[u+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,i){return this._root?this._root.get(0,void 0,n,i):i},t.prototype.set=function(n,i){return mI(this,n,i)},t.prototype.remove=function(n){return mI(this,n,cn)},t.prototype.deleteAll=function(n){var i=Ci(n);return i.size===0?this:this.withMutations(function(a){i.forEach(function(u){return a.remove(u)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):vs()},t.prototype.sort=function(n){return Vl(th(this,n))},t.prototype.sortBy=function(n,i){return Vl(th(this,i,n))},t.prototype.map=function(n,i){var a=this;return this.withMutations(function(u){u.forEach(function(o,f){u.set(f,n.call(i,o,f,a))})})},t.prototype.__iterator=function(n,i){return new Yye(this,n,i)},t.prototype.__iterate=function(n,i){var a=this,u=0;return this._root&&this._root.iterate(function(o){return u++,n(o[1],o[0],a)},i),u},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?HE(this.size,this._root,n,this.__hash):this.size===0?vs():(this.__ownerID=n,this.__altered=!1,this)},t}(Ya);Nh.isMap=IE;var Yn=Nh.prototype;Yn[WL]=!0;Yn[Bv]=Yn.remove;Yn.removeAll=Yn.deleteAll;Yn.setIn=DE;Yn.removeIn=Yn.deleteIn=LE;Yn.update=FE;Yn.updateIn=$E;Yn.merge=Yn.concat=uF;Yn.mergeWith=cF;Yn.mergeDeep=fF;Yn.mergeDeepWith=hF;Yn.mergeIn=jE;Yn.mergeDeepIn=UE;Yn.withMutations=Uv;Yn.wasAltered=KE;Yn.asImmutable=Hv;Yn["@@transducer/init"]=Yn.asMutable=Kv;Yn["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Yn["@@transducer/result"]=function(e){return e.asImmutable()};var rv=function(t,r){this.ownerID=t,this.entries=r};rv.prototype.get=function(t,r,n,i){for(var a=this.entries,u=0,o=a.length;u=n0e)return Qye(t,p,i,a);var k=t&&t===this.ownerID,T=k?p:Bs(p);return w?f?v===y-1?T.pop():T[v]=T.pop():T[v]=[i,a]:T.push([i,a]),k?(this.entries=T,this):new rv(t,T)}};var rh=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};rh.prototype.get=function(t,r,n,i){r===void 0&&(r=fa(n));var a=1<<((t===0?r:r>>>t)&Ao),u=this.bitmap;return(u&a)===0?i:this.nodes[pF(u&a-1)].get(t+Gn,r,n,i)};rh.prototype.update=function(t,r,n,i,a,u,o){n===void 0&&(n=fa(i));var f=(r===0?n:n>>>r)&Ao,p=1<=i0e)return e0e(t,k,v,f,R);if(y&&!R&&k.length===2&&vI(k[w^1]))return k[w^1];if(y&&R&&k.length===1&&vI(R))return R;var A=t&&t===this.ownerID,I=y?R?v:v^p:v|p,O=y?R?mF(k,w,R,A):r0e(k,w,A):t0e(k,w,R,A);return A?(this.bitmap=I,this.nodes=O,this):new rh(t,I,O)};var nv=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};nv.prototype.get=function(t,r,n,i){r===void 0&&(r=fa(n));var a=(t===0?r:r>>>t)&Ao,u=this.nodes[a];return u?u.get(t+Gn,r,n,i):i};nv.prototype.update=function(t,r,n,i,a,u,o){n===void 0&&(n=fa(i));var f=(r===0?n:n>>>r)&Ao,p=a===cn,v=this.nodes,y=v[f];if(p&&!y)return this;var w=WE(y,t,r+Gn,n,i,a,u,o);if(w===y)return this;var k=this.count;if(!y)k++;else if(!w&&(k--,k>>r)&Ao,u=(r===0?n:n>>>r)&Ao,o,f=a===u?[qE(e,t,r+Gn,n,i)]:(o=new Bl(t,n,i),a>>=1)u[o]=r&1?t[a++]:void 0;return u[n]=i,new nv(e,a+1,u)}function pF(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function mF(e,t,r,n){var i=n?e:Bs(e);return i[t]=r,i}function t0e(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var a=new Array(i),u=0,o=0;o0&&a=0&&n>>r&Ao;if(i>=this.array.length)return new ju([],t);var a=i===0,u;if(r>0){var o=this.array[i];if(u=o&&o.removeBefore(t,r-Gn,n),u===o&&a)return this}if(a&&!u)return this;var f=ih(this,t);if(!a)for(var p=0;p>>r&Ao;if(i>=this.array.length)return this;var a;if(r>0){var u=this.array[i];if(a=u&&u.removeAfter(t,r-Gn,n),a===u&&i===this.array.length-1)return this}var o=ih(this,t);return o.array.splice(i+1),a&&(o.array[i]=a),o};var Cm={};function gI(e,t){var r=e._origin,n=e._capacity,i=ov(n),a=e._tail;return u(e._root,e._level,0);function u(p,v,y){return v===0?o(p,y):f(p,v,y)}function o(p,v){var y=v===i?a&&a.array:p&&p.array,w=v>r?0:r-v,k=n-v;return k>Va&&(k=Va),function(){if(w===k)return Cm;var T=t?--k:w++;return y&&y[T]}}function f(p,v,y){var w,k=p&&p.array,T=y>r?0:r-y>>v,R=(n-y>>v)+1;return R>Va&&(R=Va),function(){for(;;){if(w){var A=w();if(A!==Cm)return A;w=null}if(T===R)return Cm;var I=t?--R:T++;w=u(k&&k[I],v-Gn,y+(I<=e.size||t<0)return e.withMutations(function(u){t<0?_u(u,t).set(0,r):_u(u,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,i=e._root,a=PC();return t>=ov(e._capacity)?n=NC(n,e.__ownerID,0,t,r,a):i=NC(i,e.__ownerID,e._level,t,r,a),a.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):iv(e._origin,e._capacity,e._level,i,n):e}function NC(e,t,r,n,i,a){var u=n>>>r&Ao,o=e&&u0){var p=e&&e.array[u],v=NC(p,t,r-Gn,n,i,a);return v===p?e:(f=ih(e,t),f.array[u]=v,f)}return o&&e.array[u]===i?e:(a&&ja(a),f=ih(e,t),i===void 0&&u===f.array.length-1?f.array.pop():f.array[u]=i,f)}function ih(e,t){return t&&e&&t===e.ownerID?e:new ju(e?e.array.slice():[],t)}function yF(e,t){if(t>=ov(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&Ao],n-=Gn;return r}}function _u(e,t,r){t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new wE,i=e._origin,a=e._capacity,u=i+t,o=r===void 0?a:r<0?a+r:i+r;if(u===i&&o===a)return e;if(u>=o)return e.clear();for(var f=e._level,p=e._root,v=0;u+v<0;)p=new ju(p&&p.array.length?[void 0,p]:[],n),f+=Gn,v+=1<=1<y?new ju([],n):k;if(k&&w>y&&uGn;A-=Gn){var I=y>>>A&Ao;R=R.array[I]=ih(R.array[I],n)}R.array[y>>>Gn&Ao]=k}if(o=w)u-=w,o-=w,f=Gn,p=null,T=T&&T.removeBefore(n,0,u);else if(u>i||w>>f&Ao;if(O!==w>>>f&Ao)break;O&&(v+=(1<i&&(p=p.removeBefore(n,f,u-v)),p&&w>>Gn<=Va&&i.size>=n.size*2?(f=i.filter(function(p,v){return p!==void 0&&a!==v}),o=f.toKeyedSeq().map(function(p){return p[0]}).flip().toMap(),e.__ownerID&&(o.__ownerID=f.__ownerID=e.__ownerID)):(o=n.remove(t),f=a===i.size-1?i.pop():i.set(a,void 0))}else if(u){if(r===i.get(a)[1])return e;o=n,f=i.set(a,[t,r])}else o=n.set(t,i.size),f=i.set(i.size,[t,r]);return e.__ownerID?(e.size=o.size,e._map=o,e._list=f,e.__hash=void 0,e.__altered=!0,e):GE(o,f)}var xF="@@__IMMUTABLE_STACK__@@";function zC(e){return Boolean(e&&e[xF])}var ZE=function(e){function t(r){return r==null?By():zC(r)?r:By().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,i){var a=this._head;for(n=Zu(this,n);a&&n--;)a=a.next;return a?a.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,a=this._head,u=arguments.length-1;u>=0;u--)a={value:n[u],next:a};return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):rm(i,a)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&zC(n))return n;Ua(n.size);var i=this.size,a=this._head;return n.__iterate(function(u){i++,a={value:u,next:a}},!0),this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):rm(i,a)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):By()},t.prototype.slice=function(n,i){if(Yx(n,i,this.size))return this;var a=Vv(n,this.size),u=Qx(i,this.size);if(u!==this.size)return e.prototype.slice.call(this,n,i);for(var o=this.size-a,f=this._head;a--;)f=f.next;return this.__ownerID?(this.size=o,this._head=f,this.__hash=void 0,this.__altered=!0,this):rm(o,f)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?rm(this.size,this._head,n,this.__hash):this.size===0?By():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,i){var a=this;if(i)return new fd(this.toArray()).__iterate(function(f,p){return n(f,p,a)},i);for(var u=0,o=this._head;o&&n(o.value,u++,this)!==!1;)o=o.next;return u},t.prototype.__iterator=function(n,i){if(i)return new fd(this.toArray()).__iterator(n,i);var a=0,u=this._head;return new bn(function(){if(u){var o=u.value;return u=u.next,oi(n,a++,o)}return Jo()})},t}(Sd);ZE.isStack=zC;var Fo=ZE.prototype;Fo[xF]=!0;Fo.shift=Fo.pop;Fo.unshift=Fo.push;Fo.unshiftAll=Fo.pushAll;Fo.withMutations=Uv;Fo.wasAltered=KE;Fo.asImmutable=Hv;Fo["@@transducer/init"]=Fo.asMutable=Kv;Fo["@@transducer/step"]=function(e,t){return e.unshift(t)};Fo["@@transducer/result"]=function(e){return e.asImmutable()};function rm(e,t,r,n){var i=Object.create(Fo);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var bI;function By(){return bI||(bI=rm(0))}var _F="@@__IMMUTABLE_SET__@@";function XE(e){return Boolean(e&&e[_F])}function bF(e){return XE(e)&&xs(e)}function wF(e,t){if(e===t)return!0;if(!Qo(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Zn(e)!==Zn(t)||zo(e)!==zo(t)||xs(e)!==xs(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!Jx(e);if(xs(e)){var n=e.entries();return t.every(function(f,p){var v=n.next().value;return v&&ma(v[1],f)&&(r||ma(v[0],p))})&&n.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{i=!0;var a=e;e=t,t=a}var u=!0,o=t.__iterate(function(f,p){if(r?!e.has(f):i?!ma(f,e.get(p,cn)):!ma(e.get(p,cn),f))return u=!1,!1});return u&&e.size===o}function Ed(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function k1(e){if(!e||typeof e!="object")return e;if(!Qo(e)){if(!Xu(e))return e;e=ea(e)}if(Zn(e)){var t={};return e.__iterate(function(n,i){t[i]=k1(n)}),t}var r=[];return e.__iterate(function(n){r.push(k1(n))}),r}var o_=function(e){function t(r){return r==null?nm():XE(r)&&!xs(r)?r:nm().withMutations(function(n){var i=e(r);Ua(i.size),i.forEach(function(a){return n.add(a)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Ya(n).keySeq())},t.intersect=function(n){return n=Ci(n).toArray(),n.length?ao.intersect.apply(t(n.pop()),n):nm()},t.union=function(n){return n=Ci(n).toArray(),n.length?ao.union.apply(t(n.pop()),n):nm()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return Vy(this,this._map.set(n,n))},t.prototype.remove=function(n){return Vy(this,this._map.remove(n))},t.prototype.clear=function(){return Vy(this,this._map.clear())},t.prototype.map=function(n,i){var a=this,u=!1,o=Vy(this,this._map.mapEntries(function(f){var p=f[1],v=n.call(i,p,p,a);return v!==p&&(u=!0),[v,v]},i));return u?o:this},t.prototype.union=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return n=n.filter(function(a){return a.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(a){for(var u=0;u=0&&i=0&&athis.size?r:this.find(function(n,i){return i===t},void 0,r)},has:function(t){return t=Zu(this,t),t>=0&&(this.size!==void 0?this.size===1/0||tt?-1:0}function f0e(e){if(e.size===1/0)return 0;var t=xs(e),r=Zn(e),n=t?1:0,i=e.__iterate(r?t?function(a,u){n=31*n+TI(fa(a),fa(u))|0}:function(a,u){n=n+TI(fa(a),fa(u))|0}:t?function(a){n=31*n+fa(a)|0}:function(a){n=n+fa(a)|0});return h0e(i,n)}function h0e(e,t){return t=Hp(t,3432918353),t=Hp(t<<15|t>>>-15,461845907),t=Hp(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Hp(t^t>>>16,2246822507),t=Hp(t^t>>>13,3266489909),t=r_(t^t>>>16),t}function TI(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var av=function(e){function t(r){return r==null?DC():bF(r)?r:DC().withMutations(function(n){var i=Ph(r);Ua(i.size),i.forEach(function(a){return n.add(a)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Ya(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(o_);av.isOrderedSet=bF;var kd=av.prototype;kd[Ih]=!0;kd.zip=zh.zip;kd.zipWith=zh.zipWith;kd.zipAll=zh.zipAll;kd.__empty=DC;kd.__make=TF;function TF(e,t){var r=Object.create(kd);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var PI;function DC(){return PI||(PI=TF(tm()))}function p0e(e){if(Mh(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Cs(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Ji=function(t,r){var n;p0e(t);var i=function(o){var f=this;if(o instanceof i)return o;if(!(this instanceof i))return new i(o);if(!n){n=!0;var p=Object.keys(t),v=a._indices={};a._name=r,a._keys=p,a._defaultValues=t;for(var y=0;y2?[]:void 0,{"":e})}function PF(e,t,r,n,i,a){if(typeof r!="string"&&!Cs(r)&&(EE(r)||SE(r)||oF(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&n!==""&&i.push(n);var u=t.call(a,n,ea(r).map(function(o,f){return PF(e,t,o,f,i,r)}),i&&i.slice());return e.pop(),i&&i.pop(),u}return r}function g0e(e,t){return zo(t)?t.toList():Zn(t)?t.toMap():t.toSet()}v0e(wye);const y0e=()=>{const e=C.exports.useRef(null),t=C.exports.useRef(null),r=C.exports.useRef(null),{popup:n,setPopup:i}=OL(),{setClickedPointConfig:a}=ac(),{setLayersVisibility:u}=Js(),{setStatus:o}=Ui(),{mode:f}=oc(),{tableState:p,openTable:v}=xE();C.exports.useEffect(()=>{o(mpe[f]),u(vpe[f]),i(null),a(null)},[f]);const y=I=>{if(!I.features){i(null),a(null);return}const O=I.features[0];if(!O){i(null),a(null);return}const{lng:N}=I.lngLat;if(O.geometry.type==="Point"){const L=O.geometry.coordinates.slice();for(;Math.abs(N-L[0])>180;)L[0]+=N>L[0]?360:-360;i({features:I.features,coordinates:L})}},w=I=>{!I.features[0]||(e.current.getCanvas().style.cursor="pointer")},k=I=>{!I.features[0]||(e.current.getCanvas().style.cursor="")};C.exports.useEffect(()=>{const I=new ResizeObserver(Tge(()=>{var O;(O=e==null?void 0:e.current)==null||O.resize()},16));return t.current&&I.observe(t.current),()=>{I.disconnect()}},[t.current]),C.exports.useEffect(()=>{p.fullScreen&&!p.isOpened&&v()},[p.fullScreen]);const[T,R]=C.exports.useState(!1),A=()=>R(I=>!I);return S(dme,{children:Xe("div",{className:"w-screen h-screen relative flex overflow-hidden",children:[S(fye,{}),S(Ive,{isCollapsed:T,ref:r}),Xe("div",{className:"flex-1 h-screen flex flex-col ",children:[S("div",{ref:t,className:dd(p.fullScreen?"":"flex-1"),children:Xe(mE,{mapLib:sme,initialViewState:{latitude:55.7558,longitude:37.6173,zoom:9},dragRotate:!1,ref:e,interactiveLayerIds:[Tr["initial-match"],Tr["initial-unmatch"],Tr.approve,Tr.working,Tr.cancelled,Tr.pvz],onClick:y,onMouseEnter:w,onMouseLeave:k,id:"map",children:[n&&S(age,{lat:n.coordinates[1],lng:n.coordinates[0],features:n.features,onClose:()=>{i(null),a(null)}}),S(Qge,{toggleCollapse:A}),S(lge,{}),S(Zve,{}),S(Mge,{}),S(uge,{}),S(iye,{})]})}),S("div",{className:"w-full border-solid border-border border-0 border-t-[1px] z-20",children:S(Xge,{fullWidth:T})})]})]})})};function x0e(){return S(ame,{children:S(y0e,{})})}const _0e=new Zhe;zpe();function b0e(){return S(Jhe,{client:_0e,children:S(jU,{basename:"/",children:Xe(DU,{children:[S(Xp,{path:"/",element:S(x0e,{})}),S(Xp,{path:"/signin",element:S(eme,{})}),S(Xp,{path:"/verify-user",element:S(rme,{})}),S(Xp,{path:"/register",element:S(ome,{})})]})})})}q2.createRoot(document.getElementById("root")).render(S(tn.StrictMode,{children:S(b0e,{})}));