var H$=Object.defineProperty;var W$=(e,t,n)=>t in e?H$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var uP=(e,t,n)=>(W$(e,typeof t!="symbol"?t+"":t,n),n);function GR(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function GC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}},ar={};/** * @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 rm=Symbol.for("react.element"),G$=Symbol.for("react.portal"),q$=Symbol.for("react.fragment"),Z$=Symbol.for("react.strict_mode"),X$=Symbol.for("react.profiler"),Y$=Symbol.for("react.provider"),Q$=Symbol.for("react.context"),J$=Symbol.for("react.forward_ref"),e8=Symbol.for("react.suspense"),t8=Symbol.for("react.memo"),n8=Symbol.for("react.lazy"),cP=Symbol.iterator;function r8(e){return e===null||typeof e!="object"?null:(e=cP&&e[cP]||e["@@iterator"],typeof e=="function"?e:null)}var qR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZR=Object.assign,XR={};function vf(e,t,n){this.props=e,this.context=t,this.refs=XR,this.updater=n||qR}vf.prototype.isReactComponent={};vf.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")};vf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function YR(){}YR.prototype=vf.prototype;function qC(e,t,n){this.props=e,this.context=t,this.refs=XR,this.updater=n||qR}var ZC=qC.prototype=new YR;ZC.constructor=qC;ZR(ZC,vf.prototype);ZC.isPureReactComponent=!0;var dP=Array.isArray,QR=Object.prototype.hasOwnProperty,XC={current:null},JR={key:!0,ref:!0,__self:!0,__source:!0};function eM(e,t,n){var r,i={},s=null,c=null;if(t!=null)for(r in t.ref!==void 0&&(c=t.ref),t.key!==void 0&&(s=""+t.key),t)QR.call(t,r)&&!JR.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1>>1,Pe=oe[Te];if(0>>1;Tei(ke,Ie))Oei($e,ke)?(oe[Te]=$e,oe[Oe]=Ie,Te=Oe):(oe[Te]=ke,oe[Re]=Ie,Te=Re);else if(Oei($e,Ie))oe[Te]=$e,oe[Oe]=Ie,Te=Oe;else break e}}return ye}function i(oe,ye){var Ie=oe.sortIndex-ye.sortIndex;return Ie!==0?Ie:oe.id-ye.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,o=c.now();e.unstable_now=function(){return c.now()-o}}var f=[],p=[],v=1,y=null,w=3,P=!1,k=!1,A=!1,N=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(oe){for(var ye=n(p);ye!==null;){if(ye.callback===null)r(p);else if(ye.startTime<=oe)r(p),ye.sortIndex=ye.expirationTime,t(f,ye);else break;ye=n(p)}}function z(oe){if(A=!1,O(oe),!k)if(n(f)!==null)k=!0,ie(B);else{var ye=n(p);ye!==null&&ce(z,ye.startTime-oe)}}function B(oe,ye){k=!1,A&&(A=!1,R(j),j=-1),P=!0;var Ie=w;try{for(O(ye),y=n(f);y!==null&&(!(y.expirationTime>ye)||oe&&!se());){var Te=y.callback;if(typeof Te=="function"){y.callback=null,w=y.priorityLevel;var Pe=Te(y.expirationTime<=ye);ye=e.unstable_now(),typeof Pe=="function"?y.callback=Pe:y===n(f)&&r(f),O(ye)}else r(f);y=n(f)}if(y!==null)var De=!0;else{var Re=n(p);Re!==null&&ce(z,Re.startTime-ye),De=!1}return De}finally{y=null,w=Ie,P=!1}}var V=!1,G=null,j=-1,X=5,Y=-1;function se(){return!(e.unstable_now()-Yoe||125Te?(oe.sortIndex=Ie,t(p,oe),n(f)===null&&oe===n(p)&&(A?(R(j),j=-1):A=!0,ce(z,Ie-Te))):(oe.sortIndex=Pe,t(f,oe),k||P||(k=!0,ie(B))),oe},e.unstable_shouldYield=se,e.unstable_wrapCallback=function(oe){var ye=w;return function(){var Ie=w;w=ye;try{return oe.apply(this,arguments)}finally{w=Ie}}}})(nM);(function(e){e.exports=nM})(tM);/** * @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 rM=C.exports,Jo=tM.exports;function Ht(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vb=Object.prototype.hasOwnProperty,l8=/^[: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]*$/,hP={},pP={};function u8(e){return vb.call(pP,e)?!0:vb.call(hP,e)?!1:l8.test(e)?pP[e]=!0:(hP[e]=!0,!1)}function c8(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function d8(e,t,n,r){if(t===null||typeof t>"u"||c8(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Eo(e,t,n,r,i,s,c){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=c}var qi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qi[e]=new Eo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qi[t]=new Eo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qi[e]=new Eo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qi[e]=new Eo(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){qi[e]=new Eo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qi[e]=new Eo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qi[e]=new Eo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qi[e]=new Eo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qi[e]=new Eo(e,5,!1,e.toLowerCase(),null,!1,!1)});var QC=/[\-:]([a-z])/g;function JC(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(QC,JC);qi[t]=new Eo(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(QC,JC);qi[t]=new Eo(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(QC,JC);qi[t]=new Eo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qi[e]=new Eo(e,1,!1,e.toLowerCase(),null,!1,!1)});qi.xlinkHref=new Eo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qi[e]=new Eo(e,1,!1,e.toLowerCase(),null,!0,!0)});function eS(e,t,n,r){var i=qi.hasOwnProperty(t)?qi[t]:null;(i!==null?i.type!==0:r||!(2o||i[c]!==s[o]){var f=` `+i[c].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=c&&0<=o);break}}}finally{D_=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gh(e):""}function f8(e){switch(e.tag){case 5:return Gh(e.type);case 16:return Gh("Lazy");case 13:return Gh("Suspense");case 19:return Gh("SuspenseList");case 0:case 2:case 15:return e=L_(e.type,!1),e;case 11:return e=L_(e.type.render,!1),e;case 1:return e=L_(e.type,!0),e;default:return""}}function _b(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 Cd:return"Fragment";case wd:return"Portal";case gb:return"Profiler";case tS:return"StrictMode";case yb:return"Suspense";case xb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case aM:return(e.displayName||"Context")+".Consumer";case oM:return(e._context.displayName||"Context")+".Provider";case nS:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rS:return t=e.displayName||null,t!==null?t:_b(e.type)||"Memo";case Bl:t=e._payload,e=e._init;try{return _b(e(t))}catch{}}return null}function h8(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 _b(t);case 8:return t===tS?"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 su(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lM(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p8(e){var t=lM(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(c){r=""+c,s.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(c){r=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bv(e){e._valueTracker||(e._valueTracker=p8(e))}function uM(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=lM(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ry(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 bb(e,t){var n=t.checked;return ti({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function vP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=su(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function cM(e,t){t=t.checked,t!=null&&eS(e,"checked",t,!1)}function wb(e,t){cM(e,t);var n=su(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Cb(e,t.type,n):t.hasOwnProperty("defaultValue")&&Cb(e,t.type,su(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Cb(e,t,n){(t!=="number"||ry(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qh=Array.isArray;function $d(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Vv.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cp(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tp={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},m8=["Webkit","ms","Moz","O"];Object.keys(tp).forEach(function(e){m8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tp[t]=tp[e]})});function pM(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||tp.hasOwnProperty(e)&&tp[e]?(""+t).trim():t+"px"}function mM(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=pM(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var v8=ti({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 Pb(e,t){if(t){if(v8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ht(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ht(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ht(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ht(62))}}function Tb(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 kb=null;function iS(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ib=null,Bd=null,Vd=null;function _P(e){if(e=am(e)){if(typeof Ib!="function")throw Error(Ht(280));var t=e.stateNode;t&&(t=p0(t),Ib(e.stateNode,e.type,t))}}function vM(e){Bd?Vd?Vd.push(e):Vd=[e]:Bd=e}function gM(){if(Bd){var e=Bd,t=Vd;if(Vd=Bd=null,_P(e),t)for(e=0;e>>=0,e===0?32:31-(T8(e)/k8|0)|0}var Uv=64,jv=4194304;function Zh(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 sy(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,c=n&268435455;if(c!==0){var o=c&~i;o!==0?r=Zh(o):(s&=c,s!==0&&(r=Zh(s)))}else c=n&~i,c!==0?r=Zh(c):s!==0&&(r=Zh(s));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function im(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ja(t),e[t]=n}function A8(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=rp),IP=String.fromCharCode(32),RP=!1;function zM(e,t){switch(e){case"keyup":return aB.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FM(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sd=!1;function lB(e,t){switch(e){case"compositionend":return FM(t);case"keypress":return t.which!==32?null:(RP=!0,IP);case"textInput":return e=t.data,e===IP&&RP?null:e;default:return null}}function uB(e,t){if(Sd)return e==="compositionend"||!fS&&zM(e,t)?(e=DM(),Rg=uS=Hl=null,Sd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=OP(n)}}function UM(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?UM(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jM(){for(var e=window,t=ry();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ry(e.document)}return t}function hS(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 yB(e){var t=jM(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&UM(n.ownerDocument.documentElement,n)){if(r!==null&&hS(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=DP(n,s);var c=DP(n,r);i&&c&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ed=null,Db=null,op=null,Lb=!1;function LP(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lb||Ed==null||Ed!==ry(r)||(r=Ed,"selectionStart"in r&&hS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),op&&Ip(op,r)||(op=r,r=cy(Db,"onSelect"),0kd||(e.current=Ub[kd],Ub[kd]=null,kd--)}function jr(e,t){kd++,Ub[kd]=e.current,e.current=t}var lu={},oo=vu(lu),Oo=vu(!1),vc=lu;function Xd(e,t){var n=e.type.contextTypes;if(!n)return lu;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Do(e){return e=e.childContextTypes,e!=null}function fy(){Wr(Oo),Wr(oo)}function jP(e,t,n){if(oo.current!==lu)throw Error(Ht(168));jr(oo,t),jr(Oo,n)}function QM(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Ht(108,h8(e)||"Unknown",i));return ti({},n,r)}function hy(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lu,vc=oo.current,jr(oo,e),jr(Oo,Oo.current),!0}function KP(e,t,n){var r=e.stateNode;if(!r)throw Error(Ht(169));n?(e=QM(e,t,vc),r.__reactInternalMemoizedMergedChildContext=e,Wr(Oo),Wr(oo),jr(oo,e)):Wr(Oo),jr(Oo,n)}var js=null,m0=!1,X_=!1;function JM(e){js===null?js=[e]:js.push(e)}function RB(e){m0=!0,JM(e)}function gu(){if(!X_&&js!==null){X_=!0;var e=0,t=Er;try{var n=js;for(Er=1;e>=c,i-=c,qs=1<<32-ja(t)+i|n<j?(X=G,G=null):X=G.sibling;var Y=w(R,G,O[j],z);if(Y===null){G===null&&(G=X);break}e&&G&&Y.alternate===null&&t(R,G),M=s(Y,M,j),V===null?B=Y:V.sibling=Y,V=Y,G=X}if(j===O.length)return n(R,G),Yr&&qu(R,j),B;if(G===null){for(;jj?(X=G,G=null):X=G.sibling;var se=w(R,G,Y.value,z);if(se===null){G===null&&(G=X);break}e&&G&&se.alternate===null&&t(R,G),M=s(se,M,j),V===null?B=se:V.sibling=se,V=se,G=X}if(Y.done)return n(R,G),Yr&&qu(R,j),B;if(G===null){for(;!Y.done;j++,Y=O.next())Y=y(R,Y.value,z),Y!==null&&(M=s(Y,M,j),V===null?B=Y:V.sibling=Y,V=Y);return Yr&&qu(R,j),B}for(G=r(R,G);!Y.done;j++,Y=O.next())Y=P(G,R,j,Y.value,z),Y!==null&&(e&&Y.alternate!==null&&G.delete(Y.key===null?j:Y.key),M=s(Y,M,j),V===null?B=Y:V.sibling=Y,V=Y);return e&&G.forEach(function(ee){return t(R,ee)}),Yr&&qu(R,j),B}function N(R,M,O,z){if(typeof O=="object"&&O!==null&&O.type===Cd&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case $v:e:{for(var B=O.key,V=M;V!==null;){if(V.key===B){if(B=O.type,B===Cd){if(V.tag===7){n(R,V.sibling),M=i(V,O.props.children),M.return=R,R=M;break e}}else if(V.elementType===B||typeof B=="object"&&B!==null&&B.$$typeof===Bl&&YP(B)===V.type){n(R,V.sibling),M=i(V,O.props),M.ref=Dh(R,V,O),M.return=R,R=M;break e}n(R,V);break}else t(R,V);V=V.sibling}O.type===Cd?(M=dc(O.props.children,R.mode,z,O.key),M.return=R,R=M):(z=Fg(O.type,O.key,O.props,null,R.mode,z),z.ref=Dh(R,M,O),z.return=R,R=z)}return c(R);case wd:e:{for(V=O.key;M!==null;){if(M.key===V)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){n(R,M.sibling),M=i(M,O.children||[]),M.return=R,R=M;break e}else{n(R,M);break}else t(R,M);M=M.sibling}M=i1(O,R.mode,z),M.return=R,R=M}return c(R);case Bl:return V=O._init,N(R,M,V(O._payload),z)}if(qh(O))return k(R,M,O,z);if(Rh(O))return A(R,M,O,z);Xv(R,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(n(R,M.sibling),M=i(M,O),M.return=R,R=M):(n(R,M),M=r1(O,R.mode,z),M.return=R,R=M),c(R)):n(R,M)}return N}var Qd=sA(!0),lA=sA(!1),sm={},ps=vu(sm),Np=vu(sm),Op=vu(sm);function rc(e){if(e===sm)throw Error(Ht(174));return e}function wS(e,t){switch(jr(Op,t),jr(Np,e),jr(ps,sm),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Eb(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Eb(t,e)}Wr(ps),jr(ps,t)}function Jd(){Wr(ps),Wr(Np),Wr(Op)}function uA(e){rc(Op.current);var t=rc(ps.current),n=Eb(t,e.type);t!==n&&(jr(Np,e),jr(ps,n))}function CS(e){Np.current===e&&(Wr(ps),Wr(Np))}var Jr=vu(0);function xy(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Y_=[];function SS(){for(var e=0;en?n:4,e(!0);var r=Q_.transition;Q_.transition={};try{e(!1),t()}finally{Er=n,Q_.transition=r}}function EA(){return Ca().memoizedState}function OB(e,t,n){var r=iu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},PA(e))TA(t,n);else if(n=rA(e,t,n,r),n!==null){var i=_o();Ka(n,e,r,i),kA(n,t,r)}}function DB(e,t,n){var r=iu(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(PA(e))TA(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var c=t.lastRenderedState,o=s(c,n);if(i.hasEagerState=!0,i.eagerState=o,Wa(o,c)){var f=t.interleaved;f===null?(i.next=i,_S(t)):(i.next=f.next,f.next=i),t.interleaved=i;return}}catch{}finally{}n=rA(e,t,i,r),n!==null&&(i=_o(),Ka(n,e,r,i),kA(n,t,r))}}function PA(e){var t=e.alternate;return e===ei||t!==null&&t===ei}function TA(e,t){ap=_y=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kA(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,aS(e,n)}}var by={readContext:wa,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useInsertionEffect:to,useLayoutEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useMutableSource:to,useSyncExternalStore:to,useId:to,unstable_isNewReconciler:!1},LB={readContext:wa,useCallback:function(e,t){return ls().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:JP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Og(4194308,4,_A.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Og(4194308,4,e,t)},useInsertionEffect:function(e,t){return Og(4,2,e,t)},useMemo:function(e,t){var n=ls();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ls();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=OB.bind(null,ei,e),[r.memoizedState,e]},useRef:function(e){var t=ls();return e={current:e},t.memoizedState=e},useState:QP,useDebugValue:IS,useDeferredValue:function(e){return ls().memoizedState=e},useTransition:function(){var e=QP(!1),t=e[0];return e=NB.bind(null,e[1]),ls().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ei,i=ls();if(Yr){if(n===void 0)throw Error(Ht(407));n=n()}else{if(n=t(),$i===null)throw Error(Ht(349));(yc&30)!==0||fA(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,JP(pA.bind(null,r,s,e),[e]),r.flags|=2048,zp(9,hA.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=ls(),t=$i.identifierPrefix;if(Yr){var n=Zs,r=qs;n=(r&~(1<<32-ja(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Dp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n==="select"&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[us]=t,e[Ap]=r,zA(e,t,!1,!1),t.stateNode=e;e:{switch(c=Tb(n,r),n){case"dialog":Kr("cancel",e),Kr("close",e),i=r;break;case"iframe":case"object":case"embed":Kr("load",e),i=r;break;case"video":case"audio":for(i=0;itf&&(t.flags|=128,r=!0,Lh(s,!1),t.lanes=4194304)}else{if(!r)if(e=xy(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Lh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!Yr)return no(t),null}else 2*mi()-s.renderingStartTime>tf&&n!==1073741824&&(t.flags|=128,r=!0,Lh(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n!==null?n.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=mi(),t.sibling=null,n=Jr.current,jr(Jr,r?n&1|2:n&1),t):(no(t),null);case 22:case 23:return DS(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Zo&1073741824)!==0&&(no(t),t.subtreeFlags&6&&(t.flags|=8192)):no(t),null;case 24:return null;case 25:return null}throw Error(Ht(156,t.tag))}function KB(e,t){switch(mS(t),t.tag){case 1:return Do(t.type)&&fy(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jd(),Wr(Oo),Wr(oo),SS(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return CS(t),null;case 13:if(Wr(Jr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ht(340));Yd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wr(Jr),null;case 4:return Jd(),null;case 10:return xS(t.type._context),null;case 22:case 23:return DS(),null;case 24:return null;default:return null}}var Qv=!1,ro=!1,HB=typeof WeakSet=="function"?WeakSet:Set,En=null;function Ad(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){oi(e,t,r)}else n.current=null}function ew(e,t,n){try{n()}catch(r){oi(e,t,r)}}var lT=!1;function WB(e,t){if(zb=ly,e=jM(),hS(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var c=0,o=-1,f=-1,p=0,v=0,y=e,w=null;t:for(;;){for(var P;y!==n||i!==0&&y.nodeType!==3||(o=c+i),y!==s||r!==0&&y.nodeType!==3||(f=c+r),y.nodeType===3&&(c+=y.nodeValue.length),(P=y.firstChild)!==null;)w=y,y=P;for(;;){if(y===e)break t;if(w===n&&++p===i&&(o=c),w===s&&++v===r&&(f=c),(P=y.nextSibling)!==null)break;y=w,w=y.parentNode}y=P}n=o===-1||f===-1?null:{start:o,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(Fb={focusedElem:e,selectionRange:n},ly=!1,En=t;En!==null;)if(t=En,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,En=e;else for(;En!==null;){t=En;try{var k=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var A=k.memoizedProps,N=k.memoizedState,R=t.stateNode,M=R.getSnapshotBeforeUpdate(t.elementType===t.type?A:$a(t.type,A),N);R.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ht(163))}}catch(z){oi(t,t.return,z)}if(e=t.sibling,e!==null){e.return=t.return,En=e;break}En=t.return}return k=lT,lT=!1,k}function sp(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&ew(t,n,s)}i=i.next}while(i!==r)}}function y0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tw(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function BA(e){var t=e.alternate;t!==null&&(e.alternate=null,BA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[us],delete t[Ap],delete t[Vb],delete t[kB],delete t[IB])),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 VA(e){return e.tag===5||e.tag===3||e.tag===4}function uT(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||VA(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,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=dy));else if(r!==4&&(e=e.child,e!==null))for(nw(e,t,n),e=e.sibling;e!==null;)nw(e,t,n),e=e.sibling}function rw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(rw(e,t,n),e=e.sibling;e!==null;)rw(e,t,n),e=e.sibling}var Hi=null,Ba=!1;function Nl(e,t,n){for(n=n.child;n!==null;)UA(e,t,n),n=n.sibling}function UA(e,t,n){if(hs&&typeof hs.onCommitFiberUnmount=="function")try{hs.onCommitFiberUnmount(c0,n)}catch{}switch(n.tag){case 5:ro||Ad(n,t);case 6:var r=Hi,i=Ba;Hi=null,Nl(e,t,n),Hi=r,Ba=i,Hi!==null&&(Ba?(e=Hi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Hi.removeChild(n.stateNode));break;case 18:Hi!==null&&(Ba?(e=Hi,n=n.stateNode,e.nodeType===8?Z_(e.parentNode,n):e.nodeType===1&&Z_(e,n),Tp(e)):Z_(Hi,n.stateNode));break;case 4:r=Hi,i=Ba,Hi=n.stateNode.containerInfo,Ba=!0,Nl(e,t,n),Hi=r,Ba=i;break;case 0:case 11:case 14:case 15:if(!ro&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,c=s.destroy;s=s.tag,c!==void 0&&((s&2)!==0||(s&4)!==0)&&ew(n,t,c),i=i.next}while(i!==r)}Nl(e,t,n);break;case 1:if(!ro&&(Ad(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){oi(n,t,o)}Nl(e,t,n);break;case 21:Nl(e,t,n);break;case 22:n.mode&1?(ro=(r=ro)||n.memoizedState!==null,Nl(e,t,n),ro=r):Nl(e,t,n);break;default:Nl(e,t,n)}}function cT(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new HB),t.forEach(function(r){var i=t9.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Da(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=c),r&=~s}if(r=i,r=mi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qB(r/1960))-r,10e?16:e,Wl===null)var r=!1;else{if(e=Wl,Wl=null,Sy=0,(mr&6)!==0)throw Error(Ht(331));var i=mr;for(mr|=4,En=e.current;En!==null;){var s=En,c=s.child;if((En.flags&16)!==0){var o=s.deletions;if(o!==null){for(var f=0;fmi()-NS?cc(e,0):AS|=n),Lo(e,t)}function XA(e,t){t===0&&((e.mode&1)===0?t=1:(t=jv,jv<<=1,(jv&130023424)===0&&(jv=4194304)));var n=_o();e=rl(e,t),e!==null&&(im(e,t,n),Lo(e,n))}function e9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),XA(e,n)}function t9(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ht(314))}r!==null&&r.delete(t),XA(e,n)}var YA;YA=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oo.current)No=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return No=!1,UB(e,t,n);No=(e.flags&131072)!==0}else No=!1,Yr&&(t.flags&1048576)!==0&&eA(t,my,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dg(e,t),e=t.pendingProps;var i=Xd(t,oo.current);jd(t,n),i=PS(null,t,r,e,i,n);var s=TS();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,Do(r)?(s=!0,hy(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,bS(t),i.updater=v0,t.stateNode=i,i._reactInternals=t,Gb(t,r,e,n),t=Xb(null,t,r,!0,s,n)):(t.tag=0,Yr&&s&&pS(t),yo(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dg(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=r9(r),e=$a(r,e),i){case 0:t=Zb(null,t,r,e,n);break e;case 1:t=oT(null,t,r,e,n);break e;case 11:t=rT(null,t,r,e,n);break e;case 14:t=iT(null,t,r,$a(r.type,e),n);break e}throw Error(Ht(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$a(r,i),Zb(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$a(r,i),oT(e,t,r,i,n);case 3:e:{if(OA(t),e===null)throw Error(Ht(387));r=t.pendingProps,s=t.memoizedState,i=s.element,iA(e,t),yy(t,r,null,n);var c=t.memoizedState;if(r=c.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=ef(Error(Ht(423)),t),t=aT(e,t,r,n,i);break e}else if(r!==i){i=ef(Error(Ht(424)),t),t=aT(e,t,r,n,i);break e}else for(Xo=tu(t.stateNode.containerInfo.firstChild),Qo=t,Yr=!0,Va=null,n=lA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yd(),r===i){t=il(e,t,n);break e}yo(e,t,r,n)}t=t.child}return t;case 5:return uA(t),e===null&&Kb(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,c=i.children,$b(r,i)?c=null:s!==null&&$b(r,s)&&(t.flags|=32),NA(e,t),yo(e,t,c,n),t.child;case 6:return e===null&&Kb(t),null;case 13:return DA(e,t,n);case 4:return wS(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qd(t,null,r,n):yo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$a(r,i),rT(e,t,r,i,n);case 7:return yo(e,t,t.pendingProps,n),t.child;case 8:return yo(e,t,t.pendingProps.children,n),t.child;case 12:return yo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,c=i.value,jr(vy,r._currentValue),r._currentValue=c,s!==null)if(Wa(s.value,c)){if(s.children===i.children&&!Oo.current){t=il(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){c=s.child;for(var f=o.firstContext;f!==null;){if(f.context===r){if(s.tag===1){f=Ys(-1,n&-n),f.tag=2;var p=s.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}}s.lanes|=n,f=s.alternate,f!==null&&(f.lanes|=n),Hb(s.return,n,t),o.lanes|=n;break}f=f.next}}else if(s.tag===10)c=s.type===t.type?null:s.child;else if(s.tag===18){if(c=s.return,c===null)throw Error(Ht(341));c.lanes|=n,o=c.alternate,o!==null&&(o.lanes|=n),Hb(c,n,t),c=s.sibling}else c=s.child;if(c!==null)c.return=s;else for(c=s;c!==null;){if(c===t){c=null;break}if(s=c.sibling,s!==null){s.return=c.return,c=s;break}c=c.return}s=c}yo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,jd(t,n),i=wa(i),r=r(i),t.flags|=1,yo(e,t,r,n),t.child;case 14:return r=t.type,i=$a(r,t.pendingProps),i=$a(r.type,i),iT(e,t,r,i,n);case 15:return MA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$a(r,i),Dg(e,t),t.tag=1,Do(r)?(e=!0,hy(t)):e=!1,jd(t,n),aA(t,r,i),Gb(t,r,i,n),Xb(null,t,r,!0,e,n);case 19:return LA(e,t,n);case 22:return AA(e,t,n)}throw Error(Ht(156,t.tag))};function QA(e,t){return SM(e,t)}function n9(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _a(e,t,n,r){return new n9(e,t,n,r)}function zS(e){return e=e.prototype,!(!e||!e.isReactComponent)}function r9(e){if(typeof e=="function")return zS(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nS)return 11;if(e===rS)return 14}return 2}function ou(e,t){var n=e.alternate;return n===null?(n=_a(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Fg(e,t,n,r,i,s){var c=2;if(r=e,typeof e=="function")zS(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case Cd:return dc(n.children,i,s,t);case tS:c=8,i|=8;break;case gb:return e=_a(12,n,t,i|2),e.elementType=gb,e.lanes=s,e;case yb:return e=_a(13,n,t,i),e.elementType=yb,e.lanes=s,e;case xb:return e=_a(19,n,t,i),e.elementType=xb,e.lanes=s,e;case sM:return _0(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oM:c=10;break e;case aM:c=9;break e;case nS:c=11;break e;case rS:c=14;break e;case Bl:c=16,r=null;break e}throw Error(Ht(130,e==null?e:typeof e,""))}return t=_a(c,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function dc(e,t,n,r){return e=_a(7,e,r,t),e.lanes=n,e}function _0(e,t,n,r){return e=_a(22,e,r,t),e.elementType=sM,e.lanes=n,e.stateNode={isHidden:!1},e}function r1(e,t,n){return e=_a(6,e,null,t),e.lanes=n,e}function i1(e,t,n){return t=_a(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function i9(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=F_(0),this.expirationTimes=F_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=F_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function FS(e,t,n,r,i,s,c,o,f){return e=new i9(e,t,n,o,f),t===1?(t=1,s===!0&&(t|=8)):t=0,s=_a(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bS(s),e}function o9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=ta})(pu);const bc=GC(pu.exports),c9=GR({__proto__:null,default:bc},[pu.exports]);var yT=pu.exports;mb.createRoot=yT.createRoot,mb.hydrateRoot=yT.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 $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function f9(){return Math.random().toString(36).substr(2,8)}function _T(e,t){return{usr:e.state,key:e.key,idx:t}}function lw(e,t,n,r){return n===void 0&&(n=null),$p({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xf(t):t,{state:n,key:t&&t.key||r||f9()})}function nN(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function xf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function h9(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,o=Gl.Pop,f=null,p=v();p==null&&(p=0,c.replaceState($p({},c.state,{idx:p}),""));function v(){return(c.state||{idx:null}).idx}function y(){o=Gl.Pop;let N=v(),R=N==null?null:N-p;p=N,f&&f({action:o,location:A.location,delta:R})}function w(N,R){o=Gl.Push;let M=lw(A.location,N,R);n&&n(M,N),p=v()+1;let O=_T(M,p),z=A.createHref(M);try{c.pushState(O,"",z)}catch{i.location.assign(z)}s&&f&&f({action:o,location:A.location,delta:1})}function P(N,R){o=Gl.Replace;let M=lw(A.location,N,R);n&&n(M,N),p=v();let O=_T(M,p),z=A.createHref(M);c.replaceState(O,"",z),s&&f&&f({action:o,location:A.location,delta:0})}function k(N){let R=i.location.origin!=="null"?i.location.origin:i.location.href,M=typeof N=="string"?N:nN(N);return Ri(R,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,R)}let A={get action(){return o},get location(){return e(i,c)},listen(N){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(xT,y),f=N,()=>{i.removeEventListener(xT,y),f=null}},createHref(N){return t(i,N)},createURL:k,encodeLocation(N){let R=k(N);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:w,replace:P,go(N){return c.go(N)}};return A}var bT;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(bT||(bT={}));function p9(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?xf(t):t,i=oN(r.pathname||"/",n);if(i==null)return null;let s=rN(e);m9(s);let c=null;for(let o=0;c==null&&o{let f={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:c,route:s};f.relativePath.startsWith("/")&&(Ri(f.relativePath.startsWith(r),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(r.length));let p=fc([r,f.relativePath]),v=n.concat(f);s.children&&s.children.length>0&&(Ri(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),rN(s.children,t,v,p)),!(s.path==null&&!s.index)&&t.push({path:p,score:w9(p,s.index),routesMeta:v})};return e.forEach((s,c)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,c);else for(let f of iN(s.path))i(s,c,f)}),t}function iN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let c=iN(r.join("/")),o=[];return o.push(...c.map(f=>f===""?s:[s,f].join("/"))),i&&o.push(...c),o.map(f=>e.startsWith("/")&&f===""?"/":f)}function m9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:C9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const v9=/^:\w+$/,g9=3,y9=2,x9=1,_9=10,b9=-2,wT=e=>e==="*";function w9(e,t){let n=e.split("/"),r=n.length;return n.some(wT)&&(r+=b9),t&&(r+=y9),n.filter(i=>!wT(i)).reduce((i,s)=>i+(v9.test(s)?g9:s===""?x9:_9),r)}function C9(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function S9(e,t){let{routesMeta:n}=e,r={},i="/",s=[];for(let c=0;c{if(v==="*"){let w=o[y]||"";c=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}return p[v]=k9(o[y]||"",v),p},{}),pathname:s,pathnameBase:c,pattern:e}}function P9(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),US(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(c,o)=>(r.push(o),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function T9(e){try{return decodeURI(e)}catch(t){return US(!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 k9(e,t){try{return decodeURIComponent(e)}catch(n){return US(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function oN(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function US(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function I9(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?xf(e):e;return{pathname:n?n.startsWith("/")?n:R9(n,t):t,search:O9(r),hash:D9(i)}}function R9(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function o1(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function M9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function A9(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=xf(e):(i=$p({},e),Ri(!i.pathname||!i.pathname.includes("?"),o1("?","pathname","search",i)),Ri(!i.pathname||!i.pathname.includes("#"),o1("#","pathname","hash",i)),Ri(!i.search||!i.search.includes("#"),o1("#","search","hash",i)));let s=e===""||i.pathname==="",c=s?"/":i.pathname,o;if(r||c==null)o=n;else{let y=t.length-1;if(c.startsWith("..")){let w=c.split("/");for(;w[0]==="..";)w.shift(),y-=1;i.pathname=w.join("/")}o=y>=0?t[y]:"/"}let f=I9(i,o),p=c&&c!=="/"&&c.endsWith("/"),v=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||v)&&(f.pathname+="/"),f}const fc=e=>e.join("/").replace(/\/\/+/g,"/"),N9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,D9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function L9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const z9=["post","put","patch","delete"];[...z9];var E0={exports:{}},P0={};/** * @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 F9=C.exports,$9=Symbol.for("react.element"),B9=Symbol.for("react.fragment"),V9=Object.prototype.hasOwnProperty,U9=F9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j9={key:!0,ref:!0,__self:!0,__source:!0};function aN(e,t,n){var r,i={},s=null,c=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(c=t.ref);for(r in t)V9.call(t,r)&&!j9.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:$9,type:e,key:s,ref:c,props:i,_owner:U9.current}}P0.Fragment=B9;P0.jsx=aN;P0.jsxs=aN;(function(e){e.exports=P0})(E0);const An=E0.exports.Fragment,I=E0.exports.jsx,Qe=E0.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 uw(){return uw=Object.assign?Object.assign.bind():function(e){for(var t=1;t{i.value=r,i.getSnapshot=t,a1(i)&&s({inst:i})},[e,r,t]),G9(()=>(a1(i)&&s({inst:i}),e(()=>{a1(i)&&s({inst:i})})),[e]),Z9(r),r}function a1(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!H9(n,r)}catch{return!0}}function Y9(e,t,n){return t()}const Q9=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J9=!Q9,eV=J9?Y9:X9;"useSyncExternalStore"in ny&&(e=>e.useSyncExternalStore)(ny);const sN=C.exports.createContext(null),jS=C.exports.createContext(null),KS=C.exports.createContext(null),T0=C.exports.createContext(null),lm=C.exports.createContext({outlet:null,matches:[]}),lN=C.exports.createContext(null);function um(){return C.exports.useContext(T0)!=null}function HS(){return um()||Ri(!1),C.exports.useContext(T0).location}function uN(){um()||Ri(!1);let{basename:e,navigator:t}=C.exports.useContext(KS),{matches:n}=C.exports.useContext(lm),{pathname:r}=HS(),i=JSON.stringify(M9(n).map(o=>o.pathnameBase)),s=C.exports.useRef(!1);return C.exports.useEffect(()=>{s.current=!0}),C.exports.useCallback(function(o,f){if(f===void 0&&(f={}),!s.current)return;if(typeof o=="number"){t.go(o);return}let p=A9(o,JSON.parse(i),r,f.relative==="path");e!=="/"&&(p.pathname=p.pathname==="/"?e:fc([e,p.pathname])),(f.replace?t.replace:t.push)(p,f.state,f)},[e,t,i,r])}function tV(e,t){um()||Ri(!1);let{navigator:n}=C.exports.useContext(KS),r=C.exports.useContext(jS),{matches:i}=C.exports.useContext(lm),s=i[i.length-1],c=s?s.params:{};s&&s.pathname;let o=s?s.pathnameBase:"/";s&&s.route;let f=HS(),p;if(t){var v;let A=typeof t=="string"?xf(t):t;o==="/"||((v=A.pathname)==null?void 0:v.startsWith(o))||Ri(!1),p=A}else p=f;let y=p.pathname||"/",w=o==="/"?y:y.slice(o.length)||"/",P=p9(e,{pathname:w}),k=oV(P&&P.map(A=>Object.assign({},A,{params:Object.assign({},c,A.params),pathname:fc([o,n.encodeLocation?n.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?o:fc([o,n.encodeLocation?n.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),i,r||void 0);return t&&k?I(T0.Provider,{value:{location:uw({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Gl.Pop},children:k}):k}function nV(){let e=uV(),t=L9(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return Qe(An,{children:[I("h2",{children:"Unexpected Application Error!"}),I("h3",{style:{fontStyle:"italic"},children:t}),n?I("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},children:n}):null,null]})}class rV 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,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?I(lm.Provider,{value:this.props.routeContext,children:I(lN.Provider,{value:this.state.error,children:this.props.component})}):this.props.children}}function iV(e){let{routeContext:t,match:n,children:r}=e,i=C.exports.useContext(sN);return i&&i.static&&i.staticContext&&n.route.errorElement&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),I(lm.Provider,{value:t,children:r})}function oV(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let s=r.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id]));s>=0||Ri(!1),r=r.slice(0,Math.min(r.length,s+1))}return r.reduceRight((s,c,o)=>{let f=c.route.id?i==null?void 0:i[c.route.id]:null,p=n?c.route.errorElement||I(nV,{}):null,v=t.concat(r.slice(0,o+1)),y=()=>I(iV,{match:c,routeContext:{outlet:s,matches:v},children:f?p:c.route.element!==void 0?c.route.element:s});return n&&(c.route.errorElement||o===0)?I(rV,{location:n.location,component:p,error:f,children:y(),routeContext:{outlet:null,matches:v}}):y()},null)}var CT;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(CT||(CT={}));var Ty;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(Ty||(Ty={}));function aV(e){let t=C.exports.useContext(jS);return t||Ri(!1),t}function sV(e){let t=C.exports.useContext(lm);return t||Ri(!1),t}function lV(e){let t=sV(),n=t.matches[t.matches.length-1];return n.route.id||Ri(!1),n.route.id}function uV(){var e;let t=C.exports.useContext(lN),n=aV(Ty.UseRouteError),r=lV(Ty.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function WS(e){let{to:t,replace:n,state:r,relative:i}=e;um()||Ri(!1);let s=C.exports.useContext(jS),c=uN();return C.exports.useEffect(()=>{s&&s.navigation.state!=="idle"||c(t,{replace:n,state:r,relative:i})}),null}function $g(e){Ri(!1)}function cV(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Gl.Pop,navigator:s,static:c=!1}=e;um()&&Ri(!1);let o=t.replace(/^\/*/,"/"),f=C.exports.useMemo(()=>({basename:o,navigator:s,static:c}),[o,s,c]);typeof r=="string"&&(r=xf(r));let{pathname:p="/",search:v="",hash:y="",state:w=null,key:P="default"}=r,k=C.exports.useMemo(()=>{let A=oN(p,o);return A==null?null:{pathname:A,search:v,hash:y,state:w,key:P}},[o,p,v,y,w,P]);return k==null?null:I(KS.Provider,{value:f,children:I(T0.Provider,{children:n,value:{location:k,navigationType:i}})})}function dV(e){let{children:t,location:n}=e,r=C.exports.useContext(sN),i=r&&!t?r.router.routes:cw(t);return tV(i,n)}var ST;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(ST||(ST={}));new Promise(()=>{});function cw(e,t){t===void 0&&(t=[]);let n=[];return C.exports.Children.forEach(e,(r,i)=>{if(!C.exports.isValidElement(r))return;if(r.type===C.exports.Fragment){n.push.apply(n,cw(r.props.children,t));return}r.type!==$g&&Ri(!1),!r.props.index||!r.props.children||Ri(!1);let s=[...t,i],c={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,hasErrorBoundary:r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle};r.props.children&&(c.children=cw(r.props.children,s)),n.push(c)}),n}/** * React Router DOM v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function dw(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function fV(e,t){let n=dw(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}function hV(e){let{basename:t,children:n,window:r}=e,i=C.exports.useRef();i.current==null&&(i.current=d9({window:r,v5Compat:!0}));let s=i.current,[c,o]=C.exports.useState({action:s.action,location:s.location});return C.exports.useLayoutEffect(()=>s.listen(o),[s]),I(cV,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s})}var ET;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(ET||(ET={}));var PT;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(PT||(PT={}));function pV(e){let t=C.exports.useRef(dw(e)),n=C.exports.useRef(!1),r=HS(),i=C.exports.useMemo(()=>fV(r.search,n.current?null:t.current),[r.search]),s=uN(),c=C.exports.useCallback((o,f)=>{const p=dw(typeof o=="function"?o(i):o);n.current=!0,s("?"+p,f)},[s,i]);return[i,c]}let s1=0,TT=[];function mV(){return s1+=1,()=>{if(s1-=1,s1===0){let e=TT;TT=[];for(let t of e)t()}}}let tg=Symbol(),vV=(e,t,n,r)=>{let i={...e};i.set=(...c)=>{e[tg]=t,e.set(...c),delete e[tg]},e.setKey&&(i.setKey=(...c)=>{e[tg]=t,e.setKey(...c),delete e[tg]});let s=n(i,...r);if(s instanceof Promise){let c=mV();return s.finally(c)}return s},gV=(e,t,n)=>(...r)=>vV(e,t,n,r),go=[],_f=(e,t)=>{let n,r=[],i={lc:0,l:t||0,value:e,set(s){i.value=s,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(s){n=r;let c=!go.length;for(let o=0;o{r===n&&(r=r.slice());let o=r.indexOf(s);~o&&(r.splice(o,2),i.lc--)}},subscribe(s,c){let o=i.listen(s,c);return s(i.value),o},off(){}};return i};function yV(e,t,n){let r=new Set([...t,void 0]);return e.listen((i,s)=>{r.has(s)&&n(i,s)})}var k0={exports:{}},cN={};/** * @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 nf=C.exports;function xV(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _V=typeof Object.is=="function"?Object.is:xV,bV=nf.useState,wV=nf.useEffect,CV=nf.useLayoutEffect,SV=nf.useDebugValue;function EV(e,t){var n=t(),r=bV({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return CV(function(){i.value=n,i.getSnapshot=t,l1(i)&&s({inst:i})},[e,n,t]),wV(function(){return l1(i)&&s({inst:i}),e(function(){l1(i)&&s({inst:i})})},[e]),SV(n),n}function l1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_V(e,n)}catch{return!0}}function PV(e,t){return t()}var TV=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?PV:EV;cN.useSyncExternalStore=nf.useSyncExternalStore!==void 0?nf.useSyncExternalStore:TV;(function(e){e.exports=cN})(k0);function Bp(e,t={}){let n=C.exports.useCallback(i=>t.keys?yV(e,t.keys,i):e.listen(i),[t.keys,e]),r=e.get.bind(e);return k0.exports.useSyncExternalStore(n,r,r)}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 Ln(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RV(e,t){if(t&&(ln(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ln(e)}function ci(e){var t=IV();return function(){var r=ky(e),i;if(t){var s=ky(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return RV(this,i)}}var fN={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{},n=[];return tr.Children.forEach(e,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Zi(r)):GS.exports.isFragment(r)&&r.props?n=n.concat(Zi(r.props.children,t)):n.push(r))}),n}var IT={};function LV(e,t){}function zV(e,t,n){!t&&!IT[n]&&(e(!1,n),IT[n]=!0)}function Rr(e,t){zV(LV,e,t)}function RT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t0},e.prototype.connect_=function(){!hw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),jV?(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(){!hw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=UV.some(function(s){return!!~r.indexOf(s)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),vN=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof rf(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new QV(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 rf(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;!n.has(t)||(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new JV(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),yN=typeof WeakMap<"u"?new WeakMap:new mN,xN=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=KV.getInstance(),r=new e7(t,n,this);yN.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){xN.prototype[e]=function(){var t;return(t=yN.get(this))[e].apply(t,arguments)}});var _N=function(){return typeof Ry.ResizeObserver<"u"?Ry.ResizeObserver:xN}(),ql=new Map;function t7(e){e.forEach(function(t){var n,r=t.target;(n=ql.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var bN=new _N(t7);function n7(e,t){ql.has(e)||(ql.set(e,new Set),bN.observe(e)),ql.get(e).add(t)}function r7(e,t){ql.has(e)&&(ql.get(e).delete(t),ql.get(e).size||(bN.unobserve(e),ql.delete(e)))}var i7=function(e){ui(n,e);var t=ci(n);function n(){return zr(this,n),t.apply(this,arguments)}return Fr(n,[{key:"render",value:function(){return this.props.children}}]),n}(C.exports.Component),pw=C.exports.createContext(null);function o7(e){var t=e.children,n=e.onBatchResize,r=C.exports.useRef(0),i=C.exports.useRef([]),s=C.exports.useContext(pw),c=C.exports.useCallback(function(o,f,p){r.current+=1;var v=r.current;i.current.push({size:o,element:f,data:p}),Promise.resolve().then(function(){v===r.current&&(n==null||n(i.current),i.current=[])}),s==null||s(o,f,p)},[n,s]);return I(pw.Provider,{value:c,children:t})}function a7(e,t){var n=e.children,r=e.disabled,i=C.exports.useRef(null),s=C.exports.useRef(null),c=C.exports.useContext(pw),o=typeof n=="function",f=o?n(i):n,p=C.exports.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),v=!o&&C.exports.isValidElement(f)&&Ic(f),y=v?f.ref:null,w=C.exports.useMemo(function(){return Po(y,i)},[y,i]),P=function(){return Vp(i.current)||Vp(s.current)};C.exports.useImperativeHandle(t,function(){return P()});var k=C.exports.useRef(e);k.current=e;var A=C.exports.useCallback(function(N){var R=k.current,M=R.onResize,O=R.data,z=N.getBoundingClientRect(),B=z.width,V=z.height,G=N.offsetWidth,j=N.offsetHeight,X=Math.floor(B),Y=Math.floor(V);if(p.current.width!==X||p.current.height!==Y||p.current.offsetWidth!==G||p.current.offsetHeight!==j){var se={width:X,height:Y,offsetWidth:G,offsetHeight:j};p.current=se;var ee=G===Math.round(B)?B:G,Z=j===Math.round(V)?V:j,J=ge(ge({},se),{},{offsetWidth:ee,offsetHeight:Z});c==null||c(J,N,O),M&&Promise.resolve().then(function(){M(J,N)})}},[]);return C.exports.useEffect(function(){var N=P();return N&&!r&&n7(N,A),function(){return r7(N,A)}},[i.current,r]),I(i7,{ref:s,children:v?C.exports.cloneElement(f,{ref:w}):f})}var s7=C.exports.forwardRef(a7),l7="rc-observer-key";function u7(e,t){var n=e.children,r=typeof n=="function"?[n]:Zi(n);return r.map(function(i,s){var c=(i==null?void 0:i.key)||"".concat(l7,"-").concat(s);return C.exports.createElement(s7,{...e,key:c,ref:s===0?t:void 0},i)})}var cl=C.exports.forwardRef(u7);cl.Collection=o7;function vi(e,t){var n=ge({},e);return Array.isArray(t)&&t.forEach(function(r){delete n[r]}),n}var c7=C.exports.createContext({});const YS=c7;function d7(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function Rn(e,t){if(e==null)return{};var n=d7(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function mw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--ie){var ce=this.tryEntries[ie],oe=ce.completion;if(ce.tryLoc==="root")return ve("end");if(ce.tryLoc<=this.prev){var ye=n.call(ce,"catchLoc"),Ie=n.call(ce,"finallyLoc");if(ye&&Ie){if(this.prev=0;--ve){var ie=this.tryEntries[ve];if(ie.tryLoc<=this.prev&&n.call(ie,"finallyLoc")&&this.prev=0;--J){var ve=this.tryEntries[J];if(ve.finallyLoc===Z)return this.complete(ve.completion,ve.afterLoc),j(ve),y}},catch:function(Z){for(var J=this.tryEntries.length-1;J>=0;--J){var ve=this.tryEntries[J];if(ve.tryLoc===Z){var ie=ve.completion;if(ie.type==="throw"){var ce=ie.arg;j(ve)}return ce}}throw new Error("illegal catch attempt")},delegateYield:function(Z,J,ve){return this.delegate={iterator:Y(Z),resultName:J,nextLoc:ve},this.method==="next"&&(this.arg=void 0),y}},e}function AT(e,t,n,r,i,s,c){try{var o=e[s](c),f=o.value}catch(p){n(p);return}o.done?t(f):Promise.resolve(f).then(r,i)}function Rc(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function c(f){AT(s,r,i,c,o,"next",f)}function o(f){AT(s,r,i,c,o,"throw",f)}c(void 0)})}}function oc(){return oc=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 Bg(e,t,n){return m7()?Bg=Reflect.construct.bind():Bg=function(i,s,c){var o=[null];o.push.apply(o,s);var f=Function.bind.apply(i,o),p=new f;return c&&Up(p,c.prototype),p},Bg.apply(null,arguments)}function v7(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(r){if(r===null||!v7(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return Bg(r,arguments,gw(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Up(i,r)},yw(e)}var g7=/%[sdj%]/g,y7=function(){};typeof process<"u"&&process.env;function xw(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Yo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=s)return o;switch(o){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return o}});return c}return e}function x7(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Mi(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||x7(t)&&typeof e=="string"&&!e)}function _7(e,t,n){var r=[],i=0,s=e.length;function c(o){r.push.apply(r,o||[]),i++,i===s&&n(r)}e.forEach(function(o){t(o,c)})}function NT(e,t,n){var r=0,i=e.length;function s(c){if(c&&c.length){n(c);return}var o=r;r=r+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},Yh={integer:function(t){return Yh.number(t)&&parseInt(t,10)===t},float:function(t){return Yh.number(t)&&!Yh.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"&&!Yh.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(zT.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(P7())},hex:function(t){return typeof t=="string"&&!!t.match(zT.hex)}},T7=function(t,n,r,i,s){if(t.required&&n===void 0){CN(t,n,r,i,s);return}var c=["integer","float","array","regexp","object","method","email","number","date","url","hex"],o=t.type;c.indexOf(o)>-1?Yh[o](n)||i.push(Yo(s.messages.types[o],t.fullField,t.type)):o&&typeof n!==t.type&&i.push(Yo(s.messages.types[o],t.fullField,t.type))},k7=function(t,n,r,i,s){var c=typeof t.len=="number",o=typeof t.min=="number",f=typeof t.max=="number",p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v=n,y=null,w=typeof n=="number",P=typeof n=="string",k=Array.isArray(n);if(w?y="number":P?y="string":k&&(y="array"),!y)return!1;k&&(v=n.length),P&&(v=n.replace(p,"_").length),c?v!==t.len&&i.push(Yo(s.messages[y].len,t.fullField,t.len)):o&&!f&&vt.max?i.push(Yo(s.messages[y].max,t.fullField,t.max)):o&&f&&(vt.max)&&i.push(Yo(s.messages[y].range,t.fullField,t.min,t.max))},pd="enum",I7=function(t,n,r,i,s){t[pd]=Array.isArray(t[pd])?t[pd]:[],t[pd].indexOf(n)===-1&&i.push(Yo(s.messages[pd],t.fullField,t[pd].join(", ")))},R7=function(t,n,r,i,s){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(Yo(s.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var c=new RegExp(t.pattern);c.test(n)||i.push(Yo(s.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},or={required:CN,whitespace:E7,type:T7,range:k7,enum:I7,pattern:R7},M7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n,"string")&&!t.required)return r();or.required(t,n,i,c,s,"string"),Mi(n,"string")||(or.type(t,n,i,c,s),or.range(t,n,i,c,s),or.pattern(t,n,i,c,s),t.whitespace===!0&&or.whitespace(t,n,i,c,s))}r(c)},A7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),n!==void 0&&or.type(t,n,i,c,s)}r(c)},N7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(n===""&&(n=void 0),Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),n!==void 0&&(or.type(t,n,i,c,s),or.range(t,n,i,c,s))}r(c)},O7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),n!==void 0&&or.type(t,n,i,c,s)}r(c)},D7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),Mi(n)||or.type(t,n,i,c,s)}r(c)},L7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),n!==void 0&&(or.type(t,n,i,c,s),or.range(t,n,i,c,s))}r(c)},z7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),n!==void 0&&(or.type(t,n,i,c,s),or.range(t,n,i,c,s))}r(c)},F7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(n==null&&!t.required)return r();or.required(t,n,i,c,s,"array"),n!=null&&(or.type(t,n,i,c,s),or.range(t,n,i,c,s))}r(c)},$7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),n!==void 0&&or.type(t,n,i,c,s)}r(c)},B7="enum",V7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s),n!==void 0&&or[B7](t,n,i,c,s)}r(c)},U7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n,"string")&&!t.required)return r();or.required(t,n,i,c,s),Mi(n,"string")||or.pattern(t,n,i,c,s)}r(c)},j7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n,"date")&&!t.required)return r();if(or.required(t,n,i,c,s),!Mi(n,"date")){var f;n instanceof Date?f=n:f=new Date(n),or.type(t,f,i,c,s),f&&or.range(t,f.getTime(),i,c,s)}}r(c)},K7=function(t,n,r,i,s){var c=[],o=Array.isArray(n)?"array":typeof n;or.required(t,n,i,c,s,o),r(c)},u1=function(t,n,r,i,s){var c=t.type,o=[],f=t.required||!t.required&&i.hasOwnProperty(t.field);if(f){if(Mi(n,c)&&!t.required)return r();or.required(t,n,i,o,s,c),Mi(n,c)||or.type(t,n,i,o,s)}r(o)},H7=function(t,n,r,i,s){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Mi(n)&&!t.required)return r();or.required(t,n,i,c,s)}r(c)},cp={string:M7,method:A7,number:N7,boolean:O7,regexp:D7,integer:L7,float:z7,array:F7,object:$7,enum:V7,pattern:U7,date:j7,url:u1,hex:u1,email:u1,required:K7,any:H7};function _w(){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 bw=_w(),dm=function(){function e(n){this.rules=null,this._messages=bw,this.define(n)}var t=e.prototype;return t.define=function(r){var i=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(s){var c=r[s];i.rules[s]=Array.isArray(c)?c:[c]})},t.messages=function(r){return r&&(this._messages=LT(_w(),r)),this._messages},t.validate=function(r,i,s){var c=this;i===void 0&&(i={}),s===void 0&&(s=function(){});var o=r,f=i,p=s;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(A){var N=[],R={};function M(z){if(Array.isArray(z)){var B;N=(B=N).concat.apply(B,z)}else N.push(z)}for(var O=0;O3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!EN(e,t.slice(0,-1))?e:kN(e,t,n,r)}function B0(e){return Array.isArray(e)?q7(e):ln(e)==="object"&&e!==null?G7(e):e}function G7(e){if(Object.getPrototypeOf(e)===Object.prototype){var t={};for(var n in e)t[n]=B0(e[n]);return t}return e}function q7(e){return e.map(function(t){return B0(t)})}function pi(e){return vw(e)}function Zl(e,t){var n=EN(e,t);return n}function Fl(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=W7(e,t,n,r);return i}function FT(e,t){var n={};return t.forEach(function(r){var i=Zl(e,r);n=Fl(n,r,i)}),n}function dp(e,t){return e&&e.some(function(n){return RN(n,t)})}function $T(e){return ln(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function IN(e,t){var n=Array.isArray(e)?Et(e):ge({},e);return t&&Object.keys(t).forEach(function(r){var i=n[r],s=t[r],c=$T(i)&&$T(s);n[r]=c?IN(i,s||{}):B0(s)}),n}function Vg(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=r||n<0||n>=r)return e;var i=e[t],s=t-n;return s>0?[].concat(Et(e.slice(0,n)),[i],Et(e.slice(n,t)),Et(e.slice(t+1,r))):s<0?[].concat(Et(e.slice(0,t)),Et(e.slice(t+1,n+1)),[i],Et(e.slice(n+1,r))):e}var Y7=dm;function Q7(e,t){return e.replace(/\$\{\w+\}/g,function(n){var r=n.slice(2,-1);return t[r]})}var VT="CODE_LOGIC_ERROR";function ww(e,t,n,r,i){return Cw.apply(this,arguments)}function Cw(){return Cw=Rc(bo().mark(function e(t,n,r,i,s){var c,o,f,p,v,y,w,P,k;return bo().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return c=ge({},r),delete c.ruleIndex,c.validator&&(o=c.validator,c.validator=function(){try{return o.apply(void 0,arguments)}catch(R){return console.error(R),Promise.reject(VT)}}),f=null,c&&c.type==="array"&&c.defaultField&&(f=c.defaultField,delete c.defaultField),p=new Y7(re({},t,[c])),v=Vg({},SN,i.validateMessages),p.messages(v),y=[],N.prev=9,N.next=12,Promise.resolve(p.validate(re({},t,n),ge({},i)));case 12:N.next=17;break;case 14:N.prev=14,N.t0=N.catch(9),N.t0.errors&&(y=N.t0.errors.map(function(R,M){var O=R.message,z=O===VT?v.default:O;return C.exports.isValidElement(z)?C.exports.cloneElement(z,{key:"error_".concat(M)}):z}));case 17:if(!(!y.length&&f)){N.next=22;break}return N.next=20,Promise.all(n.map(function(R,M){return ww("".concat(t,".").concat(M),R,f,i,s)}));case 20:return w=N.sent,N.abrupt("return",w.reduce(function(R,M){return[].concat(Et(R),Et(M))},[]));case 22:return P=ge(ge({},r),{},{name:t,enum:(r.enum||[]).join(", ")},s),k=y.map(function(R){return typeof R=="string"?Q7(R,P):R}),N.abrupt("return",k);case 25:case"end":return N.stop()}},e,null,[[9,14]])})),Cw.apply(this,arguments)}function J7(e,t,n,r,i,s){var c=e.join("."),o=n.map(function(v,y){var w=v.validator,P=ge(ge({},v),{},{ruleIndex:y});return w&&(P.validator=function(k,A,N){var R=!1,M=function(){for(var B=arguments.length,V=new Array(B),G=0;G0&&arguments[0]!==void 0?arguments[0]:da;if(i.validatePromise===y){var B;i.validatePromise=null;var V=[],G=[];(B=z.forEach)===null||B===void 0||B.call(z,function(j){var X=j.rule.warningOnly,Y=j.errors,se=Y===void 0?da:Y;X?G.push.apply(G,Et(se)):V.push.apply(V,Et(se))}),i.errors=V,i.warnings=G,i.triggerMetaEvent(),i.reRender()}}),O});return i.validatePromise=y,i.dirty=!0,i.errors=da,i.warnings=da,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(ic),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 ge(ge({},i.getOnlyChild(f(i.getControlled(),p,i.props.fieldContext))),{},{isFunction:!0})}var v=Zi(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 Zl(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,P=p.normalize,k=p.valuePropName,A=p.getValueProps,N=p.fieldContext,R=y!==void 0?y:N.validateTrigger,M=i.getNamePath(),O=N.getInternalHooks,z=N.getFieldsValue,B=O(ic),V=B.dispatch,G=i.getValue(),j=A||function(ee){return re({},k,ee)},X=f[v],Y=ge(ge({},f),j(G));Y[v]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var ee,Z=arguments.length,J=new Array(Z),ve=0;ve=0&&X<=Y.length?(p.keys=[].concat(Et(p.keys.slice(0,X)),[p.id],Et(p.keys.slice(X))),M([].concat(Et(Y.slice(0,X)),[j],Et(Y.slice(X))))):(p.keys=[].concat(Et(p.keys),[p.id]),M([].concat(Et(Y),[j]))),p.id+=1},remove:function(j){var X=z(),Y=new Set(Array.isArray(j)?j:[j]);Y.size<=0||(p.keys=p.keys.filter(function(se,ee){return!Y.has(ee)}),M(X.filter(function(se,ee){return!Y.has(ee)})))},move:function(j,X){if(j!==X){var Y=z();j<0||j>=Y.length||X<0||X>=Y.length||(p.keys=BT(p.keys,j,X),M(BT(Y,j,X)))}}},V=R||[];return Array.isArray(V)||(V=[]),i(V.map(function(G,j){var X=p.keys[j];return X===void 0&&(p.keys[j]=p.id,X=p.keys[j],p.id+=1),{name:j,key:X,isListField:!0}}),B,A)}})})})};function rU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,c,o=[],f=!0,p=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);f=!0);}catch(v){p=!0,i=v}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(p)throw i}}return o}}function ze(e,t){return PN(e)||rU(e,t)||QS(e,t)||TN()}function iU(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,s){e.forEach(function(c,o){c.catch(function(f){return t=!0,f}).then(function(f){n-=1,r[o]=f,!(n>0)&&(t&&s(r),i(r))})})}):Promise.resolve([])}var NN="__@field_split__";function c1(e){return e.map(function(t){return"".concat(ln(t),":").concat(t)}).join(NN)}var md=function(){function e(){zr(this,e),this.kvs=new Map}return Fr(e,[{key:"set",value:function(n,r){this.kvs.set(c1(n),r)}},{key:"get",value:function(n){return this.kvs.get(c1(n))}},{key:"update",value:function(n,r){var i=this.get(n),s=r(i);s?this.set(n,s):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(c1(n))}},{key:"map",value:function(n){return Et(this.kvs.entries()).map(function(r){var i=ze(r,2),s=i[0],c=i[1],o=s.split(NN);return n({key:o.map(function(f){var p=f.match(/^([^:]*):(.*)$/),v=ze(p,3),y=v[1],w=v[2];return y==="number"?Number(w):w}),value:c})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,s=r.value;return n[i.join(".")]=s,null}),n}}]),e}(),oU=["name","errors"],aU=Fr(function e(t){var n=this;zr(this,e),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}},this.getInternalHooks=function(r){return r===ic?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Rr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(r){n.subscribable=r},this.prevWithoutPreserves=null,this.setInitialValues=function(r,i){if(n.initialValues=r||{},i){var s,c=Vg({},r,n.store);(s=n.prevWithoutPreserves)===null||s===void 0||s.map(function(o){var f=o.key;c=Fl(c,f,Zl(r,f))}),n.prevWithoutPreserves=null,n.updateStore(c)}},this.destroyForm=function(){var r=new md;n.getFieldEntities(!0).forEach(function(i){n.isMergedPreserve(i.isPreserve())||r.set(i.getNamePath(),!0)}),n.prevWithoutPreserves=r},this.getInitialValue=function(r){var i=Zl(n.initialValues,r);return r.length?B0(i):i},this.setCallbacks=function(r){n.callbacks=r},this.setValidateMessages=function(r){n.validateMessages=r},this.setPreserve=function(r){n.preserve=r},this.watchList=[],this.registerWatch=function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}},this.notifyWatch=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue();n.watchList.forEach(function(s){s(i,r)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(r){n.store=r},this.getFieldEntities=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities},this.getFieldsMap=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new md;return n.getFieldEntities(r).forEach(function(s){var c=s.getNamePath();i.set(c,s)}),i},this.getFieldEntitiesForNamePathList=function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(s){var c=pi(s);return i.get(c)||{INVALIDATE_NAME_PATH:pi(s)}})},this.getFieldsValue=function(r,i){if(n.warningUnhooked(),r===!0&&!i)return n.store;var s=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return s.forEach(function(o){var f,p="INVALIDATE_NAME_PATH"in o?o.INVALIDATE_NAME_PATH:o.getNamePath();if(!(!r&&((f=o.isListField)===null||f===void 0?void 0:f.call(o))))if(!i)c.push(p);else{var v="getMeta"in o?o.getMeta():null;i(v)&&c.push(p)}}),FT(n.store,c.map(pi))},this.getFieldValue=function(r){n.warningUnhooked();var i=pi(r);return Zl(n.store,i)},this.getFieldsError=function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(s,c){return s&&!("INVALIDATE_NAME_PATH"in s)?{name:s.getNamePath(),errors:s.getErrors(),warnings:s.getWarnings()}:{name:pi(r[c]),errors:[],warnings:[]}})},this.getFieldError=function(r){n.warningUnhooked();var i=pi(r),s=n.getFieldsError([i])[0];return s.errors},this.getFieldWarning=function(r){n.warningUnhooked();var i=pi(r),s=n.getFieldsError([i])[0];return s.warnings},this.isFieldsTouched=function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),s=0;s0&&arguments[0]!==void 0?arguments[0]:{},i=new md,s=n.getFieldEntities(!0);s.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 c=function(p){p.forEach(function(v){var y=v.props.initialValue;if(y!==void 0){var w=v.getNamePath(),P=n.getInitialValue(w);if(P!==void 0)Rr(!1,"Form already set 'initialValues' with path '".concat(w.join("."),"'. Field can not overwrite it."));else{var k=i.get(w);if(k&&k.size>1)Rr(!1,"Multiple Field with path '".concat(w.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(k){var A=n.getFieldValue(w);(!r.skipExist||A===void 0)&&n.updateStore(Fl(n.store,w,Et(k)[0].value))}}}})},o;r.entities?o=r.entities:r.namePathList?(o=[],r.namePathList.forEach(function(f){var p=i.get(f);if(p){var v;(v=o).push.apply(v,Et(Et(p).map(function(y){return y.entity})))}})):o=s,c(o)},this.resetFields=function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(Vg({},n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var s=r.map(pi);s.forEach(function(c){var o=n.getInitialValue(c);n.updateStore(Fl(n.store,c,o))}),n.resetWithFieldInitialValue({namePathList:s}),n.notifyObservers(i,s,{type:"reset"}),n.notifyWatch(s)},this.setFields=function(r){n.warningUnhooked();var i=n.store,s=[];r.forEach(function(c){var o=c.name;c.errors;var f=Rn(c,oU),p=pi(o);s.push(p),"value"in f&&n.updateStore(Fl(n.store,p,f.value)),n.notifyObservers(i,[p],{type:"setField",data:c})}),n.notifyWatch(s)},this.getFields=function(){var r=n.getFieldEntities(!0),i=r.map(function(s){var c=s.getNamePath(),o=s.getMeta(),f=ge(ge({},o),{},{name:c,value:n.getFieldValue(c)});return Object.defineProperty(f,"originRCField",{value:!0}),f});return i},this.initEntityValue=function(r){var i=r.props.initialValue;if(i!==void 0){var s=r.getNamePath(),c=Zl(n.store,s);c===void 0&&n.updateStore(Fl(n.store,s,i))}},this.isMergedPreserve=function(r){var i=r!==void 0?r:n.preserve;return i!=null?i:!0},this.registerField=function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var s=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(s,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(c,o){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(y){return y!==r}),!n.isMergedPreserve(o)&&(!c||f.length>1)){var p=c?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==p&&n.fieldEntities.every(function(y){return!RN(y.getNamePath(),i)})){var v=n.store;n.updateStore(Fl(v,i,p,!0)),n.notifyObservers(v,[i],{type:"remove"}),n.triggerDependenciesUpdate(v,i)}}n.notifyWatch([i])}},this.dispatch=function(r){switch(r.type){case"updateValue":{var i=r.namePath,s=r.value;n.updateValue(i,s);break}case"validateField":{var c=r.namePath,o=r.triggerName;n.validateFields([c],{triggerName:o});break}}},this.notifyObservers=function(r,i,s){if(n.subscribable){var c=ge(ge({},s),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(o){var f=o.onStoreChange;f(r,i,c)})}else n.forceRootUpdate()},this.triggerDependenciesUpdate=function(r,i){var s=n.getDependencyChildrenFields(i);return s.length&&n.validateFields(s),n.notifyObservers(r,s,{type:"dependenciesUpdate",relatedFields:[i].concat(Et(s))}),s},this.updateValue=function(r,i){var s=pi(r),c=n.store;n.updateStore(Fl(n.store,s,i)),n.notifyObservers(c,[s],{type:"valueUpdate",source:"internal"}),n.notifyWatch([s]);var o=n.triggerDependenciesUpdate(c,s),f=n.callbacks.onValuesChange;if(f){var p=FT(n.store,[s]);f(p,n.getFieldsValue())}n.triggerOnFieldsChange([s].concat(Et(o)))},this.setFieldsValue=function(r){n.warningUnhooked();var i=n.store;if(r){var s=Vg(n.store,r);n.updateStore(s)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()},this.setFieldValue=function(r,i){n.setFields([{name:r,value:i}])},this.getDependencyChildrenFields=function(r){var i=new Set,s=[],c=new md;n.getFieldEntities().forEach(function(f){var p=f.props.dependencies;(p||[]).forEach(function(v){var y=pi(v);c.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=c.get(p)||new Set;v.forEach(function(y){if(!i.has(y)){i.add(y);var w=y.getNamePath();y.isFieldDirty()&&w.length&&(s.push(w),f(w))}})};return o(r),s},this.triggerOnFieldsChange=function(r,i){var s=n.callbacks.onFieldsChange;if(s){var c=n.getFields();if(i){var o=new md;i.forEach(function(p){var v=p.name,y=p.errors;o.set(v,y)}),c.forEach(function(p){p.errors=o.get(p.name)||p.errors})}var f=c.filter(function(p){var v=p.name;return dp(r,v)});s(f,c)}},this.validateFields=function(r,i){n.warningUnhooked();var s=!!r,c=s?r.map(pi):[],o=[];n.getFieldEntities(!0).forEach(function(v){if(s||c.push(v.getNamePath()),(i==null?void 0:i.recursive)&&s){var y=v.getNamePath();y.every(function(k,A){return r[A]===k||r[A]===void 0})&&c.push(y)}if(!(!v.props.rules||!v.props.rules.length)){var w=v.getNamePath();if(!s||dp(c,w)){var P=v.validateRules(ge({validateMessages:ge(ge({},SN),n.validateMessages)},i));o.push(P.then(function(){return{name:w,errors:[],warnings:[]}}).catch(function(k){var A,N=[],R=[];return(A=k.forEach)===null||A===void 0||A.call(k,function(M){var O=M.rule.warningOnly,z=M.errors;O?R.push.apply(R,Et(z)):N.push.apply(N,Et(z))}),N.length?Promise.reject({name:w,errors:N,warnings:R}):{name:w,errors:N,warnings:R}}))}}});var f=iU(o);n.lastValidatePromise=f,f.catch(function(v){return v}).then(function(v){var y=v.map(function(w){var P=w.name;return P});n.notifyObservers(n.store,y,{type:"validateFinish"}),n.triggerOnFieldsChange(y,v)});var p=f.then(function(){return n.lastValidatePromise===f?Promise.resolve(n.getFieldsValue(c)):Promise.reject([])}).catch(function(v){var y=v.filter(function(w){return w&&w.errors.length});return Promise.reject({values:n.getFieldsValue(c),errorFields:y,outOfDate:n.lastValidatePromise!==f})});return p.catch(function(v){return v}),p},this.submit=function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(s){console.error(s)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})},this.forceRootUpdate=t});function n2(e){var t=C.exports.useRef(),n=C.exports.useState({}),r=ze(n,2),i=r[1];if(!t.current)if(e)t.current=e;else{var s=function(){i({})},c=new aU(s);t.current=c.getForm()}return[t.current]}var Pw=C.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),r2=function(t){var n=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,s=t.children,c=C.exports.useContext(Pw),o=C.exports.useRef({});return I(Pw.Provider,{value:ge(ge({},c),{},{validateMessages:ge(ge({},c.validateMessages),n),triggerFormChange:function(p,v){r&&r(p,{changedFields:v,forms:o.current}),c.triggerFormChange(p,v)},triggerFormFinish:function(p,v){i&&i(p,{values:v,forms:o.current}),c.triggerFormFinish(p,v)},registerForm:function(p,v){p&&(o.current=ge(ge({},o.current),{},re({},p,v))),c.registerForm(p,v)},unregisterForm:function(p){var v=ge({},o.current);delete v[p],o.current=v,c.unregisterForm(p)}}),children:s})},sU=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],lU=function(t,n){var r=t.name,i=t.initialValues,s=t.fields,c=t.form,o=t.preserve,f=t.children,p=t.component,v=p===void 0?"form":p,y=t.validateMessages,w=t.validateTrigger,P=w===void 0?"onChange":w,k=t.onValuesChange,A=t.onFieldsChange,N=t.onFinish,R=t.onFinishFailed,M=Rn(t,sU),O=C.exports.useContext(Pw),z=n2(c),B=ze(z,1),V=B[0],G=V.getInternalHooks(ic),j=G.useSubscribe,X=G.setInitialValues,Y=G.setCallbacks,se=G.setValidateMessages,ee=G.setPreserve,Z=G.destroyForm;C.exports.useImperativeHandle(n,function(){return V}),C.exports.useEffect(function(){return O.registerForm(r,V),function(){O.unregisterForm(r)}},[O,V,r]),se(ge(ge({},O.validateMessages),y)),Y({onValuesChange:k,onFieldsChange:function(Pe){if(O.triggerFormChange(r,Pe),A){for(var De=arguments.length,Re=new Array(De>1?De-1:0),ke=1;ke1)&&(e=1),e}function ig(e){return e<=1?"".concat(Number(e)*100,"%"):e}function ac(e){return e.length===1?"0"+e:String(e)}function CU(e,t,n){return{r:Gi(e,255)*255,g:Gi(t,255)*255,b:Gi(n,255)*255}}function WT(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),s=0,c=0,o=(r+i)/2;if(r===i)c=0,s=0;else{var f=r-i;switch(c=o>.5?f/(2-r-i):f/(r+i),r){case e:s=(t-n)/f+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function SU(e,t,n){var r,i,s;if(e=Gi(e,360),t=Gi(t,100),n=Gi(n,100),t===0)i=n,s=n,r=n;else{var c=n<.5?n*(1+t):n+t-n*t,o=2*n-c;r=d1(o,c,e+1/3),i=d1(o,c,e),s=d1(o,c,e-1/3)}return{r:r*255,g:i*255,b:s*255}}function Ay(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),s=0,c=r,o=r-i,f=r===0?0:o/r;if(r===i)s=0;else{switch(r){case e:s=(t-n)/o+(t>16,g:(e&65280)>>8,b:e&255}}var Tw={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 Ua(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,s=null,c=!1,o=!1;return typeof e=="string"&&(e=MU(e)),typeof e=="object"&&($s(e.r)&&$s(e.g)&&$s(e.b)?(t=CU(e.r,e.g,e.b),c=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):$s(e.h)&&$s(e.s)&&$s(e.v)?(r=ig(e.s),i=ig(e.v),t=EU(e.h,r,i),c=!0,o="hsv"):$s(e.h)&&$s(e.s)&&$s(e.l)&&(r=ig(e.s),s=ig(e.l),t=SU(e.h,r,s),c=!0,o="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=$N(n),{ok:c,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:n}}var IU="[-\\+]?\\d+%?",RU="[-\\+]?\\d*\\.\\d+%?",Xl="(?:".concat(RU,")|(?:").concat(IU,")"),f1="[\\s|\\(]+(".concat(Xl,")[,|\\s]+(").concat(Xl,")[,|\\s]+(").concat(Xl,")\\s*\\)?"),h1="[\\s|\\(]+(".concat(Xl,")[,|\\s]+(").concat(Xl,")[,|\\s]+(").concat(Xl,")[,|\\s]+(").concat(Xl,")\\s*\\)?"),za={CSS_UNIT:new RegExp(Xl),rgb:new RegExp("rgb"+f1),rgba:new RegExp("rgba"+h1),hsl:new RegExp("hsl"+f1),hsla:new RegExp("hsla"+h1),hsv:new RegExp("hsv"+f1),hsva:new RegExp("hsva"+h1),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 MU(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Tw[e])e=Tw[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=za.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=za.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=za.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=za.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=za.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=za.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=za.hex8.exec(e),n?{r:qo(n[1]),g:qo(n[2]),b:qo(n[3]),a:GT(n[4]),format:t?"name":"hex8"}:(n=za.hex6.exec(e),n?{r:qo(n[1]),g:qo(n[2]),b:qo(n[3]),format:t?"name":"hex"}:(n=za.hex4.exec(e),n?{r:qo(n[1]+n[1]),g:qo(n[2]+n[2]),b:qo(n[3]+n[3]),a:GT(n[4]+n[4]),format:t?"name":"hex8"}:(n=za.hex3.exec(e),n?{r:qo(n[1]+n[1]),g:qo(n[2]+n[2]),b:qo(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function $s(e){return Boolean(za.CSS_UNIT.exec(String(e)))}var p1=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=kU(t)),this.originalInput=t;var i=Ua(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,s=t.r/255,c=t.g/255,o=t.b/255;return s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),c<=.03928?r=c/12.92:r=Math.pow((c+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=$N(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=Ay(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=Ay(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=WT(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=WT(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Ny(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),PU(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Gi(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Gi(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Ny(this.r,this.g,this.b,!1),n=0,r=Object.entries(Tw);n=0,s=!n&&i&&(t.startsWith("hex")||t==="name");return s?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=rg(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=rg(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=rg(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=rg(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),s=n/100,c={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a};return new e(c)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,s=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,s.push(new e(r));return s},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,s=n.v,c=[],o=1/t;t--;)c.push(new e({h:r,s:i,v:s})),s=(s+o)%1;return c},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],s=360/t,c=1;c=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-og*t:Math.round(e.h)+og*t:r=n?Math.round(e.h)+og*t:Math.round(e.h)-og*t,r<0?r+=360:r>=360&&(r-=360),r}function YT(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-qT*t:t===VN?r=e.s+qT:r=e.s+AU*t,r>1&&(r=1),n&&t===BN&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function QT(e,t,n){var r;return n?r=e.v+NU*t:r=e.v-OU*t,r>1&&(r=1),Number(r.toFixed(2))}function jp(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Ua(e),i=BN;i>0;i-=1){var s=ZT(r),c=ag(Ua({h:XT(s,i,!0),s:YT(s,i,!0),v:QT(s,i,!0)}));n.push(c)}n.push(ag(r));for(var o=1;o<=VN;o+=1){var f=ZT(r),p=ag(Ua({h:XT(f,o),s:YT(f,o),v:QT(f,o)}));n.push(p)}return t.theme==="dark"?DU.map(function(v){var y=v.index,w=v.opacity,P=ag(LU(Ua(t.backgroundColor||"#141414"),Ua(n[y]),w*100));return P}):n}var m1={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"},v1={},g1={};Object.keys(m1).forEach(function(e){v1[e]=jp(m1[e]),v1[e].primary=v1[e][5],g1[e]=jp(m1[e],{theme:"dark",backgroundColor:"#141414"}),g1[e].primary=g1[e][5]});function wo(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function hc(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var JT="data-rc-order",zU="rc-util-key",kw=new Map;function UN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):zU}function V0(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function FU(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function jN(e){return Array.from((kw.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function KN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!wo())return null;var n=t.csp,r=t.prepend,i=document.createElement("style");i.setAttribute(JT,FU(r)),n!=null&&n.nonce&&(i.nonce=n==null?void 0:n.nonce),i.innerHTML=e;var s=V0(t),c=s.firstChild;if(r){if(r==="queue"){var o=jN(s).filter(function(f){return["prepend","prependQueue"].includes(f.getAttribute(JT))});if(o.length)return s.insertBefore(i,o[o.length-1].nextSibling),i}s.insertBefore(i,c)}else s.appendChild(i);return i}function HN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=V0(t);return jN(n).find(function(r){return r.getAttribute(UN(t))===e})}function ek(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=HN(e,t);if(n){var r=V0(t);r.removeChild(n)}}function $U(e,t){var n=kw.get(e);if(!n||!hc(document,n)){var r=KN("",t),i=r.parentNode;kw.set(e,i),e.removeChild(r)}}function hm(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=V0(n);$U(r,n);var i=HN(t,n);if(i){var s,c;if((s=n.csp)!==null&&s!==void 0&&s.nonce&&i.nonce!==((c=n.csp)===null||c===void 0?void 0:c.nonce)){var o;i.nonce=(o=n.csp)===null||o===void 0?void 0:o.nonce}return i.innerHTML!==e&&(i.innerHTML=e),i}var f=KN(e,n);return f.setAttribute(UN(n),t),f}function BU(e,t){Rr(e,"[@ant-design/icons] ".concat(t))}function tk(e){return ln(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(ln(e.icon)==="object"||typeof e.icon=="function")}function nk(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t},{})}function Iw(e,t,n){return n?tr.createElement(e.tag,ge(ge({key:t},nk(e.attrs)),n),(e.children||[]).map(function(r,i){return Iw(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):tr.createElement(e.tag,ge({key:t},nk(e.attrs)),(e.children||[]).map(function(r,i){return Iw(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function WN(e){return jp(e)[0]}function GN(e){return e?Array.isArray(e)?e:[e]:[]}var VU=` .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); } } `,UU=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VU,n=C.exports.useContext(YS),r=n.csp;C.exports.useEffect(function(){hm(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},jU=["icon","className","onClick","style","primaryColor","secondaryColor"],fp={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function KU(e){var t=e.primaryColor,n=e.secondaryColor;fp.primaryColor=t,fp.secondaryColor=n||WN(t),fp.calculated=!!n}function HU(){return ge({},fp)}var U0=function(t){var n=t.icon,r=t.className,i=t.onClick,s=t.style,c=t.primaryColor,o=t.secondaryColor,f=Rn(t,jU),p=fp;if(c&&(p={primaryColor:c,secondaryColor:o||WN(c)}),UU(),BU(tk(n),"icon should be icon definiton, but got ".concat(n)),!tk(n))return null;var v=n;return v&&typeof v.icon=="function"&&(v=ge(ge({},v),{},{icon:v.icon(p.primaryColor,p.secondaryColor)})),Iw(v.icon,"svg-".concat(v.name),ge({className:r,onClick:i,style:s,"data-icon":v.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f))};U0.displayName="IconReact";U0.getTwoToneColors=HU;U0.setTwoToneColors=KU;const o2=U0;function qN(e){var t=GN(e),n=ze(t,2),r=n[0],i=n[1];return o2.setTwoToneColors({primaryColor:r,secondaryColor:i})}function WU(){var e=o2.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var GU=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];qN("#1890ff");var j0=C.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,s=e.spin,c=e.rotate,o=e.tabIndex,f=e.onClick,p=e.twoToneColor,v=Rn(e,GU),y=C.exports.useContext(YS),w=y.prefixCls,P=w===void 0?"anticon":w,k=y.rootClassName,A=Xe(k,P,(n={},re(n,"".concat(P,"-").concat(i.name),!!i.name),re(n,"".concat(P,"-spin"),!!s||i.name==="loading"),n),r),N=o;N===void 0&&f&&(N=-1);var R=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,M=GN(p),O=ze(M,2),z=O[0],B=O[1];return I("span",{...ge(ge({role:"img","aria-label":i.name},v),{},{ref:t,tabIndex:N,onClick:f,className:A}),children:I(o2,{icon:i,primaryColor:z,secondaryColor:B,style:R})})});j0.displayName="AntdIcon";j0.getTwoToneColor=WU;j0.setTwoToneColor=qN;const cr=j0;var ZN=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:_U})})};ZN.displayName="CheckCircleFilled";const a2=C.exports.forwardRef(ZN);var qU={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 ZU=qU;var XN=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:ZU})})};XN.displayName="CloseCircleFilled";const wf=C.exports.forwardRef(XN);var XU={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 YU=XU;var YN=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:YU})})};YN.displayName="ExclamationCircleFilled";const s2=C.exports.forwardRef(YN);var QU={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 JU=QU;var QN=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:JU})})};QN.displayName="InfoCircleFilled";const JN=C.exports.forwardRef(QN);var ej={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 tj=ej;var eO=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:tj})})};eO.displayName="LoadingOutlined";const of=C.exports.forwardRef(eO);var pm=ge({},c9),nj=pm.version,rj=pm.render,ij=pm.unmountComponentAtNode,K0;try{var oj=Number((nj||"").split(".")[0]);oj>=18&&(K0=pm.createRoot)}catch{}function rk(e){var t=pm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&ln(t)==="object"&&(t.usingClientEntryPoint=e)}var Oy="__rc_react_root__";function aj(e,t){rk(!0);var n=t[Oy]||K0(t);rk(!1),n.render(e),t[Oy]=n}function sj(e,t){rj(e,t)}function tO(e,t){if(K0){aj(e,t);return}sj(e,t)}function lj(e){return Rw.apply(this,arguments)}function Rw(){return Rw=Rc(bo().mark(function e(t){return bo().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=t[Oy])===null||i===void 0||i.unmount(),delete t[Oy]}));case 1:case"end":return r.stop()}},e)})),Rw.apply(this,arguments)}function uj(e){ij(e)}function nO(e){return Mw.apply(this,arguments)}function Mw(){return Mw=Rc(bo().mark(function e(t){return bo().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(K0===void 0){r.next=2;break}return r.abrupt("return",lj(t));case 2:uj(t);case 3:case"end":return r.stop()}},e)})),Mw.apply(this,arguments)}function ik(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function cj(e,t){var n={animationend:ik("Animation","AnimationEnd"),transitionend:ik("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var dj=cj(wo(),typeof window<"u"?window:{}),rO={};if(wo()){var fj=document.createElement("div");rO=fj.style}var sg={};function iO(e){if(sg[e])return sg[e];var t=dj[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:1;uk+=1;var r=uk;function i(s){if(s===0)cO(r),t();else{var c=lO(function(){i(s-1)});u2.set(r,c)}}return i(n),r};nr.cancel=function(e){var t=u2.get(e);return cO(t),uO(t)};const hj=function(){var e=C.exports.useRef(null);function t(){nr.cancel(e.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var s=nr(function(){i<=1?r({isCanceled:function(){return s!==e.current}}):n(r,i-1)});e.current=s}return C.exports.useEffect(function(){return function(){t()}},[]),[n,t]};var dO=wo()?C.exports.useLayoutEffect:C.exports.useEffect,ck=[Ks,Od,Dd,l2],fO=!1,pj=!0;function hO(e){return e===Dd||e===l2}const mj=function(e,t){var n=ms(lk),r=ze(n,2),i=r[0],s=r[1],c=hj(),o=ze(c,2),f=o[0],p=o[1];function v(){s(Ks,!0)}return dO(function(){if(i!==lk&&i!==l2){var y=ck.indexOf(i),w=ck[y+1],P=t(i);P===fO?s(w,!0):f(function(k){function A(){k.isCanceled()||s(w,!0)}P===!0?A():Promise.resolve(P).then(A)})}},[e,i]),C.exports.useEffect(function(){return function(){p()}},[]),[v,i]},vj=function(e){var t=C.exports.useRef(),n=C.exports.useRef(e);n.current=e;var r=C.exports.useCallback(function(c){n.current(c)},[]);function i(c){c&&(c.removeEventListener(ak,r),c.removeEventListener(ok,r))}function s(c){t.current&&t.current!==c&&i(t.current),c&&c!==t.current&&(c.addEventListener(ak,r),c.addEventListener(ok,r),t.current=c)}return C.exports.useEffect(function(){return function(){i(t.current)}},[]),[s,i]};function gj(e,t,n,r){var i=r.motionEnter,s=i===void 0?!0:i,c=r.motionAppear,o=c===void 0?!0:c,f=r.motionLeave,p=f===void 0?!0:f,v=r.motionDeadline,y=r.motionLeaveImmediately,w=r.onAppearPrepare,P=r.onEnterPrepare,k=r.onLeavePrepare,A=r.onAppearStart,N=r.onEnterStart,R=r.onLeaveStart,M=r.onAppearActive,O=r.onEnterActive,z=r.onLeaveActive,B=r.onAppearEnd,V=r.onEnterEnd,G=r.onLeaveEnd,j=r.onVisibleChanged,X=ms(),Y=ze(X,2),se=Y[0],ee=Y[1],Z=ms(_d),J=ze(Z,2),ve=J[0],ie=J[1],ce=ms(null),oe=ze(ce,2),ye=oe[0],Ie=oe[1],Te=C.exports.useRef(!1),Pe=C.exports.useRef(null);function De(){return n()}var Re=C.exports.useRef(!1);function ke(yt){var Mt=De();if(!(yt&&!yt.deadline&&yt.target!==Mt)){var ut=Re.current,dt;ve===lg&&ut?dt=B==null?void 0:B(Mt,yt):ve===ug&&ut?dt=V==null?void 0:V(Mt,yt):ve===cg&&ut&&(dt=G==null?void 0:G(Mt,yt)),ve!==_d&&ut&&dt!==!1&&(ie(_d,!0),Ie(null,!0))}}var Oe=vj(ke),$e=ze(Oe,1),He=$e[0],Ue=C.exports.useMemo(function(){var yt,Mt,ut;switch(ve){case lg:return yt={},re(yt,Ks,w),re(yt,Od,A),re(yt,Dd,M),yt;case ug:return Mt={},re(Mt,Ks,P),re(Mt,Od,N),re(Mt,Dd,O),Mt;case cg:return ut={},re(ut,Ks,k),re(ut,Od,R),re(ut,Dd,z),ut;default:return{}}},[ve]),st=mj(ve,function(yt){if(yt===Ks){var Mt=Ue[Ks];return Mt?Mt(De()):fO}if(We in Ue){var ut;Ie(((ut=Ue[We])===null||ut===void 0?void 0:ut.call(Ue,De(),null))||null)}return We===Dd&&(He(De()),v>0&&(clearTimeout(Pe.current),Pe.current=setTimeout(function(){ke({deadline:!0})},v))),pj}),ft=ze(st,2),It=ft[0],We=ft[1],Pt=hO(We);Re.current=Pt,dO(function(){ee(t);var yt=Te.current;if(Te.current=!0,!!e){var Mt;!yt&&t&&o&&(Mt=lg),yt&&t&&s&&(Mt=ug),(yt&&!t&&p||!yt&&y&&!t&&p)&&(Mt=cg),Mt&&(ie(Mt),It())}},[t]),C.exports.useEffect(function(){(ve===lg&&!o||ve===ug&&!s||ve===cg&&!p)&&ie(_d)},[o,s,p]),C.exports.useEffect(function(){return function(){Te.current=!1,clearTimeout(Pe.current)}},[]);var pt=C.exports.useRef(!1);C.exports.useEffect(function(){se&&(pt.current=!0),se!==void 0&&ve===_d&&((pt.current||se)&&(j==null||j(se)),pt.current=!0)},[se,ve]);var Rt=ye;return Ue[Ks]&&We===Od&&(Rt=ge({transition:"none"},Rt)),[ve,We,Rt,se!=null?se:t]}var yj=function(e){ui(n,e);var t=ci(n);function n(){return zr(this,n),t.apply(this,arguments)}return Fr(n,[{key:"render",value:function(){return this.props.children}}]),n}(C.exports.Component);function xj(e){var t=e;ln(e)==="object"&&(t=e.transitionSupport);function n(i){return!!(i.motionName&&t)}var r=C.exports.forwardRef(function(i,s){var c=i.visible,o=c===void 0?!0:c,f=i.removeOnLeave,p=f===void 0?!0:f,v=i.forceRender,y=i.children,w=i.motionName,P=i.leavedClassName,k=i.eventProps,A=n(i),N=C.exports.useRef(),R=C.exports.useRef();function M(){try{return N.current instanceof HTMLElement?N.current:Vp(R.current)}catch{return null}}var O=gj(A,o,M,i),z=ze(O,4),B=z[0],V=z[1],G=z[2],j=z[3],X=C.exports.useRef(j);j&&(X.current=!0);var Y=C.exports.useCallback(function(ce){N.current=ce,Iy(s,ce)},[s]),se,ee=ge(ge({},k),{},{visible:o});if(!y)se=null;else if(B===_d||!n(i))j?se=y(ge({},ee),Y):!p&&X.current&&P?se=y(ge(ge({},ee),{},{className:P}),Y):v||!p&&!P?se=y(ge(ge({},ee),{},{style:{display:"none"}}),Y):se=null;else{var Z,J;V===Ks?J="prepare":hO(V)?J="active":V===Od&&(J="start"),se=y(ge(ge({},ee),{},{className:Xe(sk(w,B),(Z={},re(Z,sk(w,"".concat(B,"-").concat(J)),J),re(Z,w,typeof w=="string"),Z)),style:G}),Y)}if(C.exports.isValidElement(se)&&Ic(se)){var ve=se,ie=ve.ref;ie||(se=C.exports.cloneElement(se,{ref:Y}))}return I(yj,{ref:R,children:se})});return r.displayName="CSSMotion",r}const Sa=xj(sO);var Aw="add",Nw="keep",Ow="remove",y1="removed";function _j(e){var t;return e&&ln(e)==="object"&&"key"in e?t=e:t={key:e},ge(ge({},t),{},{key:String(t.key)})}function Dw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(_j)}function bj(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=t.length,s=Dw(e),c=Dw(t);s.forEach(function(p){for(var v=!1,y=r;y1});return f.forEach(function(p){n=n.filter(function(v){var y=v.key,w=v.status;return y!==p||w!==Ow}),n.forEach(function(v){v.key===p&&(v.status=Nw)})}),n}var wj=["component","children","onVisibleChanged","onAllRemoved"],Cj=["status"],Sj=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Ej(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sa,n=function(r){ui(s,r);var i=ci(s);function s(){var c;zr(this,s);for(var o=arguments.length,f=new Array(o),p=0;p=w&&(y.key=N[0].notice.key,y.updateMark=fk(),y.userPassKey=v,N.shift()),N.push({notice:y,holderCallback:f})),{notices:N}})},r.remove=function(o){r.setState(function(f){var p=f.notices;return{notices:p.filter(function(v){var y=v.notice,w=y.key,P=y.userPassKey,k=P!=null?P:w;return k!==o})}})},r.noticePropsMap={},r}return Fr(n,[{key:"getTransitionName",value:function(){var i=this.props,s=i.prefixCls,c=i.animation,o=this.props.transitionName;return!o&&c&&(o="".concat(s,"-").concat(c)),o}},{key:"render",value:function(){var i=this,s=this.state.notices,c=this.props,o=c.prefixCls,f=c.className,p=c.closeIcon,v=c.style,y=[];return s.forEach(function(w,P){var k=w.notice,A=w.holderCallback,N=P===s.length-1?k.updateMark:void 0,R=k.key,M=k.userPassKey,O=ge(ge(ge({prefixCls:o,closeIcon:p},k),k.props),{},{key:R,noticeKey:M||R,updateMark:N,onClose:function(B){var V;i.remove(B),(V=k.onClose)===null||V===void 0||V.call(k)},onClick:k.onClick,children:k.content});y.push(R),i.noticePropsMap[R]={props:O,holderCallback:A}}),I("div",{className:Xe(o,f),style:v,children:I(pO,{keys:y,motionName:this.getTransitionName(),onVisibleChanged:function(P,k){var A=k.key;P||delete i.noticePropsMap[A]},children:function(w){var P=w.key,k=w.className,A=w.style,N=w.visible,R=i.noticePropsMap[P],M=R.props,O=R.holderCallback;return O?I("div",{className:Xe(k,"".concat(o,"-hook-holder")),style:ge({},A),ref:function(B){typeof P>"u"||(B?(i.hookRefs.set(P,B),O(B,M)):i.hookRefs.delete(P))}},P):I(c2,{...M,className:Xe(k,M==null?void 0:M.className),style:ge(ge({},A),M==null?void 0:M.style),visible:N})}})})}}]),n}(C.exports.Component);af.newInstance=void 0;af.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}};af.newInstance=function(t,n){var r=t||{},i=r.getContainer,s=Rn(r,Pj),c=document.createElement("div");if(i){var o=i();o.appendChild(c)}else document.body.appendChild(c);var f=!1;function p(v){f||(f=!0,n({notice:function(w){v.add(w)},removeNotice:function(w){v.remove(w)},component:v,destroy:function(){nO(c),c.parentNode&&c.parentNode.removeChild(c)},useNotification:function(){return d2(v)}}))}tO(I(af,{...s,ref:p}),c)};function kj(e,t){var n=function(){var i,s,c=null,o={add:function(A,N){c==null||c.component.add(A,N)}},f=d2(o),p=ze(f,2),v=p[0],y=p[1];function w(k){var A=k.prefixCls,N=i("message",A),R=i(),M=k.key||wO(),O=new Promise(function(B){var V=function(){return typeof k.onClose=="function"&&k.onClose(),B(!0)};e(tt(tt({},k),{prefixCls:N,rootPrefixCls:R,getPopupContainer:s}),function(G){var j=G.prefixCls,X=G.instance;c=X,v(t(tt(tt({},k),{key:M,onClose:V}),j))})}),z=function(){c&&c.removeNotice(M)};return z.then=function(B,V){return O.then(B,V)},z.promise=O,z}var P=C.exports.useRef({});return P.current.open=w,EO.forEach(function(k){return TO(P.current,k)}),[P.current,I(yu,{children:function(k){return i=k.getPrefixCls,s=k.getPopupContainer,y}},"holder")]};return n}var xo,mO=3,vO,Ij=1,gO="",Lw="move-up",yO=!1,xO,_O,bO=!1;function wO(){return Ij++}function Rj(e){e.top!==void 0&&(vO=e.top,xo=null),e.duration!==void 0&&(mO=e.duration),e.prefixCls!==void 0&&(gO=e.prefixCls),e.getContainer!==void 0&&(xO=e.getContainer,xo=null),e.transitionName!==void 0&&(Lw=e.transitionName,xo=null,yO=!0),e.maxCount!==void 0&&(_O=e.maxCount,xo=null),e.rtl!==void 0&&(bO=e.rtl)}function CO(e,t){var n=e.prefixCls,r=e.getPopupContainer,i=m2(),s=i.getPrefixCls,c=i.getRootPrefixCls,o=i.getIconPrefixCls,f=s("message",n||gO),p=c(e.rootPrefixCls,f),v=o();if(xo){t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:xo});return}var y={prefixCls:f,transitionName:yO?Lw:"".concat(p,"-").concat(Lw),style:{top:vO},getContainer:xO||r,maxCount:_O};af.newInstance(y,function(w){if(xo){t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:xo});return}xo=w,t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:w})})}var SO={info:JN,success:a2,error:wf,warning:s2,loading:of},EO=Object.keys(SO);function PO(e,t,n){var r,i=e.duration!==void 0?e.duration:mO,s=SO[e.type],c=Xe("".concat(t,"-custom-content"),(r={},re(r,"".concat(t,"-").concat(e.type),e.type),re(r,"".concat(t,"-rtl"),bO===!0),r));return{key:e.key,duration:i,style:e.style||{},className:e.className,content:I(Cf,{iconPrefixCls:n,children:Qe("div",{className:c,children:[e.icon||s&&I(s,{}),I("span",{children:e.content})]})}),onClose:e.onClose,onClick:e.onClick}}function Mj(e){var t=e.key||wO(),n=new Promise(function(i){var s=function(){return typeof e.onClose=="function"&&e.onClose(),i(!0)};CO(e,function(c){var o=c.prefixCls,f=c.iconPrefixCls,p=c.instance;p.notice(PO(tt(tt({},e),{key:t,onClose:s}),o,f))})}),r=function(){var s;xo&&(xo.removeNotice(t),(s=e.onClose)===null||s===void 0||s.call(e))};return r.then=function(i,s){return n.then(i,s)},r.promise=n,r}function Aj(e){return Object.prototype.toString.call(e)==="[object Object]"&&!!e.content}var Kp={open:Mj,config:Rj,destroy:function(t){if(xo)if(t){var n=xo,r=n.removeNotice;r(t)}else{var i=xo,s=i.destroy;s(),xo=null}}};function TO(e,t){e[t]=function(n,r,i){return Aj(n)?e.open(tt(tt({},n),{type:t})):(typeof r=="function"&&(i=r,r=void 0),e.open({content:n,duration:r,type:t,onClose:i}))}}EO.forEach(function(e){return TO(Kp,e)});Kp.warn=Kp.warning;Kp.useMessage=kj(CO,PO);const Nj=Kp;var Oj={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 Dj=Oj;var kO=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:Dj})})};kO.displayName="CheckCircleOutlined";const f2=C.exports.forwardRef(kO);var Lj={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 zj=Lj;var IO=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:zj})})};IO.displayName="CloseCircleOutlined";const h2=C.exports.forwardRef(IO);var Fj={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 $j=Fj;var RO=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:$j})})};RO.displayName="CloseOutlined";const H0=C.exports.forwardRef(RO);var Bj={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 Vj=Bj;var MO=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:Vj})})};MO.displayName="ExclamationCircleOutlined";const W0=C.exports.forwardRef(MO);var Uj={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 jj=Uj;var AO=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:jj})})};AO.displayName="InfoCircleOutlined";const p2=C.exports.forwardRef(AO);function Kj(e,t){var n=function(){var i,s=null,c={add:function(k,A){s==null||s.component.add(k,A)}},o=d2(c),f=ze(o,2),p=f[0],v=f[1];function y(P){var k=P.prefixCls,A=i("notification",k);e(tt(tt({},P),{prefixCls:A}),function(N){var R=N.prefixCls,M=N.instance;s=M,p(t(P,R))})}var w=C.exports.useRef({});return w.current.open=y,["success","info","warning","error"].forEach(function(P){w.current[P]=function(k){return w.current.open(tt(tt({},k),{type:P}))}}),[w.current,I(yu,{children:function(P){return i=P.getPrefixCls,v}},"holder")]};return n}globalThis&&globalThis.__awaiter;var ec={},NO=4.5,OO=24,DO=24,LO="",zw="topRight",zO,FO,$O=!1,BO;function Hj(e){var t=e.duration,n=e.placement,r=e.bottom,i=e.top,s=e.getContainer,c=e.closeIcon,o=e.prefixCls;o!==void 0&&(LO=o),t!==void 0&&(NO=t),n!==void 0?zw=n:e.rtl&&(zw="topLeft"),r!==void 0&&(DO=r),i!==void 0&&(OO=i),s!==void 0&&(zO=s),c!==void 0&&(FO=c),e.rtl!==void 0&&($O=e.rtl),e.maxCount!==void 0&&(BO=e.maxCount)}function Wj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:OO,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:DO,r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n};break}return r}function VO(e,t){var n=e.placement,r=n===void 0?zw:n,i=e.top,s=e.bottom,c=e.getContainer,o=c===void 0?zO:c,f=e.prefixCls,p=m2(),v=p.getPrefixCls,y=p.getIconPrefixCls,w=v("notification",f||LO),P=y(),k="".concat(w,"-").concat(r),A=ec[k];if(A){Promise.resolve(A).then(function(R){t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:P,instance:R})});return}var N=Xe("".concat(w,"-").concat(r),re({},"".concat(w,"-rtl"),$O===!0));ec[k]=new Promise(function(R){af.newInstance({prefixCls:w,className:N,style:Wj(r,i,s),getContainer:o,maxCount:BO},function(M){R(M),t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:P,instance:M})})})}var Gj={success:f2,info:p2,error:h2,warning:W0};function UO(e,t,n){var r=e.duration,i=e.icon,s=e.type,c=e.description,o=e.message,f=e.btn,p=e.onClose,v=e.onClick,y=e.key,w=e.style,P=e.className,k=e.closeIcon,A=k===void 0?FO:k,N=e.props,R=r===void 0?NO:r,M=null;i?M=I("span",{className:"".concat(t,"-icon"),children:e.icon}):s&&(M=C.exports.createElement(Gj[s]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(s)}));var O=I("span",{className:"".concat(t,"-close-x"),children:A||I(H0,{className:"".concat(t,"-close-icon")})}),z=!c&&M?I("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:I(Cf,{iconPrefixCls:n,children:Qe("div",{className:M?"".concat(t,"-with-icon"):"",role:"alert",children:[M,Qe("div",{className:"".concat(t,"-message"),children:[z,o]}),I("div",{className:"".concat(t,"-description"),children:c}),f?I("span",{className:"".concat(t,"-btn"),children:f}):null]})}),duration:R,closable:!0,closeIcon:O,onClose:p,onClick:v,key:y,style:w||{},className:Xe(P,re({},"".concat(t,"-").concat(s),!!s)),props:N}}function qj(e){VO(e,function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.instance;i.notice(UO(e,n,r))})}var sf={open:qj,close:function(t){Object.keys(ec).forEach(function(n){return Promise.resolve(ec[n]).then(function(r){r.removeNotice(t)})})},config:Hj,destroy:function(){Object.keys(ec).forEach(function(t){Promise.resolve(ec[t]).then(function(n){n.destroy()}),delete ec[t]})}};["success","info","warning","error"].forEach(function(e){sf[e]=function(t){return sf.open(tt(tt({},t),{type:e}))}});sf.warn=sf.warning;sf.useNotification=Kj(VO,UO);const Zj=sf;var Xj=function(t,n){return n||(t?"ant-".concat(t):"ant")},zn=C.exports.createContext({getPrefixCls:Xj}),yu=zn.Consumer,Yj="-ant-".concat(Date.now(),"-").concat(Math.random());function Qj(e,t){var n={},r=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 p1(v),P=jp(w.toRgbString());n["".concat(y,"-color")]=r(w),n["".concat(y,"-color-disabled")]=P[1],n["".concat(y,"-color-hover")]=P[4],n["".concat(y,"-color-active")]=P[6],n["".concat(y,"-color-outline")]=w.clone().setAlpha(.2).toRgbString(),n["".concat(y,"-color-deprecated-bg")]=P[0],n["".concat(y,"-color-deprecated-border")]=P[2]};if(t.primaryColor){i(t.primaryColor,"primary");var s=new p1(t.primaryColor),c=jp(s.toRgbString());c.forEach(function(p,v){n["primary-".concat(v+1)]=p}),n["primary-color-deprecated-l-35"]=r(s,function(p){return p.lighten(35)}),n["primary-color-deprecated-l-20"]=r(s,function(p){return p.lighten(20)}),n["primary-color-deprecated-t-20"]=r(s,function(p){return p.tint(20)}),n["primary-color-deprecated-t-50"]=r(s,function(p){return p.tint(50)}),n["primary-color-deprecated-f-12"]=r(s,function(p){return p.setAlpha(p.getAlpha()*.12)});var o=new p1(c[0]);n["primary-color-active-deprecated-f-30"]=r(o,function(p){return p.setAlpha(p.getAlpha()*.3)}),n["primary-color-active-deprecated-d-02"]=r(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(n).map(function(p){return"--".concat(e,"-").concat(p,": ").concat(n[p],";")});return` :root { `.concat(f.join(` `),` } `).trim()}function Jj(e,t){var n=Qj(e,t);wo()&&hm(n,"".concat(Yj,"-dynamic-theme"))}var Fw=C.exports.createContext(!1),jO=function(t){var n=t.children,r=t.disabled,i=C.exports.useContext(Fw);return I(Fw.Provider,{value:r!=null?r:i,children:n})};const dl=Fw;var $w=C.exports.createContext(void 0),KO=function(t){var n=t.children,r=t.size;return I($w.Consumer,{children:function(i){return I($w.Provider,{value:r||i,children:n})}})};const qa=$w;var eK=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form"],tK="ant",nK="anticon",Dy,HO;function jg(){return Dy||tK}function rK(){return HO||nK}var iK=function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.theme;n!==void 0&&(Dy=n),r!==void 0&&(HO=r),i&&Jj(jg(),i)},m2=function(){return{getPrefixCls:function(n,r){return r||(n?"".concat(jg(),"-").concat(n):jg())},getIconPrefixCls:rK,getRootPrefixCls:function(n,r){return n||Dy||(r&&r.includes("-")?r.replace(/^(.*)-[^-]*$/,"$1"):jg())}}},oK=function(t){var n,r,i=t.children,s=t.csp,c=t.autoInsertSpaceInButton,o=t.form,f=t.locale,p=t.componentSize,v=t.direction,y=t.space,w=t.virtual,P=t.dropdownMatchSelectWidth,k=t.legacyLocale,A=t.parentContext,N=t.iconPrefixCls,R=t.componentDisabled,M=C.exports.useCallback(function(j,X){var Y=t.prefixCls;if(X)return X;var se=Y||A.getPrefixCls("");return j?"".concat(se,"-").concat(j):se},[A.getPrefixCls,t.prefixCls]),O=tt(tt({},A),{csp:s,autoInsertSpaceInButton:c,locale:f||k,direction:v,space:y,virtual:w,dropdownMatchSelectWidth:P,getPrefixCls:M});eK.forEach(function(j){var X=t[j];X&&(O[j]=X)});var z=cm(function(){return O},O,function(j,X){var Y=Object.keys(j),se=Object.keys(X);return Y.length!==se.length||Y.some(function(ee){return j[ee]!==X[ee]})}),B=C.exports.useMemo(function(){return{prefixCls:N,csp:s}},[N,s]),V=i,G={};return f&&(G=((n=f.Form)===null||n===void 0?void 0:n.defaultValidateMessages)||((r=ol.Form)===null||r===void 0?void 0:r.defaultValidateMessages)||{}),o&&o.validateMessages&&(G=tt(tt({},G),o.validateMessages)),Object.keys(G).length>0&&(V=I(r2,{validateMessages:G,children:i})),f&&(V=I(gU,{locale:f,_ANT_MARK__:mU,children:V})),(N||s)&&(V=I(YS.Provider,{value:B,children:V})),p&&(V=I(KO,{size:p,children:V})),R!==void 0&&(V=I(jO,{disabled:R,children:V})),I(zn.Provider,{value:z,children:V})},Cf=function(t){return C.exports.useEffect(function(){t.direction&&(Nj.config({rtl:t.direction==="rtl"}),Zj.config({rtl:t.direction==="rtl"}))},[t.direction]),I(fm,{children:function(n,r,i){return I(yu,{children:function(s){return I(oK,{parentContext:s,legacyLocale:i,...t})}})}})};Cf.ConfigContext=zn;Cf.SizeContext=qa;Cf.config=iK;function Xs(e,t,n,r){var i=bc.unstable_batchedUpdates?function(c){bc.unstable_batchedUpdates(n,c)}:n;return e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){e.removeEventListener&&e.removeEventListener(t,i,r)}}}function WO(e){return Object.keys(e).reduce(function(t,n){return(n.startsWith("data-")||n.startsWith("aria-")||n==="role")&&!n.startsWith("data-__")&&(t[n]=e[n]),t},{})}var zo=C.exports.isValidElement;function GO(e){return e&&zo(e)&&e.type===C.exports.Fragment}function qO(e,t,n){return zo(e)?C.exports.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t}function li(e,t){return qO(e,e,t)}var aK=function(e){ui(n,e);var t=ci(n);function n(){var r;return zr(this,n),r=t.apply(this,arguments),r.state={error:void 0,info:{componentStack:""}},r}return Fr(n,[{key:"componentDidCatch",value:function(i,s){this.setState({error:i,info:s})}},{key:"render",value:function(){var i=this.props,s=i.message,c=i.description,o=i.children,f=this.state,p=f.error,v=f.info,y=v&&v.componentStack?v.componentStack:null,w=typeof s>"u"?(p||"").toString():s,P=typeof c>"u"?y:c;return p?I(v2,{type:"error",message:w,description:I("pre",{children:P})}):o}}]),n}(C.exports.Component);const sK=aK;var lK=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u")return 0;var i=t?"scrollTop":"scrollLeft",s=0;return Bw(e)?s=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?s=e.documentElement[i]:(e instanceof HTMLElement||e)&&(s=e[i]),e&&!Bw(e)&&typeof s!="number"&&(s=(r=((n=e.ownerDocument)!==null&&n!==void 0?n:e).documentElement)===null||r===void 0?void 0:r[i]),s}function pK(e,t,n,r){var i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function mK(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.getContainer,r=n===void 0?function(){return window}:n,i=t.callback,s=t.duration,c=s===void 0?450:s,o=r(),f=hK(o,!0),p=Date.now(),v=function y(){var w=Date.now(),P=w-p,k=pK(P>c?c:P,f,e,c);Bw(o)?o.scrollTo(window.pageXOffset,k):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=k:o.scrollTop=k,P"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 St={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=St.F1&&n<=St.F12)return!1;switch(n){case St.ALT:case St.CAPS_LOCK:case St.CONTEXT_MENU:case St.CTRL:case St.DOWN:case St.END:case St.ESC:case St.HOME:case St.INSERT:case St.LEFT:case St.MAC_FF_META:case St.META:case St.NUMLOCK:case St.NUM_CENTER:case St.PAGE_DOWN:case St.PAGE_UP:case St.PAUSE:case St.PRINT_SCREEN:case St.RIGHT:case St.SHIFT:case St.UP:case St.WIN_KEY:case St.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=St.ZERO&&t<=St.NINE||t>=St.NUM_ZERO&&t<=St.NUM_MULTIPLY||t>=St.A&&t<=St.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case St.SPACE:case St.QUESTION_MARK:case St.NUM_PLUS:case St.NUM_MINUS:case St.NUM_PERIOD:case St.NUM_DIVISION:case St.SEMICOLON:case St.DASH:case St.EQUALS:case St.COMMA:case St.PERIOD:case St.SLASH:case St.APOSTROPHE:case St.SINGLE_QUOTE:case St.OPEN_SQUARE_BRACKET:case St.BACKSLASH:case St.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},XO=C.exports.createContext(null);function YO(){return C.exports.useContext(XO)}function vK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=C.exports.useState(!1),n=ze(t,2),r=n[0],i=n[1],s=C.exports.useRef(null),c=function(){window.clearTimeout(s.current)};C.exports.useEffect(function(){return c},[]);var o=function(p,v){c(),s.current=window.setTimeout(function(){i(p),v&&v()},e)};return[r,o,c]}function QO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=C.exports.useRef(null),n=C.exports.useRef(null);C.exports.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||t.current===null)&&(t.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}return[function(){return t.current},r]}function gK(e,t,n,r){var i=C.exports.useRef(null);i.current={open:t,triggerOpen:n,customizedTrigger:r},C.exports.useEffect(function(){function s(c){var o;if(!((o=i.current)!==null&&o!==void 0&&o.customizedTrigger)){var f=c.target;f.shadowRoot&&c.composed&&(f=c.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",s),function(){return window.removeEventListener("mousedown",s)}},[])}var yK=`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`,xK=`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`,_K="".concat(yK," ").concat(xK).split(/[\s\n]+/),bK="aria-",wK="data-";function hk(e,t){return e.indexOf(t)===0}function uu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=ge({},t);var r={};return Object.keys(e).forEach(function(i){(n.aria&&(i==="role"||hk(i,bK))||n.data&&hk(i,wK)||n.attr&&_K.includes(i))&&(r[i]=e[i])}),r}var CK=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],vd=void 0;function SK(e,t){var n=e.prefixCls,r=e.invalidate,i=e.item,s=e.renderItem,c=e.responsive,o=e.responsiveDisabled,f=e.registerSize,p=e.itemKey,v=e.className,y=e.style,w=e.children,P=e.display,k=e.order,A=e.component,N=A===void 0?"div":A,R=Rn(e,CK),M=c&&!P;function O(j){f(p,j)}C.exports.useEffect(function(){return function(){O(null)}},[]);var z=s&&i!==vd?s(i):w,B;r||(B={opacity:M?0:1,height:M?0:vd,overflowY:M?"hidden":vd,order:c?k:vd,pointerEvents:M?"none":vd,position:M?"absolute":vd});var V={};M&&(V["aria-hidden"]=!0);var G=I(N,{className:Xe(!r&&n,v),style:ge(ge({},B),y),...V,...R,ref:t,children:z});return c&&(G=I(cl,{onResize:function(X){var Y=X.offsetWidth;O(Y)},disabled:o,children:G})),G}var pp=C.exports.forwardRef(SK);pp.displayName="Item";function EK(){var e=ms({}),t=ze(e,2),n=t[1],r=C.exports.useRef([]),i=0,s=0;function c(o){var f=i;i+=1,r.current.lengthk,Ge=C.exports.useMemo(function(){var ot=s;return Ut?se===null&&j?ot=s:ot=s.slice(0,Math.min(s.length,Z/v)):typeof k=="number"&&(ot=s.slice(0,k)),ot},[s,v,se,k,Ut]),Zt=C.exports.useMemo(function(){return Ut?s.slice(Mt+1):s.slice(Ge.length)},[s,Ge,Ut,Mt]),cn=C.exports.useCallback(function(ot,mt){var Dt;return typeof f=="function"?f(ot):(Dt=f&&(ot==null?void 0:ot[f]))!==null&&Dt!==void 0?Dt:mt},[f]),jt=C.exports.useCallback(c||function(ot){return ot},[c]);function Kt(ot,mt,Dt){Rt===ot&&(mt===void 0||mt===It)||(yt(ot),Dt||(rt(otZ){Kt(Bt-1,ot-pn-He+Re);break}}R&&qt(0)+He>Z&&We(null)}},[Z,ie,Re,He,cn,Ge]);var At=ct&&!!Zt.length,Xt={};It!==null&&Ut&&(Xt={position:"absolute",left:It,top:0});var en={prefixCls:ht,responsive:Ut,component:z,invalidate:Jt},gt=o?function(ot,mt){var Dt=cn(ot,mt);return I(Ly.Provider,{value:ge(ge({},en),{},{order:mt,item:ot,itemKey:Dt,registerSize:Cn,display:mt<=Mt}),children:o(ot,mt)},Dt)}:function(ot,mt){var Dt=cn(ot,mt);return C.exports.createElement(pp,{...en,order:mt,key:Dt,item:ot,renderItem:jt,itemKey:Dt,registerSize:Cn,display:mt<=Mt})},yn,Sn={order:At?Mt:Number.MAX_SAFE_INTEGER,className:"".concat(ht,"-rest"),registerSize:Nn,display:At};if(N)N&&(yn=I(Ly.Provider,{value:ge(ge({},en),Sn),children:N(Zt)}));else{var dn=A||MK;yn=I(pp,{...en,...Sn,children:typeof dn=="function"?dn(Zt):dn})}var zt=Qe(O,{className:Xe(!Jt&&r,P),style:w,ref:t,...V,children:[Ge.map(gt),Fe?yn:null,R&&I(pp,{...en,responsive:Wt,responsiveDisabled:!Ut,order:Mt,className:"".concat(ht,"-suffix"),registerSize:wt,display:!0,style:Xt,children:R})]});return Wt&&(zt=I(cl,{onResize:nn,disabled:!Ut,children:zt})),zt}var vs=C.exports.forwardRef(AK);vs.displayName="Overflow";vs.Item=JO;vs.RESPONSIVE=eD;vs.INVALIDATE=tD;var zy=function(t){var n=t.className,r=t.customizeIcon,i=t.customizeIconProps,s=t.onMouseDown,c=t.onClick,o=t.children,f;return typeof r=="function"?f=r(i):f=r,I("span",{className:n,onMouseDown:function(v){v.preventDefault(),s&&s(v)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:c,"aria-hidden":!0,children:f!==void 0?f:I("span",{className:Xe(n.split(/\s+/).map(function(p){return"".concat(p,"-icon")})),children:o})})},NK=function(t,n){var r,i,s=t.prefixCls,c=t.id,o=t.inputElement,f=t.disabled,p=t.tabIndex,v=t.autoFocus,y=t.autoComplete,w=t.editable,P=t.activeDescendantId,k=t.value,A=t.maxLength,N=t.onKeyDown,R=t.onMouseDown,M=t.onChange,O=t.onPaste,z=t.onCompositionStart,B=t.onCompositionEnd,V=t.open,G=t.attrs,j=o||I("input",{}),X=j,Y=X.ref,se=X.props,ee=se.onKeyDown,Z=se.onChange,J=se.onMouseDown,ve=se.onCompositionStart,ie=se.onCompositionEnd,ce=se.style;return"maxLength"in j.props,j=C.exports.cloneElement(j,ge(ge(ge({type:"search"},se),{},{id:c,ref:Po(n,Y),disabled:f,tabIndex:p,autoComplete:y||"off",autoFocus:v,className:Xe("".concat(s,"-selection-search-input"),(r=j)===null||r===void 0||(i=r.props)===null||i===void 0?void 0:i.className),role:"combobox","aria-expanded":V,"aria-haspopup":"listbox","aria-owns":"".concat(c,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(c,"_list"),"aria-activedescendant":P},G),{},{value:w?k:"",maxLength:A,readOnly:!w,unselectable:w?null:"on",style:ge(ge({},ce),{},{opacity:w?null:0}),onKeyDown:function(ye){N(ye),ee&&ee(ye)},onMouseDown:function(ye){R(ye),J&&J(ye)},onChange:function(ye){M(ye),Z&&Z(ye)},onCompositionStart:function(ye){z(ye),ve&&ve(ye)},onCompositionEnd:function(ye){B(ye),ie&&ie(ye)},onPaste:O})),j},y2=C.exports.forwardRef(NK);y2.displayName="Input";function nD(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}var OK=typeof window<"u"&&window.document&&window.document.documentElement,DK=OK;function LK(e){return e!=null}function pk(e){return["string","number"].includes(ln(e))}function rD(e){var t=void 0;return e&&(pk(e.title)?t=e.title.toString():pk(e.label)&&(t=e.label.toString())),t}function zK(e,t){DK?C.exports.useLayoutEffect(e,t):C.exports.useEffect(e,t)}function FK(e){var t;return(t=e.key)!==null&&t!==void 0?t:e.value}var mk=function(t){t.preventDefault(),t.stopPropagation()},$K=function(t){var n=t.id,r=t.prefixCls,i=t.values,s=t.open,c=t.searchValue,o=t.autoClearSearchValue,f=t.inputRef,p=t.placeholder,v=t.disabled,y=t.mode,w=t.showSearch,P=t.autoFocus,k=t.autoComplete,A=t.activeDescendantId,N=t.tabIndex,R=t.removeIcon,M=t.maxTagCount,O=t.maxTagTextLength,z=t.maxTagPlaceholder,B=z===void 0?function(We){return"+ ".concat(We.length," ...")}:z,V=t.tagRender,G=t.onToggleOpen,j=t.onRemove,X=t.onInputChange,Y=t.onInputPaste,se=t.onInputKeyDown,ee=t.onInputMouseDown,Z=t.onInputCompositionStart,J=t.onInputCompositionEnd,ve=C.exports.useRef(null),ie=C.exports.useState(0),ce=ze(ie,2),oe=ce[0],ye=ce[1],Ie=C.exports.useState(!1),Te=ze(Ie,2),Pe=Te[0],De=Te[1],Re="".concat(r,"-selection"),ke=s||y==="multiple"&&o===!1||y==="tags"?c:"",Oe=y==="tags"||y==="multiple"&&o===!1||w&&(s||Pe);zK(function(){ye(ve.current.scrollWidth)},[ke]);function $e(We,Pt,pt,Rt,yt){return Qe("span",{className:Xe("".concat(Re,"-item"),re({},"".concat(Re,"-item-disabled"),pt)),title:rD(We),children:[I("span",{className:"".concat(Re,"-item-content"),children:Pt}),Rt&&I(zy,{className:"".concat(Re,"-item-remove"),onMouseDown:mk,onClick:yt,customizeIcon:R,children:"\xD7"})]})}function He(We,Pt,pt,Rt,yt){var Mt=function(dt){mk(dt),G(!s)};return I("span",{onMouseDown:Mt,children:V({label:Pt,value:We,disabled:pt,closable:Rt,onClose:yt})})}function Ue(We){var Pt=We.disabled,pt=We.label,Rt=We.value,yt=!v&&!Pt,Mt=pt;if(typeof O=="number"&&(typeof pt=="string"||typeof pt=="number")){var ut=String(Mt);ut.length>O&&(Mt="".concat(ut.slice(0,O),"..."))}var dt=function(rt){rt&&rt.stopPropagation(),j(We)};return typeof V=="function"?He(Rt,Mt,Pt,yt,dt):$e(We,Mt,Pt,yt,dt)}function st(We){var Pt=typeof B=="function"?B(We):B;return $e({title:Pt},Pt,!1)}var ft=Qe("div",{className:"".concat(Re,"-search"),style:{width:oe},onFocus:function(){De(!0)},onBlur:function(){De(!1)},children:[I(y2,{ref:f,open:s,prefixCls:r,id:n,inputElement:null,disabled:v,autoFocus:P,autoComplete:k,editable:Oe,activeDescendantId:A,value:ke,onKeyDown:se,onMouseDown:ee,onChange:X,onPaste:Y,onCompositionStart:Z,onCompositionEnd:J,tabIndex:N,attrs:uu(t,!0)}),Qe("span",{ref:ve,className:"".concat(Re,"-search-mirror"),"aria-hidden":!0,children:[ke,"\xA0"]})]}),It=I(vs,{prefixCls:"".concat(Re,"-overflow"),data:i,renderItem:Ue,renderRest:st,suffix:ft,itemKey:FK,maxCount:M});return Qe(An,{children:[It,!i.length&&!ke&&I("span",{className:"".concat(Re,"-placeholder"),children:p})]})},BK=function(t){var n=t.inputElement,r=t.prefixCls,i=t.id,s=t.inputRef,c=t.disabled,o=t.autoFocus,f=t.autoComplete,p=t.activeDescendantId,v=t.mode,y=t.open,w=t.values,P=t.placeholder,k=t.tabIndex,A=t.showSearch,N=t.searchValue,R=t.activeValue,M=t.maxLength,O=t.onInputKeyDown,z=t.onInputMouseDown,B=t.onInputChange,V=t.onInputPaste,G=t.onInputCompositionStart,j=t.onInputCompositionEnd,X=C.exports.useState(!1),Y=ze(X,2),se=Y[0],ee=Y[1],Z=v==="combobox",J=Z||A,ve=w[0],ie=N||"";Z&&R&&!se&&(ie=R),C.exports.useEffect(function(){Z&&ee(!1)},[Z,R]);var ce=v!=="combobox"&&!y&&!A?!1:!!ie,oe=rD(ve),ye=function(){if(ve)return null;var Te=ce?{visibility:"hidden"}:void 0;return I("span",{className:"".concat(r,"-selection-placeholder"),style:Te,children:P})};return Qe(An,{children:[I("span",{className:"".concat(r,"-selection-search"),children:I(y2,{ref:s,prefixCls:r,id:i,open:y,inputElement:n,disabled:c,autoFocus:o,autoComplete:f,editable:J,activeDescendantId:p,value:ie,onKeyDown:O,onMouseDown:z,onChange:function(Te){ee(!0),B(Te)},onPaste:V,onCompositionStart:G,onCompositionEnd:j,tabIndex:k,attrs:uu(t,!0),maxLength:Z?M:void 0})}),!Z&&ve&&!ce&&I("span",{className:"".concat(r,"-selection-item"),title:oe,children:ve.label}),ye()]})};function VK(e){return![St.ESC,St.SHIFT,St.BACKSPACE,St.TAB,St.WIN_KEY,St.ALT,St.META,St.WIN_KEY_RIGHT,St.CTRL,St.SEMICOLON,St.EQUALS,St.CAPS_LOCK,St.CONTEXT_MENU,St.F1,St.F2,St.F3,St.F4,St.F5,St.F6,St.F7,St.F8,St.F9,St.F10,St.F11,St.F12].includes(e)}var UK=function(t,n){var r=C.exports.useRef(null),i=C.exports.useRef(!1),s=t.prefixCls,c=t.open,o=t.mode,f=t.showSearch,p=t.tokenWithEnter,v=t.autoClearSearchValue,y=t.onSearch,w=t.onSearchSubmit,P=t.onToggleOpen,k=t.onInputKeyDown,A=t.domRef;C.exports.useImperativeHandle(n,function(){return{focus:function(){r.current.focus()},blur:function(){r.current.blur()}}});var N=QO(0),R=ze(N,2),M=R[0],O=R[1],z=function(ce){var oe=ce.which;(oe===St.UP||oe===St.DOWN)&&ce.preventDefault(),k&&k(ce),oe===St.ENTER&&o==="tags"&&!i.current&&!c&&(w==null||w(ce.target.value)),VK(oe)&&P(!0)},B=function(){O(!0)},V=C.exports.useRef(null),G=function(ce){y(ce,!0,i.current)!==!1&&P(!0)},j=function(){i.current=!0},X=function(ce){i.current=!1,o!=="combobox"&&G(ce.target.value)},Y=function(ce){var oe=ce.target.value;if(p&&V.current&&/[\r\n]/.test(V.current)){var ye=V.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");oe=oe.replace(ye,V.current)}V.current=null,G(oe)},se=function(ce){var oe=ce.clipboardData,ye=oe.getData("text");V.current=ye},ee=function(ce){var oe=ce.target;if(oe!==r.current){var ye=document.body.style.msTouchAction!==void 0;ye?setTimeout(function(){r.current.focus()}):r.current.focus()}},Z=function(ce){var oe=M();ce.target!==r.current&&!oe&&o!=="combobox"&&ce.preventDefault(),(o!=="combobox"&&(!f||!oe)||!c)&&(c&&v!==!1&&y("",!0,!1),P())},J={inputRef:r,onInputKeyDown:z,onInputMouseDown:B,onInputChange:Y,onInputPaste:se,onInputCompositionStart:j,onInputCompositionEnd:X},ve=o==="multiple"||o==="tags"?I($K,{...t,...J}):I(BK,{...t,...J});return I("div",{ref:A,className:"".concat(s,"-selector"),onClick:ee,onMouseDown:Z,children:ve})},iD=C.exports.forwardRef(UK);iD.displayName="Selector";var jK=C.exports.forwardRef(function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,s=C.exports.useRef(),c=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{}});var o=C.exports.useRef(!1);return!o.current&&wo()&&(c.current=r(),s.current=c.current.parentNode,o.current=!0),C.exports.useEffect(function(){n==null||n(e)}),C.exports.useEffect(function(){return c.current.parentNode===null&&s.current!==null&&s.current.appendChild(c.current),function(){var f,p;(f=c.current)===null||f===void 0||(p=f.parentNode)===null||p===void 0||p.removeChild(c.current)}},[]),c.current?bc.createPortal(i,c.current):null});function KK(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function HK(e,t,n){var r=e[t]||{};return ge(ge({},r),n)}function WK(e,t,n,r){for(var i=n.points,s=Object.keys(e),c=0;c=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function vH(e,t,n,r){var i=Hn.clone(e),s={width:t.width,height:t.height};return r.adjustX&&i.left=n.left&&i.left+s.width>n.right&&(s.width-=i.left+s.width-n.right),r.adjustX&&i.left+s.width>n.right&&(i.left=Math.max(n.right-s.width,n.left)),r.adjustY&&i.top=n.top&&i.top+s.height>n.bottom&&(s.height-=i.top+s.height-n.bottom),r.adjustY&&i.top+s.height>n.bottom&&(i.top=Math.max(n.bottom-s.height,n.top)),Hn.mix(i,s)}function w2(e){var t,n,r;if(!Hn.isWindow(e)&&e.nodeType!==9)t=Hn.offset(e),n=Hn.outerWidth(e),r=Hn.outerHeight(e);else{var i=Hn.getWindow(e);t={left:Hn.getWindowScrollLeft(i),top:Hn.getWindowScrollTop(i)},n=Hn.viewportWidth(i),r=Hn.viewportHeight(i)}return t.width=n,t.height=r,t}function Ek(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,s=e.height,c=e.left,o=e.top;return n==="c"?o+=s/2:n==="b"&&(o+=s),r==="c"?c+=i/2:r==="r"&&(c+=i),{left:c,top:o}}function fg(e,t,n,r,i){var s=Ek(t,n[1]),c=Ek(e,n[0]),o=[c.left-s.left,c.top-s.top];return{left:Math.round(e.left-o[0]+r[0]-i[0]),top:Math.round(e.top-o[1]+r[1]-i[1])}}function Pk(e,t,n){return e.leftn.right}function Tk(e,t,n){return e.topn.bottom}function gH(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.right||r.top>=n.bottom}function C2(e,t,n){var r=n.target||t,i=w2(r),s=!xH(r,n.overflow&&n.overflow.alwaysByViewport);return hD(e,i,n,s)}C2.__getOffsetParent=Kw;C2.__getVisibleRectForElement=b2;function _H(e,t,n){var r,i,s=Hn.getDocument(e),c=s.defaultView||s.parentWindow,o=Hn.getWindowScrollLeft(c),f=Hn.getWindowScrollTop(c),p=Hn.viewportWidth(c),v=Hn.viewportHeight(c);"pageX"in t?r=t.pageX:r=o+t.clientX,"pageY"in t?i=t.pageY:i=f+t.clientY;var y={left:r,top:i,width:0,height:0},w=r>=0&&r<=o+p&&i>=0&&i<=f+v,P=[n.points[0],"cc"];return hD(e,y,gk(gk({},n),{},{points:P}),w)}function S2(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(s,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=r.has(s);if(Rr(!f,"Warning: There may be circular references"),f)return!1;if(s===c)return!0;if(n&&o>1)return!1;r.add(s);var p=o+1;if(Array.isArray(s)){if(!Array.isArray(c)||s.length!==c.length)return!1;for(var v=0;v1&&(It=I("div",{className:"".concat(r,"-content"),children:c})),I(Sa,{visible:n,ref:V,leavedClassName:"".concat(r,"-hidden"),...He,onAppearPrepare:Ue,onEnterPrepare:Ue,removeOnLeave:p,forceRender:v,children:function(We,Pt){var pt=We.className,Rt=We.style,yt=Xe(r,i,X,pt);return I(pD,{target:ke(),ref:B,monitorWindowResize:!0,disabled:ft,align:y,onAlign:$e,children:I("div",{ref:Pt,className:yt,onMouseEnter:N,onMouseLeave:R,onMouseDownCapture:M,onTouchStartCapture:O,onClick:z,style:ge(ge({},Rt),st),children:It})},"popup")}})});mD.displayName="PopupInner";var vD=C.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.visible,i=e.zIndex,s=e.children,c=e.mobile;c=c===void 0?{}:c;var o=c.popupClassName,f=c.popupStyle,p=c.popupMotion,v=p===void 0?{}:p,y=c.popupRender,w=e.onClick,P=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return P.current}}});var k=ge({zIndex:i},f),A=s;return C.exports.Children.count(s)>1&&(A=I("div",{className:"".concat(n,"-content"),children:s})),y&&(A=y(A)),I(Sa,{visible:r,ref:P,removeOnLeave:!0,...v,children:function(N,R){var M=N.className,O=N.style,z=Xe(n,o,M);return I("div",{ref:R,className:z,onClick:w,style:ge(ge({},O),k),children:A})}})});vD.displayName="MobilePopupInner";var TH=["visible","mobile"],gD=C.exports.forwardRef(function(e,t){var n=e.visible,r=e.mobile,i=Rn(e,TH),s=C.exports.useState(n),c=ze(s,2),o=c[0],f=c[1],p=C.exports.useState(!1),v=ze(p,2),y=v[0],w=v[1],P=ge(ge({},i),{},{visible:o});C.exports.useEffect(function(){f(n),n&&r&&w(g2())},[n,r]);var k=y?I(vD,{...P,mobile:r,ref:t}):I(mD,{...P,ref:t});return Qe("div",{children:[I(GK,{...P}),k]})});gD.displayName="Popup";var Ok=C.exports.createContext(null);function S1(){}function kH(){return""}function IH(e){return e?e.ownerDocument:window.document}var RH=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function MH(e){var t=function(n){ui(i,n);var r=ci(i);function i(s){var c;zr(this,i),c=r.call(this,s),re(Ln(c),"popupRef",C.exports.createRef()),re(Ln(c),"triggerRef",C.exports.createRef()),re(Ln(c),"portalContainer",void 0),re(Ln(c),"attachId",void 0),re(Ln(c),"clickOutsideHandler",void 0),re(Ln(c),"touchOutsideHandler",void 0),re(Ln(c),"contextMenuOutsideHandler1",void 0),re(Ln(c),"contextMenuOutsideHandler2",void 0),re(Ln(c),"mouseDownTimeout",void 0),re(Ln(c),"focusTime",void 0),re(Ln(c),"preClickTime",void 0),re(Ln(c),"preTouchTime",void 0),re(Ln(c),"delayTimer",void 0),re(Ln(c),"hasPopupMouseDown",void 0),re(Ln(c),"onMouseEnter",function(f){var p=c.props.mouseEnterDelay;c.fireEvents("onMouseEnter",f),c.delaySetPopupVisible(!0,p,p?null:f)}),re(Ln(c),"onMouseMove",function(f){c.fireEvents("onMouseMove",f),c.setPoint(f)}),re(Ln(c),"onMouseLeave",function(f){c.fireEvents("onMouseLeave",f),c.delaySetPopupVisible(!1,c.props.mouseLeaveDelay)}),re(Ln(c),"onPopupMouseEnter",function(){c.clearDelayTimer()}),re(Ln(c),"onPopupMouseLeave",function(f){var p;f.relatedTarget&&!f.relatedTarget.setTimeout&&hc((p=c.popupRef.current)===null||p===void 0?void 0:p.getElement(),f.relatedTarget)||c.delaySetPopupVisible(!1,c.props.mouseLeaveDelay)}),re(Ln(c),"onFocus",function(f){c.fireEvents("onFocus",f),c.clearDelayTimer(),c.isFocusToShow()&&(c.focusTime=Date.now(),c.delaySetPopupVisible(!0,c.props.focusDelay))}),re(Ln(c),"onMouseDown",function(f){c.fireEvents("onMouseDown",f),c.preClickTime=Date.now()}),re(Ln(c),"onTouchStart",function(f){c.fireEvents("onTouchStart",f),c.preTouchTime=Date.now()}),re(Ln(c),"onBlur",function(f){c.fireEvents("onBlur",f),c.clearDelayTimer(),c.isBlurToHide()&&c.delaySetPopupVisible(!1,c.props.blurDelay)}),re(Ln(c),"onContextMenu",function(f){f.preventDefault(),c.fireEvents("onContextMenu",f),c.setPopupVisible(!0,f)}),re(Ln(c),"onContextMenuClose",function(){c.isContextMenuToShow()&&c.close()}),re(Ln(c),"onClick",function(f){if(c.fireEvents("onClick",f),c.focusTime){var p;if(c.preClickTime&&c.preTouchTime?p=Math.min(c.preClickTime,c.preTouchTime):c.preClickTime?p=c.preClickTime:c.preTouchTime&&(p=c.preTouchTime),Math.abs(p-c.focusTime)<20)return;c.focusTime=0}c.preClickTime=0,c.preTouchTime=0,c.isClickToShow()&&(c.isClickToHide()||c.isBlurToHide())&&f&&f.preventDefault&&f.preventDefault();var v=!c.state.popupVisible;(c.isClickToHide()&&!v||v&&c.isClickToShow())&&c.setPopupVisible(!c.state.popupVisible,f)}),re(Ln(c),"onPopupMouseDown",function(){if(c.hasPopupMouseDown=!0,clearTimeout(c.mouseDownTimeout),c.mouseDownTimeout=window.setTimeout(function(){c.hasPopupMouseDown=!1},0),c.context){var f;(f=c.context).onPopupMouseDown.apply(f,arguments)}}),re(Ln(c),"onDocumentClick",function(f){if(!(c.props.mask&&!c.props.maskClosable)){var p=f.target,v=c.getRootDomNode(),y=c.getPopupDomNode();(!hc(v,p)||c.isContextMenuOnly())&&!hc(y,p)&&!c.hasPopupMouseDown&&c.close()}}),re(Ln(c),"getRootDomNode",function(){var f=c.props.getTriggerDOMNode;if(f)return f(c.triggerRef.current);try{var p=Vp(c.triggerRef.current);if(p)return p}catch{}return bc.findDOMNode(Ln(c))}),re(Ln(c),"getPopupClassNameFromAlign",function(f){var p=[],v=c.props,y=v.popupPlacement,w=v.builtinPlacements,P=v.prefixCls,k=v.alignPoint,A=v.getPopupClassNameFromAlign;return y&&w&&p.push(WK(w,P,f,k)),A&&p.push(A(f)),p.join(" ")}),re(Ln(c),"getComponent",function(){var f=c.props,p=f.prefixCls,v=f.destroyPopupOnHide,y=f.popupClassName,w=f.onPopupAlign,P=f.popupMotion,k=f.popupAnimation,A=f.popupTransitionName,N=f.popupStyle,R=f.mask,M=f.maskAnimation,O=f.maskTransitionName,z=f.maskMotion,B=f.zIndex,V=f.popup,G=f.stretch,j=f.alignPoint,X=f.mobile,Y=f.forceRender,se=f.onPopupClick,ee=c.state,Z=ee.popupVisible,J=ee.point,ve=c.getPopupAlign(),ie={};return c.isMouseEnterToShow()&&(ie.onMouseEnter=c.onPopupMouseEnter),c.isMouseLeaveToHide()&&(ie.onMouseLeave=c.onPopupMouseLeave),ie.onMouseDown=c.onPopupMouseDown,ie.onTouchStart=c.onPopupMouseDown,I(gD,{prefixCls:p,destroyPopupOnHide:v,visible:Z,point:j&&J,className:y,align:ve,onAlign:w,animation:k,getClassNameFromAlign:c.getPopupClassNameFromAlign,...ie,stretch:G,getRootDomNode:c.getRootDomNode,style:N,mask:R,zIndex:B,transitionName:A,maskAnimation:M,maskTransitionName:O,maskMotion:z,ref:c.popupRef,motion:P,mobile:X,forceRender:Y,onClick:se,children:typeof V=="function"?V():V})}),re(Ln(c),"attachParent",function(f){nr.cancel(c.attachId);var p=c.props,v=p.getPopupContainer,y=p.getDocument,w=c.getRootDomNode(),P;v?(w||v.length===0)&&(P=v(w)):P=y(c.getRootDomNode()).body,P?P.appendChild(f):c.attachId=nr(function(){c.attachParent(f)})}),re(Ln(c),"getContainer",function(){if(!c.portalContainer){var f=c.props.getDocument,p=f(c.getRootDomNode()).createElement("div");p.style.position="absolute",p.style.top="0",p.style.left="0",p.style.width="100%",c.portalContainer=p}return c.attachParent(c.portalContainer),c.portalContainer}),re(Ln(c),"setPoint",function(f){var p=c.props.alignPoint;!p||!f||c.setState({point:{pageX:f.pageX,pageY:f.pageY}})}),re(Ln(c),"handlePortalUpdate",function(){c.state.prevPopupVisible!==c.state.popupVisible&&c.props.afterPopupVisibleChange(c.state.popupVisible)}),re(Ln(c),"triggerContextValue",{onPopupMouseDown:c.onPopupMouseDown});var o;return"popupVisible"in s?o=!!s.popupVisible:o=!!s.defaultPopupVisible,c.state={prevPopupVisible:o,popupVisible:o},RH.forEach(function(f){c["fire".concat(f)]=function(p){c.fireEvents(f,p)}}),c}return Fr(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var c=this.props,o=this.state;if(o.popupVisible){var f;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(f=c.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Xs(f,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(f=f||c.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Xs(f,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(f=f||c.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Xs(f,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Xs(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),nr.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var c;return((c=this.popupRef.current)===null||c===void 0?void 0:c.getElement())||null}},{key:"getPopupAlign",value:function(){var c=this.props,o=c.popupPlacement,f=c.popupAlign,p=c.builtinPlacements;return o&&p?HK(p,o,f):f}},{key:"setPopupVisible",value:function(c,o){var f=this.props.alignPoint,p=this.state.popupVisible;this.clearDelayTimer(),p!==c&&("popupVisible"in this.props||this.setState({popupVisible:c,prevPopupVisible:p}),this.props.onPopupVisibleChange(c)),f&&o&&c&&this.setPoint(o)}},{key:"delaySetPopupVisible",value:function(c,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(c,y),p.clearDelayTimer()},v)}else this.setPopupVisible(c,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(c){var o=this.props.children.props,f=this.props;return o[c]&&f[c]?this["fire".concat(c)]:o[c]||f[c]}},{key:"isClickToShow",value:function(){var c=this.props,o=c.action,f=c.showAction;return o.indexOf("click")!==-1||f.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var c=this.props.action;return c==="contextMenu"||c.length===1&&c[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var c=this.props,o=c.action,f=c.showAction;return o.indexOf("contextMenu")!==-1||f.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var c=this.props,o=c.action,f=c.hideAction;return o.indexOf("click")!==-1||f.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var c=this.props,o=c.action,f=c.showAction;return o.indexOf("hover")!==-1||f.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var c=this.props,o=c.action,f=c.hideAction;return o.indexOf("hover")!==-1||f.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var c=this.props,o=c.action,f=c.showAction;return o.indexOf("focus")!==-1||f.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var c=this.props,o=c.action,f=c.hideAction;return o.indexOf("focus")!==-1||f.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var c;(c=this.popupRef.current)===null||c===void 0||c.forceAlign()}}},{key:"fireEvents",value:function(c,o){var f=this.props.children.props[c];f&&f(o);var p=this.props[c];p&&p(o)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var c=this.state.popupVisible,o=this.props,f=o.children,p=o.forceRender,v=o.alignPoint,y=o.className,w=o.autoDestroy,P=C.exports.Children.only(f),k={key:"trigger"};this.isContextMenuToShow()?k.onContextMenu=this.onContextMenu:k.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(k.onClick=this.onClick,k.onMouseDown=this.onMouseDown,k.onTouchStart=this.onTouchStart):(k.onClick=this.createTwoChains("onClick"),k.onMouseDown=this.createTwoChains("onMouseDown"),k.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(k.onMouseEnter=this.onMouseEnter,v&&(k.onMouseMove=this.onMouseMove)):k.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?k.onMouseLeave=this.onMouseLeave:k.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(k.onFocus=this.onFocus,k.onBlur=this.onBlur):(k.onFocus=this.createTwoChains("onFocus"),k.onBlur=this.createTwoChains("onBlur"));var A=Xe(P&&P.props&&P.props.className,y);A&&(k.className=A);var N=ge({},k);Ic(P)&&(N.ref=Po(this.triggerRef,P.ref));var R=C.exports.cloneElement(P,N),M;return(c||this.popupRef.current||p)&&(M=I(e,{getContainer:this.getContainer,didUpdate:this.handlePortalUpdate,children:this.getComponent()},"portal")),!c&&w&&(M=null),Qe(Ok.Provider,{value:this.triggerContextValue,children:[R,M]})}}],[{key:"getDerivedStateFromProps",value:function(c,o){var f=c.popupVisible,p={};return f!==void 0&&o.popupVisible!==f&&(p.popupVisible=f,p.prevPopupVisible=o.popupVisible),p}}]),i}(C.exports.Component);return re(t,"contextType",Ok),re(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:kH,getDocument:IH,onPopupVisibleChange:S1,afterPopupVisibleChange:S1,onPopupAlign:S1,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 q0=MH(jK);var AH=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],NH=function(t){var n=t===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}}}},OH=function(t,n){var r=t.prefixCls;t.disabled;var i=t.visible,s=t.children,c=t.popupElement,o=t.containerWidth,f=t.animation,p=t.transitionName,v=t.dropdownStyle,y=t.dropdownClassName,w=t.direction,P=w===void 0?"ltr":w,k=t.placement,A=t.dropdownMatchSelectWidth,N=t.dropdownRender,R=t.dropdownAlign,M=t.getPopupContainer,O=t.empty,z=t.getTriggerDOMNode,B=t.onPopupVisibleChange,V=t.onPopupMouseEnter,G=Rn(t,AH),j="".concat(r,"-dropdown"),X=c;N&&(X=N(c));var Y=C.exports.useMemo(function(){return NH(A)},[A]),se=f?"".concat(j,"-").concat(f):p,ee=C.exports.useRef(null);C.exports.useImperativeHandle(n,function(){return{getPopupElement:function(){return ee.current}}});var Z=ge({minWidth:o},v);return typeof A=="number"?Z.width=A:A&&(Z.width=o),I(q0,{...G,showAction:B?["click"]:[],hideAction:B?["click"]:[],popupPlacement:k||(P==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Y,prefixCls:j,popupTransitionName:se,popup:I("div",{ref:ee,onMouseEnter:V,children:X}),popupAlign:R,popupVisible:i,getPopupContainer:M,popupClassName:Xe(y,re({},"".concat(j,"-empty"),O)),popupStyle:Z,getTriggerDOMNode:z,onPopupVisibleChange:B,children:s})},yD=C.exports.forwardRef(OH);yD.displayName="SelectTrigger";function Dk(e,t){var n=e.key,r;return"value"in e&&(r=e.value),n!=null?n:r!==void 0?r:"rc-index-key-".concat(t)}function xD(e,t){var n=e||{},r=n.label,i=n.value,s=n.options;return{label:r||(t?"children":"label"),value:i||"value",options:s||"options"}}function DH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],s=xD(n,!1),c=s.label,o=s.value,f=s.options;function p(v,y){v.forEach(function(w){var P=w[c];if(y||!(f in w)){var k=w[o];i.push({key:Dk(w,i.length),groupOption:y,data:w,label:P,value:k})}else{var A=P;A===void 0&&r&&(A=w.label),i.push({key:Dk(w,i.length),group:!0,data:w,label:A}),p(w[f],!0)}})}return p(e,!1),i}function Hw(e){var t=ge({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Rr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function LH(e,t){if(!t||!t.length)return null;var n=!1;function r(s,c){var o=JS(c),f=o[0],p=o.slice(1);if(!f)return[s];var v=s.split(f);return n=n||v.length>1,v.reduce(function(y,w){return[].concat(Et(y),Et(r(w,p)))},[]).filter(function(y){return y})}var i=r(e,t);return n?i:null}var zH=["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"],FH=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Ww(e){return e==="tags"||e==="multiple"}var _D=C.exports.forwardRef(function(e,t){var n,r,i=e.id,s=e.prefixCls,c=e.className,o=e.showSearch,f=e.tagRender,p=e.direction,v=e.omitDomProps,y=e.displayValues,w=e.onDisplayValuesChange,P=e.emptyOptions,k=e.notFoundContent,A=k===void 0?"Not Found":k,N=e.onClear,R=e.mode,M=e.disabled,O=e.loading,z=e.getInputElement,B=e.getRawInputElement,V=e.open,G=e.defaultOpen,j=e.onDropdownVisibleChange,X=e.activeValue,Y=e.onActiveValueChange,se=e.activeDescendantId,ee=e.searchValue,Z=e.autoClearSearchValue,J=e.onSearch,ve=e.onSearchSplit,ie=e.tokenSeparators,ce=e.allowClear,oe=e.showArrow,ye=e.inputIcon,Ie=e.clearIcon,Te=e.OptionList,Pe=e.animation,De=e.transitionName,Re=e.dropdownStyle,ke=e.dropdownClassName,Oe=e.dropdownMatchSelectWidth,$e=e.dropdownRender,He=e.dropdownAlign,Ue=e.placement,st=e.getPopupContainer,ft=e.showAction,It=ft===void 0?[]:ft,We=e.onFocus,Pt=e.onBlur,pt=e.onKeyUp,Rt=e.onKeyDown,yt=e.onMouseDown,Mt=Rn(e,zH),ut=Ww(R),dt=(o!==void 0?o:ut)||R==="combobox",ct=ge({},Mt);FH.forEach(function(Mn){delete ct[Mn]}),v==null||v.forEach(function(Mn){delete ct[Mn]});var rt=C.exports.useState(!1),ht=ze(rt,2),bt=ht[0],Wt=ht[1];C.exports.useEffect(function(){Wt(g2())},[]);var Ut=C.exports.useRef(null),Jt=C.exports.useRef(null),Fe=C.exports.useRef(null),Ge=C.exports.useRef(null),Zt=C.exports.useRef(null),cn=vK(),jt=ze(cn,3),Kt=jt[0],nn=jt[1],Cn=jt[2];C.exports.useImperativeHandle(t,function(){var Mn,kn;return{focus:(Mn=Ge.current)===null||Mn===void 0?void 0:Mn.focus,blur:(kn=Ge.current)===null||kn===void 0?void 0:kn.blur,scrollTo:function(Gr){var yr;return(yr=Zt.current)===null||yr===void 0?void 0:yr.scrollTo(Gr)}}});var Nn=C.exports.useMemo(function(){var Mn;if(R!=="combobox")return ee;var kn=(Mn=y[0])===null||Mn===void 0?void 0:Mn.value;return typeof kn=="string"||typeof kn=="number"?String(kn):""},[ee,R,y]),wt=R==="combobox"&&typeof z=="function"&&z()||null,qt=typeof B=="function"&&B(),At=pN(Jt,qt==null||(n=qt.props)===null||n===void 0?void 0:n.ref),Xt=Bi(void 0,{defaultValue:G,value:V}),en=ze(Xt,2),gt=en[0],yn=en[1],Sn=gt,dn=!A&&P;(M||dn&&Sn&&R==="combobox")&&(Sn=!1);var zt=dn?!1:Sn,ot=C.exports.useCallback(function(Mn){var kn=Mn!==void 0?Mn:!Sn;M||(yn(kn),Sn!==kn&&(j==null||j(kn)))},[M,Sn,yn,j]),mt=C.exports.useMemo(function(){return(ie||[]).some(function(Mn){return[` `,`\r `].includes(Mn)})},[ie]),Dt=function(kn,Dn,Gr){var yr=!0,Kn=kn;Y==null||Y(null);var $n=Gr?null:LH(kn,ie);return R!=="combobox"&&$n&&(Kn="",ve==null||ve($n),ot(!1),yr=!1),J&&Nn!==Kn&&J(Kn,{source:Dn?"typing":"effect"}),yr},Bt=function(kn){!kn||!kn.trim()||J(kn,{source:"submit"})};C.exports.useEffect(function(){!Sn&&!ut&&R!=="combobox"&&Dt("",!1,!1)},[Sn]),C.exports.useEffect(function(){gt&&M&&yn(!1),M&&nn(!1)},[M]);var pn=QO(),On=ze(pn,2),Zn=On[0],Xn=On[1],me=function(kn){var Dn=Zn(),Gr=kn.which;if(Gr===St.ENTER&&(R!=="combobox"&&kn.preventDefault(),Sn||ot(!0)),Xn(!!Nn),Gr===St.BACKSPACE&&!Dn&&ut&&!Nn&&y.length){for(var yr=Et(y),Kn=null,$n=yr.length-1;$n>=0;$n-=1){var Jn=yr[$n];if(!Jn.disabled){yr.splice($n,1),Kn=Jn;break}}Kn&&w(yr,{type:"remove",values:[Kn]})}for(var br=arguments.length,Cr=new Array(br>1?br-1:0),Br=1;Br1?Dn-1:0),yr=1;yr1?$n-1:0),br=1;br<$n;br++)Jn[br-1]=arguments[br];yt==null||yt.apply(void 0,[kn].concat(Jn))},Ce=C.exports.useState(null),Le=ze(Ce,2),qe=Le[0],Ze=Le[1],Ve=C.exports.useState({}),Lt=ze(Ve,2),Ct=Lt[1];function Je(){Ct({})}si(function(){if(zt){var Mn,kn=Math.ceil((Mn=Ut.current)===null||Mn===void 0?void 0:Mn.offsetWidth);qe!==kn&&!Number.isNaN(kn)&&Ze(kn)}},[zt]);var Ot;qt&&(Ot=function(kn){ot(kn)}),gK(function(){var Mn;return[Ut.current,(Mn=Fe.current)===null||Mn===void 0?void 0:Mn.getPopupElement()]},zt,ot,!!qt);var Vt=C.exports.useMemo(function(){return ge(ge({},e),{},{notFoundContent:A,open:Sn,triggerOpen:zt,id:i,showSearch:dt,multiple:ut,toggleOpen:ot})},[e,A,zt,Sn,i,dt,ut,ot]),bn=oe!==void 0?oe:O||!ut&&R!=="combobox",un;bn&&(un=I(zy,{className:Xe("".concat(s,"-arrow"),re({},"".concat(s,"-arrow-loading"),O)),customizeIcon:ye,customizeIconProps:{loading:O,searchValue:Nn,open:Sn,focused:Kt,showSearch:dt}}));var wn,Vn=function(){var kn;N==null||N(),(kn=Ge.current)===null||kn===void 0||kn.focus(),w([],{type:"clear",values:y}),Dt("",!1,!1)};!M&&ce&&(y.length||Nn)&&!(R==="combobox"&&Nn==="")&&(wn=I(zy,{className:"".concat(s,"-clear"),onMouseDown:Vn,customizeIcon:Ie,children:"\xD7"}));var rr=I(Te,{ref:Zt}),$r=Xe(s,c,(r={},re(r,"".concat(s,"-focused"),Kt),re(r,"".concat(s,"-multiple"),ut),re(r,"".concat(s,"-single"),!ut),re(r,"".concat(s,"-allow-clear"),ce),re(r,"".concat(s,"-show-arrow"),bn),re(r,"".concat(s,"-disabled"),M),re(r,"".concat(s,"-loading"),O),re(r,"".concat(s,"-open"),Sn),re(r,"".concat(s,"-customize-input"),wt),re(r,"".concat(s,"-show-search"),dt),r)),sr=I(yD,{ref:Fe,disabled:M,prefixCls:s,visible:zt,popupElement:rr,containerWidth:qe,animation:Pe,transitionName:De,dropdownStyle:Re,dropdownClassName:ke,direction:p,dropdownMatchSelectWidth:Oe,dropdownRender:$e,dropdownAlign:He,placement:Ue,getPopupContainer:st,empty:P,getTriggerDOMNode:function(){return Jt.current},onPopupVisibleChange:Ot,onPopupMouseEnter:Je,children:qt?C.exports.cloneElement(qt,{ref:At}):I(iD,{...e,domRef:Jt,prefixCls:s,inputElement:wt,ref:Ge,id:i,showSearch:dt,autoClearSearchValue:Z,mode:R,activeDescendantId:se,tagRender:f,values:y,open:Sn,onToggleOpen:ot,activeValue:X,searchValue:Nn,onSearch:Dt,onSearchSubmit:Bt,onRemove:q,tokenWithEnter:mt})}),Mr;return qt?Mr=sr:Mr=Qe("div",{className:$r,...ct,ref:Ut,onMouseDown:be,onKeyDown:me,onKeyUp:H,onFocus:le,onBlur:xe,children:[Kt&&!Sn&&I("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite",children:"".concat(y.map(function(Mn){var kn=Mn.label,Dn=Mn.value;return["number","string"].includes(ln(kn))?kn:Dn}).join(", "))}),sr,un,wn]}),I(XO.Provider,{value:Vt,children:Mr})});const $H=function(e,t){var n=C.exports.useRef({values:new Map,options:new Map}),r=C.exports.useMemo(function(){var s=n.current,c=s.values,o=s.options,f=e.map(function(y){if(y.label===void 0){var w;return ge(ge({},y),{},{label:(w=c.get(y.value))===null||w===void 0?void 0:w.label})}return y}),p=new Map,v=new Map;return f.forEach(function(y){p.set(y.value,y),v.set(y.value,t.get(y.value)||o.get(y.value))}),n.current.values=p,n.current.options=v,f},[e,t]),i=C.exports.useCallback(function(s){return t.get(s)||n.current.options.get(s)},[t]);return[r,i]};function E1(e,t){return nD(e).join("").toUpperCase().includes(t)}const BH=function(e,t,n,r,i){return C.exports.useMemo(function(){if(!n||r===!1)return e;var s=t.options,c=t.label,o=t.value,f=[],p=typeof r=="function",v=n.toUpperCase(),y=p?r:function(P,k){return i?E1(k[i],v):k[s]?E1(k[c!=="children"?c:"label"],v):E1(k[o],v)},w=p?function(P){return Hw(P)}:function(P){return P};return e.forEach(function(P){if(P[s]){var k=y(n,w(P));if(k)f.push(P);else{var A=P[s].filter(function(N){return y(n,w(N))});A.length&&f.push(ge(ge({},P),{},re({},s,A)))}return}y(n,w(P))&&f.push(P)}),f},[e,r,i,n,t])};var Lk=0,VH=wo();function UH(){var e;return VH?(e=Lk,Lk+=1):e="TEST_OR_SSR",e}function bD(e){var t=C.exports.useState(),n=ze(t,2),r=n[0],i=n[1];return C.exports.useEffect(function(){i("rc_select_".concat(UH()))},[]),e||r}var jH=["children","value"],KH=["children"];function HH(e){var t=e,n=t.key,r=t.props,i=r.children,s=r.value,c=Rn(r,jH);return ge({key:n,value:s!==void 0?s:n,children:i},c)}function wD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Zi(e).map(function(n,r){if(!C.exports.isValidElement(n)||!n.type)return null;var i=n,s=i.type.isSelectOptGroup,c=i.key,o=i.props,f=o.children,p=Rn(o,KH);return t||!s?HH(n):ge(ge({key:"__RC_SELECT_GRP__".concat(c===null?r:c,"__"),label:c},p),{},{options:wD(f)})}).filter(function(n){return n})}function WH(e,t,n,r,i){return C.exports.useMemo(function(){var s=e,c=!e;c&&(s=wD(t));var o=new Map,f=new Map,p=function(w,P,k){k&&typeof k=="string"&&w.set(P[k],P)};function v(y){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,P=0;Pf},r}return Fr(n,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(i){i.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var i=this.state,s=i.dragging,c=i.visible,o=this.props.prefixCls,f=this.getSpinHeight(),p=this.getTop(),v=this.showScroll(),y=v&&c;return I("div",{ref:this.scrollbarRef,className:Xe("".concat(o,"-scrollbar"),re({},"".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:I("div",{ref:this.thumbRef,className:Xe("".concat(o,"-scrollbar-thumb"),re({},"".concat(o,"-scrollbar-thumb-moving"),s)),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})})}}]),n}(C.exports.Component);function ZH(e){var t=e.children,n=e.setRef,r=C.exports.useCallback(function(i){n(i)},[]);return C.exports.cloneElement(t,{ref:r})}function XH(e,t,n,r,i,s){var c=s.getKey;return e.slice(t,n+1).map(function(o,f){var p=t+f,v=i(o,p,{}),y=c(o);return I(ZH,{setRef:function(P){return r(o,P)},children:v},y)})}var YH=function(){function e(){zr(this,e),this.maps=void 0,this.maps=Object.create(null)}return Fr(e,[{key:"set",value:function(n,r){this.maps[n]=r}},{key:"get",value:function(n){return this.maps[n]}}]),e}();function QH(e,t,n){var r=C.exports.useState(0),i=ze(r,2),s=i[0],c=i[1],o=C.exports.useRef(new Map),f=C.exports.useRef(new YH),p=C.exports.useRef();function v(){nr.cancel(p.current)}function y(){v(),p.current=nr(function(){o.current.forEach(function(P,k){if(P&&P.offsetParent){var A=Vp(P),N=A.offsetHeight;f.current.get(k)!==N&&f.current.set(k,A.offsetHeight)}}),c(function(P){return P+1})})}function w(P,k){var A=e(P),N=o.current.get(A);k?(o.current.set(A,k),y()):o.current.delete(A),!N!=!k&&(k?t==null||t(P):n==null||n(P))}return C.exports.useEffect(function(){return v},[]),[w,y,f.current,s]}function JH(e,t,n,r,i,s,c,o){var f=C.exports.useRef();return function(p){if(p==null){o();return}if(nr.cancel(f.current),typeof p=="number")c(p);else if(p&&ln(p)==="object"){var v,y=p.align;"index"in p?v=p.index:v=t.findIndex(function(A){return i(A)===p.key});var w=p.offset,P=w===void 0?0:w,k=function A(N,R){if(!(N<0||!e.current)){var M=e.current.clientHeight,O=!1,z=R;if(M){for(var B=R||y,V=0,G=0,j=0,X=Math.min(t.length,v),Y=0;Y<=X;Y+=1){var se=i(t[Y]);G=V;var ee=n.get(se);j=G+(ee===void 0?r:ee),V=j,Y===v&&ee===void 0&&(O=!0)}var Z=null;switch(B){case"top":Z=G-P;break;case"bottom":Z=j-M+P;break;default:{var J=e.current.scrollTop,ve=J+M;Gve&&(z="bottom")}}Z!==null&&Z!==e.current.scrollTop&&c(Z)}f.current=nr(function(){O&&s(),A(N-1,z)},2)}};k(3)}}}function eW(e,t,n){var r=e.length,i=t.length,s,c;if(r===0&&i===0)return null;r"u"?"undefined":ln(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const SD=function(e,t){var n=C.exports.useRef(!1),r=C.exports.useRef(null);function i(){clearTimeout(r.current),n.current=!0,r.current=setTimeout(function(){n.current=!1},50)}var s=C.exports.useRef({top:e,bottom:t});return s.current.top=e,s.current.bottom=t,function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=c<0&&s.current.top||c>0&&s.current.bottom;return o&&f?(clearTimeout(r.current),n.current=!1):(!f||n.current)&&i(),!n.current&&f}};function rW(e,t,n,r){var i=C.exports.useRef(0),s=C.exports.useRef(null),c=C.exports.useRef(null),o=C.exports.useRef(!1),f=SD(t,n);function p(y){if(!!e){nr.cancel(s.current);var w=y.deltaY;i.current+=w,c.current=w,!f(w)&&(nW||y.preventDefault(),s.current=nr(function(){var P=o.current?10:1;r(i.current*P),i.current=0}))}}function v(y){!e||(o.current=y.detail===c.current)}return[p,v]}var iW=14/15;function oW(e,t,n){var r=C.exports.useRef(!1),i=C.exports.useRef(0),s=C.exports.useRef(null),c=C.exports.useRef(null),o,f=function(w){if(r.current){var P=Math.ceil(w.touches[0].pageY),k=i.current-P;i.current=P,n(k)&&w.preventDefault(),clearInterval(c.current),c.current=setInterval(function(){k*=iW,(!n(k,!0)||Math.abs(k)<=.1)&&clearInterval(c.current)},16)}},p=function(){r.current=!1,o()},v=function(w){o(),w.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(w.touches[0].pageY),s.current=w.target,s.current.addEventListener("touchmove",f),s.current.addEventListener("touchend",p))};o=function(){s.current&&(s.current.removeEventListener("touchmove",f),s.current.removeEventListener("touchend",p))},si(function(){return e&&t.current.addEventListener("touchstart",v),function(){var y;(y=t.current)===null||y===void 0||y.removeEventListener("touchstart",v),o(),clearInterval(c.current)}},[e])}var aW=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],sW=[],lW={overflowY:"auto",overflowAnchor:"none"};function uW(e,t){var n=e.prefixCls,r=n===void 0?"rc-virtual-list":n,i=e.className,s=e.height,c=e.itemHeight,o=e.fullHeight,f=o===void 0?!0:o,p=e.style,v=e.data,y=e.children,w=e.itemKey,P=e.virtual,k=e.component,A=k===void 0?"div":k,N=e.onScroll,R=e.onVisibleChange,M=e.innerProps,O=Rn(e,aW),z=!!(P!==!1&&s&&c),B=z&&v&&c*v.length>s,V=C.exports.useState(0),G=ze(V,2),j=G[0],X=G[1],Y=C.exports.useState(!1),se=ze(Y,2),ee=se[0],Z=se[1],J=Xe(r,i),ve=v||sW,ie=C.exports.useRef(),ce=C.exports.useRef(),oe=C.exports.useRef(),ye=C.exports.useCallback(function(Kt){return typeof w=="function"?w(Kt):Kt==null?void 0:Kt[w]},[w]),Ie={getKey:ye};function Te(Kt){X(function(nn){var Cn;typeof Kt=="function"?Cn=Kt(nn):Cn=Kt;var Nn=dt(Cn);return ie.current.scrollTop=Nn,Nn})}var Pe=C.exports.useRef({start:0,end:ve.length}),De=C.exports.useRef(),Re=tW(ve,ye),ke=ze(Re,1),Oe=ke[0];De.current=Oe;var $e=QH(ye,null,null),He=ze($e,4),Ue=He[0],st=He[1],ft=He[2],It=He[3],We=C.exports.useMemo(function(){if(!z)return{scrollHeight:void 0,start:0,end:ve.length-1,offset:void 0};if(!B){var Kt;return{scrollHeight:((Kt=ce.current)===null||Kt===void 0?void 0:Kt.offsetHeight)||0,start:0,end:ve.length-1,offset:void 0}}for(var nn=0,Cn,Nn,wt,qt=ve.length,At=0;At=j&&Cn===void 0&&(Cn=At,Nn=nn),yn>j+s&&wt===void 0&&(wt=At),nn=yn}return Cn===void 0&&(Cn=0,Nn=0,wt=Math.ceil(s/c)),wt===void 0&&(wt=ve.length-1),wt=Math.min(wt+1,ve.length),{scrollHeight:nn,start:Cn,end:wt,offset:Nn}},[B,z,j,ve,It,s]),Pt=We.scrollHeight,pt=We.start,Rt=We.end,yt=We.offset;Pe.current.start=pt,Pe.current.end=Rt;var Mt=Pt-s,ut=C.exports.useRef(Mt);ut.current=Mt;function dt(Kt){var nn=Kt;return Number.isNaN(ut.current)||(nn=Math.min(nn,ut.current)),nn=Math.max(nn,0),nn}var ct=j<=0,rt=j>=Mt,ht=SD(ct,rt);function bt(Kt){var nn=Kt;Te(nn)}function Wt(Kt){var nn=Kt.currentTarget.scrollTop;nn!==j&&Te(nn),N==null||N(Kt)}var Ut=rW(z,ct,rt,function(Kt){Te(function(nn){var Cn=nn+Kt;return Cn})}),Jt=ze(Ut,2),Fe=Jt[0],Ge=Jt[1];oW(z,ie,function(Kt,nn){return ht(Kt,nn)?!1:(Fe({preventDefault:function(){},deltaY:Kt}),!0)}),si(function(){function Kt(nn){z&&nn.preventDefault()}return ie.current.addEventListener("wheel",Fe),ie.current.addEventListener("DOMMouseScroll",Ge),ie.current.addEventListener("MozMousePixelScroll",Kt),function(){ie.current&&(ie.current.removeEventListener("wheel",Fe),ie.current.removeEventListener("DOMMouseScroll",Ge),ie.current.removeEventListener("MozMousePixelScroll",Kt))}},[z]);var Zt=JH(ie,ve,ft,c,ye,st,Te,function(){var Kt;(Kt=oe.current)===null||Kt===void 0||Kt.delayHidden()});C.exports.useImperativeHandle(t,function(){return{scrollTo:Zt}}),si(function(){if(R){var Kt=ve.slice(pt,Rt+1);R(Kt,ve)}},[pt,Rt,ve]);var cn=XH(ve,pt,Rt,Ue,y,Ie),jt=null;return s&&(jt=ge(re({},f?"height":"maxHeight",s),lW),z&&(jt.overflowY="hidden",ee&&(jt.pointerEvents="none"))),Qe("div",{style:ge(ge({},p),{},{position:"relative"}),className:J,...O,children:[I(A,{className:"".concat(r,"-holder"),style:jt,ref:ie,onScroll:Wt,children:I(CD,{prefixCls:r,height:Pt,offset:yt,onInnerResize:st,ref:ce,innerProps:M,children:cn})}),z&&I(qH,{ref:oe,prefixCls:r,scrollTop:j,height:s,scrollHeight:Pt,count:ve.length,onScroll:bt,onStartMove:function(){Z(!0)},onStopMove:function(){Z(!1)}})]})}var k2=C.exports.forwardRef(uW);k2.displayName="List";function cW(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var ED=C.exports.createContext(null),dW=["disabled","title","children","style","className"];function $k(e){return typeof e=="string"||typeof e=="number"}var fW=function(t,n){var r=YO(),i=r.prefixCls,s=r.id,c=r.open,o=r.multiple,f=r.mode,p=r.searchValue,v=r.toggleOpen,y=r.notFoundContent,w=r.onPopupScroll,P=C.exports.useContext(ED),k=P.flattenOptions,A=P.onActiveValue,N=P.defaultActiveFirstOption,R=P.onSelect,M=P.menuItemSelectedIcon,O=P.rawValues,z=P.fieldNames,B=P.virtual,V=P.listHeight,G=P.listItemHeight,j="".concat(i,"-item"),X=cm(function(){return k},[c,k],function(Re,ke){return ke[0]&&Re[1]!==ke[1]}),Y=C.exports.useRef(null),se=function(ke){ke.preventDefault()},ee=function(ke){Y.current&&Y.current.scrollTo(typeof ke=="number"?{index:ke}:ke)},Z=function(ke){for(var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,$e=X.length,He=0;He<$e;He+=1){var Ue=(ke+He*Oe+$e)%$e,st=X[Ue],ft=st.group,It=st.data;if(!ft&&!It.disabled)return Ue}return-1},J=C.exports.useState(function(){return Z(0)}),ve=ze(J,2),ie=ve[0],ce=ve[1],oe=function(ke){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;ce(ke);var $e={source:Oe?"keyboard":"mouse"},He=X[ke];if(!He){A(null,-1,$e);return}A(He.value,ke,$e)};C.exports.useEffect(function(){oe(N!==!1?Z(0):-1)},[X.length,p]);var ye=C.exports.useCallback(function(Re){return O.has(Re)&&f!=="combobox"},[f,Et(O).toString(),O.size]);C.exports.useEffect(function(){var Re=setTimeout(function(){if(!o&&c&&O.size===1){var Oe=Array.from(O)[0],$e=X.findIndex(function(He){var Ue=He.data;return Ue.value===Oe});$e!==-1&&(oe($e),ee($e))}});if(c){var ke;(ke=Y.current)===null||ke===void 0||ke.scrollTo(void 0)}return function(){return clearTimeout(Re)}},[c,p]);var Ie=function(ke){ke!==void 0&&R(ke,{selected:!O.has(ke)}),o||v(!1)};if(C.exports.useImperativeHandle(n,function(){return{onKeyDown:function(ke){var Oe=ke.which,$e=ke.ctrlKey;switch(Oe){case St.N:case St.P:case St.UP:case St.DOWN:{var He=0;if(Oe===St.UP?He=-1:Oe===St.DOWN?He=1:cW()&&$e&&(Oe===St.N?He=1:Oe===St.P&&(He=-1)),He!==0){var Ue=Z(ie+He,He);ee(Ue),oe(Ue,!0)}break}case St.ENTER:{var st=X[ie];st&&!st.data.disabled?Ie(st.value):Ie(void 0),c&&ke.preventDefault();break}case St.ESC:v(!1),c&&ke.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ke){ee(ke)}}}),X.length===0)return I("div",{role:"listbox",id:"".concat(s,"_list"),className:"".concat(j,"-empty"),onMouseDown:se,children:y});var Te=Object.keys(z).map(function(Re){return z[Re]}),Pe=function(ke){return ke.label},De=function(ke){var Oe=X[ke];if(!Oe)return null;var $e=Oe.data||{},He=$e.value,Ue=Oe.group,st=uu($e,!0),ft=Pe(Oe);return Oe?C.exports.createElement("div",{"aria-label":typeof ft=="string"&&!Ue?ft:null,...st,key:ke,role:Ue?"presentation":"option",id:"".concat(s,"_list_").concat(ke),"aria-selected":ye(He)},He):null};return Qe(An,{children:[Qe("div",{role:"listbox",id:"".concat(s,"_list"),style:{height:0,width:0,overflow:"hidden"},children:[De(ie-1),De(ie),De(ie+1)]}),I(k2,{itemKey:"key",ref:Y,data:X,height:V,itemHeight:G,fullHeight:!1,onMouseDown:se,onScroll:w,virtual:B,children:function(Re,ke){var Oe,$e=Re.group,He=Re.groupOption,Ue=Re.data,st=Re.label,ft=Re.value,It=Ue.key;if($e){var We,Pt=(We=Ue.title)!==null&&We!==void 0?We:$k(st)?st.toString():void 0;return I("div",{className:Xe(j,"".concat(j,"-group")),title:Pt,children:st!==void 0?st:It})}var pt=Ue.disabled,Rt=Ue.title;Ue.children;var yt=Ue.style,Mt=Ue.className,ut=Rn(Ue,dW),dt=vi(ut,Te),ct=ye(ft),rt="".concat(j,"-option"),ht=Xe(j,rt,Mt,(Oe={},re(Oe,"".concat(rt,"-grouped"),He),re(Oe,"".concat(rt,"-active"),ie===ke&&!pt),re(Oe,"".concat(rt,"-disabled"),pt),re(Oe,"".concat(rt,"-selected"),ct),Oe)),bt=Pe(Re),Wt=!M||typeof M=="function"||ct,Ut=typeof bt=="number"?bt:bt||ft,Jt=$k(Ut)?Ut.toString():void 0;return Rt!==void 0&&(Jt=Rt),Qe("div",{...uu(dt),"aria-selected":ct,className:ht,title:Jt,onMouseMove:function(){ie===ke||pt||oe(ke)},onClick:function(){pt||Ie(ft)},style:yt,children:[I("div",{className:"".concat(rt,"-content"),children:Ut}),C.exports.isValidElement(M)||ct,Wt&&I(zy,{className:"".concat(j,"-option-state"),customizeIcon:M,customizeIconProps:{isSelected:ct},children:ct?"\u2713":null})]})}})]})},PD=C.exports.forwardRef(fW);PD.displayName="OptionList";var hW=["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"],pW=["inputValue"];function mW(e){return!e||ln(e)!=="object"}var vW=C.exports.forwardRef(function(e,t){var n=e.id,r=e.mode,i=e.prefixCls,s=i===void 0?"rc-select":i,c=e.backfill,o=e.fieldNames,f=e.inputValue,p=e.searchValue,v=e.onSearch,y=e.autoClearSearchValue,w=y===void 0?!0:y,P=e.onSelect,k=e.onDeselect,A=e.dropdownMatchSelectWidth,N=A===void 0?!0:A,R=e.filterOption,M=e.filterSort,O=e.optionFilterProp,z=e.optionLabelProp,B=e.options,V=e.children,G=e.defaultActiveFirstOption,j=e.menuItemSelectedIcon,X=e.virtual,Y=e.listHeight,se=Y===void 0?200:Y,ee=e.listItemHeight,Z=ee===void 0?20:ee,J=e.value,ve=e.defaultValue,ie=e.labelInValue,ce=e.onChange,oe=Rn(e,hW),ye=bD(n),Ie=Ww(r),Te=!!(!B&&V),Pe=C.exports.useMemo(function(){return R===void 0&&r==="combobox"?!1:R},[R,r]),De=C.exports.useMemo(function(){return xD(o,Te)},[JSON.stringify(o),Te]),Re=Bi("",{value:p!==void 0?p:f,postState:function(mt){return mt||""}}),ke=ze(Re,2),Oe=ke[0],$e=ke[1],He=WH(B,V,De,O,z),Ue=He.valueOptions,st=He.labelOptions,ft=He.options,It=C.exports.useCallback(function(ot){var mt=nD(ot);return mt.map(function(Dt){var Bt,pn,On,Zn,Xn;if(mW(Dt))Bt=Dt;else{var me;On=Dt.key,pn=Dt.label,Bt=(me=Dt.value)!==null&&me!==void 0?me:On}var H=Ue.get(Bt);if(H){var q;pn===void 0&&(pn=H==null?void 0:H[z||De.label]),On===void 0&&(On=(q=H==null?void 0:H.key)!==null&&q!==void 0?q:Bt),Zn=H==null?void 0:H.disabled,Xn=H==null?void 0:H.title}return{label:pn,value:Bt,key:On,disabled:Zn,title:Xn}})},[De,z,Ue]),We=Bi(ve,{value:J}),Pt=ze(We,2),pt=Pt[0],Rt=Pt[1],yt=C.exports.useMemo(function(){var ot,mt=It(pt);return r==="combobox"&&!((ot=mt[0])!==null&&ot!==void 0&&ot.value)?[]:mt},[pt,It,r]),Mt=$H(yt,Ue),ut=ze(Mt,2),dt=ut[0],ct=ut[1],rt=C.exports.useMemo(function(){if(!r&&dt.length===1){var ot=dt[0];if(ot.value===null&&(ot.label===null||ot.label===void 0))return[]}return dt.map(function(mt){var Dt;return ge(ge({},mt),{},{label:(Dt=mt.label)!==null&&Dt!==void 0?Dt:mt.value})})},[r,dt]),ht=C.exports.useMemo(function(){return new Set(dt.map(function(ot){return ot.value}))},[dt]);C.exports.useEffect(function(){if(r==="combobox"){var ot,mt=(ot=dt[0])===null||ot===void 0?void 0:ot.value;$e(LK(mt)?String(mt):"")}},[dt]);var bt=zk(function(ot,mt){var Dt,Bt=mt!=null?mt:ot;return Dt={},re(Dt,De.value,ot),re(Dt,De.label,Bt),Dt}),Wt=C.exports.useMemo(function(){if(r!=="tags")return ft;var ot=Et(ft),mt=function(Bt){return Ue.has(Bt)};return Et(dt).sort(function(Dt,Bt){return Dt.value2&&arguments[2]!==void 0?arguments[2]:{},Bt=Dt.source,pn=Bt===void 0?"keyboard":Bt;qt(mt),c&&r==="combobox"&&ot!==null&&pn==="keyboard"&&nn(String(ot))},[c,r]),en=function(mt,Dt,Bt){var pn=function(){var Ee,be=ct(mt);return[ie?{label:be==null?void 0:be[De.label],value:mt,key:(Ee=be==null?void 0:be.key)!==null&&Ee!==void 0?Ee:mt}:mt,Hw(be)]};if(Dt&&P){var On=pn(),Zn=ze(On,2),Xn=Zn[0],me=Zn[1];P(Xn,me)}else if(!Dt&&k&&Bt!=="clear"){var H=pn(),q=ze(H,2),de=q[0],le=q[1];k(de,le)}},gt=zk(function(ot,mt){var Dt,Bt=Ie?mt.selected:!0;Bt?Dt=Ie?[].concat(Et(dt),[ot]):[ot]:Dt=dt.filter(function(pn){return pn.value!==ot}),Zt(Dt),en(ot,Bt),r==="combobox"?nn(""):(!Ww||w)&&($e(""),nn(""))}),yn=function(mt,Dt){Zt(mt);var Bt=Dt.type,pn=Dt.values;(Bt==="remove"||Bt==="clear")&&pn.forEach(function(On){en(On.value,!1,Bt)})},Sn=function(mt,Dt){if($e(mt),nn(null),Dt.source==="submit"){var Bt=(mt||"").trim();if(Bt){var pn=Array.from(new Set([].concat(Et(ht),[Bt])));Zt(pn),en(Bt,!0),$e("")}return}Dt.source!=="blur"&&(r==="combobox"&&Zt(mt),v==null||v(mt))},dn=function(mt){var Dt=mt;r!=="tags"&&(Dt=mt.map(function(pn){var On=st.get(pn);return On==null?void 0:On.value}).filter(function(pn){return pn!==void 0}));var Bt=Array.from(new Set([].concat(Et(ht),Et(Dt))));Zt(Bt),Bt.forEach(function(pn){en(pn,!0)})},zt=C.exports.useMemo(function(){var ot=X!==!1&&N!==!1;return ge(ge({},He),{},{flattenOptions:Ge,onActiveValue:Xt,defaultActiveFirstOption:At,onSelect:gt,menuItemSelectedIcon:j,rawValues:ht,fieldNames:De,virtual:ot,listHeight:se,listItemHeight:Z,childrenAsData:Te})},[He,Ge,Xt,At,gt,j,ht,De,X,N,se,Z,Te]);return I(ED.Provider,{value:zt,children:I(_D,{...oe,id:ye,prefixCls:s,ref:t,omitDomProps:pW,mode:r,displayValues:rt,onDisplayValuesChange:yn,searchValue:Oe,onSearch:Sn,autoClearSearchValue:w,onSearchSplit:dn,dropdownMatchSelectWidth:N,OptionList:PD,emptyOptions:!Ge.length,activeValue:Kt,activeDescendantId:"".concat(ye,"_list_").concat(wt)})})}),I2=vW;I2.Option=T2;I2.OptGroup=P2;var gW=function(){var t=C.exports.useContext(zn),n=t.getPrefixCls,r=n("empty-img-default");return I("svg",{className:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg",children:Qe("g",{fill:"none",fillRule:"evenodd",children:[Qe("g",{transform:"translate(24 31.67)",children:[I("ellipse",{className:"".concat(r,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),I("path",{className:"".concat(r,"-path-1"),d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),I("path",{className:"".concat(r,"-path-2"),d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",transform:"translate(13.56)"}),I("path",{className:"".concat(r,"-path-3"),d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),I("path",{className:"".concat(r,"-path-4"),d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})]}),I("path",{className:"".concat(r,"-path-5"),d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),Qe("g",{className:"".concat(r,"-g"),transform:"translate(149.65 15.383)",children:[I("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),I("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})]})]})})};const yW=gW;var xW=function(){var t=C.exports.useContext(zn),n=t.getPrefixCls,r=n("empty-img-simple");return I("svg",{className:r,width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:Qe("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[I("ellipse",{className:"".concat(r,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),Qe("g",{className:"".concat(r,"-g"),fillRule:"nonzero",children:[I("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"}),I("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",className:"".concat(r,"-path")})]})]})})};const _W=xW;var bW=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=1},subscribe:function(t){return Gu.size||this.register(),k1+=1,Gu.set(k1,t),t(vg),k1},unsubscribe:function(t){Gu.delete(t),Gu.size||this.unregister()},unregister:function(){var t=this;Object.keys(mg).forEach(function(n){var r=mg[n],i=t.matchHandlers[r];i==null||i.mql.removeListener(i==null?void 0:i.listener)}),Gu.clear()},register:function(){var t=this;Object.keys(mg).forEach(function(n){var r=mg[n],i=function(o){var f=o.matches;t.dispatch(tt(tt({},vg),re({},n,f)))},s=window.matchMedia(r);s.addListener(i),t.matchHandlers[r]={mql:s,listener:i},i(s)})}};const By=$W;function VD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=C.exports.useRef({}),n=BD();return C.exports.useEffect(function(){var r=By.subscribe(function(i){t.current=i,e&&n()});return function(){return By.unsubscribe(r)}},[]),t.current}var fa={adjustX:1,adjustY:1},ha=[0,0],UD={left:{points:["cr","cl"],overflow:fa,offset:[-4,0],targetOffset:ha},right:{points:["cl","cr"],overflow:fa,offset:[4,0],targetOffset:ha},top:{points:["bc","tc"],overflow:fa,offset:[0,-4],targetOffset:ha},bottom:{points:["tc","bc"],overflow:fa,offset:[0,4],targetOffset:ha},topLeft:{points:["bl","tl"],overflow:fa,offset:[0,-4],targetOffset:ha},leftTop:{points:["tr","tl"],overflow:fa,offset:[-4,0],targetOffset:ha},topRight:{points:["br","tr"],overflow:fa,offset:[0,-4],targetOffset:ha},rightTop:{points:["tl","tr"],overflow:fa,offset:[4,0],targetOffset:ha},bottomRight:{points:["tr","br"],overflow:fa,offset:[0,4],targetOffset:ha},rightBottom:{points:["bl","br"],overflow:fa,offset:[4,0],targetOffset:ha},bottomLeft:{points:["tl","bl"],overflow:fa,offset:[0,4],targetOffset:ha},leftBottom:{points:["br","bl"],overflow:fa,offset:[-4,0],targetOffset:ha}};function BW(e){var t=e.showArrow,n=e.arrowContent,r=e.children,i=e.prefixCls,s=e.id,c=e.overlayInnerStyle,o=e.className,f=e.style;return Qe("div",{className:Xe("".concat(i,"-content"),o),style:f,children:[t!==!1&&I("div",{className:"".concat(i,"-arrow"),children:n},"arrow"),I("div",{className:"".concat(i,"-inner"),id:s,role:"tooltip",style:c,children:typeof r=="function"?r():r})]})}var VW=function(t,n){var r=t.overlayClassName,i=t.trigger,s=i===void 0?["hover"]:i,c=t.mouseEnterDelay,o=c===void 0?0:c,f=t.mouseLeaveDelay,p=f===void 0?.1:f,v=t.overlayStyle,y=t.prefixCls,w=y===void 0?"rc-tooltip":y,P=t.children,k=t.onVisibleChange,A=t.afterVisibleChange,N=t.transitionName,R=t.animation,M=t.motion,O=t.placement,z=O===void 0?"right":O,B=t.align,V=B===void 0?{}:B,G=t.destroyTooltipOnHide,j=G===void 0?!1:G,X=t.defaultVisible,Y=t.getTooltipContainer,se=t.overlayInnerStyle,ee=t.arrowContent,Z=t.overlay,J=t.id,ve=t.showArrow,ie=Rn(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),ce=C.exports.useRef(null);C.exports.useImperativeHandle(n,function(){return ce.current});var oe=ge({},ie);"visible"in t&&(oe.popupVisible=t.visible);var ye=function(){return I(BW,{showArrow:ve,arrowContent:ee,prefixCls:w,id:J,overlayInnerStyle:se,children:Z},"content")},Ie=!1,Te=!1;if(typeof j=="boolean")Ie=j;else if(j&&ln(j)==="object"){var Pe=j.keepParent;Ie=Pe===!0,Te=Pe===!1}return I(q0,{popupClassName:r,prefixCls:w,popup:ye,action:s,builtinPlacements:UD,popupPlacement:z,ref:ce,popupAlign:V,getPopupContainer:Y,onPopupVisibleChange:k,afterPopupVisibleChange:A,popupTransitionName:N,popupAnimation:R,popupMotion:M,defaultPopupVisible:X,destroyPopupOnHide:Ie,autoDestroy:Te,mouseLeaveDelay:p,popupStyle:v,mouseEnterDelay:o,...oe,children:P})};const UW=C.exports.forwardRef(VW);ia("success","processing","error","default","warning");var jW=ia("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"),KW={adjustX:1,adjustY:1},Uk={adjustX:0,adjustY:0},HW=[0,0];function jk(e){return typeof e=="boolean"?e?KW:Uk:tt(tt({},Uk),e)}function jD(e){var t=e.arrowWidth,n=t===void 0?4:t,r=e.horizontalArrowShift,i=r===void 0?16:r,s=e.verticalArrowShift,c=s===void 0?8:s,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+n),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(c+n)]},topRight:{points:["br","tc"],offset:[i+n,-4]},rightTop:{points:["tl","cr"],offset:[4,-(c+n)]},bottomRight:{points:["tr","bc"],offset:[i+n,4]},rightBottom:{points:["bl","cr"],offset:[4,c+n]},bottomLeft:{points:["tl","bc"],offset:[-(i+n),4]},leftBottom:{points:["br","cl"],offset:[-4,c+n]}};return Object.keys(p).forEach(function(v){p[v]=f?tt(tt({},p[v]),{overflow:jk(o),targetOffset:HW}):tt(tt({},UD[v]),{overflow:jk(o)}),p[v].ignoreShake=!0}),p}var WW=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1;if(E2(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),s=Number(i),c=null;return i&&!Number.isNaN(s)?c=s:r&&c===null&&(c=0),r&&e.disabled&&(c=null),c!==null&&(c>=0||t&&c<0)}return!1}function YD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Et(e.querySelectorAll("*")).filter(function(r){return Wk(r,t)});return Wk(e,t)&&n.unshift(e),n}var qw=St.LEFT,Zw=St.RIGHT,Xw=St.UP,Kg=St.DOWN,Hg=St.ENTER,QD=St.ESC,$h=St.HOME,Bh=St.END,Gk=[Xw,Kg,qw,Zw];function iG(e,t,n,r){var i,s,c,o,f="prev",p="next",v="children",y="parent";if(e==="inline"&&r===Hg)return{inlineTrigger:!0};var w=(i={},re(i,Xw,f),re(i,Kg,p),i),P=(s={},re(s,qw,n?p:f),re(s,Zw,n?f:p),re(s,Kg,v),re(s,Hg,v),s),k=(c={},re(c,Xw,f),re(c,Kg,p),re(c,Hg,v),re(c,QD,y),re(c,qw,n?v:y),re(c,Zw,n?y:v),c),A={inline:w,horizontal:P,vertical:k,inlineSub:w,horizontalSub:k,verticalSub:k},N=(o=A["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[r];switch(N){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 oG(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function aG(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}function JD(e,t){var n=YD(e,!0);return n.filter(function(r){return t.has(r)})}function qk(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var i=JD(e,t),s=i.length,c=i.findIndex(function(o){return n===o});return r<0?c===-1?c=s-1:c-=1:r>0&&(c+=1),c=(c+s)%s,i[c]}function sG(e,t,n,r,i,s,c,o,f,p){var v=C.exports.useRef(),y=C.exports.useRef();y.current=t;var w=function(){nr.cancel(v.current)};return C.exports.useEffect(function(){return function(){w()}},[]),function(P){var k=P.which;if([].concat(Gk,[Hg,QD,$h,Bh]).includes(k)){var A,N,R,M=function(){A=new Set,N=new Map,R=new Map;var ve=s();return ve.forEach(function(ie){var ce=document.querySelector("[data-menu-id='".concat(D2(r,ie),"']"));ce&&(A.add(ce),R.set(ce,ie),N.set(ie,ce))}),A};M();var O=N.get(t),z=aG(O,A),B=R.get(z),V=iG(e,c(B,!0).length===1,n,k);if(!V&&k!==$h&&k!==Bh)return;(Gk.includes(k)||[$h,Bh].includes(k))&&P.preventDefault();var G=function(ve){if(ve){var ie=ve,ce=ve.querySelector("a");ce!=null&&ce.getAttribute("href")&&(ie=ce);var oe=R.get(ve);o(oe),w(),v.current=nr(function(){y.current===oe&&ie.focus()})}};if([$h,Bh].includes(k)||V.sibling||!z){var j;!z||e==="inline"?j=i.current:j=oG(z);var X,Y=JD(j,A);k===$h?X=Y[0]:k===Bh?X=Y[Y.length-1]:X=qk(j,A,z,V.offset),G(X)}else if(V.inlineTrigger)f(B);else if(V.offset>0)f(B,!0),w(),v.current=nr(function(){M();var J=z.getAttribute("aria-controls"),ve=document.getElementById(J),ie=qk(ve,A);G(ie)},5);else if(V.offset<0){var se=c(B,!0),ee=se[se.length-2],Z=N.get(ee);f(ee,!1),G(Z)}}p==null||p(P)}}function lG(e){Promise.resolve().then(e)}var z2="__RC_UTIL_PATH_SPLIT__",Zk=function(t){return t.join(z2)},uG=function(t){return t.split(z2)},Yw="rc-menu-more";function cG(){var e=C.exports.useState({}),t=ze(e,2),n=t[1],r=C.exports.useRef(new Map),i=C.exports.useRef(new Map),s=C.exports.useState([]),c=ze(s,2),o=c[0],f=c[1],p=C.exports.useRef(0),v=C.exports.useRef(!1),y=function(){v.current||n({})},w=C.exports.useCallback(function(O,z){var B=Zk(z);i.current.set(B,O),r.current.set(O,B),p.current+=1;var V=p.current;lG(function(){V===p.current&&y()})},[]),P=C.exports.useCallback(function(O,z){var B=Zk(z);i.current.delete(B),r.current.delete(O)},[]),k=C.exports.useCallback(function(O){f(O)},[]),A=C.exports.useCallback(function(O,z){var B=r.current.get(O)||"",V=uG(B);return z&&o.includes(V[0])&&V.unshift(Yw),V},[o]),N=C.exports.useCallback(function(O,z){return O.some(function(B){var V=A(B,!0);return V.includes(z)})},[A]),R=function(){var z=Et(r.current.keys());return o.length&&z.push(Yw),z},M=C.exports.useCallback(function(O){var z="".concat(r.current.get(O)).concat(z2),B=new Set;return Et(i.current.keys()).forEach(function(V){V.startsWith(z)&&B.add(i.current.get(V))}),B},[]);return C.exports.useEffect(function(){return function(){v.current=!0}},[]),{registerPath:w,unregisterPath:P,refreshOverflowKeys:k,isSubPathKey:N,getKeyPath:A,getKeys:R,getSubPathKeys:M}}function bd(e){var t=C.exports.useRef(e);t.current=e;var n=C.exports.useCallback(function(){for(var r,i=arguments.length,s=new Array(i),c=0;c1&&(M.motionAppear=!1);var O=M.onVisibleChanged;return M.onVisibleChanged=function(z){return!w.current&&!z&&N(!0),O==null?void 0:O(z)},A?null:I(Zp,{mode:s,locked:!w.current,children:I(Sa,{visible:R,...M,forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(o,"-hidden"),children:function(z){var B=z.className,V=z.style;return I(F2,{id:t,className:B,style:V,children:i})}})})}var kG=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],IG=["active"],RG=function(t){var n,r=t.style,i=t.className,s=t.title,c=t.eventKey;t.warnKey;var o=t.disabled,f=t.internalPopupClose,p=t.children,v=t.itemIcon,y=t.expandIcon,w=t.popupClassName,P=t.popupOffset,k=t.onClick,A=t.onMouseEnter,N=t.onMouseLeave,R=t.onTitleClick,M=t.onTitleMouseEnter,O=t.onTitleMouseLeave,z=Rn(t,kG),B=GD(c),V=C.exports.useContext(Ga),G=V.prefixCls,j=V.mode,X=V.openKeys,Y=V.disabled,se=V.overflowDisabled,ee=V.activeKey,Z=V.selectedKeys,J=V.itemIcon,ve=V.expandIcon,ie=V.onItemClick,ce=V.onOpenChange,oe=V.onActive,ye=C.exports.useContext(L2),Ie=ye._internalRenderSubMenuItem,Te=C.exports.useContext(XD),Pe=Te.isSubPathKey,De=Ef(),Re="".concat(G,"-submenu"),ke=Y||o,Oe=C.exports.useRef(),$e=C.exports.useRef(),He=v||J,Ue=y||ve,st=X.includes(c),ft=!se&&st,It=Pe(Z,c),We=eL(c,ke,M,O),Pt=We.active,pt=Rn(We,IG),Rt=C.exports.useState(!1),yt=ze(Rt,2),Mt=yt[0],ut=yt[1],dt=function(Cn){ke||ut(Cn)},ct=function(Cn){dt(!0),A==null||A({key:c,domEvent:Cn})},rt=function(Cn){dt(!1),N==null||N({key:c,domEvent:Cn})},ht=C.exports.useMemo(function(){return Pt||(j!=="inline"?Mt||Pe([ee],c):!1)},[j,Pt,ee,Mt,c,Pe]),bt=nL(De.length),Wt=function(Cn){ke||(R==null||R({key:c,domEvent:Cn}),j==="inline"&&ce(c,!st))},Ut=bd(function(nn){k==null||k(Vy(nn)),ie(nn)}),Jt=function(Cn){j!=="inline"&&ce(c,Cn)},Fe=function(){oe(c)},Ge=B&&"".concat(B,"-popup"),Zt=Qe("div",{role:"menuitem",style:bt,className:"".concat(Re,"-title"),tabIndex:ke?null:-1,ref:Oe,title:typeof s=="string"?s:null,"data-menu-id":se&&B?null:B,"aria-expanded":ft,"aria-haspopup":!0,"aria-controls":Ge,"aria-disabled":ke,onClick:Wt,onFocus:Fe,...pt,children:[s,I(tL,{icon:j!=="horizontal"?Ue:null,props:ge(ge({},t),{},{isOpen:ft,isSubMenu:!0}),children:I("i",{className:"".concat(Re,"-arrow")})})]}),cn=C.exports.useRef(j);if(j!=="inline"&&De.length>1?cn.current="vertical":cn.current=j,!se){var jt=cn.current;Zt=I(PG,{mode:jt,prefixCls:Re,visible:!f&&ft&&j!=="inline",popupClassName:w,popupOffset:P,popup:I(Zp,{mode:jt==="horizontal"?"vertical":jt,children:I(F2,{id:Ge,ref:$e,children:p})}),disabled:ke,onVisibleChange:Jt,children:Zt})}var Kt=Qe(vs.Item,{role:"none",...z,component:"li",style:r,className:Xe(Re,"".concat(Re,"-").concat(j),i,(n={},re(n,"".concat(Re,"-open"),ft),re(n,"".concat(Re,"-active"),ht),re(n,"".concat(Re,"-selected"),It),re(n,"".concat(Re,"-disabled"),ke),n)),onMouseEnter:ct,onMouseLeave:rt,children:[Zt,!se&&I(TG,{id:Ge,open:ft,keyPath:De,children:p})]});return Ie&&(Kt=Ie(Kt,t,{selected:It,active:ht,open:ft,disabled:ke})),I(Zp,{onItemClick:Ut,mode:j==="horizontal"?"vertical":j,itemIcon:He,expandIcon:Ue,children:Kt})};function ex(e){var t=e.eventKey,n=e.children,r=Ef(t),i=$2(n,r),s=Q0();C.exports.useEffect(function(){if(s)return s.registerPath(t,r),function(){s.unregisterPath(t,r)}},[r]);var c;return s?c=i:c=I(RG,{...e,children:i}),I(ZD.Provider,{value:r,children:c})}var MG=["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"],gd=[],AG=C.exports.forwardRef(function(e,t){var n,r,i=e,s=i.prefixCls,c=s===void 0?"rc-menu":s,o=i.rootClassName,f=i.style,p=i.className,v=i.tabIndex,y=v===void 0?0:v,w=i.items,P=i.children,k=i.direction,A=i.id,N=i.mode,R=N===void 0?"vertical":N,M=i.inlineCollapsed,O=i.disabled,z=i.disabledOverflow,B=i.subMenuOpenDelay,V=B===void 0?.1:B,G=i.subMenuCloseDelay,j=G===void 0?.1:G,X=i.forceSubMenuRender,Y=i.defaultOpenKeys,se=i.openKeys,ee=i.activeKey,Z=i.defaultActiveFirst,J=i.selectable,ve=J===void 0?!0:J,ie=i.multiple,ce=ie===void 0?!1:ie,oe=i.defaultSelectedKeys,ye=i.selectedKeys,Ie=i.onSelect,Te=i.onDeselect,Pe=i.inlineIndent,De=Pe===void 0?24:Pe,Re=i.motion,ke=i.defaultMotions,Oe=i.triggerSubMenuAction,$e=Oe===void 0?"hover":Oe,He=i.builtinPlacements,Ue=i.itemIcon,st=i.expandIcon,ft=i.overflowedIndicator,It=ft===void 0?"...":ft,We=i.overflowedIndicatorPopupClassName,Pt=i.getPopupContainer,pt=i.onClick,Rt=i.onOpenChange,yt=i.onKeyDown;i.openAnimation,i.openTransitionName;var Mt=i._internalRenderMenuItem,ut=i._internalRenderSubMenuItem,dt=Rn(i,MG),ct=C.exports.useMemo(function(){return wG(P,w,gd)},[P,w]),rt=C.exports.useState(!1),ht=ze(rt,2),bt=ht[0],Wt=ht[1],Ut=C.exports.useRef(),Jt=fG(A),Fe=k==="rtl",Ge=Bi(Y,{value:se,postState:function($n){return $n||gd}}),Zt=ze(Ge,2),cn=Zt[0],jt=Zt[1],Kt=function($n){var Jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function br(){jt($n),Rt==null||Rt($n)}Jn?pu.exports.flushSync(br):br()},nn=C.exports.useState(cn),Cn=ze(nn,2),Nn=Cn[0],wt=Cn[1],qt=C.exports.useRef(!1),At=C.exports.useMemo(function(){return(R==="inline"||R==="vertical")&&M?["vertical",M]:[R,!1]},[R,M]),Xt=ze(At,2),en=Xt[0],gt=Xt[1],yn=en==="inline",Sn=C.exports.useState(en),dn=ze(Sn,2),zt=dn[0],ot=dn[1],mt=C.exports.useState(gt),Dt=ze(mt,2),Bt=Dt[0],pn=Dt[1];C.exports.useEffect(function(){ot(en),pn(gt),qt.current&&(yn?jt(Nn):Kt(gd))},[en,gt]);var On=C.exports.useState(0),Zn=ze(On,2),Xn=Zn[0],me=Zn[1],H=Xn>=ct.length-1||zt!=="horizontal"||z;C.exports.useEffect(function(){yn&&wt(cn)},[cn]),C.exports.useEffect(function(){return qt.current=!0,function(){qt.current=!1}},[]);var q=cG(),de=q.registerPath,le=q.unregisterPath,xe=q.refreshOverflowKeys,Ee=q.isSubPathKey,be=q.getKeyPath,Ce=q.getKeys,Le=q.getSubPathKeys,qe=C.exports.useMemo(function(){return{registerPath:de,unregisterPath:le}},[de,le]),Ze=C.exports.useMemo(function(){return{isSubPathKey:Ee}},[Ee]);C.exports.useEffect(function(){xe(H?gd:ct.slice(Xn+1).map(function(Kn){return Kn.key}))},[Xn,H]);var Ve=Bi(ee||Z&&((n=ct[0])===null||n===void 0?void 0:n.key),{value:ee}),Lt=ze(Ve,2),Ct=Lt[0],Je=Lt[1],Ot=bd(function(Kn){Je(Kn)}),Vt=bd(function(){Je(void 0)});C.exports.useImperativeHandle(t,function(){return{list:Ut.current,focus:function($n){var Jn,br=Ct!=null?Ct:(Jn=ct.find(function(gl){return!gl.props.disabled}))===null||Jn===void 0?void 0:Jn.key;if(br){var Cr,Br,so;(Cr=Ut.current)===null||Cr===void 0||(Br=Cr.querySelector("li[data-menu-id='".concat(D2(Jt,br),"']")))===null||Br===void 0||(so=Br.focus)===null||so===void 0||so.call(Br,$n)}}}});var bn=Bi(oe||[],{value:ye,postState:function($n){return Array.isArray($n)?$n:$n==null?gd:[$n]}}),un=ze(bn,2),wn=un[0],Vn=un[1],rr=function($n){if(ve){var Jn=$n.key,br=wn.includes(Jn),Cr;ce?br?Cr=wn.filter(function(so){return so!==Jn}):Cr=[].concat(Et(wn),[Jn]):Cr=[Jn],Vn(Cr);var Br=ge(ge({},$n),{},{selectedKeys:Cr});br?Te==null||Te(Br):Ie==null||Ie(Br)}!ce&&cn.length&&zt!=="inline"&&Kt(gd)},$r=bd(function(Kn){pt==null||pt(Vy(Kn)),rr(Kn)}),sr=bd(function(Kn,$n){var Jn=cn.filter(function(Cr){return Cr!==Kn});if($n)Jn.push(Kn);else if(zt!=="inline"){var br=Le(Kn);Jn=Jn.filter(function(Cr){return!br.has(Cr)})}S2(cn,Jn,!0)||Kt(Jn,!0)}),Mr=bd(Pt),Mn=function($n,Jn){var br=Jn!=null?Jn:!cn.includes($n);sr($n,br)},kn=sG(zt,Ct,Fe,Jt,Ut,Ce,be,Je,Mn,yt);C.exports.useEffect(function(){Wt(!0)},[]);var Dn=C.exports.useMemo(function(){return{_internalRenderMenuItem:Mt,_internalRenderSubMenuItem:ut}},[Mt,ut]),Gr=zt!=="horizontal"||z?ct:ct.map(function(Kn,$n){return I(Zp,{overflowDisabled:$n>Xn,children:Kn},Kn.key)}),yr=I(vs,{id:A,ref:Ut,prefixCls:"".concat(c,"-overflow"),component:"ul",itemComponent:J0,className:Xe(c,"".concat(c,"-root"),"".concat(c,"-").concat(zt),p,(r={},re(r,"".concat(c,"-inline-collapsed"),Bt),re(r,"".concat(c,"-rtl"),Fe),r),o),dir:k,style:f,role:"menu",tabIndex:y,data:Gr,renderRawItem:function($n){return $n},renderRawRest:function($n){var Jn=$n.length,br=Jn?ct.slice(-Jn):null;return I(ex,{eventKey:Yw,title:It,disabled:H,internalPopupClose:Jn===0,popupClassName:We,children:br})},maxCount:zt!=="horizontal"||z?vs.INVALIDATE:vs.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function($n){me($n)},onKeyDown:kn,...dt});return I(L2.Provider,{value:Dn,children:I(WD.Provider,{value:Jt,children:Qe(Zp,{prefixCls:c,rootClassName:o,mode:zt,openKeys:cn,rtl:Fe,disabled:O,motion:bt?Re:null,defaultMotions:bt?ke:null,activeKey:Ct,onActive:Ot,onInactive:Vt,selectedKeys:wn,inlineIndent:De,subMenuOpenDelay:V,subMenuCloseDelay:j,forceSubMenuRender:X,builtinPlacements:He,triggerSubMenuAction:$e,getPopupContainer:Mr,itemIcon:Ue,expandIcon:st,onItemClick:$r,onOpenChange:sr,children:[I(XD.Provider,{value:Ze,children:yr}),I("div",{style:{display:"none"},"aria-hidden":!0,children:I(qD.Provider,{value:qe,children:ct})})]})})})}),NG=["className","title","eventKey","children"],OG=["children"],DG=function(t){var n=t.className,r=t.title;t.eventKey;var i=t.children,s=Rn(t,NG),c=C.exports.useContext(Ga),o=c.prefixCls,f="".concat(o,"-item-group");return Qe("li",{role:"presentation",...s,onClick:function(v){return v.stopPropagation()},className:Xe(f,n),children:[I("div",{role:"presentation",className:"".concat(f,"-title"),title:typeof r=="string"?r:void 0,children:r}),I("ul",{role:"group",className:"".concat(f,"-list"),children:i})]})};function tx(e){var t=e.children,n=Rn(e,OG),r=Ef(n.eventKey),i=$2(t,r),s=Q0();return s?i:I(DG,{...vi(n,["warnKey"]),children:i})}function B2(e){var t=e.className,n=e.style,r=C.exports.useContext(Ga),i=r.prefixCls,s=Q0();return s?null:I("li",{className:Xe("".concat(i,"-item-divider"),t),style:n})}var vm=AG;vm.Item=J0;vm.SubMenu=ex;vm.ItemGroup=tx;vm.Divider=B2;var LG={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 zG=LG;var iL=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:zG})})};iL.displayName="LeftOutlined";const FG=C.exports.forwardRef(iL);var $G={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 BG=$G;var oL=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:BG})})};oL.displayName="RightOutlined";const V2=C.exports.forwardRef(oL);globalThis&&globalThis.__rest;var aL=C.exports.createContext({}),VG=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u"?V=v?N:"":M===!1&&(V="");var G={title:V};!c&&!y&&(G.title=null,G.open=!1);var j=Zi(N).length,X=Qe(J0,{...B,className:Xe((s={},re(s,"".concat(p,"-item-danger"),z),re(s,"".concat(p,"-item-only-child"),(O?j+1:j)===1),s),A),title:typeof M=="string"?M:void 0,children:[li(O,{className:Xe(zo(O)?(o=O.props)===null||o===void 0?void 0:o.className:"","".concat(p,"-item-icon"))}),r.renderItemChildren(y)]});return P||(X=I(io,{...G,placement:w==="rtl"?"left":"right",overlayClassName:"".concat(p,"-inline-collapsed-tooltip"),children:X})),X},r}return Fr(n,[{key:"renderItemChildren",value:function(i){var s=this.context,c=s.prefixCls,o=s.firstLevel,f=this.props,p=f.icon,v=f.children,y=I("span",{className:"".concat(c,"-title-content"),children:v});return(!p||zo(v)&&v.type==="span")&&v&&i&&o&&typeof v=="string"?I("div",{className:"".concat(c,"-inline-collapsed-noicon"),children:v.charAt(0)}):y}},{key:"render",value:function(){return I(aL.Consumer,{children:this.renderItem})}}]),n}(C.exports.Component);U2.contextType=Uy;function lL(e){var t,n=e.popupClassName,r=e.icon,i=e.title,s=e.theme,c=C.exports.useContext(Uy),o=c.prefixCls,f=c.inlineCollapsed,p=c.antdMenuTheme,v=Ef(),y;if(!r)y=f&&!v.length&&i&&typeof i=="string"?I("div",{className:"".concat(o,"-inline-collapsed-noicon"),children:i.charAt(0)}):I("span",{className:"".concat(o,"-title-content"),children:i});else{var w=zo(i)&&i.type==="span";y=Qe(An,{children:[li(r,{className:Xe(zo(r)?(t=r.props)===null||t===void 0?void 0:t.className:"","".concat(o,"-item-icon"))}),w?i:I("span",{className:"".concat(o,"-title-content"),children:i})]})}var P=C.exports.useMemo(function(){return tt(tt({},c),{firstLevel:!1})},[c]);return I(Uy.Provider,{value:P,children:I(ex,{...vi(e,["icon"]),title:y,popupClassName:Xe(o,"".concat(o,"-").concat(s||p),n)})})}var HG=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:1,n=rq++,r=t;function i(){r-=1,r<=0?(e(),delete Wd[n]):Wd[n]=nr(i)}return Wd[n]=nr(i),n}Ky.cancel=function(t){t!==void 0&&(nr.cancel(Wd[t]),delete Wd[t])};Ky.ids=Wd;var I1;function Yk(e){return!e||e.offsetParent===null||e.hidden}function iq(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 oq(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 dL=function(e){ui(n,e);var t=ci(n);function n(){var r;return zr(this,n),r=t.apply(this,arguments),r.containerRef=C.exports.createRef(),r.animationStart=!1,r.destroyed=!1,r.onClick=function(i,s){var c,o,f=r.props,p=f.insertExtraNode,v=f.disabled;if(!(v||!i||Yk(i)||i.className.includes("-leave"))){r.extraNode=document.createElement("div");var y=Ln(r),w=y.extraNode,P=r.context.getPrefixCls;w.className="".concat(P(""),"-click-animating-node");var k=r.getAttributeName();if(i.setAttribute(k,"true"),s&&s!=="#fff"&&s!=="#ffffff"&&s!=="rgb(255, 255, 255)"&&s!=="rgba(255, 255, 255, 1)"&&oq(s)&&!/rgba\((?:\d*, ){3}0\)/.test(s)&&s!=="transparent"){w.style.borderColor=s;var A=((c=i.getRootNode)===null||c===void 0?void 0:c.call(i))||i.ownerDocument,N=(o=iq(A))!==null&&o!==void 0?o:A;I1=hm(` [`.concat(P(""),"-click-animating-without-extra-node='true']::after, .").concat(P(""),`-click-animating-node { --antd-wave-shadow-color: `).concat(s,`; }`),"antd-wave",{csp:r.csp,attachTo:N})}p&&i.appendChild(w),["transition","animation"].forEach(function(R){i.addEventListener("".concat(R,"start"),r.onTransitionStart),i.addEventListener("".concat(R,"end"),r.onTransitionEnd)})}},r.onTransitionStart=function(i){if(!r.destroyed){var s=r.containerRef.current;!i||i.target!==s||r.animationStart||r.resetEffect(s)}},r.onTransitionEnd=function(i){!i||i.animationName!=="fadeEffect"||r.resetEffect(i.target)},r.bindAnimationEvent=function(i){if(!(!i||!i.getAttribute||i.getAttribute("disabled")||i.className.includes("disabled"))){var s=function(o){if(!(o.target.tagName==="INPUT"||Yk(o.target))){r.resetEffect(i);var f=getComputedStyle(i).getPropertyValue("border-top-color")||getComputedStyle(i).getPropertyValue("border-color")||getComputedStyle(i).getPropertyValue("background-color");r.clickWaveTimeoutId=window.setTimeout(function(){return r.onClick(i,f)},0),Ky.cancel(r.animationStartId),r.animationStart=!0,r.animationStartId=Ky(function(){r.animationStart=!1},10)}};return i.addEventListener("click",s,!0),{cancel:function(){i.removeEventListener("click",s,!0)}}}},r.renderWave=function(i){var s=i.csp,c=r.props.children;if(r.csp=s,!C.exports.isValidElement(c))return c;var o=r.containerRef;return Ic(c)&&(o=Po(c.ref,r.containerRef)),li(c,{ref:o})},r}return Fr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var i=this.containerRef.current;!i||i.nodeType!==1||(this.instance=this.bindAnimationEvent(i))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var i=this.context.getPrefixCls,s=this.props.insertExtraNode;return s?"".concat(i(""),"-click-animating"):"".concat(i(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(i){var s=this;if(!(!i||i===this.extraNode||!(i instanceof Element))){var c=this.props.insertExtraNode,o=this.getAttributeName();i.setAttribute(o,"false"),I1&&(I1.innerHTML=""),c&&this.extraNode&&i.contains(this.extraNode)&&i.removeChild(this.extraNode),["transition","animation"].forEach(function(f){i.removeEventListener("".concat(f,"start"),s.onTransitionStart),i.removeEventListener("".concat(f,"end"),s.onTransitionEnd)})}}},{key:"render",value:function(){return I(yu,{children:this.renderWave})}}]),n}(C.exports.Component);dL.contextType=zn;const aq=dL;var sq=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&(Z=A.map(function(ie){return typeof ie=="string"||typeof ie=="number"?I(Hy,{prefixCls:se,disabled:M,value:ie,checked:p===ie,children:ie},ie.toString()):I(Hy,{prefixCls:se,disabled:ie.disabled||M,value:ie.value,checked:p===ie.value,style:ie.style,children:ie.label},"radio-group-value-options-".concat(ie.value))}));var J=z||c,ve=Xe(ee,"".concat(ee,"-").concat(R),(n={},re(n,"".concat(ee,"-").concat(J),J),re(n,"".concat(ee,"-rtl"),s==="rtl"),n),k);return I("div",{...WO(e),className:ve,style:B,onMouseEnter:G,onMouseLeave:j,onFocus:X,onBlur:Y,id:V,ref:t,children:I(pZ,{value:{onChange:y,value:p,disabled:e.disabled,name:e.name,optionType:e.optionType},children:Z})})});const _Z=C.exports.memo(xZ);var bZ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=t||G<0||y&&j>=s}function R(){var V=N1();if(N(V))return M(V);o=setTimeout(R,A(V))}function M(V){return o=void 0,w&&r?P(V):(r=i=void 0,c)}function O(){o!==void 0&&clearTimeout(o),p=0,r=f=i=o=void 0}function z(){return o===void 0?c:M(N1())}function B(){var V=N1(),G=N(V);if(r=arguments,i=this,f=V,G){if(o===void 0)return k(f);if(y)return clearTimeout(o),o=setTimeout(R,t),P(f)}return o===void 0&&(o=setTimeout(R,t)),c}return B.cancel=O,B.flush=z,B}var AZ=MZ;function TL(e,t){var n=new Set;return e.forEach(function(r){t.has(r)||n.add(r)}),n}function NZ(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,i=t.checkable;return!!(n||r)||i===!1}function OZ(e,t,n,r){for(var i=new Set(e),s=new Set,c=0;c<=n;c+=1){var o=t.get(c)||new Set;o.forEach(function(y){var w=y.key,P=y.node,k=y.children,A=k===void 0?[]:k;i.has(w)&&!r(P)&&A.filter(function(N){return!r(N.node)}).forEach(function(N){i.add(N.key)})})}for(var f=new Set,p=n;p>=0;p-=1){var v=t.get(p)||new Set;v.forEach(function(y){var w=y.parent,P=y.node;if(!(r(P)||!y.parent||f.has(y.parent.key))){if(r(y.parent.node)){f.add(w.key);return}var k=!0,A=!1;(w.children||[]).filter(function(N){return!r(N.node)}).forEach(function(N){var R=N.key,M=i.has(R);k&&!M&&(k=!1),!A&&(M||s.has(R))&&(A=!0)}),k&&i.add(w.key),A&&s.add(w.key),f.add(w.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(TL(s,i))}}function DZ(e,t,n,r,i){for(var s=new Set(e),c=new Set(t),o=0;o<=r;o+=1){var f=n.get(o)||new Set;f.forEach(function(w){var P=w.key,k=w.node,A=w.children,N=A===void 0?[]:A;!s.has(P)&&!c.has(P)&&!i(k)&&N.filter(function(R){return!i(R.node)}).forEach(function(R){s.delete(R.key)})})}c=new Set;for(var p=new Set,v=r;v>=0;v-=1){var y=n.get(v)||new Set;y.forEach(function(w){var P=w.parent,k=w.node;if(!(i(k)||!w.parent||p.has(w.parent.key))){if(i(w.parent.node)){p.add(P.key);return}var A=!0,N=!1;(P.children||[]).filter(function(R){return!i(R.node)}).forEach(function(R){var M=R.key,O=s.has(M);A&&!O&&(A=!1),!N&&(O||c.has(M))&&(N=!0)}),A||s.delete(P.key),N&&c.add(P.key),p.add(P.key)}})}return{checkedKeys:Array.from(s),halfCheckedKeys:Array.from(TL(c,s))}}function Qs(e,t,n,r){var i=[],s;r?s=r:s=NZ;var c=new Set(e.filter(function(v){var y=!!n[v];return y||i.push(v),y})),o=new Map,f=0;Object.keys(n).forEach(function(v){var y=n[v],w=y.level,P=o.get(w);P||(P=new Set,o.set(w,P)),P.add(y),f=Math.max(f,w)}),Rr(!i.length,"Tree missing follow keys: ".concat(i.slice(0,100).map(function(v){return"'".concat(v,"'")}).join(", ")));var p;return t===!0?p=OZ(c,o,f,s):p=DZ(c,t.halfCheckedKeys,o,f,s),p}var q2=C.exports.createContext(null),LZ=function(t){for(var n=t.prefixCls,r=t.level,i=t.isStart,s=t.isEnd,c="".concat(n,"-indent-unit"),o=[],f=0;f=0&&n.splice(r,1),n}function Bs(e,t){var n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function Z2(e){return e.split("-")}function kL(e,t){return"".concat(e,"-").concat(t)}function VZ(e){return e&&e.type&&e.type.isTreeNode}function UZ(e,t){var n=[],r=t[e];function i(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(c){var o=c.key,f=c.children;n.push(o),i(f)})}return i(r.children),n}function jZ(e){if(e.parent){var t=Z2(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function KZ(e){var t=Z2(e.pos);return Number(t[t.length-1])===0}function sI(e,t,n,r,i,s,c,o,f,p){var v,y=e.clientX,w=e.clientY,P=e.target.getBoundingClientRect(),k=P.top,A=P.height,N=(p==="rtl"?-1:1)*(((i==null?void 0:i.x)||0)-y),R=(N-12)/r,M=o[n.props.eventKey];if(w-1.5?s({dragNode:ee,dropNode:Z,dropPosition:1})?X=1:J=!1:s({dragNode:ee,dropNode:Z,dropPosition:0})?X=0:s({dragNode:ee,dropNode:Z,dropPosition:1})?X=1:J=!1:s({dragNode:ee,dropNode:Z,dropPosition:1})?X=1:J=!1,{dropPosition:X,dropLevelOffset:Y,dropTargetKey:M.key,dropTargetPos:M.pos,dragOverNodeKey:j,dropContainerKey:X===0?null:((v=M.parent)===null||v===void 0?void 0:v.key)||null,dropAllowed:J}}function lI(e,t){if(!!e){var n=t.multiple;return n?e.slice():e.length?[e[0]]:e}}function O1(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(ln(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return Rr(!1,"`checkedKeys` is not an array or an object"),null;return t}function nC(e,t){var n=new Set;function r(i){if(!n.has(i)){var s=t[i];if(!!s){n.add(i);var c=s.parent,o=s.node;o.disabled||c&&r(c.key)}}}return(e||[]).forEach(function(i){r(i)}),Et(n)}var HZ=["children"];function _m(e,t){return e!=null?e:t}function Wy(e){var t=e||{},n=t.title,r=t._title,i=t.key,s=t.children,c=n||"title";return{title:c,_title:r||[c],key:i||"key",children:s||"children"}}function IL(e){function t(n){var r=Zi(n);return r.map(function(i){if(!VZ(i))return Rr(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var s=i.key,c=i.props,o=c.children,f=Rn(c,HZ),p=ge({key:s},f),v=t(o);return v.length&&(p.children=v),p}).filter(function(i){return i})}return t(e)}function D1(e,t,n){var r=Wy(n),i=r._title,s=r.key,c=r.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,P){for(var k=kL(y?y.pos:"0",P),A=_m(w[s],k),N,R=0;R1&&arguments[1]!==void 0?arguments[1]:{},n=t.initWrapper,r=t.processEntity,i=t.onProcessFinished,s=t.externalGetKey,c=t.childrenPropName,o=t.fieldNames,f=arguments.length>2?arguments[2]:void 0,p=s||f,v={},y={},w={posEntities:v,keyEntities:y};return n&&(w=n(w)||w),WZ(e,function(P){var k=P.node,A=P.index,N=P.pos,R=P.key,M=P.parentPos,O=P.level,z=P.nodes,B={node:k,nodes:z,index:A,key:R,pos:N,level:O},V=_m(R,N);v[N]=B,y[V]=B,B.parent=v[M],B.parent&&(B.parent.children=B.parent.children||[],B.parent.children.push(B)),r&&r(B,w)},{externalGetKey:p,childrenPropName:c,fieldNames:o}),i&&i(w),w}function mp(e,t){var n=t.expandedKeys,r=t.selectedKeys,i=t.loadedKeys,s=t.loadingKeys,c=t.checkedKeys,o=t.halfCheckedKeys,f=t.dragOverNodeKey,p=t.dropPosition,v=t.keyEntities,y=v[e],w={eventKey:e,expanded:n.indexOf(e)!==-1,selected:r.indexOf(e)!==-1,loaded:i.indexOf(e)!==-1,loading:s.indexOf(e)!==-1,checked:c.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 Ci(e){var t=e.data,n=e.expanded,r=e.selected,i=e.checked,s=e.loaded,c=e.loading,o=e.halfChecked,f=e.dragOver,p=e.dragOverGapTop,v=e.dragOverGapBottom,y=e.pos,w=e.active,P=e.eventKey,k=ge(ge({},t),{},{expanded:n,selected:r,checked:i,loaded:s,loading:c,halfChecked:o,dragOver:f,dragOverGapTop:p,dragOverGapBottom:v,pos:y,active:w,key:P});return"props"in k||Object.defineProperty(k,"props",{get:function(){return Rr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),k}var GZ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&(i=G().map(function(ie){return I(Ld,{prefixCls:se,disabled:"disabled"in ie?ie.disabled:y.disabled,value:ie.value,checked:R.includes(ie.value),onChange:ie.onChange,className:"".concat(ee,"-item"),style:ie.style,children:ie.label},ie.value.toString())}));var J={toggleOption:Y,value:R,disabled:y.disabled,name:y.name,registerValue:X,cancelValue:j},ve=Xe(ee,re({},"".concat(ee,"-rtl"),k==="rtl"),f);return I("div",{className:ve,style:p,...Z,ref:n,children:I(RL.Provider,{value:J,children:i})})},ZZ=C.exports.forwardRef(qZ);const XZ=C.exports.memo(ZZ);var YZ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0){var X=o[0]/2;j.paddingLeft=X,j.paddingRight=X}if(o&&o[1]>0&&!p){var Y=o[1]/2;j.paddingTop=Y,j.paddingBottom=Y}return M&&(j.flex=nX(M),f===!1&&!j.minWidth&&(j.minWidth=0)),I("div",{...z,style:tt(tt({},j),O),className:G,ref:t,children:R})});const Gy=iX;var oX=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0?J[0]/-2:void 0,oe=J[1]!=null&&J[1]>0?J[1]/-2:void 0;if(ce&&(ie.marginLeft=ce,ie.marginRight=ce),Y){var ye=ze(J,2);ie.rowGap=ye[1]}else oe&&(ie.marginTop=oe,ie.marginBottom=oe);var Ie=ze(J,2),Te=Ie[0],Pe=Ie[1],De=C.exports.useMemo(function(){return{gutter:[Te,Pe],wrap:y,supportFlexGap:Y}},[Te,Pe,y,Y]);return I(ML.Provider,{value:De,children:I("div",{...w,className:ve,style:tt(tt({},ie),o),ref:t,children:f})})});const AL=aX;var NL=C.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.forceRender,s=e.className,c=e.style,o=e.children,f=e.isActive,p=e.role,v=C.exports.useState(f||i),y=ze(v,2),w=y[0],P=y[1];return C.exports.useEffect(function(){(i||f)&&P(!0)},[i,f]),w?I("div",{ref:t,className:Xe("".concat(r,"-content"),(n={},re(n,"".concat(r,"-content-active"),f),re(n,"".concat(r,"-content-inactive"),!f),n),s),style:c,role:p,children:I("div",{className:"".concat(r,"-content-box"),children:o})}):null});NL.displayName="PanelContent";var sX=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],OL=function(e){ui(n,e);var t=ci(n);function n(){var r;zr(this,n);for(var i=arguments.length,s=new Array(i),c=0;c-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,P=y.openMotion,k=y.accordion,A=y.destroyInactivePanel,N=y.expandIcon,R=y.collapsible,M=f.key||String(p),O=f.props,z=O.header,B=O.headerClass,V=O.destroyInactivePanel,G=O.collapsible,j=!1;k?j=v[0]===M:j=v.indexOf(M)>-1;var X=G!=null?G:R,Y={key:M,panelKey:M,header:z,headerClass:B,isActive:j,prefixCls:w,destroyInactivePanel:V!=null?V:A,openMotion:P,accordion:k,children:f.props.children,onItemClick:X==="disabled"?null:i.onClickItem,expandIcon:N,collapsible:X};return typeof f.type=="string"?f:(Object.keys(Y).forEach(function(se){typeof Y[se]>"u"&&delete Y[se]}),C.exports.cloneElement(f,Y))},i.getItems=function(){var f=i.props.children;return Zi(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 s=r.activeKey,c=r.defaultActiveKey,o=c;return"activeKey"in r&&(o=s),i.state={activeKey:cI(o)},i}return Fr(n,[{key:"shouldComponentUpdate",value:function(i,s){return!Cc(this.props,i)||!Cc(this.state,s)}},{key:"render",value:function(){var i,s=this.props,c=s.prefixCls,o=s.className,f=s.style,p=s.accordion,v=Xe((i={},re(i,c,!0),re(i,o,!!o),i));return I("div",{className:v,style:f,role:p?"tablist":null,children:this.getItems()})}}],[{key:"getDerivedStateFromProps",value:function(i){var s={};return"activeKey"in i&&(s.activeKey=cI(i.activeKey)),s}}]),n}(C.exports.Component);bm.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1};bm.Panel=OL;bm.Panel;var lX=function(t){var n=C.exports.useContext(zn),r=n.getPrefixCls,i=t.prefixCls,s=t.className,c=s===void 0?"":s,o=t.showArrow,f=o===void 0?!0:o,p=r("collapse",i),v=Xe(re({},"".concat(p,"-no-arrow"),!f),c);return I(bm.Panel,{...t,prefixCls:p,className:v})};const uX=lX;var DL=function(t){var n,r=C.exports.useContext(zn),i=r.getPrefixCls,s=r.direction,c=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,P=w===void 0?"start":w,k=i("collapse",c),A=C.exports.useMemo(function(){return P==="left"?"start":P==="right"?"end":P},[P]),N=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=t.expandIcon,G=V?V(B):I(V2,{rotate:B.isActive?90:void 0});return li(G,function(){return{className:Xe(G.props.className,"".concat(k,"-arrow"))}})},R=Xe("".concat(k,"-icon-position-").concat(A),(n={},re(n,"".concat(k,"-borderless"),!v),re(n,"".concat(k,"-rtl"),s==="rtl"),re(n,"".concat(k,"-ghost"),!!y),n),f),M=tt(tt({},qp),{motionAppear:!1,leavedClassName:"".concat(k,"-content-hidden")}),O=function(){var B=t.children;return Zi(B).map(function(V,G){var j;if(!((j=V.props)===null||j===void 0)&&j.disabled){var X=V.key||String(G),Y=V.props,se=Y.disabled,ee=Y.collapsible,Z=tt(tt({},vi(V.props,["disabled"])),{key:X,collapsible:ee!=null?ee:se?"disabled":void 0});return li(V,Z)}return V})};return I(bm,{openMotion:M,...t,expandIcon:N,prefixCls:k,className:R,children:O()})};DL.Panel=uX;const dI=DL;var LL=C.exports.createContext(null),fI=[];function cX(e,t){var n=C.exports.useState(function(){if(!wo())return null;var k=document.createElement("div");return k}),r=ze(n,1),i=r[0],s=C.exports.useRef(!1),c=C.exports.useContext(LL),o=C.exports.useState(fI),f=ze(o,2),p=f[0],v=f[1],y=c||(s.current?void 0:function(k){v(function(A){var N=[k].concat(Et(A));return N})});function w(){i.parentElement||document.body.appendChild(i),s.current=!0}function P(){var k;(k=i.parentElement)===null||k===void 0||k.removeChild(i),s.current=!1}return si(function(){return e?c?c(w):w():P(),P},[e]),si(function(){p.length&&(p.forEach(function(k){return k()}),v(fI))},[p]),[i,y]}var L1;function qy(e){if(typeof document>"u")return 0;if(e||L1===void 0){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var i=t.offsetWidth;n.style.overflow="scroll";var s=t.offsetWidth;i===s&&(s=n.clientWidth),document.body.removeChild(n),L1=i-s}return L1}function hI(e){var t=e.match(/^(.*)px$/),n=Number(t==null?void 0:t[1]);return Number.isNaN(n)?qy():n}function pI(e){if(typeof document>"u"||!e||!(e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),n=t.width,r=t.height;return{width:hI(n),height:hI(r)}}function dX(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var fX="rc-util-locker-".concat(Date.now()),mI=0;function hX(e){var t=!!e,n=C.exports.useState(function(){return mI+=1,"".concat(fX,"_").concat(mI)}),r=ze(n,1),i=r[0];si(function(){if(t){var s=qy(),c=dX();hm(` html body { overflow-y: hidden; `.concat(c?"width: calc(100% - ".concat(s,"px);"):"",` }`),i)}else ek(i);return function(){ek(i)}},[t,i])}var vI=!1;function pX(e){return typeof e=="boolean"&&(vI=e),vI}var gI=function(t){return t===!1?!1:!wo()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},mX=C.exports.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer;e.debug;var s=e.autoDestroy,c=s===void 0?!0:s,o=e.children,f=C.exports.useState(n),p=ze(f,2),v=p[0],y=p[1],w=v||n;C.exports.useEffect(function(){(c||n)&&y(n)},[n,c]);var P=C.exports.useState(function(){return gI(i)}),k=ze(P,2),A=k[0],N=k[1];C.exports.useEffect(function(){var se=gI(i);N(se!=null?se:null)});var R=cX(w&&!A),M=ze(R,2),O=M[0],z=M[1],B=A!=null?A:O;hX(r&&n&&wo()&&(B===O||B===document.body));var V=null;if(o&&Ic(o)&&t){var G=o;V=G.ref}var j=pN(V,t);if(!w||!wo()||A===void 0)return null;var X=B===!1||pX(),Y=o;return t&&(Y=C.exports.cloneElement(o,{ref:j})),I(LL.Provider,{value:z,children:X?Y:pu.exports.createPortal(Y,B)})});function Zy(e){var t=C.exports.useState(e),n=ze(t,2),r=n[0],i=n[1];return C.exports.useEffect(function(){var s=setTimeout(function(){i(e)},e.length?0:10);return function(){clearTimeout(s)}},[e]),r}var yI=[];function z1(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof e=="string"?e:"".concat(n,"-").concat(r),error:e,errorStatus:t}}function zL(e){var t=e.help,n=e.helpStatus,r=e.errors,i=r===void 0?yI:r,s=e.warnings,c=s===void 0?yI:s,o=e.className,f=e.fieldId,p=e.onVisibleChanged,v=C.exports.useContext(A2),y=v.prefixCls,w=C.exports.useContext(zn),P=w.getPrefixCls,k="".concat(y,"-item-explain"),A=P(),N=Zy(i),R=Zy(c),M=C.exports.useMemo(function(){return t!=null?[z1(t,n,"help")]:[].concat(Et(N.map(function(z,B){return z1(z,"error","error",B)})),Et(R.map(function(z,B){return z1(z,"warning","warning",B)})))},[t,n,N,R]),O={};return f&&(O.id="".concat(f,"_help")),I(Sa,{motionDeadline:qp.motionDeadline,motionName:"".concat(A,"-show-help"),visible:!!M.length,onVisibleChanged:p,children:function(z){var B=z.className,V=z.style;return I("div",{...O,className:Xe(k,B,o),style:V,role:"alert",children:I(pO,{keys:M,...qp,motionName:"".concat(A,"-show-help-item"),component:!1,children:function(G){var j=G.key,X=G.error,Y=G.errorStatus,se=G.className,ee=G.style;return I("div",{className:Xe(se,re({},"".concat(k,"-").concat(Y),Y)),style:ee,children:X},j)}})})}})}function xI(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function _I(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function F1(e,t){if(e.clientHeightt||s>e&&c=t&&o>=n?s-e-r:c>t&&on?c-t+i:0}var bI=function(e,t){var n=window,r=t.scrollMode,i=t.block,s=t.inline,c=t.boundary,o=t.skipOverflowHiddenElements,f=typeof c=="function"?c:function(Pt){return Pt!==c};if(!xI(e))throw new TypeError("Invalid target");for(var p,v,y=document.scrollingElement||document.documentElement,w=[],P=e;xI(P)&&f(P);){if((P=(v=(p=P).parentElement)==null?p.getRootNode().host||null:v)===y){w.push(P);break}P!=null&&P===document.body&&F1(P)&&!F1(document.documentElement)||P!=null&&F1(P,o)&&w.push(P)}for(var k=n.visualViewport?n.visualViewport.width:innerWidth,A=n.visualViewport?n.visualViewport.height:innerHeight,N=window.scrollX||pageXOffset,R=window.scrollY||pageYOffset,M=e.getBoundingClientRect(),O=M.height,z=M.width,B=M.top,V=M.right,G=M.bottom,j=M.left,X=i==="start"||i==="nearest"?B:i==="end"?G:B+O/2,Y=s==="center"?j+z/2:s==="end"?V:j,se=[],ee=0;ee=0&&j>=0&&G<=A&&V<=k&&B>=ce&&G<=ye&&j>=Ie&&V<=oe)return se;var Te=getComputedStyle(Z),Pe=parseInt(Te.borderLeftWidth,10),De=parseInt(Te.borderTopWidth,10),Re=parseInt(Te.borderRightWidth,10),ke=parseInt(Te.borderBottomWidth,10),Oe=0,$e=0,He="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-Pe-Re:0,Ue="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-De-ke:0,st="offsetWidth"in Z?Z.offsetWidth===0?0:ie/Z.offsetWidth:0,ft="offsetHeight"in Z?Z.offsetHeight===0?0:ve/Z.offsetHeight:0;if(y===Z)Oe=i==="start"?X:i==="end"?X-A:i==="nearest"?yg(R,R+A,A,De,ke,R+X,R+X+O,O):X-A/2,$e=s==="start"?Y:s==="center"?Y-k/2:s==="end"?Y-k:yg(N,N+k,k,Pe,Re,N+Y,N+Y+z,z),Oe=Math.max(0,Oe+R),$e=Math.max(0,$e+N);else{Oe=i==="start"?X-ce-De:i==="end"?X-ye+ke+Ue:i==="nearest"?yg(ce,ye,ve,De,ke+Ue,X,X+O,O):X-(ce+ve/2)+Ue/2,$e=s==="start"?Y-Ie-Pe:s==="center"?Y-(Ie+ie/2)+He/2:s==="end"?Y-oe+Re+He:yg(Ie,oe,ie,Pe,Re+He,Y,Y+z,z);var It=Z.scrollLeft,We=Z.scrollTop;X+=We-(Oe=Math.max(0,Math.min(We+Oe/ft,Z.scrollHeight-ve/ft+Ue))),Y+=It-($e=Math.max(0,Math.min(It+$e/st,Z.scrollWidth-ie/st+He)))}se.push({el:Z,top:Oe,left:$e})}return se};function FL(e){return e===Object(e)&&Object.keys(e).length!==0}function vX(e,t){t===void 0&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach(function(r){var i=r.el,s=r.top,c=r.left;i.scroll&&n?i.scroll({top:s,left:c,behavior:t}):(i.scrollTop=s,i.scrollLeft=c)})}function gX(e){return e===!1?{block:"end",inline:"nearest"}:FL(e)?e:{block:"start",inline:"nearest"}}function yX(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(FL(t)&&typeof t.behavior=="function")return t.behavior(n?bI(e,t):[]);if(!!n){var r=gX(t);return vX(bI(e,r),r.behavior)}}var xX=["parentNode"],_X="form_item";function vp(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function $L(e,t){if(!!e.length){var n=e.join("_");if(t)return"".concat(t,"_").concat(n);var r=xX.includes(n);return r?"".concat(_X,"_").concat(n):n}}function wI(e){var t=vp(e);return t.join("_")}function BL(e){var t=n2(),n=ze(t,1),r=n[0],i=C.exports.useRef({}),s=C.exports.useMemo(function(){return e!=null?e:tt(tt({},r),{__INTERNAL__:{itemRef:function(o){return function(f){var p=wI(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=vp(o),v=$L(p,s.__INTERNAL__.name),y=v?document.getElementById(v):null;y&&yX(y,tt({scrollMode:"if-needed",block:"nearest"},f))},getFieldInstance:function(o){var f=wI(o);return i.current[f]}})},[e,r]);return[s]}var bX=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0||ke.length>0||e.extra){var Mt=[];(e.help||Re.length>0)&&Mt.push("".concat(We,"_help")),e.extra&&Mt.push("".concat(We,"_extra")),yt["aria-describedby"]=Mt.join(" ")}Re.length>0&&(yt["aria-invalid"]="true"),Pt&&(yt["aria-required"]="true"),Ic(o)&&(yt.ref=Oe(It,o));var ut=new Set([].concat(Et(vp(w)),Et(vp(G))));ut.forEach(function(ct){yt[ct]=function(){for(var rt,ht,bt,Wt,Ut,Jt=arguments.length,Fe=new Array(Jt),Ge=0;Ge"u"||e===null?"":String(e)}var uY=function(t){var n=t.inputElement,r=t.prefixCls,i=t.prefix,s=t.suffix,c=t.addonBefore,o=t.addonAfter,f=t.className,p=t.style,v=t.affixWrapperClassName,y=t.groupClassName,w=t.wrapperClassName,P=t.disabled,k=t.readOnly,A=t.focused,N=t.triggerFocus,R=t.allowClear,M=t.value,O=t.handleReset,z=t.hidden,B=C.exports.useRef(null),V=function(oe){var ye;(ye=B.current)!==null&&ye!==void 0&&ye.contains(oe.target)&&(N==null||N())},G=function(){var oe;if(!R)return null;var ye=!P&&!k&&M,Ie="".concat(r,"-clear-icon"),Te=ln(R)==="object"&&R!==null&&R!==void 0&&R.clearIcon?R.clearIcon:"\u2716";return I("span",{onClick:O,onMouseDown:function(De){return De.preventDefault()},className:Xe(Ie,(oe={},re(oe,"".concat(Ie,"-hidden"),!ye),re(oe,"".concat(Ie,"-has-suffix"),!!s),oe)),role:"button",tabIndex:-1,children:Te})},j=C.exports.cloneElement(n,{value:M,hidden:z});if(WL(t)){var X,Y="".concat(r,"-affix-wrapper"),se=Xe(Y,(X={},re(X,"".concat(Y,"-disabled"),P),re(X,"".concat(Y,"-focused"),A),re(X,"".concat(Y,"-readonly"),k),re(X,"".concat(Y,"-input-with-clear-btn"),s&&R&&M),X),!Wg(t)&&f,v),ee=(s||R)&&Qe("span",{className:"".concat(r,"-suffix"),children:[G(),s]});j=Qe("span",{className:se,style:p,hidden:!Wg(t)&&z,onClick:V,ref:B,children:[i&&I("span",{className:"".concat(r,"-prefix"),children:i}),C.exports.cloneElement(n,{style:null,value:M,hidden:null}),ee]})}if(Wg(t)){var Z="".concat(r,"-group"),J="".concat(Z,"-addon"),ve=Xe("".concat(r,"-wrapper"),Z,w),ie=Xe("".concat(r,"-group-wrapper"),f,y);return I("span",{className:ie,style:p,hidden:z,children:Qe("span",{className:ve,children:[c&&I("span",{className:J,children:c}),C.exports.cloneElement(j,{style:null,hidden:null}),o&&I("span",{className:J,children:o})]})})}return j},cY=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],dY=C.exports.forwardRef(function(e,t){var n=e.autoComplete,r=e.onChange,i=e.onFocus,s=e.onBlur,c=e.onPressEnter,o=e.onKeyDown,f=e.prefixCls,p=f===void 0?"rc-input":f,v=e.disabled,y=e.htmlSize,w=e.className,P=e.maxLength,k=e.suffix,A=e.showCount,N=e.type,R=N===void 0?"text":N,M=e.inputClassName,O=Rn(e,cY),z=Bi(e.defaultValue,{value:e.value}),B=ze(z,2),V=B[0],G=B[1],j=C.exports.useState(!1),X=ze(j,2),Y=X[0],se=X[1],ee=C.exports.useRef(null),Z=function(Pe){ee.current&&lY(ee.current,Pe)};C.exports.useImperativeHandle(t,function(){return{focus:Z,blur:function(){var Pe;(Pe=ee.current)===null||Pe===void 0||Pe.blur()},setSelectionRange:function(Pe,De,Re){var ke;(ke=ee.current)===null||ke===void 0||ke.setSelectionRange(Pe,De,Re)},select:function(){var Pe;(Pe=ee.current)===null||Pe===void 0||Pe.select()},input:ee.current}}),C.exports.useEffect(function(){se(function(Te){return Te&&v?!1:Te})},[v]);var J=function(Pe){e.value===void 0&&G(Pe.target.value),ee.current&&II(ee.current,Pe,r)},ve=function(Pe){c&&Pe.key==="Enter"&&c(Pe),o==null||o(Pe)},ie=function(Pe){se(!0),i==null||i(Pe)},ce=function(Pe){se(!1),s==null||s(Pe)},oe=function(Pe){G(""),Z(),ee.current&&II(ee.current,Pe,r)},ye=function(){var Pe=vi(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return I("input",{autoComplete:n,...Pe,onChange:J,onFocus:ie,onBlur:ce,onKeyDown:ve,className:Xe(p,re({},"".concat(p,"-disabled"),v),M,!Wg(e)&&!WL(e)&&w),ref:ee,size:y,type:R})},Ie=function(){var Pe=Number(P)>0;if(k||A){var De=RI(V),Re=Et(De).length,ke=ln(A)==="object"?A.formatter({value:De,count:Re,maxLength:P}):"".concat(Re).concat(Pe?" / ".concat(P):"");return Qe(An,{children:[!!A&&I("span",{className:Xe("".concat(p,"-show-count-suffix"),re({},"".concat(p,"-show-count-has-suffix"),!!k)),children:ke}),k]})}return null};return I(uY,{...O,prefixCls:p,className:w,inputElement:ye(),handleReset:oe,value:RI(V),focused:Y,triggerFocus:Z,suffix:Ie(),disabled:v})});function GL(e,t){var n=C.exports.useRef([]),r=function(){n.current.push(setTimeout(function(){var s,c,o,f;((s=e.current)===null||s===void 0?void 0:s.input)&&((c=e.current)===null||c===void 0?void 0:c.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&&r(),function(){return n.current.forEach(function(i){i&&clearTimeout(i)})}},[]),r}function fY(e){return!!(e.prefix||e.suffix||e.allowClear)}var hY=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u"||e===null?"":String(e)}function $1(e,t,n,r){if(!!n){var i=t;if(t.type==="click"){var s=e.cloneNode(!0);i=Object.create(t,{target:{value:s},currentTarget:{value:s}}),s.value="",n(i);return}if(r!==void 0){i=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,n(i);return}n(i)}}function mY(e,t){if(!!e){e.focus(t);var n=t||{},r=n.cursor;if(r){var i=e.value.length;switch(r){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i);break}}}}var vY=C.exports.forwardRef(function(e,t){var n,r,i,s=e.prefixCls,c=e.bordered,o=c===void 0?!0:c,f=e.status,p=e.size,v=e.disabled,y=e.onBlur,w=e.onFocus,P=e.suffix,k=e.allowClear,A=e.addonAfter,N=e.addonBefore,R=e.className,M=e.onChange,O=hY(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","onChange"]),z=tr.useContext(zn),B=z.getPrefixCls,V=z.direction,G=z.input,j=B("input",s),X=C.exports.useRef(null),Y=Mc(j,V),se=Y.compactSize,ee=Y.compactItemClassnames,Z=tr.useContext(qa),J=se||p||Z,ve=tr.useContext(dl),ie=v!=null?v:ve,ce=C.exports.useContext(Fo),oe=ce.status,ye=ce.hasFeedback,Ie=ce.feedbackIcon,Te=Sf(oe,f),Pe=fY(e)||!!ye,De=C.exports.useRef(Pe);C.exports.useEffect(function(){Pe&&De.current,De.current=Pe},[Pe]);var Re=GL(X,!0),ke=function(ft){Re(),y==null||y(ft)},Oe=function(ft){Re(),w==null||w(ft)},$e=function(ft){Re(),M==null||M(ft)},He=(ye||P)&&Qe(An,{children:[P,ye&&Ie]}),Ue;return ln(k)==="object"&&(k==null?void 0:k.clearIcon)?Ue=k:k&&(Ue={clearIcon:I(wf,{})}),I(dY,{ref:Po(t,X),prefixCls:j,autoComplete:G==null?void 0:G.autoComplete,...O,disabled:ie||void 0,onBlur:ke,onFocus:Oe,suffix:He,allowClear:Ue,className:Xe(R,ee),onChange:$e,addonAfter:A&&I(lf,{children:I(Gp,{override:!0,status:!0,children:A})}),addonBefore:N&&I(lf,{children:I(Gp,{override:!0,status:!0,children:N})}),inputClassName:Xe((n={},re(n,"".concat(j,"-sm"),J==="small"),re(n,"".concat(j,"-lg"),J==="large"),re(n,"".concat(j,"-rtl"),V==="rtl"),re(n,"".concat(j,"-borderless"),!o),n),!Pe&&Ha(j,Te)),affixWrapperClassName:Xe((r={},re(r,"".concat(j,"-affix-wrapper-sm"),J==="small"),re(r,"".concat(j,"-affix-wrapper-lg"),J==="large"),re(r,"".concat(j,"-affix-wrapper-rtl"),V==="rtl"),re(r,"".concat(j,"-affix-wrapper-borderless"),!o),r),Ha("".concat(j,"-affix-wrapper"),Te,ye)),wrapperClassName:Xe(re({},"".concat(j,"-group-rtl"),V==="rtl")),groupClassName:Xe((i={},re(i,"".concat(j,"-group-wrapper-sm"),J==="small"),re(i,"".concat(j,"-group-wrapper-lg"),J==="large"),re(i,"".concat(j,"-group-wrapper-rtl"),V==="rtl"),i),Ha("".concat(j,"-group-wrapper"),Te,ye))})});const Y2=vY;var gY={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 yY=gY;var qL=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:yY})})};qL.displayName="EyeInvisibleOutlined";const xY=C.exports.forwardRef(qL);var _Y=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1,n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&B1[n])return B1[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),s=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),c=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),o=IY.map(function(p){return"".concat(p,":").concat(r.getPropertyValue(p))}).join(";"),f={sizingStyle:o,paddingSize:s,borderSize:c,boxSizing:i};return t&&n&&(B1[n]=f),f}function MY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;pa||(pa=document.createElement("textarea"),pa.setAttribute("tab-index","-1"),pa.setAttribute("aria-hidden","true"),document.body.appendChild(pa)),e.getAttribute("wrap")?pa.setAttribute("wrap",e.getAttribute("wrap")):pa.removeAttribute("wrap");var i=RY(e,t),s=i.paddingSize,c=i.borderSize,o=i.boxSizing,f=i.sizingStyle;pa.setAttribute("style","".concat(f,";").concat(kY)),pa.value=e.value||e.placeholder||"";var p=void 0,v=void 0,y,w=pa.scrollHeight;if(o==="border-box"?w+=c:o==="content-box"&&(w-=s),n!==null||r!==null){pa.value=" ";var P=pa.scrollHeight-s;n!==null&&(p=P*n,o==="border-box"&&(p=p+s+c),w=Math.max(p,w)),r!==null&&(v=P*r,o==="border-box"&&(v=v+s+c),y=w>v?"":"hidden",w=Math.min(v,w))}var k={height:w,overflowY:y,resize:"none"};return p&&(k.minHeight=p),v&&(k.maxHeight=v),k}var AY=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],V1=0,U1=1,j1=2,NY=C.exports.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-textarea":n;e.onPressEnter;var i=e.defaultValue,s=e.value,c=e.autoSize,o=e.onResize,f=e.className,p=e.style,v=e.disabled,y=e.onChange;e.onInternalAutoSize;var w=Rn(e,AY),P=Bi(i,{value:s,postState:function(Re){return Re!=null?Re:""}}),k=ze(P,2),A=k[0],N=k[1],R=function(Re){N(Re.target.value),y==null||y(Re)},M=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{textArea:M.current}});var O=C.exports.useMemo(function(){return c&&ln(c)==="object"?[c.minRows,c.maxRows]:[]},[c]),z=ze(O,2),B=z[0],V=z[1],G=!!c,j=function(){try{if(document.activeElement===M.current){var Re=M.current,ke=Re.selectionStart,Oe=Re.selectionEnd,$e=Re.scrollTop;M.current.setSelectionRange(ke,Oe),M.current.scrollTop=$e}}catch{}},X=C.exports.useState(j1),Y=ze(X,2),se=Y[0],ee=Y[1],Z=C.exports.useState(),J=ze(Z,2),ve=J[0],ie=J[1],ce=function(){ee(V1)};si(function(){G&&ce()},[s,B,V,G]),si(function(){if(se===V1)ee(U1);else if(se===U1){var De=MY(M.current,!1,B,V);ee(j1),ie(De)}else j()},[se]);var oe=C.exports.useRef(),ye=function(){nr.cancel(oe.current)},Ie=function(Re){se===j1&&(o==null||o(Re),c&&(ye(),oe.current=nr(function(){ce()})))};C.exports.useEffect(function(){return ye},[]);var Te=G?ve:null,Pe=ge(ge({},p),Te);return(se===V1||se===U1)&&(Pe.overflowY="hidden",Pe.overflowX="hidden"),I(cl,{onResize:Ie,disabled:!(c||o),children:I("textarea",{...w,ref:M,style:Pe,className:Xe(r,f,re({},"".concat(r,"-disabled"),v)),disabled:v,value:A,onChange:R})})}),OY=function(e){ui(n,e);var t=ci(n);function n(r){var i;zr(this,n),i=t.call(this,r),i.resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(c){i.resizableTextArea=c},i.handleChange=function(c){var o=i.props.onChange;i.setValue(c.target.value),o&&o(c)},i.handleKeyDown=function(c){var o=i.props,f=o.onPressEnter,p=o.onKeyDown;c.keyCode===13&&f&&f(c),p&&p(c)};var s=typeof r.value>"u"||r.value===null?r.defaultValue:r.value;return i.state={value:s},i}return Fr(n,[{key:"setValue",value:function(i,s){"value"in this.props||this.setState({value:i},s)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I(NY,{...this.props,value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea})}}],[{key:"getDerivedStateFromProps",value:function(i){return"value"in i?{value:i.value}:null}}]),n}(C.exports.Component),DY=ia("text","input");function LY(e){return!!(e.addonBefore||e.addonAfter)}var zY=function(e){ui(n,e);var t=ci(n);function n(){return zr(this,n),t.apply(this,arguments)}return Fr(n,[{key:"renderClearIcon",value:function(i){var s,c=this.props,o=c.value,f=c.disabled,p=c.readOnly,v=c.handleReset,y=c.suffix,w=!f&&!p&&o,P="".concat(i,"-clear-icon");return I(wf,{onClick:v,onMouseDown:function(A){return A.preventDefault()},className:Xe((s={},re(s,"".concat(P,"-hidden"),!w),re(s,"".concat(P,"-has-suffix"),!!y),s),P),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(i,s,c){var o,f=this.props,p=f.value,v=f.allowClear,y=f.className,w=f.style,P=f.direction,k=f.bordered,A=f.hidden,N=f.status,R=c.status,M=c.hasFeedback;if(!v)return li(s,{value:p});var O=Xe("".concat(i,"-affix-wrapper"),"".concat(i,"-affix-wrapper-textarea-with-clear-btn"),Ha("".concat(i,"-affix-wrapper"),Sf(R,N),M),(o={},re(o,"".concat(i,"-affix-wrapper-rtl"),P==="rtl"),re(o,"".concat(i,"-affix-wrapper-borderless"),!k),re(o,"".concat(y),!LY(this.props)&&y),o));return Qe("span",{className:O,style:w,hidden:A,children:[li(s,{style:null,value:p}),this.renderClearIcon(i)]})}},{key:"render",value:function(){var i=this;return I(Fo.Consumer,{children:function(s){var c=i.props,o=c.prefixCls,f=c.inputType,p=c.element;if(f===DY[0])return i.renderTextAreaWithClearIcon(o,p,s)}})}}]),n}(C.exports.Component);const FY=zY;var $Y=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);ir&&(i=t),i}var BY=C.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.bordered,s=i===void 0?!0:i,c=e.showCount,o=c===void 0?!1:c,f=e.maxLength,p=e.className,v=e.style,y=e.size,w=e.disabled,P=e.onCompositionStart,k=e.onCompositionEnd,A=e.onChange,N=e.status,R=$Y(e,["prefixCls","bordered","showCount","maxLength","className","style","size","disabled","onCompositionStart","onCompositionEnd","onChange","status"]),M=C.exports.useContext(zn),O=M.getPrefixCls,z=M.direction,B=C.exports.useContext(qa),V=C.exports.useContext(dl),G=w!=null?w:V,j=C.exports.useContext(Fo),X=j.status,Y=j.hasFeedback,se=j.isFormItemInput,ee=j.feedbackIcon,Z=Sf(X,N),J=C.exports.useRef(null),ve=C.exports.useRef(null),ie=C.exports.useState(!1),ce=ze(ie,2),oe=ce[0],ye=ce[1],Ie=C.exports.useRef(),Te=C.exports.useRef(0),Pe=Bi(R.defaultValue,{value:R.value}),De=ze(Pe,2),Re=De[0],ke=De[1],Oe=R.hidden,$e=function(ct,rt){R.value===void 0&&(ke(ct),rt==null||rt())},He=Number(f)>0,Ue=function(ct){ye(!0),Ie.current=Re,Te.current=ct.currentTarget.selectionStart,P==null||P(ct)},st=function(ct){var rt;ye(!1);var ht=ct.currentTarget.value;if(He){var bt=Te.current>=f+1||Te.current===((rt=Ie.current)===null||rt===void 0?void 0:rt.length);ht=MI(bt,Ie.current,ht,f)}ht!==Re&&($e(ht),$1(ct.currentTarget,ct,A,ht)),k==null||k(ct)},ft=function(ct){var rt=ct.target.value;if(!oe&&He){var ht=ct.target.selectionStart>=f+1||ct.target.selectionStart===rt.length||!ct.target.selectionStart;rt=MI(ht,Re,rt,f)}$e(rt),$1(ct.currentTarget,ct,A,rt)},It=function(ct){var rt,ht,bt;$e(""),(rt=J.current)===null||rt===void 0||rt.focus(),$1((bt=(ht=J.current)===null||ht===void 0?void 0:ht.resizableTextArea)===null||bt===void 0?void 0:bt.textArea,ct,A)},We=O("input",r);C.exports.useImperativeHandle(t,function(){var dt;return{resizableTextArea:(dt=J.current)===null||dt===void 0?void 0:dt.resizableTextArea,focus:function(rt){var ht,bt;mY((bt=(ht=J.current)===null||ht===void 0?void 0:ht.resizableTextArea)===null||bt===void 0?void 0:bt.textArea,rt)},blur:function(){var rt;return(rt=J.current)===null||rt===void 0?void 0:rt.blur()}}});var Pt=I(OY,{...vi(R,["allowClear"]),disabled:G,className:Xe((n={},re(n,"".concat(We,"-borderless"),!s),re(n,p,p&&!o),re(n,"".concat(We,"-sm"),B==="small"||y==="small"),re(n,"".concat(We,"-lg"),B==="large"||y==="large"),n),Ha(We,Z)),style:o?{resize:v==null?void 0:v.resize}:v,prefixCls:We,onCompositionStart:Ue,onChange:ft,onCompositionEnd:st,ref:J}),pt=pY(Re);!oe&&He&&(R.value===null||R.value===void 0)&&(pt=ZL(pt,f));var Rt=I(FY,{disabled:G,...R,prefixCls:We,direction:z,inputType:"text",value:pt,element:Pt,handleReset:It,ref:ve,bordered:s,status:N,style:o?void 0:v});if(o||Y){var yt,Mt=Et(pt).length,ut="";return ln(o)==="object"?ut=o.formatter({value:pt,count:Mt,maxLength:f}):ut="".concat(Mt).concat(He?" / ".concat(f):""),Qe("div",{hidden:Oe,className:Xe("".concat(We,"-textarea"),(yt={},re(yt,"".concat(We,"-textarea-rtl"),z==="rtl"),re(yt,"".concat(We,"-textarea-show-count"),o),re(yt,"".concat(We,"-textarea-in-form-item"),se),yt),Ha("".concat(We,"-textarea"),Z,Y),p),style:v,"data-count":ut,children:[Rt,Y&&I("span",{className:"".concat(We,"-textarea-suffix"),children:ee})]})}return Rt});const XL=BY;var wm=Y2;wm.Group=sY;wm.Search=TY;wm.TextArea=XL;wm.Password=SY;const Xy=wm;var VY={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"};const UY=VY;var YL=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:UY})})};YL.displayName="UpOutlined";const jY=C.exports.forwardRef(YL);function rC(){return typeof BigInt=="function"}function mc(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),t.startsWith(".")&&(t="0".concat(t));var r=t||"0",i=r.split("."),s=i[0]||"0",c=i[1]||"0";s==="0"&&c==="0"&&(n=!1);var o=n?"-":"";return{negative:n,negativeStr:o,trimStr:r,integerStr:s,decimalStr:c,fullStr:"".concat(o).concat(r)}}function Q2(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function Xp(e){var t=String(e);if(Q2(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return r!=null&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&J2(t)?t.length-t.indexOf(".")-1:0}function ox(e){var t=String(e);if(Q2(e)){if(e>Number.MAX_SAFE_INTEGER)return String(rC()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(eNumber.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(i0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":ox(this.number):this.origin}}]),e}(),HY=function(){function e(t){if(zr(this,e),this.origin="",this.negative=void 0,this.integer=void 0,this.decimal=void 0,this.decimalLen=void 0,this.empty=void 0,this.nan=void 0,!t&&t!==0||!String(t).trim()){this.empty=!0;return}if(this.origin=String(t),t==="-"){this.nan=!0;return}var n=t;if(Q2(n)&&(n=Number(n)),n=typeof n=="string"?n:ox(n),J2(n)){var r=mc(n);this.negative=r.negative;var i=r.trimStr.split(".");this.integer=BigInt(i[0]);var s=i[1]||"0";this.decimal=BigInt(s),this.decimalLen=s.length}else this.nan=!0}return Fr(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(n){var r="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(n,"0"));return BigInt(r)}},{key:"negate",value:function(){var n=new e(this.toString());return n.negative=!n.negative,n}},{key:"add",value:function(n){if(this.isInvalidate())return new e(n);var r=new e(n);if(r.isInvalidate())return this;var i=Math.max(this.getDecimalStr().length,r.getDecimalStr().length),s=this.alignDecimal(i),c=r.alignDecimal(i),o=(s+c).toString(),f=mc(o),p=f.negativeStr,v=f.trimStr,y="".concat(p).concat(v.padStart(i+1,"0"));return new e("".concat(y.slice(0,-i),".").concat(y.slice(-i)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(n){return this.toString()===(n==null?void 0:n.toString())}},{key:"lessEquals",value:function(n){return this.add(n.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":mc("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}();function Fa(e){return rC()?new HY(e):new KY(e)}function Gg(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e==="")return"";var i=mc(e),s=i.negativeStr,c=i.integerStr,o=i.decimalStr,f="".concat(t).concat(o),p="".concat(s).concat(c);if(n>=0){var v=Number(o[n]);if(v>=5&&!r){var y=Fa(e).add("".concat(s,"0.").concat("0".repeat(n)).concat(10-v));return Gg(y.toString(),t,n,r)}return n===0?p:"".concat(p).concat(t).concat(o.padEnd(n,"0").slice(0,n))}return f===".0"?p:"".concat(p).concat(f)}var WY=200,GY=600;function qY(e){var t=e.prefixCls,n=e.upNode,r=e.downNode,i=e.upDisabled,s=e.downDisabled,c=e.onStep,o=C.exports.useRef(),f=C.exports.useRef();f.current=c;var p=function(N,R){N.preventDefault(),f.current(R);function M(){f.current(R),o.current=setTimeout(M,WY)}o.current=setTimeout(M,GY)},v=function(){clearTimeout(o.current)};if(C.exports.useEffect(function(){return v},[]),g2())return null;var y="".concat(t,"-handler"),w=Xe(y,"".concat(y,"-up"),re({},"".concat(y,"-up-disabled"),i)),P=Xe(y,"".concat(y,"-down"),re({},"".concat(y,"-down-disabled"),s)),k={unselectable:"on",role:"button",onMouseUp:v,onMouseLeave:v};return Qe("div",{className:"".concat(y,"-wrap"),children:[I("span",{...k,onMouseDown:function(N){p(N,!0)},"aria-label":"Increase Value","aria-disabled":i,className:w,children:n||I("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})}),I("span",{...k,onMouseDown:function(N){p(N,!1)},"aria-label":"Decrease Value","aria-disabled":s,className:P,children:r||I("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})})]})}function ZY(e,t){var n=C.exports.useRef(null);function r(){try{var s=e.selectionStart,c=e.selectionEnd,o=e.value,f=o.substring(0,s),p=o.substring(c);n.current={start:s,end:c,value:o,beforeTxt:f,afterTxt:p}}catch{}}function i(){if(e&&n.current&&t)try{var s=e.value,c=n.current,o=c.beforeTxt,f=c.afterTxt,p=c.start,v=s.length;if(s.endsWith(f))v=s.length-n.current.afterTxt.length;else if(s.startsWith(o))v=o.length;else{var y=o[p-1],w=s.indexOf(y,p-1);w!==-1&&(v=w+1)}e.setSelectionRange(v,v)}catch(P){Rr(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(P.message))}}return[r,i]}const XY=function(){var e=C.exports.useRef(0),t=function(){nr.cancel(e.current)};return C.exports.useEffect(function(){return t},[]),function(n){t(),e.current=nr(function(){n()})}};var YY=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],NI=function(t,n){return t||n.isEmpty()?n.toString():n.toNumber()},OI=function(t){var n=Fa(t);return n.isInvalidate()?null:n},QL=C.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=r===void 0?"rc-input-number":r,s=e.className,c=e.style,o=e.min,f=e.max,p=e.step,v=p===void 0?1:p,y=e.defaultValue,w=e.value,P=e.disabled,k=e.readOnly,A=e.upHandler,N=e.downHandler,R=e.keyboard,M=e.controls,O=M===void 0?!0:M,z=e.stringMode,B=e.parser,V=e.formatter,G=e.precision,j=e.decimalSeparator,X=e.onChange,Y=e.onInput,se=e.onPressEnter,ee=e.onStep,Z=Rn(e,YY),J="".concat(i,"-input"),ve=C.exports.useRef(null),ie=C.exports.useState(!1),ce=ze(ie,2),oe=ce[0],ye=ce[1],Ie=C.exports.useRef(!1),Te=C.exports.useRef(!1),Pe=C.exports.useRef(!1),De=C.exports.useState(function(){return Fa(w!=null?w:y)}),Re=ze(De,2),ke=Re[0],Oe=Re[1];function $e(At){w===void 0&&Oe(At)}var He=C.exports.useCallback(function(At,Xt){if(!Xt)return G>=0?G:Math.max(Xp(At),Xp(v))},[G,v]),Ue=C.exports.useCallback(function(At){var Xt=String(At);if(B)return B(Xt);var en=Xt;return j&&(en=en.replace(j,".")),en.replace(/[^\w.-]+/g,"")},[B,j]),st=C.exports.useRef(""),ft=C.exports.useCallback(function(At,Xt){if(V)return V(At,{userTyping:Xt,input:String(st.current)});var en=typeof At=="number"?ox(At):At;if(!Xt){var gt=He(en,Xt);if(J2(en)&&(j||gt>=0)){var yn=j||".";en=Gg(en,yn,gt)}}return en},[V,He,j]),It=C.exports.useState(function(){var At=y!=null?y:w;return ke.isInvalidate()&&["string","number"].includes(ln(At))?Number.isNaN(At)?"":At:ft(ke.toString(),!1)}),We=ze(It,2),Pt=We[0],pt=We[1];st.current=Pt;function Rt(At,Xt){pt(ft(At.isInvalidate()?At.toString(!1):At.toString(!Xt),Xt))}var yt=C.exports.useMemo(function(){return OI(f)},[f,G]),Mt=C.exports.useMemo(function(){return OI(o)},[o,G]),ut=C.exports.useMemo(function(){return!yt||!ke||ke.isInvalidate()?!1:yt.lessEquals(ke)},[yt,ke]),dt=C.exports.useMemo(function(){return!Mt||!ke||ke.isInvalidate()?!1:ke.lessEquals(Mt)},[Mt,ke]),ct=ZY(ve.current,oe),rt=ze(ct,2),ht=rt[0],bt=rt[1],Wt=function(Xt){return yt&&!Xt.lessEquals(yt)?yt:Mt&&!Mt.lessEquals(Xt)?Mt:null},Ut=function(Xt){return!Wt(Xt)},Jt=function(Xt,en){var gt=Xt,yn=Ut(gt)||gt.isEmpty();if(!gt.isEmpty()&&!en&&(gt=Wt(gt)||gt,yn=!0),!k&&!P&&yn){var Sn=gt.toString(),dn=He(Sn,en);return dn>=0&&(gt=Fa(Gg(Sn,".",dn)),Ut(gt)||(gt=Fa(Gg(Sn,".",dn,!0)))),gt.equals(ke)||($e(gt),X==null||X(gt.isEmpty()?null:NI(z,gt)),w===void 0&&Rt(gt,en)),gt}return ke},Fe=XY(),Ge=function At(Xt){if(ht(),pt(Xt),!Te.current){var en=Ue(Xt),gt=Fa(en);gt.isNaN()||Jt(gt,!0)}Y==null||Y(Xt),Fe(function(){var yn=Xt;B||(yn=Xt.replace(/。/g,".")),yn!==Xt&&At(yn)})},Zt=function(){Te.current=!0},cn=function(){Te.current=!1,Ge(ve.current.value)},jt=function(Xt){Ge(Xt.target.value)},Kt=function(Xt){var en;if(!(Xt&&ut||!Xt&&dt)){Ie.current=!1;var gt=Fa(Pe.current?AI(v):v);Xt||(gt=gt.negate());var yn=(ke||Fa(0)).add(gt.toString()),Sn=Jt(yn,!1);ee==null||ee(NI(z,Sn),{offset:Pe.current?AI(v):v,type:Xt?"up":"down"}),(en=ve.current)===null||en===void 0||en.focus()}},nn=function(Xt){var en=Fa(Ue(Pt)),gt=en;en.isNaN()?gt=ke:gt=Jt(en,Xt),w!==void 0?Rt(ke,!1):gt.isNaN()||Rt(gt,!1)},Cn=function(){Ie.current=!0},Nn=function(Xt){var en=Xt.which,gt=Xt.shiftKey;Ie.current=!0,gt?Pe.current=!0:Pe.current=!1,en===St.ENTER&&(Te.current||(Ie.current=!1),nn(!1),se==null||se(Xt)),R!==!1&&!Te.current&&[St.UP,St.DOWN].includes(en)&&(Kt(St.UP===en),Xt.preventDefault())},wt=function(){Ie.current=!1,Pe.current=!1},qt=function(){nn(!1),ye(!1),Ie.current=!1};return hp(function(){ke.isInvalidate()||Rt(ke,!1)},[G]),hp(function(){var At=Fa(w);Oe(At);var Xt=Fa(Ue(Pt));(!At.equals(Xt)||!Ie.current||V)&&Rt(At,Ie.current)},[w]),hp(function(){V&&bt()},[Pt]),Qe("div",{className:Xe(i,s,(n={},re(n,"".concat(i,"-focused"),oe),re(n,"".concat(i,"-disabled"),P),re(n,"".concat(i,"-readonly"),k),re(n,"".concat(i,"-not-a-number"),ke.isNaN()),re(n,"".concat(i,"-out-of-range"),!ke.isInvalidate()&&!Ut(ke)),n)),style:c,onFocus:function(){ye(!0)},onBlur:qt,onKeyDown:Nn,onKeyUp:wt,onCompositionStart:Zt,onCompositionEnd:cn,onBeforeInput:Cn,children:[O&&I(qY,{prefixCls:i,upNode:A,downNode:N,upDisabled:ut,downDisabled:dt,onStep:Kt}),I("div",{className:"".concat(J,"-wrap"),children:I("input",{autoComplete:"off",role:"spinbutton","aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":ke.isInvalidate()?null:ke.toString(),step:v,...Z,ref:Po(ve,t),className:J,value:Pt,onChange:jt,disabled:P,readOnly:k})})]})});QL.displayName="InputNumber";var QY=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u"?Z:I("span",{className:"".concat(X,"-handler-up-inner"),children:G.upIcon}),J=typeof G.downIcon>"u"?J:I("span",{className:"".concat(X,"-handler-down-inner"),children:G.downIcon}));var ie=C.exports.useContext(Fo),ce=ie.hasFeedback,oe=ie.status,ye=ie.isFormItemInput,Ie=ie.feedbackIcon,Te=Sf(oe,V),Pe=se||P||c,De=C.exports.useContext(dl),Re=k!=null?k:De,ke=Xe((n={},re(n,"".concat(X,"-lg"),Pe==="large"),re(n,"".concat(X,"-sm"),Pe==="small"),re(n,"".concat(X,"-rtl"),s==="rtl"),re(n,"".concat(X,"-borderless"),!z),re(n,"".concat(X,"-in-form-item"),ye),n),Ha(X,Te),ee,w),Oe=I(QL,{ref:y,disabled:Re,className:ke,upHandler:Z,downHandler:J,prefixCls:X,readOnly:B,controls:ve,...j});if(M!=null||ce){var $e,He=Xe("".concat(X,"-affix-wrapper"),Ha("".concat(X,"-affix-wrapper"),Te,ce),($e={},re($e,"".concat(X,"-affix-wrapper-focused"),p),re($e,"".concat(X,"-affix-wrapper-disabled"),e.disabled),re($e,"".concat(X,"-affix-wrapper-sm"),c==="small"),re($e,"".concat(X,"-affix-wrapper-lg"),c==="large"),re($e,"".concat(X,"-affix-wrapper-rtl"),s==="rtl"),re($e,"".concat(X,"-affix-wrapper-readonly"),B),re($e,"".concat(X,"-affix-wrapper-borderless"),!z),re($e,"".concat(w),!(N||R)&&w),$e));Oe=Qe("div",{className:He,style:e.style,onMouseUp:function(){return y.current.focus()},children:[M&&I("span",{className:"".concat(X,"-prefix"),children:M}),li(Oe,{style:null,value:e.value,onFocus:function(yt){var Mt;v(!0),(Mt=e.onFocus)===null||Mt===void 0||Mt.call(e,yt)},onBlur:function(yt){var Mt;v(!1),(Mt=e.onBlur)===null||Mt===void 0||Mt.call(e,yt)}}),ce&&I("span",{className:"".concat(X,"-suffix"),children:Ie})]})}if(N!=null||R!=null){var Ue,st="".concat(X,"-group"),ft="".concat(st,"-addon"),It=N?I("div",{className:ft,children:N}):null,We=R?I("div",{className:ft,children:R}):null,Pt=Xe("".concat(X,"-wrapper"),st,re({},"".concat(st,"-rtl"),s==="rtl")),pt=Xe("".concat(X,"-group-wrapper"),(Ue={},re(Ue,"".concat(X,"-group-wrapper-sm"),c==="small"),re(Ue,"".concat(X,"-group-wrapper-lg"),c==="large"),re(Ue,"".concat(X,"-group-wrapper-rtl"),s==="rtl"),Ue),Ha("".concat(X,"-group-wrapper"),Te,ce),w);Oe=I("div",{className:pt,style:e.style,children:Qe("div",{className:Pt,children:[It&&I(lf,{children:I(Gp,{status:!0,override:!0,children:It})}),li(Oe,{style:null,disabled:Re}),We&&I(lf,{children:I(Gp,{status:!0,override:!0,children:We})})]})})}return Oe});const JL=JY;var eQ={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 tQ=eQ;var ez=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:tQ})})};ez.displayName="DoubleLeftOutlined";const nQ=C.exports.forwardRef(ez);var rQ={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 iQ=rQ;var tz=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:iQ})})};tz.displayName="DoubleRightOutlined";const oQ=C.exports.forwardRef(tz);var Uh=function(t){var n,r="".concat(t.rootPrefixCls,"-item"),i=Xe(r,"".concat(r,"-").concat(t.page),(n={},re(n,"".concat(r,"-active"),t.active),re(n,"".concat(r,"-disabled"),!t.page),re(n,t.className,!!t.className),n)),s=function(){t.onClick(t.page)},c=function(f){t.onKeyPress(f,t.onClick,t.page)};return I("li",{title:t.showTitle?t.page:null,className:i,onClick:s,onKeyPress:c,tabIndex:"0",children:t.itemRender(t.page,"page",I("a",{rel:"nofollow",children:t.page}))})};const Xu={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};var nz=function(e){ui(n,e);var t=ci(n);function n(){var r;zr(this,n);for(var i=arguments.length,s=new Array(i),c=0;c=0||o.relatedTarget.className.indexOf("".concat(y,"-item"))>=0))&&v(r.getValidValue()))},r.go=function(o){var f=r.state.goInputText;f!==""&&(o.keyCode===Xu.ENTER||o.type==="click")&&(r.setState({goInputText:""}),r.props.quickGo(r.getValidValue()))},r}return Fr(n,[{key:"getValidValue",value:function(){var i=this.state.goInputText;return!i||isNaN(i)?void 0:Number(i)}},{key:"getPageSizeOptions",value:function(){var i=this.props,s=i.pageSize,c=i.pageSizeOptions;return c.some(function(o){return o.toString()===s.toString()})?c:c.concat([s.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,s=this.props,c=s.pageSize,o=s.locale,f=s.rootPrefixCls,p=s.changeSize,v=s.quickGo,y=s.goButton,w=s.selectComponentClass,P=s.buildOptionText,k=s.selectPrefixCls,A=s.disabled,N=this.state.goInputText,R="".concat(f,"-options"),M=w,O=null,z=null,B=null;if(!p&&!v)return null;var V=this.getPageSizeOptions();if(p&&M){var G=V.map(function(j,X){return I(M.Option,{value:j.toString(),children:(P||i.buildOptionText)(j)},X)});O=I(M,{disabled:A,prefixCls:k,showSearch:!1,className:"".concat(R,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(c||V[0]).toString(),onChange:this.changeSize,getPopupContainer:function(X){return X.parentNode},"aria-label":o.page_size,defaultOpen:!1,children:G})}return v&&(y&&(B=typeof y=="boolean"?I("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:A,className:"".concat(R,"-quick-jumper-button"),children:o.jump_to_confirm}):I("span",{onClick:this.go,onKeyUp:this.go,children:y})),z=Qe("div",{className:"".concat(R,"-quick-jumper"),children:[o.jump_to,I("input",{disabled:A,type:"text",value:N,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":o.page}),o.page,B]})),Qe("li",{className:"".concat(R),children:[O,z]})}}]),n}(tr.Component);nz.defaultProps={pageSizeOptions:["10","20","50","100"]};const aQ={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 iC(){}function DI(e){var t=Number(e);return typeof t=="number"&&!isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function sQ(e,t,n){return n}function Ol(e,t,n){var r=typeof e>"u"?t.pageSize:e;return Math.floor((n.total-1)/r)+1}var rz=function(e){ui(n,e);var t=ci(n);function n(r){var i;zr(this,n),i=t.call(this,r),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(Ol(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||I("button",{type:"button","aria-label":v,className:"".concat(y,"-item-link")});return typeof p=="function"&&(w=tr.createElement(p,ge({},i.props))),w},i.savePaginationNode=function(p){i.paginationNode=p},i.isValid=function(p){var v=i.props.total;return DI(p)&&p!==i.state.current&&DI(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===Xu.ARROW_UP||p.keyCode===Xu.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===Xu.ENTER?i.handleChange(v):p.keyCode===Xu.ARROW_UP?i.handleChange(v-1):p.keyCode===Xu.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=Ol(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,P=i.state,k=P.pageSize,A=P.current,N=P.currentInputValue;if(i.isValid(p)&&!y){var R=Ol(void 0,i.state,i.props),M=p;return p>R?M=R:p<1&&(M=1),"current"in i.props||i.setState({current:M}),M!==N&&i.setState({currentInputValue:M}),w(M,k),M}return A},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),P=2;P=c?f=c:f=Number(s),f}},{key:"getShowSizeChanger",value:function(){var i=this.props,s=i.showSizeChanger,c=i.total,o=i.totalBoundaryShowSizeChanger;return typeof s<"u"?s:c>o}},{key:"renderPrev",value:function(i){var s=this.props,c=s.prevIcon,o=s.itemRender,f=o(i,"prev",this.getItemIcon(c,"prev page")),p=!this.hasPrev();return C.exports.isValidElement(f)?C.exports.cloneElement(f,{disabled:p}):f}},{key:"renderNext",value:function(i){var s=this.props,c=s.nextIcon,o=s.itemRender,f=o(i,"next",this.getItemIcon(c,"next page")),p=!this.hasNext();return C.exports.isValidElement(f)?C.exports.cloneElement(f,{disabled:p}):f}},{key:"render",value:function(){var i=this,s=this.props,c=s.prefixCls,o=s.className,f=s.style,p=s.disabled,v=s.hideOnSinglePage,y=s.total,w=s.locale,P=s.showQuickJumper,k=s.showLessItems,A=s.showTitle,N=s.showTotal,R=s.simple,M=s.itemRender,O=s.showPrevNextJumpers,z=s.jumpPrevIcon,B=s.jumpNextIcon,V=s.selectComponentClass,G=s.selectPrefixCls,j=s.pageSizeOptions,X=this.state,Y=X.current,se=X.pageSize,ee=X.currentInputValue;if(v===!0&&y<=se)return null;var Z=Ol(void 0,this.state,this.props),J=[],ve=null,ie=null,ce=null,oe=null,ye=null,Ie=P&&P.goButton,Te=k?1:2,Pe=Y-1>0?Y-1:0,De=Y+1y?y:Y*se])});if(R)return Ie&&(typeof Ie=="boolean"?ye=I("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:w.jump_to_confirm}):ye=I("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:Ie}),ye=I("li",{title:A?"".concat(w.jump_to).concat(Y,"/").concat(Z):null,className:"".concat(c,"-simple-pager"),children:ye})),Qe("ul",{className:Xe(c,"".concat(c,"-simple"),re({},"".concat(c,"-disabled"),p),o),style:f,ref:this.savePaginationNode,...Re,children:[ke,I("li",{title:A?w.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:Xe("".concat(c,"-prev"),re({},"".concat(c,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev(),children:this.renderPrev(Pe)}),Qe("li",{title:A?"".concat(Y,"/").concat(Z):null,className:"".concat(c,"-simple-pager"),children:[I("input",{type:"text",value:ee,disabled:p,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),I("span",{className:"".concat(c,"-slash"),children:"/"}),Z]}),I("li",{title:A?w.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:Xe("".concat(c,"-next"),re({},"".concat(c,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext(),children:this.renderNext(De)}),ye]});if(Z<=3+Te*2){var Oe={locale:w,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:A,itemRender:M};Z||J.push(C.exports.createElement(Uh,{...Oe,key:"noPager",page:1,className:"".concat(c,"-item-disabled")}));for(var $e=1;$e<=Z;$e+=1){var He=Y===$e;J.push(C.exports.createElement(Uh,{...Oe,key:$e,page:$e,active:He}))}}else{var Ue=k?w.prev_3:w.prev_5,st=k?w.next_3:w.next_5;O&&(ve=I("li",{title:A?Ue:null,onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:Xe("".concat(c,"-jump-prev"),re({},"".concat(c,"-jump-prev-custom-icon"),!!z)),children:M(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(z,"prev page"))},"prev"),ie=I("li",{title:A?st:null,tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:Xe("".concat(c,"-jump-next"),re({},"".concat(c,"-jump-next-custom-icon"),!!B)),children:M(this.getJumpNextPage(),"jump-next",this.getItemIcon(B,"next page"))},"next")),oe=I(Uh,{locale:w,last:!0,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Z,active:!1,showTitle:A,itemRender:M},Z),ce=I(Uh,{locale:w,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:1,active:!1,showTitle:A,itemRender:M},1);var ft=Math.max(1,Y-Te),It=Math.min(Y+Te,Z);Y-1<=Te&&(It=1+Te*2),Z-Y<=Te&&(ft=Z-Te*2);for(var We=ft;We<=It;We+=1){var Pt=Y===We;J.push(I(Uh,{locale:w,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:We,active:Pt,showTitle:A,itemRender:M},We))}Y-1>=Te*2&&Y!==1+2&&(J[0]=C.exports.cloneElement(J[0],{className:"".concat(c,"-item-after-jump-prev")}),J.unshift(ve)),Z-Y>=Te*2&&Y!==Z-2&&(J[J.length-1]=C.exports.cloneElement(J[J.length-1],{className:"".concat(c,"-item-before-jump-next")}),J.push(ie)),ft!==1&&J.unshift(ce),It!==Z&&J.push(oe)}var pt=!this.hasPrev()||!Z,Rt=!this.hasNext()||!Z;return Qe("ul",{className:Xe(c,o,re({},"".concat(c,"-disabled"),p)),style:f,ref:this.savePaginationNode,...Re,children:[ke,I("li",{title:A?w.prev_page:null,onClick:this.prev,tabIndex:pt?null:0,onKeyPress:this.runIfEnterPrev,className:Xe("".concat(c,"-prev"),re({},"".concat(c,"-disabled"),pt)),"aria-disabled":pt,children:this.renderPrev(Pe)}),J,I("li",{title:A?w.next_page:null,onClick:this.next,tabIndex:Rt?null:0,onKeyPress:this.runIfEnterNext,className:Xe("".concat(c,"-next"),re({},"".concat(c,"-disabled"),Rt)),"aria-disabled":Rt,children:this.renderNext(De)}),I(nz,{disabled:p,locale:w,rootPrefixCls:c,selectComponentClass:V,selectPrefixCls:G,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Y,pageSize:se,pageSizeOptions:j,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ie})]})}}],[{key:"getDerivedStateFromProps",value:function(i,s){var c={};if("current"in i&&(c.current=i.current,i.current!==s.current&&(c.currentInputValue=c.current)),"pageSize"in i&&i.pageSize!==s.pageSize){var o=s.current,f=Ol(i.pageSize,s,i);o=o>f?f:o,"current"in i||(c.current=o,c.currentInputValue=o),c.pageSize=i.pageSize}return c}}]),n}(tr.Component);rz.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:iC,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:iC,locale:aQ,style:{},itemRender:sQ,totalBoundaryShowSizeChanger:50};var iz=function(t){return I(sl,{...t,size:"small"})},oz=function(t){return I(sl,{...t,size:"middle"})};iz.Option=sl.Option;oz.Option=sl.Option;var lQ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof A=="number"){var M,O=k[N],z=O+A,B=[];r.forEach(function(Y){B.push(Y.value)}),B.push(e,t),B.push(o(O));var V=A>0?1:-1;R==="unit"?B.push(o(O+V*n)):B.push(o(z)),B=B.filter(function(Y){return Y!==null}).filter(function(Y){return A<0?Y<=O:Y>=O}),R==="unit"&&(B=B.filter(function(Y){return Y!==O}));var G=R==="unit"?O:z;M=B[0];var j=Math.abs(M-G);if(B.forEach(function(Y){var se=Math.abs(Y-G);se1){var X=Et(k);return X[N]=M,P(X,A-V,N,R)}return M}else{if(A==="min")return e;if(A==="max")return t}},v=function(k,A,N){var R=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",M=k[N],O=p(k,A,N,R);return{value:O,changed:O!==M}},y=function(k){return s===null&&k===0||typeof s=="number"&&k3&&arguments[3]!==void 0?arguments[3]:"unit",M=k.map(f),O=M[N],z=p(M,A,N,R);if(M[N]=z,i===!1){var B=s||0;N>0&&M[N-1]!==O&&(M[N]=Math.max(M[N],M[N-1]+B)),N0;X-=1)for(var Y=!0;y(M[X]-M[X-1])&&Y;){var se=v(M,-1,X-1);M[X-1]=se.value,Y=se.changed}for(var ee=M.length-1;ee>0;ee-=1)for(var Z=!0;y(M[ee]-M[ee-1])&&Z;){var J=v(M,-1,ee-1);M[ee-1]=J.value,Z=J.changed}for(var ve=0;ve=0?ee:!1},[ee,yt]),ut=C.exports.useMemo(function(){var me=Object.keys(Re||{});return me.map(function(H){var q=Re[H],de={value:Number(H)};return q&&ln(q)==="object"&&!C.exports.isValidElement(q)&&("label"in q||"style"in q)?(de.style=q.style,de.label=q.label):de.label=q,de}).filter(function(H){var q=H.label;return q||typeof q=="number"}).sort(function(H,q){return H.value-q.value})},[Re]),dt=HQ(pt,Rt,yt,ut,Y,Mt),ct=ze(dt,2),rt=ct[0],ht=ct[1],bt=Bi(O,{value:M}),Wt=ze(bt,2),Ut=Wt[0],Jt=Wt[1],Fe=C.exports.useMemo(function(){var me=Ut==null?[]:Array.isArray(Ut)?Ut:[Ut],H=ze(me,1),q=H[0],de=q===void 0?pt:q,le=Ut===null?[]:[de];if(z){if(le=Et(me),B||Ut===void 0){var xe=B>=0?B+1:2;for(le=le.slice(0,xe);le.length=0&&It.current.focus(me)}wt(null)},[Nn]);var At=C.exports.useMemo(function(){return Z&&yt===null?!1:Z},[Z,yt]),Xt=function(){j==null||j(Zt(Ge.current))},en=FQ(We,Pt,Fe,pt,Rt,rt,cn,Xt,ht),gt=ze(en,4),yn=gt[0],Sn=gt[1],dn=gt[2],zt=gt[3],ot=function(H,q){zt(H,q),G==null||G(Zt(Ge.current))},mt=yn!==-1;C.exports.useEffect(function(){if(!mt){var me=Fe.lastIndexOf(Sn);It.current.focus(me)}},[mt]);var Dt=C.exports.useMemo(function(){return Et(dn).sort(function(me,H){return me-H})},[dn]),Bt=C.exports.useMemo(function(){return z?[Dt[0],Dt[Dt.length-1]]:[pt,Dt[0]]},[Dt,z,pt]),pn=ze(Bt,2),On=pn[0],Zn=pn[1];C.exports.useImperativeHandle(t,function(){return{focus:function(){It.current.focus(0)},blur:function(){var H=document,q=H.activeElement;We.current.contains(q)&&(q==null||q.blur())}}}),C.exports.useEffect(function(){p&&It.current.focus(0)},[]);var Xn=C.exports.useMemo(function(){return{min:pt,max:Rt,direction:Pt,disabled:f,step:yt,included:ce,includedStart:On,includedEnd:Zn,range:z,tabIndex:He,ariaLabelForHandle:Ue,ariaLabelledByForHandle:st,ariaValueTextFormatterForHandle:ft}},[pt,Rt,Pt,f,yt,ce,On,Zn,z,He,Ue,st,ft]);return I(Ac.Provider,{value:Xn,children:Qe("div",{ref:We,className:Xe(i,s,(n={},re(n,"".concat(i,"-disabled"),f),re(n,"".concat(i,"-vertical"),ve),re(n,"".concat(i,"-horizontal"),!ve),re(n,"".concat(i,"-with-marks"),ut.length),n)),style:c,onMouseDown:Kt,children:[I("div",{className:"".concat(i,"-rail"),style:Te}),I(BQ,{prefixCls:i,style:ye,values:Dt,startPoint:oe,onStartMove:At?ot:null}),I(KQ,{prefixCls:i,marks:ut,dots:ke,style:Pe,activeStyle:De}),I(zQ,{ref:It,prefixCls:i,style:Ie,values:dn,draggingIndex:yn,onStartMove:ot,onOffsetChange:qt,onFocus:v,onBlur:y,handleRender:Oe}),I(UQ,{prefixCls:i,marks:ut,onClick:jt})]})})}),GQ=C.exports.forwardRef(function(e,t){var n=e.open,r=C.exports.useRef(null),i=C.exports.useRef(null);function s(){nr.cancel(i.current),i.current=null}function c(){i.current=nr(function(){var o;(o=r.current)===null||o===void 0||o.forcePopupAlign(),i.current=null})}return C.exports.useEffect(function(){return n?c():s(),s},[n,e.title]),I(io,{ref:Po(r,t),...e})});const qQ=GQ;var ZQ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=n}function oJ(e){return e&&ln(e)==="object"&&!Array.isArray(e)&&!C.exports.isValidElement(e)}function aJ(e){return typeof e=="string"?!0:Ic(e)}var sJ=function(t){var n=t.ellipsis,r=t.rowType,i=t.children,s,c=n===!0?{showTitle:!0}:n;return c&&(c.showTitle||r==="header")&&(typeof i=="string"||typeof i=="number"?s=i.toString():C.exports.isValidElement(i)&&typeof i.props.children=="string"&&(s=i.props.children)),s};function lJ(e,t){var n,r,i,s=e.prefixCls,c=e.className,o=e.record,f=e.index,p=e.renderIndex,v=e.dataIndex,y=e.render,w=e.children,P=e.component,k=P===void 0?"td":P,A=e.colSpan,N=e.rowSpan,R=e.fixLeft,M=e.fixRight,O=e.firstFixLeft,z=e.lastFixLeft,B=e.firstFixRight,V=e.lastFixRight,G=e.appendNode,j=e.additionalProps,X=j===void 0?{}:j,Y=e.ellipsis,se=e.align,ee=e.rowType,Z=e.isSticky,J=e.hovering,ve=e.onHover,ie="".concat(s,"-cell"),ce=C.exports.useContext(bz),oe=C.exports.useContext(xz),ye=C.exports.useContext(sx),Ie=ye.allColumnsFixedLeft,Te=C.exports.useMemo(function(){if(sC(w))return[w];var rt=yz(o,v),ht=rt,bt=void 0;if(y){var Wt=y(rt,o,p);oJ(Wt)?(ht=Wt.children,bt=Wt.props,ce.renderWithProps=!0):ht=Wt}return[ht,bt]},[ce.renderWithProps?Math.random():0,w,v,ce,o,y,p]),Pe=ze(Te,2),De=Pe[0],Re=Pe[1],ke=De;ln(ke)==="object"&&!Array.isArray(ke)&&!C.exports.isValidElement(ke)&&(ke=null),Y&&(z||B)&&(ke=I("span",{className:"".concat(ie,"-content"),children:ke}));var Oe=Re||{},$e=Oe.colSpan,He=Oe.rowSpan,Ue=Oe.style,st=Oe.className,ft=Rn(Oe,rJ),It=(n=$e!==void 0?$e:A)!==null&&n!==void 0?n:1,We=(r=He!==void 0?He:N)!==null&&r!==void 0?r:1;if(It===0||We===0)return null;var Pt={},pt=typeof R=="number"&&oe,Rt=typeof M=="number"&&oe;pt&&(Pt.position="sticky",Pt.left=R),Rt&&(Pt.position="sticky",Pt.right=M);var yt={};se&&(yt.textAlign=se);var Mt=function(ht){var bt;o&&ve(f,f+We-1),X==null||(bt=X.onMouseEnter)===null||bt===void 0||bt.call(X,ht)},ut=function(ht){var bt;o&&ve(-1,-1),X==null||(bt=X.onMouseLeave)===null||bt===void 0||bt.call(X,ht)},dt=sJ({rowType:ee,ellipsis:Y,children:De}),ct=ge(ge(ge({title:dt},ft),X),{},{colSpan:It!==1?It:null,rowSpan:We!==1?We:null,className:Xe(ie,c,(i={},re(i,"".concat(ie,"-fix-left"),pt&&oe),re(i,"".concat(ie,"-fix-left-first"),O&&oe),re(i,"".concat(ie,"-fix-left-last"),z&&oe),re(i,"".concat(ie,"-fix-left-all"),z&&Ie&&oe),re(i,"".concat(ie,"-fix-right"),Rt&&oe),re(i,"".concat(ie,"-fix-right-first"),B&&oe),re(i,"".concat(ie,"-fix-right-last"),V&&oe),re(i,"".concat(ie,"-ellipsis"),Y),re(i,"".concat(ie,"-with-append"),G),re(i,"".concat(ie,"-fix-sticky"),(pt||Rt)&&Z&&oe),re(i,"".concat(ie,"-row-hover"),!Re&&J),i),X.className,st),style:ge(ge(ge(ge({},X.style),yt),Pt),Ue),onMouseEnter:Mt,onMouseLeave:ut,ref:aJ(k)?t:null});return Qe(k,{...ct,children:[G,ke]})}var wz=C.exports.forwardRef(lJ);wz.displayName="Cell";var uJ=["expanded","className","hovering"],cJ=C.exports.memo(wz,function(e,t){return t.shouldCellUpdate?uJ.every(function(n){return e[n]===t[n]})&&!t.shouldCellUpdate(t.record,e.record):Cc(e,t)}),Sm=C.exports.forwardRef(function(e,t){var n=e.index,r=e.additionalProps,i=r===void 0?{}:r,s=e.colSpan,c=e.rowSpan,o=i.colSpan,f=i.rowSpan,p=s!=null?s:o,v=c!=null?c:f,y=nJ(_z,function(k){var A=iJ(n,v||1,k==null?void 0:k.startRow,k==null?void 0:k.endRow);return{onHover:k==null?void 0:k.onHover,hovering:A}}),w=y.onHover,P=y.hovering;return I(cJ,{...e,colSpan:p,rowSpan:v,hovering:P,ref:t,onHover:w})});Sm.displayName="WrappedCell";var _s=C.exports.createContext(null);function tE(e,t,n,r,i){var s=n[e]||{},c=n[t]||{},o,f;s.fixed==="left"?o=r.left[e]:c.fixed==="right"&&(f=r.right[t]);var p=!1,v=!1,y=!1,w=!1,P=n[t+1],k=n[e-1];if(i==="rtl"){if(o!==void 0){var A=k&&k.fixed==="left";w=!A}else if(f!==void 0){var N=P&&P.fixed==="right";y=!N}}else if(o!==void 0){var R=P&&P.fixed==="left";p=!R}else if(f!==void 0){var M=k&&k.fixed==="right";v=!M}return{fixLeft:o,fixRight:f,lastFixLeft:p,firstFixRight:v,lastFixRight:y,firstFixLeft:w,isSticky:r.isSticky}}function Cz(e){var t=e.cells,n=e.stickyOffsets,r=e.flattenColumns,i=e.rowComponent,s=e.cellComponent,c=e.onHeaderRow,o=e.index,f=C.exports.useContext(_s),p=f.prefixCls,v=f.direction,y;c&&(y=c(t.map(function(P){return P.column}),o));var w=ax(t.map(function(P){return P.column}));return I(i,{...y,children:t.map(function(P,k){var A=P.column,N=tE(P.colStart,P.colEnd,r,n,v),R;return A&&A.onHeaderCell&&(R=P.column.onHeaderCell(A)),C.exports.createElement(Sm,{...P,ellipsis:A.ellipsis,align:A.align,component:s,prefixCls:p,key:w[k],...N,additionalProps:R,rowType:"header"})})})}Cz.displayName="HeaderRow";function dJ(e){var t=[];function n(c,o){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[f]=t[f]||[];var p=o,v=c.filter(Boolean).map(function(y){var w={key:y.key,className:y.className||"",children:y.title,column:y,colStart:p},P=1,k=y.children;return k&&k.length>0&&(P=n(k,p,f+1).reduce(function(A,N){return A+N},0),w.hasSubColumns=!0),"colSpan"in y&&(P=y.colSpan),"rowSpan"in y&&(w.rowSpan=y.rowSpan),w.colSpan=P,w.colEnd=w.colStart+P-1,t[f].push(w),p+=P,P});return v}n(e,0);for(var r=t.length,i=function(o){t[o].forEach(function(f){!("rowSpan"in f)&&!f.hasSubColumns&&(f.rowSpan=r-o)})},s=0;s1?pt-1:0),yt=1;yt0?[].concat(Et(t),Et(lC(s).map(function(c){return ge({fixed:i},c)}))):[].concat(Et(t),[ge(ge({},n),{},{fixed:i})])},[])}function _J(e){return e.map(function(t){var n=t.fixed,r=Rn(t,xJ),i=n;return n==="left"?i="right":n==="right"&&(i="left"),ge({fixed:i},r)})}function bJ(e,t){var n=e.prefixCls,r=e.columns,i=e.children,s=e.expandable,c=e.expandedKeys,o=e.columnTitle,f=e.getRowKey,p=e.onTriggerExpand,v=e.expandIcon,y=e.rowExpandable,w=e.expandIconColumnIndex,P=e.direction,k=e.expandRowByClick,A=e.columnWidth,N=e.fixed,R=C.exports.useMemo(function(){return r||nE(i)},[r,i]),M=C.exports.useMemo(function(){if(s){var B,V=R.slice();if(!V.includes(Yu)){var G=w||0;G>=0&&V.splice(G,0,Yu)}var j=V.indexOf(Yu);V=V.filter(function(ee,Z){return ee!==Yu||Z===j});var X=R[j],Y;(N==="left"||N)&&!w?Y="left":(N==="right"||N)&&w===R.length?Y="right":Y=X?X.fixed:null;var se=(B={},re(B,gp,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),re(B,"title",o),re(B,"fixed",Y),re(B,"className","".concat(n,"-row-expand-icon-cell")),re(B,"width",A),re(B,"render",function(Z,J,ve){var ie=f(J,ve),ce=c.has(ie),oe=y?y(J):!0,ye=v({prefixCls:n,expanded:ce,expandable:oe,record:J,onExpand:p});return k?I("span",{onClick:function(Te){return Te.stopPropagation()},children:ye}):ye}),B);return V.map(function(ee){return ee===Yu?se:ee})}return R.filter(function(ee){return ee!==Yu})},[s,R,f,c,v,P]),O=C.exports.useMemo(function(){var B=M;return t&&(B=t(B)),B.length||(B=[{render:function(){return null}}]),B},[t,M,P]),z=C.exports.useMemo(function(){return P==="rtl"?_J(lC(O)):lC(O)},[O,P]);return[O,z]}function Rz(e){var t=C.exports.useRef(e),n=C.exports.useState({}),r=ze(n,2),i=r[1],s=C.exports.useRef(null),c=C.exports.useRef([]);function o(f){c.current.push(f);var p=Promise.resolve();s.current=p,p.then(function(){if(s.current===p){var v=c.current,y=t.current;c.current=[],v.forEach(function(w){t.current=w(t.current)}),s.current=null,y!==t.current&&i({})}})}return C.exports.useEffect(function(){return function(){s.current=null}},[]),[t.current,o]}function wJ(e){var t=C.exports.useRef(e||null),n=C.exports.useRef();function r(){window.clearTimeout(n.current)}function i(c){t.current=c,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)}function s(){return t.current}return C.exports.useEffect(function(){return r},[]),[i,s]}function CJ(e,t,n){var r=C.exports.useMemo(function(){for(var i=[],s=[],c=0,o=0,f=0;f=0;o-=1){var f=t[o],p=n&&n[o],v=p&&p[gp];if(f||v||c){var y=v||{};y.columnType;var w=Rn(y,SJ);i.unshift(I("col",{style:{width:f},...w},o)),c=!0}}return I("colgroup",{children:i})}function UI(e){var t=e.className,n=e.children;return I("div",{className:t,children:n})}var Az=C.exports.createContext({});function EJ(e){var t=e.className,n=e.index,r=e.children,i=e.colSpan,s=i===void 0?1:i,c=e.rowSpan,o=e.align,f=C.exports.useContext(_s),p=f.prefixCls,v=f.direction,y=C.exports.useContext(Az),w=y.scrollColumnIndex,P=y.stickyOffsets,k=y.flattenColumns,A=n+s-1,N=A+1===w?s+1:s,R=tE(n,n+N-1,k,P,v);return I(Sm,{className:t,index:n,component:"td",prefixCls:p,record:null,dataIndex:null,align:o,colSpan:N,rowSpan:c,render:function(){return r},...R})}var PJ=["children"];function TJ(e){var t=e.children,n=Rn(e,PJ);return I("tr",{...n,children:t})}function lx(e){var t=e.children;return t}lx.Row=TJ;lx.Cell=EJ;function xg(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,i=C.exports.useContext(_s),s=i.prefixCls,c=r.length-1,o=r[c],f=C.exports.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:o!=null&&o.scrollbar?c:null}},[o,r,c,n]);return I(Az.Provider,{value:f,children:I("tfoot",{className:"".concat(s,"-summary"),children:t})})}var Nz=lx;function kJ(e){var t,n=e.prefixCls,r=e.record,i=e.onExpand,s=e.expanded,c=e.expandable,o="".concat(n,"-row-expand-icon");if(!c)return I("span",{className:Xe(o,"".concat(n,"-row-spaced"))});var f=function(v){i(r,v),v.stopPropagation()};return I("span",{className:Xe(o,(t={},re(t,"".concat(n,"-row-expanded"),s),re(t,"".concat(n,"-row-collapsed"),!s),t)),onClick:f})}function IJ(e,t,n){var r=[];function i(s){(s||[]).forEach(function(c,o){r.push(t(c,o)),i(c[n])})}return i(e),r}var RJ=function(t,n){var r,i,s=t.scrollBodyRef,c=t.onScroll,o=t.offsetScroll,f=t.container,p=C.exports.useContext(_s),v=p.prefixCls,y=((r=s.current)===null||r===void 0?void 0:r.scrollWidth)||0,w=((i=s.current)===null||i===void 0?void 0:i.clientWidth)||0,P=y&&w*(w/y),k=C.exports.useRef(),A=Rz({scrollLeft:0,isHiddenScrollBar:!1}),N=ze(A,2),R=N[0],M=N[1],O=C.exports.useRef({delta:0,x:0}),z=C.exports.useState(!1),B=ze(z,2),V=B[0],G=B[1],j=function(){G(!1)},X=function(J){J.persist(),O.current.delta=J.pageX-R.scrollLeft,O.current.x=0,G(!0),J.preventDefault()},Y=function(J){var ve,ie=J||((ve=window)===null||ve===void 0?void 0:ve.event),ce=ie.buttons;if(!V||ce===0){V&&G(!1);return}var oe=O.current.x+J.pageX-O.current.x-O.current.delta;oe<=0&&(oe=0),oe+P>=w&&(oe=w-P),c({scrollLeft:oe/w*(y+2)}),O.current.x=J.pageX},se=function(){if(!!s.current){var J=SI(s.current).top,ve=J+s.current.offsetHeight,ie=f===window?document.documentElement.scrollTop+window.innerHeight:SI(f).top+f.clientHeight;ve-qy()<=ie||J>=ie-o?M(function(ce){return ge(ge({},ce),{},{isHiddenScrollBar:!0})}):M(function(ce){return ge(ge({},ce),{},{isHiddenScrollBar:!1})})}},ee=function(J){M(function(ve){return ge(ge({},ve),{},{scrollLeft:J/y*w||0})})};return C.exports.useImperativeHandle(n,function(){return{setScrollLeft:ee}}),C.exports.useEffect(function(){var Z=Xs(document.body,"mouseup",j,!1),J=Xs(document.body,"mousemove",Y,!1);return se(),function(){Z.remove(),J.remove()}},[P,V]),C.exports.useEffect(function(){var Z=Xs(f,"scroll",se,!1),J=Xs(window,"resize",se,!1);return function(){Z.remove(),J.remove()}},[f]),C.exports.useEffect(function(){R.isHiddenScrollBar||M(function(Z){var J=s.current;return J?ge(ge({},Z),{},{scrollLeft:J.scrollLeft/J.scrollWidth*J.clientWidth}):Z})},[R.isHiddenScrollBar]),y<=w||!P||R.isHiddenScrollBar?null:I("div",{style:{height:qy(),width:w,bottom:o},className:"".concat(v,"-sticky-scroll"),children:I("div",{onMouseDown:X,ref:k,className:Xe("".concat(v,"-sticky-scroll-bar"),re({},"".concat(v,"-sticky-scroll-bar-active"),V)),style:{width:"".concat(P,"px"),transform:"translate3d(".concat(R.scrollLeft,"px, 0, 0)")}})})};const MJ=C.exports.forwardRef(RJ);var jI=wo()?window:null;function AJ(e,t){var n=ln(e)==="object"?e:{},r=n.offsetHeader,i=r===void 0?0:r,s=n.offsetSummary,c=s===void 0?0:s,o=n.offsetScroll,f=o===void 0?0:o,p=n.getContainer,v=p===void 0?function(){return jI}:p,y=v()||jI;return C.exports.useMemo(function(){var w=!!e;return{isSticky:w,stickyClassName:w?"".concat(t,"-sticky-holder"):"",offsetHeader:i,offsetSummary:c,offsetScroll:f,container:y}},[f,i,c,t,y])}var NJ=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function OJ(e,t){return C.exports.useMemo(function(){for(var n=[],r=0;r=0})},[s]),Y=s[s.length-1],se={fixed:Y?Y.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(O,"-cell-scrollbar")}}},ee=C.exports.useMemo(function(){return V?[].concat(Et(i),[se]):i},[V,i]),Z=C.exports.useMemo(function(){return V?[].concat(Et(s),[se]):s},[V,s]),J=C.exports.useMemo(function(){var ie=f.right,ce=f.left;return ge(ge({},f),{},{left:p==="rtl"?[].concat(Et(ce.map(function(oe){return oe+V})),[0]):ce,right:p==="rtl"?ie:[].concat(Et(ie.map(function(oe){return oe+V})),[0]),isSticky:B})},[V,f,B]),ve=OJ(c,o);return I("div",{style:ge({overflow:"hidden"},B?{top:y,bottom:w}:{}),ref:j,className:Xe(n,re({},P,!!P)),children:Qe("table",{style:{tableLayout:"fixed",visibility:r||ve?null:"hidden"},children:[(!r||!A||X)&&I(Mz,{colWidths:ve?[].concat(Et(ve),[V]):[],columCount:o+1,columns:Z}),N(ge(ge({},R),{},{stickyOffsets:J,columns:ee,flattenColumns:Z}))]})})});uC.displayName="FixedHolder";var DJ=[],LJ={},Zg="rc-table-internal-hook",zJ=C.exports.memo(function(e){var t=e.children;return t},function(e,t){return Cc(e.props,t.props)?e.pingLeft!==t.pingLeft||e.pingRight!==t.pingRight:!1});function Nc(e){var t,n=e.prefixCls,r=e.className,i=e.rowClassName,s=e.style,c=e.data,o=e.rowKey,f=e.scroll,p=e.tableLayout,v=e.direction,y=e.title,w=e.footer,P=e.summary,k=e.id,A=e.showHeader,N=e.components,R=e.emptyText,M=e.onRow,O=e.onHeaderRow,z=e.internalHooks,B=e.transformColumns,V=e.internalRefs,G=e.sticky,j=c||DJ,X=!!j.length,Y=C.exports.useCallback(function(Bn,Yn){return yz(N||{},Bn)||Yn},[N]),se=C.exports.useMemo(function(){return typeof o=="function"?o:function(Bn){var Yn=Bn&&Bn[o];return Yn}},[o]),ee=gJ(e),Z=ee.expandIcon,J=ee.expandedRowKeys,ve=ee.defaultExpandedRowKeys,ie=ee.defaultExpandAllRows,ce=ee.expandedRowRender,oe=ee.columnTitle,ye=ee.onExpand,Ie=ee.onExpandedRowsChange,Te=ee.expandRowByClick,Pe=ee.rowExpandable,De=ee.expandIconColumnIndex,Re=ee.expandedRowClassName,ke=ee.childrenColumnName,Oe=ee.indentSize,$e=Z||kJ,He=ke||"children",Ue=C.exports.useMemo(function(){return ce?"row":e.expandable&&z===Zg&&e.expandable.__PARENT_RENDER_ICON__||j.some(function(Bn){return Bn&&ln(Bn)==="object"&&Bn[He]})?"nest":!1},[!!ce,j]),st=C.exports.useState(function(){return ve||(ie?IJ(j,se,He):[])}),ft=ze(st,2),It=ft[0],We=ft[1],Pt=C.exports.useMemo(function(){return new Set(J||It||[])},[J,It]),pt=C.exports.useCallback(function(Bn){var Yn=se(Bn,j.indexOf(Bn)),Ar,Ei=Pt.has(Yn);Ei?(Pt.delete(Yn),Ar=Et(Pt)):Ar=[].concat(Et(Pt),[Yn]),We(Ar),ye&&ye(!Ei,Bn),Ie&&Ie(Ar)},[se,Pt,j,ye,Ie]),Rt=C.exports.useState(0),yt=ze(Rt,2),Mt=yt[0],ut=yt[1],dt=bJ(ge(ge(ge({},e),ee),{},{expandable:!!ce,columnTitle:oe,expandedKeys:Pt,getRowKey:se,onTriggerExpand:pt,expandIcon:$e,expandIconColumnIndex:De,direction:v}),z===Zg?B:null),ct=ze(dt,2),rt=ct[0],ht=ct[1],bt=C.exports.useMemo(function(){return{columns:rt,flattenColumns:ht}},[rt,ht]),Wt=C.exports.useRef(),Ut=C.exports.useRef(),Jt=C.exports.useRef(),Fe=C.exports.useRef(),Ge=C.exports.useRef(),Zt=C.exports.useState(!1),cn=ze(Zt,2),jt=cn[0],Kt=cn[1],nn=C.exports.useState(!1),Cn=ze(nn,2),Nn=Cn[0],wt=Cn[1],qt=Rz(new Map),At=ze(qt,2),Xt=At[0],en=At[1],gt=ax(ht),yn=gt.map(function(Bn){return Xt.get(Bn)}),Sn=C.exports.useMemo(function(){return yn},[yn.join("_")]),dn=CJ(Sn,ht.length,v),zt=f&&sC(f.y),ot=f&&sC(f.x)||Boolean(ee.fixed),mt=ot&&ht.some(function(Bn){var Yn=Bn.fixed;return Yn}),Dt=C.exports.useRef(),Bt=AJ(G,n),pn=Bt.isSticky,On=Bt.offsetHeader,Zn=Bt.offsetSummary,Xn=Bt.offsetScroll,me=Bt.stickyClassName,H=Bt.container,q=P==null?void 0:P(j),de=(zt||pn)&&C.exports.isValidElement(q)&&q.type===lx&&q.props.fixed,le,xe,Ee;zt&&(xe={overflowY:"scroll",maxHeight:f.y}),ot&&(le={overflowX:"auto"},zt||(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(Bn,Yn){E2(Wt.current)&&en(function(Ar){if(Ar.get(Bn)!==Yn){var Ei=new Map(Ar);return Ei.set(Bn,Yn),Ei}return Ar})},[]),Ce=wJ(null),Le=ze(Ce,2),qe=Le[0],Ze=Le[1];function Ve(Bn,Yn){!Yn||(typeof Yn=="function"?Yn(Bn):Yn.scrollLeft!==Bn&&(Yn.scrollLeft=Bn))}var Lt=function(Yn){var Ar=Yn.currentTarget,Ei=Yn.scrollLeft,Xa=v==="rtl",To=typeof Ei=="number"?Ei:Ar.scrollLeft,Es=Ar||LJ;if(!Ze()||Ze()===Es){var Pa;qe(Es),Ve(To,Ut.current),Ve(To,Jt.current),Ve(To,Ge.current),Ve(To,(Pa=Dt.current)===null||Pa===void 0?void 0:Pa.setScrollLeft)}if(Ar){var xr=Ar.scrollWidth,Ta=Ar.clientWidth;if(xr===Ta){Kt(!1),wt(!1);return}Xa?(Kt(-To0)):(Kt(To>0),wt(To-1}var aee=oee,see=dx;function lee(e,t){var n=this.__data__,r=see(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var uee=lee,cee=WJ,dee=eee,fee=ree,hee=aee,pee=uee;function Tf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++to))return!1;var p=s.get(e),v=s.get(t);if(p&&v)return p==t&&v==e;var y=-1,w=!0,P=n&One?new Rne:void 0;for(s.set(e,t),s.set(t,e);++y-1&&e%1==0&&e-1&&e%1==0&&e<=Ure}var Vz=jre,Kre=ym,Hre=Vz,Wre=xm,Gre="[object Arguments]",qre="[object Array]",Zre="[object Boolean]",Xre="[object Date]",Yre="[object Error]",Qre="[object Function]",Jre="[object Map]",eie="[object Number]",tie="[object Object]",nie="[object RegExp]",rie="[object Set]",iie="[object String]",oie="[object WeakMap]",aie="[object ArrayBuffer]",sie="[object DataView]",lie="[object Float32Array]",uie="[object Float64Array]",cie="[object Int8Array]",die="[object Int16Array]",fie="[object Int32Array]",hie="[object Uint8Array]",pie="[object Uint8ClampedArray]",mie="[object Uint16Array]",vie="[object Uint32Array]",Hr={};Hr[lie]=Hr[uie]=Hr[cie]=Hr[die]=Hr[fie]=Hr[hie]=Hr[pie]=Hr[mie]=Hr[vie]=!0;Hr[Gre]=Hr[qre]=Hr[aie]=Hr[Zre]=Hr[sie]=Hr[Xre]=Hr[Yre]=Hr[Qre]=Hr[Jre]=Hr[eie]=Hr[tie]=Hr[nie]=Hr[rie]=Hr[iie]=Hr[oie]=!1;function gie(e){return Wre(e)&&Hre(e.length)&&!!Hr[Kre(e)]}var yie=gie;function xie(e){return function(t){return e(t)}}var _ie=xie,cC={exports:{}};(function(e,t){var n=wL,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,c=s&&n.process,o=function(){try{var f=i&&i.require&&i.require("util").types;return f||c&&c.binding&&c.binding("util")}catch{}}();e.exports=o})(cC,cC.exports);var bie=yie,wie=_ie,QI=cC.exports,JI=QI&&QI.isTypedArray,Cie=JI?wie(JI):bie,Uz=Cie,Sie=Ere,Eie=Dre,Pie=W2,Tie=Qy.exports,kie=Vre,Iie=Uz,Rie=Object.prototype,Mie=Rie.hasOwnProperty;function Aie(e,t){var n=Pie(e),r=!n&&Eie(e),i=!n&&!r&&Tie(e),s=!n&&!r&&!i&&Iie(e),c=n||r||i||s,o=c?Sie(e.length,String):[],f=o.length;for(var p in e)(t||Mie.call(e,p))&&!(c&&(p=="length"||i&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||kie(p,f)))&&o.push(p);return o}var Nie=Aie,Oie=Object.prototype;function Die(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Oie;return e===n}var Lie=Die;function zie(e,t){return function(n){return e(t(n))}}var Fie=zie,$ie=Fie,Bie=$ie(Object.keys,Object),Vie=Bie,Uie=Lie,jie=Vie,Kie=Object.prototype,Hie=Kie.hasOwnProperty;function Wie(e){if(!Uie(e))return jie(e);var t=[];for(var n in Object(e))Hie.call(e,n)&&n!="constructor"&&t.push(n);return t}var Gie=Wie,qie=Lz,Zie=Vz;function Xie(e){return e!=null&&Zie(e.length)&&!qie(e)}var Yie=Xie,Qie=Nie,Jie=Gie,eoe=Yie;function toe(e){return eoe(e)?Qie(e):Jie(e)}var noe=toe,roe=hre,ioe=Cre,ooe=noe;function aoe(e){return roe(e,ooe,ioe)}var soe=aoe,e3=soe,loe=1,uoe=Object.prototype,coe=uoe.hasOwnProperty;function doe(e,t,n,r,i,s){var c=n&loe,o=e3(e),f=o.length,p=e3(t),v=p.length;if(f!=v&&!c)return!1;for(var y=f;y--;){var w=o[y];if(!(c?w in t:coe.call(t,w)))return!1}var P=s.get(e),k=s.get(t);if(P&&k)return P==t&&k==e;var A=!0;s.set(e,t),s.set(t,e);for(var N=c;++y0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function i(s,c){var o=new Map;s.forEach(function(p){o.set(p,!0)});var f=c.filter(function(p){return!o.has(p)});return f.length===1?f[0]:null}return n ").concat(t);return t}var qz=C.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.data;e.selectable,e.checkable;var i=e.expandedKeys,s=e.selectedKeys,c=e.checkedKeys,o=e.loadedKeys,f=e.loadingKeys,p=e.halfCheckedKeys,v=e.keyEntities,y=e.disabled,w=e.dragging,P=e.dragOverNodeKey,k=e.dropPosition,A=e.motion,N=e.height,R=e.itemHeight,M=e.virtual,O=e.focusable,z=e.activeItem,B=e.focused,V=e.tabIndex,G=e.onKeyDown,j=e.onFocus,X=e.onBlur,Y=e.onActiveChange,se=e.onListChangeStart,ee=e.onListChangeEnd,Z=Rn(e,Yoe),J=C.exports.useRef(null),ve=C.exports.useRef(null);C.exports.useImperativeHandle(t,function(){return{scrollTo:function(ct){J.current.scrollTo(ct)},getIndentWidth:function(){return ve.current.offsetWidth}}});var ie=C.exports.useState(i),ce=ze(ie,2),oe=ce[0],ye=ce[1],Ie=C.exports.useState(r),Te=ze(Ie,2),Pe=Te[0],De=Te[1],Re=C.exports.useState(r),ke=ze(Re,2),Oe=ke[0],$e=ke[1],He=C.exports.useState([]),Ue=ze(He,2),st=Ue[0],ft=Ue[1],It=C.exports.useState(null),We=ze(It,2),Pt=We[0],pt=We[1],Rt=C.exports.useRef(r);Rt.current=r;function yt(){var dt=Rt.current;De(dt),$e(dt),ft([]),pt(null),ee()}C.exports.useEffect(function(){ye(i);var dt=Xoe(oe,i);if(dt.key!==null)if(dt.add){var ct=Pe.findIndex(function(Jt){var Fe=Jt.key;return Fe===dt.key}),rt=g3(p3(Pe,r,dt.key),M,N,R),ht=Pe.slice();ht.splice(ct+1,0,v3),$e(ht),ft(rt),pt("show")}else{var bt=r.findIndex(function(Jt){var Fe=Jt.key;return Fe===dt.key}),Wt=g3(p3(r,Pe,dt.key),M,N,R),Ut=r.slice();Ut.splice(bt+1,0,v3),$e(Ut),ft(Wt),pt("hide")}else Pe!==r&&(De(r),$e(r))},[i,r]),C.exports.useEffect(function(){w||yt()},[w]);var Mt=A?Oe:r,ut={expandedKeys:i,selectedKeys:s,loadedKeys:o,loadingKeys:f,checkedKeys:c,halfCheckedKeys:p,dragOverNodeKey:P,dropPosition:k,keyEntities:v};return Qe(An,{children:[B&&z&&I("span",{style:m3,"aria-live":"assertive",children:Joe(z)}),I("div",{children:I("input",{style:m3,disabled:O===!1||y,tabIndex:O!==!1?V:null,onKeyDown:G,onFocus:j,onBlur:X,value:"",onChange:Qoe,"aria-label":"for screen reader"})}),I("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0},children:I("div",{className:"".concat(n,"-indent"),children:I("div",{ref:ve,className:"".concat(n,"-indent-unit")})})}),I(k2,{...Z,data:Mt,itemKey:y3,height:N,fullHeight:!1,virtual:M,itemHeight:R,prefixCls:"".concat(n,"-list"),ref:J,onVisibleChange:function(ct,rt){var ht=new Set(ct),bt=rt.filter(function(Wt){return!ht.has(Wt)});bt.some(function(Wt){return y3(Wt)===Ec})&&yt()},children:function(dt){var ct=dt.pos,rt=tt({},(Hz(dt.data),dt.data)),ht=dt.title,bt=dt.key,Wt=dt.isStart,Ut=dt.isEnd,Jt=_m(bt,ct);delete rt.key,delete rt.children;var Fe=mp(Jt,ut);return I(Zoe,{...rt,...Fe,title:ht,active:!!z&&bt===z.key,pos:ct,data:dt.data,isStart:Wt,isEnd:Ut,motion:A,motionNodes:bt===Ec?st:null,motionType:Pt,onMotionStart:se,onMotionEnd:yt,treeNodeRequiredProps:ut,onMouseMove:function(){Y(null)}})}})]})});qz.displayName="NodeList";function eae(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,i={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:i.top=0,i.left=-n*r;break;case 1:i.bottom=0,i.left=-n*r;break;case 0:i.bottom=0,i.left=r;break}return I("div",{style:i})}var tae=10,mx=function(e){ui(n,e);var t=ci(n);function n(){var r;zr(this,n);for(var i=arguments.length,s=new Array(i),c=0;c2&&arguments[2]!==void 0?arguments[2]:!1,y=r.state,w=y.dragChildrenKeys,P=y.dropPosition,k=y.dropTargetKey,A=y.dropTargetPos,N=y.dropAllowed;if(!!N){var R=r.props.onDrop;if(r.setState({dragOverNodeKey:null}),r.cleanDragState(),k!==null){var M=ge(ge({},mp(k,r.getTreeNodeRequiredProps())),{},{active:((p=r.getActiveItem())===null||p===void 0?void 0:p.key)===k,data:r.state.keyEntities[k].node}),O=w.indexOf(k)!==-1;Rr(!O,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var z=Z2(A),B={event:o,node:Ci(M),dragNode:r.dragNode?Ci(r.dragNode.props):null,dragNodesKeys:[r.dragNode.props.eventKey].concat(w),dropToGap:P!==0,dropPosition:P+Number(z[z.length-1])};v||R==null||R(B),r.dragNode=null}}},r.cleanDragState=function(){var o=r.state.draggingNodeKey;o!==null&&r.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),r.dragStartMousePosition=null,r.currentMouseOverDroppableNodeKey=null},r.triggerExpandActionExpand=function(o,f){var p=r.state,v=p.expandedKeys,y=p.flattenNodes,w=f.expanded,P=f.key,k=f.isLeaf;if(!(k||o.shiftKey||o.metaKey||o.ctrlKey)){var A=y.filter(function(R){return R.key===P})[0],N=Ci(ge(ge({},mp(P,r.getTreeNodeRequiredProps())),{},{data:A.data}));r.setExpandedKeys(w?ss(v,P):Bs(v,P)),r.onNodeExpand(o,N)}},r.onNodeClick=function(o,f){var p=r.props,v=p.onClick,y=p.expandAction;y==="click"&&r.triggerExpandActionExpand(o,f),v==null||v(o,f)},r.onNodeDoubleClick=function(o,f){var p=r.props,v=p.onDoubleClick,y=p.expandAction;y==="doubleClick"&&r.triggerExpandActionExpand(o,f),v==null||v(o,f)},r.onNodeSelect=function(o,f){var p=r.state.selectedKeys,v=r.state,y=v.keyEntities,w=v.fieldNames,P=r.props,k=P.onSelect,A=P.multiple,N=f.selected,R=f[w.key],M=!N;M?A?p=Bs(p,R):p=[R]:p=ss(p,R);var O=p.map(function(z){var B=y[z];return B?B.node:null}).filter(function(z){return z});r.setUncontrolledState({selectedKeys:p}),k==null||k(p,{event:"select",selected:M,node:f,selectedNodes:O,nativeEvent:o.nativeEvent})},r.onNodeCheck=function(o,f,p){var v=r.state,y=v.keyEntities,w=v.checkedKeys,P=v.halfCheckedKeys,k=r.props,A=k.checkStrictly,N=k.onCheck,R=f.key,M,O={event:"check",node:f,checked:p,nativeEvent:o.nativeEvent};if(A){var z=p?Bs(w,R):ss(w,R),B=ss(P,R);M={checked:z,halfChecked:B},O.checkedNodes=z.map(function(se){return y[se]}).filter(function(se){return se}).map(function(se){return se.node}),r.setUncontrolledState({checkedKeys:z})}else{var V=Qs([].concat(Et(w),[R]),!0,y),G=V.checkedKeys,j=V.halfCheckedKeys;if(!p){var X=new Set(G);X.delete(R);var Y=Qs(Array.from(X),{checked:!1,halfCheckedKeys:j},y);G=Y.checkedKeys,j=Y.halfCheckedKeys}M=G,O.checkedNodes=[],O.checkedNodesPositions=[],O.halfCheckedKeys=j,G.forEach(function(se){var ee=y[se];if(!!ee){var Z=ee.node,J=ee.pos;O.checkedNodes.push(Z),O.checkedNodesPositions.push({node:Z,pos:J})}}),r.setUncontrolledState({checkedKeys:G},!1,{halfCheckedKeys:j})}N==null||N(M,O)},r.onNodeLoad=function(o){var f=o.key,p=new Promise(function(v,y){r.setState(function(w){var P=w.loadedKeys,k=P===void 0?[]:P,A=w.loadingKeys,N=A===void 0?[]:A,R=r.props,M=R.loadData,O=R.onLoad;if(!M||k.indexOf(f)!==-1||N.indexOf(f)!==-1)return null;var z=M(o);return z.then(function(){var B=r.state.loadedKeys,V=Bs(B,f);O==null||O(V,{event:"load",node:o}),r.setUncontrolledState({loadedKeys:V}),r.setState(function(G){return{loadingKeys:ss(G.loadingKeys,f)}}),v()}).catch(function(B){if(r.setState(function(G){return{loadingKeys:ss(G.loadingKeys,f)}}),r.loadingRetryTimes[f]=(r.loadingRetryTimes[f]||0)+1,r.loadingRetryTimes[f]>=tae){var V=r.state.loadedKeys;Rr(!1,"Retry for `loadData` many times but still failed. No more retry."),r.setUncontrolledState({loadedKeys:Bs(V,f)}),v()}y(B)}),{loadingKeys:Bs(N,f)}})});return p.catch(function(){}),p},r.onNodeMouseEnter=function(o,f){var p=r.props.onMouseEnter;p==null||p({event:o,node:f})},r.onNodeMouseLeave=function(o,f){var p=r.props.onMouseLeave;p==null||p({event:o,node:f})},r.onNodeContextMenu=function(o,f){var p=r.props.onRightClick;p&&(o.preventDefault(),p({event:o,node:f}))},r.onFocus=function(){var o=r.props.onFocus;r.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(!r.destroyed){var v=!1,y=!0,w={};Object.keys(o).forEach(function(P){if(P in r.props){y=!1;return}v=!0,w[P]=o[P]}),v&&(!f||y)&&r.setState(ge(ge({},w),p))}},r.scrollTo=function(o){r.listRef.current.scrollTo(o)},r}return Fr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var i=this.props.activeKey;i!==void 0&&i!==this.state.activeKey&&(this.setState({activeKey:i}),i!==null&&this.scrollTo({key:i}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var i,s=this.state,c=s.focused,o=s.flattenNodes,f=s.keyEntities,p=s.draggingNodeKey,v=s.activeKey,y=s.dropLevelOffset,w=s.dropContainerKey,P=s.dropTargetKey,k=s.dropPosition,A=s.dragOverNodeKey,N=s.indent,R=this.props,M=R.prefixCls,O=R.className,z=R.style,B=R.showLine,V=R.focusable,G=R.tabIndex,j=G===void 0?0:G,X=R.selectable,Y=R.showIcon,se=R.icon,ee=R.switcherIcon,Z=R.draggable,J=R.checkable,ve=R.checkStrictly,ie=R.disabled,ce=R.motion,oe=R.loadData,ye=R.filterTreeNode,Ie=R.height,Te=R.itemHeight,Pe=R.virtual,De=R.titleRender,Re=R.dropIndicatorRender,ke=R.onContextMenu,Oe=R.onScroll,$e=R.direction,He=R.rootClassName,Ue=R.rootStyle,st=uu(this.props,{aria:!0,data:!0}),ft;return Z&&(ln(Z)==="object"?ft=Z:typeof Z=="function"?ft={nodeDraggable:Z}:ft={}),I(q2.Provider,{value:{prefixCls:M,selectable:X,showIcon:Y,icon:se,switcherIcon:ee,draggable:ft,draggingNodeKey:p,checkable:J,checkStrictly:ve,disabled:ie,keyEntities:f,dropLevelOffset:y,dropContainerKey:w,dropTargetKey:P,dropPosition:k,dragOverNodeKey:A,indent:N,direction:$e,dropIndicatorRender:Re,loadData:oe,filterTreeNode:ye,titleRender:De,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:I("div",{role:"tree",className:Xe(M,O,He,(i={},re(i,"".concat(M,"-show-line"),B),re(i,"".concat(M,"-focused"),c),re(i,"".concat(M,"-active-focused"),v!==null),i)),style:Ue,children:I(qz,{ref:this.listRef,prefixCls:M,style:z,data:o,disabled:ie,selectable:X,checkable:!!J,motion:ce,dragging:p!==null,height:Ie,itemHeight:Te,virtual:Pe,focusable:V,focused:c,tabIndex:j,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ke,onScroll:Oe,...this.getTreeNodeRequiredProps(),...st})})})}}],[{key:"getDerivedStateFromProps",value:function(i,s){var c=s.prevProps,o={prevProps:i};function f(V){return!c&&V in i||c&&c[V]!==i[V]}var p,v=s.fieldNames;if(f("fieldNames")&&(v=Wy(i.fieldNames),o.fieldNames=v),f("treeData")?p=i.treeData:f("children")&&(Rr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),p=IL(i.children)),p){o.treeData=p;var y=ix(p,{fieldNames:v});o.keyEntities=ge(re({},Ec,Gz),y.keyEntities)}var w=o.keyEntities||s.keyEntities;if(f("expandedKeys")||c&&f("autoExpandParent"))o.expandedKeys=i.autoExpandParent||!c&&i.defaultExpandParent?nC(i.expandedKeys,w):i.expandedKeys;else if(!c&&i.defaultExpandAll){var P=ge({},w);delete P[Ec],o.expandedKeys=Object.keys(P).map(function(V){return P[V].key})}else!c&&i.defaultExpandedKeys&&(o.expandedKeys=i.autoExpandParent||i.defaultExpandParent?nC(i.defaultExpandedKeys,w):i.defaultExpandedKeys);if(o.expandedKeys||delete o.expandedKeys,p||o.expandedKeys){var k=D1(p||s.treeData,o.expandedKeys||s.expandedKeys,v);o.flattenNodes=k}if(i.selectable&&(f("selectedKeys")?o.selectedKeys=lI(i.selectedKeys,i):!c&&i.defaultSelectedKeys&&(o.selectedKeys=lI(i.defaultSelectedKeys,i))),i.checkable){var A;if(f("checkedKeys")?A=O1(i.checkedKeys)||{}:!c&&i.defaultCheckedKeys?A=O1(i.defaultCheckedKeys)||{}:p&&(A=O1(i.checkedKeys)||{checkedKeys:s.checkedKeys,halfCheckedKeys:s.halfCheckedKeys}),A){var N=A,R=N.checkedKeys,M=R===void 0?[]:R,O=N.halfCheckedKeys,z=O===void 0?[]:O;if(!i.checkStrictly){var B=Qs(M,!0,w);M=B.checkedKeys,z=B.halfCheckedKeys}o.checkedKeys=M,o.halfCheckedKeys=z}}return f("loadedKeys")&&(o.loadedKeys=i.loadedKeys),o}}]),n}(C.exports.Component);mx.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:eae,allowDrop:function(){return!0},expandAction:!1};mx.TreeNode=Sc;var nae={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 rae=nae;var Zz=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:rae})})};Zz.displayName="HolderOutlined";const iae=C.exports.forwardRef(Zz);var x3=4;function oae(e){var t,n=e.dropPosition,r=e.dropLevelOffset,i=e.prefixCls,s=e.indent,c=e.direction,o=c===void 0?"ltr":c,f=o==="ltr"?"left":"right",p=o==="ltr"?"right":"left",v=(t={},re(t,f,-r*s+x3),re(t,p,0),t);switch(n){case-1:v.top=-3;break;case 1:v.bottom=-3;break;default:v.bottom=-3,v[f]=s+x3;break}return I("div",{style:v,className:"".concat(i,"-drop-indicator")})}var aae={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 sae=aae;var Xz=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:sae})})};Xz.displayName="CaretDownFilled";const lae=C.exports.forwardRef(Xz);var uae={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 cae=uae;var Yz=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:cae})})};Yz.displayName="FileOutlined";const Qz=C.exports.forwardRef(Yz);var dae={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 fae=dae;var Jz=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:fae})})};Jz.displayName="MinusSquareOutlined";const hae=C.exports.forwardRef(Jz);var pae={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 mae=pae;var e5=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:mae})})};e5.displayName="PlusSquareOutlined";const vae=C.exports.forwardRef(e5);function t5(e,t,n,r){var i=r.isLeaf,s=r.expanded,c=r.loading;if(c)return I(of,{className:"".concat(e,"-switcher-loading-icon")});var o;if(n&&ln(n)==="object"&&(o=n.showLeafIcon),i){if(!n)return null;if(typeof o!="boolean"&&!!o){var f=typeof o=="function"?o(r):o,p="".concat(e,"-switcher-line-custom-icon");return zo(f)?li(f,{className:Xe(f.props.className||"",p)}):f}return o?I(Qz,{className:"".concat(e,"-switcher-line-icon")}):I("span",{className:"".concat(e,"-switcher-leaf-line")})}var v="".concat(e,"-switcher-icon"),y=typeof t=="function"?t(r):t;return zo(y)?li(y,{className:Xe(y.props.className||"",v)}):y||(n?s?I(hae,{className:"".concat(e,"-switcher-line-icon")}):I(vae,{className:"".concat(e,"-switcher-line-icon")}):I(lae,{className:v}))}var gae=C.exports.forwardRef(function(e,t){var n,r=C.exports.useContext(zn),i=r.getPrefixCls,s=r.direction,c=r.virtual,o=e.prefixCls,f=e.className,p=e.showIcon,v=p===void 0?!1:p,y=e.showLine,w=e.switcherIcon,P=e.blockNode,k=P===void 0?!1:P,A=e.children,N=e.checkable,R=N===void 0?!1:N,M=e.selectable,O=M===void 0?!0:M,z=e.draggable,B=e.motion,V=B===void 0?tt(tt({},qp),{motionAppear:!1}):B,G=i("tree",o),j=tt(tt({},e),{checkable:R,selectable:O,showIcon:v,motion:V,blockNode:k,showLine:Boolean(y),dropIndicatorRender:oae}),X=C.exports.useMemo(function(){if(!z)return!1;var Y={};switch(ln(z)){case"function":Y.nodeDraggable=z;break;case"object":Y=tt({},z);break}return Y.icon!==!1&&(Y.icon=Y.icon||I(iae,{})),Y},[z]);return I(mx,{itemHeight:20,ref:t,virtual:c,...j,prefixCls:G,className:Xe((n={},re(n,"".concat(G,"-icon-hide"),!v),re(n,"".concat(G,"-block-node"),k),re(n,"".concat(G,"-unselectable"),!O),re(n,"".concat(G,"-rtl"),s==="rtl"),n),f),direction:s,checkable:R&&I("span",{className:"".concat(G,"-checkbox-inner")}),selectable:O,switcherIcon:function(se){return t5(G,w,y,se)},draggable:X,children:A})});const n5=gae;var yae={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 xae=yae;var r5=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:xae})})};r5.displayName="FolderOpenOutlined";const _ae=C.exports.forwardRef(r5);var bae={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 wae=bae;var i5=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:wae})})};i5.displayName="FolderOutlined";const Cae=C.exports.forwardRef(i5);var Us;(function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"})(Us||(Us={}));function iE(e,t){function n(r){var i=r.key,s=r.children;t(i,r)!==!1&&iE(s||[],t)}e.forEach(n)}function Sae(e){var t=e.treeData,n=e.expandedKeys,r=e.startKey,i=e.endKey,s=[],c=Us.None;if(r&&r===i)return[r];if(!r||!i)return[];function o(f){return f===r||f===i}return iE(t,function(f){if(c===Us.End)return!1;if(o(f)){if(s.push(f),c===Us.None)c=Us.Start;else if(c===Us.Start)return c=Us.End,!1}else c===Us.Start&&s.push(f);return n.includes(f)}),s}function G1(e,t){var n=Et(t),r=[];return iE(e,function(i,s){var c=n.indexOf(i);return c!==-1&&(r.push(s),n.splice(c,1)),!!n.length}),r}var _3=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1},Zt=Ge.confirm,cn=Ge.closeDropdown;Zt&&ft([]),cn&&ee(!1),Ue(""),oe(B?(V||[]).map(function(jt){return String(jt)}):[])},Pt=function(){var Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0},Zt=Ge.closeDropdown;Zt&&ee(!1),ft(ce())},pt=function(Ge){Ge&&J!==void 0&&oe(J||[]),ee(Ge),!Ge&&!i.filterDropdown&&It()},Rt=Xe(re({},"".concat(s,"-menu-without-submenu"),!Oae(i.filters||[]))),yt=function(Ge){if(Ge.target.checked){var Zt=Gd(i==null?void 0:i.filters).map(function(cn){return String(cn)});oe(Zt)}else oe([])},Mt=function Fe(Ge){var Zt=Ge.filters;return(Zt||[]).map(function(cn,jt){var Kt=String(cn.value),nn={title:cn.text,key:cn.value!==void 0?Kt:jt};return cn.children&&(nn.children=Fe({filters:cn.children})),nn})},ut=function Fe(Ge){var Zt;return tt(tt({},Ge),{text:Ge.title,value:Ge.key,children:((Zt=Ge.children)===null||Zt===void 0?void 0:Zt.map(function(cn){return Fe(cn)}))||[]})},dt;if(typeof i.filterDropdown=="function")dt=i.filterDropdown({prefixCls:"".concat(s,"-custom"),setSelectedKeys:function(Ge){return ye({selectedKeys:Ge})},selectedKeys:ce(),confirm:Pt,clearFilters:We,filters:i.filters,visible:Z,close:function(){ee(!1)}});else if(i.filterDropdown)dt=i.filterDropdown;else{var ct=ce()||[],rt=function(){return(i.filters||[]).length===0?I(cs,{image:cs.PRESENTED_IMAGE_SIMPLE,description:k.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):p==="tree"?Qe(An,{children:[I(w3,{filterSearch:y,value:He,onChange:st,tablePrefixCls:n,locale:k}),Qe("div",{className:"".concat(n,"-filter-dropdown-tree"),children:[o?I(pc,{checked:ct.length===Gd(i.filters).length,indeterminate:ct.length>0&&ct.length0?s:e}),w=Math.ceil((s||e)/y.pageSize);y.current>w&&(y.current=w||1);var P=function(N,R){v({current:N!=null?N:1,pageSize:R||y.pageSize})},k=function(N,R){var M;t&&((M=t.onChange)===null||M===void 0||M.call(t,N,R)),P(N,R),n(N,R||(y==null?void 0:y.pageSize))};return t===!1?[{},function(){}]:[tt(tt({},y),{onChange:k}),P]}var $l={},yC="SELECT_ALL",xC="SELECT_INVERT",_C="SELECT_NONE",E3=[];function u5(e,t){var n=[];return(e||[]).forEach(function(r){n.push(r),r&&ln(r)==="object"&&t in r&&(n=[].concat(Et(n),Et(u5(r[t],t))))}),n}function Uae(e,t){var n=e||{},r=n.preserveSelectedRowKeys,i=n.selectedRowKeys,s=n.defaultSelectedRowKeys,c=n.getCheckboxProps,o=n.onChange,f=n.onSelect,p=n.onSelectAll,v=n.onSelectInvert,y=n.onSelectNone,w=n.onSelectMultiple,P=n.columnWidth,k=n.type,A=n.selections,N=n.fixed,R=n.renderCell,M=n.hideSelectAll,O=n.checkStrictly,z=O===void 0?!0:O,B=t.prefixCls,V=t.data,G=t.pageData,j=t.getRecordByKey,X=t.getRowKey,Y=t.expandType,se=t.childrenColumnName,ee=t.locale,Z=t.getPopupContainer,J=Bi(i||s||E3,{value:i}),ve=ze(J,2),ie=ve[0],ce=ve[1],oe=C.exports.useRef(new Map),ye=C.exports.useCallback(function(ut){if(r){var dt=new Map;ut.forEach(function(ct){var rt=j(ct);!rt&&oe.current.has(ct)&&(rt=oe.current.get(ct)),dt.set(ct,rt)}),oe.current=dt}},[j,r]);C.exports.useEffect(function(){ye(ie)},[ie]);var Ie=C.exports.useMemo(function(){return z?{keyEntities:null}:ix(V,{externalGetKey:X,childrenPropName:se})},[V,X,z,se]),Te=Ie.keyEntities,Pe=C.exports.useMemo(function(){return u5(G,se)},[G,se]),De=C.exports.useMemo(function(){var ut=new Map;return Pe.forEach(function(dt,ct){var rt=X(dt,ct),ht=(c?c(dt):null)||{};ut.set(rt,ht)}),ut},[Pe,X,c]),Re=C.exports.useCallback(function(ut){var dt;return!!(!((dt=De.get(X(ut)))===null||dt===void 0)&&dt.disabled)},[De,X]),ke=C.exports.useMemo(function(){if(z)return[ie||[],[]];var ut=Qs(ie,!0,Te,Re),dt=ut.checkedKeys,ct=ut.halfCheckedKeys;return[dt||[],ct]},[ie,z,Te,Re]),Oe=ze(ke,2),$e=Oe[0],He=Oe[1],Ue=C.exports.useMemo(function(){var ut=k==="radio"?$e.slice(0,1):$e;return new Set(ut)},[$e,k]),st=C.exports.useMemo(function(){return k==="radio"?new Set:new Set(He)},[He,k]),ft=C.exports.useState(null),It=ze(ft,2),We=It[0],Pt=It[1];C.exports.useEffect(function(){e||ce(E3)},[!!e]);var pt=C.exports.useCallback(function(ut,dt){var ct,rt;ye(ut),r?(ct=ut,rt=ut.map(function(ht){return oe.current.get(ht)})):(ct=[],rt=[],ut.forEach(function(ht){var bt=j(ht);bt!==void 0&&(ct.push(ht),rt.push(bt))})),ce(ct),o==null||o(ct,rt,{type:dt})},[ce,j,o,r]),Rt=C.exports.useCallback(function(ut,dt,ct,rt){if(f){var ht=ct.map(function(bt){return j(bt)});f(j(ut),dt,ht,rt)}pt(ct,"single")},[f,j,pt]),yt=C.exports.useMemo(function(){if(!A||M)return null;var ut=A===!0?[yC,xC,_C]:A;return ut.map(function(dt){return dt===yC?{key:"all",text:ee.selectionAll,onSelect:function(){pt(V.map(function(rt,ht){return X(rt,ht)}).filter(function(rt){var ht=De.get(rt);return!(ht!=null&&ht.disabled)||Ue.has(rt)}),"all")}}:dt===xC?{key:"invert",text:ee.selectInvert,onSelect:function(){var rt=new Set(Ue);G.forEach(function(bt,Wt){var Ut=X(bt,Wt),Jt=De.get(Ut);Jt!=null&&Jt.disabled||(rt.has(Ut)?rt.delete(Ut):rt.add(Ut))});var ht=Array.from(rt);v&&v(ht),pt(ht,"invert")}}:dt===_C?{key:"none",text:ee.selectNone,onSelect:function(){y==null||y(),pt(Array.from(Ue).filter(function(rt){var ht=De.get(rt);return ht==null?void 0:ht.disabled}),"none")}}:dt}).map(function(dt){return tt(tt({},dt),{onSelect:function(){for(var rt,ht,bt=arguments.length,Wt=new Array(bt),Ut=0;Ut2&&arguments[2]!==void 0?arguments[2]:!1,Je=tt(tt({},rt),Ve);Ct&&(rt.resetPagination(),Je.pagination.current&&(Je.pagination.current=1),v&&v.onChange&&v.onChange(1,Je.pagination.pageSize)),Y&&Y.scrollToFirstRowOnChange!==!1&&yt.body.current&&mK(0,{getContainer:function(){return yt.body.current}}),M==null||M(Je.pagination,Je.filters,Je.sorter,{currentDataSource:S3(wC(He,Je.sorterStates,pt),Je.filterStates),action:Lt})},bt=function(Ve,Lt){ht({sorter:Ve,sorterStates:Lt},"sort",!1)},Wt=Xae({prefixCls:ft,mergedColumns:oe,onSorterChange:bt,sortDirections:se||["ascend","descend"],tableLocale:$e,showSorterTooltip:J}),Ut=ze(Wt,4),Jt=Ut[0],Fe=Ut[1],Ge=Ut[2],Zt=Ut[3],cn=C.exports.useMemo(function(){return wC(He,Fe,pt)},[He,Fe]);rt.sorter=Zt(),rt.sorterStates=Fe;var jt=function(Ve,Lt){ht({filters:Ve,filterStates:Lt},"filter",!0)},Kt=Lae({prefixCls:ft,locale:$e,dropdownPrefixCls:It,mergedColumns:oe,onFilterChange:jt,getPopupContainer:O}),nn=ze(Kt,3),Cn=nn[0],Nn=nn[1],wt=nn[2],qt=S3(cn,Nn);rt.filters=wt,rt.filterStates=Nn;var At=C.exports.useMemo(function(){var Ze={};return Object.keys(wt).forEach(function(Ve){wt[Ve]!==null&&(Ze[Ve]=wt[Ve])}),tt(tt({},Ge),{filters:Ze})},[Ge,wt]),Xt=Yae(At),en=ze(Xt,1),gt=en[0],yn=function(Ve,Lt){ht({pagination:tt(tt({},rt.pagination),{current:Ve,pageSize:Lt})},"paginate")},Sn=Vae(qt.length,v,yn),dn=ze(Sn,2),zt=dn[0],ot=dn[1];rt.pagination=v===!1?{}:$ae(v,zt),rt.resetPagination=ot;var mt=C.exports.useMemo(function(){if(v===!1||!zt.pageSize)return qt;var Ze=zt.current,Ve=Ze===void 0?1:Ze,Lt=zt.total,Ct=zt.pageSize,Je=Ct===void 0?l5:Ct;return qt.lengthJe?qt.slice((Ve-1)*Je,Ve*Je):qt:qt.slice((Ve-1)*Je,Ve*Je)},[!!v,qt,zt&&zt.current,zt&&zt.pageSize,zt&&zt.total]),Dt=Uae(y,{prefixCls:ft,data:qt,pageData:mt,getRowKey:Mt,getRecordByKey:ct,expandType:Rt,childrenColumnName:pt,locale:$e,getPopupContainer:O}),Bt=ze(Dt,2),pn=Bt[0],On=Bt[1],Zn=function(Ve,Lt,Ct){var Je;return typeof k=="function"?Je=Xe(k(Ve,Lt,Ct)):Je=Xe(k),Xe(re({},"".concat(ft,"-row-selected"),On.has(Mt(Ve,Lt))),Je)};We.__PARENT_RENDER_ICON__=We.expandIcon,We.expandIcon=We.expandIcon||B||BJ($e),Rt==="nest"&&We.expandIconColumnIndex===void 0?We.expandIconColumnIndex=y?1:0:We.expandIconColumnIndex>0&&y&&(We.expandIconColumnIndex-=1),typeof We.indentSize!="number"&&(We.indentSize=typeof X=="number"?X:15);var Xn=C.exports.useCallback(function(Ze){return gt(pn(Cn(Jt(Ze))))},[Jt,Cn,pn]),me,H;if(v!==!1&&(zt==null?void 0:zt.total)){var q;zt.size?q=zt.size:q=Oe==="small"||Oe==="middle"?"small":void 0;var de=function(Ve){return I(cQ,{...zt,className:Xe("".concat(ft,"-pagination ").concat(ft,"-pagination-").concat(Ve),zt.className),size:q})},le=ke==="rtl"?"left":"right",xe=zt.position;if(xe!==null&&Array.isArray(xe)){var Ee=xe.find(function(Ze){return Ze.includes("top")}),be=xe.find(function(Ze){return Ze.includes("bottom")}),Ce=xe.every(function(Ze){return"".concat(Ze)==="none"});!Ee&&!be&&!Ce&&(H=de(le)),Ee&&(me=de(Ee.toLowerCase().replace("top",""))),be&&(H=de(be.toLowerCase().replace("bottom","")))}else H=de(le)}var Le;typeof z=="boolean"?Le={spinning:z}:ln(z)==="object"&&(Le=tt({spinning:!0},z));var qe=Xe("".concat(ft,"-wrapper"),re({},"".concat(ft,"-wrapper-rtl"),ke==="rtl"),i);return I("div",{ref:t,className:qe,style:s,children:Qe(Pf,{spinning:!1,...Le,children:[me,I(Nc,{...ye,columns:oe,direction:ke,expandable:We,prefixCls:ft,className:Xe((n={},re(n,"".concat(ft,"-middle"),Oe==="middle"),re(n,"".concat(ft,"-small"),Oe==="small"),re(n,"".concat(ft,"-bordered"),o),re(n,"".concat(ft,"-empty"),He.length===0),n)),data:mt,rowKey:Mt,rowClassName:Zn,emptyText:ee&&ee.emptyText||(Re||M2)("Table"),internalHooks:Zg,internalRefs:yt,transformColumns:Xn}),H]})})}var ese=C.exports.forwardRef(Jae),hl=ese;hl.SELECTION_COLUMN=$l;hl.EXPAND_COLUMN=Nc.EXPAND_COLUMN;hl.SELECTION_ALL=yC;hl.SELECTION_INVERT=xC;hl.SELECTION_NONE=_C;hl.Column=FJ;hl.ColumnGroup=$J;hl.Summary=Nz;const p5=hl;var m5=C.exports.createContext(null),v5=C.exports.createContext(null);function tse(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function nse(e){var t=e||{},n=t.label,r=t.value,i=t.children,s=r||"value";return{_title:n?[n]:["title","label"],value:s,key:s,children:i||"children"}}function CC(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function rse(e,t){var n=[];function r(i){i.forEach(function(s){var c=s[t.children];c&&(n.push(s[t.value]),r(c))})}return r(e),n}function I3(e){return e==null}var ise={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},ose=function(t,n){var r=YO(),i=r.prefixCls,s=r.multiple,c=r.searchValue,o=r.toggleOpen,f=r.open,p=r.notFoundContent,v=C.exports.useContext(v5),y=v.virtual,w=v.listHeight,P=v.listItemHeight,k=v.treeData,A=v.fieldNames,N=v.onSelect,R=v.dropdownMatchSelectWidth,M=v.treeExpandAction,O=C.exports.useContext(m5),z=O.checkable,B=O.checkedKeys,V=O.halfCheckedKeys,G=O.treeExpandedKeys,j=O.treeDefaultExpandAll,X=O.treeDefaultExpandedKeys,Y=O.onTreeExpand,se=O.treeIcon,ee=O.showTreeIcon,Z=O.switcherIcon,J=O.treeLine,ve=O.treeNodeFilterProp,ie=O.loadData,ce=O.treeLoadedKeys,oe=O.treeMotion,ye=O.onTreeLoad,Ie=O.keyEntities,Te=C.exports.useRef(),Pe=cm(function(){return k},[f,k],function(bt,Wt){return Wt[0]&&bt[1]!==Wt[1]}),De=C.exports.useMemo(function(){return z?{checked:B,halfChecked:V}:null},[z,B,V]);C.exports.useEffect(function(){if(f&&!s&&B.length){var bt;(bt=Te.current)===null||bt===void 0||bt.scrollTo({key:B[0]})}},[f]);var Re=String(c).toLowerCase(),ke=function(Wt){return Re?String(Wt[ve]).toLowerCase().includes(Re):!1},Oe=C.exports.useState(X),$e=ze(Oe,2),He=$e[0],Ue=$e[1],st=C.exports.useState(null),ft=ze(st,2),It=ft[0],We=ft[1],Pt=C.exports.useMemo(function(){return G?Et(G):c?It:He},[He,It,G,c]);C.exports.useEffect(function(){c&&We(rse(k,A))},[c]);var pt=function(Wt){Ue(Wt),We(Wt),Y&&Y(Wt)},Rt=function(Wt){Wt.preventDefault()},yt=function(Wt,Ut){var Jt=Ut.node;z&&CC(Jt)||(N(Jt.key,{selected:!B.includes(Jt.key)}),s||o(!1))},Mt=C.exports.useState(null),ut=ze(Mt,2),dt=ut[0],ct=ut[1],rt=Ie[dt];if(C.exports.useImperativeHandle(n,function(){var bt;return{scrollTo:(bt=Te.current)===null||bt===void 0?void 0:bt.scrollTo,onKeyDown:function(Ut){var Jt,Fe=Ut.which;switch(Fe){case St.UP:case St.DOWN:case St.LEFT:case St.RIGHT:(Jt=Te.current)===null||Jt===void 0||Jt.onKeyDown(Ut);break;case St.ENTER:{if(rt){var Ge=(rt==null?void 0:rt.node)||{},Zt=Ge.selectable,cn=Ge.value;Zt!==!1&&yt(null,{node:{key:dt},selected:!B.includes(cn)})}break}case St.ESC:o(!1)}},onKeyUp:function(){}}}),Pe.length===0)return I("div",{role:"listbox",className:"".concat(i,"-empty"),onMouseDown:Rt,children:p});var ht={fieldNames:A};return ce&&(ht.loadedKeys=ce),Pt&&(ht.expandedKeys=Pt),Qe("div",{onMouseDown:Rt,children:[rt&&f&&I("span",{style:ise,"aria-live":"assertive",children:rt.node.value}),I(mx,{ref:Te,focusable:!1,prefixCls:"".concat(i,"-tree"),treeData:Pe,height:w,itemHeight:P,virtual:y!==!1&&R!==!1,multiple:s,icon:se,showIcon:ee,switcherIcon:Z,showLine:J,loadData:c?null:ie,motion:oe,activeKey:dt,checkable:z,checkStrictly:!0,checkedKeys:De,selectedKeys:z?[]:B,defaultExpandAll:j,...ht,onActiveChange:ct,onSelect:yt,onCheck:yt,onExpand:pt,onLoad:ye,filterTreeNode:ke,expandAction:M})]})},g5=C.exports.forwardRef(ose);g5.displayName="OptionList";var aE=function(){return null},y5="SHOW_ALL",sE="SHOW_PARENT",vx="SHOW_CHILD";function R3(e,t,n,r){var i=new Set(e);return t===vx?e.filter(function(s){var c=n[s];return!(c&&c.children&&c.children.some(function(o){var f=o.node;return i.has(f[r.value])})&&c.children.every(function(o){var f=o.node;return CC(f)||i.has(f[r.value])}))}):t===sE?e.filter(function(s){var c=n[s],o=c?c.parent:null;return!(o&&!CC(o.node)&&i.has(o.key))}):e}var ase=["children","value"];function x5(e){return Zi(e).map(function(t){if(!C.exports.isValidElement(t)||!t.type)return null;var n=t,r=n.key,i=n.props,s=i.children,c=i.value,o=Rn(i,ase),f=ge({key:r,value:c},o),p=x5(s);return p.length&&(f.children=p),f}).filter(function(t){return t})}function SC(e){if(!e)return e;var t=ge({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Rr(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function sse(e,t,n,r,i,s){var c=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(P,k){var A="".concat(y,"-").concat(k),N=P[s.value],R=n.includes(N),M=p(P[s.children]||[],A,R),O=I(aE,{...P,children:M.map(function(B){return B.node})});if(t===N&&(c=O),R){var z={pos:A,node:O,children:M};return w||o.push(z),z}return null}).filter(function(P){return P})}o||(o=[],p(r),o.sort(function(v,y){var w=v.node.props.value,P=y.node.props.value,k=n.indexOf(w),A=n.indexOf(P);return k-A}))}Object.defineProperty(e,"triggerNode",{get:function(){return Rr(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),f(),c}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Rr(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),f(),i?o:o.map(function(v){var y=v.node;return y})}})}function lse(e,t){var n=t.id,r=t.pId,i=t.rootPId,s={},c=[],o=e.map(function(f){var p=ge({},f),v=p[n];return s[v]=p,p.key=p.key||v,p});return o.forEach(function(f){var p=f[r],v=s[p];v&&(v.children=v.children||[],v.children.push(f)),(p===i||!v&&i===null)&&c.push(f)}),c}function use(e,t,n){return C.exports.useMemo(function(){return e?n?lse(e,ge({id:"id",pId:"pId",rootPId:null},n!==!0?n:{})):e:x5(t)},[t,n,e])}const cse=function(e){var t=C.exports.useRef({valueLabels:new Map});return C.exports.useMemo(function(){var n=t.current.valueLabels,r=new Map,i=e.map(function(s){var c,o=s.value,f=(c=s.label)!==null&&c!==void 0?c:n.get(o);return r.set(o,f),ge(ge({},s),{},{label:f})});return t.current.valueLabels=r,[i]},[e])};function M3(e){var t=C.exports.useRef();t.current=e;var n=C.exports.useCallback(function(){return t.current.apply(t,arguments)},[]);return n}const dse=function(e,t){return C.exports.useMemo(function(){var n=ix(e,{fieldNames:t,initWrapper:function(i){return ge(ge({},i),{},{valueEntities:new Map})},processEntity:function(i,s){var c=i.node[t.value];s.valueEntities.set(c,i)}});return n},[e,t])},fse=function(e,t,n,r){return C.exports.useMemo(function(){var i=e.map(function(f){var p=f.value;return p}),s=t.map(function(f){var p=f.value;return p}),c=i.filter(function(f){return!r[f]});if(n){var o=Qs(i,!0,r);i=o.checkedKeys,s=o.halfCheckedKeys}return[Array.from(new Set([].concat(Et(c),Et(i)))),s]},[e,t,n,r])},hse=function(e,t,n){var r=n.treeNodeFilterProp,i=n.filterTreeNode,s=n.fieldNames,c=s.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 P=w[r];return String(P).toUpperCase().includes(f)}}function p(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return v.map(function(w){var P=w[c],k=y||o(t,SC(w)),A=p(P||[],k);return k||A.length?ge(ge({},w),{},re({isLeaf:void 0},c,A)):null}).filter(function(w){return w})}return p(e)},[e,t,c,r,i])};var pse=["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 mse(e){return!e||ln(e)!=="object"}var vse=C.exports.forwardRef(function(e,t){var n=e.id,r=e.prefixCls,i=r===void 0?"rc-tree-select":r,s=e.value,c=e.defaultValue,o=e.onChange,f=e.onSelect,p=e.onDeselect,v=e.searchValue,y=e.inputValue,w=e.onSearch,P=e.autoClearSearchValue,k=P===void 0?!0:P,A=e.filterTreeNode,N=e.treeNodeFilterProp,R=N===void 0?"value":N,M=e.showCheckedStrategy,O=M===void 0?vx:M,z=e.treeNodeLabelProp,B=e.multiple,V=e.treeCheckable,G=e.treeCheckStrictly,j=e.labelInValue,X=e.fieldNames,Y=e.treeDataSimpleMode,se=e.treeData,ee=e.children,Z=e.loadData,J=e.treeLoadedKeys,ve=e.onTreeLoad,ie=e.treeDefaultExpandAll,ce=e.treeExpandedKeys,oe=e.treeDefaultExpandedKeys,ye=e.onTreeExpand,Ie=e.treeExpandAction,Te=e.virtual,Pe=e.listHeight,De=Pe===void 0?200:Pe,Re=e.listItemHeight,ke=Re===void 0?20:Re,Oe=e.onDropdownVisibleChange,$e=e.dropdownMatchSelectWidth,He=$e===void 0?!0:$e,Ue=e.treeLine,st=e.treeIcon,ft=e.showTreeIcon,It=e.switcherIcon,We=e.treeMotion,Pt=Rn(e,pse),pt=bD(n),Rt=V&&!G,yt=V||G,Mt=G||j,ut=yt||B,dt=Bi(c,{value:s}),ct=ze(dt,2),rt=ct[0],ht=ct[1],bt=C.exports.useMemo(function(){return nse(X)},[JSON.stringify(X)]),Wt=Bi("",{value:v!==void 0?v:y,postState:function(xe){return xe||""}}),Ut=ze(Wt,2),Jt=Ut[0],Fe=Ut[1],Ge=function(xe){Fe(xe),w==null||w(xe)},Zt=use(se,ee,Y),cn=dse(Zt,bt),jt=cn.keyEntities,Kt=cn.valueEntities,nn=C.exports.useCallback(function(le){var xe=[],Ee=[];return le.forEach(function(be){Kt.has(be)?Ee.push(be):xe.push(be)}),{missingRawValues:xe,existRawValues:Ee}},[Kt]),Cn=hse(Zt,Jt,{fieldNames:bt,treeNodeFilterProp:R,filterTreeNode:A}),Nn=C.exports.useCallback(function(le){if(le){if(z)return le[z];for(var xe=bt._title,Ee=0;Ee"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=A3[t.format]||A3.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),s.selectNodeContents(o),c.addRange(s);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");f=!0}catch(v){n&&console.error("unable to copy using execCommand: ",v),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(y){n&&console.error("unable to copy using clipboardData: ",y),n&&console.error("falling back to prompt"),r=Ise("message"in t?t.message:kse),window.prompt(r,e)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(s):c.removeAllRanges()),o&&document.body.removeChild(o),i()}return f}var Mse=Rse,Ase={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 Nse=Ase;var C5=function(t,n){return I(cr,{...ge(ge({},t),{},{ref:n,icon:Nse})})};C5.displayName="EnterOutlined";const Ose=C.exports.forwardRef(C5);var Dse=function(t){var n=t.prefixCls,r=t["aria-label"],i=t.className,s=t.style,c=t.direction,o=t.maxLength,f=t.autoSize,p=f===void 0?!0:f,v=t.value,y=t.onSave,w=t.onCancel,P=t.onEnd,k=t.component,A=t.enterIcon,N=A===void 0?I(Ose,{}):A,R=C.exports.useRef(null),M=C.exports.useRef(!1),O=C.exports.useRef(),z=C.exports.useState(v),B=ze(z,2),V=B[0],G=B[1];C.exports.useEffect(function(){G(v)},[v]),C.exports.useEffect(function(){if(R.current&&R.current.resizableTextArea){var ce=R.current.resizableTextArea.textArea;ce.focus();var oe=ce.value.length;ce.setSelectionRange(oe,oe)}},[]);var j=function(oe){var ye=oe.target;G(ye.value.replace(/[\n\r]/g,""))},X=function(){M.current=!0},Y=function(){M.current=!1},se=function(oe){var ye=oe.keyCode;M.current||(O.current=ye)},ee=function(){y(V.trim())},Z=function(oe){var ye=oe.keyCode,Ie=oe.ctrlKey,Te=oe.altKey,Pe=oe.metaKey,De=oe.shiftKey;O.current===ye&&!M.current&&!Ie&&!Te&&!Pe&&!De&&(ye===St.ENTER?(ee(),P==null||P()):ye===St.ESC&&w())},J=function(){ee()},ve=k?"".concat(n,"-").concat(k):"",ie=Xe(n,"".concat(n,"-edit-content"),re({},"".concat(n,"-rtl"),c==="rtl"),i,ve);return Qe("div",{className:ie,style:s,children:[I(XL,{ref:R,maxLength:o,value:V,onChange:j,onKeyDown:se,onKeyUp:Z,onCompositionStart:X,onCompositionEnd:Y,onBlur:J,"aria-label":r,rows:1,autoSize:p}),N!==null?li(N,{className:"".concat(n,"-edit-content-confirm")}):null]})};const Lse=Dse;function Z1(e,t){return C.exports.useMemo(function(){var n=!!e;return[n,tt(tt({},t),n&&ln(e)==="object"?e:null)]},[e])}var zse=function(t,n){var r=C.exports.useRef(!1);C.exports.useEffect(function(){r.current?t():r.current=!0},n)};const Fse=zse;var $se=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);it){var p=t-n;return r.push(String(s).slice(0,p)),r}r.push(s),n=f}return e}var Use=0,bg=1,O3=2,X1=3,D3=4,jse=function(t){var n=t.enabledMeasure,r=t.children,i=t.text,s=t.width,c=t.fontSize,o=t.rows,f=t.onEllipsis,p=C.exports.useState([0,0,0]),v=ze(p,2),y=ze(v[0],3),w=y[0],P=y[1],k=y[2],A=v[1],N=C.exports.useState(Use),R=ze(N,2),M=R[0],O=R[1],z=C.exports.useState(0),B=ze(z,2),V=B[0],G=B[1],j=C.exports.useRef(null),X=C.exports.useRef(null),Y=C.exports.useMemo(function(){return Zi(i)},[i]),se=C.exports.useMemo(function(){return Vse(Y)},[Y]),ee=C.exports.useMemo(function(){return!n||M!==X1?r(Y,!1):r(N3(Y,P),P1&&ot,pn=function(Je){var Ot;Ut(!0),(Ot=gt.onExpand)===null||Ot===void 0||Ot.call(gt,Je)},On=C.exports.useState(0),Zn=ze(On,2),Xn=Zn[0],me=Zn[1],H=C.exports.useState(0),q=ze(H,2),de=q[0],le=q[1],xe=function(Je,Ot){var Vt=Je.offsetWidth,bn;me(Vt),le(parseInt((bn=window.getComputedStyle)===null||bn===void 0?void 0:bn.call(window,Ot).fontSize,10)||0)},Ee=function(Je){var Ot;Zt(Je),Ge!==Je&&((Ot=gt.onEllipsis)===null||Ot===void 0||Ot.call(gt,Je))};C.exports.useEffect(function(){var Ct=B.current;if(en&&ot&&Ct){var Je=Bt?Ct.offsetHeight"u"||!Ct||!ot||!yn)){var Je=new IntersectionObserver(function(){qt(!!Ct.offsetParent)});return Je.observe(Ct),function(){Je.disconnect()}}},[ot,yn]);var be={};gt.tooltip===!0?be={title:(n=ee.text)!==null&&n!==void 0?n:v}:C.exports.isValidElement(gt.tooltip)?be={title:gt.tooltip}:ln(gt.tooltip)==="object"?be=tt({title:(r=ee.text)!==null&&r!==void 0?r:v},gt.tooltip):be={title:gt.tooltip};var Ce=C.exports.useMemo(function(){var Ct=function(Ot){return["string","number"].includes(ln(Ot))};if(!(!en||ot)){if(Ct(ee.text))return ee.text;if(Ct(v))return v;if(Ct(A))return A;if(Ct(be.title))return be.title}},[en,ot,A,be.title,mt]);if(ve)return I(Lse,{value:(i=ee.text)!==null&&i!==void 0?i:typeof v=="string"?v:"",onSave:Te,onCancel:Pe,onEnd:ee.onEnd,prefixCls:G,className:c,style:o,direction:O,component:k,maxLength:ee.maxLength,autoSize:ee.autoSize,enterIcon:ee.enterIcon});var Le=function(){var Je=gt.expandable,Ot=gt.symbol;if(!Je)return null;var Vt;return Ot?Vt=Ot:Vt=z.expand,I("a",{className:"".concat(G,"-expand"),onClick:pn,"aria-label":z.expand,children:Vt},"expand")},qe=function(){if(!!se){var Je=ee.icon,Ot=ee.tooltip,Vt=Zi(Ot)[0]||z.edit,bn=typeof Vt=="string"?Vt:"";return oe.includes("icon")?I(io,{title:Ot===!1?"":Vt,children:I($I,{ref:V,className:"".concat(G,"-edit"),onClick:Ie,"aria-label":bn,children:Je||I(Ese,{role:"button"})})},"edit"):null}},Ze=function(){if(!!ke){var Je=Oe.tooltips,Ot=Oe.icon,Vt=L3(Je),bn=L3(Ot),un=Ue?wg(Vt[1],z.copied):wg(Vt[0],z.copy),wn=Ue?z.copied:z.copy,Vn=typeof un=="string"?un:wn;return I(io,{title:un,children:I($I,{className:Xe("".concat(G,"-copy"),Ue&&"".concat(G,"-copy-success")),onClick:Pt,"aria-label":Vn,children:Ue?wg(bn[1],I(AD,{}),!0):wg(bn[0],I(wse,{}),!0)})},"copy")}},Ve=function(Je){return[Je&&Le(),qe(),Ze()]},Lt=function(Je){return[Je&&I("span",{"aria-hidden":!0,children:Zse},"ellipsis"),gt.suffix,Ve(Je)]};return I(cl,{onResize:xe,disabled:!yn||ot,children:function(Ct){var Je;return I(Wse,{tooltipProps:be,enabledEllipsis:yn,isEllipsis:mt,children:I(S5,{className:Xe((Je={},re(Je,"".concat(G,"-").concat(f),f),re(Je,"".concat(G,"-disabled"),p),re(Je,"".concat(G,"-ellipsis"),en),re(Je,"".concat(G,"-single-line"),yn&&dn===1),re(Je,"".concat(G,"-ellipsis-single-line"),Dt),re(Je,"".concat(G,"-ellipsis-multiple-line"),Bt),Je),c),prefixCls:s,style:tt(tt({},o),{WebkitLineClamp:Bt?dn:void 0}),component:k,ref:Po(Ct,B,t),direction:O,onClick:oe.includes("text")?Ie:void 0,"aria-label":Ce==null?void 0:Ce.toString(),title:A,...j,children:I(Kse,{enabledMeasure:yn&&!ot,text:v,rows:dn,width:Xn,fontSize:de,onEllipsis:Ee,children:function(Ot,Vt){var bn=Ot;Ot.length&&Vt&&Ce&&(bn=I("span",{"aria-hidden":!0,children:bn},"show-content"));var un=qse(e,Qe(An,{children:[bn,Lt(Vt)]}));return un}})})})}})});const gx=Xse;var Yse=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-Cg*t:Math.round(e.h)+Cg*t:r=n?Math.round(e.h)+Cg*t:Math.round(e.h)-Cg*t,r<0?r+=360:r>=360&&(r-=360),r}function B3(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-z3*t:t===I5?r=e.s+z3:r=e.s+fle*t,r>1&&(r=1),n&&t===k5&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function V3(e,t,n){var r;return n?r=e.v+hle*t:r=e.v-ple*t,r>1&&(r=1),Number(r.toFixed(2))}function EC(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Ua(e),i=k5;i>0;i-=1){var s=F3(r),c=Sg(Ua({h:$3(s,i,!0),s:B3(s,i,!0),v:V3(s,i,!0)}));n.push(c)}n.push(Sg(r));for(var o=1;o<=I5;o+=1){var f=F3(r),p=Sg(Ua({h:$3(f,o),s:B3(f,o),v:V3(f,o)}));n.push(p)}return t.theme==="dark"?mle.map(function(v){var y=v.index,w=v.opacity,P=Sg(vle(Ua(t.backgroundColor||"#141414"),Ua(n[y]),w*100));return P}):n}var Y1={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"},Q1={},J1={};Object.keys(Y1).forEach(function(e){Q1[e]=EC(Y1[e]),Q1[e].primary=Q1[e][5],J1[e]=EC(Y1[e],{theme:"dark",backgroundColor:"#141414"}),J1[e].primary=J1[e][5]});function gle(e,t){Rr(e,"[@ant-design/icons] ".concat(t))}function U3(e){return ln(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(ln(e.icon)==="object"||typeof e.icon=="function")}function j3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t},{})}function PC(e,t,n){return n?tr.createElement(e.tag,ge(ge({key:t},j3(e.attrs)),n),(e.children||[]).map(function(r,i){return PC(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):tr.createElement(e.tag,ge({key:t},j3(e.attrs)),(e.children||[]).map(function(r,i){return PC(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function R5(e){return EC(e)[0]}function M5(e){return e?Array.isArray(e)?e:[e]:[]}var yle=` .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); } } `,xle=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yle,n=C.exports.useContext(T5),r=n.csp,i=n.prefixCls,s=t;i&&(s=s.replace(/anticon/g,i)),C.exports.useEffect(function(){hm(s,"@ant-design-icons",{prepend:!0,csp:r})},[])},_le=["icon","className","onClick","style","primaryColor","secondaryColor"],yp={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function ble(e){var t=e.primaryColor,n=e.secondaryColor;yp.primaryColor=t,yp.secondaryColor=n||R5(t),yp.calculated=!!n}function wle(){return ge({},yp)}var yx=function(t){var n=t.icon,r=t.className,i=t.onClick,s=t.style,c=t.primaryColor,o=t.secondaryColor,f=Rn(t,_le),p=yp;if(c&&(p={primaryColor:c,secondaryColor:o||R5(c)}),xle(),gle(U3(n),"icon should be icon definiton, but got ".concat(n)),!U3(n))return null;var v=n;return v&&typeof v.icon=="function"&&(v=ge(ge({},v),{},{icon:v.icon(p.primaryColor,p.secondaryColor)})),PC(v.icon,"svg-".concat(v.name),ge({className:r,onClick:i,style:s,"data-icon":v.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f))};yx.displayName="IconReact";yx.getTwoToneColors=wle;yx.setTwoToneColors=ble;const lE=yx;function A5(e){var t=M5(e),n=ze(t,2),r=n[0],i=n[1];return lE.setTwoToneColors({primaryColor:r,secondaryColor:i})}function Cle(){var e=lE.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var Sle=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];A5("#1890ff");var xx=C.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,s=e.spin,c=e.rotate,o=e.tabIndex,f=e.onClick,p=e.twoToneColor,v=Rn(e,Sle),y=C.exports.useContext(T5),w=y.prefixCls,P=w===void 0?"anticon":w,k=y.rootClassName,A=Xe(k,P,(n={},re(n,"".concat(P,"-").concat(i.name),!!i.name),re(n,"".concat(P,"-spin"),!!s||i.name==="loading"),n),r),N=o;N===void 0&&f&&(N=-1);var R=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,M=M5(p),O=ze(M,2),z=O[0],B=O[1];return I("span",{...ge(ge({role:"img","aria-label":i.name},v),{},{ref:t,tabIndex:N,onClick:f,className:A}),children:I(lE,{icon:i,primaryColor:z,secondaryColor:B,style:R})})});xx.displayName="AntdIcon";xx.getTwoToneColor=Cle;xx.setTwoToneColor=A5;const xu=xx;var N5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:RQ})})};N5.displayName="ArrowRightOutlined";const O5=C.exports.forwardRef(N5);var D5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:cle})})};D5.displayName="DownloadOutlined";const Ele=C.exports.forwardRef(D5);var Ple={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 Tle=Ple;var L5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:Tle})})};L5.displayName="FullscreenExitOutlined";const kle=C.exports.forwardRef(L5);var Ile={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 Rle=Ile;var z5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:Rle})})};z5.displayName="FullscreenOutlined";const Mle=C.exports.forwardRef(z5);var Ale={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 Nle=Ale;var F5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:Nle})})};F5.displayName="LockOutlined";const Ole=C.exports.forwardRef(F5);var Dle={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 Lle=Dle;var $5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:Lle})})};$5.displayName="LogoutOutlined";const zle=C.exports.forwardRef($5);var B5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:OD})})};B5.displayName="SearchOutlined";const uE=C.exports.forwardRef(B5);var Fle={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 $le=Fle;var V5=function(t,n){return I(xu,{...ge(ge({},t),{},{ref:n,icon:$le})})};V5.displayName="UserOutlined";const Ble=C.exports.forwardRef(V5);function U5(e,t){return function(){return e.apply(t,arguments)}}const{toString:j5}=Object.prototype,{getPrototypeOf:cE}=Object,dE=(e=>t=>{const n=j5.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pl=e=>(e=e.toLowerCase(),t=>dE(t)===e),_x=e=>t=>typeof t===e,{isArray:Nf}=Array,Yp=_x("undefined");function Vle(e){return e!==null&&!Yp(e)&&e.constructor!==null&&!Yp(e.constructor)&&du(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const K5=pl("ArrayBuffer");function Ule(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&K5(e.buffer),t}const jle=_x("string"),du=_x("function"),H5=_x("number"),fE=e=>e!==null&&typeof e=="object",Kle=e=>e===!0||e===!1,Yg=e=>{if(dE(e)!=="object")return!1;const t=cE(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Hle=pl("Date"),Wle=pl("File"),Gle=pl("Blob"),qle=pl("FileList"),Zle=e=>fE(e)&&du(e.pipe),Xle=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||j5.call(e)===t||du(e.toString)&&e.toString()===t)},Yle=pl("URLSearchParams"),Qle=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function km(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Nf(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const G5=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),q5=e=>!Yp(e)&&e!==G5;function TC(){const{caseless:e}=q5(this)&&this||{},t={},n=(r,i)=>{const s=e&&W5(t,i)||i;Yg(t[s])&&Yg(r)?t[s]=TC(t[s],r):Yg(r)?t[s]=TC({},r):Nf(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r(km(t,(i,s)=>{n&&du(i)?e[s]=U5(i,n):e[s]=i},{allOwnKeys:r}),e),eue=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),tue=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},nue=(e,t,n,r)=>{let i,s,c;const o={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)c=i[s],(!r||r(c,e,t))&&!o[c]&&(t[c]=e[c],o[c]=!0);e=n!==!1&&cE(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},rue=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},iue=e=>{if(!e)return null;if(Nf(e))return e;let t=e.length;if(!H5(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},oue=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&cE(Uint8Array)),aue=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},sue=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},lue=pl("HTMLFormElement"),uue=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),K3=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),cue=pl("RegExp"),Z5=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};km(n,(i,s)=>{t(i,s,e)!==!1&&(r[s]=i)}),Object.defineProperties(e,r)},due=e=>{Z5(e,(t,n)=>{if(du(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(!!du(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},fue=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Nf(e)?r(e):r(String(e).split(t)),n},hue=()=>{},pue=(e,t)=>(e=+e,Number.isFinite(e)?e:t),eb="abcdefghijklmnopqrstuvwxyz",H3="0123456789",X5={DIGIT:H3,ALPHA:eb,ALPHA_DIGIT:eb+eb.toUpperCase()+H3},mue=(e=16,t=X5.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function vue(e){return!!(e&&du(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const gue=e=>{const t=new Array(10),n=(r,i)=>{if(fE(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=Nf(r)?[]:{};return km(r,(c,o)=>{const f=n(c,i+1);!Yp(f)&&(s[o]=f)}),t[i]=void 0,s}}return r};return n(e,0)},Nt={isArray:Nf,isArrayBuffer:K5,isBuffer:Vle,isFormData:Xle,isArrayBufferView:Ule,isString:jle,isNumber:H5,isBoolean:Kle,isObject:fE,isPlainObject:Yg,isUndefined:Yp,isDate:Hle,isFile:Wle,isBlob:Gle,isRegExp:cue,isFunction:du,isStream:Zle,isURLSearchParams:Yle,isTypedArray:oue,isFileList:qle,forEach:km,merge:TC,extend:Jle,trim:Qle,stripBOM:eue,inherits:tue,toFlatObject:nue,kindOf:dE,kindOfTest:pl,endsWith:rue,toArray:iue,forEachEntry:aue,matchAll:sue,isHTMLForm:lue,hasOwnProperty:K3,hasOwnProp:K3,reduceDescriptors:Z5,freezeMethods:due,toObjectSet:fue,toCamelCase:uue,noop:hue,toFiniteNumber:pue,findKey:W5,global:G5,isContextDefined:q5,ALPHABET:X5,generateString:mue,isSpecCompliantForm:vue,toJSONObject:gue};function pr(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}Nt.inherits(pr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Nt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Y5=pr.prototype,Q5={};["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=>{Q5[e]={value:e}});Object.defineProperties(pr,Q5);Object.defineProperty(Y5,"isAxiosError",{value:!0});pr.from=(e,t,n,r,i,s)=>{const c=Object.create(Y5);return Nt.toFlatObject(e,c,function(f){return f!==Error.prototype},o=>o!=="isAxiosError"),pr.call(c,e.message,t,n,r,i),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};const yue=null;function kC(e){return Nt.isPlainObject(e)||Nt.isArray(e)}function J5(e){return Nt.endsWith(e,"[]")?e.slice(0,-2):e}function W3(e,t,n){return e?e.concat(t).map(function(i,s){return i=J5(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function xue(e){return Nt.isArray(e)&&!e.some(kC)}const _ue=Nt.toFlatObject(Nt,{},null,function(t){return/^is[A-Z]/.test(t)});function bx(e,t,n){if(!Nt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Nt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(A,N){return!Nt.isUndefined(N[A])});const r=n.metaTokens,i=n.visitor||v,s=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&Nt.isSpecCompliantForm(t);if(!Nt.isFunction(i))throw new TypeError("visitor must be a function");function p(k){if(k===null)return"";if(Nt.isDate(k))return k.toISOString();if(!f&&Nt.isBlob(k))throw new pr("Blob is not supported. Use a Buffer instead.");return Nt.isArrayBuffer(k)||Nt.isTypedArray(k)?f&&typeof Blob=="function"?new Blob([k]):Buffer.from(k):k}function v(k,A,N){let R=k;if(k&&!N&&typeof k=="object"){if(Nt.endsWith(A,"{}"))A=r?A:A.slice(0,-2),k=JSON.stringify(k);else if(Nt.isArray(k)&&xue(k)||(Nt.isFileList(k)||Nt.endsWith(A,"[]"))&&(R=Nt.toArray(k)))return A=J5(A),R.forEach(function(O,z){!(Nt.isUndefined(O)||O===null)&&t.append(c===!0?W3([A],z,s):c===null?A:A+"[]",p(O))}),!1}return kC(k)?!0:(t.append(W3(N,A,s),p(k)),!1)}const y=[],w=Object.assign(_ue,{defaultVisitor:v,convertValue:p,isVisitable:kC});function P(k,A){if(!Nt.isUndefined(k)){if(y.indexOf(k)!==-1)throw Error("Circular reference detected in "+A.join("."));y.push(k),Nt.forEach(k,function(R,M){(!(Nt.isUndefined(R)||R===null)&&i.call(t,R,Nt.isString(M)?M.trim():M,A,w))===!0&&P(R,A?A.concat(M):[M])}),y.pop()}}if(!Nt.isObject(e))throw new TypeError("data must be an object");return P(e),t}function G3(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hE(e,t){this._pairs=[],e&&bx(e,this,t)}const e6=hE.prototype;e6.append=function(t,n){this._pairs.push([t,n])};e6.toString=function(t){const n=t?function(r){return t.call(this,r,G3)}:G3;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function bue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function t6(e,t,n){if(!t)return e;const r=n&&n.encode||bue,i=n&&n.serialize;let s;if(i?s=i(t,n):s=Nt.isURLSearchParams(t)?t.toString():new hE(t,n).toString(r),s){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class wue{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Nt.forEach(this.handlers,function(r){r!==null&&t(r)})}}const q3=wue,n6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cue=typeof URLSearchParams<"u"?URLSearchParams:hE,Sue=typeof FormData<"u"?FormData:null,Eue=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Pue=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),fs={isBrowser:!0,classes:{URLSearchParams:Cue,FormData:Sue,Blob},isStandardBrowserEnv:Eue,isStandardBrowserWebWorkerEnv:Pue,protocols:["http","https","file","blob","url","data"]};function Tue(e,t){return bx(e,new fs.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return fs.isNode&&Nt.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function kue(e){return Nt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Iue(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r=n.length;return c=!c&&Nt.isArray(i)?i.length:c,f?(Nt.hasOwnProp(i,c)?i[c]=[i[c],r]:i[c]=r,!o):((!i[c]||!Nt.isObject(i[c]))&&(i[c]=[]),t(n,r,i[c],s)&&Nt.isArray(i[c])&&(i[c]=Iue(i[c])),!o)}if(Nt.isFormData(e)&&Nt.isFunction(e.entries)){const n={};return Nt.forEachEntry(e,(r,i)=>{t(kue(r),i,n,0)}),n}return null}const Rue={"Content-Type":void 0};function Mue(e,t,n){if(Nt.isString(e))try{return(t||JSON.parse)(e),Nt.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const wx={transitional:n6,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=Nt.isObject(t);if(s&&Nt.isHTMLForm(t)&&(t=new FormData(t)),Nt.isFormData(t))return i&&i?JSON.stringify(r6(t)):t;if(Nt.isArrayBuffer(t)||Nt.isBuffer(t)||Nt.isStream(t)||Nt.isFile(t)||Nt.isBlob(t))return t;if(Nt.isArrayBufferView(t))return t.buffer;if(Nt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Tue(t,this.formSerializer).toString();if((o=Nt.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return bx(o?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Mue(t)):t}],transformResponse:[function(t){const n=this.transitional||wx.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&Nt.isString(t)&&(r&&!this.responseType||i)){const c=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(c)throw o.name==="SyntaxError"?pr.from(o,pr.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:fs.classes.FormData,Blob:fs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Nt.forEach(["delete","get","head"],function(t){wx.headers[t]={}});Nt.forEach(["post","put","patch"],function(t){wx.headers[t]=Nt.merge(Rue)});const pE=wx,Aue=Nt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Nue=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(c){i=c.indexOf(":"),n=c.substring(0,i).trim().toLowerCase(),r=c.substring(i+1).trim(),!(!n||t[n]&&Aue[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Z3=Symbol("internals");function jh(e){return e&&String(e).trim().toLowerCase()}function Qg(e){return e===!1||e==null?e:Nt.isArray(e)?e.map(Qg):String(e)}function Oue(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function Due(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function tb(e,t,n,r,i){if(Nt.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Nt.isString(t)){if(Nt.isString(r))return t.indexOf(r)!==-1;if(Nt.isRegExp(r))return r.test(t)}}function Lue(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function zue(e,t){const n=Nt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,c){return this[r].call(this,t,i,s,c)},configurable:!0})})}class Cx{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(o,f,p){const v=jh(f);if(!v)throw new Error("header name must be a non-empty string");const y=Nt.findKey(i,v);(!y||i[y]===void 0||p===!0||p===void 0&&i[y]!==!1)&&(i[y||f]=Qg(o))}const c=(o,f)=>Nt.forEach(o,(p,v)=>s(p,v,f));return Nt.isPlainObject(t)||t instanceof this.constructor?c(t,n):Nt.isString(t)&&(t=t.trim())&&!Due(t)?c(Nue(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=jh(t),t){const r=Nt.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Oue(i);if(Nt.isFunction(n))return n.call(this,i,r);if(Nt.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=jh(t),t){const r=Nt.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||tb(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(c){if(c=jh(c),c){const o=Nt.findKey(r,c);o&&(!n||tb(r,r[o],o,n))&&(delete r[o],i=!0)}}return Nt.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||tb(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return Nt.forEach(this,(i,s)=>{const c=Nt.findKey(r,s);if(c){n[c]=Qg(i),delete n[s];return}const o=t?Lue(s):String(s).trim();o!==s&&delete n[s],n[o]=Qg(i),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Nt.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Nt.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Z3]=this[Z3]={accessors:{}}).accessors,i=this.prototype;function s(c){const o=jh(c);r[o]||(zue(i,c),r[o]=!0)}return Nt.isArray(t)?t.forEach(s):s(t),this}}Cx.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Nt.freezeMethods(Cx.prototype);Nt.freezeMethods(Cx);const Js=Cx;function nb(e,t){const n=this||pE,r=t||n,i=Js.from(r.headers);let s=r.data;return Nt.forEach(e,function(o){s=o.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function i6(e){return!!(e&&e.__CANCEL__)}function Im(e,t,n){pr.call(this,e==null?"canceled":e,pr.ERR_CANCELED,t,n),this.name="CanceledError"}Nt.inherits(Im,pr,{__CANCEL__:!0});function Fue(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new pr("Request failed with status code "+n.status,[pr.ERR_BAD_REQUEST,pr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const $ue=fs.isStandardBrowserEnv?function(){return{write:function(n,r,i,s,c,o){const f=[];f.push(n+"="+encodeURIComponent(r)),Nt.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),Nt.isString(s)&&f.push("path="+s),Nt.isString(c)&&f.push("domain="+c),o===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Bue(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vue(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function o6(e,t){return e&&!Bue(t)?Vue(e,t):t}const Uue=fs.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let c=s;return t&&(n.setAttribute("href",c),c=n.href),n.setAttribute("href",c),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(c){const o=Nt.isString(c)?i(c):c;return o.protocol===r.protocol&&o.host===r.host}}():function(){return function(){return!0}}();function jue(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kue(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,c;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),v=r[s];c||(c=p),n[i]=f,r[i]=p;let y=s,w=0;for(;y!==i;)w+=n[y++],y=y%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),p-c{const s=i.loaded,c=i.lengthComputable?i.total:void 0,o=s-n,f=r(o),p=s<=c;n=s;const v={loaded:s,total:c,progress:c?s/c:void 0,bytes:o,rate:f||void 0,estimated:f&&c&&p?(c-s)/f:void 0,event:i};v[t?"download":"upload"]=!0,e(v)}}const Hue=typeof XMLHttpRequest<"u",Wue=Hue&&function(e){return new Promise(function(n,r){let i=e.data;const s=Js.from(e.headers).normalize(),c=e.responseType;let o;function f(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}Nt.isFormData(i)&&(fs.isStandardBrowserEnv||fs.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let p=new XMLHttpRequest;if(e.auth){const P=e.auth.username||"",k=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(P+":"+k))}const v=o6(e.baseURL,e.url);p.open(e.method.toUpperCase(),t6(v,e.params,e.paramsSerializer),!0),p.timeout=e.timeout;function y(){if(!p)return;const P=Js.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),A={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:P,config:e,request:p};Fue(function(R){n(R),f()},function(R){r(R),f()},A),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||(r(new pr("Request aborted",pr.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new pr("Network Error",pr.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let k=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const A=e.transitional||n6;e.timeoutErrorMessage&&(k=e.timeoutErrorMessage),r(new pr(k,A.clarifyTimeoutError?pr.ETIMEDOUT:pr.ECONNABORTED,e,p)),p=null},fs.isStandardBrowserEnv){const P=(e.withCredentials||Uue(v))&&e.xsrfCookieName&&$ue.read(e.xsrfCookieName);P&&s.set(e.xsrfHeaderName,P)}i===void 0&&s.setContentType(null),"setRequestHeader"in p&&Nt.forEach(s.toJSON(),function(k,A){p.setRequestHeader(A,k)}),Nt.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),c&&c!=="json"&&(p.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&p.addEventListener("progress",X3(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",X3(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=P=>{!p||(r(!P||P.type?new Im(null,e,p):P),p.abort(),p=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const w=jue(v);if(w&&fs.protocols.indexOf(w)===-1){r(new pr("Unsupported protocol "+w+":",pr.ERR_BAD_REQUEST,e));return}p.send(i||null)})},Jg={http:yue,xhr:Wue};Nt.forEach(Jg,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gue={getAdapter:e=>{e=Nt.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof Js?e.toJSON():e;function cf(e,t){t=t||{};const n={};function r(p,v,y){return Nt.isPlainObject(p)&&Nt.isPlainObject(v)?Nt.merge.call({caseless:y},p,v):Nt.isPlainObject(v)?Nt.merge({},v):Nt.isArray(v)?v.slice():v}function i(p,v,y){if(Nt.isUndefined(v)){if(!Nt.isUndefined(p))return r(void 0,p,y)}else return r(p,v,y)}function s(p,v){if(!Nt.isUndefined(v))return r(void 0,v)}function c(p,v){if(Nt.isUndefined(v)){if(!Nt.isUndefined(p))return r(void 0,p)}else return r(void 0,v)}function o(p,v,y){if(y in t)return r(p,v);if(y in e)return r(void 0,p)}const f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:o,headers:(p,v)=>i(Q3(p),Q3(v),!0)};return Nt.forEach(Object.keys(e).concat(Object.keys(t)),function(v){const y=f[v]||i,w=y(e[v],t[v],v);Nt.isUndefined(w)&&y!==o||(n[v]=w)}),n}const a6="1.3.3",mE={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mE[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const J3={};mE.transitional=function(t,n,r){function i(s,c){return"[Axios v"+a6+"] Transitional option '"+s+"'"+c+(r?". "+r:"")}return(s,c,o)=>{if(t===!1)throw new pr(i(c," has been removed"+(n?" in "+n:"")),pr.ERR_DEPRECATED);return n&&!J3[c]&&(J3[c]=!0,console.warn(i(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,c,o):!0}};function que(e,t,n){if(typeof e!="object")throw new pr("options must be an object",pr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],c=t[s];if(c){const o=e[s],f=o===void 0||c(o,s,e);if(f!==!0)throw new pr("option "+s+" must be "+f,pr.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new pr("Unknown option "+s,pr.ERR_BAD_OPTION)}}const IC={assertOptions:que,validators:mE},Dl=IC.validators;class e0{constructor(t){this.defaults=t,this.interceptors={request:new q3,response:new q3}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=cf(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&IC.assertOptions(r,{silentJSONParsing:Dl.transitional(Dl.boolean),forcedJSONParsing:Dl.transitional(Dl.boolean),clarifyTimeoutError:Dl.transitional(Dl.boolean)},!1),i!==void 0&&IC.assertOptions(i,{encode:Dl.function,serialize:Dl.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c;c=s&&Nt.merge(s.common,s[n.method]),c&&Nt.forEach(["delete","get","head","post","put","patch","common"],k=>{delete s[k]}),n.headers=Js.concat(c,s);const o=[];let f=!0;this.interceptors.request.forEach(function(A){typeof A.runWhen=="function"&&A.runWhen(n)===!1||(f=f&&A.synchronous,o.unshift(A.fulfilled,A.rejected))});const p=[];this.interceptors.response.forEach(function(A){p.push(A.fulfilled,A.rejected)});let v,y=0,w;if(!f){const k=[Y3.bind(this),void 0];for(k.unshift.apply(k,o),k.push.apply(k,p),w=k.length,v=Promise.resolve(n);y{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const c=new Promise(o=>{r.subscribe(o),s=o}).then(i);return c.cancel=function(){r.unsubscribe(s)},c},t(function(s,c,o){r.reason||(r.reason=new Im(s,c,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new vE(function(i){t=i}),cancel:t}}}const Zue=vE;function Xue(e){return function(n){return e.apply(null,n)}}function Yue(e){return Nt.isObject(e)&&e.isAxiosError===!0}const RC={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(RC).forEach(([e,t])=>{RC[t]=e});const Que=RC;function s6(e){const t=new ey(e),n=U5(ey.prototype.request,t);return Nt.extend(n,ey.prototype,t,{allOwnKeys:!0}),Nt.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return s6(cf(e,i))},n}const Ai=s6(pE);Ai.Axios=ey;Ai.CanceledError=Im;Ai.CancelToken=Zue;Ai.isCancel=i6;Ai.VERSION=a6;Ai.toFormData=bx;Ai.AxiosError=pr;Ai.Cancel=Ai.CanceledError;Ai.all=function(t){return Promise.all(t)};Ai.spread=Xue;Ai.isAxiosError=Yue;Ai.mergeConfig=cf;Ai.AxiosHeaders=Js;Ai.formToJSON=e=>r6(Nt.isHTMLForm(e)?new FormData(e):e);Ai.HttpStatusCode=Que;Ai.default=Ai;const Jue=Ai;class Of{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(n=>n!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const Qp=typeof window>"u"||"Deno"in window;function ma(){}function ece(e,t){return typeof e=="function"?e(t):e}function MC(e){return typeof e=="number"&&e>=0&&e!==1/0}function l6(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jh(e,t,n){return Rm(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function tce(e,t,n){return Rm(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function Ul(e,t,n){return Rm(e)?[{...t,queryKey:e},n]:[e||{},t]}function eR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:c,stale:o}=e;if(Rm(c)){if(r){if(t.queryHash!==gE(c,t.options))return!1}else if(!t0(t.queryKey,c))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||typeof i<"u"&&i!==t.state.fetchStatus||s&&!s(t))}function tR(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:s}=e;if(Rm(s)){if(!t.options.mutationKey)return!1;if(n){if(lc(t.options.mutationKey)!==lc(s))return!1}else if(!t0(t.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function gE(e,t){return((t==null?void 0:t.queryKeyHashFn)||lc)(e)}function lc(e){return JSON.stringify(e,(t,n)=>NC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function t0(e,t){return u6(e,t)}function u6(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!u6(e[n],t[n])):!1}function c6(e,t){if(e===t)return e;const n=nR(e)&&nR(t);if(n||NC(e)&&NC(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),s=i.length,c=n?[]:{};let o=0;for(let f=0;f"u")return!0;const n=t.prototype;return!(!rR(n)||!n.hasOwnProperty("isPrototypeOf"))}function rR(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rm(e){return Array.isArray(e)}function d6(e){return new Promise(t=>{setTimeout(t,e)})}function iR(e){d6(0).then(e)}function nce(){if(typeof AbortController=="function")return new AbortController}function OC(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?c6(e,t):t}class rce extends Of{constructor(){super(),this.setup=t=>{if(!Qp&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const n0=new rce;class ice extends Of{constructor(){super(),this.setup=t=>{if(!Qp&&window.addEventListener){const n=()=>t();return window.addEventListener("online",n,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const r0=new ice;function oce(e){return Math.min(1e3*2**e,3e4)}function Sx(e){return(e!=null?e:"online")==="online"?r0.isOnline():!0}class f6{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function ty(e){return e instanceof f6}function h6(e){let t=!1,n=0,r=!1,i,s,c;const o=new Promise((N,R)=>{s=N,c=R}),f=N=>{r||(P(new f6(N)),e.abort==null||e.abort())},p=()=>{t=!0},v=()=>{t=!1},y=()=>!n0.isFocused()||e.networkMode!=="always"&&!r0.isOnline(),w=N=>{r||(r=!0,e.onSuccess==null||e.onSuccess(N),i==null||i(),s(N))},P=N=>{r||(r=!0,e.onError==null||e.onError(N),i==null||i(),c(N))},k=()=>new Promise(N=>{i=R=>{const M=r||!y();return M&&N(R),M},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),A=()=>{if(r)return;let N;try{N=e.fn()}catch(R){N=Promise.reject(R)}Promise.resolve(N).then(w).catch(R=>{var M,O;if(r)return;const z=(M=e.retry)!=null?M:3,B=(O=e.retryDelay)!=null?O:oce,V=typeof B=="function"?B(n,R):B,G=z===!0||typeof z=="number"&&n{if(y())return k()}).then(()=>{t?P(R):A()})})};return Sx(e.networkMode)?A():k().then(A),{promise:o,cancel:f,continue:()=>(i==null?void 0:i())?o:Promise.resolve(),cancelRetry:p,continueRetry:v}}const yE=console;function ace(){let e=[],t=0,n=v=>{v()},r=v=>{v()};const i=v=>{let y;t++;try{y=v()}finally{t--,t||o()}return y},s=v=>{t?e.push(v):iR(()=>{n(v)})},c=v=>(...y)=>{s(()=>{v(...y)})},o=()=>{const v=e;e=[],v.length&&iR(()=>{r(()=>{v.forEach(y=>{n(y)})})})};return{batch:i,batchCalls:c,schedule:s,setNotifyFunction:v=>{n=v},setBatchNotifyFunction:v=>{r=v}}}const ai=ace();class p6{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),MC(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:Qp?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class sce extends p6{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||yE,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||lce(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=OC(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(ma).catch(ma):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||!l6(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const P=this.observers.find(k=>k.options.queryFn);P&&this.setOptions(P.options)}Array.isArray(this.options.queryKey);const c=nce(),o={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},f=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>{if(c)return this.abortSignalConsumed=!0,c.signal}})};f(o);const p=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(o)):Promise.reject("Missing queryFn"),v={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:p};if(f(v),(r=this.options.behavior)==null||r.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=P=>{if(ty(P)&&P.silent||this.dispatch({type:"error",error:P}),!ty(P)){var k,A;(k=(A=this.cache.config).onError)==null||k.call(A,P,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=h6({fn:v.fetchFn,abort:c==null?void 0:c.abort.bind(c),onSuccess:P=>{var k,A;if(typeof P>"u"){w(new Error("undefined"));return}this.setData(P),(k=(A=this.cache.config).onSuccess)==null||k.call(A,P,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:w,onFail:(P,k)=>{this.dispatch({type:"failed",failureCount:P,error:k})},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 n=r=>{var i,s;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Sx(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const c=t.error;return ty(c)&&c.revert&&this.revertState?{...this.revertState}:{...r,error:c,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ai.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function lce(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class uce extends Of{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const s=n.queryKey,c=(i=n.queryHash)!=null?i:gE(s,n);let o=this.get(c);return o||(o=new sce({cache:this,logger:t.getLogger(),queryKey:s,queryHash:c,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),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 n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){ai.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Ul(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>eR(r,i))}findAll(t,n){const[r]=Ul(t,n);return Object.keys(r).length>0?this.queries.filter(i=>eR(r,i)):this.queries}notify(t){ai.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ai.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){ai.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class cce extends p6{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||yE,this.observers=[],this.state=t.state||m6(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var O;return this.retryer=h6({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(z,B)=>{this.dispatch({type:"failed",failureCount:z,error:B})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(O=this.options.retry)!=null?O:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,s,c,o,f;if(!n){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 z=await((y=(w=this.options).onMutate)==null?void 0:y.call(w,this.state.variables));z!==this.state.context&&this.dispatch({type:"loading",context:z,variables:this.state.variables})}const O=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,O,this.state.variables,this.state.context,this)),await((s=(c=this.options).onSuccess)==null?void 0:s.call(c,O,this.state.variables,this.state.context)),await((o=(f=this.options).onSettled)==null?void 0:o.call(f,O,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:O}),O}catch(O){try{var P,k,A,N,R,M;throw await((P=(k=this.mutationCache.config).onError)==null?void 0:P.call(k,O,this.state.variables,this.state.context,this)),await((A=(N=this.options).onError)==null?void 0:A.call(N,O,this.state.variables,this.state.context)),await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,O,this.state.variables,this.state.context)),O}finally{this.dispatch({type:"error",error:O})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Sx(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),ai.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function m6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class dce extends Of{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new cce({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){ai.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>tR(t,n))}findAll(t){return this.mutations.filter(n=>tR(t,n))}notify(t){ai.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return ai.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(ma)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function fce(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,s,c;const o=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,f=(r=e.fetchOptions)==null||(i=r.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=((s=e.state.data)==null?void 0:s.pages)||[],P=((c=e.state.data)==null?void 0:c.pageParams)||[];let k=P,A=!1;const N=V=>{Object.defineProperty(V,"signal",{enumerable:!0,get:()=>{var G;if((G=e.signal)!=null&&G.aborted)A=!0;else{var j;(j=e.signal)==null||j.addEventListener("abort",()=>{A=!0})}return e.signal}})},R=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),M=(V,G,j,X)=>(k=X?[G,...k]:[...k,G],X?[j,...V]:[...V,j]),O=(V,G,j,X)=>{if(A)return Promise.reject("Cancelled");if(typeof j>"u"&&!G&&V.length)return Promise.resolve(V);const Y={queryKey:e.queryKey,pageParam:j,meta:e.options.meta};N(Y);const se=R(Y);return Promise.resolve(se).then(Z=>M(V,j,Z,X))};let z;if(!w.length)z=O([]);else if(v){const V=typeof p<"u",G=V?p:oR(e.options,w);z=O(w,V,G)}else if(y){const V=typeof p<"u",G=V?p:hce(e.options,w);z=O(w,V,G,!0)}else{k=[];const V=typeof e.options.getNextPageParam>"u";z=(o&&w[0]?o(w[0],0,w):!0)?O([],V,P[0]):Promise.resolve(M([],P[0],w[0]));for(let j=1;j{if(o&&w[j]?o(w[j],j,w):!0){const se=V?P[j]:oR(e.options,X);return O(X,V,se)}return Promise.resolve(M(X,P[j],w[j]))})}return z.then(V=>({pages:V,pageParams:k}))}}}}function oR(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function hce(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class pce{constructor(t={}){this.queryCache=t.queryCache||new uce,this.mutationCache=t.mutationCache||new dce,this.logger=t.logger||yE,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=n0.subscribe(()=>{n0.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=r0.subscribe(()=>{r0.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=Ul(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=Jh(t,n,r),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),s=i==null?void 0:i.state.data,c=ece(n,s);if(typeof c>"u")return;const o=Jh(t),f=this.defaultQueryOptions(o);return this.queryCache.build(this,f).setData(c,{...r,manual:!0})}setQueriesData(t,n,r){return ai.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Ul(t,n),i=this.queryCache;ai.batch(()=>{i.findAll(r).forEach(s=>{i.remove(s)})})}resetQueries(t,n,r){const[i,s]=Ul(t,n,r),c=this.queryCache,o={type:"active",...i};return ai.batch(()=>(c.findAll(i).forEach(f=>{f.reset()}),this.refetchQueries(o,s)))}cancelQueries(t,n,r){const[i,s={}]=Ul(t,n,r);typeof s.revert>"u"&&(s.revert=!0);const c=ai.batch(()=>this.queryCache.findAll(i).map(o=>o.cancel(s)));return Promise.all(c).then(ma).catch(ma)}invalidateQueries(t,n,r){const[i,s]=Ul(t,n,r);return ai.batch(()=>{var c,o;if(this.queryCache.findAll(i).forEach(p=>{p.invalidate()}),i.refetchType==="none")return Promise.resolve();const f={...i,type:(c=(o=i.refetchType)!=null?o:i.type)!=null?c:"active"};return this.refetchQueries(f,s)})}refetchQueries(t,n,r){const[i,s]=Ul(t,n,r),c=ai.batch(()=>this.queryCache.findAll(i).filter(f=>!f.isDisabled()).map(f=>{var p;return f.fetch(void 0,{...s,cancelRefetch:(p=s==null?void 0:s.cancelRefetch)!=null?p:!0,meta:{refetchPage:i.refetchPage}})}));let o=Promise.all(c).then(ma);return s!=null&&s.throwOnError||(o=o.catch(ma)),o}fetchQuery(t,n,r){const i=Jh(t,n,r),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const c=this.queryCache.build(this,s);return c.isStaleByTime(s.staleTime)?c.fetch(s):Promise.resolve(c.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(ma).catch(ma)}fetchInfiniteQuery(t,n,r){const i=Jh(t,n,r);return i.behavior=fce(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(ma).catch(ma)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>lc(t)===lc(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>t0(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>lc(t)===lc(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>t0(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=gE(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class mce extends Of{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),aR(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return DC(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return DC(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),AC(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const s=this.hasListeners();s&&sR(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const c=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||c!==this.currentRefetchInterval)&&this.updateRefetchInterval(c)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t);return this.createResult(n,t)}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ma)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Qp||this.currentResult.isStale||!MC(this.options.staleTime))return;const n=l6(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Qp||this.options.enabled===!1||!MC(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||n0.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,s=this.currentResult,c=this.currentResultState,o=this.currentResultOptions,f=t!==r,p=f?t.state:this.currentQueryInitialState,v=f?this.currentResult:this.previousQueryResult,{state:y}=t;let{dataUpdatedAt:w,error:P,errorUpdatedAt:k,fetchStatus:A,status:N}=y,R=!1,M=!1,O;if(n._optimisticResults){const j=this.hasListeners(),X=!j&&aR(t,n),Y=j&&sR(t,r,n,i);(X||Y)&&(A=Sx(t.options.networkMode)?"fetching":"paused",w||(N="loading")),n._optimisticResults==="isRestoring"&&(A="idle")}if(n.keepPreviousData&&!y.dataUpdatedAt&&v!=null&&v.isSuccess&&N!=="error")O=v.data,w=v.dataUpdatedAt,N=v.status,R=!0;else if(n.select&&typeof y.data<"u")if(s&&y.data===(c==null?void 0:c.data)&&n.select===this.selectFn)O=this.selectResult;else try{this.selectFn=n.select,O=n.select(y.data),O=OC(s==null?void 0:s.data,O,n),this.selectResult=O,this.selectError=null}catch(j){this.selectError=j}else O=y.data;if(typeof n.placeholderData<"u"&&typeof O>"u"&&N==="loading"){let j;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))j=s.data;else if(j=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof j<"u")try{j=n.select(j),this.selectError=null}catch(X){this.selectError=X}typeof j<"u"&&(N="success",O=OC(s==null?void 0:s.data,j,n),M=!0)}this.selectError&&(P=this.selectError,O=this.selectResult,k=Date.now(),N="error");const z=A==="fetching",B=N==="loading",V=N==="error";return{status:N,fetchStatus:A,isLoading:B,isSuccess:N==="success",isError:V,isInitialLoading:B&&z,data:O,dataUpdatedAt:w,error:P,errorUpdatedAt:k,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:z,isRefetching:z&&!B,isLoadingError:V&&y.dataUpdatedAt===0,isPaused:A==="paused",isPlaceholderData:M,isPreviousData:R,isRefetchError:V&&y.dataUpdatedAt!==0,isStale:xE(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,AC(r,n))return;this.currentResult=r;const i={cache:!0},s=()=>{if(!n)return!0;const{notifyOnChangeProps:c}=this.options;if(c==="all"||!c&&!this.trackedProps.size)return!0;const o=new Set(c!=null?c:this.trackedProps);return this.options.useErrorBoundary&&o.add("error"),Object.keys(this.currentResult).some(f=>{const p=f;return this.currentResult[p]!==n[p]&&o.has(p)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!ty(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){ai.batch(()=>{if(t.onSuccess){var n,r,i,s;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(t.onError){var c,o,f,p;(c=(o=this.options).onError)==null||c.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 vce(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function aR(e,t){return vce(e,t)||e.state.dataUpdatedAt>0&&DC(e,t,t.refetchOnMount)}function DC(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&xE(e,t)}return!1}function sR(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&xE(e,n)}function xE(e,t){return e.isStaleByTime(t.staleTime)}class gce extends Of{constructor(t,n){super(),this.client=t,this.setOptions(n),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.client.defaultMutationOptions(t),AC(n,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 n={listeners:!0};t.type==="success"?n.onSuccess=!0:t.type==="error"&&(n.onError=!0),this.notify(n)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,n){return this.mutateOptions=n,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:m6(),n={...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=n}notify(t){ai.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var n,r,i,s;(n=(r=this.mutateOptions).onSuccess)==null||n.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var c,o,f,p;(c=(o=this.mutateOptions).onError)==null||c.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 v6=k0.exports.useSyncExternalStore,lR=C.exports.createContext(void 0),g6=C.exports.createContext(!1);function y6(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=lR),window.ReactQueryClientContext):lR)}const Oc=({context:e}={})=>{const t=C.exports.useContext(y6(e,C.exports.useContext(g6)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yce=({client:e,children:t,context:n,contextSharing:r=!1})=>{C.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=y6(n,r);return I(g6.Provider,{value:!n&&r,children:I(i.Provider,{value:e,children:t})})},x6=C.exports.createContext(!1),xce=()=>C.exports.useContext(x6);x6.Provider;function _ce(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const bce=C.exports.createContext(_ce()),wce=()=>C.exports.useContext(bce);function _6(e,t){return typeof e=="function"?e(...t):!!e}const Cce=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},Sce=e=>{C.exports.useEffect(()=>{e.clearReset()},[e])},Ece=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&_6(n,[e.error,r]),Pce=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Tce=(e,t)=>e.isLoading&&e.isFetching&&!t,kce=(e,t,n)=>(e==null?void 0:e.suspense)&&Tce(t,n),Ice=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function Rce(e,t){const n=Oc({context:e.context}),r=xce(),i=wce(),s=n.defaultQueryOptions(e);s._optimisticResults=r?"isRestoring":"optimistic",s.onError&&(s.onError=ai.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=ai.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=ai.batchCalls(s.onSettled)),Pce(s),Cce(s,i),Sce(i);const[c]=C.exports.useState(()=>new t(n,s)),o=c.getOptimisticResult(s);if(v6(C.exports.useCallback(f=>r?()=>{}:c.subscribe(ai.batchCalls(f)),[c,r]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.exports.useEffect(()=>{c.setOptions(s,{listeners:!1})},[s,c]),kce(s,o,r))throw Ice(s,c,i);if(Ece({result:o,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:c.getCurrentQuery()}))throw o.error;return s.notifyOnChangeProps?o:c.trackResult(o)}function ao(e,t,n){const r=Jh(e,t,n);return Rce(r,mce)}function b6(e,t,n){const r=tce(e,t,n),i=Oc({context:r.context}),[s]=C.exports.useState(()=>new gce(i,r));C.exports.useEffect(()=>{s.setOptions(r)},[s,r]);const c=v6(C.exports.useCallback(f=>s.subscribe(ai.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=C.exports.useCallback((f,p)=>{s.mutate(f,p).catch(Mce)},[s]);if(c.error&&_6(s.options.useErrorBoundary,[c.error]))throw c.error;return{...c,mutate:o,mutateAsync:c.mutate}}function Mce(){}const gn={initial:"initial","initial-match":"initial-match-points","initial-unmatch":"initial-unmatch-points",approve:"approve-points",working:"working-points",workingBackground:"working-points-bg",filteredWorking:"filtered-working-points",filteredWorkingBackground:"filtered-working-points-bg",cancelled:"cancelled-points",atd:"atd",pvz:"pvz",other:"other"},Gn={pending:"Pending",onApproval:"Installation",working:"Working",cancelled:"Cancelled"},uc={[Gn.pending]:"\u041A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E",[Gn.onApproval]:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",[Gn.working]:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",[Gn.cancelled]:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D"},_E={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"},Ace="\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",Ur={PENDING:"INITIAL",ON_APPROVAL:"ON_APPROVAL",WORKING:"WORKING"},Nce={[Ur.PENDING]:[gn.initial,gn.working,gn.cancelled],[Ur.ON_APPROVAL]:[gn.approve,gn.working,gn.cancelled],[Ur.WORKING]:[gn.filteredWorking]},uR=e=>{let t;const n=new Set,r=(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),n.forEach(w=>w(t,y))}},i=()=>t,o={setState:r,getState:i,subscribe:f=>(n.add(f),()=>n.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."),n.clear()}};return t=e(r,i,o),o},Oce=e=>e?uR(e):uR;var w6={exports:{}},C6={};/** * @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 Ex=C.exports,Dce=k0.exports;function Lce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zce=typeof Object.is=="function"?Object.is:Lce,Fce=Dce.useSyncExternalStore,$ce=Ex.useRef,Bce=Ex.useEffect,Vce=Ex.useMemo,Uce=Ex.useDebugValue;C6.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=$ce(null);if(s.current===null){var c={hasValue:!1,value:null};s.current=c}else c=s.current;s=Vce(function(){function f(P){if(!p){if(p=!0,v=P,P=r(P),i!==void 0&&c.hasValue){var k=c.value;if(i(k,P))return y=k}return y=P}if(k=y,zce(v,P))return k;var A=r(P);return i!==void 0&&i(k,A)?k:(v=P,y=A)}var p=!1,v,y,w=n===void 0?null:n;return[function(){return f(t())},w===null?void 0:function(){return f(w())}]},[t,n,r,i]);var o=Fce(e,s[0],s[1]);return Bce(function(){c.hasValue=!0,c.value=o},[o]),Uce(o),o};(function(e){e.exports=C6})(w6);const jce=GC(w6.exports),{useSyncExternalStoreWithSelector:Kce}=jce;function Hce(e,t=e.getState,n){const r=Kce(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return C.exports.useDebugValue(r),r}const cR=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 n=typeof e=="function"?Oce(e):e,r=(i,s)=>Hce(n,i,s);return Object.assign(r,n),r},bs=e=>e?cR(e):cR;function ya(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:bE(e)?2:wE(e)?3:0}function LC(e,t){return Df(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Wce(e,t){return Df(e)===2?e.get(t):e[t]}function S6(e,t,n){var r=Df(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Gce(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function bE(e){return Jce&&e instanceof Map}function wE(e){return ede&&e instanceof Set}function zi(e){return e.o||e.t}function CE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=nde(e);delete t[wr];for(var n=TE(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=qce),Object.freeze(e),t&&ff(e,function(n,r){return SE(r,!0)},!0)),e}function qce(){ya(2)}function EE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function gs(e){var t=FC[e];return t||ya(18,e),t}function Zce(e,t){FC[e]||(FC[e]=t)}function i0(){return em}function ib(e,t){t&&(gs("Patches"),e.u=[],e.s=[],e.v=t)}function o0(e){zC(e),e.p.forEach(Xce),e.p=null}function zC(e){e===em&&(em=e.l)}function dR(e){return em={p:[],l:em,h:e,m:!0,_:0}}function Xce(e){var t=e[wr];t.i===0||t.i===1?t.j():t.O=!0}function ob(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||gs("ES5").S(t,e,r),r?(n[wr].P&&(o0(t),ya(4)),ll(e)&&(e=a0(t,e),t.l||s0(t,e)),t.u&&gs("Patches").M(n[wr].t,e,t.u,t.s)):e=a0(t,n,[]),o0(t),t.u&&t.v(t.u,t.s),e!==E6?e:void 0}function a0(e,t,n){if(EE(t))return t;var r=t[wr];if(!r)return ff(t,function(o,f){return fR(e,r,t,o,f,n)},!0),t;if(r.A!==e)return t;if(!r.P)return s0(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=CE(r.k):r.o,s=i,c=!1;r.i===3&&(s=new Set(i),i.clear(),c=!0),ff(s,function(o,f){return fR(e,r,i,o,f,n,c)}),s0(e,i,!1),n&&e.u&&gs("Patches").N(r,n,e.u,e.s)}return r.o}function fR(e,t,n,r,i,s,c){if(df(i)){var o=a0(e,i,s&&t&&t.i!==3&&!LC(t.R,r)?s.concat(r):void 0);if(S6(n,r,o),!df(o))return;e.m=!1}else c&&n.add(i);if(ll(i)&&!EE(i)){if(!e.h.D&&e._<1)return;a0(e,i),t&&t.A.l||s0(e,i)}}function s0(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&SE(t,n)}function ab(e,t){var n=e[wr];return(n?zi(n):e)[t]}function hR(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Hs(e){e.P||(e.P=!0,e.l&&Hs(e.l))}function sb(e){e.o||(e.o=CE(e.t))}function Jp(e,t,n){var r=bE(t)?gs("MapSet").F(t,n):wE(t)?gs("MapSet").T(t,n):e.g?function(i,s){var c=Array.isArray(i),o={i:c?1:0,A:s?s.A:i0(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},f=o,p=$C;c&&(f=[o],p=ep);var v=Proxy.revocable(f,p),y=v.revoke,w=v.proxy;return o.k=w,o.j=y,w}(t,n):gs("ES5").J(t,n);return(n?n.A:i0()).p.push(r),r}function Yce(e){return df(e)||ya(22,e),function t(n){if(!ll(n))return n;var r,i=n[wr],s=Df(n);if(i){if(!i.P&&(i.i<4||!gs("ES5").K(i)))return i.t;i.I=!0,r=pR(n,s),i.I=!1}else r=pR(n,s);return ff(r,function(c,o){i&&Wce(i.t,c)===o||S6(r,c,t(o))}),s===3?new Set(r):r}(e)}function pR(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return CE(e)}function Qce(){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 n(o){o.o||(o.o=new Set,o.t.forEach(function(f){if(ll(f)){var p=Jp(o.A.h,f,o);o.p.set(f,p),o.o.add(p)}else o.o.add(f)}))}function r(o){o.O&&ya(3,JSON.stringify(zi(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)},s=function(){function o(p,v){return this[wr]={i:2,l:v,A:v?v.A:i0(),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 zi(this[wr]).size}}),f.has=function(p){return zi(this[wr]).has(p)},f.set=function(p,v){var y=this[wr];return r(y),zi(y).has(p)&&zi(y).get(p)===v||(t(y),Hs(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[wr];return r(v),t(v),Hs(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[wr];r(p),zi(p).size&&(t(p),Hs(p),p.R=new Map,ff(p.t,function(v){p.R.set(v,!1)}),p.o.clear())},f.forEach=function(p,v){var y=this;zi(this[wr]).forEach(function(w,P){p.call(v,y.get(P),P,y)})},f.get=function(p){var v=this[wr];r(v);var y=zi(v).get(p);if(v.I||!ll(y)||y!==v.t.get(p))return y;var w=Jp(v.A.h,y,v);return t(v),v.o.set(p,w),w},f.keys=function(){return zi(this[wr]).keys()},f.values=function(){var p,v=this,y=this.keys();return(p={})[Eg]=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={})[Eg]=function(){return v.entries()},p.next=function(){var w=y.next();if(w.done)return w;var P=v.get(w.value);return{done:!1,value:[w.value,P]}},p},f[Eg]=function(){return this.entries()},o}(),c=function(){function o(p,v){return this[wr]={i:3,l:v,A:v?v.A:i0(),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 zi(this[wr]).size}}),f.has=function(p){var v=this[wr];return r(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[wr];return r(v),this.has(p)||(n(v),Hs(v),v.o.add(p)),this},f.delete=function(p){if(!this.has(p))return!1;var v=this[wr];return r(v),n(v),Hs(v),v.o.delete(p)||!!v.p.has(p)&&v.o.delete(v.p.get(p))},f.clear=function(){var p=this[wr];r(p),zi(p).size&&(n(p),Hs(p),p.o.clear())},f.values=function(){var p=this[wr];return r(p),n(p),p.o.values()},f.entries=function(){var p=this[wr];return r(p),n(p),p.o.entries()},f.keys=function(){return this.values()},f[Eg]=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}();Zce("MapSet",{F:function(o,f){return new s(o,f)},T:function(o,f){return new c(o,f)}})}var mR,em,PE=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Jce=typeof Map<"u",ede=typeof Set<"u",vR=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",E6=PE?Symbol.for("immer-nothing"):((mR={})["immer-nothing"]=!0,mR),gR=PE?Symbol.for("immer-draftable"):"__$immer_draftable",wr=PE?Symbol.for("immer-state"):"__$immer_state",Eg=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",tde=""+Object.prototype.constructor,TE=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,nde=Object.getOwnPropertyDescriptors||function(e){var t={};return TE(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},FC={},$C={get:function(e,t){if(t===wr)return e;var n=zi(e);if(!LC(n,t))return function(i,s,c){var o,f=hR(s,c);return f?"value"in f?f.value:(o=f.get)===null||o===void 0?void 0:o.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!ll(r)?r:r===ab(e.t,t)?(sb(e),e.o[t]=Jp(e.A.h,r,e)):r},has:function(e,t){return t in zi(e)},ownKeys:function(e){return Reflect.ownKeys(zi(e))},set:function(e,t,n){var r=hR(zi(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=ab(zi(e),t),s=i==null?void 0:i[wr];if(s&&s.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Gce(n,i)&&(n!==void 0||LC(e.t,t)))return!0;sb(e),Hs(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return ab(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,sb(e),Hs(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=zi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){ya(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ya(12)}},ep={};ff($C,function(e,t){ep[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ep.deleteProperty=function(e,t){return ep.set.call(this,e,t,void 0)},ep.set=function(e,t,n){return $C.set.call(this,e[0],t,n,e[0])};var rde=function(){function e(n){var r=this;this.g=vR,this.D=!0,this.produce=function(i,s,c){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var f=r;return function(A){var N=this;A===void 0&&(A=o);for(var R=arguments.length,M=Array(R>1?R-1:0),O=1;O1?v-1:0),w=1;w=0;i--){var s=r[i];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}i>-1&&(r=r.slice(i+1));var c=gs("Patches").$;return df(n)?c(n,r):this.produce(n,function(o){return c(o,r)})},e}(),ea=new rde,ide=ea.produce;ea.produceWithPatches.bind(ea);ea.setAutoFreeze.bind(ea);ea.setUseProxies.bind(ea);ea.applyPatches.bind(ea);ea.createDraft.bind(ea);ea.finishDraft.bind(ea);const ode=e=>(t,n,r)=>(r.setState=(i,s,...c)=>{const o=typeof i=="function"?ide(i):i;return t(o,s,...c)},e(r.setState,n,r)),ws=ode,ade={included:new Set([]),excluded:new Set([])},sde=e=>({selection:ade,include:t=>{e(n=>{const{excluded:r}=n.selection;r.has(t)?n.selection.excluded.delete(t):n.selection.included.add(t)})},exclude:t=>{e(n=>{const{included:r}=n.selection;r.has(t)?n.selection.included.delete(t):n.selection.excluded.add(t)})},reset:()=>e(t=>{t.selection.included.clear(),t.selection.excluded.clear()})}),ml=bs(ws(sde)),lde=()=>{const{selection:e}=ml();return C.exports.useMemo(()=>e.included.size||e.excluded.size,[e])};function ude(e){let t;try{t=e()}catch{return}return{getItem:r=>{var i;const s=o=>o===null?null:JSON.parse(o),c=(i=t.getItem(r))!=null?i:null;return c instanceof Promise?c.then(s):s(c)},setItem:(r,i)=>t.setItem(r,JSON.stringify(i)),removeItem:r=>t.removeItem(r)}}const tm=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return tm(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return tm(r)(n)}}}},cde=(e,t)=>(n,r,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:N=>N,version:0,merge:(N,R)=>({...R,...N}),...t},c=!1;const o=new Set,f=new Set;let p;try{p=s.getStorage()}catch{}if(!p)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...N)},r,i);const v=tm(s.serialize),y=()=>{const N=s.partialize({...r()});let R;const M=v({state:N,version:s.version}).then(O=>p.setItem(s.name,O)).catch(O=>{R=O});if(R)throw R;return M},w=i.setState;i.setState=(N,R)=>{w(N,R),y()};const P=e((...N)=>{n(...N),y()},r,i);let k;const A=()=>{var N;if(!p)return;c=!1,o.forEach(M=>M(r()));const R=((N=s.onRehydrateStorage)==null?void 0:N.call(s,r()))||void 0;return tm(p.getItem.bind(p))(s.name).then(M=>{if(M)return s.deserialize(M)}).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==s.version){if(s.migrate)return s.migrate(M.state,M.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return M.state}).then(M=>{var O;return k=s.merge(M,(O=r())!=null?O:P),n(k,!0),y()}).then(()=>{R==null||R(k,void 0),c=!0,f.forEach(M=>M(k))}).catch(M=>{R==null||R(void 0,M)})};return i.persist={setOptions:N=>{s={...s,...N},N.getStorage&&(p=N.getStorage())},clearStorage:()=>{p==null||p.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>A(),hasHydrated:()=>c,onHydrate:N=>(o.add(N),()=>{o.delete(N)}),onFinishHydration:N=>(f.add(N),()=>{f.delete(N)})},A(),k||P},dde=(e,t)=>(n,r,i)=>{let s={storage:ude(()=>localStorage),partialize:A=>A,version:0,merge:(A,N)=>({...N,...A}),...t},c=!1;const o=new Set,f=new Set;let p=s.storage;if(!p)return e((...A)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...A)},r,i);const v=()=>{const A=s.partialize({...r()});return p.setItem(s.name,{state:A,version:s.version})},y=i.setState;i.setState=(A,N)=>{y(A,N),v()};const w=e((...A)=>{n(...A),v()},r,i);let P;const k=()=>{var A;if(!p)return;c=!1,o.forEach(R=>R(r()));const N=((A=s.onRehydrateStorage)==null?void 0:A.call(s,r()))||void 0;return tm(p.getItem.bind(p))(s.name).then(R=>{if(R)if(typeof R.version=="number"&&R.version!==s.version){if(s.migrate)return s.migrate(R.state,R.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return R.state}).then(R=>{var M;return P=s.merge(R,(M=r())!=null?M:w),n(P,!0),v()}).then(()=>{N==null||N(P,void 0),c=!0,f.forEach(R=>R(P))}).catch(R=>{N==null||N(void 0,R)})};return i.persist={setOptions:A=>{s={...s,...A},A.storage&&(p=A.storage)},clearStorage:()=>{p==null||p.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>k(),hasHydrated:()=>c,onHydrate:A=>(o.add(A),()=>{o.delete(A)}),onFinishHydration:A=>(f.add(A),()=>{f.delete(A)})},k(),P||w},fde=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),cde(e,t)):dde(e,t)},Mm=fde,xp={prediction:[0,0],categories:[],region:null},hde=e=>({filters:xp,setPrediction:t=>{e(n=>{n.filters.prediction=t})},setCategories:t=>e(n=>{n.filters.categories=t}),setRegion:t=>e(n=>{n.filters.region=t}),clear:t=>e(n=>{if(!t)return n.filters=xp,n;n.filters={...xp,prediction:t.prediction}})}),Cs=bs(Mm(ws(hde),{name:"postnet/pending-filters"})),_p="https://postnet-dev.selftech.ru",Co=Jue.create({baseURL:`${_p}/`,withCredentials:!0,xsrfHeaderName:"X-CSRFToken",xsrfCookieName:"csrftoken"}),P6=(e,t)=>{const n=e||new URLSearchParams;return t&&(t.type==="ao"&&n.append("district[]",t.id),t.type==="rayon"&&n.append("area[]",t.id)),n},Lf=async(e,t)=>{const n=P6(e,t),{data:r}=await Co.get(`/api/placement_points?${n.toString()}`);return r},kE=async(e,t)=>{const n=P6(e,t),{data:r}=await Co.get(`/api/placement_points/to_excel?${n.toString()}`,{responseType:"arraybuffer"});return r},pde=()=>ao(["all-initial-count"],async()=>{const e=new URLSearchParams({page:1,page_size:1,"status[]":[Gn.pending]});return await Lf(e)},{select:e=>e.count}),mde=()=>{const{filters:e}=Cs(),{prediction:t,categories:n,region:r}=e,{selection:{included:i}}=ml(),s=[...i];return ao(["filtered-points",e,s],async()=>{const c=new URLSearchParams({page:1,page_size:1,"prediction_current[]":t,"status[]":[Gn.pending],"categories[]":n,"included[]":s});return await Lf(c,r)},{select:c=>c.count,keepPreviousData:!0})},vde=()=>ao(["permissions"],async()=>{var t;const{data:e}=await Co.get("/api/me");return(t=e==null?void 0:e.groups)!=null&&t.includes("\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440")?"editor":"viewer"}),Am=()=>{const{data:e}=vde();return e==="editor"},T6=()=>b6({mutationFn:e=>Co.put(`/api/placement_points/update_postamat_id?${e.toString()}`)}),k6=_f(!0),IE=_f(!1),RE=gV(IE,"setAuth",(e,t)=>{e.set(t)});async function gde(){try{await Co.get("/accounts/profile/"),RE(!0)}catch{console.log("Not authorized")}finally{k6.set(!1)}}gde();class yde extends Error{constructor(n){super("");uP(this,"errors");this.name="DjangoValidationError";const r=[];for(const i in n)r.push({name:i,errors:n[i]});this.errors=r}}const BC=_f(!1),VC=_f(""),xde="\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 _de(e){var n,r,i,s;BC.set(!0),VC.set("");try{const{data:c}=await Co.post("accounts/login/",e);return RE(!0),c}catch(c){var t=xde;throw(r=(n=c.response)==null?void 0:n.data)!=null&&r.detail&&(t=(s=(i=c.response)==null?void 0:i.data)==null?void 0:s.detail,VC.set(t)),new yde(c.response.data)}finally{BC.set(!1)}}_f(!1);_f("");function bde(){const e=Bp(VC),t=Bp(BC),n=r=>{_de(r)};return Qe(xL,{direction:"vertical",style:{width:"320px"},children:[e.length>0?I(v2,{type:"error",showIcon:!0,closable:!0,description:e}):null,I(P5.Title,{level:4,children:"\u0412\u0445\u043E\u0434"}),Qe(sc,{disabled:t,name:"basic",layout:"vertical",onFinish:n,autoComplete:"off",children:[I(sc.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:I(Xy,{prefix:I(Ble,{className:"site-form-item-icon"}),placeholder:"\u043B\u043E\u0433\u0438\u043D"})}),I(sc.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:I(Xy,{prefix:I(Ole,{className:"site-form-item-icon"}),type:"password",placeholder:"\u043F\u0430\u0440\u043E\u043B\u044C"})}),I(sc.Item,{children:I(gr,{block:!0,type:"primary",htmlType:"submit",children:"\u0412\u043E\u0439\u0442\u0438"})})]})]})}function wde(){return Bp(IE)?I(WS,{to:"/",replace:!0}):I("main",{className:"w-screen h-screen flex items-center justify-center",children:I(bde,{})})}const Cde=e=>{const t=C.exports.useRef(e),n=C.exports.useRef(),r=C.exports.useRef(!1),i=C.exports.useRef(!1),[,s]=C.exports.useState(0);r.current&&(i.current=!0),C.exports.useEffect(()=>(r.current||(n.current=t.current(),r.current=!0),s(c=>c+1),()=>{!i.current||n.current&&n.current()}),[])};function Sde(){const[e]=pV(),[t,n]=C.exports.useState(!1);return Cde(()=>{async function r(){try{await Co.post("accounts/verify-registration/",{user_id:e.get("user_id"),timestamp:e.get("timestamp"),signature:e.get("signature")})}finally{n(!0)}}r()}),t?I(WS,{to:"/"}):I("div",{children:"Verifying..."})}function Ede(e){const t=Bp(IE);return Bp(k6)?I(Pf,{className:"user-info-loader"}):t?I(An,{children:e.children}):I(WS,{to:"/signin",replace:!0})}var I6={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Gs,function(){var n,r,i;function s(o,f){if(!n)n=f;else if(!r)r=f;else{var p="var sharedChunk = {}; ("+n+")(sharedChunk); ("+r+")(sharedChunk);",v={};n(v),i=f(v),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([p],{type:"text/javascript"})))}}s(["exports"],function(o){var f=p;function p(u,a,d,m){this.cx=3*u,this.bx=3*(d-u)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*a,this.by=3*(m-a)-this.cy,this.ay=1-this.cy-this.by,this.p1x=u,this.p1y=a,this.p2x=d,this.p2y=m}function v(u,a,d,m){const _=new f(u,a,d,m);return function(S){return _.solve(S)}}p.prototype={sampleCurveX:function(u){return((this.ax*u+this.bx)*u+this.cx)*u},sampleCurveY:function(u){return((this.ay*u+this.by)*u+this.cy)*u},sampleCurveDerivativeX:function(u){return(3*this.ax*u+2*this.bx)*u+this.cx},solveCurveX:function(u,a){if(a===void 0&&(a=1e-6),u<0)return 0;if(u>1)return 1;for(var d=u,m=0;m<8;m++){var _=this.sampleCurveX(d)-u;if(Math.abs(_)_?T=d:L=d,d=.5*(L-T)+T;return d},solve:function(u,a){return this.sampleCurveY(this.solveCurveX(u,a))}};const y=v(.25,.1,.25,1);function w(u,a,d){return Math.min(d,Math.max(a,u))}function P(u,a,d){const m=d-a,_=((u-a)%m+m)%m+a;return _===a?d:_}function k(u,...a){for(const d of a)for(const m in d)u[m]=d[m];return u}let A=1;function N(u,a){u.forEach(d=>{a[d]&&(a[d]=a[d].bind(a))})}function R(u,a,d){const m={};for(const _ in u)m[_]=a.call(d||this,u[_],_,u);return m}function M(u,a,d){const m={};for(const _ in u)a.call(d||this,u[_],_,u)&&(m[_]=u[_]);return m}function O(u){return Array.isArray(u)?u.map(O):typeof u=="object"&&u?R(u,O):u}const z={};function B(u){z[u]||(typeof console<"u"&&console.warn(u),z[u]=!0)}function V(u,a,d){return(d.y-u.y)*(a.x-u.x)>(a.y-u.y)*(d.x-u.x)}function G(u){let a=0;for(let d,m,_=0,S=u.length,T=S-1;_@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(d,m,_,S)=>{const T=_||S;return a[m]=!T||T.toLowerCase(),""}),a["max-age"]){const d=parseInt(a["max-age"],10);isNaN(d)?delete a["max-age"]:a["max-age"]=d}return a}let Y,se,ee=null;function Z(u){if(ee==null){const a=u.navigator?u.navigator.userAgent:null;ee=!!u.safari||!(!a||!(/\b(iPad|iPhone|iPod)\b/.test(a)||a.match("Safari")&&!a.match("Chrome")))}return ee}function J(u){return typeof ImageBitmap<"u"&&u instanceof ImageBitmap}const ve={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(u){const a=requestAnimationFrame(u);return{cancel:()=>cancelAnimationFrame(a)}},getImageData(u,a=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=u.width,d.height=u.height,m.drawImage(u,0,0,u.width,u.height),m.getImageData(-a,-a,u.width+2*a,u.height+2*a)},resolveURL:u=>(Y||(Y=document.createElement("a")),Y.href=u,Y.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(se==null&&(se=matchMedia("(prefers-reduced-motion: reduce)")),se.matches)}};var ie=ce;function ce(u,a){this.x=u,this.y=a}ce.prototype={clone:function(){return new ce(this.x,this.y)},add:function(u){return this.clone()._add(u)},sub:function(u){return this.clone()._sub(u)},multByPoint:function(u){return this.clone()._multByPoint(u)},divByPoint:function(u){return this.clone()._divByPoint(u)},mult:function(u){return this.clone()._mult(u)},div:function(u){return this.clone()._div(u)},rotate:function(u){return this.clone()._rotate(u)},rotateAround:function(u,a){return this.clone()._rotateAround(u,a)},matMult:function(u){return this.clone()._matMult(u)},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(u){return this.x===u.x&&this.y===u.y},dist:function(u){return Math.sqrt(this.distSqr(u))},distSqr:function(u){var a=u.x-this.x,d=u.y-this.y;return a*a+d*d},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(u){return Math.atan2(this.y-u.y,this.x-u.x)},angleWith:function(u){return this.angleWithSep(u.x,u.y)},angleWithSep:function(u,a){return Math.atan2(this.x*a-this.y*u,this.x*u+this.y*a)},_matMult:function(u){var a=u[2]*this.x+u[3]*this.y;return this.x=u[0]*this.x+u[1]*this.y,this.y=a,this},_add:function(u){return this.x+=u.x,this.y+=u.y,this},_sub:function(u){return this.x-=u.x,this.y-=u.y,this},_mult:function(u){return this.x*=u,this.y*=u,this},_div:function(u){return this.x/=u,this.y/=u,this},_multByPoint:function(u){return this.x*=u.x,this.y*=u.y,this},_divByPoint:function(u){return this.x/=u.x,this.y/=u.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var u=this.y;return this.y=this.x,this.x=-u,this},_rotate:function(u){var a=Math.cos(u),d=Math.sin(u),m=d*this.x+a*this.y;return this.x=a*this.x-d*this.y,this.y=m,this},_rotateAround:function(u,a){var d=Math.cos(u),m=Math.sin(u),_=a.y+m*(this.x-a.x)+d*(this.y-a.y);return this.x=a.x+d*(this.x-a.x)-m*(this.y-a.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ce.convert=function(u){return u instanceof ce?u:Array.isArray(u)?new ce(u[0],u[1]):u};const oe={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},ye="mapbox-tiles";let Ie,Te,Pe=500,De=50;function Re(){typeof caches>"u"||Ie||(Ie=caches.open(ye))}let ke=1/0;const Oe={supported:!1,testSupport:function(u){!Ue&&He&&(st?ft(u):$e=u)}};let $e,He,Ue=!1,st=!1;function ft(u){const a=u.createTexture();u.bindTexture(u.TEXTURE_2D,a);try{if(u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,He),u.isContextLost())return;Oe.supported=!0}catch{}u.deleteTexture(a),Ue=!0}typeof document<"u"&&(He=document.createElement("img"),He.onload=function(){$e&&ft($e),$e=null,st=!0},He.onerror=function(){Ue=!0,$e=null},He.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const It={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(It);class We extends Error{constructor(a,d,m,_){super(`AJAXError: ${d} (${a}): ${m}`),this.status=a,this.statusText=d,this.url=m,this.body=_}}const Pt=j()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function pt(u,a){const d=new AbortController,m=new Request(u.url,{method:u.method||"GET",body:u.body,credentials:u.credentials,headers:u.headers,referrer:Pt(),signal:d.signal});let _=!1,S=!1;return u.type==="json"&&m.headers.set("Accept","application/json"),((T,L,F)=>{if(S)return;const K=Date.now();fetch(m).then(Q=>Q.ok?((ne,ue,he)=>{(u.type==="arrayBuffer"?ne.arrayBuffer():u.type==="json"?ne.json():ne.text()).then(pe=>{S||(ue&&he&&function(Ne,Ae,Ye){if(Re(),!Ie)return;const lt={status:Ae.status,statusText:Ae.statusText,headers:new Headers};Ae.headers.forEach((it,kt)=>lt.headers.set(kt,it));const Ke=X(Ae.headers.get("Cache-Control")||"");Ke["no-store"]||(Ke["max-age"]&<.headers.set("Expires",new Date(Ye+1e3*Ke["max-age"]).toUTCString()),new Date(lt.headers.get("Expires")).getTime()-Ye<42e4||function(it,kt){if(Te===void 0)try{new Response(new ReadableStream),Te=!0}catch{Te=!1}Te?kt(it.body):it.blob().then(kt)}(Ae,it=>{const kt=new Response(it,lt);Re(),Ie&&Ie.then(Tt=>Tt.put(function(hn){const vn=hn.indexOf("?");return vn<0?hn:hn.slice(0,vn)}(Ne.url),kt)).catch(Tt=>B(Tt.message))}))}(m,ue,he),_=!0,a(null,pe,ne.headers.get("Cache-Control"),ne.headers.get("Expires")))}).catch(pe=>{S||a(new Error(pe.message))})})(Q,null,K):Q.blob().then(ne=>a(new We(Q.status,Q.statusText,u.url,ne)))).catch(Q=>{Q.code!==20&&a(new Error(Q.message))})})(),{cancel:()=>{S=!0,_||d.abort()}}}const Rt=function(u,a){if(/:\/\//.test(u.url)&&!/^https?:|^file:/.test(u.url)){if(j()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",u,a);if(!j()){const m=u.url.substring(0,u.url.indexOf("://"));return(oe.REGISTERED_PROTOCOLS[m]||pt)(u,a)}}if(!(/^file:/.test(d=u.url)||/^file:/.test(Pt())&&!/^\w+:/.test(d))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return pt(u,a);if(j()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",u,a,void 0,!0)}var d;return function(m,_){const S=new XMLHttpRequest;S.open(m.method||"GET",m.url,!0),m.type==="arrayBuffer"&&(S.responseType="arraybuffer");for(const T in m.headers)S.setRequestHeader(T,m.headers[T]);return m.type==="json"&&(S.responseType="text",S.setRequestHeader("Accept","application/json")),S.withCredentials=m.credentials==="include",S.onerror=()=>{_(new Error(S.statusText))},S.onload=()=>{if((S.status>=200&&S.status<300||S.status===0)&&S.response!==null){let T=S.response;if(m.type==="json")try{T=JSON.parse(S.response)}catch(L){return _(L)}_(null,T,S.getResponseHeader("Cache-Control"),S.getResponseHeader("Expires"))}else{const T=new Blob([S.response],{type:S.getResponseHeader("Content-Type")});_(new We(S.status,S.statusText,m.url,T))}},S.send(m.body),{cancel:()=>S.abort()}}(u,a)},yt=function(u,a){return Rt(k(u,{type:"arrayBuffer"}),a)};function Mt(u){const a=window.document.createElement("a");return a.href=u,a.protocol===window.document.location.protocol&&a.host===window.document.location.host}const ut="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let dt,ct;dt=[],ct=0;const rt=function(u,a){if(Oe.supported&&(u.headers||(u.headers={}),u.headers.accept="image/webp,*/*"),ct>=oe.MAX_PARALLEL_IMAGE_REQUESTS){const S={requestParameters:u,callback:a,cancelled:!1,cancel(){this.cancelled=!0}};return dt.push(S),S}ct++;let d=!1;const m=()=>{if(!d)for(d=!0,ct--;dt.length&&ct{m(),S?a(S):T&&function(K,Q){typeof createImageBitmap=="function"?function(ne,ue){const he=new Blob([new Uint8Array(ne)],{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.`))})}(K,Q):function(ne,ue){const he=new Image;he.onload=()=>{ue(null,he),URL.revokeObjectURL(he.src),he.onload=null,window.requestAnimationFrame(()=>{he.src=ut})},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(ne)],{type:"image/png"});he.src=ne.byteLength?URL.createObjectURL(pe):ut}(K,Q)}(T,(K,Q)=>{K!=null?a(K):Q!=null&&a(null,Q,{cacheControl:L,expires:F})})});return{cancel:()=>{_.cancel(),m()}}};function ht(u,a,d){d[u]&&d[u].indexOf(a)!==-1||(d[u]=d[u]||[],d[u].push(a))}function bt(u,a,d){if(d&&d[u]){const m=d[u].indexOf(a);m!==-1&&d[u].splice(m,1)}}class Wt{constructor(a,d={}){k(this,d),this.type=a}}class Ut extends Wt{constructor(a,d={}){super("error",k({error:a},d))}}class Jt{on(a,d){return this._listeners=this._listeners||{},ht(a,d,this._listeners),this}off(a,d){return bt(a,d,this._listeners),bt(a,d,this._oneTimeListeners),this}once(a,d){return this._oneTimeListeners=this._oneTimeListeners||{},ht(a,d,this._oneTimeListeners),this}fire(a,d){typeof a=="string"&&(a=new Wt(a,d||{}));const m=a.type;if(this.listens(m)){a.target=this;const _=this._listeners&&this._listeners[m]?this._listeners[m].slice():[];for(const L of _)L.call(this,a);const S=this._oneTimeListeners&&this._oneTimeListeners[m]?this._oneTimeListeners[m].slice():[];for(const L of S)bt(m,L,this._oneTimeListeners),L.call(this,a);const T=this._eventedParent;T&&(k(a,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),T.fire(a))}else a instanceof Ut&&console.error(a.error);return this}listens(a){return this._listeners&&this._listeners[a]&&this._listeners[a].length>0||this._oneTimeListeners&&this._oneTimeListeners[a]&&this._oneTimeListeners[a].length>0||this._eventedParent&&this._eventedParent.listens(a)}setEventedParent(a,d){return this._eventedParent=a,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 Ge{constructor(a,d,m,_){this.message=(a?`${a}: `:"")+m,_&&(this.identifier=_),d!=null&&d.__line__&&(this.line=d.__line__)}}function Zt(u){const a=u.value;return a?[new Ge(u.key,a,"constants have been deprecated as of v8")]:[]}function cn(u,...a){for(const d of a)for(const m in d)u[m]=d[m];return u}function jt(u){return u instanceof Number||u instanceof String||u instanceof Boolean?u.valueOf():u}function Kt(u){if(Array.isArray(u))return u.map(Kt);if(u instanceof Object&&!(u instanceof Number||u instanceof String||u instanceof Boolean)){const a={};for(const d in u)a[d]=Kt(u[d]);return a}return jt(u)}class nn extends Error{constructor(a,d){super(d),this.message=d,this.key=a}}class Cn{constructor(a,d=[]){this.parent=a,this.bindings={};for(const[m,_]of d)this.bindings[m]=_}concat(a){return new Cn(this,a)}get(a){if(this.bindings[a])return this.bindings[a];if(this.parent)return this.parent.get(a);throw new Error(`${a} not found in scope.`)}has(a){return!!this.bindings[a]||!!this.parent&&this.parent.has(a)}}const Nn={kind:"null"},wt={kind:"number"},qt={kind:"string"},At={kind:"boolean"},Xt={kind:"color"},en={kind:"object"},gt={kind:"value"},yn={kind:"collator"},Sn={kind:"formatted"},dn={kind:"padding"},zt={kind:"resolvedImage"};function ot(u,a){return{kind:"array",itemType:u,N:a}}function mt(u){if(u.kind==="array"){const a=mt(u.itemType);return typeof u.N=="number"?`array<${a}, ${u.N}>`:u.itemType.kind==="value"?"array":`array<${a}>`}return u.kind}const Dt=[Nn,wt,qt,At,Xt,Sn,en,ot(gt),dn,zt];function Bt(u,a){if(a.kind==="error")return null;if(u.kind==="array"){if(a.kind==="array"&&(a.N===0&&a.itemType.kind==="value"||!Bt(u.itemType,a.itemType))&&(typeof u.N!="number"||u.N===a.N))return null}else{if(u.kind===a.kind)return null;if(u.kind==="value"){for(const d of Dt)if(!Bt(d,a))return null}}return`Expected ${mt(u)} but found ${mt(a)} instead.`}function pn(u,a){return a.some(d=>d.kind===u.kind)}function On(u,a){return a.some(d=>d==="null"?u===null:d==="array"?Array.isArray(u):d==="object"?u&&!Array.isArray(u)&&typeof u=="object":d===typeof u)}var Zn,Xn={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(u){return(u=Math.round(u))<0?0:u>255?255:u}function H(u){return me(u[u.length-1]==="%"?parseFloat(u)/100*255:parseInt(u))}function q(u){return(a=u[u.length-1]==="%"?parseFloat(u)/100:parseFloat(u))<0?0:a>1?1:a;var a}function de(u,a,d){return d<0?d+=1:d>1&&(d-=1),6*d<1?u+(a-u)*d*6:2*d<1?a:3*d<2?u+(a-u)*(2/3-d)*6:u}try{Zn={}.parseCSSColor=function(u){var a,d=u.replace(/ /g,"").toLowerCase();if(d in Xn)return Xn[d].slice();if(d[0]==="#")return d.length===4?(a=parseInt(d.substr(1),16))>=0&&a<=4095?[(3840&a)>>4|(3840&a)>>8,240&a|(240&a)>>4,15&a|(15&a)<<4,1]:null:d.length===7&&(a=parseInt(d.substr(1),16))>=0&&a<=16777215?[(16711680&a)>>16,(65280&a)>>8,255&a,1]:null;var m=d.indexOf("("),_=d.indexOf(")");if(m!==-1&&_+1===d.length){var S=d.substr(0,m),T=d.substr(m+1,_-(m+1)).split(","),L=1;switch(S){case"rgba":if(T.length!==4)return null;L=q(T.pop());case"rgb":return T.length!==3?null:[H(T[0]),H(T[1]),H(T[2]),L];case"hsla":if(T.length!==4)return null;L=q(T.pop());case"hsl":if(T.length!==3)return null;var F=(parseFloat(T[0])%360+360)%360/360,K=q(T[1]),Q=q(T[2]),ne=Q<=.5?Q*(K+1):Q+K-Q*K,ue=2*Q-ne;return[me(255*de(ue,ne,F+1/3)),me(255*de(ue,ne,F)),me(255*de(ue,ne,F-1/3)),L];default:return null}}return null}}catch{}class le{constructor(a,d,m,_=1){this.r=a,this.g=d,this.b=m,this.a=_}static parse(a){if(!a)return;if(a instanceof le)return a;if(typeof a!="string")return;const d=Zn(a);return d?new le(d[0]/255*d[3],d[1]/255*d[3],d[2]/255*d[3],d[3]):void 0}toString(){const[a,d,m,_]=this.toArray();return`rgba(${Math.round(a)},${Math.round(d)},${Math.round(m)},${_})`}toArray(){const{r:a,g:d,b:m,a:_}=this;return _===0?[0,0,0,0]:[255*a/_,255*d/_,255*m/_,_]}}le.black=new le(0,0,0,1),le.white=new le(1,1,1,1),le.transparent=new le(0,0,0,0),le.red=new le(1,0,0,1);class xe{constructor(a,d,m){this.sensitivity=a?d?"variant":"case":d?"accent":"base",this.locale=m,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(a,d){return this.collator.compare(a,d)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ee{constructor(a,d,m,_,S){this.text=a,this.image=d,this.scale=m,this.fontStack=_,this.textColor=S}}class be{constructor(a){this.sections=a}static fromString(a){return new be([new Ee(a,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(a=>a.text.length!==0||a.image&&a.image.name.length!==0)}static factory(a){return a instanceof be?a:be.fromString(a)}toString(){return this.sections.length===0?"":this.sections.map(a=>a.text).join("")}}class Ce{constructor(a){this.values=a.slice()}static parse(a){if(a instanceof Ce)return a;if(typeof a=="number")return new Ce([a,a,a,a]);if(Array.isArray(a)&&!(a.length<1||a.length>4)){for(const d of a)if(typeof d!="number")return;switch(a.length){case 1:a=[a[0],a[0],a[0],a[0]];break;case 2:a=[a[0],a[1],a[0],a[1]];break;case 3:a=[a[0],a[1],a[2],a[1]]}return new Ce(a)}}toString(){return JSON.stringify(this.values)}}class Le{constructor(a){this.name=a.name,this.available=a.available}toString(){return this.name}static fromString(a){return a?new Le({name:a,available:!1}):null}}function qe(u,a,d,m){return typeof u=="number"&&u>=0&&u<=255&&typeof a=="number"&&a>=0&&a<=255&&typeof d=="number"&&d>=0&&d<=255?m===void 0||typeof m=="number"&&m>=0&&m<=1?null:`Invalid rgba value [${[u,a,d,m].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof m=="number"?[u,a,d,m]:[u,a,d]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ze(u){if(u===null||typeof u=="string"||typeof u=="boolean"||typeof u=="number"||u instanceof le||u instanceof xe||u instanceof be||u instanceof Ce||u instanceof Le)return!0;if(Array.isArray(u)){for(const a of u)if(!Ze(a))return!1;return!0}if(typeof u=="object"){for(const a in u)if(!Ze(u[a]))return!1;return!0}return!1}function Ve(u){if(u===null)return Nn;if(typeof u=="string")return qt;if(typeof u=="boolean")return At;if(typeof u=="number")return wt;if(u instanceof le)return Xt;if(u instanceof xe)return yn;if(u instanceof be)return Sn;if(u instanceof Ce)return dn;if(u instanceof Le)return zt;if(Array.isArray(u)){const a=u.length;let d;for(const m of u){const _=Ve(m);if(d){if(d===_)continue;d=gt;break}d=_}return ot(d||gt,a)}return en}function Lt(u){const a=typeof u;return u===null?"":a==="string"||a==="number"||a==="boolean"?String(u):u instanceof le||u instanceof be||u instanceof Ce||u instanceof Le?u.toString():JSON.stringify(u)}class Ct{constructor(a,d){this.type=a,this.value=d}static parse(a,d){if(a.length!==2)return d.error(`'literal' expression requires exactly one argument, but found ${a.length-1} instead.`);if(!Ze(a[1]))return d.error("invalid value");const m=a[1];let _=Ve(m);const S=d.expectedType;return _.kind!=="array"||_.N!==0||!S||S.kind!=="array"||typeof S.N=="number"&&S.N!==0||(_=S),new Ct(_,m)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Je{constructor(a){this.name="ExpressionEvaluationError",this.message=a}toJSON(){return this.message}}const Ot={string:qt,number:wt,boolean:At,object:en};class Vt{constructor(a,d){this.type=a,this.args=d}static parse(a,d){if(a.length<2)return d.error("Expected at least one argument.");let m,_=1;const S=a[0];if(S==="array"){let L,F;if(a.length>2){const K=a[1];if(typeof K!="string"||!(K in Ot)||K==="object")return d.error('The item type argument of "array" must be one of string, number, boolean',1);L=Ot[K],_++}else L=gt;if(a.length>3){if(a[2]!==null&&(typeof a[2]!="number"||a[2]<0||a[2]!==Math.floor(a[2])))return d.error('The length argument to "array" must be a positive integer literal',2);F=a[2],_++}m=ot(L,F)}else{if(!Ot[S])throw new Error(`Types doesn't contain name = ${S}`);m=Ot[S]}const T=[];for(;_a.outputDefined())}}const bn={"to-boolean":At,"to-color":Xt,"to-number":wt,"to-string":qt};class un{constructor(a,d){this.type=a,this.args=d}static parse(a,d){if(a.length<2)return d.error("Expected at least one argument.");const m=a[0];if(!bn[m])throw new Error(`Can't parse ${m} as it is not part of the known types`);if((m==="to-boolean"||m==="to-string")&&a.length!==2)return d.error("Expected one argument.");const _=bn[m],S=[];for(let T=1;T4?`Invalid rbga value ${JSON.stringify(d)}: expected an array containing either three or four numeric values.`:qe(d[0],d[1],d[2],d[3]),!m))return new le(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(a);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(a),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(Lt(this.args[0].evaluate(a))):this.type.kind==="resolvedImage"?Le.fromString(Lt(this.args[0].evaluate(a))):Lt(this.args[0].evaluate(a))}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}}const wn=["Unknown","Point","LineString","Polygon"];class Vn{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"?wn[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(a){let d=this._parseColorCache[a];return d||(d=this._parseColorCache[a]=le.parse(a)),d}}class rr{constructor(a,d,m,_){this.name=a,this.type=d,this._evaluate=m,this.args=_}evaluate(a){return this._evaluate(a,this.args)}eachChild(a){this.args.forEach(a)}outputDefined(){return!1}static parse(a,d){const m=a[0],_=rr.definitions[m];if(!_)return d.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0);const S=Array.isArray(_)?_[0]:_.type,T=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,L=T.filter(([K])=>!Array.isArray(K)||K.length===a.length-1);let F=null;for(const[K,Q]of L){F=new Xa(d.registry,d.path,null,d.scope);const ne=[];let ue=!1;for(let he=1;he{return ue=ne,Array.isArray(ue)?`(${ue.map(mt).join(", ")})`:`(${mt(ue.type)}...)`;var ue}).join(" | "),Q=[];for(let ne=1;ne=a[2]||u[1]<=a[1]||u[3]>=a[3])}function kn(u,a){const d=(180+u[0])/360,m=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u[1]*Math.PI/360)))/360,_=Math.pow(2,a.z);return[Math.round(d*_*sr),Math.round(m*_*sr)]}function Dn(u,a,d){const m=u[0]-a[0],_=u[1]-a[1],S=u[0]-d[0],T=u[1]-d[1];return m*T-S*_==0&&m*S<=0&&_*T<=0}function Gr(u,a){let d=!1;for(let T=0,L=a.length;T(m=u)[1]!=(S=F[K+1])[1]>m[1]&&m[0]<(S[0]-_[0])*(m[1]-_[1])/(S[1]-_[1])+_[0]&&(d=!d)}}var m,_,S;return d}function yr(u,a){for(let d=0;d0&&L<0||T<0&&L>0}function $n(u,a,d){for(const K of d)for(let Q=0;Qd[2]){const _=.5*m;let S=u[0]-d[0]>_?-m:d[0]-u[0]>_?m:0;S===0&&(S=u[0]-d[2]>_?-m:d[2]-u[0]>_?m:0),u[0]+=S}Mr(a,u)}function gl(u,a,d,m){const _=Math.pow(2,m.z)*sr,S=[m.x*sr,m.y*sr],T=[];for(const L of u)for(const F of L){const K=[F.x+S[0],F.y+S[1]];so(K,a,d,_),T.push(K)}return T}function Bc(u,a,d,m){const _=Math.pow(2,m.z)*sr,S=[m.x*sr,m.y*sr],T=[];for(const F of u){const K=[];for(const Q of F){const ne=[Q.x+S[0],Q.y+S[1]];Mr(a,ne),K.push(ne)}T.push(K)}if(a[2]-a[0]<=_/2){(L=a)[0]=L[1]=1/0,L[2]=L[3]=-1/0;for(const F of T)for(const K of F)so(K,a,d,_)}var L;return T}class Ea{constructor(a,d){this.type=At,this.geojson=a,this.geometries=d}static parse(a,d){if(a.length!==2)return d.error(`'within' expression requires exactly one argument, but found ${a.length-1} instead.`);if(Ze(a[1])){const m=a[1];if(m.type==="FeatureCollection")for(let _=0;_{a&&!Bn(d)&&(a=!1)}),a}function Yn(u){if(u instanceof rr&&u.name==="feature-state")return!1;let a=!0;return u.eachChild(d=>{a&&!Yn(d)&&(a=!1)}),a}function Ar(u,a){if(u instanceof rr&&a.indexOf(u.name)>=0)return!1;let d=!0;return u.eachChild(m=>{d&&!Ar(m,a)&&(d=!1)}),d}class Ei{constructor(a,d){this.type=d.type,this.name=a,this.boundExpression=d}static parse(a,d){if(a.length!==2||typeof a[1]!="string")return d.error("'var' expression requires exactly one string literal argument.");const m=a[1];return d.scope.has(m)?new Ei(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(a){return this.boundExpression.evaluate(a)}eachChild(){}outputDefined(){return!1}}class Xa{constructor(a,d=[],m,_=new Cn,S=[]){this.registry=a,this.path=d,this.key=d.map(T=>`[${T}]`).join(""),this.scope=_,this.errors=S,this.expectedType=m}parse(a,d,m,_,S={}){return d?this.concat(d,m,_)._parse(a,S):this._parse(a,S)}_parse(a,d){function m(_,S,T){return T==="assert"?new Vt(S,[_]):T==="coerce"?new un(S,[_]):_}if(a!==null&&typeof a!="string"&&typeof a!="boolean"&&typeof a!="number"||(a=["literal",a]),Array.isArray(a)){if(a.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=a[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 S=this.registry[_];if(S){let T=S.parse(a,this);if(!T)return null;if(this.expectedType){const L=this.expectedType,F=T.type;if(L.kind!=="string"&&L.kind!=="number"&&L.kind!=="boolean"&&L.kind!=="object"&&L.kind!=="array"||F.kind!=="value")if(L.kind!=="color"&&L.kind!=="formatted"&&L.kind!=="resolvedImage"||F.kind!=="value"&&F.kind!=="string")if(L.kind!=="padding"||F.kind!=="value"&&F.kind!=="number"&&F.kind!=="array"){if(this.checkSubtype(L,F))return null}else T=m(T,L,d.typeAnnotation||"coerce");else T=m(T,L,d.typeAnnotation||"coerce");else T=m(T,L,d.typeAnnotation||"assert")}if(!(T instanceof Ct)&&T.type.kind!=="resolvedImage"&&To(T)){const L=new Vn;try{T=new Ct(T.type,T.evaluate(L))}catch(F){return this.error(F.message),null}}return T}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(a===void 0?"'undefined' value invalid. Use null instead.":typeof a=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof a} instead.`)}concat(a,d,m){const _=typeof a=="number"?this.path.concat(a):this.path,S=m?this.scope.concat(m):this.scope;return new Xa(this.registry,_,d||null,S,this.errors)}error(a,...d){const m=`${this.key}${d.map(_=>`[${_}]`).join("")}`;this.errors.push(new nn(m,a))}checkSubtype(a,d){const m=Bt(a,d);return m&&this.error(m),m}}function To(u){if(u instanceof Ei)return To(u.boundExpression);if(u instanceof rr&&u.name==="error"||u instanceof $r||u instanceof Ea)return!1;const a=u instanceof un||u instanceof Vt;let d=!0;return u.eachChild(m=>{d=a?d&&To(m):d&&m instanceof Ct}),!!d&&Bn(u)&&Ar(u,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Es(u,a){const d=u.length-1;let m,_,S=0,T=d,L=0;for(;S<=T;)if(L=Math.floor((S+T)/2),m=u[L],_=u[L+1],m<=a){if(L===d||a<_)return L;S=L+1}else{if(!(m>a))throw new Je("Input is not a number.");T=L-1}return 0}class Pa{constructor(a,d,m){this.type=a,this.input=d,this.labels=[],this.outputs=[];for(const[_,S]of m)this.labels.push(_),this.outputs.push(S)}static parse(a,d){if(a.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if((a.length-1)%2!=0)return d.error("Expected an even number of arguments.");const m=d.parse(a[1],1,wt);if(!m)return null;const _=[];let S=null;d.expectedType&&d.expectedType.kind!=="value"&&(S=d.expectedType);for(let T=1;T=L)return d.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',K);const ne=d.parse(F,Q,S);if(!ne)return null;S=S||ne.type,_.push([L,ne])}return new Pa(S,m,_)}evaluate(a){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(a);const _=this.input.evaluate(a);if(_<=d[0])return m[0].evaluate(a);const S=d.length;return _>=d[S-1]?m[S-1].evaluate(a):m[Es(d,_)].evaluate(a)}eachChild(a){a(this.input);for(const d of this.outputs)a(d)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}}function xr(u,a,d){return u*(1-d)+a*d}var Ta=Object.freeze({__proto__:null,number:xr,color:function(u,a,d){return new le(xr(u.r,a.r,d),xr(u.g,a.g,d),xr(u.b,a.b,d),xr(u.a,a.a,d))},array:function(u,a,d){return u.map((m,_)=>xr(m,a[_],d))},padding:function(u,a,d){const m=u.values,_=a.values;return new Ce([xr(m[0],_[0],d),xr(m[1],_[1],d),xr(m[2],_[2],d),xr(m[3],_[3],d)])}});const Lm=.95047,zm=1.08883,Ff=4/29,Vc=6/29,Fm=3*Vc*Vc,Rx=Math.PI/180,Mx=180/Math.PI;function $f(u){return u>.008856451679035631?Math.pow(u,1/3):u/Fm+Ff}function Bf(u){return u>Vc?u*u*u:Fm*(u-Ff)}function Vf(u){return 255*(u<=.0031308?12.92*u:1.055*Math.pow(u,1/2.4)-.055)}function Uf(u){return(u/=255)<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)}function lr(u){const a=Uf(u.r),d=Uf(u.g),m=Uf(u.b),_=$f((.4124564*a+.3575761*d+.1804375*m)/Lm),S=$f((.2126729*a+.7151522*d+.072175*m)/1);return{l:116*S-16,a:500*(_-S),b:200*(S-$f((.0193339*a+.119192*d+.9503041*m)/zm)),alpha:u.a}}function $m(u){let a=(u.l+16)/116,d=isNaN(u.a)?a:a+u.a/500,m=isNaN(u.b)?a:a-u.b/200;return a=1*Bf(a),d=Lm*Bf(d),m=zm*Bf(m),new le(Vf(3.2404542*d-1.5371385*a-.4985314*m),Vf(-.969266*d+1.8760108*a+.041556*m),Vf(.0556434*d-.2040259*a+1.0572252*m),u.alpha)}function Ax(u,a,d){const m=a-u;return u+d*(m>180||m<-180?m-360*Math.round(m/360):m)}const bu={forward:lr,reverse:$m,interpolate:function(u,a,d){return{l:xr(u.l,a.l,d),a:xr(u.a,a.a,d),b:xr(u.b,a.b,d),alpha:xr(u.alpha,a.alpha,d)}}},wu={forward:function(u){const{l:a,a:d,b:m}=lr(u),_=Math.atan2(m,d)*Mx;return{h:_<0?_+360:_,c:Math.sqrt(d*d+m*m),l:a,alpha:u.a}},reverse:function(u){const a=u.h*Rx,d=u.c;return $m({l:u.l,a:Math.cos(a)*d,b:Math.sin(a)*d,alpha:u.alpha})},interpolate:function(u,a,d){return{h:Ax(u.h,a.h,d),c:xr(u.c,a.c,d),l:xr(u.l,a.l,d),alpha:xr(u.alpha,a.alpha,d)}}};var Bm=Object.freeze({__proto__:null,lab:bu,hcl:wu});class lo{constructor(a,d,m,_,S){this.type=a,this.operator=d,this.interpolation=m,this.input=_,this.labels=[],this.outputs=[];for(const[T,L]of S)this.labels.push(T),this.outputs.push(L)}static interpolationFactor(a,d,m,_){let S=0;if(a.name==="exponential")S=jf(d,a.base,m,_);else if(a.name==="linear")S=jf(d,1,m,_);else if(a.name==="cubic-bezier"){const T=a.controlPoints;S=new f(T[0],T[1],T[2],T[3]).solve(jf(d,1,m,_))}return S}static parse(a,d){let[m,_,S,...T]=a;if(!Array.isArray(_)||_.length===0)return d.error("Expected an interpolation type expression.",1);if(_[0]==="linear")_={name:"linear"};else if(_[0]==="exponential"){const K=_[1];if(typeof K!="number")return d.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:K}}else{if(_[0]!=="cubic-bezier")return d.error(`Unknown interpolation type ${String(_[0])}`,1,0);{const K=_.slice(1);if(K.length!==4||K.some(Q=>typeof Q!="number"||Q<0||Q>1))return d.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:K}}}if(a.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if((a.length-1)%2!=0)return d.error("Expected an even number of arguments.");if(S=d.parse(S,2,wt),!S)return null;const L=[];let F=null;m==="interpolate-hcl"||m==="interpolate-lab"?F=Xt:d.expectedType&&d.expectedType.kind!=="value"&&(F=d.expectedType);for(let K=0;K=Q)return d.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ue);const pe=d.parse(ne,he,F);if(!pe)return null;F=F||pe.type,L.push([Q,pe])}return F.kind==="number"||F.kind==="color"||F.kind==="padding"||F.kind==="array"&&F.itemType.kind==="number"&&typeof F.N=="number"?new lo(F,m,_,S,L):d.error(`Type ${mt(F)} is not interpolatable.`)}evaluate(a){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(a);const _=this.input.evaluate(a);if(_<=d[0])return m[0].evaluate(a);const S=d.length;if(_>=d[S-1])return m[S-1].evaluate(a);const T=Es(d,_),L=lo.interpolationFactor(this.interpolation,_,d[T],d[T+1]),F=m[T].evaluate(a),K=m[T+1].evaluate(a);return this.operator==="interpolate"?Ta[this.type.kind.toLowerCase()](F,K,L):this.operator==="interpolate-hcl"?wu.reverse(wu.interpolate(wu.forward(F),wu.forward(K),L)):bu.reverse(bu.interpolate(bu.forward(F),bu.forward(K),L))}eachChild(a){a(this.input);for(const d of this.outputs)a(d)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}}function jf(u,a,d,m){const _=m-d,S=u-d;return _===0?0:a===1?S/_:(Math.pow(a,S)-1)/(Math.pow(a,_)-1)}class Uc{constructor(a,d){this.type=a,this.args=d}static parse(a,d){if(a.length<2)return d.error("Expectected at least one argument.");let m=null;const _=d.expectedType;_&&_.kind!=="value"&&(m=_);const S=[];for(const L of a.slice(1)){const F=d.parse(L,1+S.length,m,void 0,{typeAnnotation:"omit"});if(!F)return null;m=m||F.type,S.push(F)}if(!m)throw new Error("No output type");const T=_&&S.some(L=>Bt(_,L.type));return new Uc(T?gt:m,S)}evaluate(a){let d,m=null,_=0;for(const S of this.args)if(_++,m=S.evaluate(a),m&&m instanceof Le&&!m.available&&(d||(d=m.name),m=null,_===this.args.length&&(m=d)),m!==null)break;return m}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}}class jc{constructor(a,d){this.type=d.type,this.bindings=[].concat(a),this.result=d}evaluate(a){return this.result.evaluate(a)}eachChild(a){for(const d of this.bindings)a(d[1]);a(this.result)}static parse(a,d){if(a.length<4)return d.error(`Expected at least 3 arguments, but found ${a.length-1} instead.`);const m=[];for(let S=1;S=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(a){a(this.index),a(this.input)}outputDefined(){return!1}}class Hf{constructor(a,d){this.type=At,this.needle=a,this.haystack=d}static parse(a,d){if(a.length!==3)return d.error(`Expected 2 arguments, but found ${a.length-1} instead.`);const m=d.parse(a[1],1,gt),_=d.parse(a[2],2,gt);return m&&_?pn(m.type,[At,qt,wt,Nn,gt])?new Hf(m,_):d.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(m.type)} instead`):null}evaluate(a){const d=this.needle.evaluate(a),m=this.haystack.evaluate(a);if(!m)return!1;if(!On(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Ve(d))} instead.`);if(!On(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${mt(Ve(m))} instead.`);return m.indexOf(d)>=0}eachChild(a){a(this.needle),a(this.haystack)}outputDefined(){return!0}}class Kc{constructor(a,d,m){this.type=wt,this.needle=a,this.haystack=d,this.fromIndex=m}static parse(a,d){if(a.length<=2||a.length>=5)return d.error(`Expected 3 or 4 arguments, but found ${a.length-1} instead.`);const m=d.parse(a[1],1,gt),_=d.parse(a[2],2,gt);if(!m||!_)return null;if(!pn(m.type,[At,qt,wt,Nn,gt]))return d.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(m.type)} instead`);if(a.length===4){const S=d.parse(a[3],3,wt);return S?new Kc(m,_,S):null}return new Kc(m,_)}evaluate(a){const d=this.needle.evaluate(a),m=this.haystack.evaluate(a);if(!On(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Ve(d))} instead.`);if(!On(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${mt(Ve(m))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(a);return m.indexOf(d,_)}return m.indexOf(d)}eachChild(a){a(this.needle),a(this.haystack),this.fromIndex&&a(this.fromIndex)}outputDefined(){return!1}}class Wf{constructor(a,d,m,_,S,T){this.inputType=a,this.type=d,this.input=m,this.cases=_,this.outputs=S,this.otherwise=T}static parse(a,d){if(a.length<5)return d.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if(a.length%2!=1)return d.error("Expected an even number of arguments.");let m,_;d.expectedType&&d.expectedType.kind!=="value"&&(_=d.expectedType);const S={},T=[];for(let K=2;KNumber.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,Ve(pe)))return null}else m=Ve(pe);if(S[String(pe)]!==void 0)return ue.error("Branch labels must be unique.");S[String(pe)]=T.length}const he=d.parse(ne,K,_);if(!he)return null;_=_||he.type,T.push(he)}const L=d.parse(a[1],1,gt);if(!L)return null;const F=d.parse(a[a.length-1],a.length-1,_);return F?L.type.kind!=="value"&&d.concat(1).checkSubtype(m,L.type)?null:new Wf(m,_,L,S,T,F):null}evaluate(a){const d=this.input.evaluate(a);return(Ve(d)===this.inputType&&this.outputs[this.cases[d]]||this.otherwise).evaluate(a)}eachChild(a){a(this.input),this.outputs.forEach(a),a(this.otherwise)}outputDefined(){return this.outputs.every(a=>a.outputDefined())&&this.otherwise.outputDefined()}}class Gf{constructor(a,d,m){this.type=a,this.branches=d,this.otherwise=m}static parse(a,d){if(a.length<4)return d.error(`Expected at least 3 arguments, but found only ${a.length-1}.`);if(a.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 T=1;Td.outputDefined())&&this.otherwise.outputDefined()}}class Hc{constructor(a,d,m,_){this.type=a,this.input=d,this.beginIndex=m,this.endIndex=_}static parse(a,d){if(a.length<=2||a.length>=5)return d.error(`Expected 3 or 4 arguments, but found ${a.length-1} instead.`);const m=d.parse(a[1],1,gt),_=d.parse(a[2],2,wt);if(!m||!_)return null;if(!pn(m.type,[ot(gt),qt,gt]))return d.error(`Expected first argument to be of type array or string, but found ${mt(m.type)} instead`);if(a.length===4){const S=d.parse(a[3],3,wt);return S?new Hc(m.type,m,_,S):null}return new Hc(m.type,m,_)}evaluate(a){const d=this.input.evaluate(a),m=this.beginIndex.evaluate(a);if(!On(d,["string","array"]))throw new Je(`Expected first argument to be of type array or string, but found ${mt(Ve(d))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(a);return d.slice(m,_)}return d.slice(m)}eachChild(a){a(this.input),a(this.beginIndex),this.endIndex&&a(this.endIndex)}outputDefined(){return!1}}function Vm(u,a){return u==="=="||u==="!="?a.kind==="boolean"||a.kind==="string"||a.kind==="number"||a.kind==="null"||a.kind==="value":a.kind==="string"||a.kind==="number"||a.kind==="value"}function Um(u,a,d,m){return m.compare(a,d)===0}function yl(u,a,d){const m=u!=="=="&&u!=="!=";return class R6{constructor(S,T,L){this.type=At,this.lhs=S,this.rhs=T,this.collator=L,this.hasUntypedArgument=S.type.kind==="value"||T.type.kind==="value"}static parse(S,T){if(S.length!==3&&S.length!==4)return T.error("Expected two or three arguments.");const L=S[0];let F=T.parse(S[1],1,gt);if(!F)return null;if(!Vm(L,F.type))return T.concat(1).error(`"${L}" comparisons are not supported for type '${mt(F.type)}'.`);let K=T.parse(S[2],2,gt);if(!K)return null;if(!Vm(L,K.type))return T.concat(2).error(`"${L}" comparisons are not supported for type '${mt(K.type)}'.`);if(F.type.kind!==K.type.kind&&F.type.kind!=="value"&&K.type.kind!=="value")return T.error(`Cannot compare types '${mt(F.type)}' and '${mt(K.type)}'.`);m&&(F.type.kind==="value"&&K.type.kind!=="value"?F=new Vt(K.type,[F]):F.type.kind!=="value"&&K.type.kind==="value"&&(K=new Vt(F.type,[K])));let Q=null;if(S.length===4){if(F.type.kind!=="string"&&K.type.kind!=="string"&&F.type.kind!=="value"&&K.type.kind!=="value")return T.error("Cannot use collator to compare non-string types.");if(Q=T.parse(S[3],3,yn),!Q)return null}return new R6(F,K,Q)}evaluate(S){const T=this.lhs.evaluate(S),L=this.rhs.evaluate(S);if(m&&this.hasUntypedArgument){const F=Ve(T),K=Ve(L);if(F.kind!==K.kind||F.kind!=="string"&&F.kind!=="number")throw new Je(`Expected arguments for "${u}" to be (string, string) or (number, number), but found (${F.kind}, ${K.kind}) instead.`)}if(this.collator&&!m&&this.hasUntypedArgument){const F=Ve(T),K=Ve(L);if(F.kind!=="string"||K.kind!=="string")return a(S,T,L)}return this.collator?d(S,T,L,this.collator.evaluate(S)):a(S,T,L)}eachChild(S){S(this.lhs),S(this.rhs),this.collator&&S(this.collator)}outputDefined(){return!0}}}const Nx=yl("==",function(u,a,d){return a===d},Um),Ox=yl("!=",function(u,a,d){return a!==d},function(u,a,d,m){return!Um(0,a,d,m)}),Dx=yl("<",function(u,a,d){return a",function(u,a,d){return a>d},function(u,a,d,m){return m.compare(a,d)>0}),zx=yl("<=",function(u,a,d){return a<=d},function(u,a,d,m){return m.compare(a,d)<=0}),Fx=yl(">=",function(u,a,d){return a>=d},function(u,a,d,m){return m.compare(a,d)>=0});class qf{constructor(a,d,m,_,S){this.type=qt,this.number=a,this.locale=d,this.currency=m,this.minFractionDigits=_,this.maxFractionDigits=S}static parse(a,d){if(a.length!==3)return d.error("Expected two arguments.");const m=d.parse(a[1],1,wt);if(!m)return null;const _=a[2];if(typeof _!="object"||Array.isArray(_))return d.error("NumberFormat options argument must be an object.");let S=null;if(_.locale&&(S=d.parse(_.locale,1,qt),!S))return null;let T=null;if(_.currency&&(T=d.parse(_.currency,1,qt),!T))return null;let L=null;if(_["min-fraction-digits"]&&(L=d.parse(_["min-fraction-digits"],1,wt),!L))return null;let F=null;return _["max-fraction-digits"]&&(F=d.parse(_["max-fraction-digits"],1,wt),!F)?null:new qf(m,S,T,L,F)}evaluate(a){return new Intl.NumberFormat(this.locale?this.locale.evaluate(a):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(a):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(a):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(a):void 0}).format(this.number.evaluate(a))}eachChild(a){a(this.number),this.locale&&a(this.locale),this.currency&&a(this.currency),this.minFractionDigits&&a(this.minFractionDigits),this.maxFractionDigits&&a(this.maxFractionDigits)}outputDefined(){return!1}}class Wc{constructor(a){this.type=Sn,this.sections=a}static parse(a,d){if(a.length<2)return d.error("Expected at least one argument.");const m=a[1];if(!Array.isArray(m)&&typeof m=="object")return d.error("First argument must be an image or text section.");const _=[];let S=!1;for(let T=1;T<=a.length-1;++T){const L=a[T];if(S&&typeof L=="object"&&!Array.isArray(L)){S=!1;let F=null;if(L["font-scale"]&&(F=d.parse(L["font-scale"],1,wt),!F))return null;let K=null;if(L["text-font"]&&(K=d.parse(L["text-font"],1,ot(qt)),!K))return null;let Q=null;if(L["text-color"]&&(Q=d.parse(L["text-color"],1,Xt),!Q))return null;const ne=_[_.length-1];ne.scale=F,ne.font=K,ne.textColor=Q}else{const F=d.parse(a[T],1,gt);if(!F)return null;const K=F.type.kind;if(K!=="string"&&K!=="value"&&K!=="null"&&K!=="resolvedImage")return d.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");S=!0,_.push({content:F,scale:null,font:null,textColor:null})}}return new Wc(_)}evaluate(a){return new be(this.sections.map(d=>{const m=d.content.evaluate(a);return Ve(m)===zt?new Ee("",m,null,null,null):new Ee(Lt(m),null,d.scale?d.scale.evaluate(a):null,d.font?d.font.evaluate(a).join(","):null,d.textColor?d.textColor.evaluate(a):null)}))}eachChild(a){for(const d of this.sections)a(d.content),d.scale&&a(d.scale),d.font&&a(d.font),d.textColor&&a(d.textColor)}outputDefined(){return!1}}class Zf{constructor(a){this.type=zt,this.input=a}static parse(a,d){if(a.length!==2)return d.error("Expected two arguments.");const m=d.parse(a[1],1,qt);return m?new Zf(m):d.error("No image name provided.")}evaluate(a){const d=this.input.evaluate(a),m=Le.fromString(d);return m&&a.availableImages&&(m.available=a.availableImages.indexOf(d)>-1),m}eachChild(a){a(this.input)}outputDefined(){return!1}}class Xf{constructor(a){this.type=wt,this.input=a}static parse(a,d){if(a.length!==2)return d.error(`Expected 1 argument, but found ${a.length-1} instead.`);const m=d.parse(a[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 ${mt(m.type)} instead.`):new Xf(m):null}evaluate(a){const d=this.input.evaluate(a);if(typeof d=="string"||Array.isArray(d))return d.length;throw new Je(`Expected value to be of type string or array, but found ${mt(Ve(d))} instead.`)}eachChild(a){a(this.input)}outputDefined(){return!1}}const xl={"==":Nx,"!=":Ox,">":Lx,"<":Dx,">=":Fx,"<=":zx,array:Vt,at:Kf,boolean:Vt,case:Gf,coalesce:Uc,collator:$r,format:Wc,image:Zf,in:Hf,"index-of":Kc,interpolate:lo,"interpolate-hcl":lo,"interpolate-lab":lo,length:Xf,let:jc,literal:Ct,match:Wf,number:Vt,"number-format":qf,object:Vt,slice:Hc,step:Pa,string:Vt,"to-boolean":un,"to-color":un,"to-number":un,"to-string":un,var:Ei,within:Ea};function jm(u,[a,d,m,_]){a=a.evaluate(u),d=d.evaluate(u),m=m.evaluate(u);const S=_?_.evaluate(u):1,T=qe(a,d,m,S);if(T)throw new Je(T);return new le(a/255*S,d/255*S,m/255*S,S)}function Km(u,a){return u in a}function Gc(u,a){const d=a[u];return d===void 0?null:d}function Ps(u){return{type:u}}function Hm(u){return{result:"success",value:u}}function _l(u){return{result:"error",value:u}}function Tr(u){return u["property-type"]==="data-driven"||u["property-type"]==="cross-faded-data-driven"}function Wm(u){return!!u.expression&&u.expression.parameters.indexOf("zoom")>-1}function Qn(u){return!!u.expression&&u.expression.interpolated}function ur(u){return u instanceof Number?"number":u instanceof String?"string":u instanceof Boolean?"boolean":Array.isArray(u)?"array":u===null?"null":typeof u}function Sr(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)}function Nr(u){return u}function Cu(u,a){const d=a.type==="color",m=u.stops&&typeof u.stops[0][0]=="object",_=m||!(m||u.property!==void 0),S=u.type||(Qn(a)?"exponential":"interval");if(d||a.type==="padding"){const K=d?le.parse:Ce.parse;(u=cn({},u)).stops&&(u.stops=u.stops.map(Q=>[Q[0],K(Q[1])])),u.default=K(u.default?u.default:a.default)}if(u.colorSpace&&u.colorSpace!=="rgb"&&!Bm[u.colorSpace])throw new Error(`Unknown color space: ${u.colorSpace}`);let T,L,F;if(S==="exponential")T=Gm;else if(S==="interval")T=Bx;else if(S==="categorical"){T=$x,L=Object.create(null);for(const K of u.stops)L[K[0]]=K[1];F=typeof u.stops[0][0]}else{if(S!=="identity")throw new Error(`Unknown function type "${S}"`);T=Vx}if(m){const K={},Q=[];for(let he=0;hehe[0]),evaluate:({zoom:he},pe)=>Gm({stops:ne,base:u.base},a,he).evaluate(he,pe)}}if(_){const K=S==="exponential"?{name:"exponential",base:u.base!==void 0?u.base:1}:null;return{kind:"camera",interpolationType:K,interpolationFactor:lo.interpolationFactor.bind(void 0,K),zoomStops:u.stops.map(Q=>Q[0]),evaluate:({zoom:Q})=>T(u,a,Q,L,F)}}return{kind:"source",evaluate(K,Q){const ne=Q&&Q.properties?Q.properties[u.property]:void 0;return ne===void 0?bl(u.default,a.default):T(u,a,ne,L,F)}}}function bl(u,a,d){return u!==void 0?u:a!==void 0?a:d!==void 0?d:void 0}function $x(u,a,d,m,_){return bl(typeof d===_?m[d]:void 0,u.default,a.default)}function Bx(u,a,d){if(ur(d)!=="number")return bl(u.default,a.default);const m=u.stops.length;if(m===1||d<=u.stops[0][0])return u.stops[0][1];if(d>=u.stops[m-1][0])return u.stops[m-1][1];const _=Es(u.stops.map(S=>S[0]),d);return u.stops[_][1]}function Gm(u,a,d){const m=u.base!==void 0?u.base:1;if(ur(d)!=="number")return bl(u.default,a.default);const _=u.stops.length;if(_===1||d<=u.stops[0][0])return u.stops[0][1];if(d>=u.stops[_-1][0])return u.stops[_-1][1];const S=Es(u.stops.map(Q=>Q[0]),d),T=function(Q,ne,ue,he){const pe=he-ue,Ne=Q-ue;return pe===0?0:ne===1?Ne/pe:(Math.pow(ne,Ne)-1)/(Math.pow(ne,pe)-1)}(d,m,u.stops[S][0],u.stops[S+1][0]),L=u.stops[S][1],F=u.stops[S+1][1];let K=Ta[a.type]||Nr;if(u.colorSpace&&u.colorSpace!=="rgb"){const Q=Bm[u.colorSpace];K=(ne,ue)=>Q.reverse(Q.interpolate(Q.forward(ne),Q.forward(ue),T))}return typeof L.evaluate=="function"?{evaluate(...Q){const ne=L.evaluate.apply(void 0,Q),ue=F.evaluate.apply(void 0,Q);if(ne!==void 0&&ue!==void 0)return K(ne,ue,T)}}:K(L,F,T)}function Vx(u,a,d){switch(a.type){case"color":d=le.parse(d);break;case"formatted":d=be.fromString(d.toString());break;case"resolvedImage":d=Le.fromString(d.toString());break;case"padding":d=Ce.parse(d);break;default:ur(d)===a.type||a.type==="enum"&&a.values[d]||(d=void 0)}return bl(d,u.default,a.default)}rr.register(xl,{error:[{kind:"error"},[qt],(u,[a])=>{throw new Je(a.evaluate(u))}],typeof:[qt,[gt],(u,[a])=>mt(Ve(a.evaluate(u)))],"to-rgba":[ot(wt,4),[Xt],(u,[a])=>a.evaluate(u).toArray()],rgb:[Xt,[wt,wt,wt],jm],rgba:[Xt,[wt,wt,wt,wt],jm],has:{type:At,overloads:[[[qt],(u,[a])=>Km(a.evaluate(u),u.properties())],[[qt,en],(u,[a,d])=>Km(a.evaluate(u),d.evaluate(u))]]},get:{type:gt,overloads:[[[qt],(u,[a])=>Gc(a.evaluate(u),u.properties())],[[qt,en],(u,[a,d])=>Gc(a.evaluate(u),d.evaluate(u))]]},"feature-state":[gt,[qt],(u,[a])=>Gc(a.evaluate(u),u.featureState||{})],properties:[en,[],u=>u.properties()],"geometry-type":[qt,[],u=>u.geometryType()],id:[gt,[],u=>u.id()],zoom:[wt,[],u=>u.globals.zoom],"heatmap-density":[wt,[],u=>u.globals.heatmapDensity||0],"line-progress":[wt,[],u=>u.globals.lineProgress||0],accumulated:[gt,[],u=>u.globals.accumulated===void 0?null:u.globals.accumulated],"+":[wt,Ps(wt),(u,a)=>{let d=0;for(const m of a)d+=m.evaluate(u);return d}],"*":[wt,Ps(wt),(u,a)=>{let d=1;for(const m of a)d*=m.evaluate(u);return d}],"-":{type:wt,overloads:[[[wt,wt],(u,[a,d])=>a.evaluate(u)-d.evaluate(u)],[[wt],(u,[a])=>-a.evaluate(u)]]},"/":[wt,[wt,wt],(u,[a,d])=>a.evaluate(u)/d.evaluate(u)],"%":[wt,[wt,wt],(u,[a,d])=>a.evaluate(u)%d.evaluate(u)],ln2:[wt,[],()=>Math.LN2],pi:[wt,[],()=>Math.PI],e:[wt,[],()=>Math.E],"^":[wt,[wt,wt],(u,[a,d])=>Math.pow(a.evaluate(u),d.evaluate(u))],sqrt:[wt,[wt],(u,[a])=>Math.sqrt(a.evaluate(u))],log10:[wt,[wt],(u,[a])=>Math.log(a.evaluate(u))/Math.LN10],ln:[wt,[wt],(u,[a])=>Math.log(a.evaluate(u))],log2:[wt,[wt],(u,[a])=>Math.log(a.evaluate(u))/Math.LN2],sin:[wt,[wt],(u,[a])=>Math.sin(a.evaluate(u))],cos:[wt,[wt],(u,[a])=>Math.cos(a.evaluate(u))],tan:[wt,[wt],(u,[a])=>Math.tan(a.evaluate(u))],asin:[wt,[wt],(u,[a])=>Math.asin(a.evaluate(u))],acos:[wt,[wt],(u,[a])=>Math.acos(a.evaluate(u))],atan:[wt,[wt],(u,[a])=>Math.atan(a.evaluate(u))],min:[wt,Ps(wt),(u,a)=>Math.min(...a.map(d=>d.evaluate(u)))],max:[wt,Ps(wt),(u,a)=>Math.max(...a.map(d=>d.evaluate(u)))],abs:[wt,[wt],(u,[a])=>Math.abs(a.evaluate(u))],round:[wt,[wt],(u,[a])=>{const d=a.evaluate(u);return d<0?-Math.round(-d):Math.round(d)}],floor:[wt,[wt],(u,[a])=>Math.floor(a.evaluate(u))],ceil:[wt,[wt],(u,[a])=>Math.ceil(a.evaluate(u))],"filter-==":[At,[qt,gt],(u,[a,d])=>u.properties()[a.value]===d.value],"filter-id-==":[At,[gt],(u,[a])=>u.id()===a.value],"filter-type-==":[At,[qt],(u,[a])=>u.geometryType()===a.value],"filter-<":[At,[qt,gt],(u,[a,d])=>{const m=u.properties()[a.value],_=d.value;return typeof m==typeof _&&m<_}],"filter-id-<":[At,[gt],(u,[a])=>{const d=u.id(),m=a.value;return typeof d==typeof m&&d":[At,[qt,gt],(u,[a,d])=>{const m=u.properties()[a.value],_=d.value;return typeof m==typeof _&&m>_}],"filter-id->":[At,[gt],(u,[a])=>{const d=u.id(),m=a.value;return typeof d==typeof m&&d>m}],"filter-<=":[At,[qt,gt],(u,[a,d])=>{const m=u.properties()[a.value],_=d.value;return typeof m==typeof _&&m<=_}],"filter-id-<=":[At,[gt],(u,[a])=>{const d=u.id(),m=a.value;return typeof d==typeof m&&d<=m}],"filter->=":[At,[qt,gt],(u,[a,d])=>{const m=u.properties()[a.value],_=d.value;return typeof m==typeof _&&m>=_}],"filter-id->=":[At,[gt],(u,[a])=>{const d=u.id(),m=a.value;return typeof d==typeof m&&d>=m}],"filter-has":[At,[gt],(u,[a])=>a.value in u.properties()],"filter-has-id":[At,[],u=>u.id()!==null&&u.id()!==void 0],"filter-type-in":[At,[ot(qt)],(u,[a])=>a.value.indexOf(u.geometryType())>=0],"filter-id-in":[At,[ot(gt)],(u,[a])=>a.value.indexOf(u.id())>=0],"filter-in-small":[At,[qt,ot(gt)],(u,[a,d])=>d.value.indexOf(u.properties()[a.value])>=0],"filter-in-large":[At,[qt,ot(gt)],(u,[a,d])=>function(m,_,S,T){for(;S<=T;){const L=S+T>>1;if(_[L]===m)return!0;_[L]>m?T=L-1:S=L+1}return!1}(u.properties()[a.value],d.value,0,d.value.length-1)],all:{type:At,overloads:[[[At,At],(u,[a,d])=>a.evaluate(u)&&d.evaluate(u)],[Ps(At),(u,a)=>{for(const d of a)if(!d.evaluate(u))return!1;return!0}]]},any:{type:At,overloads:[[[At,At],(u,[a,d])=>a.evaluate(u)||d.evaluate(u)],[Ps(At),(u,a)=>{for(const d of a)if(d.evaluate(u))return!0;return!1}]]},"!":[At,[At],(u,[a])=>!a.evaluate(u)],"is-supported-script":[At,[qt],(u,[a])=>{const d=u.globals&&u.globals.isSupportedScript;return!d||d(a.evaluate(u))}],upcase:[qt,[qt],(u,[a])=>a.evaluate(u).toUpperCase()],downcase:[qt,[qt],(u,[a])=>a.evaluate(u).toLowerCase()],concat:[qt,Ps(gt),(u,a)=>a.map(d=>Lt(d.evaluate(u))).join("")],"resolved-locale":[qt,[yn],(u,[a])=>a.evaluate(u).resolvedLocale()]});class qc{constructor(a,d){this.expression=a,this._warningHistory={},this._evaluator=new Vn,this._defaultValue=d?function(m){return m.type==="color"&&Sr(m.default)?new le(0,0,0,0):m.type==="color"?le.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(a,d,m,_,S,T){return this._evaluator.globals=a,this._evaluator.feature=d,this._evaluator.featureState=m,this._evaluator.canonical=_,this._evaluator.availableImages=S||null,this._evaluator.formattedSection=T,this.expression.evaluate(this._evaluator)}evaluate(a,d,m,_,S,T){this._evaluator.globals=a,this._evaluator.feature=d||null,this._evaluator.featureState=m||null,this._evaluator.canonical=_,this._evaluator.availableImages=S||null,this._evaluator.formattedSection=T||null;try{const L=this.expression.evaluate(this._evaluator);if(L==null||typeof L=="number"&&L!=L)return this._defaultValue;if(this._enumValues&&!(L 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(L)} instead.`);return L}catch(L){return this._warningHistory[L.message]||(this._warningHistory[L.message]=!0,typeof console<"u"&&console.warn(L.message)),this._defaultValue}}}function Su(u){return Array.isArray(u)&&u.length>0&&typeof u[0]=="string"&&u[0]in xl}function Eu(u,a){const d=new Xa(xl,[],a?function(_){const S={color:Xt,string:qt,number:wt,enum:qt,boolean:At,formatted:Sn,padding:dn,resolvedImage:zt};return _.type==="array"?ot(S[_.value]||gt,_.length):S[_.type]}(a):void 0),m=d.parse(u,void 0,void 0,void 0,a&&a.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?Hm(new qc(m,a)):_l(d.errors)}class Pu{constructor(a,d){this.kind=a,this._styleExpression=d,this.isStateDependent=a!=="constant"&&!Yn(d.expression)}evaluateWithoutErrorHandling(a,d,m,_,S,T){return this._styleExpression.evaluateWithoutErrorHandling(a,d,m,_,S,T)}evaluate(a,d,m,_,S,T){return this._styleExpression.evaluate(a,d,m,_,S,T)}}class Yf{constructor(a,d,m,_){this.kind=a,this.zoomStops=m,this._styleExpression=d,this.isStateDependent=a!=="camera"&&!Yn(d.expression),this.interpolationType=_}evaluateWithoutErrorHandling(a,d,m,_,S,T){return this._styleExpression.evaluateWithoutErrorHandling(a,d,m,_,S,T)}evaluate(a,d,m,_,S,T){return this._styleExpression.evaluate(a,d,m,_,S,T)}interpolationFactor(a,d,m){return this.interpolationType?lo.interpolationFactor(this.interpolationType,a,d,m):0}}function qm(u,a){const d=Eu(u,a);if(d.result==="error")return d;const m=d.value.expression,_=Bn(m);if(!_&&!Tr(a))return _l([new nn("","data expressions not supported")]);const S=Ar(m,["zoom"]);if(!S&&!Wm(a))return _l([new nn("","zoom expressions not supported")]);const T=Xc(m);return T||S?T instanceof nn?_l([T]):T instanceof lo&&!Qn(a)?_l([new nn("",'"interpolate" expressions cannot be used with this property')]):Hm(T?new Yf(_?"camera":"composite",d.value,T.labels,T instanceof lo?T.interpolation:void 0):new Pu(_?"constant":"source",d.value)):_l([new nn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Zc{constructor(a,d){this._parameters=a,this._specification=d,cn(this,Cu(this._parameters,this._specification))}static deserialize(a){return new Zc(a._parameters,a._specification)}static serialize(a){return{_parameters:a._parameters,_specification:a._specification}}}function Xc(u){let a=null;if(u instanceof jc)a=Xc(u.result);else if(u instanceof Uc){for(const d of u.args)if(a=Xc(d),a)break}else(u instanceof Pa||u instanceof lo)&&u.input instanceof rr&&u.input.name==="zoom"&&(a=u);return a instanceof nn||u.eachChild(d=>{const m=Xc(d);m instanceof nn?a=m:!a&&m?a=new nn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):a&&m&&a!==m&&(a=new nn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),a}function Bo(u){const a=u.key,d=u.value,m=u.valueSpec||{},_=u.objectElementValidators||{},S=u.style,T=u.styleSpec;let L=[];const F=ur(d);if(F!=="object")return[new Ge(a,d,`object expected, ${F} found`)];for(const K in d){const Q=K.split(".")[0],ne=m[Q]||m["*"];let ue;if(_[Q])ue=_[Q];else if(m[Q])ue=co;else if(_["*"])ue=_["*"];else{if(!m["*"]){L.push(new Ge(a,d[K],`unknown property "${K}"`));continue}ue=co}L=L.concat(ue({key:(a&&`${a}.`)+K,value:d[K],valueSpec:ne,style:S,styleSpec:T,object:d,objectKey:K},d))}for(const K in m)_[K]||m[K].required&&m[K].default===void 0&&d[K]===void 0&&L.push(new Ge(a,d,`missing required property "${K}"`));return L}function Zm(u){const a=u.value,d=u.valueSpec,m=u.style,_=u.styleSpec,S=u.key,T=u.arrayElementValidator||co;if(ur(a)!=="array")return[new Ge(S,a,`array expected, ${ur(a)} found`)];if(d.length&&a.length!==d.length)return[new Ge(S,a,`array length ${d.length} expected, length ${a.length} found`)];if(d["min-length"]&&a.lengthm.maximum?[new Ge(a,d,`${d} is greater than the maximum value ${m.maximum}`)]:[]}function Xm(u){const a=u.valueSpec,d=jt(u.value.type);let m,_,S,T={};const L=d!=="categorical"&&u.value.property===void 0,F=!L,K=ur(u.value.stops)==="array"&&ur(u.value.stops[0])==="array"&&ur(u.value.stops[0][0])==="object",Q=Bo({key:u.key,value:u.value,valueSpec:u.styleSpec.function,style:u.style,styleSpec:u.styleSpec,objectElementValidators:{stops:function(he){if(d==="identity")return[new Ge(he.key,he.value,'identity function may not have a "stops" property')];let pe=[];const Ne=he.value;return pe=pe.concat(Zm({key:he.key,value:Ne,valueSpec:he.valueSpec,style:he.style,styleSpec:he.styleSpec,arrayElementValidator:ne})),ur(Ne)==="array"&&Ne.length===0&&pe.push(new Ge(he.key,Ne,"array must have at least one stop")),pe},default:function(he){return co({key:he.key,value:he.value,valueSpec:a,style:he.style,styleSpec:he.styleSpec})}}});return d==="identity"&&L&&Q.push(new Ge(u.key,u.value,'missing required property "property"')),d==="identity"||u.value.stops||Q.push(new Ge(u.key,u.value,'missing required property "stops"')),d==="exponential"&&u.valueSpec.expression&&!Qn(u.valueSpec)&&Q.push(new Ge(u.key,u.value,"exponential functions not supported")),u.styleSpec.$version>=8&&(F&&!Tr(u.valueSpec)?Q.push(new Ge(u.key,u.value,"property functions not supported")):L&&!Wm(u.valueSpec)&&Q.push(new Ge(u.key,u.value,"zoom functions not supported"))),d!=="categorical"&&!K||u.value.property!==void 0||Q.push(new Ge(u.key,u.value,'"property" property is required')),Q;function ne(he){let pe=[];const Ne=he.value,Ae=he.key;if(ur(Ne)!=="array")return[new Ge(Ae,Ne,`array expected, ${ur(Ne)} found`)];if(Ne.length!==2)return[new Ge(Ae,Ne,`array length 2 expected, length ${Ne.length} found`)];if(K){if(ur(Ne[0])!=="object")return[new Ge(Ae,Ne,`object expected, ${ur(Ne[0])} found`)];if(Ne[0].zoom===void 0)return[new Ge(Ae,Ne,"object stop key must have zoom")];if(Ne[0].value===void 0)return[new Ge(Ae,Ne,"object stop key must have value")];if(S&&S>jt(Ne[0].zoom))return[new Ge(Ae,Ne[0].zoom,"stop zoom values must appear in ascending order")];jt(Ne[0].zoom)!==S&&(S=jt(Ne[0].zoom),_=void 0,T={}),pe=pe.concat(Bo({key:`${Ae}[0]`,value:Ne[0],valueSpec:{zoom:{}},style:he.style,styleSpec:he.styleSpec,objectElementValidators:{zoom:Qf,value:ue}}))}else pe=pe.concat(ue({key:`${Ae}[0]`,value:Ne[0],valueSpec:{},style:he.style,styleSpec:he.styleSpec},Ne));return Su(Kt(Ne[1]))?pe.concat([new Ge(`${Ae}[1]`,Ne[1],"expressions are not allowed in function stops.")]):pe.concat(co({key:`${Ae}[1]`,value:Ne[1],valueSpec:a,style:he.style,styleSpec:he.styleSpec}))}function ue(he,pe){const Ne=ur(he.value),Ae=jt(he.value),Ye=he.value!==null?he.value:pe;if(m){if(Ne!==m)return[new Ge(he.key,Ye,`${Ne} stop domain type must match previous stop domain type ${m}`)]}else m=Ne;if(Ne!=="number"&&Ne!=="string"&&Ne!=="boolean")return[new Ge(he.key,Ye,"stop domain value must be a number, string, or boolean")];if(Ne!=="number"&&d!=="categorical"){let lt=`number expected, ${Ne} found`;return Tr(a)&&d===void 0&&(lt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ge(he.key,Ye,lt)]}return d!=="categorical"||Ne!=="number"||isFinite(Ae)&&Math.floor(Ae)===Ae?d!=="categorical"&&Ne==="number"&&_!==void 0&&Ae<_?[new Ge(he.key,Ye,"stop domain values must appear in ascending order")]:(_=Ae,d==="categorical"&&Ae in T?[new Ge(he.key,Ye,"stop domain values must be unique")]:(T[Ae]=!0,[])):[new Ge(he.key,Ye,`integer expected, found ${Ae}`)]}}function Ts(u){const a=(u.expressionContext==="property"?qm:Eu)(Kt(u.value),u.valueSpec);if(a.result==="error")return a.value.map(m=>new Ge(`${u.key}${m.key}`,u.value,m.message));const d=a.value.expression||a.value._styleExpression.expression;if(u.expressionContext==="property"&&u.propertyKey==="text-font"&&!d.outputDefined())return[new Ge(u.key,u.value,`Invalid data expression for "${u.propertyKey}". Output values must be contained as literals within the expression.`)];if(u.expressionContext==="property"&&u.propertyType==="layout"&&!Yn(d))return[new Ge(u.key,u.value,'"feature-state" data expressions are not supported with layout properties.')];if(u.expressionContext==="filter"&&!Yn(d))return[new Ge(u.key,u.value,'"feature-state" data expressions are not supported with filters.')];if(u.expressionContext&&u.expressionContext.indexOf("cluster")===0){if(!Ar(d,["zoom","feature-state"]))return[new Ge(u.key,u.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(u.expressionContext==="cluster-initial"&&!Bn(d))return[new Ge(u.key,u.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Tu(u){const a=u.key,d=u.value,m=u.valueSpec,_=[];return Array.isArray(m.values)?m.values.indexOf(jt(d))===-1&&_.push(new Ge(a,d,`expected one of [${m.values.join(", ")}], ${JSON.stringify(d)} found`)):Object.keys(m.values).indexOf(jt(d))===-1&&_.push(new Ge(a,d,`expected one of [${Object.keys(m.values).join(", ")}], ${JSON.stringify(d)} found`)),_}function wl(u){if(u===!0||u===!1)return!0;if(!Array.isArray(u)||u.length===0)return!1;switch(u[0]){case"has":return u.length>=2&&u[1]!=="$id"&&u[1]!=="$type";case"in":return u.length>=3&&(typeof u[1]!="string"||Array.isArray(u[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return u.length!==3||Array.isArray(u[1])||Array.isArray(u[2]);case"any":case"all":for(const a of u.slice(1))if(!wl(a)&&typeof a!="boolean")return!1;return!0;default:return!0}}const Ux={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Yc(u){if(u==null)return{filter:()=>!0,needGeometry:!1};wl(u)||(u=ku(u));const a=Eu(u,Ux);if(a.result==="error")throw new Error(a.value.map(d=>`${d.key}: ${d.message}`).join(", "));return{filter:(d,m,_)=>a.value.evaluate(d,m,{},_),needGeometry:Qm(u)}}function Ym(u,a){return ua?1:0}function Qm(u){if(!Array.isArray(u))return!1;if(u[0]==="within")return!0;for(let a=1;a"||a==="<="||a===">="?Jf(u[1],u[2],a):a==="any"?(d=u.slice(1),["any"].concat(d.map(ku))):a==="all"?["all"].concat(u.slice(1).map(ku)):a==="none"?["all"].concat(u.slice(1).map(ku).map(Cl)):a==="in"?Qc(u[1],u.slice(2)):a==="!in"?Cl(Qc(u[1],u.slice(2))):a==="has"?Iu(u[1]):a==="!has"?Cl(Iu(u[1])):a!=="within"||u;var d}function Jf(u,a,d){switch(u){case"$type":return[`filter-type-${d}`,a];case"$id":return[`filter-id-${d}`,a];default:return[`filter-${d}`,u,a]}}function Qc(u,a){if(a.length===0)return!1;switch(u){case"$type":return["filter-type-in",["literal",a]];case"$id":return["filter-id-in",["literal",a]];default:return a.length>200&&!a.some(d=>typeof d!=typeof a[0])?["filter-in-large",u,["literal",a.sort(Ym)]]:["filter-in-small",u,["literal",a]]}}function Iu(u){switch(u){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",u]}}function Cl(u){return["!",u]}function Ru(u){return wl(Kt(u.value))?Ts(cn({},u,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Jm(u)}function Jm(u){const a=u.value,d=u.key;if(ur(a)!=="array")return[new Ge(d,a,`array expected, ${ur(a)} found`)];const m=u.styleSpec;let _,S=[];if(a.length<1)return[new Ge(d,a,"filter array must have at least 1 element")];switch(S=S.concat(Tu({key:`${d}[0]`,value:a[0],valueSpec:m.filter_operator,style:u.style,styleSpec:u.styleSpec})),jt(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&jt(a[1])==="$type"&&S.push(new Ge(d,a,`"$type" cannot be use with operator "${a[0]}"`));case"==":case"!=":a.length!==3&&S.push(new Ge(d,a,`filter array for operator "${a[0]}" must have 3 elements`));case"in":case"!in":a.length>=2&&(_=ur(a[1]),_!=="string"&&S.push(new Ge(`${d}[1]`,a[1],`string expected, ${_} found`)));for(let T=2;T{K in d&&a.push(new Ge(m,d[K],`"${K}" is prohibited for ref layers`))}),_.layers.forEach(K=>{jt(K.id)===L&&(F=K)}),F?F.ref?a.push(new Ge(m,d.ref,"ref cannot reference another ref layer")):T=jt(F.type):a.push(new Ge(m,d.ref,`ref layer "${L}" not found`))}else if(T!=="background")if(d.source){const F=_.sources&&_.sources[d.source],K=F&&jt(F.type);F?K==="vector"&&T==="raster"?a.push(new Ge(m,d.source,`layer "${d.id}" requires a raster source`)):K==="raster"&&T!=="raster"?a.push(new Ge(m,d.source,`layer "${d.id}" requires a vector source`)):K!=="vector"||d["source-layer"]?K==="raster-dem"&&T!=="hillshade"?a.push(new Ge(m,d.source,"raster-dem source can only be used with layer type 'hillshade'.")):T!=="line"||!d.paint||!d.paint["line-gradient"]||K==="geojson"&&F.lineMetrics||a.push(new Ge(m,d,`layer "${d.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):a.push(new Ge(m,d,`layer "${d.id}" must specify a "source-layer"`)):a.push(new Ge(m,d.source,`source "${d.source}" not found`))}else a.push(new Ge(m,d,'missing required property "source"'));return a=a.concat(Bo({key:m,value:d,valueSpec:S.layer,style:u.style,styleSpec:u.styleSpec,objectElementValidators:{"*":()=>[],type:()=>co({key:`${m}.type`,value:d.type,valueSpec:S.layer.type,style:u.style,styleSpec:u.styleSpec,object:d,objectKey:"type"}),filter:Ru,layout:F=>Bo({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":K=>tv(cn({layerType:T},K))}}),paint:F=>Bo({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":K=>ev(cn({layerType:T},K))}})}})),a}function Sl(u){const a=u.value,d=u.key,m=ur(a);return m!=="string"?[new Ge(d,a,`string expected, ${m} found`)]:[]}const rv={promoteId:function({key:u,value:a}){if(ur(a)==="string")return Sl({key:u,value:a});{const d=[];for(const m in a)d.push(...Sl({key:`${u}.${m}`,value:a[m]}));return d}}};function Au(u){const a=u.value,d=u.key,m=u.styleSpec,_=u.style;if(!a.type)return[new Ge(d,a,'"type" is required')];const S=jt(a.type);let T;switch(S){case"vector":case"raster":case"raster-dem":return T=Bo({key:d,value:a,valueSpec:m[`source_${S.replace("-","_")}`],style:u.style,styleSpec:m,objectElementValidators:rv}),T;case"geojson":if(T=Bo({key:d,value:a,valueSpec:m.source_geojson,style:_,styleSpec:m,objectElementValidators:rv}),a.cluster)for(const L in a.clusterProperties){const[F,K]=a.clusterProperties[L],Q=typeof F=="string"?[F,["accumulated"],["get",L]]:F;T.push(...Ts({key:`${d}.${L}.map`,value:K,expressionContext:"cluster-map"})),T.push(...Ts({key:`${d}.${L}.reduce`,value:Q,expressionContext:"cluster-reduce"}))}return T;case"video":return Bo({key:d,value:a,valueSpec:m.source_video,style:_,styleSpec:m});case"image":return Bo({key:d,value:a,valueSpec:m.source_image,style:_,styleSpec:m});case"canvas":return[new Ge(d,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Tu({key:`${d}.type`,value:a.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,styleSpec:m})}}function Nu(u){const a=u.value,d=u.styleSpec,m=d.light,_=u.style;let S=[];const T=ur(a);if(a===void 0)return S;if(T!=="object")return S=S.concat([new Ge("light",a,`object expected, ${T} found`)]),S;for(const L in a){const F=L.match(/^(.*)-transition$/);S=S.concat(F&&m[F[1]]&&m[F[1]].transition?co({key:L,value:a[L],valueSpec:d.transition,style:_,styleSpec:d}):m[L]?co({key:L,value:a[L],valueSpec:m[L],style:_,styleSpec:d}):[new Ge(L,a[L],`unknown property "${L}"`)])}return S}function uo(u){const a=u.value,d=u.styleSpec,m=d.terrain,_=u.style;let S=[];const T=ur(a);if(a===void 0)return S;if(T!=="object")return S=S.concat([new Ge("terrain",a,`object expected, ${T} found`)]),S;for(const L in a)S=S.concat(m[L]?co({key:L,value:a[L],valueSpec:m[L],style:_,styleSpec:d}):[new Ge(L,a[L],`unknown property "${L}"`)]);return S}const Ou={"*":()=>[],array:Zm,boolean:function(u){const a=u.value,d=u.key,m=ur(a);return m!=="boolean"?[new Ge(d,a,`boolean expected, ${m} found`)]:[]},number:Qf,color:function(u){const a=u.key,d=u.value,m=ur(d);return m!=="string"?[new Ge(a,d,`color expected, ${m} found`)]:Zn(d)===null?[new Ge(a,d,`color expected, "${d}" found`)]:[]},constants:Zt,enum:Tu,filter:Ru,function:Xm,layer:nv,object:Bo,source:Au,light:Nu,terrain:uo,string:Sl,formatted:function(u){return Sl(u).length===0?[]:Ts(u)},resolvedImage:function(u){return Sl(u).length===0?[]:Ts(u)},padding:function(u){const a=u.key,d=u.value;if(ur(d)==="array"){if(d.length<1||d.length>4)return[new Ge(a,d,`padding requires 1 to 4 values; ${d.length} values found`)];const m={type:"number"};let _=[];for(let S=0;S[]}})),u.constants&&(d=d.concat(Zt({key:"constants",value:u.constants,style:u,styleSpec:a}))),iv(d)}function iv(u){return[].concat(u).sort((a,d)=>a.line-d.line)}function ka(u){return function(...a){return iv(u.apply(this,a))}}Ya.source=ka(Au),Ya.light=ka(Nu),Ya.terrain=ka(uo),Ya.layer=ka(nv),Ya.filter=ka(Ru),Ya.paintProperty=ka(ev),Ya.layoutProperty=ka(tv);const Du=Ya,eh=Du.light,Kx=Du.paintProperty,Hx=Du.layoutProperty;function Jc(u,a){let d=!1;if(a&&a.length)for(const m of a)u.fire(new Ut(new Error(m.message))),d=!0;return d}class Lu{constructor(a,d,m){const _=this.cells=[];if(a instanceof ArrayBuffer){this.arrayBuffer=a;const T=new Int32Array(this.arrayBuffer);a=T[0],this.d=(d=T[1])+2*(m=T[2]);for(let F=0;F=ne[pe+0]&&_>=ne[pe+1])?(L[he]=!0,T.push(Q[he])):L[he]=!1}}}}_forEachCell(a,d,m,_,S,T,L,F){const K=this._convertToCellCoord(a),Q=this._convertToCellCoord(d),ne=this._convertToCellCoord(m),ue=this._convertToCellCoord(_);for(let he=K;he<=ne;he++)for(let pe=Q;pe<=ue;pe++){const Ne=this.d*pe+he;if((!F||F(this._convertFromCellCoord(he),this._convertFromCellCoord(pe),this._convertFromCellCoord(he+1),this._convertFromCellCoord(pe+1)))&&S.call(this,a,d,m,_,Ne,T,L,F))return}}_convertFromCellCoord(a){return(a-this.padding)/this.scale}_convertToCellCoord(a){return Math.max(0,Math.min(this.d-1,Math.floor(a*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const a=this.cells,d=3+this.cells.length+1+1;let m=0;for(let T=0;T=0)continue;const T=u[S];_[S]=Ia[m].shallow.indexOf(S)>=0?T:ks(T,a)}u instanceof Error&&(_.message=u.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 u)}function Qa(u){if(u==null||typeof u=="boolean"||typeof u=="number"||typeof u=="string"||u instanceof Boolean||u instanceof Number||u instanceof String||u instanceof Date||u instanceof RegExp||u instanceof Blob||ov(u)||J(u)||ArrayBuffer.isView(u)||u instanceof ImageData)return u;if(Array.isArray(u))return u.map(Qa);if(typeof u=="object"){const a=u.$name||"Object";if(!Ia[a])throw new Error(`can't deserialize unregistered class ${a}`);const{klass:d}=Ia[a];if(!d)throw new Error(`can't deserialize unregistered class ${a}`);if(d.deserialize)return d.deserialize(u);const m=Object.create(d.prototype);for(const _ of Object.keys(u)){if(_==="$name")continue;const S=u[_];m[_]=Ia[a].shallow.indexOf(_)>=0?S:Qa(S)}return m}throw new Error("can't deserialize object of type "+typeof u)}class th{constructor(){this.first=!0}update(a,d){const m=Math.floor(a);return this.first?(this.first=!1,this.lastIntegerZoom=m,this.lastIntegerZoomTime=0,this.lastZoom=a,this.lastFloorZoom=m,!0):(this.lastFloorZoom>m?(this.lastIntegerZoom=m+1,this.lastIntegerZoomTime=d):this.lastFloorZoomu>=128&&u<=255,Arabic:u=>u>=1536&&u<=1791,"Arabic Supplement":u=>u>=1872&&u<=1919,"Arabic Extended-A":u=>u>=2208&&u<=2303,"Hangul Jamo":u=>u>=4352&&u<=4607,"Unified Canadian Aboriginal Syllabics":u=>u>=5120&&u<=5759,Khmer:u=>u>=6016&&u<=6143,"Unified Canadian Aboriginal Syllabics Extended":u=>u>=6320&&u<=6399,"General Punctuation":u=>u>=8192&&u<=8303,"Letterlike Symbols":u=>u>=8448&&u<=8527,"Number Forms":u=>u>=8528&&u<=8591,"Miscellaneous Technical":u=>u>=8960&&u<=9215,"Control Pictures":u=>u>=9216&&u<=9279,"Optical Character Recognition":u=>u>=9280&&u<=9311,"Enclosed Alphanumerics":u=>u>=9312&&u<=9471,"Geometric Shapes":u=>u>=9632&&u<=9727,"Miscellaneous Symbols":u=>u>=9728&&u<=9983,"Miscellaneous Symbols and Arrows":u=>u>=11008&&u<=11263,"CJK Radicals Supplement":u=>u>=11904&&u<=12031,"Kangxi Radicals":u=>u>=12032&&u<=12255,"Ideographic Description Characters":u=>u>=12272&&u<=12287,"CJK Symbols and Punctuation":u=>u>=12288&&u<=12351,Hiragana:u=>u>=12352&&u<=12447,Katakana:u=>u>=12448&&u<=12543,Bopomofo:u=>u>=12544&&u<=12591,"Hangul Compatibility Jamo":u=>u>=12592&&u<=12687,Kanbun:u=>u>=12688&&u<=12703,"Bopomofo Extended":u=>u>=12704&&u<=12735,"CJK Strokes":u=>u>=12736&&u<=12783,"Katakana Phonetic Extensions":u=>u>=12784&&u<=12799,"Enclosed CJK Letters and Months":u=>u>=12800&&u<=13055,"CJK Compatibility":u=>u>=13056&&u<=13311,"CJK Unified Ideographs Extension A":u=>u>=13312&&u<=19903,"Yijing Hexagram Symbols":u=>u>=19904&&u<=19967,"CJK Unified Ideographs":u=>u>=19968&&u<=40959,"Yi Syllables":u=>u>=40960&&u<=42127,"Yi Radicals":u=>u>=42128&&u<=42191,"Hangul Jamo Extended-A":u=>u>=43360&&u<=43391,"Hangul Syllables":u=>u>=44032&&u<=55215,"Hangul Jamo Extended-B":u=>u>=55216&&u<=55295,"Private Use Area":u=>u>=57344&&u<=63743,"CJK Compatibility Ideographs":u=>u>=63744&&u<=64255,"Arabic Presentation Forms-A":u=>u>=64336&&u<=65023,"Vertical Forms":u=>u>=65040&&u<=65055,"CJK Compatibility Forms":u=>u>=65072&&u<=65103,"Small Form Variants":u=>u>=65104&&u<=65135,"Arabic Presentation Forms-B":u=>u>=65136&&u<=65279,"Halfwidth and Fullwidth Forms":u=>u>=65280&&u<=65519};function ed(u){for(const a of u)if(rh(a.charCodeAt(0)))return!0;return!1}function Wx(u){for(const a of u)if(!nh(a.charCodeAt(0)))return!1;return!0}function nh(u){return!(rn.Arabic(u)||rn["Arabic Supplement"](u)||rn["Arabic Extended-A"](u)||rn["Arabic Presentation Forms-A"](u)||rn["Arabic Presentation Forms-B"](u))}function rh(u){return!(u!==746&&u!==747&&(u<4352||!(rn["Bopomofo Extended"](u)||rn.Bopomofo(u)||rn["CJK Compatibility Forms"](u)&&!(u>=65097&&u<=65103)||rn["CJK Compatibility Ideographs"](u)||rn["CJK Compatibility"](u)||rn["CJK Radicals Supplement"](u)||rn["CJK Strokes"](u)||!(!rn["CJK Symbols and Punctuation"](u)||u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||rn["CJK Unified Ideographs Extension A"](u)||rn["CJK Unified Ideographs"](u)||rn["Enclosed CJK Letters and Months"](u)||rn["Hangul Compatibility Jamo"](u)||rn["Hangul Jamo Extended-A"](u)||rn["Hangul Jamo Extended-B"](u)||rn["Hangul Jamo"](u)||rn["Hangul Syllables"](u)||rn.Hiragana(u)||rn["Ideographic Description Characters"](u)||rn.Kanbun(u)||rn["Kangxi Radicals"](u)||rn["Katakana Phonetic Extensions"](u)||rn.Katakana(u)&&u!==12540||!(!rn["Halfwidth and Fullwidth Forms"](u)||u===65288||u===65289||u===65293||u>=65306&&u<=65310||u===65339||u===65341||u===65343||u>=65371&&u<=65503||u===65507||u>=65512&&u<=65519)||!(!rn["Small Form Variants"](u)||u>=65112&&u<=65118||u>=65123&&u<=65126)||rn["Unified Canadian Aboriginal Syllabics"](u)||rn["Unified Canadian Aboriginal Syllabics Extended"](u)||rn["Vertical Forms"](u)||rn["Yijing Hexagram Symbols"](u)||rn["Yi Syllables"](u)||rn["Yi Radicals"](u))))}function av(u){return!(rh(u)||function(a){return!!(rn["Latin-1 Supplement"](a)&&(a===167||a===169||a===174||a===177||a===188||a===189||a===190||a===215||a===247)||rn["General Punctuation"](a)&&(a===8214||a===8224||a===8225||a===8240||a===8241||a===8251||a===8252||a===8258||a===8263||a===8264||a===8265||a===8273)||rn["Letterlike Symbols"](a)||rn["Number Forms"](a)||rn["Miscellaneous Technical"](a)&&(a>=8960&&a<=8967||a>=8972&&a<=8991||a>=8996&&a<=9e3||a===9003||a>=9085&&a<=9114||a>=9150&&a<=9165||a===9167||a>=9169&&a<=9179||a>=9186&&a<=9215)||rn["Control Pictures"](a)&&a!==9251||rn["Optical Character Recognition"](a)||rn["Enclosed Alphanumerics"](a)||rn["Geometric Shapes"](a)||rn["Miscellaneous Symbols"](a)&&!(a>=9754&&a<=9759)||rn["Miscellaneous Symbols and Arrows"](a)&&(a>=11026&&a<=11055||a>=11088&&a<=11097||a>=11192&&a<=11243)||rn["CJK Symbols and Punctuation"](a)||rn.Katakana(a)||rn["Private Use Area"](a)||rn["CJK Compatibility Forms"](a)||rn["Small Form Variants"](a)||rn["Halfwidth and Fullwidth Forms"](a)||a===8734||a===8756||a===8757||a>=9984&&a<=10087||a>=10102&&a<=10131||a===65532||a===65533)}(u))}function sv(u){return u>=1424&&u<=2303||rn["Arabic Presentation Forms-A"](u)||rn["Arabic Presentation Forms-B"](u)}function Gx(u,a){return!(!a&&sv(u)||u>=2304&&u<=3583||u>=3840&&u<=4255||rn.Khmer(u))}function lv(u){for(const a of u)if(sv(a.charCodeAt(0)))return!0;return!1}const ih="deferred",oh="loading",ah="loaded";let sh=null,Xi="unavailable",Ja=null;const uv=function(u){u&&typeof u=="string"&&u.indexOf("NetworkError")>-1&&(Xi="error"),sh&&sh(u)};function El(){lh.fire(new Wt("pluginStateChange",{pluginStatus:Xi,pluginURL:Ja}))}const lh=new Jt,zu=function(){return Xi},cv=function(){if(Xi!==ih||!Ja)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Xi=oh,El(),Ja&&yt({url:Ja},u=>{u?uv(u):(Xi=ah,El())})},ko={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Xi===ah||ko.applyArabicShaping!=null,isLoading:()=>Xi===oh,setState(u){if(!j())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Xi=u.pluginStatus,Ja=u.pluginURL},isParsed(){if(!j())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return ko.applyArabicShaping!=null&&ko.processBidirectionalText!=null&&ko.processStyledBidirectionalText!=null},getPluginURL(){if(!j())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Ja}};class Or{constructor(a,d){this.zoom=a,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 th,this.transition={})}isSupportedScript(a){return function(d,m){for(const _ of d)if(!Gx(_.charCodeAt(0),m))return!1;return!0}(a,ko.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const a=this.zoom,d=a-Math.floor(a),m=this.crossFadingFactor();return a>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:d+(1-d)*m}:{fromScale:.5,toScale:1,t:1-(1-m)*d}}}class Fu{constructor(a,d){this.property=a,this.value=d,this.expression=function(m,_){if(Sr(m))return new Zc(m,_);if(Su(m)){const S=qm(m,_);if(S.result==="error")throw new Error(S.value.map(T=>`${T.key}: ${T.message}`).join(", "));return S.value}{let S=m;return _.type==="color"&&typeof m=="string"?S=le.parse(m):_.type!=="padding"||typeof m!="number"&&!Array.isArray(m)||(S=Ce.parse(m)),{kind:"constant",evaluate:()=>S}}}(d===void 0?a.specification.default:d,a.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(a,d,m){return this.property.possiblyEvaluate(this,a,d,m)}}class td{constructor(a){this.property=a,this.value=new Fu(a,void 0)}transitioned(a,d){return new fv(this.property,this.value,d,k({},a.transition,this.transition),a.now)}untransitioned(){return new fv(this.property,this.value,null,{},0)}}class dv{constructor(a){this._properties=a,this._values=Object.create(a.defaultTransitionablePropertyValues)}getValue(a){return O(this._values[a].value.value)}setValue(a,d){Object.prototype.hasOwnProperty.call(this._values,a)||(this._values[a]=new td(this._values[a].property)),this._values[a].value=new Fu(this._values[a].property,d===null?void 0:O(d))}getTransition(a){return O(this._values[a].transition)}setTransition(a,d){Object.prototype.hasOwnProperty.call(this._values,a)||(this._values[a]=new td(this._values[a].property)),this._values[a].transition=O(d)||void 0}serialize(){const a={};for(const d of Object.keys(this._values)){const m=this.getValue(d);m!==void 0&&(a[d]=m);const _=this.getTransition(d);_!==void 0&&(a[`${d}-transition`]=_)}return a}transitioned(a,d){const m=new hv(this._properties);for(const _ of Object.keys(this._values))m._values[_]=this._values[_].transitioned(a,d._values[_]);return m}untransitioned(){const a=new hv(this._properties);for(const d of Object.keys(this._values))a._values[d]=this._values[d].untransitioned();return a}}class fv{constructor(a,d,m,_,S){this.property=a,this.value=d,this.begin=S+_.delay||0,this.end=this.begin+_.duration||0,a.specification.transition&&(_.delay||_.duration)&&(this.prior=m)}possiblyEvaluate(a,d,m){const _=a.now||0,S=this.value.possiblyEvaluate(a,d,m),T=this.prior;if(T){if(_>this.end)return this.prior=null,S;if(this.value.isDataDriven())return this.prior=null,S;if(_=1)return 1;const K=F*F,Q=K*F;return 4*(F<.5?Q:3*(F-K)+Q-.75)}(L))}}return S}}class hv{constructor(a){this._properties=a,this._values=Object.create(a.defaultTransitioningPropertyValues)}possiblyEvaluate(a,d,m){const _=new $u(this._properties);for(const S of Object.keys(this._values))_._values[S]=this._values[S].possiblyEvaluate(a,d,m);return _}hasTransition(){for(const a of Object.keys(this._values))if(this._values[a].prior)return!0;return!1}}class qx{constructor(a){this._properties=a,this._values=Object.create(a.defaultPropertyValues)}getValue(a){return O(this._values[a].value)}setValue(a,d){this._values[a]=new Fu(this._values[a].property,d===null?void 0:O(d))}serialize(){const a={};for(const d of Object.keys(this._values)){const m=this.getValue(d);m!==void 0&&(a[d]=m)}return a}possiblyEvaluate(a,d,m){const _=new $u(this._properties);for(const S of Object.keys(this._values))_._values[S]=this._values[S].possiblyEvaluate(a,d,m);return _}}class oa{constructor(a,d,m){this.property=a,this.value=d,this.parameters=m}isConstant(){return this.value.kind==="constant"}constantOr(a){return this.value.kind==="constant"?this.value.value:a}evaluate(a,d,m,_){return this.property.evaluate(this.value,this.parameters,a,d,m,_)}}class $u{constructor(a){this._properties=a,this._values=Object.create(a.defaultPossiblyEvaluatedValues)}get(a){return this._values[a]}}class xn{constructor(a){this.specification=a}possiblyEvaluate(a,d){if(a.isDataDriven())throw new Error("Value should not be data driven");return a.expression.evaluate(d)}interpolate(a,d,m){const _=Ta[this.specification.type];return _?_(a,d,m):a}}class In{constructor(a,d){this.specification=a,this.overrides=d}possiblyEvaluate(a,d,m,_){return new oa(this,a.expression.kind==="constant"||a.expression.kind==="camera"?{kind:"constant",value:a.expression.evaluate(d,null,{},m,_)}:a.expression,d)}interpolate(a,d,m){if(a.value.kind!=="constant"||d.value.kind!=="constant")return a;if(a.value.value===void 0||d.value.value===void 0)return new oa(this,{kind:"constant",value:void 0},a.parameters);const _=Ta[this.specification.type];return _?new oa(this,{kind:"constant",value:_(a.value.value,d.value.value,m)},a.parameters):a}evaluate(a,d,m,_,S,T){return a.kind==="constant"?a.value:a.evaluate(d,m,_,S,T)}}class Pl extends In{possiblyEvaluate(a,d,m,_){if(a.value===void 0)return new oa(this,{kind:"constant",value:void 0},d);if(a.expression.kind==="constant"){const S=a.expression.evaluate(d,null,{},m,_),T=a.property.specification.type==="resolvedImage"&&typeof S!="string"?S.name:S,L=this._calculate(T,T,T,d);return new oa(this,{kind:"constant",value:L},d)}if(a.expression.kind==="camera"){const S=this._calculate(a.expression.evaluate({zoom:d.zoom-1}),a.expression.evaluate({zoom:d.zoom}),a.expression.evaluate({zoom:d.zoom+1}),d);return new oa(this,{kind:"constant",value:S},d)}return new oa(this,a.expression,d)}evaluate(a,d,m,_,S,T){if(a.kind==="source"){const L=a.evaluate(d,m,_,S,T);return this._calculate(L,L,L,d)}return a.kind==="composite"?this._calculate(a.evaluate({zoom:Math.floor(d.zoom)-1},m,_),a.evaluate({zoom:Math.floor(d.zoom)},m,_),a.evaluate({zoom:Math.floor(d.zoom)+1},m,_),d):a.value}_calculate(a,d,m,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:a,to:d}:{from:m,to:d}}interpolate(a){return a}}class uh{constructor(a){this.specification=a}possiblyEvaluate(a,d,m,_){if(a.value!==void 0){if(a.expression.kind==="constant"){const S=a.expression.evaluate(d,null,{},m,_);return this._calculate(S,S,S,d)}return this._calculate(a.expression.evaluate(new Or(Math.floor(d.zoom-1),d)),a.expression.evaluate(new Or(Math.floor(d.zoom),d)),a.expression.evaluate(new Or(Math.floor(d.zoom+1),d)),d)}}_calculate(a,d,m,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:a,to:d}:{from:m,to:d}}interpolate(a){return a}}class es{constructor(a){this.specification=a}possiblyEvaluate(a,d,m,_){return!!a.expression.evaluate(d,null,{},m,_)}interpolate(){return!1}}class Pi{constructor(a){this.properties=a,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const d in a){const m=a[d];m.specification.overridable&&this.overridableProperties.push(d);const _=this.defaultPropertyValues[d]=new Fu(m,void 0),S=this.defaultTransitionablePropertyValues[d]=new td(m);this.defaultTransitioningPropertyValues[d]=S.untransitioned(),this.defaultPossiblyEvaluatedValues[d]=_.possiblyEvaluate({})}}}mn("DataDrivenProperty",In),mn("DataConstantProperty",xn),mn("CrossFadedDataDrivenProperty",Pl),mn("CrossFadedProperty",uh),mn("ColorRampProperty",es);const ts="-transition";class aa extends Jt{constructor(a,d){if(super(),this.id=a.id,this.type=a.type,this._featureFilter={filter:()=>!0,needGeometry:!1},a.type!=="custom"&&(this.metadata=a.metadata,this.minzoom=a.minzoom,this.maxzoom=a.maxzoom,a.type!=="background"&&(this.source=a.source,this.sourceLayer=a["source-layer"],this.filter=a.filter),d.layout&&(this._unevaluatedLayout=new qx(d.layout)),d.paint)){this._transitionablePaint=new dv(d.paint);for(const m in a.paint)this.setPaintProperty(m,a.paint[m],{validate:!1});for(const m in a.layout)this.setLayoutProperty(m,a.layout[m],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new $u(d.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(a){return a==="visibility"?this.visibility:this._unevaluatedLayout.getValue(a)}setLayoutProperty(a,d,m={}){d!=null&&this._validate(Hx,`layers.${this.id}.layout.${a}`,a,d,m)||(a!=="visibility"?this._unevaluatedLayout.setValue(a,d):this.visibility=d)}getPaintProperty(a){return a.endsWith(ts)?this._transitionablePaint.getTransition(a.slice(0,-ts.length)):this._transitionablePaint.getValue(a)}setPaintProperty(a,d,m={}){if(d!=null&&this._validate(Kx,`layers.${this.id}.paint.${a}`,a,d,m))return!1;if(a.endsWith(ts))return this._transitionablePaint.setTransition(a.slice(0,-ts.length),d||void 0),!1;{const _=this._transitionablePaint._values[a],S=_.property.specification["property-type"]==="cross-faded-data-driven",T=_.value.isDataDriven(),L=_.value;this._transitionablePaint.setValue(a,d),this._handleSpecialPaintPropertyUpdate(a);const F=this._transitionablePaint._values[a].value;return F.isDataDriven()||T||S||this._handleOverridablePaintPropertyUpdate(a,L,F)}}_handleSpecialPaintPropertyUpdate(a){}_handleOverridablePaintPropertyUpdate(a,d,m){return!1}isHidden(a){return!!(this.minzoom&&a=this.maxzoom)||this.visibility==="none"}updateTransitions(a){this._transitioningPaint=this._transitionablePaint.transitioned(a,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(a,d){a.getCrossfadeParameters&&(this._crossfadeParameters=a.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(a,void 0,d)),this.paint=this._transitioningPaint.possiblyEvaluate(a,void 0,d)}serialize(){const a={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&&(a.layout=a.layout||{},a.layout.visibility=this.visibility),M(a,(d,m)=>!(d===void 0||m==="layout"&&!Object.keys(d).length||m==="paint"&&!Object.keys(d).length))}_validate(a,d,m,_,S={}){return(!S||S.validate!==!1)&&Jc(this,a.call(Du,{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 a in this.paint._values){const d=this.paint.get(a);if(d instanceof oa&&Tr(d.property.specification)&&(d.value.kind==="source"||d.value.kind==="composite")&&d.value.isStateDependent)return!0}return!1}}const pv={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ns{constructor(a,d){this._structArray=a,this._pos1=d*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class qr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(a,d){return a._trim(),d&&(a.isTransferred=!0,d.push(a.arrayBuffer)),{length:a.length,arrayBuffer:a.arrayBuffer}}static deserialize(a){const d=Object.create(this.prototype);return d.arrayBuffer=a.arrayBuffer,d.length=a.length,d.capacity=a.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(a){this.reserve(a),this.length=a}reserve(a){if(a>this.capacity){this.capacity=Math.max(a,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 ni(u,a=1){let d=0,m=0;return{members:u.map(_=>{const S=pv[_.type].BYTES_PER_ELEMENT,T=d=ch(d,Math.max(a,S)),L=_.components||1;return m=Math.max(m,S),d+=S*L,{name:_.name,type:_.type,components:L,offset:T}}),size:ch(d,Math.max(m,a)),alignment:a}}function ch(u,a){return Math.ceil(u/a)*a}class Is extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d){const m=this.length;return this.resize(m+1),this.emplace(m,a,d)}emplace(a,d,m){const _=2*a;return this.int16[_+0]=d,this.int16[_+1]=m,a}}Is.prototype.bytesPerElement=4,mn("StructArrayLayout2i4",Is);class x extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,_){const S=this.length;return this.resize(S+1),this.emplace(S,a,d,m,_)}emplace(a,d,m,_,S){const T=4*a;return this.int16[T+0]=d,this.int16[T+1]=m,this.int16[T+2]=_,this.int16[T+3]=S,a}}x.prototype.bytesPerElement=8,mn("StructArrayLayout4i8",x);class l extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,_,S,T){const L=this.length;return this.resize(L+1),this.emplace(L,a,d,m,_,S,T)}emplace(a,d,m,_,S,T,L){const F=6*a;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=_,this.int16[F+3]=S,this.int16[F+4]=T,this.int16[F+5]=L,a}}l.prototype.bytesPerElement=12,mn("StructArrayLayout2i4i12",l);class h extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,_,S,T){const L=this.length;return this.resize(L+1),this.emplace(L,a,d,m,_,S,T)}emplace(a,d,m,_,S,T,L){const F=4*a,K=8*a;return this.int16[F+0]=d,this.int16[F+1]=m,this.uint8[K+4]=_,this.uint8[K+5]=S,this.uint8[K+6]=T,this.uint8[K+7]=L,a}}h.prototype.bytesPerElement=8,mn("StructArrayLayout2i4ub8",h);class g extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,d){const m=this.length;return this.resize(m+1),this.emplace(m,a,d)}emplace(a,d,m){const _=2*a;return this.float32[_+0]=d,this.float32[_+1]=m,a}}g.prototype.bytesPerElement=8,mn("StructArrayLayout2f8",g);class b extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m,_,S,T,L,F,K,Q){const ne=this.length;return this.resize(ne+1),this.emplace(ne,a,d,m,_,S,T,L,F,K,Q)}emplace(a,d,m,_,S,T,L,F,K,Q,ne){const ue=10*a;return this.uint16[ue+0]=d,this.uint16[ue+1]=m,this.uint16[ue+2]=_,this.uint16[ue+3]=S,this.uint16[ue+4]=T,this.uint16[ue+5]=L,this.uint16[ue+6]=F,this.uint16[ue+7]=K,this.uint16[ue+8]=Q,this.uint16[ue+9]=ne,a}}b.prototype.bytesPerElement=20,mn("StructArrayLayout10ui20",b);class E extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m,_,S,T,L,F,K,Q,ne,ue){const he=this.length;return this.resize(he+1),this.emplace(he,a,d,m,_,S,T,L,F,K,Q,ne,ue)}emplace(a,d,m,_,S,T,L,F,K,Q,ne,ue,he){const pe=12*a;return this.int16[pe+0]=d,this.int16[pe+1]=m,this.int16[pe+2]=_,this.int16[pe+3]=S,this.uint16[pe+4]=T,this.uint16[pe+5]=L,this.uint16[pe+6]=F,this.uint16[pe+7]=K,this.int16[pe+8]=Q,this.int16[pe+9]=ne,this.int16[pe+10]=ue,this.int16[pe+11]=he,a}}E.prototype.bytesPerElement=24,mn("StructArrayLayout4i4ui4i24",E);class D extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,a,d,m)}emplace(a,d,m,_){const S=3*a;return this.float32[S+0]=d,this.float32[S+1]=m,this.float32[S+2]=_,a}}D.prototype.bytesPerElement=12,mn("StructArrayLayout3f12",D);class $ extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(a){const d=this.length;return this.resize(d+1),this.emplace(d,a)}emplace(a,d){return this.uint32[1*a+0]=d,a}}$.prototype.bytesPerElement=4,mn("StructArrayLayout1ul4",$);class U extends qr{_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(a,d,m,_,S,T,L,F,K){const Q=this.length;return this.resize(Q+1),this.emplace(Q,a,d,m,_,S,T,L,F,K)}emplace(a,d,m,_,S,T,L,F,K,Q){const ne=10*a,ue=5*a;return this.int16[ne+0]=d,this.int16[ne+1]=m,this.int16[ne+2]=_,this.int16[ne+3]=S,this.int16[ne+4]=T,this.int16[ne+5]=L,this.uint32[ue+3]=F,this.uint16[ne+8]=K,this.uint16[ne+9]=Q,a}}U.prototype.bytesPerElement=20,mn("StructArrayLayout6i1ul2ui20",U);class W extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,_,S,T){const L=this.length;return this.resize(L+1),this.emplace(L,a,d,m,_,S,T)}emplace(a,d,m,_,S,T,L){const F=6*a;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=_,this.int16[F+3]=S,this.int16[F+4]=T,this.int16[F+5]=L,a}}W.prototype.bytesPerElement=12,mn("StructArrayLayout2i2i2i12",W);class te extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,_,S){const T=this.length;return this.resize(T+1),this.emplace(T,a,d,m,_,S)}emplace(a,d,m,_,S,T){const L=4*a,F=8*a;return this.float32[L+0]=d,this.float32[L+1]=m,this.float32[L+2]=_,this.int16[F+6]=S,this.int16[F+7]=T,a}}te.prototype.bytesPerElement=16,mn("StructArrayLayout2f1f2i16",te);class ae extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,d,m,_){const S=this.length;return this.resize(S+1),this.emplace(S,a,d,m,_)}emplace(a,d,m,_,S){const T=12*a,L=3*a;return this.uint8[T+0]=d,this.uint8[T+1]=m,this.float32[L+1]=_,this.float32[L+2]=S,a}}ae.prototype.bytesPerElement=12,mn("StructArrayLayout2ub2f12",ae);class fe extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,a,d,m)}emplace(a,d,m,_){const S=3*a;return this.uint16[S+0]=d,this.uint16[S+1]=m,this.uint16[S+2]=_,a}}fe.prototype.bytesPerElement=6,mn("StructArrayLayout3ui6",fe);class Se extends qr{_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(a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe,Ne,Ae,Ye){const lt=this.length;return this.resize(lt+1),this.emplace(lt,a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe,Ne,Ae,Ye)}emplace(a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe,Ne,Ae,Ye,lt){const Ke=24*a,it=12*a,kt=48*a;return this.int16[Ke+0]=d,this.int16[Ke+1]=m,this.uint16[Ke+2]=_,this.uint16[Ke+3]=S,this.uint32[it+2]=T,this.uint32[it+3]=L,this.uint32[it+4]=F,this.uint16[Ke+10]=K,this.uint16[Ke+11]=Q,this.uint16[Ke+12]=ne,this.float32[it+7]=ue,this.float32[it+8]=he,this.uint8[kt+36]=pe,this.uint8[kt+37]=Ne,this.uint8[kt+38]=Ae,this.uint32[it+10]=Ye,this.int16[Ke+22]=lt,a}}Se.prototype.bytesPerElement=48,mn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Se);class _e extends qr{_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(a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe,Ne,Ae,Ye,lt,Ke,it,kt,Tt,hn,vn,on,Qt,Gt,an){const tn=this.length;return this.resize(tn+1),this.emplace(tn,a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe,Ne,Ae,Ye,lt,Ke,it,kt,Tt,hn,vn,on,Qt,Gt,an)}emplace(a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe,Ne,Ae,Ye,lt,Ke,it,kt,Tt,hn,vn,on,Qt,Gt,an,tn){const $t=34*a,Tn=17*a;return this.int16[$t+0]=d,this.int16[$t+1]=m,this.int16[$t+2]=_,this.int16[$t+3]=S,this.int16[$t+4]=T,this.int16[$t+5]=L,this.int16[$t+6]=F,this.int16[$t+7]=K,this.uint16[$t+8]=Q,this.uint16[$t+9]=ne,this.uint16[$t+10]=ue,this.uint16[$t+11]=he,this.uint16[$t+12]=pe,this.uint16[$t+13]=Ne,this.uint16[$t+14]=Ae,this.uint16[$t+15]=Ye,this.uint16[$t+16]=lt,this.uint16[$t+17]=Ke,this.uint16[$t+18]=it,this.uint16[$t+19]=kt,this.uint16[$t+20]=Tt,this.uint16[$t+21]=hn,this.uint16[$t+22]=vn,this.uint32[Tn+12]=on,this.float32[Tn+13]=Qt,this.float32[Tn+14]=Gt,this.float32[Tn+15]=an,this.float32[Tn+16]=tn,a}}_e.prototype.bytesPerElement=68,mn("StructArrayLayout8i15ui1ul4f68",_e);class we extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a){const d=this.length;return this.resize(d+1),this.emplace(d,a)}emplace(a,d){return this.float32[1*a+0]=d,a}}we.prototype.bytesPerElement=4,mn("StructArrayLayout1f4",we);class Be extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,a,d,m)}emplace(a,d,m,_){const S=3*a;return this.int16[S+0]=d,this.int16[S+1]=m,this.int16[S+2]=_,a}}Be.prototype.bytesPerElement=6,mn("StructArrayLayout3i6",Be);class je extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,a,d,m)}emplace(a,d,m,_){const S=4*a;return this.uint32[2*a+0]=d,this.uint16[S+2]=m,this.uint16[S+3]=_,a}}je.prototype.bytesPerElement=8,mn("StructArrayLayout1ul2ui8",je);class et extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d){const m=this.length;return this.resize(m+1),this.emplace(m,a,d)}emplace(a,d,m){const _=2*a;return this.uint16[_+0]=d,this.uint16[_+1]=m,a}}et.prototype.bytesPerElement=4,mn("StructArrayLayout2ui4",et);class Me extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a){const d=this.length;return this.resize(d+1),this.emplace(d,a)}emplace(a,d){return this.uint16[1*a+0]=d,a}}Me.prototype.bytesPerElement=2,mn("StructArrayLayout1ui2",Me);class at extends qr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,d,m,_){const S=this.length;return this.resize(S+1),this.emplace(S,a,d,m,_)}emplace(a,d,m,_,S){const T=4*a;return this.float32[T+0]=d,this.float32[T+1]=m,this.float32[T+2]=_,this.float32[T+3]=S,a}}at.prototype.bytesPerElement=16,mn("StructArrayLayout4f16",at);class nt extends ns{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 ie(this.anchorPointX,this.anchorPointY)}}nt.prototype.size=20;class xt extends U{get(a){return new nt(this,a)}}mn("CollisionBoxArray",xt);class _t extends ns{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(a){this._structArray.uint8[this._pos1+37]=a}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(a){this._structArray.uint8[this._pos1+38]=a}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(a){this._structArray.uint32[this._pos4+10]=a}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}_t.prototype.size=48;class Ft extends Se{get(a){return new _t(this,a)}}mn("PlacedSymbolArray",Ft);class vt extends ns{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(a){this._structArray.uint32[this._pos4+12]=a}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 sn extends _e{get(a){return new vt(this,a)}}mn("SymbolInstanceArray",sn);class Yt extends we{getoffsetX(a){return this.float32[1*a+0]}}mn("GlyphOffsetArray",Yt);class fn extends Be{getx(a){return this.int16[3*a+0]}gety(a){return this.int16[3*a+1]}gettileUnitDistanceFromAnchor(a){return this.int16[3*a+2]}}mn("SymbolLineVertexArray",fn);class Fn extends ns{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]}}Fn.prototype.size=8;class Un extends je{get(a){return new Fn(this,a)}}mn("FeatureIndexArray",Un);class Pn extends Is{}class fr extends Is{}class hr extends Is{}class er extends l{}class ir extends h{}class vr extends g{}class gi extends b{}class sa extends E{}class Vo extends D{}class la extends ${}class rs extends W{}class Io extends ae{}class Yi extends fe{}class Ra extends et{}const nd=ni([{name:"a_pos",components:2,type:"Int16"}],4),{members:di}=nd;class Wn{constructor(a=[]){this.segments=a}prepareSegment(a,d,m,_){let S=this.segments[this.segments.length-1];return a>Wn.MAX_VERTEX_ARRAY_LENGTH&&B(`Max vertices per segment is ${Wn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${a}`),(!S||S.vertexLength+a>Wn.MAX_VERTEX_ARRAY_LENGTH||S.sortKey!==_)&&(S={vertexOffset:d.length,primitiveOffset:m.length,vertexLength:0,primitiveLength:0},_!==void 0&&(S.sortKey=_),this.segments.push(S)),S}get(){return this.segments}destroy(){for(const a of this.segments)for(const d in a.vaos)a.vaos[d].destroy()}static simpleSegment(a,d,m,_){return new Wn([{vertexOffset:a,primitiveOffset:d,vertexLength:m,primitiveLength:_,vaos:{},sortKey:0}])}}function dr(u,a){return 256*(u=w(Math.floor(u),0,255))+w(Math.floor(a),0,255)}Wn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,mn("SegmentVector",Wn);const yi=ni([{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 xi={exports:{}},Dr={exports:{}};Dr.exports=function(u,a){var d,m,_,S,T,L,F,K;for(m=u.length-(d=3&u.length),_=a,T=3432918353,L=461845907,K=0;K>>16)*T&65535)<<16)&4294967295)<<15|F>>>17))*L+(((F>>>16)*L&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(S>>>16)&65535)<<16);switch(F=0,d){case 3:F^=(255&u.charCodeAt(K+2))<<16;case 2:F^=(255&u.charCodeAt(K+1))<<8;case 1:_^=F=(65535&(F=(F=(65535&(F^=255&u.charCodeAt(K)))*T+(((F>>>16)*T&65535)<<16)&4294967295)<<15|F>>>17))*L+(((F>>>16)*L&65535)<<16)&4294967295}return _^=u.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Ro={exports:{}};Ro.exports=function(u,a){for(var d,m=u.length,_=a^m,S=0;m>=4;)d=1540483477*(65535&(d=255&u.charCodeAt(S)|(255&u.charCodeAt(++S))<<8|(255&u.charCodeAt(++S))<<16|(255&u.charCodeAt(++S))<<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,++S;switch(m){case 3:_^=(255&u.charCodeAt(S+2))<<16;case 2:_^=(255&u.charCodeAt(S+1))<<8;case 1:_=1540483477*(65535&(_^=255&u.charCodeAt(S)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var Rs=Dr.exports,dh=Ro.exports;xi.exports=Rs,xi.exports.murmur3=Rs,xi.exports.murmur2=dh;class Tl{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(a,d,m,_){this.ids.push(mv(a)),this.positions.push(d,m,_)}getPositions(a){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const d=mv(a);let m=0,_=this.ids.length-1;for(;m<_;){const T=m+_>>1;this.ids[T]>=d?_=T:m=T+1}const S=[];for(;this.ids[m]===d;)S.push({index:this.positions[3*m],start:this.positions[3*m+1],end:this.positions[3*m+2]}),m++;return S}static serialize(a,d){const m=new Float64Array(a.ids),_=new Uint32Array(a.positions);return fh(m,_,0,m.length-1),d&&d.push(m.buffer,_.buffer),{ids:m,positions:_}}static deserialize(a){const d=new Tl;return d.ids=a.ids,d.positions=a.positions,d.indexed=!0,d}}function mv(u){const a=+u;return!isNaN(a)&&a<=Number.MAX_SAFE_INTEGER?a:xi.exports(String(u))}function fh(u,a,d,m){for(;d>1];let S=d-1,T=m+1;for(;;){do S++;while(u[S]<_);do T--;while(u[T]>_);if(S>=T)break;is(u,S,T),is(a,3*S,3*T),is(a,3*S+1,3*T+1),is(a,3*S+2,3*T+2)}T-d`u_${_}`),this.type=m}setUniform(a,d,m){a.set(m.constantOr(this.value))}getBinding(a,d,m){return this.type==="color"?new VE(a,d):new As(a,d)}}class id{constructor(a,d){this.uniformNames=d.map(m=>`u_${m}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(a,d){this.pixelRatioFrom=d.pixelRatio,this.pixelRatioTo=a.pixelRatio,this.patternFrom=d.tlbr,this.patternTo=a.tlbr}setUniform(a,d,m,_){const S=_==="u_pattern_to"?this.patternTo:_==="u_pattern_from"?this.patternFrom:_==="u_pixel_ratio_to"?this.pixelRatioTo:_==="u_pixel_ratio_from"?this.pixelRatioFrom:null;S&&a.set(S)}getBinding(a,d,m){return m.substr(0,9)==="u_pattern"?new rd(a,d):new As(a,d)}}class Ns{constructor(a,d,m,_){this.expression=a,this.type=m,this.maxValue=0,this.paintVertexAttributes=d.map(S=>({name:`a_${S}`,type:"Float32",components:m==="color"?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(a,d,m,_,S){const T=this.paintVertexArray.length,L=this.expression.evaluate(new Or(0),d,{},_,[],S);this.paintVertexArray.resize(a),this._setPaintValue(T,a,L)}updatePaintArray(a,d,m,_){const S=this.expression.evaluate({zoom:0},m,_);this._setPaintValue(a,d,S)}_setPaintValue(a,d,m){if(this.type==="color"){const _=Zx(m);for(let S=a;S`u_${L}_t`),this.type=m,this.useIntegerZoom=_,this.zoom=S,this.maxValue=0,this.paintVertexAttributes=d.map(L=>({name:`a_${L}`,type:"Float32",components:m==="color"?4:2,offset:0})),this.paintVertexArray=new T}populatePaintArray(a,d,m,_,S){const T=this.expression.evaluate(new Or(this.zoom),d,{},_,[],S),L=this.expression.evaluate(new Or(this.zoom+1),d,{},_,[],S),F=this.paintVertexArray.length;this.paintVertexArray.resize(a),this._setPaintValue(F,a,T,L)}updatePaintArray(a,d,m,_){const S=this.expression.evaluate({zoom:this.zoom},m,_),T=this.expression.evaluate({zoom:this.zoom+1},m,_);this._setPaintValue(a,d,S,T)}_setPaintValue(a,d,m,_){if(this.type==="color"){const S=Zx(m),T=Zx(_);for(let L=a;L`#define HAS_UNIFORM_${_}`))}return a}getBinderAttributes(){const a=[];for(const d in this.binders){const m=this.binders[d];if(m instanceof Ns||m instanceof Ma)for(let _=0;_!0){this.programConfigurations={};for(const _ of a)this.programConfigurations[_.id]=new UE(_,d,m);this.needsUpload=!1,this._featureMap=new Tl,this._bufferOffset=0}populatePaintArrays(a,d,m,_,S,T){for(const L in this.programConfigurations)this.programConfigurations[L].populatePaintArrays(a,d,_,S,T);d.id!==void 0&&this._featureMap.add(d.id,m,this._bufferOffset,a),this._bufferOffset=a,this.needsUpload=!0}updatePaintArrays(a,d,m,_){for(const S of m)this.needsUpload=this.programConfigurations[S.id].updatePaintArrays(a,this._featureMap,d,S,_)||this.needsUpload}get(a){return this.programConfigurations[a]}upload(a){if(this.needsUpload){for(const d in this.programConfigurations)this.programConfigurations[d].upload(a);this.needsUpload=!1}}destroy(){for(const a in this.programConfigurations)this.programConfigurations[a].destroy()}}function iF(u,a){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"]}[u]||[u.replace(`${a}-`,"").replace(/-/g,"_")]}function jE(u,a,d){const m={color:{source:g,composite:at},number:{source:we,composite:g}},_=function(S){return{"line-pattern":{source:gi,composite:gi},"fill-pattern":{source:gi,composite:gi},"fill-extrusion-pattern":{source:gi,composite:gi}}[S]}(u);return _&&_[d]||m[a][d]}mn("ConstantBinder",hh),mn("CrossFadedConstantBinder",id),mn("SourceExpressionBinder",Ns),mn("CrossFadedCompositeBinder",kl),mn("CompositeExpressionBinder",Ma),mn("ProgramConfiguration",UE,{omit:["_buffers"]}),mn("ProgramConfigurationSet",Bu);var fi=8192;const Xx=Math.pow(2,14)-1,KE=-Xx-1;function Vu(u){const a=fi/u.extent,d=u.loadGeometry();for(let m=0;mT.x+1||FT.y+1)&&B("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return d}function Uu(u,a){return{type:u.type,id:u.id,properties:u.properties,geometry:a?Vu(u):[]}}function vv(u,a,d,m,_){u.emplaceBack(2*a+(m+1)/2,2*d+(_+1)/2)}class Yx{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(d=>d.id),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new fr,this.indexArray=new Yi,this.segments=new Wn,this.programConfigurations=new Bu(a.layers,a.zoom),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){const _=this.layers[0],S=[];let T=null,L=!1;_.type==="circle"&&(T=_.layout.get("circle-sort-key"),L=!T.isConstant());for(const{feature:F,id:K,index:Q,sourceLayerIndex:ne}of a){const ue=this.layers[0]._featureFilter.needGeometry,he=Uu(F,ue);if(!this.layers[0]._featureFilter.filter(new Or(this.zoom),he,m))continue;const pe=L?T.evaluate(he,{},m):void 0,Ne={id:K,properties:F.properties,type:F.type,sourceLayerIndex:ne,index:Q,geometry:ue?he.geometry:Vu(F),patterns:{},sortKey:pe};S.push(Ne)}L&&S.sort((F,K)=>F.sortKey-K.sortKey);for(const F of S){const{geometry:K,index:Q,sourceLayerIndex:ne}=F,ue=a[Q].feature;this.addFeature(F,K,Q,m),d.featureIndex.insert(ue,K,Q,ne,this.index)}}update(a,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,d,this.stateDependentLayers,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,di),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(a,d,m,_){for(const S of d)for(const T of S){const L=T.x,F=T.y;if(L<0||L>=fi||F<0||F>=fi)continue;const K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,a.sortKey),Q=K.vertexLength;vv(this.layoutVertexArray,L,F,-1,-1),vv(this.layoutVertexArray,L,F,1,-1),vv(this.layoutVertexArray,L,F,1,1),vv(this.layoutVertexArray,L,F,-1,1),this.indexArray.emplaceBack(Q,Q+1,Q+2),this.indexArray.emplaceBack(Q,Q+3,Q+2),K.vertexLength+=4,K.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,m,{},_)}}function HE(u,a){for(let d=0;d1){if(Qx(u,a))return!0;for(let m=0;m1?d:d.sub(a)._mult(_)._add(a))}function qE(u,a){let d,m,_,S=!1;for(let T=0;Ta.y!=_.y>a.y&&a.x<(_.x-m.x)*(a.y-m.y)/(_.y-m.y)+m.x&&(S=!S)}return S}function od(u,a){let d=!1;for(let m=0,_=u.length-1;ma.y!=T.y>a.y&&a.x<(T.x-S.x)*(a.y-S.y)/(T.y-S.y)+S.x&&(d=!d)}return d}function lF(u,a,d){const m=d[0],_=d[2];if(u.x_.x&&a.x>_.x||u.y_.y&&a.y>_.y)return!1;const S=V(u,a,d[0]);return S!==V(u,a,d[1])||S!==V(u,a,d[2])||S!==V(u,a,d[3])}function ph(u,a,d){const m=a.paint.get(u).value;return m.kind==="constant"?m.value:d.programConfigurations.get(a.id).getMaxValue(u)}function gv(u){return Math.sqrt(u[0]*u[0]+u[1]*u[1])}function yv(u,a,d,m,_){if(!a[0]&&!a[1])return u;const S=ie.convert(a)._mult(_);d==="viewport"&&S._rotate(-m);const T=[];for(let L=0;Lu.width||_.height>u.height||d.x>u.width-_.width||d.y>u.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>a.width||_.height>a.height||m.x>a.width-_.width||m.y>a.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const T=u.data,L=a.data;if(T===L)throw new Error("srcData equals dstData, so image is already copied");for(let F=0;F<_.height;F++){const K=((d.y+F)*u.width+d.x)*S,Q=((m.y+F)*a.width+m.x)*S;for(let ne=0;ne<_.width*S;ne++)L[Q+ne]=T[K+ne]}return a}class vh{constructor(a,d){t_(this,a,1,d)}resize(a){n4(this,a,1)}clone(){return new vh({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(a,d,m,_,S){n_(a,d,m,_,S,1)}}class Uo{constructor(a,d){t_(this,a,4,d)}resize(a){n4(this,a,4)}replace(a,d){d?this.data.set(a):this.data=a instanceof Uint8ClampedArray?new Uint8Array(a.buffer):a}clone(){return new Uo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(a,d,m,_,S){n_(a,d,m,_,S,4)}}function r4(u){const a={},d=u.resolution||256,m=u.clips?u.clips.length:1,_=u.image||new Uo({width:d,height:m});if(Math.log(d)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${d}`);const S=(T,L,F)=>{a[u.evaluationKey]=F;const K=u.expression.evaluate(a);_.data[T+L+0]=Math.floor(255*K.r/K.a),_.data[T+L+1]=Math.floor(255*K.g/K.a),_.data[T+L+2]=Math.floor(255*K.b/K.a),_.data[T+L+3]=Math.floor(255*K.a)};if(u.clips)for(let T=0,L=0;T80*d){m=S=u[0],_=T=u[1];for(var pe=d;peS&&(S=L),F>T&&(T=F);K=(K=Math.max(S-m,T-_))!==0?32767/K:0}return gh(ue,he,d,m,_,K,0),he}function i4(u,a,d,m,_){var S,T;if(_===o_(u,a,d,m)>0)for(S=a;S=a;S-=m)T=s4(S,u[S],u[S+1],T);return T&&wv(T,T.next)&&(xh(T),T=T.next),T}function ju(u,a){if(!u)return u;a||(a=u);var d,m=u;do if(d=!1,m.steiner||!wv(m,m.next)&&Qr(m.prev,m,m.next)!==0)m=m.next;else{if(xh(m),(m=a=m.prev)===m.next)break;d=!0}while(d||m!==a);return a}function gh(u,a,d,m,_,S,T){if(u){!T&&S&&function(Q,ne,ue,he){var pe=Q;do pe.z===0&&(pe.z=r_(pe.x,pe.y,ne,ue,he)),pe.prevZ=pe.prev,pe.nextZ=pe.next,pe=pe.next;while(pe!==Q);pe.prevZ.nextZ=null,pe.prevZ=null,function(Ne){var Ae,Ye,lt,Ke,it,kt,Tt,hn,vn=1;do{for(Ye=Ne,Ne=null,it=null,kt=0;Ye;){for(kt++,lt=Ye,Tt=0,Ae=0;Ae0||hn>0&<)Tt!==0&&(hn===0||!lt||Ye.z<=lt.z)?(Ke=Ye,Ye=Ye.nextZ,Tt--):(Ke=lt,lt=lt.nextZ,hn--),it?it.nextZ=Ke:Ne=Ke,Ke.prevZ=it,it=Ke;Ye=lt}it.nextZ=null,vn*=2}while(kt>1)}(pe)}(u,m,_,S);for(var L,F,K=u;u.prev!==u.next;)if(L=u.prev,F=u.next,S?gF(u,m,_,S):vF(u))a.push(L.i/d|0),a.push(u.i/d|0),a.push(F.i/d|0),xh(u),u=F.next,K=F.next;else if((u=F)===K){T?T===1?gh(u=yF(ju(u),a,d),a,d,m,_,S,2):T===2&&xF(u,a,d,m,_,S):gh(ju(u),a,d,m,_,S,1);break}}}function vF(u){var a=u.prev,d=u,m=u.next;if(Qr(a,d,m)>=0)return!1;for(var _=a.x,S=d.x,T=m.x,L=a.y,F=d.y,K=m.y,Q=_S?_>T?_:T:S>T?S:T,he=L>F?L>K?L:K:F>K?F:K,pe=m.next;pe!==a;){if(pe.x>=Q&&pe.x<=ue&&pe.y>=ne&&pe.y<=he&&ad(_,L,S,F,T,K,pe.x,pe.y)&&Qr(pe.prev,pe,pe.next)>=0)return!1;pe=pe.next}return!0}function gF(u,a,d,m){var _=u.prev,S=u,T=u.next;if(Qr(_,S,T)>=0)return!1;for(var L=_.x,F=S.x,K=T.x,Q=_.y,ne=S.y,ue=T.y,he=LF?L>K?L:K:F>K?F:K,Ae=Q>ne?Q>ue?Q:ue:ne>ue?ne:ue,Ye=r_(he,pe,a,d,m),lt=r_(Ne,Ae,a,d,m),Ke=u.prevZ,it=u.nextZ;Ke&&Ke.z>=Ye&&it&&it.z<=lt;){if(Ke.x>=he&&Ke.x<=Ne&&Ke.y>=pe&&Ke.y<=Ae&&Ke!==_&&Ke!==T&&ad(L,Q,F,ne,K,ue,Ke.x,Ke.y)&&Qr(Ke.prev,Ke,Ke.next)>=0||(Ke=Ke.prevZ,it.x>=he&&it.x<=Ne&&it.y>=pe&&it.y<=Ae&&it!==_&&it!==T&&ad(L,Q,F,ne,K,ue,it.x,it.y)&&Qr(it.prev,it,it.next)>=0))return!1;it=it.nextZ}for(;Ke&&Ke.z>=Ye;){if(Ke.x>=he&&Ke.x<=Ne&&Ke.y>=pe&&Ke.y<=Ae&&Ke!==_&&Ke!==T&&ad(L,Q,F,ne,K,ue,Ke.x,Ke.y)&&Qr(Ke.prev,Ke,Ke.next)>=0)return!1;Ke=Ke.prevZ}for(;it&&it.z<=lt;){if(it.x>=he&&it.x<=Ne&&it.y>=pe&&it.y<=Ae&&it!==_&&it!==T&&ad(L,Q,F,ne,K,ue,it.x,it.y)&&Qr(it.prev,it,it.next)>=0)return!1;it=it.nextZ}return!0}function yF(u,a,d){var m=u;do{var _=m.prev,S=m.next.next;!wv(_,S)&&o4(_,m,m.next,S)&&yh(_,S)&&yh(S,_)&&(a.push(_.i/d|0),a.push(m.i/d|0),a.push(S.i/d|0),xh(m),xh(m.next),m=u=S),m=m.next}while(m!==u);return ju(m)}function xF(u,a,d,m,_,S){var T=u;do{for(var L=T.next.next;L!==T.prev;){if(T.i!==L.i&&SF(T,L)){var F=a4(T,L);return T=ju(T,T.next),F=ju(F,F.next),gh(T,a,d,m,_,S,0),void gh(F,a,d,m,_,S,0)}L=L.next}T=T.next}while(T!==u)}function _F(u,a){return u.x-a.x}function bF(u,a){var d=function(_,S){var T,L=S,F=_.x,K=_.y,Q=-1/0;do{if(K<=L.y&&K>=L.next.y&&L.next.y!==L.y){var ne=L.x+(K-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(ne<=F&&ne>Q&&(Q=ne,T=L.x=L.x&&L.x>=pe&&F!==L.x&&ad(KT.x||L.x===T.x&&wF(T,L)))&&(T=L,Ae=ue)),L=L.next;while(L!==he);return T}(u,a);if(!d)return a;var m=a4(d,u);return ju(m,m.next),ju(d,d.next)}function wF(u,a){return Qr(u.prev,u,a.prev)<0&&Qr(a.next,u,u.next)<0}function r_(u,a,d,m,_){return(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u=(u-d)*_|0)|u<<8))|u<<4))|u<<2))|u<<1))|(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-m)*_|0)|a<<8))|a<<4))|a<<2))|a<<1))<<1}function CF(u){var a=u,d=u;do(a.x=(u-T)*(S-L)&&(u-T)*(m-L)>=(d-T)*(a-L)&&(d-T)*(S-L)>=(_-T)*(m-L)}function SF(u,a){return u.next.i!==a.i&&u.prev.i!==a.i&&!function(d,m){var _=d;do{if(_.i!==d.i&&_.next.i!==d.i&&_.i!==m.i&&_.next.i!==m.i&&o4(_,_.next,d,m))return!0;_=_.next}while(_!==d);return!1}(u,a)&&(yh(u,a)&&yh(a,u)&&function(d,m){var _=d,S=!1,T=(d.x+m.x)/2,L=(d.y+m.y)/2;do _.y>L!=_.next.y>L&&_.next.y!==_.y&&T<(_.next.x-_.x)*(L-_.y)/(_.next.y-_.y)+_.x&&(S=!S),_=_.next;while(_!==d);return S}(u,a)&&(Qr(u.prev,u,a.prev)||Qr(u,a.prev,a))||wv(u,a)&&Qr(u.prev,u,u.next)>0&&Qr(a.prev,a,a.next)>0)}function Qr(u,a,d){return(a.y-u.y)*(d.x-a.x)-(a.x-u.x)*(d.y-a.y)}function wv(u,a){return u.x===a.x&&u.y===a.y}function o4(u,a,d,m){var _=Sv(Qr(u,a,d)),S=Sv(Qr(u,a,m)),T=Sv(Qr(d,m,u)),L=Sv(Qr(d,m,a));return _!==S&&T!==L||!(_!==0||!Cv(u,d,a))||!(S!==0||!Cv(u,m,a))||!(T!==0||!Cv(d,u,m))||!(L!==0||!Cv(d,a,m))}function Cv(u,a,d){return a.x<=Math.max(u.x,d.x)&&a.x>=Math.min(u.x,d.x)&&a.y<=Math.max(u.y,d.y)&&a.y>=Math.min(u.y,d.y)}function Sv(u){return u>0?1:u<0?-1:0}function yh(u,a){return Qr(u.prev,u,u.next)<0?Qr(u,a,u.next)>=0&&Qr(u,u.prev,a)>=0:Qr(u,a,u.prev)<0||Qr(u,u.next,a)<0}function a4(u,a){var d=new i_(u.i,u.x,u.y),m=new i_(a.i,a.x,a.y),_=u.next,S=a.prev;return u.next=a,a.prev=u,d.next=_,_.prev=d,m.next=d,d.prev=m,S.next=m,m.prev=S,m}function s4(u,a,d,m){var _=new i_(u,a,d);return m?(_.next=m.next,_.prev=m,m.next.prev=_,m.next=_):(_.prev=_,_.next=_),_}function xh(u){u.next.prev=u.prev,u.prev.next=u.next,u.prevZ&&(u.prevZ.nextZ=u.nextZ),u.nextZ&&(u.nextZ.prevZ=u.prevZ)}function i_(u,a,d){this.i=u,this.x=a,this.y=d,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function o_(u,a,d,m){for(var _=0,S=a,T=d-m;Sd;){if(m-d>600){var S=m-d+1,T=a-d+1,L=Math.log(S),F=.5*Math.exp(2*L/3),K=.5*Math.sqrt(L*F*(S-F)/S)*(T-S/2<0?-1:1);l4(u,a,Math.max(d,Math.floor(a-T*F/S+K)),Math.min(m,Math.floor(a+(S-T)*F/S+K)),_)}var Q=u[a],ne=d,ue=m;for(_h(u,d,a),_(u[m],Q)>0&&_h(u,d,m);ne0;)ue--}_(u[d],Q)===0?_h(u,d,ue):_h(u,++ue,m),ue<=a&&(d=ue+1),a<=ue&&(m=ue-1)}}function _h(u,a,d){var m=u[a];u[a]=u[d],u[d]=m}function PF(u,a){return ua?1:0}function a_(u,a){const d=u.length;if(d<=1)return[u];const m=[];let _,S;for(let T=0;T1)for(let T=0;T0&&d.holes.push(m+=u[_-1].length)}return d};class u_{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(d=>d.id),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new hr,this.indexArray=new Yi,this.indexArray2=new Ra,this.programConfigurations=new Bu(a.layers,a.zoom),this.segments=new Wn,this.segments2=new Wn,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){this.hasPattern=s_("fill",this.layers,d);const _=this.layers[0].layout.get("fill-sort-key"),S=!_.isConstant(),T=[];for(const{feature:L,id:F,index:K,sourceLayerIndex:Q}of a){const ne=this.layers[0]._featureFilter.needGeometry,ue=Uu(L,ne);if(!this.layers[0]._featureFilter.filter(new Or(this.zoom),ue,m))continue;const he=S?_.evaluate(ue,{},m,d.availableImages):void 0,pe={id:F,properties:L.properties,type:L.type,sourceLayerIndex:Q,index:K,geometry:ne?ue.geometry:Vu(L),patterns:{},sortKey:he};T.push(pe)}S&&T.sort((L,F)=>L.sortKey-F.sortKey);for(const L of T){const{geometry:F,index:K,sourceLayerIndex:Q}=L;if(this.hasPattern){const ne=l_("fill",this.layers,L,this.zoom,d);this.patternFeatures.push(ne)}else this.addFeature(L,F,K,m,{});d.featureIndex.insert(a[K].feature,F,K,Q,this.index)}}update(a,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,d,this.stateDependentLayers,m)}addFeatures(a,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(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,mF),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.indexBuffer2=a.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(a),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(a,d,m,_,S){for(const T of a_(d,500)){let L=0;for(const he of T)L+=he.length;const F=this.segments.prepareSegment(L,this.layoutVertexArray,this.indexArray),K=F.vertexLength,Q=[],ne=[];for(const he of T){if(he.length===0)continue;he!==T[0]&&ne.push(Q.length/2);const pe=this.segments2.prepareSegment(he.length,this.layoutVertexArray,this.indexArray2),Ne=pe.vertexLength;this.layoutVertexArray.emplaceBack(he[0].x,he[0].y),this.indexArray2.emplaceBack(Ne+he.length-1,Ne),Q.push(he[0].x),Q.push(he[0].y);for(let Ae=1;Ae>3}if(_--,m===1||m===2)S+=u.readSVarint(),T+=u.readSVarint(),m===1&&(a&&L.push(a),a=[]),a.push(new NF(S,T));else{if(m!==7)throw new Error("unknown command "+m);a&&a.push(a[0].clone())}}return a&&L.push(a),L},sd.prototype.bbox=function(){var u=this._pbf;u.pos=this._geometry;for(var a=u.readVarint()+u.pos,d=1,m=0,_=0,S=0,T=1/0,L=-1/0,F=1/0,K=-1/0;u.pos>3}if(m--,d===1||d===2)(_+=u.readSVarint())L&&(L=_),(S+=u.readSVarint())K&&(K=S);else if(d!==7)throw new Error("unknown command "+d)}return[T,F,L,K]},sd.prototype.toGeoJSON=function(u,a,d){var m,_,S=this.extent*Math.pow(2,d),T=this.extent*u,L=this.extent*a,F=this.loadGeometry(),K=sd.types[this.type];function Q(he){for(var pe=0;pe>3;_=T===1?m.readString():T===2?m.readFloat():T===3?m.readDouble():T===4?m.readVarint64():T===5?m.readVarint():T===6?m.readSVarint():T===7?m.readBoolean():null}return _}(d))}d4.prototype.feature=function(u){if(u<0||u>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[u];var a=this._pbf.readVarint()+this._pbf.pos;return new LF(this._pbf,a,this.extent,this._keys,this._values)};var FF=c4;function $F(u,a,d){if(u===3){var m=new FF(d,d.readVarint()+d.pos);m.length&&(a[m.name]=m)}}Il.VectorTile=function(u,a){this.layers=u.readFields($F,{},a)},Il.VectorTileFeature=u4,Il.VectorTileLayer=c4;const BF=Il.VectorTileFeature.types,c_=Math.pow(2,13);function bh(u,a,d,m,_,S,T,L){u.emplaceBack(a,d,2*Math.floor(m*c_)+T,_*c_*2,S*c_*2,Math.round(L))}class d_{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(d=>d.id),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new er,this.centroidVertexArray=new Pn,this.indexArray=new Yi,this.programConfigurations=new Bu(a.layers,a.zoom),this.segments=new Wn,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){this.features=[],this.hasPattern=s_("fill-extrusion",this.layers,d);for(const{feature:_,id:S,index:T,sourceLayerIndex:L}of a){const F=this.layers[0]._featureFilter.needGeometry,K=Uu(_,F);if(!this.layers[0]._featureFilter.filter(new Or(this.zoom),K,m))continue;const Q={id:S,sourceLayerIndex:L,index:T,geometry:F?K.geometry:Vu(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(l_("fill-extrusion",this.layers,Q,this.zoom,d)):this.addFeature(Q,Q.geometry,T,m,{}),d.featureIndex.insert(_,Q.geometry,T,L,this.index,!0)}}addFeatures(a,d,m){for(const _ of this.features){const{geometry:S}=_;this.addFeature(_,S,_.index,d,m)}}update(a,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,d,this.stateDependentLayers,m)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,AF),this.centroidVertexBuffer=a.createVertexBuffer(this.centroidVertexArray,MF.members,!0),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(a,d,m,_,S){const T={x:0,y:0,vertexCount:0};for(const L of a_(d,500)){let F=0;for(const pe of L)F+=pe.length;let K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const pe of L){if(pe.length===0||UF(pe))continue;let Ne=0;for(let Ae=0;Ae=1){const lt=pe[Ae-1];if(!VF(Ye,lt)){K.vertexLength+4>Wn.MAX_VERTEX_ARRAY_LENGTH&&(K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ke=Ye.sub(lt)._perp()._unit(),it=lt.dist(Ye);Ne+it>32768&&(Ne=0),bh(this.layoutVertexArray,Ye.x,Ye.y,Ke.x,Ke.y,0,0,Ne),bh(this.layoutVertexArray,Ye.x,Ye.y,Ke.x,Ke.y,0,1,Ne),T.x+=2*Ye.x,T.y+=2*Ye.y,T.vertexCount+=2,Ne+=it,bh(this.layoutVertexArray,lt.x,lt.y,Ke.x,Ke.y,0,0,Ne),bh(this.layoutVertexArray,lt.x,lt.y,Ke.x,Ke.y,0,1,Ne),T.x+=2*lt.x,T.y+=2*lt.y,T.vertexCount+=2;const kt=K.vertexLength;this.indexArray.emplaceBack(kt,kt+2,kt+1),this.indexArray.emplaceBack(kt+1,kt+2,kt+3),K.vertexLength+=4,K.primitiveLength+=2}}}}if(K.vertexLength+F>Wn.MAX_VERTEX_ARRAY_LENGTH&&(K=this.segments.prepareSegment(F,this.layoutVertexArray,this.indexArray)),BF[a.type]!=="Polygon")continue;const Q=[],ne=[],ue=K.vertexLength;for(const pe of L)if(pe.length!==0){pe!==L[0]&&ne.push(Q.length/2);for(let Ne=0;Nefi)||u.y===a.y&&(u.y<0||u.y>fi)}function UF(u){return u.every(a=>a.x<0)||u.every(a=>a.x>fi)||u.every(a=>a.y<0)||u.every(a=>a.y>fi)}mn("FillExtrusionBucket",d_,{omit:["layers","features"]});var jF={paint:new Pi({"fill-extrusion-opacity":new xn(Fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new In(Fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new xn(Fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new xn(Fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Pl(Fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new In(Fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new In(Fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new xn(Fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function wh(u,a){return u.x*a.x+u.y*a.y}function f4(u,a){if(u.length===1){let d=0;const m=a[d++];let _;for(;!_||m.equals(_);)if(_=a[d++],!_)return 1/0;for(;dd.id),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(d=>{this.gradients[d.id]={}}),this.layoutVertexArray=new ir,this.layoutVertexArray2=new vr,this.indexArray=new Yi,this.programConfigurations=new Bu(a.layers,a.zoom),this.segments=new Wn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){this.hasPattern=s_("line",this.layers,d);const _=this.layers[0].layout.get("line-sort-key"),S=!_.isConstant(),T=[];for(const{feature:L,id:F,index:K,sourceLayerIndex:Q}of a){const ne=this.layers[0]._featureFilter.needGeometry,ue=Uu(L,ne);if(!this.layers[0]._featureFilter.filter(new Or(this.zoom),ue,m))continue;const he=S?_.evaluate(ue,{},m):void 0,pe={id:F,properties:L.properties,type:L.type,sourceLayerIndex:Q,index:K,geometry:ne?ue.geometry:Vu(L),patterns:{},sortKey:he};T.push(pe)}S&&T.sort((L,F)=>L.sortKey-F.sortKey);for(const L of T){const{geometry:F,index:K,sourceLayerIndex:Q}=L;if(this.hasPattern){const ne=l_("line",this.layers,L,this.zoom,d);this.patternFeatures.push(ne)}else this.addFeature(L,F,K,m,{});d.featureIndex.insert(a[K].feature,F,K,Q,this.index)}}update(a,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,d,this.stateDependentLayers,m)}addFeatures(a,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(a){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=a.createVertexBuffer(this.layoutVertexArray2,GF)),this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,HF),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(a){if(a.properties&&Object.prototype.hasOwnProperty.call(a.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(a.properties,"mapbox_clip_end"))return{start:+a.properties.mapbox_clip_start,end:+a.properties.mapbox_clip_end}}addFeature(a,d,m,_,S){const T=this.layers[0].layout,L=T.get("line-join").evaluate(a,{}),F=T.get("line-cap"),K=T.get("line-miter-limit"),Q=T.get("line-round-limit");this.lineClips=this.lineFeatureClips(a);for(const ne of d)this.addLine(ne,a,L,F,K,Q);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,m,S,_)}addLine(a,d,m,_,S,T){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ye=0;Ye=2&&a[F-1].equals(a[F-2]);)F--;let K=0;for(;K0;if(hn&&Ye>K){const Gt=ue.dist(he);if(Gt>2*Q){const an=ue.sub(ue.sub(he)._mult(Q/Gt)._round());this.updateDistance(he,an),this.addCurrentVertex(an,Ne,0,0,ne),he=an}}const on=he&&pe;let Qt=on?m:L?"butt":_;if(on&&Qt==="round"&&(ktS&&(Qt="bevel"),Qt==="bevel"&&(kt>2&&(Qt="flipbevel"),kt100)lt=Ae.mult(-1);else{const Gt=kt*Ne.add(Ae).mag()/Ne.sub(Ae).mag();lt._perp()._mult(Gt*(vn?-1:1))}this.addCurrentVertex(ue,lt,0,0,ne),this.addCurrentVertex(ue,lt.mult(-1),0,0,ne)}else if(Qt==="bevel"||Qt==="fakeround"){const Gt=-Math.sqrt(kt*kt-1),an=vn?Gt:0,tn=vn?0:Gt;if(he&&this.addCurrentVertex(ue,Ne,an,tn,ne),Qt==="fakeround"){const $t=Math.round(180*Tt/Math.PI/20);for(let Tn=1;Tn<$t;Tn++){let _n=Tn/$t;if(_n!==.5){const kr=_n-.5;_n+=_n*kr*(_n-1)*((1.0904+Ke*(Ke*(3.55645-1.43519*Ke)-3.2452))*kr*kr+(.848013+Ke*(.215638*Ke-1.06021)))}const jn=Ae.sub(Ne)._mult(_n)._add(Ne)._unit()._mult(vn?-1:1);this.addHalfVertex(ue,jn.x,jn.y,!1,vn,0,ne)}}pe&&this.addCurrentVertex(ue,Ae,-an,-tn,ne)}else if(Qt==="butt")this.addCurrentVertex(ue,lt,0,0,ne);else if(Qt==="square"){const Gt=he?1:-1;this.addCurrentVertex(ue,lt,Gt,Gt,ne)}else Qt==="round"&&(he&&(this.addCurrentVertex(ue,Ne,0,0,ne),this.addCurrentVertex(ue,Ne,1,1,ne,!0)),pe&&(this.addCurrentVertex(ue,Ae,-1,-1,ne,!0),this.addCurrentVertex(ue,Ae,0,0,ne)));if(hn&&Ye2*Q){const an=ue.add(pe.sub(ue)._mult(Q/Gt)._round());this.updateDistance(ue,an),this.addCurrentVertex(an,Ae,0,0,ne),ue=an}}}}addCurrentVertex(a,d,m,_,S,T=!1){const L=d.y*_-d.x,F=-d.y-d.x*_;this.addHalfVertex(a,d.x+d.y*m,d.y-d.x*m,T,!1,m,S),this.addHalfVertex(a,L,F,T,!0,-_,S),this.distance>h4/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(a,d,m,_,S,T))}addHalfVertex({x:a,y:d},m,_,S,T,L,F){const K=.5*(this.lineClips?this.scaledDistance*(h4-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((a<<1)+(S?1:0),(d<<1)+(T?1:0),Math.round(63*m)+128,Math.round(63*_)+128,1+(L===0?0:L<0?-1:1)|(63&K)<<2,K>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Q=F.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Q),F.primitiveLength++),T?this.e2=Q:this.e1=Q}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(a,d){this.distance+=a.dist(d),this.updateScaledDistance()}}mn("LineBucket",f_,{omit:["layers","patternFeatures"]});const XF=new Pi({"line-cap":new xn(Fe.layout_line["line-cap"]),"line-join":new In(Fe.layout_line["line-join"]),"line-miter-limit":new xn(Fe.layout_line["line-miter-limit"]),"line-round-limit":new xn(Fe.layout_line["line-round-limit"]),"line-sort-key":new In(Fe.layout_line["line-sort-key"])});var p4={paint:new Pi({"line-opacity":new In(Fe.paint_line["line-opacity"]),"line-color":new In(Fe.paint_line["line-color"]),"line-translate":new xn(Fe.paint_line["line-translate"]),"line-translate-anchor":new xn(Fe.paint_line["line-translate-anchor"]),"line-width":new In(Fe.paint_line["line-width"]),"line-gap-width":new In(Fe.paint_line["line-gap-width"]),"line-offset":new In(Fe.paint_line["line-offset"]),"line-blur":new In(Fe.paint_line["line-blur"]),"line-dasharray":new uh(Fe.paint_line["line-dasharray"]),"line-pattern":new Pl(Fe.paint_line["line-pattern"]),"line-gradient":new es(Fe.paint_line["line-gradient"])}),layout:XF};const m4=new class extends In{possiblyEvaluate(u,a){return a=new Or(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),super.possiblyEvaluate(u,a)}evaluate(u,a,d,m){return a=k({},a,{zoom:Math.floor(a.zoom)}),super.evaluate(u,a,d,m)}}(p4.paint.properties["line-width"].specification);function v4(u,a){return a>0?a+2*u:u}m4.useIntegerZoom=!0;const YF=ni([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),QF=ni([{name:"a_projected_pos",components:3,type:"Float32"}],4);ni([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const JF=ni([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);ni([{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 g4=ni([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),e$=ni([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function t$(u,a,d){return u.sections.forEach(m=>{m.text=function(_,S,T){const L=S.layout.get("text-transform").evaluate(T,{});return L==="uppercase"?_=_.toLocaleUpperCase():L==="lowercase"&&(_=_.toLocaleLowerCase()),ko.applyArabicShaping&&(_=ko.applyArabicShaping(_)),_}(m.text,a,d)}),u}ni([{name:"triangle",components:3,type:"Uint16"}]),ni([{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"}]),ni([{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"}]),ni([{type:"Float32",name:"offsetX"}]),ni([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const Ch={"!":"\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 Ti=24,h_=_r,y4=function(u,a,d,m,_){var S,T,L=8*_-m-1,F=(1<>1,Q=-7,ne=d?_-1:0,ue=d?-1:1,he=u[a+ne];for(ne+=ue,S=he&(1<<-Q)-1,he>>=-Q,Q+=L;Q>0;S=256*S+u[a+ne],ne+=ue,Q-=8);for(T=S&(1<<-Q)-1,S>>=-Q,Q+=m;Q>0;T=256*T+u[a+ne],ne+=ue,Q-=8);if(S===0)S=1-K;else{if(S===F)return T?NaN:1/0*(he?-1:1);T+=Math.pow(2,m),S-=K}return(he?-1:1)*T*Math.pow(2,S-m)},x4=function(u,a,d,m,_,S){var T,L,F,K=8*S-_-1,Q=(1<>1,ue=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,he=m?0:S-1,pe=m?1:-1,Ne=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(L=isNaN(a)?1:0,T=Q):(T=Math.floor(Math.log(a)/Math.LN2),a*(F=Math.pow(2,-T))<1&&(T--,F*=2),(a+=T+ne>=1?ue/F:ue*Math.pow(2,1-ne))*F>=2&&(T++,F/=2),T+ne>=Q?(L=0,T=Q):T+ne>=1?(L=(a*F-1)*Math.pow(2,_),T+=ne):(L=a*Math.pow(2,ne-1)*Math.pow(2,_),T=0));_>=8;u[d+he]=255&L,he+=pe,L/=256,_-=8);for(T=T<<_|L,K+=_;K>0;u[d+he]=255&T,he+=pe,T/=256,K-=8);u[d+he-pe]|=128*Ne};function _r(u){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(u)?u:new Uint8Array(u||0),this.pos=0,this.type=0,this.length=this.buf.length}_r.Varint=0,_r.Fixed64=1,_r.Bytes=2,_r.Fixed32=5;var Rl,p_=4294967296,_4=1/p_,b4=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Os(u){return u.type===_r.Bytes?u.readVarint()+u.pos:u.pos+1}function ld(u,a,d){return d?4294967296*a+(u>>>0):4294967296*(a>>>0)+(u>>>0)}function w4(u,a,d){var m=a<=16383?1:a<=2097151?2:a<=268435455?3:Math.floor(Math.log(a)/(7*Math.LN2));d.realloc(m);for(var _=d.pos-1;_>=u;_--)d.buf[_+m]=d.buf[_]}function n$(u,a){for(var d=0;d>>8,u[d+2]=a>>>16,u[d+3]=a>>>24}function C4(u,a){return(u[a]|u[a+1]<<8|u[a+2]<<16)+(u[a+3]<<24)}function d$(u,a,d){u===1&&d.readMessage(f$,a)}function f$(u,a,d){if(u===3){const{id:m,bitmap:_,width:S,height:T,left:L,top:F,advance:K}=d.readMessage(h$,{});a.push({id:m,bitmap:new vh({width:S+6,height:T+6},_),metrics:{width:S,height:T,left:L,top:F,advance:K}})}}function h$(u,a,d){u===1?a.id=d.readVarint():u===2?a.bitmap=d.readBytes():u===3?a.width=d.readVarint():u===4?a.height=d.readVarint():u===5?a.left=d.readSVarint():u===6?a.top=d.readSVarint():u===7&&(a.advance=d.readVarint())}function S4(u){let a=0,d=0;for(const T of u)a+=T.w*T.h,d=Math.max(d,T.w);u.sort((T,L)=>L.h-T.h);const m=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(a/.95)),d),h:1/0}];let _=0,S=0;for(const T of u)for(let L=m.length-1;L>=0;L--){const F=m[L];if(!(T.w>F.w||T.h>F.h)){if(T.x=F.x,T.y=F.y,S=Math.max(S,T.y+T.h),_=Math.max(_,T.x+T.w),T.w===F.w&&T.h===F.h){const K=m.pop();L>3,S=this.pos;this.type=7&m,u(_,a,this),this.pos===S&&this.skip(m)}return a},readMessage:function(u,a){return this.readFields(u,a,this.readVarint()+this.pos)},readFixed32:function(){var u=Ev(this.buf,this.pos);return this.pos+=4,u},readSFixed32:function(){var u=C4(this.buf,this.pos);return this.pos+=4,u},readFixed64:function(){var u=Ev(this.buf,this.pos)+Ev(this.buf,this.pos+4)*p_;return this.pos+=8,u},readSFixed64:function(){var u=Ev(this.buf,this.pos)+C4(this.buf,this.pos+4)*p_;return this.pos+=8,u},readFloat:function(){var u=y4(this.buf,this.pos,!0,23,4);return this.pos+=4,u},readDouble:function(){var u=y4(this.buf,this.pos,!0,52,8);return this.pos+=8,u},readVarint:function(u){var a,d,m=this.buf;return a=127&(d=m[this.pos++]),d<128?a:(a|=(127&(d=m[this.pos++]))<<7,d<128?a:(a|=(127&(d=m[this.pos++]))<<14,d<128?a:(a|=(127&(d=m[this.pos++]))<<21,d<128?a:function(_,S,T){var L,F,K=T.buf;if(L=(112&(F=K[T.pos++]))>>4,F<128||(L|=(127&(F=K[T.pos++]))<<3,F<128)||(L|=(127&(F=K[T.pos++]))<<10,F<128)||(L|=(127&(F=K[T.pos++]))<<17,F<128)||(L|=(127&(F=K[T.pos++]))<<24,F<128)||(L|=(1&(F=K[T.pos++]))<<31,F<128))return ld(_,L,S);throw new Error("Expected varint not more than 10 bytes")}(a|=(15&(d=m[this.pos]))<<28,u,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var u=this.readVarint();return u%2==1?(u+1)/-2:u/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var u=this.readVarint()+this.pos,a=this.pos;return this.pos=u,u-a>=12&&b4?function(d,m,_){return b4.decode(d.subarray(m,_))}(this.buf,a,u):function(d,m,_){for(var S="",T=m;T<_;){var L,F,K,Q=d[T],ne=null,ue=Q>239?4:Q>223?3:Q>191?2:1;if(T+ue>_)break;ue===1?Q<128&&(ne=Q):ue===2?(192&(L=d[T+1]))==128&&(ne=(31&Q)<<6|63&L)<=127&&(ne=null):ue===3?(F=d[T+2],(192&(L=d[T+1]))==128&&(192&F)==128&&((ne=(15&Q)<<12|(63&L)<<6|63&F)<=2047||ne>=55296&&ne<=57343)&&(ne=null)):ue===4&&(F=d[T+2],K=d[T+3],(192&(L=d[T+1]))==128&&(192&F)==128&&(192&K)==128&&((ne=(15&Q)<<18|(63&L)<<12|(63&F)<<6|63&K)<=65535||ne>=1114112)&&(ne=null)),ne===null?(ne=65533,ue=1):ne>65535&&(ne-=65536,S+=String.fromCharCode(ne>>>10&1023|55296),ne=56320|1023&ne),S+=String.fromCharCode(ne),T+=ue}return S}(this.buf,a,u)},readBytes:function(){var u=this.readVarint()+this.pos,a=this.buf.subarray(this.pos,u);return this.pos=u,a},readPackedVarint:function(u,a){if(this.type!==_r.Bytes)return u.push(this.readVarint(a));var d=Os(this);for(u=u||[];this.pos127;);else if(a===_r.Bytes)this.pos=this.readVarint()+this.pos;else if(a===_r.Fixed32)this.pos+=4;else{if(a!==_r.Fixed64)throw new Error("Unimplemented type: "+a);this.pos+=8}},writeTag:function(u,a){this.writeVarint(u<<3|a)},realloc:function(u){for(var a=this.length||16;a268435455||u<0?function(a,d){var m,_;if(a>=0?(m=a%4294967296|0,_=a/4294967296|0):(_=~(-a/4294967296),4294967295^(m=~(-a%4294967296))?m=m+1|0:(m=0,_=_+1|0)),a>=18446744073709552e3||a<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");d.realloc(10),function(S,T,L){L.buf[L.pos++]=127&S|128,S>>>=7,L.buf[L.pos++]=127&S|128,S>>>=7,L.buf[L.pos++]=127&S|128,S>>>=7,L.buf[L.pos++]=127&S|128,L.buf[L.pos]=127&(S>>>=7)}(m,0,d),function(S,T){var L=(7&S)<<4;T.buf[T.pos++]|=L|((S>>>=3)?128:0),S&&(T.buf[T.pos++]=127&S|((S>>>=7)?128:0),S&&(T.buf[T.pos++]=127&S|((S>>>=7)?128:0),S&&(T.buf[T.pos++]=127&S|((S>>>=7)?128:0),S&&(T.buf[T.pos++]=127&S|((S>>>=7)?128:0),S&&(T.buf[T.pos++]=127&S)))))}(_,d)}(u,this):(this.realloc(4),this.buf[this.pos++]=127&u|(u>127?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(u>127?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(u>127?128:0),u<=127||(this.buf[this.pos++]=u>>>7&127))))},writeSVarint:function(u){this.writeVarint(u<0?2*-u-1:2*u)},writeBoolean:function(u){this.writeVarint(Boolean(u))},writeString:function(u){u=String(u),this.realloc(4*u.length),this.pos++;var a=this.pos;this.pos=function(m,_,S){for(var T,L,F=0;F<_.length;F++){if((T=_.charCodeAt(F))>55295&&T<57344){if(!L){T>56319||F+1===_.length?(m[S++]=239,m[S++]=191,m[S++]=189):L=T;continue}if(T<56320){m[S++]=239,m[S++]=191,m[S++]=189,L=T;continue}T=L-55296<<10|T-56320|65536,L=null}else L&&(m[S++]=239,m[S++]=191,m[S++]=189,L=null);T<128?m[S++]=T:(T<2048?m[S++]=T>>6|192:(T<65536?m[S++]=T>>12|224:(m[S++]=T>>18|240,m[S++]=T>>12&63|128),m[S++]=T>>6&63|128),m[S++]=63&T|128)}return S}(this.buf,u,this.pos);var d=this.pos-a;d>=128&&w4(a,d,this),this.pos=a-1,this.writeVarint(d),this.pos+=d},writeFloat:function(u){this.realloc(4),x4(this.buf,u,this.pos,!0,23,4),this.pos+=4},writeDouble:function(u){this.realloc(8),x4(this.buf,u,this.pos,!0,52,8),this.pos+=8},writeBytes:function(u){var a=u.length;this.writeVarint(a),this.realloc(a);for(var d=0;d=128&&w4(d,m,this),this.pos=d-1,this.writeVarint(m),this.pos+=m},writeMessage:function(u,a,d){this.writeTag(u,_r.Bytes),this.writeRawMessage(a,d)},writePackedVarint:function(u,a){a.length&&this.writeMessage(u,n$,a)},writePackedSVarint:function(u,a){a.length&&this.writeMessage(u,r$,a)},writePackedBoolean:function(u,a){a.length&&this.writeMessage(u,a$,a)},writePackedFloat:function(u,a){a.length&&this.writeMessage(u,i$,a)},writePackedDouble:function(u,a){a.length&&this.writeMessage(u,o$,a)},writePackedFixed32:function(u,a){a.length&&this.writeMessage(u,s$,a)},writePackedSFixed32:function(u,a){a.length&&this.writeMessage(u,l$,a)},writePackedFixed64:function(u,a){a.length&&this.writeMessage(u,u$,a)},writePackedSFixed64:function(u,a){a.length&&this.writeMessage(u,c$,a)},writeBytesField:function(u,a){this.writeTag(u,_r.Bytes),this.writeBytes(a)},writeFixed32Field:function(u,a){this.writeTag(u,_r.Fixed32),this.writeFixed32(a)},writeSFixed32Field:function(u,a){this.writeTag(u,_r.Fixed32),this.writeSFixed32(a)},writeFixed64Field:function(u,a){this.writeTag(u,_r.Fixed64),this.writeFixed64(a)},writeSFixed64Field:function(u,a){this.writeTag(u,_r.Fixed64),this.writeSFixed64(a)},writeVarintField:function(u,a){this.writeTag(u,_r.Varint),this.writeVarint(a)},writeSVarintField:function(u,a){this.writeTag(u,_r.Varint),this.writeSVarint(a)},writeStringField:function(u,a){this.writeTag(u,_r.Bytes),this.writeString(a)},writeFloatField:function(u,a){this.writeTag(u,_r.Fixed32),this.writeFloat(a)},writeDoubleField:function(u,a){this.writeTag(u,_r.Fixed64),this.writeDouble(a)},writeBooleanField:function(u,a){this.writeVarintField(u,Boolean(a))}};class m_{constructor(a,{pixelRatio:d,version:m,stretchX:_,stretchY:S,content:T}){this.paddedRect=a,this.pixelRatio=d,this.stretchX=_,this.stretchY=S,this.content=T,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 E4{constructor(a,d){const m={},_={};this.haveRenderCallbacks=[];const S=[];this.addImages(a,m,S),this.addImages(d,_,S);const{w:T,h:L}=S4(S),F=new Uo({width:T||1,height:L||1});for(const K in a){const Q=a[K],ne=m[K].paddedRect;Uo.copy(Q.data,F,{x:0,y:0},{x:ne.x+1,y:ne.y+1},Q.data)}for(const K in d){const Q=d[K],ne=_[K].paddedRect,ue=ne.x+1,he=ne.y+1,pe=Q.data.width,Ne=Q.data.height;Uo.copy(Q.data,F,{x:0,y:0},{x:ue,y:he},Q.data),Uo.copy(Q.data,F,{x:0,y:Ne-1},{x:ue,y:he-1},{width:pe,height:1}),Uo.copy(Q.data,F,{x:0,y:0},{x:ue,y:he+Ne},{width:pe,height:1}),Uo.copy(Q.data,F,{x:pe-1,y:0},{x:ue-1,y:he},{width:1,height:Ne}),Uo.copy(Q.data,F,{x:0,y:0},{x:ue+pe,y:he},{width:1,height:Ne})}this.image=F,this.iconPositions=m,this.patternPositions=_}addImages(a,d,m){for(const _ in a){const S=a[_],T={x:0,y:0,w:S.data.width+2,h:S.data.height+2};m.push(T),d[_]=new m_(T,S),S.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(a,d){a.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const m in a.updatedImages)this.patchUpdatedImage(this.iconPositions[m],a.getImage(m),d),this.patchUpdatedImage(this.patternPositions[m],a.getImage(m),d)}patchUpdatedImage(a,d,m){if(!a||!d||a.version===d.version)return;a.version=d.version;const[_,S]=a.tl;m.update(d.data,void 0,{x:_,y:S})}}mn("ImagePosition",m_),mn("ImageAtlas",E4),o.WritingMode=void 0,(Rl=o.WritingMode||(o.WritingMode={}))[Rl.none=0]="none",Rl[Rl.horizontal=1]="horizontal",Rl[Rl.vertical=2]="vertical",Rl[Rl.horizontalOnly=3]="horizontalOnly";const Pv=-17;class Sh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(a,d){const m=new Sh;return m.scale=a||1,m.fontStack=d,m}static forImage(a){const d=new Sh;return d.imageName=a,d}}class cd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(a,d){const m=new cd;for(let _=0;_=0&&m>=a&&kv[this.text.charCodeAt(m)];m--)d--;this.text=this.text.substring(a,d),this.sectionIndex=this.sectionIndex.slice(a,d)}substring(a,d){const m=new cd;return m.text=this.text.substring(a,d),m.sectionIndex=this.sectionIndex.slice(a,d),m.sections=this.sections,m}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((a,d)=>Math.max(a,this.sections[d].scale),0)}addTextSection(a,d){this.text+=a.text,this.sections.push(Sh.forText(a.scale,a.fontStack||d));const m=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Tv(u,a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe,Ne){const Ae=cd.fromFeature(u,_);let Ye;ne===o.WritingMode.vertical&&Ae.verticalizePunctuation();const{processBidirectionalText:lt,processStyledBidirectionalText:Ke}=ko;if(lt&&Ae.sections.length===1){Ye=[];const Tt=lt(Ae.toString(),v_(Ae,K,S,a,m,he,pe));for(const hn of Tt){const vn=new cd;vn.text=hn,vn.sections=Ae.sections;for(let on=0;on0&&zs>po&&(po=zs)}else{const Ho=vn[qn.fontStack],mo=Ho&&Ho[Li];if(mo&&mo.rect)Aa=mo.rect,ua=mo.metrics;else{const zs=hn[qn.fontStack],Th=zs&&zs[Li];if(!Th)continue;ua=Th.metrics}Ki=(Di-qn.scale)*Ti}ca?(Tt.verticalizable=!0,ho.push({glyph:Li,imageName:Na,x:kr,y:Lr+Ki,vertical:ca,scale:qn.scale,fontStack:qn.fontStack,sectionIndex:Mo,metrics:ua,rect:Aa}),kr+=Ls*qn.scale+Tn):(ho.push({glyph:Li,imageName:Na,x:kr,y:Lr+Ki,vertical:ca,scale:qn.scale,fontStack:qn.fontStack,sectionIndex:Mo,metrics:ua,rect:Aa}),kr+=ua.advance*qn.scale+Tn)}ho.length!==0&&(hi=Math.max(kr-Tn,hi),v$(ho,0,ho.length-1,Ni,po)),kr=0;const Vr=Gt*Di+po;eo.lineOffset=Math.max(po,ji),Lr+=Vr,Ko=Math.max(Vr,Ko),++ri}var _i;const Oi=Lr-Pv,{horizontalAlign:Ui,verticalAlign:fo}=g_(an);(function(ii,Di,ji,eo,ho,po,Vr,bi,qn){const Mo=(Di-ji)*ho;let Li=0;Li=po!==Vr?-bi*eo-Pv:(-eo*qn+.5)*Vr;for(const Ki of ii)for(const ua of Ki.positionedGlyphs)ua.x+=Mo,ua.y+=Li})(Tt.positionedLines,Ni,Ui,fo,hi,Ko,Gt,Oi,Qt.length),Tt.top+=-fo*Oi,Tt.bottom=Tt.top+Oi,Tt.left+=-Ui*hi,Tt.right=Tt.left+hi}(kt,a,d,m,Ye,T,L,F,ne,K,ue,Ne),!function(Tt){for(const hn of Tt)if(hn.positionedGlyphs.length!==0)return!1;return!0}(it)&&kt}const kv={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},p$={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 P4(u,a,d,m,_,S){if(a.imageName){const T=m[a.imageName];return T?T.displaySize[0]*a.scale*Ti/S+_:0}{const T=d[a.fontStack],L=T&&T[u];return L?L.metrics.advance*a.scale+_:0}}function T4(u,a,d,m){const _=Math.pow(u-a,2);return m?u=0;let Q=0;for(let ue=0;ue-d/2;){if(T--,T<0)return!1;L-=u[T].dist(S),S=u[T]}L+=u[T].dist(u[T+1]),T++;const F=[];let K=0;for(;Lm;)K-=F.shift().angleDelta;if(K>_)return!1;T++,L+=Q.dist(ne)}return!0}function N4(u){let a=0;for(let d=0;dK){const pe=(K-F)/he,Ne=xr(ne.x,ue.x,pe),Ae=xr(ne.y,ue.y,pe),Ye=new Ml(Ne,Ae,ue.angleTo(ne),Q);return Ye._round(),!T||A4(u,Ye,L,T,a)?Ye:void 0}F+=he}}function x$(u,a,d,m,_,S,T,L,F){const K=O4(m,S,T),Q=D4(m,_),ne=Q*T,ue=u[0].x===0||u[0].x===F||u[0].y===0||u[0].y===F;return a-ne=0&&it=0&&kt=0&&ue+K<=Q){const Tt=new Ml(it,kt,lt,pe);Tt._round(),m&&!A4(u,Tt,S,m,_)||he.push(Tt)}}ne+=Ye}return L||he.length||T||(he=L4(u,ne/2,d,m,_,S,T,!0,F)),he}function z4(u,a,d,m,_){const S=[];for(let T=0;T=m&&ne.x>=m||(Q.x>=m?Q=new ie(m,Q.y+(m-Q.x)/(ne.x-Q.x)*(ne.y-Q.y))._round():ne.x>=m&&(ne=new ie(m,Q.y+(m-Q.x)/(ne.x-Q.x)*(ne.y-Q.y))._round()),Q.y>=_&&ne.y>=_||(Q.y>=_?Q=new ie(Q.x+(_-Q.y)/(ne.y-Q.y)*(ne.x-Q.x),_)._round():ne.y>=_&&(ne=new ie(Q.x+(_-Q.y)/(ne.y-Q.y)*(ne.x-Q.x),_)._round()),F&&Q.equals(F[F.length-1])||(F=[Q],S.push(F)),F.push(ne)))))}}return S}function F4(u,a,d,m){const _=[],S=u.image,T=S.pixelRatio,L=S.paddedRect.w-2,F=S.paddedRect.h-2,K=u.right-u.left,Q=u.bottom-u.top,ne=S.stretchX||[[0,L]],ue=S.stretchY||[[0,F]],he=(Gt,an)=>Gt+an[1]-an[0],pe=ne.reduce(he,0),Ne=ue.reduce(he,0),Ae=L-pe,Ye=F-Ne;let lt=0,Ke=pe,it=0,kt=Ne,Tt=0,hn=Ae,vn=0,on=Ye;if(S.content&&m){const Gt=S.content;lt=Iv(ne,0,Gt[0]),it=Iv(ue,0,Gt[1]),Ke=Iv(ne,Gt[0],Gt[2]),kt=Iv(ue,Gt[1],Gt[3]),Tt=Gt[0]-lt,vn=Gt[1]-it,hn=Gt[2]-Gt[0]-Ke,on=Gt[3]-Gt[1]-kt}const Qt=(Gt,an,tn,$t)=>{const Tn=Rv(Gt.stretch-lt,Ke,K,u.left),_n=Mv(Gt.fixed-Tt,hn,Gt.stretch,pe),jn=Rv(an.stretch-it,kt,Q,u.top),kr=Mv(an.fixed-vn,on,an.stretch,Ne),Lr=Rv(tn.stretch-lt,Ke,K,u.left),hi=Mv(tn.fixed-Tt,hn,tn.stretch,pe),Ko=Rv($t.stretch-it,kt,Q,u.top),Ni=Mv($t.fixed-vn,on,$t.stretch,Ne),ri=new ie(Tn,jn),_i=new ie(Lr,jn),Oi=new ie(Lr,Ko),Ui=new ie(Tn,Ko),fo=new ie(_n/T,kr/T),ii=new ie(hi/T,Ni/T),Di=a*Math.PI/180;if(Di){const ho=Math.sin(Di),po=Math.cos(Di),Vr=[po,-ho,ho,po];ri._matMult(Vr),_i._matMult(Vr),Ui._matMult(Vr),Oi._matMult(Vr)}const ji=Gt.stretch+Gt.fixed,eo=an.stretch+an.fixed;return{tl:ri,tr:_i,bl:Ui,br:Oi,tex:{x:S.paddedRect.x+1+ji,y:S.paddedRect.y+1+eo,w:tn.stretch+tn.fixed-ji,h:$t.stretch+$t.fixed-eo},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:fo,pixelOffsetBR:ii,minFontScaleX:hn/T/K,minFontScaleY:on/T/Q,isSDF:d}};if(m&&(S.stretchX||S.stretchY)){const Gt=$4(ne,Ae,pe),an=$4(ue,Ye,Ne);for(let tn=0;tn0&&(pe=Math.max(10,pe),this.circleDiameter=pe)}else{let ne=T.top*L-F[0],ue=T.bottom*L+F[2],he=T.left*L-F[3],pe=T.right*L+F[1];const Ne=T.collisionPadding;if(Ne&&(he-=Ne[0]*L,ne-=Ne[1]*L,pe+=Ne[2]*L,ue+=Ne[3]*L),Q){const Ae=new ie(he,ne),Ye=new ie(pe,ne),lt=new ie(he,ue),Ke=new ie(pe,ue),it=Q*Math.PI/180;Ae._rotate(it),Ye._rotate(it),lt._rotate(it),Ke._rotate(it),he=Math.min(Ae.x,Ye.x,lt.x,Ke.x),pe=Math.max(Ae.x,Ye.x,lt.x,Ke.x),ne=Math.min(Ae.y,Ye.y,lt.y,Ke.y),ue=Math.max(Ae.y,Ye.y,lt.y,Ke.y)}a.emplaceBack(d.x,d.y,he,ne,pe,ue,m,_,S)}this.boxEndIndex=a.length}}class _${constructor(a=[],d=b$){if(this.data=a,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(a){this.data.push(a),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const a=this.data[0],d=this.data.pop();return this.length--,this.length>0&&(this.data[0]=d,this._down(0)),a}peek(){return this.data[0]}_up(a){const{data:d,compare:m}=this,_=d[a];for(;a>0;){const S=a-1>>1,T=d[S];if(m(_,T)>=0)break;d[a]=T,a=S}d[a]=_}_down(a){const{data:d,compare:m}=this,_=this.length>>1,S=d[a];for(;a<_;){let T=1+(a<<1),L=d[T];const F=T+1;if(F=0)break;d[a]=L,a=T}d[a]=S}}function b$(u,a){return ua?1:0}function w$(u,a=1,d=!1){let m=1/0,_=1/0,S=-1/0,T=-1/0;const L=u[0];for(let he=0;heS)&&(S=pe.x),(!he||pe.y>T)&&(T=pe.y)}const F=Math.min(S-m,T-_);let K=F/2;const Q=new _$([],C$);if(F===0)return new ie(m,_);for(let he=m;hene.d||!ne.d)&&(ne=he,d&&console.log("found best %d after %d probes",Math.round(1e4*he.d)/1e4,ue)),he.max-ne.d<=a||(K=he.h/2,Q.push(new dd(he.p.x-K,he.p.y-K,K,u)),Q.push(new dd(he.p.x+K,he.p.y-K,K,u)),Q.push(new dd(he.p.x-K,he.p.y+K,K,u)),Q.push(new dd(he.p.x+K,he.p.y+K,K,u)),ue+=4)}return d&&(console.log(`num probes: ${ue}`),console.log(`best distance: ${ne.d}`)),ne.p}function C$(u,a){return a.max-u.max}function dd(u,a,d,m){this.p=new ie(u,a),this.h=d,this.d=function(_,S){let T=!1,L=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&&(T=!T),L=Math.min(L,GE(_,he,pe))}}return(T?1:-1)*Math.sqrt(L)}(this.p,m),this.max=this.d+this.h*Math.SQRT2}const y_=Number.POSITIVE_INFINITY;function B4(u,a){return a[1]!==y_?function(d,m,_){let S=0,T=0;switch(m=Math.abs(m),_=Math.abs(_),d){case"top-right":case"top-left":case"top":T=_-7;break;case"bottom-right":case"bottom-left":case"bottom":T=7-_}switch(d){case"top-right":case"bottom-right":case"right":S=-m;break;case"top-left":case"bottom-left":case"left":S=m}return[S,T]}(u,a[0],a[1]):function(d,m){let _=0,S=0;m<0&&(m=0);const T=m/Math.sqrt(2);switch(d){case"top-right":case"top-left":S=T-7;break;case"bottom-right":case"bottom-left":S=7-T;break;case"bottom":S=7-m;break;case"top":S=m-7}switch(d){case"top-right":case"bottom-right":_=-T;break;case"top-left":case"bottom-left":_=T;break;case"left":_=m;break;case"right":_=-m}return[_,S]}(u,a[0])}function x_(u){switch(u){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function S$(u,a,d,m,_,S,T,L,F,K,Q){let ne=S.textMaxSize.evaluate(a,{});ne===void 0&&(ne=T);const ue=u.layers[0].layout,he=ue.get("icon-offset").evaluate(a,{},Q),pe=U4(d.horizontal),Ne=T/24,Ae=u.tilePixelRatio*Ne,Ye=u.tilePixelRatio*ne/24,lt=u.tilePixelRatio*L,Ke=u.tilePixelRatio*ue.get("symbol-spacing"),it=ue.get("text-padding")*u.tilePixelRatio,kt=function($t,Tn,_n,jn=1){const kr=$t.get("icon-padding").evaluate(Tn,{},_n),Lr=kr&&kr.values;return[Lr[0]*jn,Lr[1]*jn,Lr[2]*jn,Lr[3]*jn]}(ue,a,Q,u.tilePixelRatio),Tt=ue.get("text-max-angle")/180*Math.PI,hn=ue.get("text-rotation-alignment")!=="viewport"&&ue.get("symbol-placement")!=="point",vn=ue.get("icon-rotation-alignment")==="map"&&ue.get("symbol-placement")!=="point",on=ue.get("symbol-placement"),Qt=Ke/2,Gt=ue.get("icon-text-fit");let an;m&&Gt!=="none"&&(u.allowVerticalPlacement&&d.vertical&&(an=R4(m,d.vertical,Gt,ue.get("icon-text-fit-padding"),he,Ne)),pe&&(m=R4(m,pe,Gt,ue.get("icon-text-fit-padding"),he,Ne)));const tn=($t,Tn)=>{Tn.x<0||Tn.x>=fi||Tn.y<0||Tn.y>=fi||function(_n,jn,kr,Lr,hi,Ko,Ni,ri,_i,Oi,Ui,fo,ii,Di,ji,eo,ho,po,Vr,bi,qn,Mo,Li,Ki,ua){const Aa=_n.addToLineVertexArray(jn,kr);let Na,Ls,ca,Ho,mo=0,zs=0,Th=0,iP=0,I_=-1,R_=-1;const Fs={};let oP=xi.exports(""),M_=0,A_=0;if(ri._unevaluatedLayout.getValue("text-radial-offset")===void 0?[M_,A_]=ri.layout.get("text-offset").evaluate(qn,{},Ki).map(vo=>vo*Ti):(M_=ri.layout.get("text-radial-offset").evaluate(qn,{},Ki)*Ti,A_=y_),_n.allowVerticalPlacement&&Lr.vertical){const vo=ri.layout.get("text-rotate").evaluate(qn,{},Ki)+90;ca=new Av(_i,jn,Oi,Ui,fo,Lr.vertical,ii,Di,ji,vo),Ni&&(Ho=new Av(_i,jn,Oi,Ui,fo,Ni,ho,po,ji,vo))}if(hi){const vo=ri.layout.get("icon-rotate").evaluate(qn,{}),os=ri.layout.get("icon-text-fit")!=="none",kh=F4(hi,vo,Li,os),Ih=Ni?F4(Ni,vo,Li,os):void 0;Ls=new Av(_i,jn,Oi,Ui,fo,hi,ho,po,!1,vo),mo=4*kh.length;const lP=_n.iconSizeData;let Hu=null;lP.kind==="source"?(Hu=[Ds*ri.layout.get("icon-size").evaluate(qn,{})],Hu[0]>Al&&B(`${_n.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):lP.kind==="composite"&&(Hu=[Ds*Mo.compositeIconSizes[0].evaluate(qn,{},Ki),Ds*Mo.compositeIconSizes[1].evaluate(qn,{},Ki)],(Hu[0]>Al||Hu[1]>Al)&&B(`${_n.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),_n.addSymbols(_n.icon,kh,Hu,bi,Vr,qn,o.WritingMode.none,jn,Aa.lineStartIndex,Aa.lineLength,-1,Ki),I_=_n.icon.placedSymbolArray.length-1,Ih&&(zs=4*Ih.length,_n.addSymbols(_n.icon,Ih,Hu,bi,Vr,qn,o.WritingMode.vertical,jn,Aa.lineStartIndex,Aa.lineLength,-1,Ki),R_=_n.icon.placedSymbolArray.length-1)}const aP=Object.keys(Lr.horizontal);for(const vo of aP){const os=Lr.horizontal[vo];if(!Na){oP=xi.exports(os.text);const Ih=ri.layout.get("text-rotate").evaluate(qn,{},Ki);Na=new Av(_i,jn,Oi,Ui,fo,os,ii,Di,ji,Ih)}const kh=os.positionedLines.length===1;if(Th+=V4(_n,jn,os,Ko,ri,ji,qn,eo,Aa,Lr.vertical?o.WritingMode.horizontal:o.WritingMode.horizontalOnly,kh?aP:[vo],Fs,I_,Mo,Ki),kh)break}Lr.vertical&&(iP+=V4(_n,jn,Lr.vertical,Ko,ri,ji,qn,eo,Aa,o.WritingMode.vertical,["vertical"],Fs,R_,Mo,Ki));const z$=Na?Na.boxStartIndex:_n.collisionBoxArray.length,F$=Na?Na.boxEndIndex:_n.collisionBoxArray.length,$$=ca?ca.boxStartIndex:_n.collisionBoxArray.length,B$=ca?ca.boxEndIndex:_n.collisionBoxArray.length,V$=Ls?Ls.boxStartIndex:_n.collisionBoxArray.length,U$=Ls?Ls.boxEndIndex:_n.collisionBoxArray.length,j$=Ho?Ho.boxStartIndex:_n.collisionBoxArray.length,K$=Ho?Ho.boxEndIndex:_n.collisionBoxArray.length;let Oa=-1;const zv=(vo,os)=>vo&&vo.circleDiameter?Math.max(vo.circleDiameter,os):os;Oa=zv(Na,Oa),Oa=zv(ca,Oa),Oa=zv(Ls,Oa),Oa=zv(Ho,Oa);const sP=Oa>-1?1:0;sP&&(Oa*=ua/Ti),_n.glyphOffsetArray.length>=fd.MAX_GLYPHS&&B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),qn.sortKey!==void 0&&_n.addToSortKeyRanges(_n.symbolInstances.length,qn.sortKey),_n.symbolInstances.emplaceBack(jn.x,jn.y,Fs.right>=0?Fs.right:-1,Fs.center>=0?Fs.center:-1,Fs.left>=0?Fs.left:-1,Fs.vertical||-1,I_,R_,oP,z$,F$,$$,B$,V$,U$,j$,K$,Oi,Th,iP,mo,zs,sP,0,ii,M_,A_,Oa)}(u,Tn,$t,d,m,_,an,u.layers[0],u.collisionBoxArray,a.index,a.sourceLayerIndex,u.index,Ae,[it,it,it,it],hn,F,lt,kt,vn,he,a,S,K,Q,T)};if(on==="line")for(const $t of z4(a.geometry,0,0,fi,fi)){const Tn=x$($t,Ke,Tt,d.vertical||pe,m,24,Ye,u.overscaling,fi);for(const _n of Tn){const jn=pe;jn&&E$(u,jn.text,Qt,_n)||tn($t,_n)}}else if(on==="line-center"){for(const $t of a.geometry)if($t.length>1){const Tn=y$($t,Tt,d.vertical||pe,m,24,Ye);Tn&&tn($t,Tn)}}else if(a.type==="Polygon")for(const $t of a_(a.geometry,0)){const Tn=w$($t,16);tn($t[0],new Ml(Tn.x,Tn.y,0))}else if(a.type==="LineString")for(const $t of a.geometry)tn($t,new Ml($t[0].x,$t[0].y,0));else if(a.type==="Point")for(const $t of a.geometry)for(const Tn of $t)tn([Tn],new Ml(Tn.x,Tn.y,0))}const Al=32640;function V4(u,a,d,m,_,S,T,L,F,K,Q,ne,ue,he,pe){const Ne=function(lt,Ke,it,kt,Tt,hn,vn,on){const Qt=kt.layout.get("text-rotate").evaluate(hn,{})*Math.PI/180,Gt=[];for(const an of Ke.positionedLines)for(const tn of an.positionedGlyphs){if(!tn.rect)continue;const $t=tn.rect||{};let Tn=4,_n=!0,jn=1,kr=0;const Lr=(Tt||on)&&tn.vertical,hi=tn.metrics.advance*tn.scale/2;if(on&&Ke.verticalizable){const Vr=(tn.scale-1)*Ti,bi=(Ti-tn.metrics.width*tn.scale)/2;kr=an.lineOffset/2-(tn.imageName?-bi:Vr)}if(tn.imageName){const Vr=vn[tn.imageName];_n=Vr.sdf,jn=Vr.pixelRatio,Tn=1/jn}const Ko=Tt?[tn.x+hi,tn.y]:[0,0];let Ni=Tt?[0,0]:[tn.x+hi+it[0],tn.y+it[1]-kr],ri=[0,0];Lr&&(ri=Ni,Ni=[0,0]);const _i=(tn.metrics.left-Tn)*tn.scale-hi+Ni[0],Oi=(-tn.metrics.top-Tn)*tn.scale+Ni[1],Ui=_i+$t.w*tn.scale/jn,fo=Oi+$t.h*tn.scale/jn,ii=new ie(_i,Oi),Di=new ie(Ui,Oi),ji=new ie(_i,fo),eo=new ie(Ui,fo);if(Lr){const Vr=new ie(-hi,hi-Pv),bi=-Math.PI/2,qn=12-hi,Mo=new ie(22-qn,-(tn.imageName?qn:0)),Li=new ie(...ri);ii._rotateAround(bi,Vr)._add(Mo)._add(Li),Di._rotateAround(bi,Vr)._add(Mo)._add(Li),ji._rotateAround(bi,Vr)._add(Mo)._add(Li),eo._rotateAround(bi,Vr)._add(Mo)._add(Li)}if(Qt){const Vr=Math.sin(Qt),bi=Math.cos(Qt),qn=[bi,-Vr,Vr,bi];ii._matMult(qn),Di._matMult(qn),ji._matMult(qn),eo._matMult(qn)}const ho=new ie(0,0),po=new ie(0,0);Gt.push({tl:ii,tr:Di,bl:ji,br:eo,tex:$t,writingMode:Ke.writingMode,glyphOffset:Ko,sectionIndex:tn.sectionIndex,isSDF:_n,pixelOffsetTL:ho,pixelOffsetBR:po,minFontScaleX:0,minFontScaleY:0})}return Gt}(0,d,L,_,S,T,m,u.allowVerticalPlacement),Ae=u.textSizeData;let Ye=null;Ae.kind==="source"?(Ye=[Ds*_.layout.get("text-size").evaluate(T,{})],Ye[0]>Al&&B(`${u.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):Ae.kind==="composite"&&(Ye=[Ds*he.compositeTextSizes[0].evaluate(T,{},pe),Ds*he.compositeTextSizes[1].evaluate(T,{},pe)],(Ye[0]>Al||Ye[1]>Al)&&B(`${u.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),u.addSymbols(u.text,Ne,Ye,L,S,T,K,a,F.lineStartIndex,F.lineLength,ue,pe);for(const lt of Q)ne[lt]=u.text.placedSymbolArray.length-1;return 4*Ne.length}function U4(u){for(const a in u)return u[a];return null}function E$(u,a,d,m){const _=u.compareText;if(a in _){const S=_[a];for(let T=S.length-1;T>=0;T--)if(m.dist(S[T])T.id),this.index=a.index,this.pixelRatio=a.pixelRatio,this.sourceLayerIndex=a.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=e_([]),this.placementViewportMatrix=e_([]);const d=this.layers[0]._unevaluatedLayout._values;this.textSizeData=M4(this.zoom,d["text-size"]),this.iconSizeData=M4(this.zoom,d["icon-size"]);const m=this.layers[0].layout,_=m.get("symbol-sort-key"),S=m.get("symbol-z-order");this.canOverlap=S_(m,"text-overlap","text-allow-overlap")!=="never"||S_(m,"icon-overlap","icon-allow-overlap")!=="never"||m.get("text-ignore-placement")||m.get("icon-ignore-placement"),this.sortFeaturesByKey=S!=="viewport-y"&&!_.isConstant(),this.sortFeaturesByY=(S==="viewport-y"||S==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,m.get("symbol-placement")==="point"&&(this.writingModes=m.get("text-writing-mode").map(T=>o.WritingMode[T])),this.stateDependentLayerIds=this.layers.filter(T=>T.isStateDependent()).map(T=>T.id),this.sourceID=a.sourceID}createArrays(){this.text=new b_(new Bu(this.layers,this.zoom,a=>/^text/.test(a))),this.icon=new b_(new Bu(this.layers,this.zoom,a=>/^icon/.test(a))),this.glyphOffsetArray=new Yt,this.lineVertexArray=new fn,this.symbolInstances=new sn}calculateGlyphDependencies(a,d,m,_,S){for(let T=0;T0)&&(T.value.kind!=="constant"||T.value.value.length>0),Q=F.value.kind!=="constant"||!!F.value.value||Object.keys(F.parameters).length>0,ne=S.get("symbol-sort-key");if(this.features=[],!K&&!Q)return;const ue=d.iconDependencies,he=d.glyphDependencies,pe=d.availableImages,Ne=new Or(this.zoom);for(const{feature:Ae,id:Ye,index:lt,sourceLayerIndex:Ke}of a){const it=_._featureFilter.needGeometry,kt=Uu(Ae,it);if(!_._featureFilter.filter(Ne,kt,m))continue;let Tt,hn;if(it||(kt.geometry=Vu(Ae)),K){const on=_.getValueAndResolveTokens("text-field",kt,m,pe),Qt=be.factory(on);k$(Qt)&&(this.hasRTLText=!0),(!this.hasRTLText||zu()==="unavailable"||this.hasRTLText&&ko.isParsed())&&(Tt=t$(Qt,_,kt))}if(Q){const on=_.getValueAndResolveTokens("icon-image",kt,m,pe);hn=on instanceof Le?on:Le.fromString(on)}if(!Tt&&!hn)continue;const vn=this.sortFeaturesByKey?ne.evaluate(kt,{},m):void 0;if(this.features.push({id:Ye,text:Tt,icon:hn,index:lt,sourceLayerIndex:Ke,geometry:kt.geometry,properties:Ae.properties,type:P$[Ae.type],sortKey:vn}),hn&&(ue[hn.name]=!0),Tt){const on=T.evaluate(kt,{},m).join(","),Qt=S.get("text-rotation-alignment")!=="viewport"&&S.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.WritingMode.vertical)>=0;for(const Gt of Tt.sections)if(Gt.image)ue[Gt.image.name]=!0;else{const an=ed(Tt.toString()),tn=Gt.fontStack||on,$t=he[tn]=he[tn]||{};this.calculateGlyphDependencies(Gt.text,$t,Qt,this.allowVerticalPlacement,an)}}}S.get("symbol-placement")==="line"&&(this.features=function(Ae){const Ye={},lt={},Ke=[];let it=0;function kt(on){Ke.push(Ae[on]),it++}function Tt(on,Qt,Gt){const an=lt[on];return delete lt[on],lt[Qt]=an,Ke[an].geometry[0].pop(),Ke[an].geometry[0]=Ke[an].geometry[0].concat(Gt[0]),an}function hn(on,Qt,Gt){const an=Ye[Qt];return delete Ye[Qt],Ye[on]=an,Ke[an].geometry[0].shift(),Ke[an].geometry[0]=Gt[0].concat(Ke[an].geometry[0]),an}function vn(on,Qt,Gt){const an=Gt?Qt[0][Qt[0].length-1]:Qt[0][0];return`${on}:${an.x}:${an.y}`}for(let on=0;onon.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Ae,Ye)=>Ae.sortKey-Ye.sortKey)}update(a,d,m){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(a,d,this.layers,m),this.icon.programConfigurations.updatePaintArrays(a,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(a){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(a),this.iconCollisionBox.upload(a)),this.text.upload(a,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(a,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(a,d){const m=this.lineVertexArray.length;if(a.segment!==void 0){let _=a.dist(d[a.segment+1]),S=a.dist(d[a.segment]);const T={};for(let L=a.segment+1;L=0;L--)T[L]={x:d[L].x,y:d[L].y,tileUnitDistanceFromAnchor:S},L>0&&(S+=d[L-1].dist(d[L]));for(let L=0;L0}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(a,d){const m=a.placedSymbolArray.get(d),_=m.vertexStartIndex+4*m.numGlyphs;for(let S=m.vertexStartIndex;S<_;S+=4)a.indexArray.emplaceBack(S,S+1,S+2),a.indexArray.emplaceBack(S+1,S+2,S+3)}getSortedSymbolIndexes(a){if(this.sortedAngle===a&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const d=Math.sin(a),m=Math.cos(a),_=[],S=[],T=[];for(let L=0;L_[L]-_[F]||S[F]-S[L]),T}addToSortKeyRanges(a,d){const m=this.sortKeyRanges[this.sortKeyRanges.length-1];m&&m.sortKey===d?m.symbolInstanceEnd=a+1:this.sortKeyRanges.push({sortKey:d,symbolInstanceStart:a,symbolInstanceEnd:a+1})}sortFeatures(a){if(this.sortFeaturesByY&&this.sortedAngle!==a&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(a),this.sortedAngle=a,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((_,S,T)=>{_>=0&&T.indexOf(_)===S&&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)}}}mn("SymbolBucket",fd,{omit:["layers","collisionBoxArray","features","compareText"]}),fd.MAX_GLYPHS=65535,fd.addDynamicAttributes=__;const I$=new Pi({"symbol-placement":new xn(Fe.layout_symbol["symbol-placement"]),"symbol-spacing":new xn(Fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new xn(Fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new In(Fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new xn(Fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new xn(Fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new xn(Fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new xn(Fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new xn(Fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new xn(Fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new In(Fe.layout_symbol["icon-size"]),"icon-text-fit":new xn(Fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new xn(Fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new In(Fe.layout_symbol["icon-image"]),"icon-rotate":new In(Fe.layout_symbol["icon-rotate"]),"icon-padding":new In(Fe.layout_symbol["icon-padding"]),"icon-keep-upright":new xn(Fe.layout_symbol["icon-keep-upright"]),"icon-offset":new In(Fe.layout_symbol["icon-offset"]),"icon-anchor":new In(Fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new xn(Fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new xn(Fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new xn(Fe.layout_symbol["text-rotation-alignment"]),"text-field":new In(Fe.layout_symbol["text-field"]),"text-font":new In(Fe.layout_symbol["text-font"]),"text-size":new In(Fe.layout_symbol["text-size"]),"text-max-width":new In(Fe.layout_symbol["text-max-width"]),"text-line-height":new xn(Fe.layout_symbol["text-line-height"]),"text-letter-spacing":new In(Fe.layout_symbol["text-letter-spacing"]),"text-justify":new In(Fe.layout_symbol["text-justify"]),"text-radial-offset":new In(Fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new xn(Fe.layout_symbol["text-variable-anchor"]),"text-anchor":new In(Fe.layout_symbol["text-anchor"]),"text-max-angle":new xn(Fe.layout_symbol["text-max-angle"]),"text-writing-mode":new xn(Fe.layout_symbol["text-writing-mode"]),"text-rotate":new In(Fe.layout_symbol["text-rotate"]),"text-padding":new xn(Fe.layout_symbol["text-padding"]),"text-keep-upright":new xn(Fe.layout_symbol["text-keep-upright"]),"text-transform":new In(Fe.layout_symbol["text-transform"]),"text-offset":new In(Fe.layout_symbol["text-offset"]),"text-allow-overlap":new xn(Fe.layout_symbol["text-allow-overlap"]),"text-overlap":new xn(Fe.layout_symbol["text-overlap"]),"text-ignore-placement":new xn(Fe.layout_symbol["text-ignore-placement"]),"text-optional":new xn(Fe.layout_symbol["text-optional"])});var C_={paint:new Pi({"icon-opacity":new In(Fe.paint_symbol["icon-opacity"]),"icon-color":new In(Fe.paint_symbol["icon-color"]),"icon-halo-color":new In(Fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new In(Fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new In(Fe.paint_symbol["icon-halo-blur"]),"icon-translate":new xn(Fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new xn(Fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new In(Fe.paint_symbol["text-opacity"]),"text-color":new In(Fe.paint_symbol["text-color"],{runtimeType:Xt,getOverride:u=>u.textColor,hasOverride:u=>!!u.textColor}),"text-halo-color":new In(Fe.paint_symbol["text-halo-color"]),"text-halo-width":new In(Fe.paint_symbol["text-halo-width"]),"text-halo-blur":new In(Fe.paint_symbol["text-halo-blur"]),"text-translate":new xn(Fe.paint_symbol["text-translate"]),"text-translate-anchor":new xn(Fe.paint_symbol["text-translate-anchor"])}),layout:I$};class j4{constructor(a){if(a.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=a.property.overrides?a.property.overrides.runtimeType:Nn,this.defaultValue=a}evaluate(a){if(a.formattedSection){const d=this.defaultValue.property.overrides;if(d&&d.hasOverride(a.formattedSection))return d.getOverride(a.formattedSection)}return a.feature&&a.featureState?this.defaultValue.evaluate(a.feature,a.featureState):this.defaultValue.property.specification.default}eachChild(a){this.defaultValue.isConstant()||a(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}mn("FormatSectionOverride",j4,{omit:["defaultValue"]});class Ov extends aa{constructor(a){super(a,C_)}recalculate(a,d){if(super.recalculate(a,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 S of m)_.indexOf(S)<0&&_.push(S);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(a,d,m,_){const S=this.layout.get(a).evaluate(d,{},m,_),T=this._unevaluatedLayout._values[a];return T.isDataDriven()||Su(T.value)||!S?S:function(L,F){return F.replace(/{([^{}]+)}/g,(K,Q)=>Q in L?String(L[Q]):"")}(d.properties,S)}createBucket(a){return new fd(a)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const a of C_.paint.overridableProperties){if(!Ov.hasPaintOverride(this.layout,a))continue;const d=this.paint.get(a),m=new j4(d),_=new qc(m,d.property.specification);let S=null;S=d.value.kind==="constant"||d.value.kind==="source"?new Pu("source",_):new Yf("composite",_,d.value.zoomStops),this.paint._values[a]=new oa(d.property,S,d.parameters)}}_handleOverridablePaintPropertyUpdate(a,d,m){return!(!this.layout||d.isDataDriven()||m.isDataDriven())&&Ov.hasPaintOverride(this.layout,a)}static hasPaintOverride(a,d){const m=a.get("text-field"),_=C_.paint.properties[d];let S=!1;const T=L=>{for(const F of L)if(_.overrides&&_.overrides.hasOverride(F))return void(S=!0)};if(m.value.kind==="constant"&&m.value.value instanceof be)T(m.value.value.sections);else if(m.value.kind==="source"){const L=K=>{S||(K instanceof Ct&&Ve(K.value)===Sn?T(K.value.sections):K instanceof Wc?T(K.sections):K.eachChild(L))},F=m.value;F._styleExpression&&L(F._styleExpression.expression)}return S}}function S_(u,a,d){let m="never";const _=u.get(a);return _?m=_:u.get(d)&&(m="always"),m}var R$={paint:new Pi({"background-color":new xn(Fe.paint_background["background-color"]),"background-pattern":new uh(Fe.paint_background["background-pattern"]),"background-opacity":new xn(Fe.paint_background["background-opacity"])})},M$={paint:new Pi({"raster-opacity":new xn(Fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new xn(Fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new xn(Fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new xn(Fe.paint_raster["raster-brightness-max"]),"raster-saturation":new xn(Fe.paint_raster["raster-saturation"]),"raster-contrast":new xn(Fe.paint_raster["raster-contrast"]),"raster-resampling":new xn(Fe.paint_raster["raster-resampling"]),"raster-fade-duration":new xn(Fe.paint_raster["raster-fade-duration"])})};class A$ extends aa{constructor(a){super(a,{}),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=a}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 N$={circle:class extends aa{constructor(u){super(u,cF)}createBucket(u){return new Yx(u)}queryRadius(u){const a=u;return ph("circle-radius",this,a)+ph("circle-stroke-width",this,a)+gv(this.paint.get("circle-translate"))}queryIntersectsFeature(u,a,d,m,_,S,T,L){const F=yv(u,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),S.angle,T),K=this.paint.get("circle-radius").evaluate(a,d)+this.paint.get("circle-stroke-width").evaluate(a,d),Q=this.paint.get("circle-pitch-alignment")==="map",ne=Q?F:function(he,pe){return he.map(Ne=>e4(Ne,pe))}(F,L),ue=Q?K*T:K;for(const he of m)for(const pe of he){const Ne=Q?pe:e4(pe,L);let Ae=ue;const Ye=xv([],[pe.x,pe.y,0,1],L);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ae*=Ye[3]/S.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ae*=S.cameraToCenterDistance/Ye[3]),oF(ne,Ne,Ae))return!0}return!1}},heatmap:class extends aa{constructor(u){super(u,fF),this._updateColorRamp()}createBucket(u){return new t4(u)}_handleSpecialPaintPropertyUpdate(u){u==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=r4({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 aa{constructor(u){super(u,hF)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends aa{constructor(u){super(u,IF)}recalculate(u,a){super.recalculate(u,a);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(u){return new u_(u)}queryRadius(){return gv(this.paint.get("fill-translate"))}queryIntersectsFeature(u,a,d,m,_,S,T){return WE(yv(u,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),S.angle,T),m)}isTileClipped(){return!0}},"fill-extrusion":class extends aa{constructor(u){super(u,jF)}createBucket(u){return new d_(u)}queryRadius(){return gv(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(u,a,d,m,_,S,T,L){const F=yv(u,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),S.angle,T),K=this.paint.get("fill-extrusion-height").evaluate(a,d),Q=this.paint.get("fill-extrusion-base").evaluate(a,d),ne=function(he,pe,Ne,Ae){const Ye=[];for(const lt of he){const Ke=[lt.x,lt.y,0,1];xv(Ke,Ke,pe),Ye.push(new ie(Ke[0]/Ke[3],Ke[1]/Ke[3]))}return Ye}(F,L),ue=function(he,pe,Ne,Ae){const Ye=[],lt=[],Ke=Ae[8]*pe,it=Ae[9]*pe,kt=Ae[10]*pe,Tt=Ae[11]*pe,hn=Ae[8]*Ne,vn=Ae[9]*Ne,on=Ae[10]*Ne,Qt=Ae[11]*Ne;for(const Gt of he){const an=[],tn=[];for(const $t of Gt){const Tn=$t.x,_n=$t.y,jn=Ae[0]*Tn+Ae[4]*_n+Ae[12],kr=Ae[1]*Tn+Ae[5]*_n+Ae[13],Lr=Ae[2]*Tn+Ae[6]*_n+Ae[14],hi=Ae[3]*Tn+Ae[7]*_n+Ae[15],Ko=Lr+kt,Ni=hi+Tt,ri=jn+hn,_i=kr+vn,Oi=Lr+on,Ui=hi+Qt,fo=new ie((jn+Ke)/Ni,(kr+it)/Ni);fo.z=Ko/Ni,an.push(fo);const ii=new ie(ri/Ui,_i/Ui);ii.z=Oi/Ui,tn.push(ii)}Ye.push(an),lt.push(tn)}return[Ye,lt]}(m,Q,K,L);return function(he,pe,Ne){let Ae=1/0;WE(Ne,pe)&&(Ae=f4(Ne,pe[0]));for(let Ye=0;Ye=3){for(let Ne=0;Ne{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const K4=63710088e-1;class Zr{constructor(a,d){if(isNaN(a)||isNaN(d))throw new Error(`Invalid LngLat object: (${a}, ${d})`);if(this.lng=+a,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 Zr(P(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(a){const d=Math.PI/180,m=this.lat*d,_=a.lat*d,S=Math.sin(m)*Math.sin(_)+Math.cos(m)*Math.cos(_)*Math.cos((a.lng-this.lng)*d);return K4*Math.acos(Math.min(S,1))}toBounds(a=0){const d=360*a/40075017,m=d/Math.cos(Math.PI/180*this.lat);return new Ku(new Zr(this.lng-m,this.lat-d),new Zr(this.lng+m,this.lat+d))}static convert(a){if(a instanceof Zr)return a;if(Array.isArray(a)&&(a.length===2||a.length===3))return new Zr(Number(a[0]),Number(a[1]));if(!Array.isArray(a)&&typeof a=="object"&&a!==null)return new Zr(Number("lng"in a?a.lng:a.lon),Number(a.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 Ku{constructor(a,d){a&&(d?this.setSouthWest(a).setNorthEast(d):a.length===4?this.setSouthWest([a[0],a[1]]).setNorthEast([a[2],a[3]]):this.setSouthWest(a[0]).setNorthEast(a[1]))}setNorthEast(a){return this._ne=a instanceof Zr?new Zr(a.lng,a.lat):Zr.convert(a),this}setSouthWest(a){return this._sw=a instanceof Zr?new Zr(a.lng,a.lat):Zr.convert(a),this}extend(a){const d=this._sw,m=this._ne;let _,S;if(a instanceof Zr)_=a,S=a;else{if(!(a instanceof Ku))return Array.isArray(a)?a.length===4||a.every(Array.isArray)?this.extend(Ku.convert(a)):this.extend(Zr.convert(a)):this;if(_=a._sw,S=a._ne,!_||!S)return this}return d||m?(d.lng=Math.min(_.lng,d.lng),d.lat=Math.min(_.lat,d.lat),m.lng=Math.max(S.lng,m.lng),m.lat=Math.max(S.lat,m.lat)):(this._sw=new Zr(_.lng,_.lat),this._ne=new Zr(S.lng,S.lat)),this}getCenter(){return new Zr((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 Zr(this.getWest(),this.getNorth())}getSouthEast(){return new Zr(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(a){const{lng:d,lat:m}=Zr.convert(a);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(a){return a instanceof Ku?a:a&&new Ku(a)}}const H4=2*Math.PI*K4;function W4(u){return H4*Math.cos(u*Math.PI/180)}function G4(u){return(180+u)/360}function q4(u){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360}function Z4(u,a){return u/W4(a)}function E_(u){return 360/Math.PI*Math.atan(Math.exp((180-360*u)*Math.PI/180))-90}class Dv{constructor(a,d,m=0){this.x=+a,this.y=+d,this.z=+m}static fromLngLat(a,d=0){const m=Zr.convert(a);return new Dv(G4(m.lng),q4(m.lat),Z4(d,m.lat))}toLngLat(){return new Zr(360*this.x-180,E_(this.y))}toAltitude(){return this.z*W4(E_(this.y))}meterInMercatorCoordinateUnits(){return 1/H4*(a=E_(this.y),1/Math.cos(a*Math.PI/180));var a}}function X4(u,a,d){var m=2*Math.PI*6378137/256/Math.pow(2,d);return[u*m-2*Math.PI*6378137/2,a*m-2*Math.PI*6378137/2]}class P_{constructor(a,d,m){if(a<0||a>25||m<0||m>=Math.pow(2,a)||d<0||d>=Math.pow(2,a))throw new Error(`x=${d}, y=${m}, z=${a} outside of bounds. 0<=x<${Math.pow(2,a)}, 0<=y<${Math.pow(2,a)} 0<=z<=25 `);this.z=a,this.x=d,this.y=m,this.key=Eh(0,a,a,d,m)}equals(a){return this.z===a.z&&this.x===a.x&&this.y===a.y}url(a,d,m){const _=(T=this.y,L=this.z,F=X4(256*(S=this.x),256*(T=Math.pow(2,L)-T-1),L),K=X4(256*(S+1),256*(T+1),L),F[0]+","+F[1]+","+K[0]+","+K[1]);var S,T,L,F,K;const Q=function(ne,ue,he){let pe,Ne="";for(let Ae=ne;Ae>0;Ae--)pe=1<1?"@2x":"").replace(/{quadkey}/g,Q).replace(/{bbox-epsg-3857}/g,_)}isChildOf(a){const d=this.z-a.z;return d>0&&a.x===this.x>>d&&a.y===this.y>>d}getTilePoint(a){const d=Math.pow(2,this.z);return new ie((a.x*d-this.x)*fi,(a.y*d-this.y)*fi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Y4{constructor(a,d){this.wrap=a,this.canonical=d,this.key=Eh(a,d.z,d.z,d.x,d.y)}}class jo{constructor(a,d,m,_,S){if(a= z; overscaledZ = ${a}; z = ${m}`);this.overscaledZ=a,this.wrap=d,this.canonical=new P_(m,+_,+S),this.key=Eh(d,a,m,_,S)}clone(){return new jo(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(a){return this.overscaledZ===a.overscaledZ&&this.wrap===a.wrap&&this.canonical.equals(a.canonical)}scaledTo(a){if(a>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${a}; overscaledZ = ${this.overscaledZ}`);const d=this.canonical.z-a;return a>this.canonical.z?new jo(a,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new jo(a,this.wrap,a,this.canonical.x>>d,this.canonical.y>>d)}calculateScaledKey(a,d){if(a>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${a}; overscaledZ = ${this.overscaledZ}`);const m=this.canonical.z-a;return a>this.canonical.z?Eh(this.wrap*+d,a,this.canonical.z,this.canonical.x,this.canonical.y):Eh(this.wrap*+d,a,a,this.canonical.x>>m,this.canonical.y>>m)}isChildOf(a){if(a.wrap!==this.wrap)return!1;const d=this.canonical.z-a.canonical.z;return a.overscaledZ===0||a.overscaledZ>d&&a.canonical.y===this.canonical.y>>d}children(a){if(this.overscaledZ>=a)return[new jo(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 jo(d,this.wrap,d,m,_),new jo(d,this.wrap,d,m+1,_),new jo(d,this.wrap,d,m,_+1),new jo(d,this.wrap,d,m+1,_+1)]}isLessThan(a){return this.wrapa.wrap)&&(this.overscaledZa.overscaledZ)&&(this.canonical.xa.canonical.x)&&this.canonical.ythis.max&&(this.max=L),L=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+(a+1)}_unpackMapbox(a,d,m){return(256*a*256+256*d+m)/10-1e4}_unpackTerrarium(a,d,m){return 256*a+d+m/256-32768}getPixels(){return new Uo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(a,d,m){if(this.dim!==a.dim)throw new Error("dem dimension mismatch");let _=d*this.dim,S=d*this.dim+this.dim,T=m*this.dim,L=m*this.dim+this.dim;switch(d){case-1:_=S-1;break;case 1:S=_+1}switch(m){case-1:T=L-1;break;case 1:L=T+1}const F=-d*this.dim,K=-m*this.dim;for(let Q=T;Q=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${a} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[a]}}class eP{constructor(a,d,m,_,S){this.type="Feature",this._vectorTileFeature=a,a._z=d,a._x=m,a._y=_,this.properties=a.properties,this.id=S}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(a){this._geometry=a}toJSON(){const a={geometry:this.geometry};for(const d in this)d!=="_geometry"&&d!=="_vectorTileFeature"&&(a[d]=this[d]);return a}}class tP{constructor(a,d){this.tileID=a,this.x=a.canonical.x,this.y=a.canonical.y,this.z=a.canonical.z,this.grid=new Lu(fi,16,0),this.grid3D=new Lu(fi,16,0),this.featureIndexArray=new Un,this.promoteId=d}insert(a,d,m,_,S,T){const L=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(m,_,S);const F=T?this.grid3D:this.grid;for(let K=0;K=0&&ne[3]>=0&&F.insert(L,ne[0],ne[1],ne[2],ne[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Il.VectorTile(new h_(this.rawTileData)).layers,this.sourceLayerCoder=new J4(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(a,d,m,_){this.loadVTLayers();const S=a.params||{},T=fi/a.tileSize/a.scale,L=Yc(S.filter),F=a.queryGeometry,K=a.queryPadding*T,Q=rP(F),ne=this.grid.query(Q.minX-K,Q.minY-K,Q.maxX+K,Q.maxY+K),ue=rP(a.cameraQueryGeometry),he=this.grid3D.query(ue.minX-K,ue.minY-K,ue.maxX+K,ue.maxY+K,(Ae,Ye,lt,Ke)=>function(it,kt,Tt,hn,vn){for(const Qt of it)if(kt<=Qt.x&&Tt<=Qt.y&&hn>=Qt.x&&vn>=Qt.y)return!0;const on=[new ie(kt,Tt),new ie(kt,vn),new ie(hn,vn),new ie(hn,Tt)];if(it.length>2){for(const Qt of on)if(od(it,Qt))return!0}for(let Qt=0;Qt(Ke||(Ke=Vu(it)),kt.queryIntersectsFeature(F,it,Tt,Ke,this.z,a.transform,T,a.pixelPosMatrix)))}return pe}loadMatchingFeature(a,d,m,_,S,T,L,F,K,Q,ne){const ue=this.bucketLayerIDs[d];if(T&&!function(Ae,Ye){for(let lt=0;lt=0)return!0;return!1}(T,ue))return;const he=this.sourceLayerCoder.decode(m),pe=this.vtLayers[he].feature(_);if(S.needGeometry){const Ae=Uu(pe,!0);if(!S.filter(new Or(this.tileID.overscaledZ),Ae,this.tileID.canonical))return}else if(!S.filter(new Or(this.tileID.overscaledZ),pe))return;const Ne=this.getId(pe,he);for(let Ae=0;Ae{const L=a instanceof $u?a.get(T):null;return L&&L.evaluate?L.evaluate(d,m,_):L})}function rP(u){let a=1/0,d=1/0,m=-1/0,_=-1/0;for(const S of u)a=Math.min(a,S.x),d=Math.min(d,S.y),m=Math.max(m,S.x),_=Math.max(_,S.y);return{minX:a,minY:d,maxX:m,maxY:_}}function D$(u,a){return a-u}var T_;mn("FeatureIndex",tP,{omit:["rawTileData","sourceLayerCoder"]}),o.PerformanceMarkers=void 0,(T_=o.PerformanceMarkers||(o.PerformanceMarkers={})).create="create",T_.load="load",T_.fullLoad="fullLoad";let Lv=null,Ph=[];const k_=1e3/30,L$={mark(u){performance.mark(u)},frame(u){const a=u;Lv!=null&&Ph.push(a-Lv),Lv=a},clearMetrics(){Lv=null,Ph=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const u in o.PerformanceMarkers)performance.clearMarks(o.PerformanceMarkers[u])},getPerformanceMetrics(){performance.measure("loadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.load),performance.measure("fullLoadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.fullLoad);const u=performance.getEntriesByName("loadTime")[0].duration,a=performance.getEntriesByName("fullLoadTime")[0].duration,d=Ph.length,m=1/(Ph.reduce((S,T)=>S+T,0)/d/1e3),_=Ph.filter(S=>S>k_).reduce((S,T)=>S+(T-k_)/k_,0);return{loadTime:u,fullLoadTime:a,fps:m,percentDroppedFrames:_/(d+_)*100}}};o.AJAXError=We,o.ARRAY_TYPE=Ji,o.Actor=class{constructor(u,a,d){this.target=u,this.parent=a,this.mapId=d,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},N(["receive","process"],this),this.invoker=new O$(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=j()?u:window}send(u,a,d,m,_=!1){const S=Math.round(1e18*Math.random()).toString(36).substring(0,10);d&&(this.callbacks[S]=d);const T=Z(this.globalScope)?void 0:[];return this.target.postMessage({id:S,type:u,hasCallback:!!d,targetMapId:m,mustQueue:_,sourceMapId:this.mapId,data:ks(a,T)},T),{cancel:()=>{d&&delete this.callbacks[S],this.target.postMessage({id:S,type:"",targetMapId:m,sourceMapId:this.mapId})}}}receive(u){const a=u.data,d=a.id;if(d&&(!a.targetMapId||this.mapId===a.targetMapId))if(a.type===""){delete this.tasks[d];const m=this.cancelCallbacks[d];delete this.cancelCallbacks[d],m&&m()}else j()||a.mustQueue?(this.tasks[d]=a,this.taskQueue.push(d),this.invoker.trigger()):this.processTask(d,a)}process(){if(!this.taskQueue.length)return;const u=this.taskQueue.shift(),a=this.tasks[u];delete this.tasks[u],this.taskQueue.length&&this.invoker.trigger(),a&&this.processTask(u,a)}processTask(u,a){if(a.type===""){const d=this.callbacks[u];delete this.callbacks[u],d&&(a.error?d(Qa(a.error)):d(null,Qa(a.data)))}else{let d=!1;const m=Z(this.globalScope)?void 0:[],_=a.hasCallback?(L,F)=>{d=!0,delete this.cancelCallbacks[u],this.target.postMessage({id:u,type:"",sourceMapId:this.mapId,error:L?ks(L):null,data:ks(F,m)},m)}:L=>{d=!0};let S=null;const T=Qa(a.data);if(this.parent[a.type])S=this.parent[a.type](a.sourceMapId,T,_);else if(this.parent.getWorkerSource){const L=a.type.split(".");S=this.parent.getWorkerSource(a.sourceMapId,L[0],T.source)[L[1]](T,_)}else _(new Error(`Could not find function ${a.type}`));!d&&S&&S.cancel&&(this.cancelCallbacks[u]=S.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.AlphaImage=vh,o.CanonicalTileID=P_,o.CollisionBoxArray=xt,o.CollisionCircleLayoutArray=class extends te{},o.Color=le,o.DEMData=Q4,o.DataConstantProperty=xn,o.DictionaryCoder=J4,o.EXTENT=fi,o.ErrorEvent=Ut,o.EvaluationParameters=Or,o.Event=Wt,o.Evented=Jt,o.FeatureIndex=tP,o.FillBucket=u_,o.FillExtrusionBucket=d_,o.GeoJSONFeature=eP,o.ImageAtlas=E4,o.ImagePosition=m_,o.LineBucket=f_,o.LineStripIndexArray=class extends Me{},o.LngLat=Zr,o.LngLatBounds=Ku,o.MercatorCoordinate=Dv,o.ONE_EM=Ti,o.OverscaledTileID=jo,o.PerformanceUtils=L$,o.PosArray=Pn,o.Properties=Pi,o.QuadTriangleArray=class extends fe{},o.RGBAImage=Uo,o.RasterBoundsArray=class extends x{},o.RequestPerformance=class{constructor(u){this._marks={start:[u.url,"start"].join("#"),end:[u.url,"end"].join("#"),measure:u.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let u=performance.getEntriesByName(this._marks.measure);return u.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),u=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),u}},o.ResourceType=It,o.SegmentVector=Wn,o.SymbolBucket=fd,o.Transitionable=dv,o.TriangleIndexArray=Yi,o.Uniform1f=As,o.Uniform1i=class extends Ms{constructor(u,a){super(u,a),this.current=0}set(u){this.current!==u&&(this.current=u,this.gl.uniform1i(this.location,u))}},o.Uniform2f=class extends Ms{constructor(u,a){super(u,a),this.current=[0,0]}set(u){u[0]===this.current[0]&&u[1]===this.current[1]||(this.current=u,this.gl.uniform2f(this.location,u[0],u[1]))}},o.Uniform3f=class extends Ms{constructor(u,a){super(u,a),this.current=[0,0,0]}set(u){u[0]===this.current[0]&&u[1]===this.current[1]&&u[2]===this.current[2]||(this.current=u,this.gl.uniform3f(this.location,u[0],u[1],u[2]))}},o.Uniform4f=rd,o.UniformColor=VE,o.UniformMatrix4f=class extends Ms{constructor(u,a){super(u,a),this.current=rF}set(u){if(u[12]!==this.current[12]||u[0]!==this.current[0])return this.current=u,void this.gl.uniformMatrix4fv(this.location,!1,u);for(let a=1;a<16;a++)if(u[a]!==this.current[a]){this.current=u,this.gl.uniformMatrix4fv(this.location,!1,u);break}}},o.UnwrappedTileID=Y4,o.ValidationError=Ge,o.ZoomHistory=th,o.add=function(u,a,d){return u[0]=a[0]+d[0],u[1]=a[1]+d[1],u[2]=a[2]+d[2],u},o.addDynamicAttributes=__,o.asyncAll=function(u,a,d){if(!u.length)return d(null,[]);let m=u.length;const _=new Array(u.length);let S=null;u.forEach((T,L)=>{a(T,(F,K)=>{F&&(S=F),_[L]=K,--m==0&&d(S,_)})})},o.bezier=v,o.bindAll=N,o.cacheEntryPossiblyAdded=function(u){ke++,ke>De&&(u.getActor().send("enforceCacheSizeLimit",Pe),ke=0)},o.clamp=w,o.clearTileCache=function(u){const a=caches.delete(ye);u&&a.catch(u).then(()=>u())},o.clipLine=z4,o.clone=function(u){var a=new Ji(16);return a[0]=u[0],a[1]=u[1],a[2]=u[2],a[3]=u[3],a[4]=u[4],a[5]=u[5],a[6]=u[6],a[7]=u[7],a[8]=u[8],a[9]=u[9],a[10]=u[10],a[11]=u[11],a[12]=u[12],a[13]=u[13],a[14]=u[14],a[15]=u[15],a},o.clone$1=O,o.clone$2=function(u){var a=new Ji(3);return a[0]=u[0],a[1]=u[1],a[2]=u[2],a},o.collisionCircleLayout=e$,o.config=oe,o.copy=function(u,a){return u[0]=a[0],u[1]=a[1],u[2]=a[2],u[3]=a[3],u[4]=a[4],u[5]=a[5],u[6]=a[6],u[7]=a[7],u[8]=a[8],u[9]=a[9],u[10]=a[10],u[11]=a[11],u[12]=a[12],u[13]=a[13],u[14]=a[14],u[15]=a[15],u},o.create=function(){var u=new Ji(16);return Ji!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=0,u[12]=0,u[13]=0,u[14]=0),u[0]=1,u[5]=1,u[10]=1,u[15]=1,u},o.create$1=ZE,o.createExpression=Eu,o.createFilter=Yc,o.createLayout=ni,o.createStyleLayer=function(u){return u.type==="custom"?new A$(u):new N$[u.type](u)},o.cross=function(u,a,d){var m=a[0],_=a[1],S=a[2],T=d[0],L=d[1],F=d[2];return u[0]=_*F-S*L,u[1]=S*T-m*F,u[2]=m*L-_*T,u},o.dot=function(u,a){return u[0]*a[0]+u[1]*a[1]+u[2]*a[2]},o.dot$1=function(u,a){return u[0]*a[0]+u[1]*a[1]+u[2]*a[2]+u[3]*a[3]},o.ease=y,o.emitValidationErrors=Jc,o.enforceCacheSizeLimit=function(u){Re(),Ie&&Ie.then(a=>{a.keys().then(d=>{for(let m=0;m{}}},o.identity=e_,o.invert=function(u,a){var d=a[0],m=a[1],_=a[2],S=a[3],T=a[4],L=a[5],F=a[6],K=a[7],Q=a[8],ne=a[9],ue=a[10],he=a[11],pe=a[12],Ne=a[13],Ae=a[14],Ye=a[15],lt=d*L-m*T,Ke=d*F-_*T,it=d*K-S*T,kt=m*F-_*L,Tt=m*K-S*L,hn=_*K-S*F,vn=Q*Ne-ne*pe,on=Q*Ae-ue*pe,Qt=Q*Ye-he*pe,Gt=ne*Ae-ue*Ne,an=ne*Ye-he*Ne,tn=ue*Ye-he*Ae,$t=lt*tn-Ke*an+it*Gt+kt*Qt-Tt*on+hn*vn;return $t?(u[0]=(L*tn-F*an+K*Gt)*($t=1/$t),u[1]=(_*an-m*tn-S*Gt)*$t,u[2]=(Ne*hn-Ae*Tt+Ye*kt)*$t,u[3]=(ue*Tt-ne*hn-he*kt)*$t,u[4]=(F*Qt-T*tn-K*on)*$t,u[5]=(d*tn-_*Qt+S*on)*$t,u[6]=(Ae*it-pe*hn-Ye*Ke)*$t,u[7]=(Q*hn-ue*it+he*Ke)*$t,u[8]=(T*an-L*Qt+K*vn)*$t,u[9]=(m*Qt-d*an-S*vn)*$t,u[10]=(pe*Tt-Ne*it+Ye*lt)*$t,u[11]=(ne*it-Q*Tt-he*lt)*$t,u[12]=(L*on-T*Gt-F*vn)*$t,u[13]=(d*Gt-m*on+_*vn)*$t,u[14]=(Ne*Ke-pe*kt-Ae*lt)*$t,u[15]=(Q*kt-ne*Ke+ue*lt)*$t,u):null},o.isImageBitmap=J,o.isSafari=Z,o.isWorker=j,o.keysDifference=function(u,a){const d=[];for(const m in u)m in a||d.push(m);return d},o.lazyLoadRTLTextPlugin=function(){ko.isLoading()||ko.isLoaded()||zu()!=="deferred"||cv()},o.makeRequest=Rt,o.mapObject=R,o.mercatorXfromLng=G4,o.mercatorYfromLat=q4,o.mercatorZfromAltitude=Z4,o.mul=dF,o.mul$1=function(u,a,d){return u[0]=a[0]*d[0],u[1]=a[1]*d[1],u[2]=a[2]*d[2],u[3]=a[3]*d[3],u},o.multiply=XE,o.nextPowerOfTwo=function(u){return u<=1?1:Math.pow(2,Math.ceil(Math.log(u)/Math.LN2))},o.normalize=function(u,a){var d=a[0],m=a[1],_=a[2],S=d*d+m*m+_*_;return S>0&&(S=1/Math.sqrt(S)),u[0]=a[0]*S,u[1]=a[1]*S,u[2]=a[2]*S,u},o.number=xr,o.ortho=function(u,a,d,m,_,S,T){var L=1/(a-d),F=1/(m-_),K=1/(S-T);return u[0]=-2*L,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=-2*F,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=2*K,u[11]=0,u[12]=(a+d)*L,u[13]=(_+m)*F,u[14]=(T+S)*K,u[15]=1,u},o.parseCacheControl=X,o.parseGlyphPbf=function(u){return new h_(u).readFields(d$,[])},o.pbf=h_,o.performSymbolLayout=function(u){u.bucket.createArrays(),u.bucket.tilePixelRatio=fi/(512*u.bucket.overscaling),u.bucket.compareText={},u.bucket.iconsNeedLinear=!1;const a=u.bucket.layers[0].layout,d=u.bucket.layers[0]._unevaluatedLayout._values,m={layoutIconSize:d["icon-size"].possiblyEvaluate(new Or(u.bucket.zoom+1),u.canonical),layoutTextSize:d["text-size"].possiblyEvaluate(new Or(u.bucket.zoom+1),u.canonical),textMaxSize:d["text-size"].possiblyEvaluate(new Or(18))};if(u.bucket.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:K}=u.bucket.textSizeData;m.compositeTextSizes=[d["text-size"].possiblyEvaluate(new Or(F),u.canonical),d["text-size"].possiblyEvaluate(new Or(K),u.canonical)]}if(u.bucket.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:K}=u.bucket.iconSizeData;m.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new Or(F),u.canonical),d["icon-size"].possiblyEvaluate(new Or(K),u.canonical)]}const _=a.get("text-line-height")*Ti,S=a.get("text-rotation-alignment")!=="viewport"&&a.get("symbol-placement")!=="point",T=a.get("text-keep-upright"),L=a.get("text-size");for(const F of u.bucket.features){const K=a.get("text-font").evaluate(F,{},u.canonical).join(","),Q=L.evaluate(F,{},u.canonical),ne=m.layoutTextSize.evaluate(F,{},u.canonical),ue=m.layoutIconSize.evaluate(F,{},u.canonical),he={horizontal:{},vertical:void 0},pe=F.text;let Ne,Ae=[0,0];if(pe){const Ke=pe.toString(),it=a.get("text-letter-spacing").evaluate(F,{},u.canonical)*Ti,kt=Wx(Ke)?it:0,Tt=a.get("text-anchor").evaluate(F,{},u.canonical),hn=a.get("text-variable-anchor");if(!hn){const an=a.get("text-radial-offset").evaluate(F,{},u.canonical);Ae=an?B4(Tt,[an*Ti,y_]):a.get("text-offset").evaluate(F,{},u.canonical).map(tn=>tn*Ti)}let vn=S?"center":a.get("text-justify").evaluate(F,{},u.canonical);const on=a.get("symbol-placement"),Qt=on==="point"?a.get("text-max-width").evaluate(F,{},u.canonical)*Ti:0,Gt=()=>{u.bucket.allowVerticalPlacement&&ed(Ke)&&(he.vertical=Tv(pe,u.glyphMap,u.glyphPositions,u.imagePositions,K,Qt,_,Tt,"left",kt,Ae,o.WritingMode.vertical,!0,on,ne,Q))};if(!S&&hn){const an=vn==="auto"?hn.map($t=>x_($t)):[vn];let tn=!1;for(let $t=0;$tthis._layers[Ze.id]),Ee=xe[0];if(Ee.visibility==="none")continue;const be=Ee.source||"";let Ce=this.familiesBySource[be];Ce||(Ce=this.familiesBySource[be]={});const Le=Ee.sourceLayer||"_geojsonTileLayer";let qe=Ce[Le];qe||(qe=Ce[Le]=[]),qe.push(xe)}}}class y{constructor(H){const q={},de=[];for(const be in H){const Ce=H[be],Le=q[be]={};for(const qe in Ce){const Ze=Ce[+qe];if(!Ze||Ze.bitmap.width===0||Ze.bitmap.height===0)continue;const Ve={x:0,y:0,w:Ze.bitmap.width+2,h:Ze.bitmap.height+2};de.push(Ve),Le[qe]={rect:Ve,metrics:Ze.metrics}}}const{w:le,h:xe}=o.potpack(de),Ee=new o.AlphaImage({width:le||1,height:xe||1});for(const be in H){const Ce=H[be];for(const Le in Ce){const qe=Ce[+Le];if(!qe||qe.bitmap.width===0||qe.bitmap.height===0)continue;const Ze=q[be][Le].rect;o.AlphaImage.copy(qe.bitmap,Ee,{x:0,y:0},{x:Ze.x+1,y:Ze.y+1},qe.bitmap)}}this.image=Ee,this.positions=q}}o.register("GlyphAtlas",y);class w{constructor(H){this.tileID=new o.OverscaledTileID(H.tileID.overscaledZ,H.tileID.wrap,H.tileID.canonical.z,H.tileID.canonical.x,H.tileID.canonical.y),this.uid=H.uid,this.zoom=H.zoom,this.pixelRatio=H.pixelRatio,this.tileSize=H.tileSize,this.source=H.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=H.showCollisionBoxes,this.collectResourceTiming=!!H.collectResourceTiming,this.returnDependencies=!!H.returnDependencies,this.promoteId=H.promoteId}parse(H,q,de,le,xe){this.status="parsing",this.data=H,this.collisionBoxArray=new o.CollisionBoxArray;const Ee=new o.DictionaryCoder(Object.keys(H.layers).sort()),be=new o.FeatureIndex(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Ce={},Le={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:de},qe=q.familiesBySource[this.source];for(const un in qe){const wn=H.layers[un];if(!wn)continue;wn.version===1&&o.warnOnce(`Vector tile source "${this.source}" layer "${un}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Vn=Ee.encode(un),rr=[];for(let $r=0;$r=sr.maxzoom||sr.visibility!=="none"&&(P($r,this.zoom,de),(Ce[sr.id]=sr.createBucket({index:be.bucketLayerIDs.length,layers:$r,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Vn,sourceID:this.source})).populate(rr,Le,this.tileID.canonical),be.bucketLayerIDs.push($r.map(Mr=>Mr.id)))}}let Ze,Ve,Lt,Ct;const Je=o.mapObject(Le.glyphDependencies,un=>Object.keys(un).map(Number));Object.keys(Je).length?le.send("getGlyphs",{uid:this.uid,stacks:Je},(un,wn)=>{Ze||(Ze=un,Ve=wn,bn.call(this))}):Ve={};const Ot=Object.keys(Le.iconDependencies);Ot.length?le.send("getImages",{icons:Ot,source:this.source,tileID:this.tileID,type:"icons"},(un,wn)=>{Ze||(Ze=un,Lt=wn,bn.call(this))}):Lt={};const Vt=Object.keys(Le.patternDependencies);function bn(){if(Ze)return xe(Ze);if(Ve&&Lt&&Ct){const un=new y(Ve),wn=new o.ImageAtlas(Lt,Ct);for(const Vn in Ce){const rr=Ce[Vn];rr instanceof o.SymbolBucket?(P(rr.layers,this.zoom,de),o.performSymbolLayout({bucket:rr,glyphMap:Ve,glyphPositions:un.positions,imageMap:Lt,imagePositions:wn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):rr.hasPattern&&(rr instanceof o.LineBucket||rr instanceof o.FillBucket||rr instanceof o.FillExtrusionBucket)&&(P(rr.layers,this.zoom,de),rr.addFeatures(Le,this.tileID.canonical,wn.patternPositions))}this.status="done",xe(null,{buckets:Object.values(Ce).filter(Vn=>!Vn.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:un.image,imageAtlas:wn,glyphMap:this.returnDependencies?Ve:null,iconMap:this.returnDependencies?Lt:null,glyphPositions:this.returnDependencies?un.positions:null})}}Vt.length?le.send("getImages",{icons:Vt,source:this.source,tileID:this.tileID,type:"patterns"},(un,wn)=>{Ze||(Ze=un,Ct=wn,bn.call(this))}):Ct={},bn.call(this)}}function P(me,H,q){const de=new o.EvaluationParameters(H);for(const le of me)le.recalculate(de,q)}function k(me,H){const q=o.getArrayBuffer(me.request,(de,le,xe,Ee)=>{de?H(de):le&&H(null,{vectorTile:new o.vectorTile.VectorTile(new o.pbf(le)),rawData:le,cacheControl:xe,expires:Ee})});return()=>{q.cancel(),H()}}class A{constructor(H,q,de,le){this.actor=H,this.layerIndex=q,this.availableImages=de,this.loadVectorData=le||k,this.loading={},this.loaded={}}loadTile(H,q){const de=H.uid;this.loading||(this.loading={});const le=!!(H&&H.request&&H.request.collectResourceTiming)&&new o.RequestPerformance(H.request),xe=this.loading[de]=new w(H);xe.abort=this.loadVectorData(H,(Ee,be)=>{if(delete this.loading[de],Ee||!be)return xe.status="done",this.loaded[de]=xe,q(Ee);const Ce=be.rawData,Le={};be.expires&&(Le.expires=be.expires),be.cacheControl&&(Le.cacheControl=be.cacheControl);const qe={};if(le){const Ze=le.finish();Ze&&(qe.resourceTiming=JSON.parse(JSON.stringify(Ze)))}xe.vectorTile=be.vectorTile,xe.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor,(Ze,Ve)=>{if(Ze||!Ve)return q(Ze);q(null,o.extend({rawTileData:Ce.slice(0)},Ve,Le,qe))}),this.loaded=this.loaded||{},this.loaded[de]=xe})}reloadTile(H,q){const de=this.loaded,le=H.uid,xe=this;if(de&&de[le]){const Ee=de[le];Ee.showCollisionBoxes=H.showCollisionBoxes;const be=(Ce,Le)=>{const qe=Ee.reloadCallback;qe&&(delete Ee.reloadCallback,Ee.parse(Ee.vectorTile,xe.layerIndex,this.availableImages,xe.actor,qe)),q(Ce,Le)};Ee.status==="parsing"?Ee.reloadCallback=be:Ee.status==="done"&&(Ee.vectorTile?Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor,be):be())}}abortTile(H,q){const de=this.loading,le=H.uid;de&&de[le]&&de[le].abort&&(de[le].abort(),delete de[le]),q()}removeTile(H,q){const de=this.loaded,le=H.uid;de&&de[le]&&delete de[le],q()}}class N{constructor(){this.loaded={}}loadTile(H,q){const{uid:de,encoding:le,rawImageData:xe}=H,Ee=o.isImageBitmap(xe)?this.getImageData(xe):xe,be=new o.DEMData(de,Ee,le);this.loaded=this.loaded||{},this.loaded[de]=be,q(null,be)}getImageData(H){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(H.width,H.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=H.width,this.offscreenCanvas.height=H.height,this.offscreenCanvasContext.drawImage(H,0,0,H.width,H.height);const q=this.offscreenCanvasContext.getImageData(-1,-1,H.width+2,H.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(H){const q=this.loaded,de=H.uid;q&&q[de]&&delete q[de]}}var R=function me(H,q){var de,le=H&&H.type;if(le==="FeatureCollection")for(de=0;de=Math.abs(be)?q-Ce+be:be-Ce+q,q=Ce}q+de>=0!=!!H&&me.reverse()}const z=o.vectorTile.VectorTileFeature.prototype.toGeoJSON;class B{constructor(H){this._feature=H,this.extent=o.EXTENT,this.type=H.type,this.properties=H.tags,"id"in H&&!isNaN(H.id)&&(this.id=parseInt(H.id,10))}loadGeometry(){if(this._feature.type===1){const H=[];for(const q of this._feature.geometry)H.push([new o.pointGeometry(q[0],q[1])]);return H}{const H=[];for(const q of this._feature.geometry){const de=[];for(const le of q)de.push(new o.pointGeometry(le[0],le[1]));H.push(de)}return H}}toGeoJSON(H,q,de){return z.call(this,H,q,de)}}class V{constructor(H){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=H.length,this._features=H}feature(H){return new B(this._features[H])}}var G={exports:{}},j=o.pointGeometry,X=o.vectorTile.VectorTileFeature,Y=se;function se(me,H){this.options=H||{},this.features=me,this.length=me.length}function ee(me,H){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=H||4096}se.prototype.feature=function(me){return new ee(this.features[me],this.options.extent)},ee.prototype.loadGeometry=function(){var me=this.rawGeometry;this.geometry=[];for(var H=0;H>31}function Te(me,H){for(var q=me.loadGeometry(),de=me.type,le=0,xe=0,Ee=q.length,be=0;be>1;Re(me,H,Ee,de,le,xe%2),De(me,H,q,de,Ee-1,xe+1),De(me,H,q,Ee+1,le,xe+1)}function Re(me,H,q,de,le,xe){for(;le>de;){if(le-de>600){const Le=le-de+1,qe=q-de+1,Ze=Math.log(Le),Ve=.5*Math.exp(2*Ze/3),Lt=.5*Math.sqrt(Ze*Ve*(Le-Ve)/Le)*(qe-Le/2<0?-1:1);Re(me,H,q,Math.max(de,Math.floor(q-qe*Ve/Le+Lt)),Math.min(le,Math.floor(q+(Le-qe)*Ve/Le+Lt)),xe)}const Ee=H[2*q+xe];let be=de,Ce=le;for(ke(me,H,de,q),H[2*le+xe]>Ee&&ke(me,H,de,le);beEe;)Ce--}H[2*de+xe]===Ee?ke(me,H,de,Ce):(Ce++,ke(me,H,Ce,le)),Ce<=q&&(de=Ce+1),q<=Ce&&(le=Ce-1)}}function ke(me,H,q,de){Oe(me,q,de),Oe(H,2*q,2*de),Oe(H,2*q+1,2*de+1)}function Oe(me,H,q){const de=me[H];me[H]=me[q],me[q]=de}function $e(me,H,q,de){const le=me-q,xe=H-de;return le*le+xe*xe}G.exports=ve,G.exports.fromVectorTileJs=ve,G.exports.fromGeojsonVt=function(me,H){H=H||{};var q={};for(var de in me)q[de]=new J(me[de].features,H),q[de].name=de,q[de].version=H.version,q[de].extent=H.extent;return ve({layers:q})},G.exports.GeoJSONWrapper=J;const He=me=>me[0],Ue=me=>me[1];class st{constructor(H,q=He,de=Ue,le=64,xe=Float64Array){this.nodeSize=le,this.points=H;const Ee=H.length<65536?Uint16Array:Uint32Array,be=this.ids=new Ee(H.length),Ce=this.coords=new xe(2*H.length);for(let Le=0;Le=be&&Ct<=Le&&Je>=Ce&&Je<=qe&&Lt.push(xe[Vn]);continue}const un=Math.floor((bn+Vt)/2);Ct=Ee[2*un],Je=Ee[2*un+1],Ct>=be&&Ct<=Le&&Je>=Ce&&Je<=qe&&Lt.push(xe[un]);const wn=(Ot+1)%2;(Ot===0?be<=Ct:Ce<=Je)&&(Ve.push(bn),Ve.push(un-1),Ve.push(wn)),(Ot===0?Le>=Ct:qe>=Je)&&(Ve.push(un+1),Ve.push(Vt),Ve.push(wn))}return Lt}(this.ids,this.coords,H,q,de,le,this.nodeSize)}within(H,q,de){return function(le,xe,Ee,be,Ce,Le){const qe=[0,le.length-1,0],Ze=[],Ve=Ce*Ce;for(;qe.length;){const Lt=qe.pop(),Ct=qe.pop(),Je=qe.pop();if(Ct-Je<=Le){for(let wn=Je;wn<=Ct;wn++)$e(xe[2*wn],xe[2*wn+1],Ee,be)<=Ve&&Ze.push(le[wn]);continue}const Ot=Math.floor((Je+Ct)/2),Vt=xe[2*Ot],bn=xe[2*Ot+1];$e(Vt,bn,Ee,be)<=Ve&&Ze.push(le[Ot]);const un=(Lt+1)%2;(Lt===0?Ee-Ce<=Vt:be-Ce<=bn)&&(qe.push(Je),qe.push(Ot-1),qe.push(un)),(Lt===0?Ee+Ce>=Vt:be+Ce>=bn)&&(qe.push(Ot+1),qe.push(Ct),qe.push(un))}return Ze}(this.ids,this.coords,H,q,de,this.nodeSize)}}const ft={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:me=>me},It=Math.fround||(We=new Float32Array(1),me=>(We[0]=+me,We[0]));var We;class Pt{constructor(H){this.options=rt(Object.create(ft),H),this.trees=new Array(this.options.maxZoom+1)}load(H){const{log:q,minZoom:de,maxZoom:le,nodeSize:xe}=this.options;q&&console.time("total time");const Ee=`prepare ${H.length} points`;q&&console.time(Ee),this.points=H;let be=[];for(let Ce=0;Ce=de;Ce--){const Le=+Date.now();be=this._cluster(be,Ce),this.trees[Ce]=new st(be,ht,bt,xe,Float32Array),q&&console.log("z%d: %d clusters in %dms",Ce,be.length,+Date.now()-Le)}return q&&console.timeEnd("total time"),this}getClusters(H,q){let de=((H[0]+180)%360+360)%360-180;const le=Math.max(-90,Math.min(90,H[1]));let xe=H[2]===180?180:((H[2]+180)%360+360)%360-180;const Ee=Math.max(-90,Math.min(90,H[3]));if(H[2]-H[0]>=360)de=-180,xe=180;else if(de>xe){const qe=this.getClusters([de,le,180,Ee],q),Ze=this.getClusters([-180,le,xe,Ee],q);return qe.concat(Ze)}const be=this.trees[this._limitZoom(q)],Ce=be.range(ut(de),dt(Ee),ut(xe),dt(le)),Le=[];for(const qe of Ce){const Ze=be.points[qe];Le.push(Ze.numPoints?yt(Ze):this.points[Ze.index])}return Le}getChildren(H){const q=this._getOriginId(H),de=this._getOriginZoom(H),le="No cluster with the specified id.",xe=this.trees[de];if(!xe)throw new Error(le);const Ee=xe.points[q];if(!Ee)throw new Error(le);const be=this.options.radius/(this.options.extent*Math.pow(2,de-1)),Ce=xe.within(Ee.x,Ee.y,be),Le=[];for(const qe of Ce){const Ze=xe.points[qe];Ze.parentId===H&&Le.push(Ze.numPoints?yt(Ze):this.points[Ze.index])}if(Le.length===0)throw new Error(le);return Le}getLeaves(H,q,de){const le=[];return this._appendLeaves(le,H,q=q||10,de=de||0,0),le}getTile(H,q,de){const le=this.trees[this._limitZoom(H)],xe=Math.pow(2,H),{extent:Ee,radius:be}=this.options,Ce=be/Ee,Le=(de-Ce)/xe,qe=(de+1+Ce)/xe,Ze={features:[]};return this._addTileFeatures(le.range((q-Ce)/xe,Le,(q+1+Ce)/xe,qe),le.points,q,de,xe,Ze),q===0&&this._addTileFeatures(le.range(1-Ce/xe,Le,1,qe),le.points,xe,de,xe,Ze),q===xe-1&&this._addTileFeatures(le.range(0,Le,Ce/xe,qe),le.points,-1,de,xe,Ze),Ze.features.length?Ze:null}getClusterExpansionZoom(H){let q=this._getOriginZoom(H)-1;for(;q<=this.options.maxZoom;){const de=this.getChildren(H);if(q++,de.length!==1)break;H=de[0].properties.cluster_id}return q}_appendLeaves(H,q,de,le,xe){const Ee=this.getChildren(q);for(const be of Ee){const Ce=be.properties;if(Ce&&Ce.cluster?xe+Ce.point_count<=le?xe+=Ce.point_count:xe=this._appendLeaves(H,Ce.cluster_id,de,le,xe):xeq&&(Ct+=Ot.numPoints||1)}if(Ct>Lt&&Ct>=be){let Je=qe.x*Lt,Ot=qe.y*Lt,Vt=Ee&&Lt>1?this._map(qe,!0):null;const bn=(Le<<5)+(q+1)+this.points.length;for(const un of Ve){const wn=Ze.points[un];if(wn.zoom<=q)continue;wn.zoom=q;const Vn=wn.numPoints||1;Je+=wn.x*Vn,Ot+=wn.y*Vn,wn.parentId=bn,Ee&&(Vt||(Vt=this._map(qe,!0)),Ee(Vt,this._map(wn)))}qe.parentId=bn,de.push(pt(Je/Ct,Ot/Ct,bn,Ct,Vt))}else if(de.push(qe),Ct>1)for(const Je of Ve){const Ot=Ze.points[Je];Ot.zoom<=q||(Ot.zoom=q,de.push(Ot))}}return de}_getOriginId(H){return H-this.points.length>>5}_getOriginZoom(H){return(H-this.points.length)%32}_map(H,q){if(H.numPoints)return q?rt({},H.properties):H.properties;const de=this.points[H.index].properties,le=this.options.map(de);return q&&le===de?rt({},le):le}}function pt(me,H,q,de,le){return{x:It(me),y:It(H),zoom:1/0,id:q,parentId:-1,numPoints:de,properties:le}}function Rt(me,H){const[q,de]=me.geometry.coordinates;return{x:It(ut(q)),y:It(dt(de)),zoom:1/0,index:H,parentId:-1}}function yt(me){return{type:"Feature",id:me.id,properties:Mt(me),geometry:{type:"Point",coordinates:[(H=me.x,360*(H-.5)),ct(me.y)]}};var H}function Mt(me){const H=me.numPoints,q=H>=1e4?`${Math.round(H/1e3)}k`:H>=1e3?Math.round(H/100)/10+"k":H;return rt(rt({},me.properties),{cluster:!0,cluster_id:me.id,point_count:H,point_count_abbreviated:q})}function ut(me){return me/360+.5}function dt(me){const H=Math.sin(me*Math.PI/180),q=.5-.25*Math.log((1+H)/(1-H))/Math.PI;return q<0?0:q>1?1:q}function ct(me){const H=(180-360*me)*Math.PI/180;return 360*Math.atan(Math.exp(H))/Math.PI-90}function rt(me,H){for(const q in H)me[q]=H[q];return me}function ht(me){return me.x}function bt(me){return me.y}function Wt(me,H,q,de){for(var le,xe=de,Ee=q-H>>1,be=q-H,Ce=me[H],Le=me[H+1],qe=me[q],Ze=me[q+1],Ve=H+3;Vexe)le=Ve,xe=Lt;else if(Lt===xe){var Ct=Math.abs(Ve-Ee);Ctde&&(le-H>3&&Wt(me,H,le,de),me[le+2]=xe,q-le>3&&Wt(me,le,q,de))}function Ut(me,H,q,de,le,xe){var Ee=le-q,be=xe-de;if(Ee!==0||be!==0){var Ce=((me-q)*Ee+(H-de)*be)/(Ee*Ee+be*be);Ce>1?(q=le,de=xe):Ce>0&&(q+=Ee*Ce,de+=be*Ce)}return(Ee=me-q)*Ee+(be=H-de)*be}function Jt(me,H,q,de){var le={id:me===void 0?null:me,type:H,geometry:q,tags:de,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+=de?(le*Le-Ce*xe)/2:Math.sqrt(Math.pow(Ce-le,2)+Math.pow(Le-xe,2))),le=Ce,xe=Le}var qe=H.length-3;H[2]=1,Wt(H,0,qe,q),H[qe+2]=1,H.size=Math.abs(Ee),H.start=0,H.end=H.size}function jt(me,H,q,de){for(var le=0;le1?1:q}function Cn(me,H,q,de,le,xe,Ee,be){if(de/=H,xe>=(q/=H)&&Ee=de)return null;for(var Ce=[],Le=0;Le=q&&Ct=de)){var Je=[];if(Ve==="Point"||Ve==="MultiPoint")Nn(Ze,Je,q,de,le);else if(Ve==="LineString")wt(Ze,Je,q,de,le,!1,be.lineMetrics);else if(Ve==="MultiLineString")At(Ze,Je,q,de,le,!1);else if(Ve==="Polygon")At(Ze,Je,q,de,le,!0);else if(Ve==="MultiPolygon")for(var Ot=0;Ot=q&&Ee<=de&&(H.push(me[xe]),H.push(me[xe+1]),H.push(me[xe+2]))}}function wt(me,H,q,de,le,xe,Ee){for(var be,Ce,Le=qt(me),qe=le===0?en:gt,Ze=me.start,Ve=0;Veq&&(Ce=qe(Le,Lt,Ct,Ot,Vt,q),Ee&&(Le.start=Ze+be*Ce)):bn>de?un=q&&(Ce=qe(Le,Lt,Ct,Ot,Vt,q),wn=!0),un>de&&bn<=de&&(Ce=qe(Le,Lt,Ct,Ot,Vt,de),wn=!0),!xe&&wn&&(Ee&&(Le.end=Ze+be*Ce),H.push(Le),Le=qt(me)),Ee&&(Ze+=be)}var Vn=me.length-3;Lt=me[Vn],Ct=me[Vn+1],Je=me[Vn+2],(bn=le===0?Lt:Ct)>=q&&bn<=de&&Xt(Le,Lt,Ct,Je),Vn=Le.length-3,xe&&Vn>=3&&(Le[Vn]!==Le[0]||Le[Vn+1]!==Le[1])&&Xt(Le,Le[0],Le[1],Le[2]),Le.length&&H.push(Le)}function qt(me){var H=[];return H.size=me.size,H.start=me.start,H.end=me.end,H}function At(me,H,q,de,le,xe){for(var Ee=0;EeEe.maxX&&(Ee.maxX=qe),Ze>Ee.maxY&&(Ee.maxY=Ze)}return Ee}function mt(me,H,q,de){var le=H.geometry,xe=H.type,Ee=[];if(xe==="Point"||xe==="MultiPoint")for(var be=0;be0&&H.size<(le?Ee:de))q.numPoints+=H.length/3;else{for(var be=[],Ce=0;CeEe)&&(q.numSimplified++,be.push(H[Ce]),be.push(H[Ce+1])),q.numPoints++;le&&function(Le,qe){for(var Ze=0,Ve=0,Lt=Le.length,Ct=Lt-2;Ve0===qe)for(Ve=0,Lt=Le.length;Ve24)throw new Error("maxZoom should be in the 0-24 range");if(H.promoteId&&H.generateId)throw new Error("promoteId and generateId cannot be used together.");var de=function(le,xe){var Ee=[];if(le.type==="FeatureCollection")for(var be=0;be1&&console.time("creation"),Ve=this.tiles[Ze]=ot(me,H,q,de,Ce),this.tileCoords.push({z:H,x:q,y:de}),Le)){Le>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",H,q,de,Ve.numFeatures,Ve.numPoints,Ve.numSimplified),console.timeEnd("creation"));var Lt="z"+H;this.stats[Lt]=(this.stats[Lt]||0)+1,this.total++}if(Ve.source=me,le){if(H===Ce.maxZoom||H===le)continue;var Ct=1<1&&console.time("clipping");var Je,Ot,Vt,bn,un,wn,Vn=.5*Ce.buffer/Ce.extent,rr=.5-Vn,$r=.5+Vn,sr=1+Vn;Je=Ot=Vt=bn=null,un=Cn(me,qe,q-Vn,q+$r,0,Ve.minX,Ve.maxX,Ce),wn=Cn(me,qe,q+rr,q+sr,0,Ve.minX,Ve.maxX,Ce),me=null,un&&(Je=Cn(un,qe,de-Vn,de+$r,1,Ve.minY,Ve.maxY,Ce),Ot=Cn(un,qe,de+rr,de+sr,1,Ve.minY,Ve.maxY,Ce),un=null),wn&&(Vt=Cn(wn,qe,de-Vn,de+$r,1,Ve.minY,Ve.maxY,Ce),bn=Cn(wn,qe,de+rr,de+sr,1,Ve.minY,Ve.maxY,Ce),wn=null),Le>1&&console.timeEnd("clipping"),be.push(Je||[],H+1,2*q,2*de),be.push(Ot||[],H+1,2*q,2*de+1),be.push(Vt||[],H+1,2*q+1,2*de),be.push(bn||[],H+1,2*q+1,2*de+1)}}},Bt.prototype.getTile=function(me,H,q){var de=this.options,le=de.extent,xe=de.debug;if(me<0||me>24)return null;var Ee=1<1&&console.log("drilling down to z%d-%d-%d",me,H,q);for(var Ce,Le=me,qe=H,Ze=q;!Ce&&Le>0;)Le--,qe=Math.floor(qe/2),Ze=Math.floor(Ze/2),Ce=this.tiles[pn(Le,qe,Ze)];return Ce&&Ce.source?(xe>1&&console.log("found parent tile z%d-%d-%d",Le,qe,Ze),xe>1&&console.time("drilling down"),this.splitTile(Ce.source,Le,qe,Ze,me,H,q),xe>1&&console.timeEnd("drilling down"),this.tiles[be]?dn(this.tiles[be],le):null):null};class Zn extends A{constructor(H,q,de,le){super(H,q,de,On),le&&(this.loadGeoJSON=le)}loadData(H,q){var de;(de=this._pendingRequest)===null||de===void 0||de.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const le=!!(H&&H.request&&H.request.collectResourceTiming)&&new o.RequestPerformance(H.request);this._pendingCallback=q,this._pendingRequest=this.loadGeoJSON(H,(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 '${H.source}' is not a valid GeoJSON object.`));{R(Ee,!0);try{if(H.filter){const Ce=o.createExpression(H.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ce.result==="error")throw new Error(Ce.value.map(qe=>`${qe.key}: ${qe.message}`).join(", "));Ee={type:"FeatureCollection",features:Ee.features.filter(qe=>Ce.value.evaluate({zoom:0},qe))}}this._geoJSONIndex=H.cluster?new Pt(function({superclusterOptions:Ce,clusterProperties:Le}){if(!Le||!Ce)return Ce;const qe={},Ze={},Ve={accumulated:null,zoom:0},Lt={properties:null},Ct=Object.keys(Le);for(const Je of Ct){const[Ot,Vt]=Le[Je],bn=o.createExpression(Vt),un=o.createExpression(typeof Ot=="string"?[Ot,["accumulated"],["get",Je]]:Ot);qe[Je]=bn.value,Ze[Je]=un.value}return Ce.map=Je=>{Lt.properties=Je;const Ot={};for(const Vt of Ct)Ot[Vt]=qe[Vt].evaluate(Ve,Lt);return Ot},Ce.reduce=(Je,Ot)=>{Lt.properties=Ot;for(const Vt of Ct)Ve.accumulated=Je[Vt],Je[Vt]=Ze[Vt].evaluate(Ve,Lt)},Ce}(H)).load(Ee.features):function(Ce,Le){return new Bt(Ce,Le)}(Ee,H.geojsonVtOptions)}catch(Ce){return q(Ce)}this.loaded={};const be={};if(le){const Ce=le.finish();Ce&&(be.resourceTiming={},be.resourceTiming[H.source]=JSON.parse(JSON.stringify(Ce)))}q(null,be)}})}reloadTile(H,q){const de=this.loaded;return de&&de[H.uid]?super.reloadTile(H,q):this.loadTile(H,q)}loadGeoJSON(H,q){if(H.request)return o.getJSON(H.request,q);if(typeof H.data=="string")try{q(null,JSON.parse(H.data))}catch{q(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`))}else q(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(H,q){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),q()}getClusterExpansionZoom(H,q){try{q(null,this._geoJSONIndex.getClusterExpansionZoom(H.clusterId))}catch(de){q(de)}}getClusterChildren(H,q){try{q(null,this._geoJSONIndex.getChildren(H.clusterId))}catch(de){q(de)}}getClusterLeaves(H,q){try{q(null,this._geoJSONIndex.getLeaves(H.clusterId,H.limit,H.offset))}catch(de){q(de)}}}class Xn{constructor(H){this.self=H,this.actor=new o.Actor(H,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:A,geojson:Zn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(q,de)=>{if(this.workerSourceTypes[q])throw new Error(`Worker source with name "${q}" already registered.`);this.workerSourceTypes[q]=de},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(H,q){this.referrer=q}setImages(H,q,de){this.availableImages[H]=q;for(const le in this.workerSources[H]){const xe=this.workerSources[H][le];for(const Ee in xe)xe[Ee].availableImages=q}de()}setLayers(H,q,de){this.getLayerIndex(H).replace(q),de()}updateLayers(H,q,de){this.getLayerIndex(H).update(q.layers,q.removedIds),de()}loadTile(H,q,de){this.getWorkerSource(H,q.type,q.source).loadTile(q,de)}loadDEMTile(H,q,de){this.getDEMWorkerSource(H,q.source).loadTile(q,de)}reloadTile(H,q,de){this.getWorkerSource(H,q.type,q.source).reloadTile(q,de)}abortTile(H,q,de){this.getWorkerSource(H,q.type,q.source).abortTile(q,de)}removeTile(H,q,de){this.getWorkerSource(H,q.type,q.source).removeTile(q,de)}removeDEMTile(H,q){this.getDEMWorkerSource(H,q.source).removeTile(q)}removeSource(H,q,de){if(!this.workerSources[H]||!this.workerSources[H][q.type]||!this.workerSources[H][q.type][q.source])return;const le=this.workerSources[H][q.type][q.source];delete this.workerSources[H][q.type][q.source],le.removeSource!==void 0?le.removeSource(q,de):de()}loadWorkerSource(H,q,de){try{this.self.importScripts(q.url),de()}catch(le){de(le.toString())}}syncRTLPluginState(H,q,de){try{o.plugin.setState(q);const le=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&le!=null){this.self.importScripts(le);const xe=o.plugin.isParsed();de(xe?void 0:new Error(`RTL Text Plugin failed to import scripts from ${le}`),xe)}}catch(le){de(le.toString())}}getAvailableImages(H){let q=this.availableImages[H];return q||(q=[]),q}getLayerIndex(H){let q=this.layerIndexes[H];return q||(q=this.layerIndexes[H]=new v),q}getWorkerSource(H,q,de){if(this.workerSources[H]||(this.workerSources[H]={}),this.workerSources[H][q]||(this.workerSources[H][q]={}),!this.workerSources[H][q][de]){const le={send:(xe,Ee,be)=>{this.actor.send(xe,Ee,be,H)}};this.workerSources[H][q][de]=new this.workerSourceTypes[q](le,this.getLayerIndex(H),this.getAvailableImages(H))}return this.workerSources[H][q][de]}getDEMWorkerSource(H,q){return this.demWorkerSources[H]||(this.demWorkerSources[H]={}),this.demWorkerSources[H][q]||(this.demWorkerSources[H][q]=new N),this.demWorkerSources[H][q]}enforceCacheSizeLimit(H,q){o.enforceCacheSizeLimit(q)}}return o.isWorker()&&(self.worker=new Xn(self)),Xn}),s(["./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,E=new Blob([""],{type:"text/javascript"}),D=URL.createObjectURL(E);try{b=new Worker(D),g=!0}catch{g=!1}return b&&b.terminate(),URL.revokeObjectURL(D),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 E=b.getImageData(0,0,1,1);return E&&E.width===g.width}()?(v[h=l&&l.failIfMajorPerformanceCaveat]===void 0&&(v[h]=function(g){var b,E=function(D){var $=document.createElement("canvas"),U=Object.create(p.webGLContextAttributes);return U.failIfMajorPerformanceCaveat=D,$.getContext("webgl",U)||$.getContext("experimental-webgl",U)}(g);if(!E)return!1;try{b=E.createShader(E.VERTEX_SHADER)}catch{return!1}return!(!b||E.isContextLost())&&(E.shaderSource(b,"void main() {}"),E.compileShader(b),E.getShaderParameter(b,E.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 E=0;E-1);U++,E[U]=$,D[U]=W,D[U+1]=M}for(let $=0,U=0;${let $=this.entries[b];$||($=this.entries[b]={glyphs:{},requests:{},ranges:{}});let U=$.glyphs[E];if(U!==void 0)return void D(null,{stack:b,id:E,glyph:U});if(U=this._tinySDF($,b,E),U)return $.glyphs[E]=U,void D(null,{stack:b,id:E,glyph:U});const W=Math.floor(E/256);if(256*W>65535)return void D(new Error("glyphs > 65535 not supported"));if($.ranges[W])return void D(null,{stack:b,id:E,glyph:U});let te=$.requests[W];te||(te=$.requests[W]=[],B.loadGlyphRange(b,W,this.url,this.requestManager,(ae,fe)=>{if(fe){for(const Se in fe)this._doesCharSupportLocalGlyph(+Se)||($.glyphs[+Se]=fe[+Se]);$.ranges[W]=!0}for(const Se of te)Se(ae,fe);delete $.requests[W]})),te.push((ae,fe)=>{ae?D(ae):fe&&D(null,{stack:b,id:E,glyph:fe[E]||null})})},(b,E)=>{if(b)h(b);else if(E){const D={};for(const{stack:$,id:U,glyph:W}of E)(D[$]||(D[$]={}))[U]=W&&{id:W.id,bitmap:W.bitmap.clone(),metrics:W.metrics};h(null,D)}})}_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 E=l.tinySDF;if(!E){let $="400";/bold/i.test(h)?$="900":/medium/i.test(h)?$="500":/light/i.test(h)&&($="200"),E=l.tinySDF=new B.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:b,fontWeight:$})}const D=E.draw(String.fromCharCode(g));return{id:g,bitmap:new o.AlphaImage({width:D.width||30,height:D.height||30},D.data),metrics:{width:D.glyphWidth||24,height:D.glyphHeight||24,left:D.glyphLeft||0,top:D.glyphTop-27||-8,advance:D.glyphAdvance||24}}}}B.loadGlyphRange=function(x,l,h,g,b){const E=256*l,D=E+255,$=g.transformRequest(h.replace("{fontstack}",x).replace("{range}",`${E}-${D}`),o.ResourceType.Glyphs);o.getArrayBuffer($,(U,W)=>{if(U)b(U);else if(W){const te={};for(const ae of o.parseGlyphPbf(W))te[ae.id]=ae;b(null,te)}})},B.TinySDF=class{constructor({fontSize:x=24,buffer:l=3,radius:h=8,cutoff:g=.25,fontFamily:b="sans-serif",fontWeight:E="normal",fontStyle:D="normal"}={}){this.buffer=l,this.cutoff=g,this.radius=h;const $=this.size=x+4*l,U=this._createCanvas($),W=this.ctx=U.getContext("2d",{willReadFrequently:!0});W.font=`${D} ${E} ${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:E}=this.ctx.measureText(x),D=Math.ceil(h),$=Math.min(this.size-this.buffer,Math.ceil(E-b)),U=Math.min(this.size-this.buffer,D+Math.ceil(g)),W=$+2*this.buffer,te=U+2*this.buffer,ae=Math.max(W*te,0),fe=new Uint8ClampedArray(ae),Se={data:fe,width:W,height:te,glyphWidth:$,glyphHeight:U,glyphTop:D,glyphLeft:0,glyphAdvance:l};if($===0||U===0)return Se;const{ctx:_e,buffer:we,gridInner:Be,gridOuter:je}=this;_e.clearRect(we,we,$,U),_e.fillText(x,we,we+D);const et=_e.getImageData(we,we,$,U);je.fill(M,0,ae),Be.fill(0,0,ae);for(let Me=0;Me0?_t*_t:0,Be[xt]=_t<0?_t*_t:0}}O(je,0,0,W,te,W,this.f,this.v,this.z),O(Be,we,we,$,U,W,this.f,this.v,this.z);for(let Me=0;Me1&&(U=l[++$]);const te=Math.abs(W-U.left),ae=Math.abs(W-U.right),fe=Math.min(te,ae);let Se;const _e=E/g*(b+1);if(U.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[D+W]=Math.max(0,Math.min(255,Se+128))}}}addRegularDash(l){for(let $=l.length-1;$>=0;--$){const U=l[$],W=l[$+1];U.zeroLength?l.splice($,1):W&&W.isDash===U.isDash&&(W.left=U.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 E=0,D=l[E];for(let $=0;$1&&(D=l[++E]);const U=Math.abs($-D.left),W=Math.abs($-D.right),te=Math.min(U,W);this.data[b+$]=Math.max(0,Math.min(255,(D.isDash?te:-te)+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 E=0;for(let $=0;${b.send(l,h,E)},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 se(x,l,h){const g=function(b,E){if(b)return h(b);if(E){const D=o.pick(o.extend(E,x),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);E.vector_layers&&(D.vectorLayers=E.vector_layers,D.vectorLayerIds=D.vectorLayers.map($=>$.id)),h(null,D)}};return x.url?o.getJSON(l.transformRequest(x.url,o.ResourceType.Source),g):o.exported.frame(()=>g(null,x))}Y.Actor=o.Actor;class ee{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),E=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*h),D=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 ee(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 E(D,$){return delete l.request,l.aborted?h(null):D&&D.status!==404?h(D):($&&$.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,E.bind(this)):(l.actor=this.dispatcher.getActor(),l.request=l.actor.send("loadTile",b,E.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 J 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=se(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 ee(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,E,D)=>{if(delete l.request,l.aborted)l.state="unloaded",h(null);else if(b)l.state="errored",h(b);else if(E){this.map._refreshExpiredTiles&&l.setExpiryData(D);const $=this.map.painter.context,U=$.gl;l.texture=this.map.painter.getTileTexture(E.width),l.texture?l.texture.update(E,{useMipmap:!0}):(l.texture=new A($,E,U.RGBA,{useMipmap:!0}),l.texture.bind(U.LINEAR,U.CLAMP_TO_EDGE,U.LINEAR_MIPMAP_NEAREST),$.extTextureFilterAnisotropic&&U.texParameterf(U.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 ve;class ie extends J{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(E,D){E&&(l.state="errored",h(E)),D&&(l.dem=D,l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0,l.state="loaded",h(null))}l.request=o.getImage(this.map._requestManager.transformRequest(g,o.ResourceType.Tile),function(E,D){if(delete l.request,l.aborted)l.state="unloaded",h(null);else if(E)l.state="errored",h(E);else if(D){this.map._refreshExpiredTiles&&l.setExpiryData(D),delete D.cacheControl,delete D.expires;const $=o.isImageBitmap(D)&&(ve==null&&(ve=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ve)?D:o.exported.getImageData(D,1),U={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",U,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,E=h.x===0?l.wrap-1:l.wrap,D=(h.x+1+g)%g,$=h.x+1===g?l.wrap+1:l.wrap,U={};return U[new o.OverscaledTileID(l.overscaledZ,E,h.z,b,h.y).key]={backfilled:!1},U[new o.OverscaledTileID(l.overscaledZ,$,h.z,D,h.y).key]={backfilled:!1},h.y>0&&(U[new o.OverscaledTileID(l.overscaledZ,E,h.z,b,h.y-1).key]={backfilled:!1},U[new o.OverscaledTileID(l.overscaledZ,l.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},U[new o.OverscaledTileID(l.overscaledZ,$,h.z,D,h.y-1).key]={backfilled:!1}),h.y+1{if(this._pendingLoads--,this._removed||E&&E.abandoned)return void this.fire(new o.Event("dataabort",{dataType:"source",sourceDataType:l}));let D=null;if(E&&E.resourceTiming&&E.resourceTiming[this.id]&&(D=E.resourceTiming[this.id].slice(0)),b)return void this.fire(new o.ErrorEvent(b));const $={dataType:"source",sourceDataType:l};this._collectResourceTiming&&D&&D.length>0&&o.extend($,{resourceTiming:D}),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,(E,D)=>(delete l.request,l.unloadVectorData(),l.aborted?h(null):E?h(E):(l.loadVectorData(D,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 E=1/0,D=1/0,$=-1/0,U=-1/0;for(const fe of b)E=Math.min(E,fe.x),D=Math.min(D,fe.y),$=Math.max($,fe.x),U=Math.max(U,fe.y);const W=Math.max($-E,U-D),te=Math.max(0,Math.floor(-Math.log(W)/Math.LN2)),ae=Math.pow(2,te);return new o.CanonicalTileID(te,Math.floor((E+$)/2*ae),Math.floor((D+U)/2*ae))}(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 A(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 Ie 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 A(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(E=>!Array.isArray(E)||E.length!==2||E.some(D=>typeof D!="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 A(h,this.canvas,g.RGBA,{premultiply:!0});for(const b in this.tiles){const E=this.tiles[b];E.state!=="loaded"&&(E.state="loaded",E.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 Pe={vector:Z,raster:J,"raster-dem":ie,geojson:ce,video:Ie,image:ye,canvas:Te};function De(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 Re(x,l,h,g,b,E){const D=function(ae,fe,Se){if(ae)for(const _e of ae){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),$=E.maxPitchScaleFactor(),U=x.tilesIn(g,$,D);U.sort(ke);const W=[];for(const ae of U)W.push({wrappedTileID:ae.tileID.wrapped().key,queryResults:ae.tile.queryRenderedFeatures(l,h,x._state,ae.queryGeometry,ae.cameraQueryGeometry,ae.scale,b,E,$,De(x.transform,ae.tileID))});const te=function(ae){const fe={},Se={};for(const _e of ae){const we=_e.queryResults,Be=_e.wrappedTileID,je=Se[Be]=Se[Be]||{};for(const et in we){const Me=we[et],at=je[et]=je[et]||{},nt=fe[et]=fe[et]||[];for(const xt of Me)at[xt.featureIndex]||(at[xt.featureIndex]=!0,nt.push(xt))}}return fe}(W);for(const ae in te)te[ae].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 te}function ke(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 Oe{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,E){const D={};if(!E)return D;for(const $ of b){const U=$.layerIds.map(W=>E.getLayer(W)).filter(Boolean);if(U.length!==0){$.layers=U,$.stateDependentLayerIds&&($.stateDependentLayers=$.stateDependentLayerIds.map(W=>U.filter(te=>te.id===W)[0]));for(const W of U)D[W.id]=$}}return D}(l.buckets,h.style),this.hasSymbolBuckets=!1;for(const b in this.buckets){const E=this.buckets[b];if(E instanceof o.SymbolBucket){if(this.hasSymbolBuckets=!0,!g)break;E.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const b in this.buckets){const E=this.buckets[b];if(E instanceof o.SymbolBucket&&E.hasRTLText){this.hasRTLText=!0,o.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const b in this.buckets){const E=this.buckets[b];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(b).queryRadius(E))}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 A(l,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new A(l,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(l){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(l,this.imageAtlasTexture)}queryRenderedFeatures(l,h,g,b,E,D,$,U,W,te){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:b,cameraQueryGeometry:E,scale:D,tileSize:this.tileSize,pixelPosMatrix:te,transform:U,params:$,queryPadding:this.queryPadding*W},l,h,g):{}}querySourceFeatures(l,h){const g=this.latestFeatureIndex;if(!g||!g.rawTileData)return;const b=g.loadVTLayers(),E=h?h.sourceLayer:"",D=b._geojsonTileLayer||b[E];if(!D)return;const $=o.createFilter(h&&h.filter),{z:U,x:W,y:te}=this.tileID.canonical,ae={z:U,x:W,y:te};for(let fe=0;feg)b=!1;else if(h)if(this.expirationTime{this.remove(l,E)},g)),this.data[b].push(E),this.order.push(b),this.order.length>this.max){const D=this._getAndRemoveByKey(this.order[0]);D&&this.onRemove(D)}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),E=this.data[g][b];return this.data[g].splice(b,1),E.timeout&&clearTimeout(E.timeout),this.data[g].length===0&&delete this.data[g],this.onRemove(E.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 He{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 E in this.state[l])E!==b&&(this.deletedStates[l][E]=null)}else if(this.deletedStates[l]&&this.deletedStates[l][b]===null){this.deletedStates[l][b]={};for(const E in this.state[l][b])g[E]||(this.deletedStates[l][b][E]=null)}else for(const E in g)this.deletedStates[l]&&this.deletedStates[l][b]&&this.deletedStates[l][b][E]===null&&delete this.deletedStates[l][b][E]}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 E=this.deletedStates[l][h];if(E===null)return{};for(const D in E)delete b[D]}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 E={};for(const D in this.stateChanges[b])this.state[b][D]||(this.state[b][D]={}),o.extend(this.state[b][D],this.stateChanges[b][D]),E[D]=this.state[b][D];g[b]=E}for(const b in this.deletedStates){this.state[b]=this.state[b]||{};const E={};if(this.deletedStates[b]===null)for(const D in this.state[b])E[D]={},this.state[b][D]={};else for(const D in this.deletedStates[b]){if(this.deletedStates[b][D]===null)this.state[b][D]={};else for(const $ of Object.keys(this.deletedStates[b][D]))delete this.state[b][D][$];E[D]=this.state[b][D]}g[b]=g[b]||{},o.extend(g[b],E)}if(this.stateChanges={},this.deletedStates={},Object.keys(g).length!==0)for(const b in l)l[b].setFeatureState(g,h)}}class Ue 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,E,D,$){const U=new Pe[E.type](b,E,D,$);if(U.id!==b)throw new Error(`Expected Source id to be ${b} instead of ${U.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],U),U}(l,h,g,this),this._tiles={},this._cache=new $e(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new He}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(st).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 E=g.tileID,D=b.tileID,$=new o.pointGeometry(E.canonical.x,E.canonical.y)._rotate(this.transform.angle),U=new o.pointGeometry(D.canonical.x,D.canonical.y)._rotate(this.transform.angle);return E.overscaledZ-D.overscaledZ||U.y-$.y||U.x-$.x}).map(g=>g.tileID.key):h.map(g=>g.tileID).sort(st).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(D)>1&&(Math.abs(D+U)===1?D+=U:Math.abs(D-U)===1&&(D-=U)),E.dem&&b.dem&&(b.dem.backfillBorder(E.dem,D,$),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 E in this._tiles){let D=this._tiles[E];if(b[E]||!D.hasData()||D.tileID.overscaledZ<=h||D.tileID.overscaledZ>g)continue;let $=D.tileID;for(;D&&D.tileID.overscaledZ>h+1;){const W=D.tileID.scaledTo(D.tileID.overscaledZ-1);D=this._tiles[W.key],D&&D.hasData()&&($=W)}let U=$;for(;U.overscaledZ>h;)if(U=U.scaledTo(U.overscaledZ-1),l[U.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),E=this._getLoadedTile(b);if(E)return E}}_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),E=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,b):b;this._cache.setMaxSize(E)}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 E=this._tiles[b];E.tileID=E.tileID.unwrapTo(E.tileID.wrap+h),g[E.tileID.key]=E}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),E=Math.max(b-Ue.maxOverzooming,this._source.minzoom),D=Math.max(b+Ue.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const W={};for(const te of g)if(te.canonical.z>this._source.minzoom){const ae=te.scaledTo(te.canonical.z-1);W[ae.key]=ae;const fe=te.scaledTo(Math.max(this._source.minzoom,Math.min(te.canonical.z,5)));W[fe.key]=fe}g=g.concat(Object.values(W))}const $=this._updateRetainedTiles(g,b);if(ft(this._source.type)){const W={},te={},ae=Object.keys($);for(const fe of ae){const Se=$[fe],_e=this._tiles[fe];if(!_e||_e.fadeEndTime&&_e.fadeEndTime<=o.exported.now())continue;const we=this.findLoadedParent(Se,E);we&&(this._addTile(we.tileID),W[we.tileID.key]=we.tileID),te[fe]=Se}this._retainLoadedChildren(te,b,D,$);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 Be in fe)fe[Be].isChildOf(we.tileID)&&delete fe[Be]}}for(const _e in this._tiles)fe[_e]||(this._coveredTiles[_e]=!0)}}for(const W in $)this._tiles[W].clearFadeHold();const U=o.keysDifference(this._tiles,$);for(const W of U){const te=this._tiles[W];te.hasSymbolBuckets&&!te.holdingForFade()?te.setHoldDuration(this.map._fadeDuration):te.hasSymbolBuckets&&!te.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={},E=Math.max(h-Ue.maxOverzooming,this._source.minzoom),D=Math.max(h+Ue.maxUnderzooming,this._source.minzoom),$={};for(const U of l){const W=this._addTile(U);g[U.key]=U,W.hasData()||hthis._source.maxzoom){const ae=U.children(this._source.maxzoom)[0],fe=this.getTile(ae);if(fe&&fe.hasData()){g[ae.key]=ae;continue}}else{const ae=U.children(this._source.maxzoom);if(g[ae[0].key]&&g[ae[1].key]&&g[ae[2].key]&&g[ae[3].key])continue}let te=W.wasRequested();for(let ae=U.overscaledZ-1;ae>=E;--ae){const fe=U.scaledTo(ae);if(b[fe.key]||(b[fe.key]=!0,W=this.getTile(fe),!W&&te&&(W=this._addTile(fe)),W&&(g[fe.key]=fe,te=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 E=b.scaledTo(b.overscaledZ-1);if(g=this._getLoadedTile(E),g)break;b=E}for(const E of h)this._loadedParentTiles[E]=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 Oe(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=[],E=this.transform;if(!E)return b;const D=g?E.getCameraQueryGeometry(l):l,$=l.map(_e=>E.pointCoordinate(_e,this.terrain)),U=D.map(_e=>E.pointCoordinate(_e,this.terrain)),W=this.getIds();let te=1/0,ae=1/0,fe=-1/0,Se=-1/0;for(const _e of U)te=Math.min(te,_e.x),ae=Math.min(ae,_e.y),fe=Math.max(fe,_e.x),Se=Math.max(Se,_e.y);for(let _e=0;_e=0&&Me[1].y+et>=0){const at=$.map(xt=>Be.getTilePoint(xt)),nt=U.map(xt=>Be.getTilePoint(xt));b.push({tile:we,tileID:Be,queryGeometry:at,cameraQueryGeometry:nt,scale:je})}}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(ft(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 st(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 ft(x){return x==="raster"||x==="image"||x==="video"}Ue.maxOverzooming=10,Ue.maxUnderzooming=3;const It="mapboxgl_preloaded_worker_pool";class We{constructor(){this.active={}}acquire(l){if(!this.workers)for(this.workers=[];this.workers.length{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[It]}numActive(){return Object.keys(this.active).length}}const Pt=Math.floor(o.exported.hardwareConcurrency/2);let pt;function Rt(){return pt||(pt=new We),pt}function yt(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 Mt(x){x=x.slice();const l=Object.create(null);for(let h=0;h0?(b-D)/$:0;return this.points[E].mult(1-U).add(this.points[h].mult(U))}}function Fe(x,l){let h=!0;return x==="always"||x!=="never"&&l!=="never"||(h=!1),h}class Ge{constructor(l,h,g){const b=this.boxCells=[],E=this.circleCells=[];this.xCellCount=Math.ceil(l/g),this.yCellCount=Math.ceil(h/g);for(let D=0;Dthis.width||b<0||h>this.height)return[];const U=[];if(l<=0&&h<=0&&this.width<=g&&this.height<=b){if(E)return[{key:null,x1:l,y1:h,x2:g,y2:b}];for(let W=0;W0}hitTestCircle(l,h,g,b,E){const D=l-g,$=l+g,U=h-g,W=h+g;if($<0||D>this.width||W<0||U>this.height)return!1;const te=[];return this._forEachCell(D,U,$,W,this._queryCellCircle,te,{hitTest:!0,overlapMode:b,circle:{x:l,y:h,radius:g},seenUids:{box:{},circle:{}}},E),te.length>0}_queryCell(l,h,g,b,E,D,$,U){const{seenUids:W,hitTest:te,overlapMode:ae}=$,fe=this.boxCells[E];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!W.box[we]){W.box[we]=!0;const Be=4*we,je=this.boxKeys[we];if(l<=_e[Be+2]&&h<=_e[Be+3]&&g>=_e[Be+0]&&b>=_e[Be+1]&&(!U||U(je))&&(!te||!Fe(ae,je.overlapMode))&&(D.push({key:je,x1:_e[Be],y1:_e[Be+1],x2:_e[Be+2],y2:_e[Be+3]}),te))return!0}}const Se=this.circleCells[E];if(Se!==null){const _e=this.circles;for(const we of Se)if(!W.circle[we]){W.circle[we]=!0;const Be=3*we,je=this.circleKeys[we];if(this._circleAndRectCollide(_e[Be],_e[Be+1],_e[Be+2],l,h,g,b)&&(!U||U(je))&&(!te||!Fe(ae,je.overlapMode))){const et=_e[Be],Me=_e[Be+1],at=_e[Be+2];if(D.push({key:je,x1:et-at,y1:Me-at,x2:et+at,y2:Me+at}),te)return!0}}}return!1}_queryCellCircle(l,h,g,b,E,D,$,U){const{circle:W,seenUids:te,overlapMode:ae}=$,fe=this.boxCells[E];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!te.box[we]){te.box[we]=!0;const Be=4*we,je=this.boxKeys[we];if(this._circleAndRectCollide(W.x,W.y,W.radius,_e[Be+0],_e[Be+1],_e[Be+2],_e[Be+3])&&(!U||U(je))&&!Fe(ae,je.overlapMode))return D.push(!0),!0}}const Se=this.circleCells[E];if(Se!==null){const _e=this.circles;for(const we of Se)if(!te.circle[we]){te.circle[we]=!0;const Be=3*we,je=this.circleKeys[we];if(this._circlesCollide(_e[Be],_e[Be+1],_e[Be+2],W.x,W.y,W.radius)&&(!U||U(je))&&!Fe(ae,je.overlapMode))return D.push(!0),!0}}}_forEachCell(l,h,g,b,E,D,$,U){const W=this._convertToXCellCoord(l),te=this._convertToYCellCoord(h),ae=this._convertToXCellCoord(g),fe=this._convertToYCellCoord(b);for(let Se=W;Se<=ae;Se++)for(let _e=te;_e<=fe;_e++)if(E.call(this,l,h,g,b,this.xCellCount*_e+Se,D,$,U))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,E,D){const $=b-l,U=E-h,W=g+D;return W*W>$*$+U*U}_circleAndRectCollide(l,h,g,b,E,D,$){const U=(D-b)/2,W=Math.abs(l-(b+U));if(W>U+g)return!1;const te=($-E)/2,ae=Math.abs(h-(E+te));if(ae>te+g)return!1;if(W<=U||ae<=te)return!0;const fe=W-U,Se=ae-te;return fe*fe+Se*Se<=g*g}}function Zt(x,l,h,g,b){const E=o.create();return l?(o.scale(E,E,[1/b,1/b,1]),h||o.rotateZ(E,E,g.angle)):o.multiply(E,g.labelPlaneMatrix,x),E}function cn(x,l,h,g,b){if(l){const E=o.clone(x);return o.scale(E,E,[b,b,1]),h||o.rotateZ(E,E,-g.angle),E}return g.glCoordMatrix}function jt(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],yn(g,g,l));const b=g[3];return{point:new o.pointGeometry(g[0]/b,g[1]/b),signedDistanceFromCamera:b}}function Kt(x,l){return .5+x/l*.5}function nn(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 Cn(x,l,h,g,b,E,D,$,U,W){const te=g?x.textSizeData:x.iconSizeData,ae=o.evaluateSizeForZoom(te,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,Be=h.transform.width/h.transform.height;let je=!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,E,D,$,U,W,te,ae,fe,Se,_e,we){const Be=l/24,je=x.lineOffsetX*Be,et=x.lineOffsetY*Be;let Me;if(x.numGlyphs>1){const at=x.glyphStartIndex+x.numGlyphs,nt=x.lineStartIndex,xt=x.lineStartIndex+x.lineLength,_t=Nn(Be,$,je,et,h,te,ae,x,U,E,fe,_e,we);if(!_t)return{notEnoughRoom:!0};const Ft=jt(_t.first.point,D,we).point,vt=jt(_t.last.point,D,we).point;if(g&&!h){const sn=wt(x.writingMode,Ft,vt,Se);if(sn)return sn}Me=[_t.first];for(let sn=x.glyphStartIndex+1;sn0?Ft.point:At(ae,_t,nt,1,b,we),sn=wt(x.writingMode,nt,vt,Se);if(sn)return sn}const at=Xt(Be*$.getoffsetX(x.glyphStartIndex),je,et,h,te,ae,x.segment,x.lineStartIndex,x.lineStartIndex+x.lineLength,U,E,fe,_e,we);if(!at)return{notEnoughRoom:!0};Me=[at]}for(const at of Me)o.addDynamicAttributes(W,at.point,at.angle);return{}}function At(x,l,h,g,b,E){const D=jt(x.add(x.sub(l)._unit()),b,E).point,$=h.sub(D);return h.add($._mult(g/$.mag()))}function Xt(x,l,h,g,b,E,D,$,U,W,te,ae,fe,Se){const _e=g?x-l:x+l;let we=_e>0?1:-1,Be=0;g&&(we*=-1,Be=Math.PI),we<0&&(Be+=Math.PI);let je=we>0?$+D:$+D+1,et=b,Me=b,at=0,nt=0;const xt=Math.abs(_e),_t=[];for(;at+nt<=xt;){if(je+=we,je<$||je>=U)return null;if(Me=et,_t.push(et),et=ae[je],et===void 0){const fn=new o.pointGeometry(W.getx(je),W.gety(je)),Fn=jt(fn,te,Se);if(Fn.signedDistanceFromCamera>0)et=ae[je]=Fn.point;else{const Un=je-we;et=At(at===0?E:new o.pointGeometry(W.getx(Un),W.gety(Un)),fn,Me,xt-at+1,te,Se)}}at+=nt,nt=Me.dist(et)}const Ft=(xt-at)/nt,vt=et.sub(Me),sn=vt.mult(Ft)._add(Me);sn._add(vt._unit()._perp()._mult(h*we));const Yt=Be+Math.atan2(et.y-Me.y,et.x-Me.x);return _t.push(sn),{point:sn,angle:fe?Yt:0,path:_t}}const en=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function gt(x,l){for(let h=0;h=1;er--)Pn.push(Fn.path[er]);for(let er=1;erjt(ir,U,_e));Pn=er.some(ir=>ir.signedDistanceFromCamera<=0)?[]:er.map(ir=>ir.point)}let hr=[];if(Pn.length>0){const er=Pn[0].clone(),ir=Pn[0].clone();for(let vr=1;vr=sn.x&&ir.x<=Yt.x&&er.y>=sn.y&&ir.y<=Yt.y?[Pn]:ir.xYt.x||ir.yYt.y?[]:o.clipLine([Pn],sn.x,sn.y,Yt.x,Yt.y)}for(const er of hr){fn.reset(er,.25*vt);let ir=0;ir=fn.length<=.5*vt?1:Math.ceil(fn.paddedLength/fr)+1;for(let vr=0;vr=this.screenRightBoundary||bthis.screenBottomBoundary}isInsideGrid(l,h,g,b){return g>=0&&l=0&&hg.collisionGroupID===h}}return this.collisionGroups[l]}}function Zn(x,l,h,g,b){const{horizontalAlign:E,verticalAlign:D}=o.getAnchorAlignment(x),$=-(E-.5)*l,U=-(D-.5)*h,W=o.evaluateVariableOffset(x,g);return new o.pointGeometry($+W[0]*b,U+W[1]*b)}function Xn(x,l,h,g,b,E){const{x1:D,x2:$,y1:U,y2:W,anchorPointX:te,anchorPointY:ae}=x,fe=new o.pointGeometry(l,h);return g&&fe._rotate(b?E:-E),{x1:D+fe.x,y1:U+fe.y,x2:$+fe.x,y2:W+fe.y,anchorPointX:te,anchorPointY:ae}}class me{constructor(l,h,g,b,E){this.transform=l.clone(),this.terrain=h,this.collisionIndex=new dn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=g,this.retainedQueryData={},this.collisionGroups=new On(b),this.collisionCircleArrays={},this.prevPlacement=E,E&&(E.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(l,h,g,b){const E=g.getBucket(h),D=g.latestFeatureIndex;if(!E||!D||h.id!==E.layerIds[0])return;const $=g.collisionBoxArray,U=E.layers[0].layout,W=Math.pow(2,this.transform.zoom-g.tileID.overscaledZ),te=g.tileSize/o.EXTENT,ae=this.transform.calculatePosMatrix(g.tileID.toUnwrapped()),fe=U.get("text-pitch-alignment")==="map",Se=U.get("text-rotation-alignment")==="map",_e=zt(g,1,this.transform.zoom),we=Zt(ae,fe,Se,this.transform,_e);let Be=null;if(fe){const et=cn(ae,fe,Se,this.transform,_e);Be=o.multiply([],this.transform.labelPlaneMatrix,et)}this.retainedQueryData[E.bucketInstanceId]=new pn(E.bucketInstanceId,D,E.sourceLayerIndex,E.index,g.tileID);const je={bucket:E,layout:U,posMatrix:ae,textLabelPlaneMatrix:we,labelToScreenMatrix:Be,scale:W,textPixelRatio:te,holdingForFade:g.holdingForFade(),collisionBoxArray:$,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(E.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(E.sourceID)};if(b)for(const et of E.sortKeyRanges){const{sortKey:Me,symbolInstanceStart:at,symbolInstanceEnd:nt}=et;l.push({sortKey:Me,symbolInstanceStart:at,symbolInstanceEnd:nt,parameters:je})}else l.push({symbolInstanceStart:0,symbolInstanceEnd:E.symbolInstances.length,parameters:je})}attemptAnchorPlacement(l,h,g,b,E,D,$,U,W,te,ae,fe,Se,_e,we,Be){const je=[fe.textOffset0,fe.textOffset1],et=Zn(l,g,b,je,E),Me=this.collisionIndex.placeCollisionBox(Xn(h,et.x,et.y,D,$,this.transform.angle),ae,U,W,te.predicate,Be);if((!we||this.collisionIndex.placeCollisionBox(Xn(we,et.x,et.y,D,$,this.transform.angle),ae,U,W,te.predicate,Be).box.length!==0)&&Me.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:je,width:g,height:b,anchor:l,textBoxScale:E,prevAnchor:at},this.markUsedJustification(Se,l,fe,_e),Se.allowVerticalPlacement&&(this.markUsedOrientation(Se,_e,fe),this.placedOrientations[fe.crossTileID]=_e),{shift:et,placedGlyphBoxes:Me}}}placeLayerBucketPart(l,h,g){const{bucket:b,layout:E,posMatrix:D,textLabelPlaneMatrix:$,labelToScreenMatrix:U,textPixelRatio:W,holdingForFade:te,collisionBoxArray:ae,partiallyEvaluatedTextSize:fe,collisionGroup:Se}=l.parameters,_e=E.get("text-optional"),we=E.get("icon-optional"),Be=o.getOverlapMode(E,"text-overlap","text-allow-overlap"),je=Be==="always",et=o.getOverlapMode(E,"icon-overlap","icon-allow-overlap"),Me=et==="always",at=E.get("text-rotation-alignment")==="map",nt=E.get("text-pitch-alignment")==="map",xt=E.get("icon-text-fit")!=="none",_t=E.get("symbol-z-order")==="viewport-y",Ft=je&&(Me||!b.hasIconData()||we),vt=Me&&(je||!b.hasTextData()||_e);!b.collisionArrays&&ae&&b.deserializeCollisionBoxes(ae);const sn=(Yt,fn)=>{if(h[Yt.crossTileID])return;if(te)return void(this.placements[Yt.crossTileID]=new Dt(!1,!1,!1));let Fn=!1,Un=!1,Pn=!0,fr=null,hr={box:null,offscreen:null},er={box:null,offscreen:null},ir=null,vr=null,gi=null,sa=0,Vo=0,la=0;fn.textFeatureIndex?sa=fn.textFeatureIndex:Yt.useRuntimeCollisionCircles&&(sa=Yt.featureIndex),fn.verticalTextFeatureIndex&&(Vo=fn.verticalTextFeatureIndex);const rs=this.retainedQueryData[b.bucketInstanceId].tileID,Io=this.terrain?(di,Wn)=>this.terrain.getElevation(rs,di,Wn):null;for(const di of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const Wn=fn[di];Wn&&(Wn.elevation=Io?Io(Wn.anchorPointX,Wn.anchorPointY):0)}const Yi=fn.textBox;if(Yi){const di=dr=>{let yi=o.WritingMode.horizontal;if(b.allowVerticalPlacement&&!dr&&this.prevPlacement){const xi=this.prevPlacement.placedOrientations[Yt.crossTileID];xi&&(this.placedOrientations[Yt.crossTileID]=xi,yi=xi,this.markUsedOrientation(b,yi,Yt))}return yi},Wn=(dr,yi)=>{if(b.allowVerticalPlacement&&Yt.numVerticalGlyphVertices>0&&fn.verticalTextBox){for(const xi of b.writingModes)if(xi===o.WritingMode.vertical?(hr=yi(),er=hr):hr=dr(),hr&&hr.box&&hr.box.length)break}else hr=dr()};if(E.get("text-variable-anchor")){let dr=E.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Yt.crossTileID]){const Dr=this.prevPlacement.variableOffsets[Yt.crossTileID];dr.indexOf(Dr.anchor)>0&&(dr=dr.filter(Ro=>Ro!==Dr.anchor),dr.unshift(Dr.anchor))}const yi=(Dr,Ro,Rs)=>{const dh=Dr.x2-Dr.x1,Tl=Dr.y2-Dr.y1,mv=Yt.textBoxScale,fh=xt&&et==="never"?Ro:null;let is={box:[],offscreen:!1};const Ms=Be!=="never"?2*dr.length:dr.length;for(let As=0;As=dr.length?Be:"never",Yt,b,Rs,fh,Io);if(rd&&(is=rd.placedGlyphBoxes,is&&is.box&&is.box.length)){Fn=!0,fr=rd.shift;break}}return is};Wn(()=>yi(Yi,fn.iconBox,o.WritingMode.horizontal),()=>{const Dr=fn.verticalTextBox;return b.allowVerticalPlacement&&!(hr&&hr.box&&hr.box.length)&&Yt.numVerticalGlyphVertices>0&&Dr?yi(Dr,fn.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null}}),hr&&(Fn=hr.box,Pn=hr.offscreen);const xi=di(hr&&hr.box);if(!Fn&&this.prevPlacement){const Dr=this.prevPlacement.variableOffsets[Yt.crossTileID];Dr&&(this.variableOffsets[Yt.crossTileID]=Dr,this.markUsedJustification(b,Dr.anchor,Yt,xi))}}else{const dr=(yi,xi)=>{const Dr=this.collisionIndex.placeCollisionBox(yi,Be,W,D,Se.predicate,Io);return Dr&&Dr.box&&Dr.box.length&&(this.markUsedOrientation(b,xi,Yt),this.placedOrientations[Yt.crossTileID]=xi),Dr};Wn(()=>dr(Yi,o.WritingMode.horizontal),()=>{const yi=fn.verticalTextBox;return b.allowVerticalPlacement&&Yt.numVerticalGlyphVertices>0&&yi?dr(yi,o.WritingMode.vertical):{box:null,offscreen:null}}),di(hr&&hr.box&&hr.box.length)}}if(ir=hr,Fn=ir&&ir.box&&ir.box.length>0,Pn=ir&&ir.offscreen,Yt.useRuntimeCollisionCircles){const di=b.text.placedSymbolArray.get(Yt.centerJustifiedTextSymbolIndex),Wn=o.evaluateSizeForFeature(b.textSizeData,fe,di),dr=E.get("text-padding");vr=this.collisionIndex.placeCollisionCircles(Be,di,b.lineVertexArray,b.glyphOffsetArray,Wn,D,$,U,g,nt,Se.predicate,Yt.collisionCircleDiameter,dr,Io),vr.circles.length&&vr.collisionDetected&&!g&&o.warnOnce("Collisions detected, but collision boxes are not shown"),Fn=je||vr.circles.length>0&&!vr.collisionDetected,Pn=Pn&&vr.offscreen}if(fn.iconFeatureIndex&&(la=fn.iconFeatureIndex),fn.iconBox){const di=Wn=>{const dr=xt&&fr?Xn(Wn,fr.x,fr.y,at,nt,this.transform.angle):Wn;return this.collisionIndex.placeCollisionBox(dr,et,W,D,Se.predicate,Io)};er&&er.box&&er.box.length&&fn.verticalIconBox?(gi=di(fn.verticalIconBox),Un=gi.box.length>0):(gi=di(fn.iconBox),Un=gi.box.length>0),Pn=Pn&&gi.offscreen}const Ra=_e||Yt.numHorizontalGlyphVertices===0&&Yt.numVerticalGlyphVertices===0,nd=we||Yt.numIconVertices===0;if(Ra||nd?nd?Ra||(Un=Un&&Fn):Fn=Un&&Fn:Un=Fn=Un&&Fn,Fn&&ir&&ir.box&&this.collisionIndex.insertCollisionBox(ir.box,Be,E.get("text-ignore-placement"),b.bucketInstanceId,er&&er.box&&Vo?Vo:sa,Se.ID),Un&&gi&&this.collisionIndex.insertCollisionBox(gi.box,et,E.get("icon-ignore-placement"),b.bucketInstanceId,la,Se.ID),vr&&(Fn&&this.collisionIndex.insertCollisionCircles(vr.circles,Be,E.get("text-ignore-placement"),b.bucketInstanceId,sa,Se.ID),g)){const di=b.bucketInstanceId;let Wn=this.collisionCircleArrays[di];Wn===void 0&&(Wn=this.collisionCircleArrays[di]=new Bt);for(let dr=0;dr=0;--fn){const Fn=Yt[fn];sn(b.symbolInstances.get(Fn),b.collisionArrays[Fn])}}else for(let Yt=l.symbolInstanceStart;Yt=0&&(l.text.placedSymbolArray.get($).crossTileID=E>=0&&$!==E?0:g.crossTileID)}markUsedOrientation(l,h,g){const b=h===o.WritingMode.horizontal||h===o.WritingMode.horizontalOnly?h:0,E=h===o.WritingMode.vertical?h:0,D=[g.leftJustifiedTextSymbolIndex,g.centerJustifiedTextSymbolIndex,g.rightJustifiedTextSymbolIndex];for(const $ of D)l.text.placedSymbolArray.get($).placedOrientation=b;g.verticalPlacedTextSymbolIndex&&(l.text.placedSymbolArray.get(g.verticalPlacedTextSymbolIndex).placedOrientation=E)}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,E=h?h.opacities:{},D=h?h.variableOffsets:{},$=h?h.placedOrientations:{};for(const U in this.placements){const W=this.placements[U],te=E[U];te?(this.opacities[U]=new mt(te,b,W.text,W.icon),g=g||W.text!==te.text.placed||W.icon!==te.icon.placed):(this.opacities[U]=new mt(null,b,W.text,W.icon,W.skipFade),g=g||W.text||W.icon)}for(const U in E){const W=E[U];if(!this.opacities[U]){const te=new mt(W,b,!1,!1);te.isHidden()||(this.opacities[U]=te,g=g||W.text.placed||W.icon.placed)}}for(const U in D)this.variableOffsets[U]||!this.opacities[U]||this.opacities[U].isHidden()||(this.variableOffsets[U]=D[U]);for(const U in $)this.placedOrientations[U]||!this.opacities[U]||this.opacities[U].isHidden()||(this.placedOrientations[U]=$[U]);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 E=b.getBucket(l);E&&b.latestFeatureIndex&&l.id===E.layerIds[0]&&this.updateBucketOpacities(E,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,E=new mt(null,0,!1,!1,!0),D=b.get("text-allow-overlap"),$=b.get("icon-allow-overlap"),U=b.get("text-variable-anchor"),W=b.get("text-rotation-alignment")==="map",te=b.get("text-pitch-alignment")==="map",ae=b.get("icon-text-fit")!=="none",fe=new mt(null,0,D&&($||!l.hasIconData()||b.get("icon-optional")),$&&(D||!l.hasTextData()||b.get("text-optional")),!0);!l.collisionArrays&&g&&(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData())&&l.deserializeCollisionBoxes(g);const Se=(_e,we,Be)=>{for(let je=0;je0,nt=this.placedOrientations[we.crossTileID],xt=nt===o.WritingMode.vertical,_t=nt===o.WritingMode.horizontal||nt===o.WritingMode.horizontalOnly;if(Be>0||je>0){const Ft=Le(Me.text);Se(l.text,Be,xt?qe:Ft),Se(l.text,je,_t?qe:Ft);const vt=Me.text.isHidden();[we.rightJustifiedTextSymbolIndex,we.centerJustifiedTextSymbolIndex,we.leftJustifiedTextSymbolIndex].forEach(fn=>{fn>=0&&(l.text.placedSymbolArray.get(fn).hidden=vt||xt?1:0)}),we.verticalPlacedTextSymbolIndex>=0&&(l.text.placedSymbolArray.get(we.verticalPlacedTextSymbolIndex).hidden=vt||_t?1:0);const sn=this.variableOffsets[we.crossTileID];sn&&this.markUsedJustification(l,sn.anchor,we,nt);const Yt=this.placedOrientations[we.crossTileID];Yt&&(this.markUsedJustification(l,"left",we,Yt),this.markUsedOrientation(l,Yt,we))}if(at){const Ft=Le(Me.icon),vt=!(ae&&we.verticalPlacedIconSymbolIndex&&xt);we.placedIconSymbolIndex>=0&&(Se(l.icon,we.numIconVertices,vt?Ft:qe),l.icon.placedSymbolArray.get(we.placedIconSymbolIndex).hidden=Me.icon.isHidden()),we.verticalPlacedIconSymbolIndex>=0&&(Se(l.icon,we.numVerticalIconVertices,vt?qe:Ft),l.icon.placedSymbolArray.get(we.verticalPlacedIconSymbolIndex).hidden=Me.icon.isHidden())}if(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData()){const Ft=l.collisionArrays[_e];if(Ft){let vt=new o.pointGeometry(0,0);if(Ft.textBox||Ft.verticalTextBox){let Yt=!0;if(U){const fn=this.variableOffsets[et];fn?(vt=Zn(fn.anchor,fn.width,fn.height,fn.textOffset,fn.textBoxScale),W&&vt._rotate(te?this.transform.angle:-this.transform.angle)):Yt=!1}Ft.textBox&&H(l.textCollisionBox.collisionVertexArray,Me.text.placed,!Yt||xt,vt.x,vt.y),Ft.verticalTextBox&&H(l.textCollisionBox.collisionVertexArray,Me.text.placed,!Yt||_t,vt.x,vt.y)}const sn=Boolean(!_t&&Ft.verticalIconBox);Ft.iconBox&&H(l.iconCollisionBox.collisionVertexArray,Me.icon.placed,sn,ae?vt.x:0,ae?vt.y:0),Ft.verticalIconBox&&H(l.iconCollisionBox.collisionVertexArray,Me.icon.placed,!sn,ae?vt.x:0,ae?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 H(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),de=Math.pow(2,24),le=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 Le(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*de+h*le+l*xe+h*Ee+l*be+h*Ce+l}const qe=0;class Ze{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,E){const D=this._bucketParts;for(;this._currentTileIndex$.sortKey-U.sortKey));this._currentPartIndex{const D=o.exported.now()-b;return!this._forceFullPlacement&&D>2};for(;this._currentPlacementIndex>=0;){const D=h[l[this._currentPlacementIndex]],$=this.placement.collisionIndex.transform.zoom;if(D.type==="symbol"&&(!D.minzoom||D.minzoom<=$)&&(!D.maxzoom||D.maxzoom>$)){if(this._inProgressLayer||(this._inProgressLayer=new Ze(D)),this._inProgressLayer.continuePlacement(g[D.source],this.placement,this._showCollisionBoxes,D,E))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(l){return this.placement.commit(l),this.placement}}const Lt=512/o.EXTENT/2;class Ct{constructor(l,h,g){this.tileID=l,this.indexedSymbolInstances={},this.bucketInstanceId=g;for(let b=0;bl.overscaledZ)for(const $ in D){const U=D[$];U.tileID.isChildOf(l)&&U.findMatches(h.symbolInstances,l,b)}else{const $=D[l.scaledTo(Number(E)).key];$&&$.findMatches(h.symbolInstances,l,b)}}for(let E=0;E{h[g]=!0});for(const g in this.layerIndexes)h[g]||delete this.layerIndexes[g]}}var bn=o.createLayout([{name:"a_pos",type:"Int16",components:2}]);class un 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 Oe(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 E=l.clone();E.posMatrix=new Float64Array(16),o.ortho(E.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),h[g]=E}else if(b.canonical.isChildOf(l.canonical)){const E=l.clone();E.posMatrix=new Float64Array(16);const D=b.canonical.z-l.canonical.z,$=b.canonical.x-(b.canonical.x>>D<>D<>D;o.ortho(E.posMatrix,0,W,0,W,0,1),o.translate(E.posMatrix,E.posMatrix,[-$*W,-U*W,0]),h[g]=E}else if(l.canonical.isChildOf(b.canonical)){const E=l.clone();E.posMatrix=new Float64Array(16);const D=l.canonical.z-b.canonical.z,$=l.canonical.x-(l.canonical.x>>D<>D<>D;o.ortho(E.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),o.translate(E.posMatrix,E.posMatrix,[$*W,U*W,0]),o.scale(E.posMatrix,E.posMatrix,[1/2**D,1/2**D,0]),h[g]=E}}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&&(!E||!E.dem);)E=this.sourceCache.getTileByID(l.scaledTo(b--).key);return E}tilesAfterTime(l=Date.now()){return Object.values(this._tiles).filter(h=>h.timeLoaded>=l)}}class wn{constructor(l,h,g){this.style=l,this.sourceCache=new un(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?E=l.canonical.z-b:o.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const D=l.canonical.x-(l.canonical.x>>E<>E<>8<<4|E>>8,h[D+3]=0;const g=new o.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),b=new A(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,E=b.gl;b.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),E.readPixels(l.x,g.height/devicePixelRatio-l.y-1,1,1,E.RGBA,E.UNSIGNED_BYTE,h),b.bindFramebuffer.set(null);const D=h[0]+(h[2]>>4<<8),$=h[1]+((15&h[2])<<8),U=this.coordsIndex[255-h[3]],W=U&&this.sourceCache.getTileByID(U);if(!W)return null;const te=this._coordsTextureSize,ae=(1<o.emitValidationErrors(x,l&&l.filter(h=>h.identifier!=="source.canvas")),rr=o.pick(ut,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),$r=o.pick(ut,["setCenter","setZoom","setBearing","setPitch"]),sr=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 Mr extends o.Evented{constructor(l,h={}){super(),this.map=l,this.dispatcher=new Y(Rt(),this),this.imageManager=new R,this.imageManager.setEventedParent(this),this.glyphManager=new B(l._requestManager,h.localIdeographFontFamily),this.lineAtlas=new X(256,512),this.crossTileSymbolIndex=new Vt,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=Mr.registerForPluginStateChange(b=>{g.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:b.pluginStatus,pluginURL:b.pluginURL},(E,D)=>{if(o.triggerPluginCompletionEvent(E),D&&D.every($=>$))for(const $ in g.sourceCaches)g.sourceCaches[$].reload()})}),this.on("data",b=>{if(b.dataType!=="source"||b.sourceDataType!=="metadata")return;const E=this.sourceCaches[b.sourceId];if(!E)return;const D=E.getSource();if(D&&D.vectorLayerIds)for(const $ in this._layers){const U=this._layers[$];U.source===D.id&&this._validateLayer(U)}})}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,(E,D)=>{this._request=null,E?this.fire(new o.ErrorEvent(E)):D&&this._load(D,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(sr,!1)}_load(l,h){if(h&&Vn(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=Mt(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 j(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,E){let D,$,U;const W=b>1?"@2x":"";let te=o.getJSON(g.transformRequest(g.normalizeSpriteURL(h,W,".json"),o.ResourceType.SpriteJSON),(Se,_e)=>{te=null,U||(U=Se,D=_e,fe())}),ae=o.getImage(g.transformRequest(g.normalizeSpriteURL(h,W,".png"),o.ResourceType.SpriteImage),(Se,_e)=>{ae=null,U||(U=Se,$=_e,fe())});function fe(){if(U)E(U);else if(D&&$){const Se=o.exported.getImageData($),_e={};for(const we in D){const{width:Be,height:je,x:et,y:Me,sdf:at,pixelRatio:nt,stretchX:xt,stretchY:_t,content:Ft}=D[we],vt=new o.RGBAImage({width:Be,height:je});o.RGBAImage.copy(Se,vt,{x:et,y:Me},{x:0,y:0},{width:Be,height:je}),_e[we]={data:vt,pixelRatio:nt,sdf:at,stretchX:xt,stretchY:_t,content:Ft}}E(null,_e)}}return{cancel(){te&&(te.cancel(),te=null),ae&&(ae.cancel(),ae=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),E=Object.keys(this._removedLayers);(b.length||E.length)&&this._updateWorkerLayers(b,E);for(const D in this._updatedSources){const $=this._updatedSources[D];if($==="reload")this._reloadSource(D);else{if($!=="clear")throw new Error(`Invalid action ${$}`);this._clearSource(D)}}this._updateTilesForChangedImages();for(const D in this._updatedPaintProps)this._layers[D].updateTransitions(l);this.light.updateTransitions(l),this._resetUpdates()}const g={};for(const b in this.sourceCaches){const E=this.sourceCaches[b];g[b]=E.used,E.used=!1}for(const b of this._order){const E=this._layers[b];E.recalculate(l,this._availableImages),!E.isHidden(l.zoom)&&E.source&&(this.sourceCaches[E.source].used=!0)}for(const b in g){const E=this.sourceCaches[b];g[b]!==E.used&&E.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 wn(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(),Vn(this,o.validateStyle(l)))return!1;(l=o.clone$1(l)).layers=Mt(l.layers);const h=function(b,E){if(!b)return[{command:ut.setStyle,args:[E]}];let D=[];try{if(!y(b.version,E.version))return[{command:ut.setStyle,args:[E]}];y(b.center,E.center)||D.push({command:ut.setCenter,args:[E.center]}),y(b.zoom,E.zoom)||D.push({command:ut.setZoom,args:[E.zoom]}),y(b.bearing,E.bearing)||D.push({command:ut.setBearing,args:[E.bearing]}),y(b.pitch,E.pitch)||D.push({command:ut.setPitch,args:[E.pitch]}),y(b.sprite,E.sprite)||D.push({command:ut.setSprite,args:[E.sprite]}),y(b.glyphs,E.glyphs)||D.push({command:ut.setGlyphs,args:[E.glyphs]}),y(b.transition,E.transition)||D.push({command:ut.setTransition,args:[E.transition]}),y(b.light,E.light)||D.push({command:ut.setLight,args:[E.light]});const $={},U=[];(function(te,ae,fe,Se){let _e;for(_e in ae=ae||{},te=te||{})Object.prototype.hasOwnProperty.call(te,_e)&&(Object.prototype.hasOwnProperty.call(ae,_e)||ct(_e,fe,Se));for(_e in ae)Object.prototype.hasOwnProperty.call(ae,_e)&&(Object.prototype.hasOwnProperty.call(te,_e)?y(te[_e],ae[_e])||(te[_e].type==="geojson"&&ae[_e].type==="geojson"&&ht(te,ae,_e)?fe.push({command:ut.setGeoJSONSourceData,args:[_e,ae[_e].data]}):rt(_e,ae,fe,Se)):dt(_e,ae,fe))})(b.sources,E.sources,U,$);const W=[];b.layers&&b.layers.forEach(te=>{$[te.source]?D.push({command:ut.removeLayer,args:[te.id]}):W.push(te)}),D=D.concat(U),function(te,ae,fe){ae=ae||[];const Se=(te=te||[]).map(Wt),_e=ae.map(Wt),we=te.reduce(Ut,{}),Be=ae.reduce(Ut,{}),je=Se.slice(),et=Object.create(null);let Me,at,nt,xt,_t,Ft,vt;for(Me=0,at=0;Me!(b.command in $r));if(h.length===0)return!1;const g=h.filter(b=>!(b.command in rr));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 Ue(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 E;if(l.type==="custom"){if(Vn(this,o.validateCustomStyleLayer(l)))return;E=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;E=o.createStyleLayer(l),this._validateLayer(E),E.setEventedParent(this,{layer:{id:b}}),this._serializedLayers[E.id]=E.serialize()}const D=h?this._order.indexOf(h):this._order.length;if(h&&D===-1)this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${b}" before non-existing layer "${h}".`)));else{if(this._order.splice(D,0,b),this._layerOrderChanged=!0,this._layers[b]=E,this._removedLayers[b]&&E.source&&E.type!=="custom"){const $=this._removedLayers[b];delete this._removedLayers[b],$.type!==E.type?this._updatedSources[E.source]="clear":(this._updatedSources[E.source]="reload",this.sourceCaches[E.source].pause())}this._updateLayer(E),E.onAdd&&E.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 E=this.getLayer(l);E?y(E.getLayoutProperty(h),g)||(E.setLayoutProperty(h,g,b),this._updateLayer(E)):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 E=this.getLayer(l);E?y(E.getPaintProperty(h),g)||(E.setPaintProperty(h,g,b)&&this._updateLayer(E),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,E=this.sourceCaches[g];if(E===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)));const D=E.getSource().type;D==="geojson"&&b?this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):D!=="vector"||b?(l.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),E.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 E=b.getSource().type,D=E==="vector"?l.sourceLayer:void 0;E!=="vector"||D?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(D,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=D=>this._layers[D].type==="fill-extrusion",g={},b=[];for(let D=this._order.length-1;D>=0;D--){const $=this._order[D];if(h($)){g[$]=D;for(const U of l){const W=U[$];if(W)for(const te of W)b.push(te)}}}b.sort((D,$)=>$.intersectionZ-D.intersectionZ);const E=[];for(let D=this._order.length-1;D>=0;D--){const $=this._order[D];if(h($))for(let U=b.length-1;U>=0;U--){const W=b[U].feature;if(g[W.layer.id]{const _t=Be.featureSortOrder;if(_t){const Ft=_t.indexOf(nt.featureIndex);return _t.indexOf(xt.featureIndex)-Ft}return xt.featureIndex-nt.featureIndex});for(const nt of at)Me.push(nt)}}for(const Be in Se)Se[Be].forEach(je=>{const et=je.feature,Me=U[D[Be].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=Me});return Se}(this._layers,this._serializedLayers,this.sourceCaches,l,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(E)}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,E){const D=b.getRenderableIds().map(W=>b.getTileByID(W)),$=[],U={};for(let W=0;Wfe.getTileByID(Se)).sort((Se,_e)=>_e.tileID.overscaledZ-Se.tileID.overscaledZ||(Se.tileID.isLessThan(_e.tileID)?-1:1))}const ae=this.crossTileSymbolIndex.addLayer(te,U[te.source],l.center.lng);D=D||ae}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((E=E||this._layerOrderChanged||g===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),l.zoom))&&(this.pauseablePlacement=new Ve(l,this.terrain,this._order,E,h,g,b,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,U),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),$=!0),D&&this.pauseablePlacement.placement.setStale()),$||D)for(const W of this._order){const te=this._layers[W];te.type==="symbol"&&this.placement.updateLayerOpacities(te,U[te.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)}}Mr.getSourceType=function(x){return Pe[x]},Mr.setSourceType=function(x,l){Pe[x]=l},Mr.registerForPluginStateChange=o.registerForPluginStateChange;var Mn="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 kn={prelude:Dn(`#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:Dn(`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:Dn(`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:Dn(`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:Dn("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:Dn(`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:Dn(`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:Dn("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:Dn("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:Dn("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:Dn(`#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:Dn(`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:Dn(`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:Dn(`#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:Dn(`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:Dn(`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:Dn(`#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:Dn(`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:Dn(`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:Dn(`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:Dn(`#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:Dn(`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:Dn(`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:Dn(`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:Dn(`#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:Dn(`#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:Dn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Mn),terrainDepth:Dn("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);}",Mn),terrainCoords:Dn("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);}",Mn)};function Dn(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),E=l.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),D=E?E.concat(b):b,$={};return{fragmentSource:x=x.replace(h,(U,W,te,ae,fe)=>($[fe]=!0,W==="define"?` #ifndef HAS_UNIFORM_u_${fe} varying ${te} ${ae} ${fe}; #else uniform ${te} ${ae} u_${fe}; #endif `:` #ifdef HAS_UNIFORM_u_${fe} ${te} ${ae} ${fe} = u_${fe}; #endif `)),vertexSource:l=l.replace(h,(U,W,te,ae,fe)=>{const Se=ae==="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 ${te} ${Se} a_${fe}; varying ${te} ${ae} ${fe}; #else uniform ${te} ${ae} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${fe} = a_${fe}; #else ${te} ${ae} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${te} ${ae} ${fe} = u_${fe}; #endif `:W==="define"?` #ifndef HAS_UNIFORM_u_${fe} uniform lowp float u_${fe}_t; attribute ${te} ${Se} a_${fe}; #else uniform ${te} ${ae} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${te} ${ae} ${fe} = a_${fe}; #else ${te} ${ae} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${te} ${ae} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${te} ${ae} ${fe} = u_${fe}; #endif `}),staticAttributes:g,staticUniforms:D}}class Gr{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,E,D,$,U,W){this.context=l;let te=this.boundPaintVertexBuffers.length!==b.length;for(let ae=0;!te&&ae({u_depth:new o.Uniform1i(_t,Ft.u_depth),u_terrain:new o.Uniform1i(_t,Ft.u_terrain),u_terrain_dim:new o.Uniform1f(_t,Ft.u_terrain_dim),u_terrain_matrix:new o.UniformMatrix4f(_t,Ft.u_terrain_matrix),u_terrain_unpack:new o.Uniform4f(_t,Ft.u_terrain_unpack),u_terrain_offset:new o.Uniform1f(_t,Ft.u_terrain_offset),u_terrain_exaggeration:new o.Uniform1f(_t,Ft.u_terrain_exaggeration)}))(l,xt),this.binderUniforms=b?b.getUniforms(l,xt):[]}draw(l,h,g,b,E,D,$,U,W,te,ae,fe,Se,_e,we,Be,je,et){const Me=l.gl;if(this.failedToCreate)return;if(l.program.set(this.program),l.setDepthMode(g),l.setStencilMode(b),l.setColorMode(E),l.setCullFace(D),U){l.activeTexture.set(Me.TEXTURE2),Me.bindTexture(Me.TEXTURE_2D,U.depthTexture),l.activeTexture.set(Me.TEXTURE3),Me.bindTexture(Me.TEXTURE_2D,U.texture);for(const nt in this.terrainUniforms)this.terrainUniforms[nt].set(U[nt])}for(const nt in this.fixedUniforms)this.fixedUniforms[nt].set($[nt]);we&&we.setUniforms(l,this.binderUniforms,Se,{zoom:_e});let at=0;switch(h){case Me.LINES:at=2;break;case Me.TRIANGLES:at=3;break;case Me.LINE_STRIP:at=1}for(const nt of fe.get()){const xt=nt.vaos||(nt.vaos={});(xt[W]||(xt[W]=new Gr)).bind(l,this,te,we?we.getPaintVertexBuffers():[],ae,nt.vertexOffset,Be,je,et),Me.drawElements(h,nt.primitiveLength*at,Me.UNSIGNED_SHORT,nt.primitiveOffset*at*2)}}}function $n(x,l,h){const g=1/zt(h,1,l.transform.tileZoom),b=Math.pow(2,h.tileID.overscaledZ),E=h.tileSize*Math.pow(2,l.transform.tileZoom)/b,D=E*(h.tileID.canonical.x+h.tileID.wrap*b),$=E*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:[D>>16,$>>16],u_pixel_coord_lower:[65535&D,65535&$]}}const Jn=(x,l,h,g)=>{const b=l.style.light,E=b.properties.get("position"),D=[E.x,E.y,E.z],$=o.create$1();b.properties.get("anchor")==="viewport"&&o.fromRotation($,-l.transform.angle),o.transformMat3(D,D,$);const U=b.properties.get("color");return{u_matrix:x,u_lightpos:D,u_lightintensity:b.properties.get("intensity"),u_lightcolor:[U.r,U.g,U.b],u_vertical_gradient:+h,u_opacity:g}},br=(x,l,h,g,b,E,D)=>o.extend(Jn(x,l,h,g),$n(E,l,D),{u_height_factor:-Math.pow(2,b.overscaledZ)/D.tileSize/8}),Cr=x=>({u_matrix:x}),Br=(x,l,h,g)=>o.extend(Cr(x),$n(h,l,g)),so=(x,l)=>({u_matrix:x,u_world:l}),gl=(x,l,h,g,b)=>o.extend(Br(x,l,h,g),{u_world:b}),Bc=(x,l,h,g)=>{const b=x.transform;let E,D;if(g.paint.get("circle-pitch-alignment")==="map"){const $=zt(h,1,b.zoom);E=!0,D=[$,$]}else E=!1,D=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:+E,u_device_pixel_ratio:x.pixelRatio,u_extrude_scale:D}},Ea=(x,l,h)=>{const g=zt(h,1,l.zoom),b=Math.pow(2,l.zoom-h.tileID.overscaledZ),E=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:E}},Bn=(x,l,h=1)=>({u_matrix:x,u_color:l,u_overlay:0,u_overlay_scale:h}),Yn=x=>({u_matrix:x}),Ar=(x,l,h,g)=>({u_matrix:x,u_extrude_scale:zt(l,1,h),u_intensity:g});function Ei(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 Xa=(x,l,h,g)=>{const b=x.transform;return{u_matrix:Ta(x,l,h,g),u_ratio:1/zt(l,1,b.zoom),u_device_pixel_ratio:x.pixelRatio,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},To=(x,l,h,g,b)=>o.extend(Xa(x,l,h,b),{u_image:0,u_image_height:g}),Es=(x,l,h,g,b)=>{const E=x.transform,D=xr(l,E);return{u_matrix:Ta(x,l,h,b),u_texsize:l.imageAtlasTexture.size,u_ratio:1/zt(l,1,E.zoom),u_device_pixel_ratio:x.pixelRatio,u_image:0,u_scale:[D,g.fromScale,g.toScale],u_fade:g.t,u_units_to_pixels:[1/E.pixelsToGLUnits[0],1/E.pixelsToGLUnits[1]]}},Pa=(x,l,h,g,b,E)=>{const D=x.lineAtlas,$=xr(l,x.transform),U=h.layout.get("line-cap")==="round",W=D.getDash(g.from,U),te=D.getDash(g.to,U),ae=W.width*b.fromScale,fe=te.width*b.toScale;return o.extend(Xa(x,l,h,E),{u_patternscale_a:[$/ae,-W.height/2],u_patternscale_b:[$/fe,-te.height/2],u_sdfgamma:D.width/(256*Math.min(ae,fe)*x.pixelRatio)/2,u_image:0,u_tex_y_a:W.y,u_tex_y_b:te.y,u_mix:b.t})};function xr(x,l){return 1/zt(x,1,l.tileZoom)}function Ta(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 Lm=(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:(D=b.paint.get("raster-saturation"),D>0?1-1/(1.001-D):-D),u_contrast_factor:(E=b.paint.get("raster-contrast"),E>0?1/(1-E):1+E),u_spin_weights:zm(b.paint.get("raster-hue-rotate"))};var E,D};function zm(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 Ff=(x,l,h,g,b,E,D,$,U,W)=>{const te=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:te.cameraToCenterDistance,u_pitch:te.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:te.width/te.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:E,u_label_plane_matrix:D,u_coord_matrix:$,u_is_text:+U,u_pitch_with_map:+g,u_texsize:W,u_texture:0}},Vc=(x,l,h,g,b,E,D,$,U,W,te)=>{const ae=b.transform;return o.extend(Ff(x,l,h,g,b,E,D,$,U,W),{u_gamma_scale:g?Math.cos(ae._pitch)*ae.cameraToCenterDistance:1,u_device_pixel_ratio:b.pixelRatio,u_is_halo:+te})},Fm=(x,l,h,g,b,E,D,$,U,W)=>o.extend(Vc(x,l,h,g,b,E,D,$,!0,U,!0),{u_texsize_icon:W,u_texture_icon:1}),Rx=(x,l,h)=>({u_matrix:x,u_opacity:l,u_color:h}),Mx=(x,l,h,g,b,E)=>o.extend(function(D,$,U,W){const te=U.imageManager.getPattern(D.from.toString()),ae=U.imageManager.getPattern(D.to.toString()),{width:fe,height:Se}=U.imageManager.getPixelSize(),_e=Math.pow(2,W.tileID.overscaledZ),we=W.tileSize*Math.pow(2,U.transform.tileZoom)/_e,Be=we*(W.tileID.canonical.x+W.tileID.wrap*_e),je=we*W.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:te.tl,u_pattern_br_a:te.br,u_pattern_tl_b:ae.tl,u_pattern_br_b:ae.br,u_texsize:[fe,Se],u_mix:$.t,u_pattern_size_a:te.displaySize,u_pattern_size_b:ae.displaySize,u_scale_a:$.fromScale,u_scale_b:$.toScale,u_tile_units_to_pixels:1/zt(W,1,U.transform.tileZoom),u_pixel_coord_upper:[Be>>16,je>>16],u_pixel_coord_lower:[65535&Be,65535&je]}}(g,E,h,b),{u_matrix:x,u_opacity:l}),$f={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 Bf{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 Vf={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Uf{constructor(l,h,g,b){this.length=h.length,this.attributes=g,this.itemSize=h.bytesPerElement,this.dynamicDraw=b,this.context=l;const E=l.gl;this.buffer=E.createBuffer(),l.bindVertexBuffer.set(this.buffer),E.bufferData(E.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?E.DYNAMIC_DRAW:E.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 sn=o.create(),Yt=_t;o.mul(sn,xt.placementInvProjMatrix,x.transform.glCoordMatrix),o.mul(sn,sn,xt.placementViewportMatrix),te.push({circleArray:vt,circleOffset:fe,transform:Yt,invTransform:sn,coord:at}),ae+=vt.length/4,fe=ae}Ft&&W.draw($,U.LINES,Qn.disabled,Sr.disabled,x.colorModeForRenderPass(),Nr.disabled,Ea(_t,x.transform,nt),x.style.terrain&&x.style.terrain.getTerrainData(at),h.id,Ft.layoutVertexBuffer,Ft.indexBuffer,Ft.segments,null,x.transform.zoom,null,null,Ft.collisionVertexBuffer)}if(!D||!te.length)return;const Se=x.useProgram("collisionCircle"),_e=new o.CollisionCircleLayoutArray;_e.resize(4*ae),_e._trim();let we=0;for(const Me of te)for(let at=0;at=0&&(_e[Be.associatedIconIndex]={shiftedAnchor:Fn,angle:Un})}else gt(Be.numGlyphs,fe)}if(W){Se.clear();const we=x.icon.placedSymbolArray;for(let Be=0;Bex.style.terrain.getElevation(Ft,dh,Tl):null,Rs=h.layout.get("text-rotation-alignment")==="map";Cn(sn,Ft.posMatrix,x,b,Io,Yi,Be,W,Rs,Ro)}const di=x.translatePosMatrix(Ft.posMatrix,vt,E,D),Wn=je||b&&xt||nd?$x:Io,dr=x.translatePosMatrix(Yi,vt,E,D,!0),yi=Fn&&h.paint.get(b?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let xi;xi=Fn?sn.iconsInText?Fm(Un.kind,hr,et,Be,x,di,Wn,dr,ir,Vo):Vc(Un.kind,hr,et,Be,x,di,Wn,dr,b,ir,!0):Ff(Un.kind,hr,et,Be,x,di,Wn,dr,b,ir);const Dr={program:fr,buffers:Yt,uniformValues:xi,atlasTexture:vr,atlasTextureIcon:la,atlasInterpolation:gi,atlasInterpolationIcon:sa,isSDF:Fn,hasHalo:yi};if(Me&&sn.canOverlap){at=!0;const Ro=Yt.segments.get();for(const Rs of Ro)_t.push({segments:new o.SegmentVector([Rs]),sortKey:Rs.sortKey,state:Dr,terrainData:er})}else _t.push({segments:Yt.segments,sortKey:0,state:Dr,terrainData:er})}at&&_t.sort((Ft,vt)=>Ft.sortKey-vt.sortKey);for(const Ft of _t){const vt=Ft.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 sn=vt.uniformValues;vt.hasHalo&&(sn.u_is_halo=1,Su(vt.buffers,Ft.segments,h,x,vt.program,nt,te,ae,sn,Ft.terrainData)),sn.u_is_halo=0}Su(vt.buffers,Ft.segments,h,x,vt.program,nt,te,ae,vt.uniformValues,Ft.terrainData)}}function Su(x,l,h,g,b,E,D,$,U,W){const te=g.context;b.draw(te,te.gl.TRIANGLES,E,D,$,Nr.disabled,U,W,h.id,x.layoutVertexBuffer,x.indexBuffer,l,h.paint,g.transform.zoom,x.programConfigurations.get(h.id),x.dynamicLayoutVertexBuffer,x.opacityVertexBuffer)}function Eu(x,l,h,g,b,E,D){const $=x.context.gl,U=h.paint.get("fill-pattern"),W=U&&U.constantOr(1),te=h.getCrossfadeParameters();let ae,fe,Se,_e,we;D?(fe=W&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ae=$.LINES):(fe=W?"fillPattern":"fill",ae=$.TRIANGLES);for(const Be of g){const je=l.getTile(Be);if(W&&!je.patternsLoaded())continue;const et=je.getBucket(h);if(!et)continue;const Me=et.programConfigurations.get(h.id),at=x.useProgram(fe,Me),nt=x.style.terrain&&x.style.terrain.getTerrainData(Be);W&&(x.context.activeTexture.set($.TEXTURE0),je.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),Me.updatePaintBuffers(te));const xt=U.constantOr(null);if(xt&&je.imageAtlas){const vt=je.imageAtlas,sn=vt.patternPositions[xt.to.toString()],Yt=vt.patternPositions[xt.from.toString()];sn&&Yt&&Me.setConstantPatternPositions(sn,Yt)}const _t=nt?Be:null,Ft=x.translatePosMatrix(_t?_t.posMatrix:Be.posMatrix,je,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(D){_e=et.indexBuffer2,we=et.segments2;const vt=[$.drawingBufferWidth,$.drawingBufferHeight];Se=fe==="fillOutlinePattern"&&W?gl(Ft,x,te,je,vt):so(Ft,vt)}else _e=et.indexBuffer,we=et.segments,Se=W?Br(Ft,x,te,je):Cr(Ft);at.draw(x.context,ae,b,x.stencilModeForClipping(Be),E,Nr.disabled,Se,nt,h.id,et.layoutVertexBuffer,_e,we,h.paint,x.transform.zoom,Me)}}function Pu(x,l,h,g,b,E,D){const $=x.context,U=$.gl,W=h.paint.get("fill-extrusion-pattern"),te=W.constantOr(1),ae=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 Be=x.style.terrain&&x.style.terrain.getTerrainData(Se),je=we.programConfigurations.get(h.id),et=x.useProgram(te?"fillExtrusionPattern":"fillExtrusion",je);te&&(x.context.activeTexture.set(U.TEXTURE0),_e.imageAtlasTexture.bind(U.LINEAR,U.CLAMP_TO_EDGE),je.updatePaintBuffers(ae));const Me=W.constantOr(null);if(Me&&_e.imageAtlas){const _t=_e.imageAtlas,Ft=_t.patternPositions[Me.to.toString()],vt=_t.patternPositions[Me.from.toString()];Ft&&vt&&je.setConstantPatternPositions(Ft,vt)}const at=x.translatePosMatrix(Se.posMatrix,_e,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),nt=h.paint.get("fill-extrusion-vertical-gradient"),xt=te?br(at,x,nt,fe,Se,ae,_e):Jn(at,x,nt,fe);et.draw($,$.gl.TRIANGLES,b,E,D,Nr.backCCW,xt,Be,h.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,h.paint,x.transform.zoom,je,x.style.terrain&&we.centroidVertexBuffer)}}function Yf(x,l,h,g,b,E,D){const $=x.context,U=$.gl,W=h.fbo;if(!W)return;const te=x.useProgram("hillshade"),ae=x.style.terrain&&x.style.terrain.getTerrainData(l);$.activeTexture.set(U.TEXTURE0),U.bindTexture(U.TEXTURE_2D,W.colorAttachment.get()),te.draw($,U.TRIANGLES,b,E,D,Nr.disabled,((fe,Se,_e,we)=>{const Be=_e.paint.get("hillshade-shadow-color"),je=_e.paint.get("hillshade-highlight-color"),et=_e.paint.get("hillshade-accent-color");let Me=_e.paint.get("hillshade-illumination-direction")*(Math.PI/180);_e.paint.get("hillshade-illumination-anchor")==="viewport"&&(Me-=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:Ei(0,Se.tileID),u_light:[_e.paint.get("hillshade-exaggeration"),Me],u_shadow:Be,u_highlight:je,u_accent:et}})(x,h,g,ae?l:null),ae,g.id,x.rasterBoundsBuffer,x.quadTriangleIndexBuffer,x.rasterBoundsSegments)}function qm(x,l,h,g,b,E){const D=x.context,$=D.gl,U=l.dem;if(U&&U.data){const W=U.dim,te=U.stride,ae=U.getPixels();if(D.activeTexture.set($.TEXTURE1),D.pixelStoreUnpackPremultiplyAlpha.set(!1),l.demTexture=l.demTexture||x.getTileTexture(te),l.demTexture){const Se=l.demTexture;Se.update(ae,{premultiply:!1}),Se.bind($.NEAREST,$.CLAMP_TO_EDGE)}else l.demTexture=new A(D,ae,$.RGBA,{premultiply:!1}),l.demTexture.bind($.NEAREST,$.CLAMP_TO_EDGE);D.activeTexture.set($.TEXTURE0);let fe=l.fbo;if(!fe){const Se=new A(D,{width:W,height:W,data:null},$.RGBA);Se.bind($.LINEAR,$.CLAMP_TO_EDGE),fe=l.fbo=D.createFramebuffer(W,W,!0),fe.colorAttachment.set(Se.texture)}D.bindFramebuffer.set(fe.framebuffer),D.viewport.set([0,0,W,W]),x.useProgram("hillshadePrepare").draw(D,$.TRIANGLES,g,b,E,Nr.disabled,((Se,_e)=>{const we=_e.stride,Be=o.create();return o.ortho(Be,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate(Be,Be,[0,-o.EXTENT,0]),{u_matrix:Be,u_image:1,u_dimension:[we,we],u_zoom:Se.overscaledZ,u_unpack:_e.getUnpackVector()}})(l.tileID,U),null,h.id,x.rasterBoundsBuffer,x.quadTriangleIndexBuffer,x.rasterBoundsSegments),l.needsHillshadePrepare=!1}}function Zc(x,l,h,g,b,E){const D=g.paint.get("raster-fade-duration");if(!E&&D>0){const $=o.exported.now(),U=($-x.timeAdded)/D,W=l?($-l.timeAdded)/D:-1,te=h.getSource(),ae=b.coveringZoomLevel({tileSize:te.tileSize,roundZoom:te.roundZoom}),fe=!l||Math.abs(l.tileID.overscaledZ-ae)>Math.abs(x.tileID.overscaledZ-ae),Se=fe&&x.refreshedUponExpiration?1:o.clamp(fe?U:1-W,0,1);return x.refreshedUponExpiration&&U>=1&&(x.refreshedUponExpiration=!1),l?{opacity:1,mix:1-Se}:{opacity:Se,mix:0}}return{opacity:1,mix:0}}const Xc=new o.Color(1,0,0,1),Bo=new o.Color(0,1,0,1),Zm=new o.Color(0,0,1,1),Qf=new o.Color(1,0,1,1),Xm=new o.Color(0,1,1,1);function Ts(x,l,h,g){wl(x,0,l+h/2,x.transform.width,h,g)}function Tu(x,l,h,g){wl(x,l-h/2,0,h,x.transform.height,g)}function wl(x,l,h,g,b,E){const D=x.context,$=D.gl;$.enable($.SCISSOR_TEST),$.scissor(l*x.pixelRatio,h*x.pixelRatio,g*x.pixelRatio,b*x.pixelRatio),D.clear({color:E}),$.disable($.SCISSOR_TEST)}function Ux(x,l,h){const g=x.context,b=g.gl,E=h.posMatrix,D=x.useProgram("debug"),$=Qn.disabled,U=Sr.disabled,W=x.colorModeForRenderPass(),te="$debug",ae=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 Be=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(Be+=` => ${h.overscaledZ}`),function(je,et){je.initDebugOverlayCanvas();const Me=je.debugOverlayCanvas,at=je.context.gl,nt=je.debugOverlayCanvas.getContext("2d");nt.clearRect(0,0,Me.width,Me.height),nt.shadowColor="white",nt.shadowBlur=2,nt.lineWidth=1.5,nt.strokeStyle="white",nt.textBaseline="top",nt.font="bold 36px Open Sans, sans-serif",nt.fillText(et,5,5),nt.strokeText(et,5,5),je.debugOverlayTexture.update(Me),je.debugOverlayTexture.bind(at.LINEAR,at.CLAMP_TO_EDGE)}(x,`${Be} ${Se}kB`),D.draw(g,b.TRIANGLES,$,U,Tr.alphaBlended,Nr.disabled,Bn(E,o.Color.transparent,we),null,te,x.debugBuffer,x.quadTriangleIndexBuffer,x.debugSegments),D.draw(g,b.LINE_STRIP,$,U,W,Nr.disabled,Bn(E,o.Color.red),ae,te,x.debugBuffer,x.tileBorderIndexBuffer,x.debugSegments)}function Yc(x,l,h){const g=x.context,b=g.gl,E=x.colorModeForRenderPass(),D=new Qn(b.LEQUAL,Qn.ReadWrite,x.depthRangeFor3D),$=x.useProgram("terrain"),U=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 te=x.transform.calculatePosMatrix(h.tileID.toUnwrapped());$.draw(g,b.TRIANGLES,D,Sr.disabled,E,Nr.backCCW,{u_matrix:te,u_texture:0},W,"terrain",U.vertexBuffer,U.indexBuffer,U.segments)}function Ym(x,l,h,g){const b=x.context,E=h.tileSize*l.qualityFactor;h.textures[g]||(h.textures[g]=x.getTileTexture(E)||new A(b,{width:E,height:E,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 D=l.getRTTFramebuffer();D.colorAttachment.set(h.textures[g].texture),b.bindFramebuffer.set(D.framebuffer),b.viewport.set([0,0,E,E])}class Qm{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 E of b){const D=h.sourceCache.getTerrainCoords(E);for(const $ in D)this._coordsDescendingInv[g][$]||(this._coordsDescendingInv[g][$]=[]),this._coordsDescendingInv[g][$].push(D[$])}}for(const g of l._order){const b=l._layers[g],E=b.source;if(this._renderToTexture[b.type]&&!this._coordsDescendingInvStr[E]){this._coordsDescendingInvStr[E]={};for(const D in this._coordsDescendingInv[E])this._coordsDescendingInvStr[E][D]=this._coordsDescendingInv[E][D].map($=>$.key).sort().join()}}return this._renderableTiles.forEach(g=>{for(const b in this._coordsDescendingInvStr){const E=this._coordsDescendingInvStr[b][g.tileID.key];E&&E!==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,E=g.currentLayer,D=E+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[E]),!D))return!0;if(this._renderToTexture[this._prevType]||h==="hillshade"||this._renderToTexture[h]&&D){this._prevType=h;const $=this._stacks.length-1,U=this._stacks[$]||[];for(const W of this._renderableTiles){if(Ym(g,g.style.terrain,W,$),this._rerender[W.tileID.key]){g.context.clear({color:o.Color.transparent});for(let te=0;teU.style.terrain.getElevation(je,vt,sn):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&&qc(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"),E,D),h.paint.get("text-opacity").constantOr(1)!==0&&qc(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"),E,D),l.map.showCollisionBoxes&&(bl(x,l,h,g,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),bl(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"),E=h.paint.get("circle-stroke-width"),D=h.paint.get("circle-stroke-opacity"),$=!h.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(E.constantOr(1)===0||D.constantOr(1)===0))return;const U=x.context,W=U.gl,te=x.depthModeForSublayer(0,Qn.ReadOnly),ae=Sr.disabled,fe=x.colorModeForRenderPass(),Se=[];for(let _e=0;_e_e.sortKey-we.sortKey);for(const _e of Se){const{programConfiguration:we,program:Be,layoutVertexBuffer:je,indexBuffer:et,uniformValues:Me,terrainData:at}=_e.state;Be.draw(U,W.TRIANGLES,te,ae,fe,Nr.disabled,Me,at,h.id,je,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,E=b.gl,D=Sr.disabled,$=new Tr([E.ONE,E.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(U,W,te){const ae=U.gl;U.activeTexture.set(ae.TEXTURE1),U.viewport.set([0,0,W.width/4,W.height/4]);let fe=te.heatmapFbo;if(fe)ae.bindTexture(ae.TEXTURE_2D,fe.colorAttachment.get()),U.bindFramebuffer.set(fe.framebuffer);else{const Se=ae.createTexture();ae.bindTexture(ae.TEXTURE_2D,Se),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_WRAP_S,ae.CLAMP_TO_EDGE),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_WRAP_T,ae.CLAMP_TO_EDGE),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_MIN_FILTER,ae.LINEAR),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_MAG_FILTER,ae.LINEAR),fe=te.heatmapFbo=U.createFramebuffer(W.width/4,W.height/4,!1),function(_e,we,Be,je){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),je.colorAttachment.set(Be)}(U,W,Se,fe)}})(b,x,h),b.clear({color:o.Color.transparent});for(let U=0;U{const _e=o.create();o.ortho(_e,0,te.width,te.height,0,0,1);const we=te.context.gl;return{u_matrix:_e,u_world:[we.drawingBufferWidth,we.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ae.paint.get("heatmap-opacity")}})(b,E),null,E.id,b.viewportBuffer,b.quadTriangleIndexBuffer,b.viewportSegments,E.paint,b.transform.zoom)}(x,h))},line:function(x,l,h,g){if(x.renderPass!=="translucent")return;const b=h.paint.get("line-opacity"),E=h.paint.get("line-width");if(b.constantOr(1)===0||E.constantOr(1)===0)return;const D=x.depthModeForSublayer(0,Qn.ReadOnly),$=x.colorModeForRenderPass(),U=h.paint.get("line-dasharray"),W=h.paint.get("line-pattern"),te=W.constantOr(1),ae=h.paint.get("line-gradient"),fe=h.getCrossfadeParameters(),Se=te?"linePattern":U?"lineSDF":ae?"lineGradient":"line",_e=x.context,we=_e.gl;let Be=!0;for(const je of g){const et=l.getTile(je);if(te&&!et.patternsLoaded())continue;const Me=et.getBucket(h);if(!Me)continue;const at=Me.programConfigurations.get(h.id),nt=x.context.program.get(),xt=x.useProgram(Se,at),_t=Be||xt.program!==nt,Ft=x.style.terrain&&x.style.terrain.getTerrainData(je),vt=W.constantOr(null);if(vt&&et.imageAtlas){const fn=et.imageAtlas,Fn=fn.patternPositions[vt.to.toString()],Un=fn.patternPositions[vt.from.toString()];Fn&&Un&&at.setConstantPatternPositions(Fn,Un)}const sn=Ft?je:null,Yt=te?Es(x,et,h,fe,sn):U?Pa(x,et,h,U,fe,sn):ae?To(x,et,h,Me.lineClipsArray.length,sn):Xa(x,et,h,sn);if(te)_e.activeTexture.set(we.TEXTURE0),et.imageAtlasTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE),at.updatePaintBuffers(fe);else if(U&&(_t||x.lineAtlas.dirty))_e.activeTexture.set(we.TEXTURE0),x.lineAtlas.bind(_e);else if(ae){const fn=Me.gradients[h.id];let Fn=fn.texture;if(h.gradientVersion!==fn.version){let Un=256;if(h.stepInterpolant){const Pn=l.getSource().maxzoom,fr=je.canonical.z===Pn?Math.ceil(1<256&&this.clearStencil(),g.setColorMode(Tr.disabled),g.setDepthMode(Qn.disabled);const E=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const D of h){const $=this._tileClippingMaskIDs[D.key]=this.nextStencilID++,U=this.style.terrain&&this.style.terrain.getTerrainData(D);E.draw(g,b.TRIANGLES,Qn.disabled,new Sr({func:b.ALWAYS,mask:0},$,255,b.KEEP,b.KEEP,b.REPLACE),Tr.disabled,Nr.disabled,Yn(D.posMatrix),U,"$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 Sr({func:h.NOTEQUAL,mask:255},l,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(l){const h=this.context.gl;return new Sr({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((D,$)=>$.overscaledZ-D.overscaledZ),b=g[g.length-1].overscaledZ,E=g[0].overscaledZ-b+1;if(E>1){this.currentStencilSource=void 0,this.nextStencilID+E>256&&this.clearStencil();const D={};for(let $=0;$=0;this.currentLayer--){const W=this.style._layers[g[this.currentLayer]],te=b[W.source],ae=D[W.source];this._renderTileClippingMasks(W,ae),this.renderLayer(this,te,W,ae)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer{ae.source&&!ae.isHidden(this.transform.zoom)&&(ae.source!==(te&&te.id)&&(te=this.style.sourceCaches[ae.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 Kn(this.context,l,kn[l],h,$f[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 A(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class Qc{constructor(l,h){this.points=l,this.planes=h}static fromInvProjectionMatrix(l,h,g){const b=Math.pow(2,g),E=[[-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 U=1/($=o.transformMat4([],$,l))[3]/h*b;return o.mul$1($,$,[U,U,1/$[3],U])}),D=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map($=>{const U=o.sub([],E[$[0]],E[$[1]]),W=o.sub([],E[$[2]],E[$[1]]),te=o.normalize([],o.cross([],U,W)),ae=-o.dot(te,E[$[1]]);return te.concat(ae)});return new Qc(E,D)}}class Iu{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 E=0;E=0&&D++;if(D===0)return 0;D!==h.length&&(g=!1)}if(g)return 2;for(let b=0;b<3;b++){let E=Number.MAX_VALUE,D=-Number.MAX_VALUE;for(let $=0;$this.max[b]-this.min[b])return 0}return 1}}class Cl{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 Cl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Ru{constructor(l,h,g,b,E){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=E===void 0||!!E,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 Cl,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const l=new Ru(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,E,D){var $=E[0],U=E[1],W=E[2],te=E[3],ae=Math.sin(D),fe=Math.cos(D);b[0]=$*fe+W*ae,b[1]=U*fe+te*ae,b[2]=$*-ae+W*fe,b[3]=U*-ae+te*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)),E=this.pointCoordinate(new o.pointGeometry(this.width,this.height)),D=this.pointCoordinate(new o.pointGeometry(0,this.height)),$=Math.floor(Math.min(g.x,b.x,E.x,D.x)),U=Math.floor(Math.max(g.x,b.x,E.x,D.x)),W=1;for(let te=$-W;te<=U+W;te++)te!==0&&h.push(new o.UnwrappedTileID(te,l))}return h}coveringTiles(l){var h,g;let b=this.coveringZoomLevel(l);const E=b;if(l.minzoom!==void 0&&bl.maxzoom&&(b=l.maxzoom);const D=this.pointCoordinate(this.getCameraPoint()),$=o.MercatorCoordinate.fromLngLat(this.center),U=Math.pow(2,b),W=[U*D.x,U*D.y,0],te=[U*$.x,U*$.y,0],ae=Qc.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=Me=>({aabb:new Iu([Me*U,0,0],[(Me+1)*U,U,0]),zoom:0,x:0,y:0,wrap:Me,fullyVisible:!1}),we=[],Be=[],je=b,et=l.reparseOverscaled?E:b;if(this._renderWorldCopies)for(let Me=1;Me<=3;Me++)we.push(_e(-Me)),we.push(_e(Me));for(we.push(_e(0));we.length>0;){const Me=we.pop(),at=Me.x,nt=Me.y;let xt=Me.fullyVisible;if(!xt){const fn=Me.aabb.intersects(ae);if(fn===0)continue;xt=fn===2}const _t=l.terrain?W:te,Ft=Me.aabb.distanceX(_t),vt=Me.aabb.distanceY(_t),sn=Math.max(Math.abs(Ft),Math.abs(vt)),Yt=Se+(1<Yt&&Me.zoom>=fe){const fn=je-Me.zoom,Fn=W[0]-.5-(at<>1),Pn=Me.zoom+1;let fr=Me.aabb.quadrant(fn);if(l.terrain){const hr=new o.OverscaledTileID(Pn,Me.wrap,Pn,Fn,Un),er=l.terrain.getMinMaxElevation(hr),ir=(h=er.minElevation)!==null&&h!==void 0?h:this.elevation,vr=(g=er.maxElevation)!==null&&g!==void 0?g:this.elevation;fr=new Iu([fr.min[0],fr.min[1],ir],[fr.max[0],fr.max[1],vr])}we.push({aabb:fr,zoom:Pn,x:Fn,y:Un,wrap:Me.wrap,fullyVisible:xt})}}return Be.sort((Me,at)=>Me.distanceSq-at.distanceSq).map(Me=>Me.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<D&&(b=D-_e)}if(this.lngRange){const Se=($+U)/2,_e=o.wrap(ae.x,Se-this.worldSize/2,Se+this.worldSize/2),we=W.x/2;_e-we<$&&(g=$+we),_e+we>U&&(g=U-we)}g===void 0&&b===void 0||(this.center=this.unproject(new o.pointGeometry(g!==void 0?g:ae.x,b!==void 0?b:ae.y)).wrap()),this._unmodified=te,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 E=Math.PI/2+this._pitch,D=this._fov*(.5+l.y/this.height),$=Math.sin(D)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-E-D,.01,Math.PI-.01)),U=this.getHorizon(),W=2*Math.atan(U/this.cameraToCenterDistance)*(.5+l.y/(2*U)),te=Math.sin(W)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-E-W,.01,Math.PI-.01)),ae=Math.cos(Math.PI/2-this._pitch)*$+this.cameraToSeaLevelDistance,fe=Math.cos(Math.PI/2-this._pitch)*te+this.cameraToSeaLevelDistance,Se=1.01*Math.min(ae,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,Be=this.height%2/2,je=Math.cos(this.angle),et=Math.sin(this.angle),Me=h-Math.round(h)+je*we+et*Be,at=g-Math.round(g)+je*Be+et*we,nt=new Float64Array(b);if(o.translate(nt,nt,[Me>.5?Me-1:Me,at>.5?at-1:at,0]),this.alignedProjMatrix=nt,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,E=h.x,D=h.y;for(const $ of l)g=Math.min(g,$.x),b=Math.min(b,$.y),E=Math.max(E,$.x),D=Math.max(D,$.y);return[new o.pointGeometry(g,b),new o.pointGeometry(E,b),new o.pointGeometry(E,D),new o.pointGeometry(g,D),new o.pointGeometry(g,b)]}}}class Jm{constructor(l){this._hashName=l&&encodeURIComponent(l),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(h,g){let b=!1,E=null;const D=()=>{E=null,b&&(h(),E=setTimeout(D,300),b=!1)};return()=>(b=!0,E||D(),E)}(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),E=Math.pow(10,b),D=Math.round(h.lng*E)/E,$=Math.round(h.lat*E)/E,U=this._map.getBearing(),W=this._map.getPitch();let te="";if(te+=l?`/${D}/${$}/${g}`:`${g}/${$}/${D}`,(U||W)&&(te+="/"+Math.round(10*U)/10),W&&(te+=`/${Math.round(W)}`),this._hashName){const ae=this._hashName;let fe=!1;const Se=window.location.hash.slice(1).split("&").map(_e=>{const we=_e.split("=")[0];return we===ae?(fe=!0,`${we}=${te}`):_e}).filter(_e=>_e);return fe||Se.push(`${ae}=${te}`),`#${Se.join("&")}`}return`#${te}`}_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 Mu={linearity:.3,easing:o.bezier(0,0,.3,1)},ev=o.extend({deceleration:2500,maxSpeed:1400},Mu),tv=o.extend({deceleration:20,maxSpeed:1400},Mu),nv=o.extend({deceleration:1e3,maxSpeed:360},Mu),Sl=o.extend({deceleration:1e3,maxSpeed:90},Mu);class rv{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:E}of this._inertiaBuffer)h.zoom+=E.zoomDelta||0,h.bearing+=E.bearingDelta||0,h.pitch+=E.pitchDelta||0,E.panDelta&&h.pan._add(E.panDelta),E.around&&(h.around=E.around),E.pinchAround&&(h.pinchAround=E.pinchAround);const g=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,b={};if(h.pan.mag()){const E=Nu(h.pan.mag(),g,o.extend({},ev,l||{}));b.offset=h.pan.mult(E.amount/h.pan.mag()),b.center=this._map.transform.center,Au(b,E)}if(h.zoom){const E=Nu(h.zoom,g,tv);b.zoom=this._map.transform.zoom+E.amount,Au(b,E)}if(h.bearing){const E=Nu(h.bearing,g,nv);b.bearing=this._map.transform.bearing+o.clamp(E.amount,-179,179),Au(b,E)}if(h.pitch){const E=Nu(h.pitch,g,Sl);b.pitch=this._map.transform.pitch+E.amount,Au(b,E)}if(b.zoom||b.bearing){const E=h.pinchAround===void 0?h.around:h.pinchAround;b.around=E?this._map.unproject(E):this._map.getCenter()}return this.clear(),o.extend(b,{noMoveStart:!0})}}function Au(x,l){(!x.duration||x.durationh.unproject(U)),$=E.reduce((U,W,te,ae)=>U.add(W.div(ae.length)),new o.pointGeometry(0,0));super(l,{points:E,point:$,lngLats:D,lngLat:h.unproject($),originalEvent:g}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class co extends o.Event{constructor(l,h,g){super(l,{originalEvent:g}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class jx{constructor(l,h){this._map=l,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(l){return this._firePreventable(new co(l.type,this._map,l))}mousedown(l,h){return this._mousedownPos=h,this._firePreventable(new uo(l.type,this._map,l))}mouseup(l){this._map.fire(new uo(l.type,this._map,l))}click(l,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new uo(l.type,this._map,l))}dblclick(l){return this._firePreventable(new uo(l.type,this._map,l))}mouseover(l){this._map.fire(new uo(l.type,this._map,l))}mouseout(l){this._map.fire(new uo(l.type,this._map,l))}touchstart(l){return this._firePreventable(new Ou(l.type,this._map,l))}touchmove(l){this._map.fire(new Ou(l.type,this._map,l))}touchend(l){this._map.fire(new Ou(l.type,this._map,l))}touchcancel(l){this._map.fire(new Ou(l.type,this._map,l))}_firePreventable(l){if(this._map.fire(l),l.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ya{constructor(l){this._map=l}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(l){this._map.fire(new uo(l.type,this._map,l))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new uo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(l){this._delayContextMenu?this._contextMenuEvent=l:this._ignoreContextMenu||this._map.fire(new uo(l.type,this._map,l)),this._map.listens("contextmenu")&&l.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iv{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)E.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 ka(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 E=new o.pointGeometry(0,0);for(const D of b)E._add(D);return E.div(b.length)}(h),this.touches=ka(g,h)))}touchmove(l,h,g){if(this.aborted||!this.centroid)return;const b=ka(g,h);for(const E in this.touches){const D=this.touches[E],$=b[E];(!$||$.dist(D)>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 eh{constructor(l){this.singleTap=new Du(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 E=l.timeStamp-this.lastTime<500,D=!this.lastTap||this.lastTap.dist(b)<30;if(E&&D||this.reset(),this.count++,this.lastTime=l.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}class Kx{constructor(){this._zoomIn=new eh({numTouches:1,numTaps:2}),this._zoomOut=new eh({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),E=this._zoomOut.touchend(l,h,g);return b?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:D.getZoom()+1,around:D.unproject(b)},{originalEvent:l})}):E?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:D.getZoom()-1,around:D.unproject(E)},{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 Hx={0:1,2:2};class Jc{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,E){const D=Hx[E];return b.buttons===void 0||(b.buttons&D)!==D}(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=ka(g,h),E=new o.pointGeometry(0,0),D=new o.pointGeometry(0,0);let $=0;for(const W in b){const te=b[W],ae=this._touches[W];ae&&(E._add(te),D._add(te.sub(ae)),$++,b[W]=te)}if(this._touches=b,$Math.abs(x.x)}class rh extends ks{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,nh(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]),E=l[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(b,E,g.timeStamp),this._valid?(this._lastPoints=l,this._active=!0,{pitchDelta:(b.y+E.y)/2*-.5}):void 0}gestureBeginsVertically(l,h,g){if(this._valid!==void 0)return this._valid;const b=l.mag()>=2,E=h.mag()>=2;if(!b&&!E)return;if(!b||!E)return this._firstMove===void 0&&(this._firstMove=g),g-this._firstMove<100&&void 0;const D=l.y>0==h.y>0;return nh(l)&&nh(h)&&D}}const av={panStep:100,bearingStep:15,pitchStep:10};class sv{constructor(){const l=av;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,E=0,D=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(),E=-1);break;case 39:l.shiftKey?g=1:(l.preventDefault(),E=1);break;case 38:l.shiftKey?b=1:(l.preventDefault(),D=-1);break;case 40:l.shiftKey?b=-1:(l.preventDefault(),D=1);break;default:return}return this._rotationDisabled&&(g=0,b=0),{cameraAnimation:$=>{const U=$.getZoom();$.easeTo({duration:300,easeId:"keyboardHandler",easing:Gx,zoom:h?Math.round(U)+h*(l.shiftKey?2:1):U,bearing:$.getBearing()+g*this._bearingStep,pitch:$.getPitch()+b*this._pitchStep,offset:[-E*this._panStep,-D*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 Gx(x){return x*(2-x)}const lv=4.000244140625;class ih{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%lv==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)>lv?this._wheelZoomRate:this._defaultZoomRate;let U=2/(1+Math.exp(-Math.abs(this._delta*$)));this._delta<0&&U!==0&&(U=1/U);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*U))),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 E,D=!1;if(this._type==="wheel"&&g&&b){const $=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),U=b($);E=o.number(g,h,U),$<1?this._frameId||(this._frameId=!0):D=!0}else E=h,D=!0;return this._active=!0,D&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!D,zoomDelta:E-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,E=g.easing(b+.01)-g.easing(b),D=.27/Math.sqrt(E*E+1e-4)*.01,$=Math.sqrt(.0729-D*D);h=o.bezier(D,$,.25,1)}return this._prevEase={start:o.exported.now(),duration:l,easing:h},h}reset(){this._active=!1}}class oh{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 ah{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 sh{constructor(){this._tap=new eh({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],E=b.y-this._swipePoint.y;return this._swipePoint=b,l.preventDefault(),this._active=!0,{zoomDelta:E/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 Xi{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 Ja{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 uv{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 El=x=>x.zoom||x.drag||x.pitch||x.rotate;class lh extends o.Event{}function zu(x){return x.panDelta&&x.panDelta.mag()||x.zoomDelta||x.bearingDelta||x.pitchDelta}class cv{constructor(l,h){this._map=l,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new rv(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,E,D]of this._listeners)w.addEventListener(b,E,b===document?this.handleWindowEvent:this.handleEvent,D)}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 jx(h,l));const b=h.boxZoom=new iv(h,l);this._add("boxZoom",b);const E=new Kx,D=new ah;h.doubleClickZoom=new oh(D,E),this._add("tapZoom",E),this._add("clickZoom",D);const $=new sh;this._add("tapDragZoom",$);const U=h.touchPitch=new rh(h);this._add("touchPitch",U);const W=new Ia(l),te=new mn(l);h.dragRotate=new Ja(l,W,te),this._add("mouseRotate",W,["mousePitch"]),this._add("mousePitch",te,["mouseRotate"]);const ae=new Lu(l),fe=new ov(l,h);h.dragPan=new Xi(g,ae,fe),this._add("mousePan",ae),this._add("touchPan",fe,["touchZoom","touchRotate"]);const Se=new Wx,_e=new rn;h.touchZoomRotate=new uv(g,_e,Se,$),this._add("touchRotate",Se,["touchPan","touchZoom"]),this._add("touchZoom",_e,["touchPan","touchRotate"]);const we=h.scrollZoom=new ih(h,this);this._add("scrollZoom",we,["mousePan"]);const Be=h.keyboard=new sv;this._add("keyboard",Be),this._add("blockableMapEvent",new Ya(h));for(const je of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])l.interactive&&l[je]&&h[je].enable(l[je])}_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(El(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},E={},D={},$=l.touches,U=$?this._getMapTouches($):void 0,W=U?w.touchPos(this._el,U):w.mousePos(this._el,l);for(const{handlerName:fe,handler:Se,allowed:_e}of this._handlers){if(!Se.isEnabled())continue;let we;this._blockedByActive(D,_e,fe)?Se.reset():Se[h||l.type]&&(we=Se[h||l.type](l,W,U),this.mergeHandlerResult(b,E,we,fe,g),we&&we.needsRenderFrame&&this._triggerRenderFrame()),(we||Se.isActive())&&(D[fe]=Se)}const te={};for(const fe in this._previousActiveHandlers)D[fe]||(te[fe]=g);this._previousActiveHandlers=D,(Object.keys(te).length||zu(b))&&(this._changes.push([b,E,te]),this._triggerRenderFrame()),(Object.keys(D).length||zu(b))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ae}=b;ae&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ae(this._map))}mergeHandlerResult(l,h,g,b,E){if(!g)return;o.extend(l,g);const D={handlerName:b,originalEvent:g.originalEvent||E};g.zoomDelta!==void 0&&(h.zoom=D),g.panDelta!==void 0&&(h.drag=D),g.pitchDelta!==void 0&&(h.pitch=D),g.bearingDelta!==void 0&&(h.rotate=D)}_applyChanges(){const l={},h={},g={};for(const[b,E,D]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,E),o.extend(g,D);this._updateMapTransform(l,h,g),this._changes=[]}_updateMapTransform(l,h,g){const b=this._map,E=b.transform,D=b.style&&b.style.terrain;if(!(zu(l)||D&&this._drag))return this._fireEvents(h,g,!0);let{panDelta:$,zoomDelta:U,bearingDelta:W,pitchDelta:te,around:ae,pinchAround:fe}=l;fe!==void 0&&(ae=fe),b._stop(!0),ae=ae||b.transform.centerPoint;const Se=E.pointLocation($?ae.sub($):ae);W&&(E.bearing+=W),te&&(E.pitch+=te),U&&(E.zoom+=U),D?h.drag&&!this._drag?(this._drag={center:E.centerPoint,lngLat:E.pointLocation(ae),point:ae,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&&(E.center=E.pointLocation(E.centerPoint.sub($))):E.setLocationAtPoint(Se,ae),this._map._update(),l.noInertia||this._inertia.record(l),this._fireEvents(h,g,!0)}_fireEvents(l,h,g){const b=El(this._eventsInProgress),E=El(l),D={};for(const te in l){const{originalEvent:ae}=l[te];this._eventsInProgress[te]||(D[`${te}start`]=ae),this._eventsInProgress[te]=l[te]}!b&&E&&this._fireEvent("movestart",E.originalEvent);for(const te in D)this._fireEvent(te,D[te]);E&&this._fireEvent("move",E.originalEvent);for(const te in l){const{originalEvent:ae}=l[te];this._fireEvent(te,ae)}const $={};let U;for(const te in this._eventsInProgress){const{handlerName:ae,originalEvent:fe}=this._eventsInProgress[te];this._handlersById[ae].isActive()||(delete this._eventsInProgress[te],U=h[ae]||fe,$[`${te}end`]=U)}for(const te in $)this._fireEvent(te,$[te]);const W=El(this._eventsInProgress);if(g&&(b||E)&&!W){this._updatingCamera=!0;const te=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ae=fe=>fe!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new lh("renderFrame",{timeStamp:l})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const ko={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 Or 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,U,xt)),this._rotating&&(g.bearing=o.number(E,W,xt)),this._pitching&&(g.pitch=o.number(D,te,xt)),this._padding&&(g.interpolatePadding($,ae,xt),Se=g.centerPoint.add(fe)),Me)g.setLocationAtPoint(Me,at);else{const _t=g.zoomScale(g.zoom-b),Ft=U>b?Math.min(2,et):Math.max(.5,et),vt=Math.pow(Ft,1-xt),sn=g.unproject(Be.add(je.mult(xt*vt)).mult(_t));g.setLocationAtPoint(g.renderWorldCopies?sn.wrap():sn,Se)}this._fireMoveEvents(h)},xt=>{this._afterEase(h,xt)},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,E=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)),E&&this.fire(new o.Event("pitchend",l)),this.fire(new o.Event("moveend",l))}flyTo(l,h){if(!l.essential&&o.exported.prefersReducedMotion){const Pn=o.pick(l,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Pn,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(),E=this.getBearing(),D=this.getPitch(),$=this.getPadding(),U="zoom"in l?o.clamp(+l.zoom,g.minZoom,g.maxZoom):b,W="bearing"in l?this._normalizeBearing(l.bearing,E):E,te="pitch"in l?+l.pitch:D,ae="padding"in l?l.padding:g.padding,fe=g.zoomScale(U-b),Se=o.pointGeometry.convert(l.offset);let _e=g.centerPoint.add(Se);const we=g.pointLocation(_e),Be=o.LngLat.convert(l.center||we);this._normalizeCenter(Be);const je=g.project(we),et=g.project(Be).sub(je);let Me=l.curve;const at=Math.max(g.width,g.height),nt=at/fe,xt=et.mag();if("minZoom"in l){const Pn=o.clamp(Math.min(l.minZoom,b,U),g.minZoom,g.maxZoom),fr=at/g.zoomScale(Pn-b);Me=Math.sqrt(fr/xt*2)}const _t=Me*Me;function Ft(Pn){const fr=(nt*nt-at*at+(Pn?-1:1)*_t*_t*xt*xt)/(2*(Pn?nt:at)*_t*xt);return Math.log(Math.sqrt(fr*fr+1)-fr)}function vt(Pn){return(Math.exp(Pn)-Math.exp(-Pn))/2}function sn(Pn){return(Math.exp(Pn)+Math.exp(-Pn))/2}const Yt=Ft(0);let fn=function(Pn){return sn(Yt)/sn(Yt+Me*Pn)},Fn=function(Pn){return at*((sn(Yt)*(vt(fr=Yt+Me*Pn)/sn(fr))-vt(Yt))/_t)/xt;var fr},Un=(Ft(1)-Yt)/Me;if(Math.abs(xt)<1e-6||!isFinite(Un)){if(Math.abs(at-nt)<1e-6)return this.easeTo(l,h);const Pn=ntl.maxDuration&&(l.duration=0),this._zooming=!0,this._rotating=E!==W,this._pitching=te!==D,this._padding=!g.isPaddingEqual(ae),this._prepareEase(h,!1),this._ease(Pn=>{const fr=Pn*Un,hr=1/fn(fr);g.zoom=Pn===1?U:b+g.scaleZoom(hr),this._rotating&&(g.bearing=o.number(E,W,Pn)),this._pitching&&(g.pitch=o.number(D,te,Pn)),this._padding&&(g.interpolatePadding($,ae,Pn),_e=g.centerPoint.add(Se));const er=Pn===1?Be:g.unproject(je.add(et.mult(Fn(fr))).mult(hr));g.setLocationAtPoint(g.renderWorldCopies?er.wrap():er,_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 Fu{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 E=h[b];if(E.used||E.usedForTerrain){const D=E.getSource();D.attribution&&l.indexOf(D.attribution)<0&&l.push(D.attribution)}}l=l.filter(b=>String(b).trim()),l.sort((b,E)=>b.length-E.length),l=l.filter((b,E)=>{for(let D=E+1;D=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 td{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 dv{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 fv={"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"},hv={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},qx={showCompass:!0,showZoom:!0,visualizePitch:!1};class oa{constructor(l,h,g=!1){this._clickTolerance=10,this.element=h,this.mouseRotate=new Ia({clickTolerance:l.dragRotate._mouseRotate._clickTolerance}),this.map=l,g&&(this.mousePitch=new mn({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 E=this.mousePitch.mousemoveWindow(l,h);E&&E.pitchDelta&&g.setPitch(g.getPitch()+E.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 xn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function In(x,l,h){const g=x.classList;for(const b in xn)g.remove(`maplibregl-${h}-anchor-${b}`,`mapboxgl-${h}-anchor-${b}`);g.add(`maplibregl-${h}-anchor-${l}`,`mapboxgl-${h}-anchor-${l}`)}class Pl 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,E=27;g.setAttributeNS(null,"display","block"),g.setAttributeNS(null,"height",`${b}px`),g.setAttributeNS(null,"width",`${E}px`),g.setAttributeNS(null,"viewBox",`0 0 ${E} ${b}`);const D=w.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"stroke","none"),D.setAttributeNS(null,"stroke-width","1"),D.setAttributeNS(null,"fill","none"),D.setAttributeNS(null,"fill-rule","evenodd");const $=w.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"fill-rule","nonzero");const U=w.createNS("http://www.w3.org/2000/svg","g");U.setAttributeNS(null,"transform","translate(3.0, 29.0)"),U.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 Me=w.createNS("http://www.w3.org/2000/svg","ellipse");Me.setAttributeNS(null,"opacity","0.04"),Me.setAttributeNS(null,"cx","10.5"),Me.setAttributeNS(null,"cy","5.80029008"),Me.setAttributeNS(null,"rx",et.rx),Me.setAttributeNS(null,"ry",et.ry),U.appendChild(Me)}const te=w.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"fill",this._color);const ae=w.createNS("http://www.w3.org/2000/svg","path");ae.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"),te.appendChild(ae);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 Be=w.createNS("http://www.w3.org/2000/svg","circle");Be.setAttributeNS(null,"fill","#000000"),Be.setAttributeNS(null,"opacity","0.25"),Be.setAttributeNS(null,"cx","5.5"),Be.setAttributeNS(null,"cy","5.5"),Be.setAttributeNS(null,"r","5.4999962");const je=w.createNS("http://www.w3.org/2000/svg","circle");je.setAttributeNS(null,"fill","#FFFFFF"),je.setAttributeNS(null,"cx","5.5"),je.setAttributeNS(null,"cy","5.5"),je.setAttributeNS(null,"r","5.4999962"),we.appendChild(Be),we.appendChild(je),$.appendChild(U),$.appendChild(te),$.appendChild(fe),$.appendChild(_e),$.appendChild(we),g.appendChild($),g.setAttributeNS(null,"height",b*this._scale+"px"),g.setAttributeNS(null,"width",E*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()}),In(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=$u(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,`${xn[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),E=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*E?"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 uh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let es,Pi=0,ts=!1;const aa={maxWidth:100,unit:"metric"};function pv(x,l,h){const g=h&&h.maxWidth||100,b=x._container.clientHeight/2,E=x.unproject([0,b]),D=x.unproject([g,b]),$=E.distanceTo(D);if(h&&h.unit==="imperial"){const U=3.2808*$;U>5280?ns(l,g,U/5280,x._getUIString("ScaleControl.Miles")):ns(l,g,U,x._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?ns(l,g,$/1852,x._getUIString("ScaleControl.NauticalMiles")):$>=1e3?ns(l,g,$/1e3,x._getUIString("ScaleControl.Kilometers")):ns(l,g,$,x._getUIString("ScaleControl.Meters"))}function ns(x,l,h,g){const b=function(E){const D=Math.pow(10,`${Math.floor(E)}`.length-1);let $=E/D;return $=$>=10?10:$>=5?5:$>=3?3:$>=2?2:$>=1?1:function(U){const W=Math.pow(10,Math.ceil(-Math.log(U)/Math.LN10));return Math.round(U*W)/W}($),D*$}(h);x.style.width=l*(b/h)+"px",x.innerHTML=`${b} ${g}`}const qr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ni=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ch(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 ch(new o.pointGeometry(0,0))}const Is={supported:f,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends Or{constructor(x){var l;if(o.PerformanceUtils.mark(o.PerformanceMarkers.create),(x=o.extend({},hv,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 Ru(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 dv,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},fv,x.locale),this._clickTolerance=x.clickTolerance,this._pixelRatio=(l=x.pixelRatio)!==null&&l!==void 0?l:devicePixelRatio,this._requestManager=new P(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 cv(this,x),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=x.hash&&new Jm(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 Fu({customAttribution:x.customAttribution})),x.maplibreLogo&&this.addControl(new td,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:E=>{const D=this.getLayer(l)?this.queryRenderedFeatures(E.point,{layers:[l]}):[];D.length?g||(g=!0,h.call(this,new uo(x,this,E.originalEvent,{features:D}))):g=!1},mouseout:()=>{g=!1}}}}if(x==="mouseleave"||x==="mouseout"){let g=!1;return{layer:l,listener:h,delegates:{mousemove:D=>{(this.getLayer(l)?this.queryRenderedFeatures(D.point,{layers:[l]}):[]).length?g=!0:g&&(g=!1,h.call(this,new uo(x,this,D.originalEvent)))},mouseout:D=>{g&&(g=!1,h.call(this,new uo(x,this,D.originalEvent)))}}}}{const g=b=>{const E=this.getLayer(l)?this.queryRenderedFeatures(b.point,{layers:[l]}):[];E.length&&(b.features=E,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 E=0;E{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:E,content:D}={}){if(this._lazyInitEmptyStyle(),l instanceof HTMLImageElement||o.isImageBitmap(l)){const{width:$,height:U,data:W}=o.exported.getImageData(l);this.style.addImage(x,{data:new o.RGBAImage({width:$,height:U},W),pixelRatio:h,stretchX:b,stretchY:E,content:D,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:U,data:W}=l,te=l;this.style.addImage(x,{data:new o.RGBAImage({width:$,height:U},new Uint8Array(W)),pixelRatio:h,stretchX:b,stretchY:E,content:D,sdf:g,version:0,userImage:te}),te.onAdd&&te.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:E,data:D}=g;if(b===void 0||E===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||E!==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(D,$),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(E=>{b[E]=w.create("div",`maplibregl-ctrl-${E} mapboxgl-ctrl-${E}`,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 Jf(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 D=this.transform.zoom,$=o.exported.now();this.style.zoomHistory.update(D,$);const U=new o.EvaluationParameters(D,{now:$,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),W=U.crossFadingFactor();W===1&&W===this._crossFadingFactor||(b=!0,this._crossFadingFactor=W),this.style.update(U)}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 D=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:D,gpuTime:$}))},50)}if(this.listens("gpu-timing-layer")){const D=this.painter.collectGpuTimers();setTimeout(()=>{const $=this.painter.queryGpuTimers(D);this.fire(new o.Event("gpu-timing-layer",{layerTimes:$}))},50)}const E=this._sourcesDirty||this._styleDirty||this._placementDirty;return E||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||E||(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({},qx,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 oa(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({},uh,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,es!==void 0?l(es):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(h=>{es=h.state!=="denied",l(es)}):(es=!!window.navigator.geolocation,l(es)),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,Pi=0,ts=!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&&ts)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 Pl(this._dotElement),this._circleElement=w.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Pl({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":Pi--,ts=!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"),Pi++,Pi>1?(x={maximumAge:6e5,timeout:0},ts=!0):(x=this.options.positionOptions,ts=!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:Fu,LogoControl:td,ScaleControl:class{constructor(x){this.options=o.extend({},aa,x),o.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){pv(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,pv(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(qr),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(E=>this._container.classList.add(E)),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=$u(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=ch(this.options.offset);if(!h){const E=this._container.offsetWidth,D=this._container.offsetHeight;let $;$=l.y+g.bottom.ythis._map.transform.height-D?["bottom"]:[],l.xthis._map.transform.width-E/2&&$.push("right"),h=$.length===0?"bottom":$.join("-")}const b=l.add(g[h]).round();w.setTransform(this._container,`${xn[h]} translate(${b.x}px,${b.y}px)`),In(this._container,h,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const x=this._container.querySelector(ni);x&&x.focus()}_onClose(){this.remove()}},Marker:Pl,Style:Mr,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.pointGeometry,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,AJAXError:o.AJAXError,config:o.config,CanvasSource:Te,GeoJSONSource:ce,ImageSource:ye,RasterDEMTileSource:ie,RasterTileSource:J,VectorTileSource:Z,VideoSource:Ie,prewarm:function(){Rt().acquire(It)},clearPrewarmedResources:function(){const x=pt;x&&(x.isPreloaded()&&x.numActive()===1?(x.release(It),pt=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 We.workerCount},set workerCount(x){We.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 ko.extend(Is,{isSafari:o.isSafari,getPerformanceMetrics:o.PerformanceUtils.getPerformanceMetrics}),Is});var c=i;return c})})(I6);const Pde=I6.exports,Tde="modulepreload",kde=function(e){return"/"+e},yR={},Ide=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(s=>{if(s=kde(s),s in yR)return;yR[s]=!0;const c=s.endsWith(".css"),o=c?'[rel="stylesheet"]':"";if(!!r)for(let v=i.length-1;v>=0;v--){const y=i[v];if(y.href===s&&(!c||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${o}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":Tde,c||(p.as="script",p.crossOrigin=""),p.href=s,document.head.appendChild(p),c)return new Promise((v,y)=>{p.addEventListener("load",v),p.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())},ME=C.exports.createContext(null),Rde=e=>{const[t,n]=C.exports.useState({}),r=C.exports.useCallback((s,c="default")=>{n(o=>{if(c==="current")throw new Error("'current' cannot be used as map id");if(o[c])throw new Error(`Multiple maps with the same id: ${c}`);return{...o,[c]:s}})},[]),i=C.exports.useCallback((s="default")=>{n(c=>{if(c[s]){const o={...c};return delete o[s],o}return c})},[]);return I(ME.Provider,{value:{maps:t,onMapMount:r,onMapUnmount:i},children:e.children})};function AE(){var e;const t=(e=C.exports.useContext(ME))===null||e===void 0?void 0:e.maps,n=C.exports.useContext(Dc);return C.exports.useMemo(()=>({...t,current:n==null?void 0:n.map}),[t,n])}function Mde(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function xR(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function _R(e,t){const n=t.viewState||t;let r=!1;if("longitude"in n&&"latitude"in n){const i=e.center;e.center=new i.constructor(n.longitude,n.latitude),r=r||i!==e.center}if("zoom"in n){const i=e.zoom;e.zoom=n.zoom,r=r||i!==e.zoom}if("bearing"in n){const i=e.bearing;e.bearing=n.bearing,r=r||i!==e.bearing}if("pitch"in n){const i=e.pitch;e.pitch=n.pitch,r=r||i!==e.pitch}return n.padding&&!e.isPaddingEqual(n.padding)&&(r=!0,e.padding=n.padding),r}const Ade=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function bR(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const r of e.layers)t[r.id]=r;const n=e.layers.map(r=>{const i=t[r.ref];let s=null;if("interactive"in r&&(s={...r},delete s.interactive),i){s=s||{...r},delete s.ref;for(const c of Ade)c in i&&(s[c]=i[c])}return s||r});return{...e,layers:n}}function Nde(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,s=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===s}function xa(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{const s=this.props[CR[i.type]];s&&s(i)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const s=this.props[wR[i.type]];if(s){if(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"){const c=this._hoveredFeatures||this._map.queryRenderedFeatures(i.point,{layers:this.props.interactiveLayerIds});i.features=c}s(i),delete i.features}},this._onCameraEvent=i=>{if(!this._internalUpdate){const s=this.props[lb[i.type]];s&&s(i)}i.type in this._deferredEvents&&(this._deferredEvents[i.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const i=this._updateSize(t),s=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||i||s&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=hf.savedMaps.pop();if(!r)return null;const i=r.map,s=i.getContainer();for(n.className=s.className;s.childNodes.length>0;)n.appendChild(s.childNodes[0]);i._container=n,r.setProps({...t,styleDiffing:!1}),i.resize();const{initialViewState:c}=t;return c&&(c.bounds?i.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):r._updateViewState(c,!1)),i.isStyleLoaded()?i.fire("load"):i.once("styledata",()=>i.fire("load")),r}_initialize(t){const{props:n}=this,r={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||Lde()||null,container:t,style:bR(n.mapStyle)},i=r.initialViewState||r.viewState||r;if(Object.assign(r,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),n.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,n.gl)}const s=new this._MapClass(r);i.padding&&s.setPadding(i.padding),n.cursor&&(s.getCanvas().style.cursor=n.cursor),this._createShadowTransform(s);const c=s._render;s._render=p=>{this._inRender=!0,c.call(s,p),this._inRender=!1};const o=s._renderTaskQueue.run;s._renderTaskQueue.run=p=>{o.call(s._renderTaskQueue,p),this._onBeforeRepaint()},s.on("render",()=>this._onAfterRepaint());const f=s.fire;s.fire=this._fireEvent.bind(this,f),s.on("resize",()=>{this._renderTransform.resize(s.transform.width,s.transform.height)}),s.on("styledata",()=>this._updateStyleComponents(this.props,{})),s.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in wR)s.on(p,this._onPointerEvent);for(const p in lb)s.on(p,this._onCameraEvent);for(const p in CR)s.on(p,this._onEvent);this._map=s}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),hf.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=Mde(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,i=this._renderTransform,{zoom:s,pitch:c,bearing:o}=i,f=r.isMoving();f&&(i.cameraElevationReference="sea");const p=_R(i,{...xR(r.transform),...t});if(f&&(i.cameraElevationReference="ground"),p&&n){const v=this._deferredEvents;v.move=!0,v.zoom||(v.zoom=s!==i.zoom),v.rotate||(v.rotate=o!==i.bearing),v.pitch||(v.pitch=c!==i.pitch)}return f||_R(r.transform,t),p}_updateSettings(t,n){const r=this._map;let i=!1;for(const s of Ode)s in t&&!xa(t[s],n[s])&&(i=!0,r[`set${s[0].toUpperCase()}${s.slice(1)}`](t[s]));return i}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor),t.mapStyle!==n.mapStyle){const r={diff:t.styleDiffing};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(bR(t.mapStyle),r),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let i=!1;return r.style.loaded()&&("light"in t&&!xa(t.light,n.light)&&(i=!0,r.setLight(t.light)),"fog"in t&&!xa(t.fog,n.fog)&&(i=!0,r.setFog(t.fog)),"terrain"in t&&!xa(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(i=!0,r.setTerrain(t.terrain))),i}_updateHandlers(t,n){const r=this._map;let i=!1;for(const s of Dde){const c=t[s];xa(c,n[s])||(i=!0,c?r[s].enable(c):r[s].disable())}return i}_updateHover(t){var n;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const s=t.type,c=((n=this._hoveredFeatures)===null||n===void 0?void 0:n.length)>0;let o;if(s==="mousemove")try{o=this._map.queryRenderedFeatures(t.point,{layers:r.interactiveLayerIds})}catch{o=[]}else o=[];const f=o.length>0;!f&&c&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=o,f&&!c&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}_fireEvent(t,n,r){const i=this._map,s=i.transform,c=typeof n=="string"?n:n.type;return c==="move"&&this._updateViewState(this.props,!1),c in lb&&(typeof n=="object"&&(n.viewState=xR(s)),this._map.isMoving())?(i.transform=this._renderTransform,t.call(i,n,r),i.transform=s,i):(t.call(i,n,r),i)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=n}}}hf.savedMaps=[];function Lde(){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 zde=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Fde(e,t){if(!e)return null;const n=e.map,r={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:i=>e.transform.locationPoint(t.LngLat.convert(i)),unproject:i=>e.transform.pointLocation(t.Point.convert(i)),queryTerrainElevation:(i,s)=>{const c=n.transform;n.transform=e.transform;const o=n.queryTerrainElevation(i,s);return n.transform=c,o}};for(const i of $de(n))!(i in r)&&!zde.includes(i)&&(r[i]=n[i].bind(n));return r}function $de(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Bde=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect,Vde=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Ude(e,t){for(const n of Vde)n in t&&(e[n]=t[n]);t.RTLTextPlugin&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(t.RTLTextPlugin,n=>{n&&console.error(n)},!1)}const Dc=C.exports.createContext(null),jde={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"},NE=C.exports.forwardRef((e,t)=>{const n=C.exports.useContext(ME),[r,i]=C.exports.useState(null),s=C.exports.useRef(),{current:c}=C.exports.useRef({mapLib:null,map:null});C.exports.useEffect(()=>{const f=e.mapLib;let p=!0,v;return Promise.resolve(f||Ide(()=>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))Ude(y,e),e.reuseMaps&&(v=hf.reuse(e,s.current)),v||(v=new hf(y.Map,e,s.current)),c.map=Fde(v,y),c.mapLib=y,i(v),n==null||n.onMapMount(c.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&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?v.recycle():v.destroy())}},[]),Bde(()=>{r&&r.setProps(e)}),C.exports.useImperativeHandle(t,()=>c.map,[r]);const o=C.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]);return I("div",{id:e.id,ref:s,style:o,children:r&&I(Dc.Provider,{value:c,children:I("div",{"mapboxgl-children":"",children:e.children})})})});NE.displayName="Map";NE.defaultProps=jde;const Kde=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Lc(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const i=t[r];Number.isFinite(i)&&!Kde.test(r)?n[r]=`${i}px`:n[r]=i}}const Hde={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function M6(e){const{map:t,mapLib:n}=C.exports.useContext(Dc),r=C.exports.useRef({props:e});r.current.props=e;const i=C.exports.useMemo(()=>{let s=!1;C.exports.Children.forEach(e.children,f=>{f&&(s=!0)});const c={...e,element:s?document.createElement("div"):null},o=new n.Marker(c).setLngLat([e.longitude,e.latitude]);return o.getElement().addEventListener("click",f=>{var p,v;(v=(p=r.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=r.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=r.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=r.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(()=>{Lc(i.getElement(),e.style)},[e.style]),(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Nde(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),pu.exports.createPortal(e.children,i.getElement())}M6.defaultProps=Hde;C.exports.memo(M6);function SR(e){return new Set(e?e.trim().split(/\s+/):[])}function Wde(e){const{map:t,mapLib:n}=C.exports.useContext(Dc),r=C.exports.useMemo(()=>document.createElement("div"),[]),i=C.exports.useRef({props:e});i.current.props=e;const s=C.exports.useMemo(()=>{const c={...e},o=new n.Popup(c).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 c=o=>{var f,p;(p=(f=i.current.props).onClose)===null||p===void 0||p.call(f,o)};return s.on("close",c),s.setDOMContent(r).addTo(t.getMap()),()=>{s.off("close",c),s.isOpen()&&s.remove()}},[]),C.exports.useEffect(()=>{Lc(s.getElement(),e.style)},[e.style]),s.isOpen()&&((s.getLngLat().lng!==e.longitude||s.getLngLat().lat!==e.latitude)&&s.setLngLat([e.longitude,e.latitude]),e.offset&&!xa(s.options.offset,e.offset)&&s.setOffset(e.offset),(s.options.anchor!==e.anchor||s.options.maxWidth!==e.maxWidth)&&(s.options.anchor=e.anchor,s.setMaxWidth(e.maxWidth)),s.options.className!==e.className)){const c=SR(s.options.className),o=SR(e.className);for(const f of c)o.has(f)||s.removeClassName(f);for(const f of o)c.has(f)||s.addClassName(f);s.options.className=e.className}return pu.exports.createPortal(e.children,r)}const Gde=C.exports.memo(Wde);function Nm(e,t,n,r){const i=C.exports.useContext(Dc),s=C.exports.useMemo(()=>e(i),[]);return C.exports.useEffect(()=>{const c=r||n||t,o=typeof t=="function"&&typeof n=="function"?t:null,f=typeof n=="function"?n:typeof t=="function"?t:null,{map:p}=i;return p.hasControl(s)||(p.addControl(s,c==null?void 0:c.position),o&&o(i)),()=>{f&&f(i),p.hasControl(s)&&p.removeControl(s)}},[]),s}function qde(e){const t=Nm(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return C.exports.useEffect(()=>{Lc(t._container,e.style)},[e.style]),null}C.exports.memo(qde);function Zde(e){const t=Nm(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return C.exports.useEffect(()=>{Lc(t._controlContainer,e.style)},[e.style]),null}C.exports.memo(Zde);const A6=C.exports.forwardRef((e,t)=>{const n=C.exports.useRef({props:e}),r=Nm(({mapLib:i})=>{const s=new i.GeolocateControl(e),c=s._setupUI;return s._setupUI=o=>{s._container.hasChildNodes()||c(o)},s.on("geolocate",o=>{var f,p;(p=(f=n.current.props).onGeolocate)===null||p===void 0||p.call(f,o)}),s.on("error",o=>{var f,p;(p=(f=n.current.props).onError)===null||p===void 0||p.call(f,o)}),s.on("outofmaxbounds",o=>{var f,p;(p=(f=n.current.props).onOutOfMaxBounds)===null||p===void 0||p.call(f,o)}),s.on("trackuserlocationstart",o=>{var f,p;(p=(f=n.current.props).onTrackUserLocationStart)===null||p===void 0||p.call(f,o)}),s.on("trackuserlocationend",o=>{var f,p;(p=(f=n.current.props).onTrackUserLocationEnd)===null||p===void 0||p.call(f,o)}),s},{position:e.position});return n.current.props=e,C.exports.useImperativeHandle(t,()=>({trigger:()=>r.trigger()}),[]),C.exports.useEffect(()=>{Lc(r._container,e.style)},[e.style]),null});A6.displayName="GeolocateControl";C.exports.memo(A6);function Xde(e){const t=Nm(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return C.exports.useEffect(()=>{Lc(t._container,e.style)},[e.style]),null}C.exports.memo(Xde);const Yde={unit:"metric",maxWidth:100};function N6(e){const t=Nm(({mapLib:n})=>new n.ScaleControl(e),{position:e.position});return(t.options.unit!==e.unit||t.options.maxWidth!==e.maxWidth)&&(t.options.maxWidth=e.maxWidth,t.setUnit(e.unit)),C.exports.useEffect(()=>{Lc(t._container,e.style)},[e.style]),null}N6.defaultProps=Yde;C.exports.memo(N6);function l0(e,t){if(!e)throw new Error(t)}let Qde=0;function Jde(e,t,n){if(e.style&&e.style._loaded){const r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function efe(e,t,n){l0(t.id===n.id,"source id changed"),l0(t.type===n.type,"source type changed");let r="",i=0;for(const c in t)c!=="children"&&c!=="id"&&!xa(n[c],t[c])&&(r=c,i++);if(!i)return;const s=t.type;if(s==="geojson")e.setData(t.data);else if(s==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((s==="canvas"||s==="video")&&i===1&&r==="coordinates")e.setCoordinates(t.coordinates);else if(s==="vector"&&"setUrl"in e)switch(r){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles);break}else console.warn(`Unable to update prop: ${r}`)}function qd(e){const t=C.exports.useContext(Dc).map.getMap(),n=C.exports.useRef(e),[,r]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-source-${Qde++}`,[]);C.exports.useEffect(()=>{if(t){const c=()=>setTimeout(()=>r(o=>o+1),0);return t.on("styledata",c),c(),()=>{var o;if(t.off("styledata",c),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 s=t&&t.style&&t.getSource(i);return s?efe(s,e,n.current):s=Jde(t,i,e),n.current=e,s&&C.exports.Children.map(e.children,c=>c&&C.exports.cloneElement(c,{source:i}))||null}function tfe(e,t,n,r){if(l0(n.id===r.id,"layer id changed"),l0(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:i={},paint:s={},filter:c,minzoom:o,maxzoom:f,beforeId:p}=n;if(p!==r.beforeId&&e.moveLayer(t,p),i!==r.layout){const v=r.layout||{};for(const y in i)xa(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(s!==r.paint){const v=r.paint||{};for(const y in s)xa(s[y],v[y])||e.setPaintProperty(t,y,s[y]);for(const y in v)s.hasOwnProperty(y)||e.setPaintProperty(t,y,void 0)}xa(c,r.filter)||e.setFilter(t,c),(o!==r.minzoom||f!==r.maxzoom)&&e.setLayerZoomRange(t,o,f)}function nfe(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}let rfe=0;function $o(e){const t=C.exports.useContext(Dc).map.getMap(),n=C.exports.useRef(e),[,r]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-layer-${rfe++}`,[]);if(C.exports.useEffect(()=>{if(t){const c=()=>r(o=>o+1);return t.on("styledata",c),c(),()=>{t.off("styledata",c),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{tfe(t,i,e,n.current)}catch(c){console.warn(c)}else nfe(t,i,e);return n.current=e,null}const ife=e=>({mode:Ur.PENDING,setMode:t=>{e(n=>{n.mode=t})}}),Ss=bs(Mm(ws(ife),{name:"postnet/mode"}));function ofe(){for(var e=0,t,n,r="";ee&&(t=0,r=n,n=new Map)}return{get:function(c){var o=n.get(c);if(o!==void 0)return o;if((o=r.get(c))!==void 0)return i(c,o),o},set:function(c,o){n.has(c)?n.set(c,o):i(c,o)}}}var L6="!";function ffe(e){var t=e.separator||":";return function(r){for(var i=0,s=[],c=0,o=0;o{const{data:t,isInitialLoading:n}=pde(),{data:r,isInitialLoading:i}=mde(),{selection:{excluded:s}}=ml();return C.exports.useEffect(()=>e(r-s.size),[r,s]),Qe("div",{className:"flex items-center justify-between",children:[I("span",{children:"\u041E\u0442\u043E\u0431\u0440\u0430\u043D\u043E \u043B\u043E\u043A\u0430\u0446\u0438\u0439"}),n||i?I(Pf,{}):I("span",{children:`${r-s.size} / ${t}`})]})},Afe=e=>({updateCounter:-1,toggleUpdateCounter:()=>{e(t=>{t.updateCounter=t.updateCounter===-1?1:-1})}}),$6=bs(ws(Afe)),Px=({onSuccess:e})=>{const{toggleUpdateCounter:t}=$6();return b6({mutationFn:n=>Co.put(`/api/placement_points/update_status?${n.toString()}`),onSuccess:()=>{t(),e==null||e()}})},{Text:Nfe}=P5,fu=({text:e,className:t,classNameText:n})=>I("div",{className:Pc("mb-1",t),children:I(Nfe,{type:"secondary",className:Pc("uppercase text-xs",n),children:e})}),Ofe=({disabled:e})=>{const{filters:t}=Cs(),{prediction:n,categories:r,region:i}=t,{selection:s}=ml(),c=Oc(),[o,f]=C.exports.useState(!1),{mutate:p,isLoading:v,isSuccess:y}=Px({onSuccess:()=>{c.invalidateQueries(["table",1,t])}}),w=()=>{const k=new URLSearchParams({status:Gn.onApproval,"prediction_current[]":n,"categories[]":r,"included[]":[...s.included],"excluded[]":[...s.excluded]});i&&(i.type==="ao"&&k.append("district[]",i.id),i.type==="rayon"&&k.append("area[]",i.id)),p(k)};return Qe(An,{children:[Qe(gr,{type:"primary",block:!0,className:"mt-2",onClick:()=>f(!0),disabled:e,children:[I("span",{className:"mr-1",children:"\u0412\u0437\u044F\u0442\u044C \u0432 \u0440\u0430\u0431\u043E\u0442\u0443"}),I(O5,{})]}),Qe(vz,{title:" ",centered:!0,open:o,onCancel:()=>f(!1),closable:!0,footer:(()=>y?[I(gr,{type:"primary",onClick:()=>f(!1),children:"\u0425\u043E\u0440\u043E\u0448\u043E"},"ok-button")]:v?null:Qe("div",{className:"flex items-center justify-center gap-x-4",children:[I(gr,{onClick:()=>f(!1),children:"\u041E\u0442\u043C\u0435\u043D\u0430"}),I(gr,{type:"primary",onClick:w,children:"\u0414\u0430"})]}))(),children:[y?I(v2,{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}):I(fu,{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?",className:"text-center"}),v&&I("div",{className:"flex justify-center py-2",children:I(Pf,{tip:"\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u043C \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435...",size:"large"})})]})]})};function Dfe(e,t,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function Lfe(e,t,n){n===void 0&&(n={});for(var r=0,i=e;rn[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]e.reduce((t,n)=>(t[n.id]=n,t[n.id].type="ao",n.rayons&&n.rayons.forEach(r=>{t[r.id]=r,t[r.id].type="rayon"}),t),{}),Tx=()=>ao(["regions"],async()=>{const{data:e}=await Co.get("/api/ao_rayons");return e},{select:e=>({raw:e,normalized:zfe(e)})}),DE=({disabled:e,value:t,onChange:n})=>{const{map:r}=AE(),{data:i,isInitialLoading:s}=Tx();return Qe("div",{children:[I(fu,{text:"\u0410\u041E / \u0440\u0430\u0439\u043E\u043D"}),I(_5,{showSearch:!0,style:{width:"100%"},value:t,dropdownStyle:{maxHeight:400,overflow:"auto"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0410\u041E \u0438\u043B\u0438 \u0440\u0430\u0439\u043E\u043D",allowClear:!0,treeDefaultExpandAll:!1,onChange:f=>{if(!f)return;const p=i.normalized[f],v=zf.exports(p.polygon),y=Lfe(v.coordinates[0]),w=jC(y);n({id:f,geometry:y,type:p.type}),r.fitBounds([[w[0],w[1]],[w[2],w[3]]],{padding:20})},loading:s,treeNodeFilterProp:"title",onClear:()=>n(null),notFoundContent:I(cs,{image:cs.PRESENTED_IMAGE_SIMPLE,description:"\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"}),disabled:e,children:i==null?void 0:i.raw.map(f=>{var p;return I(RR,{value:f.id,title:f.name,children:(p=f.rayons)==null?void 0:p.map(v=>I(RR,{value:v.id,title:v.name},v.id))},f.id)})})]})},Ffe=Object.entries(_E).map(([e,t])=>({value:t,label:t})),$fe=({disabled:e})=>{const{filters:{categories:t},setCategories:n}=Cs();return Qe("div",{children:[I(fu,{text:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438"}),I(sl,{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:n,options:Ffe,allowClear:!0,value:t,disabled:e})]})},Ws=({value:e})=>I("span",{className:"text-grey text-xs bg-white-background-light",children:e}),MR=(e,t)=>{if(Array.isArray(t)){const[n,r]=t;return{...e,[n]:I(Ws,{value:n}),[r]:I(Ws,{value:r})}}else return{...e,[t]:I(Ws,{value:t})}},kx=({title:e,value:t,onChange:n,onAfterChange:r,min:i=0,max:s=100,range:c=!1,step:o=1,disabled:f=!1,onMouseEnter:p,onMouseLeave:v,showZeroMark:y=!1})=>{const w={[i]:I(Ws,{value:i}),[s]:I(Ws,{value:s})},[P,k]=C.exports.useState(t),[A,N]=C.exports.useState(MR(w,t));C.exports.useEffect(()=>{k(t),N(MR(w,t))},[t]);const R=z=>{if(Array.isArray(z)){const[B,V]=z;N({...w,[B]:I(Ws,{value:B}),[V]:I(Ws,{value:V})})}else N({...w,[z]:I(Ws,{value:z})});r==null||r(z)},M=z=>{k(z),n==null||n(z)},O=y?{...A,0:I(Ws,{value:0})}:A;return Qe("div",{onMouseEnter:p,onMouseLeave:v,children:[I(fu,{text:e}),I(YQ,{range:c,value:P,marks:O,onChange:M,onAfterChange:R,min:i,max:s,step:o,disabled:f})]})},Bfe=({disabled:e,fullRange:t,isLoading:n})=>{const{filters:{prediction:r},setPrediction:i}=Cs(),s=c=>i(c);return C.exports.useEffect(()=>{if(!t)return;const c=t.prediction[0],o=t.prediction[1];r[0]===xp.prediction[0]&&r[1]===xp.prediction[1]&&i([c,o])},[t]),n?I("div",{className:"flex justify-center items-center",children:I(Pf,{})}):I(kx,{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:r,onAfterChange:s,min:t.prediction[0],max:t.prediction[1],range:!0,disabled:e})},LE=({onClick:e,disabled:t})=>I(gr,{block:!0,className:"mt-2",onClick:e,disabled:t,children:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B"}),j6=(e,t,n)=>{if(!t||!n)return!1;const r={};return n.forEach(i=>{r[i]=e[i][0]!==t[i][0]||e[i][1]!==t[i][1]}),r},Vfe=()=>ao(["prediction-max-min"],async()=>{const{data:e}=await Co.get(`/api/placement_points/filters?status[]=${Gn.pending}`);return e},{select:e=>({prediction:[e.prediction_current[0],e.prediction_current[1]]})}),Ufe=()=>{var M;const e=lde(),{reset:t}=ml(),{filters:n,setRegion:r,clear:i}=Cs(),{data:s,isInitialLoading:c}=Vfe(),[o,f]=C.exports.useState(!1),p=O=>{f(O===0)},[v,y]=C.exports.useState(!1);C.exports.useEffect(()=>{const O=setTimeout(()=>y(!1),1500);return()=>clearTimeout(O)},[v]);const w=()=>{y(!0)},P=()=>{y(!1)},k=j6(n,s,["prediction"]),A=()=>i(s),N=n.region||k.prediction||n.categories.length!==0,R=Am();return Qe("div",{className:"flex flex-col flex-1 justify-between",children:[Qe("div",{children:[Qe(io,{title:Ace,placement:"right",open:e&&v,onMouseEnter:w,onMouseLeave:P,children:[Qe("div",{className:"space-y-5",children:[I(DE,{disabled:e,value:(M=n.region)==null?void 0:M.id,onChange:r}),I($fe,{disabled:e}),I(Bfe,{disabled:e,fullRange:s,isLoading:c})]}),N&&I(LE,{onClick:A,disabled:e})]}),e?I(gr,{block:!0,className:"mt-2",onClick:t,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]}),Qe("div",{children:[I(Mfe,{onSelectedChange:p}),R&&I(Ofe,{disabled:o})]})]})},AR={region:null},jfe=e=>({filters:AR,setRegion:t=>e(n=>{n.filters.region=t}),clear:()=>e(t=>{t.filters=AR})}),Fc=bs(Mm(ws(jfe),{name:"postnet/on-approval-filters"})),Kfe={[gn.initial]:!0,[gn.approve]:!1,[gn.working]:!1,[gn.filteredWorking]:!1,[gn.cancelled]:!1,[gn.pvz]:!0,[gn.other]:!0},Hfe=[gn.pvz,gn.other],Wfe=e=>({isVisible:Kfe,toggleVisibility:t=>e(n=>{n.isVisible[t]=!n.isVisible[t]}),showLayers:t=>e(n=>{t.forEach(r=>{n.isVisible[r]=!0})}),setLayersVisibility:t=>e(n=>{t.forEach(i=>{n.isVisible[i]=!0}),Object.keys(n.isVisible).filter(i=>!t.includes(i)&&!Hfe.includes(i)).forEach(i=>{n.isVisible[i]=!1})})}),Za=bs(Mm(ws(Wfe),{name:"postnet/layers-visibility"})),Gfe=()=>{const{filters:{region:e},setRegion:t,clear:n}=Fc(),{isVisible:r,toggleVisibility:i,showLayers:s}=Za(),c=e||!r[gn.approve]||!r[gn.working]||!r[gn.cancelled],o=()=>{n(),s([gn.approve,gn.working,gn.cancelled])};return Qe("div",{className:"space-y-4",children:[I(DE,{value:e==null?void 0:e.id,onChange:t}),Qe("div",{children:[I(fu,{text:"\u0421\u0442\u0430\u0442\u0443\u0441\u044B"}),Qe("div",{className:"flex flex-col space-y-2",children:[I(pc,{onChange:()=>i(gn.approve),checked:r[gn.approve],children:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430"}),I(pc,{className:"!ml-0",onChange:()=>i(gn.working),checked:r[gn.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"}),I(pc,{className:"!ml-0",onChange:()=>i(gn.cancelled),checked:r[gn.cancelled],children:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D"})]})]}),c&&I(LE,{onClick:o})]})},el={region:null,deltaTraffic:[-1e4,1e4],factTraffic:[-100,0],age:[-1,0]},qfe=e=>({filters:el,setDeltaTraffic:t=>{e(n=>{n.filters.deltaTraffic=t})},setFactTraffic:t=>{e(n=>{n.filters.factTraffic=t})},setAge:t=>{e(n=>{n.filters.age=t})},setRegion:t=>e(n=>{n.filters.region=t}),clear:t=>e(n=>{if(!t)return n.filters=el,n;const{deltaTraffic:r,factTraffic:i,age:s}=t;n.filters={...el,deltaTraffic:r,factTraffic:i,age:s}})}),_u=bs(Mm(ws(qfe),{name:"postnet/working-filters"})),Zfe=({fullRange:e})=>{const{filters:{deltaTraffic:t},setDeltaTraffic:n}=_u(),r=i=>n(i);return C.exports.useEffect(()=>{const i=e.deltaTraffic[0],s=e.deltaTraffic[1];t[0]===el.deltaTraffic[0]&&t[1]===el.deltaTraffic[1]&&n([i,s])},[e,t]),I(kx,{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:r,min:e.deltaTraffic[0],max:e.deltaTraffic[1],range:!0,showZeroMark:!0})},Xfe=({fullRange:e})=>{const{filters:{factTraffic:t},setFactTraffic:n}=_u(),r=i=>n(i);return C.exports.useEffect(()=>{const i=e.factTraffic[0],s=e.factTraffic[1];t[0]===el.factTraffic[0]&&t[1]===el.factTraffic[1]&&n([i,s])},[e,t]),I(kx,{title:"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:t,onAfterChange:r,min:e.factTraffic[0],max:e.factTraffic[1],range:!0})},Yfe=({fullRange:e})=>{const{filters:{age:t},setAge:n}=_u(),r=i=>n(i);return C.exports.useEffect(()=>{const i=e.age[0],s=e.age[1];t[0]===el.age[0]&&t[1]===el.age[1]&&n([i,s])},[e,t]),I(kx,{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:r,min:e.age[0],max:e.age[1],range:!0})},Qfe=()=>ao(["working-max-min"],async()=>{const{data:e}=await Co.get(`/api/placement_points/filters?status[]=${Gn.working}`);return e},{select:e=>({deltaTraffic:[e.delta_current[0],e.delta_current[1]],factTraffic:[e.fact[0],e.fact[1]],age:[e.age_day[0],e.age_day[1]]})}),Jfe=()=>{var f;const{filters:e,setRegion:t,clear:n}=_u(),{data:r,isInitialLoading:i}=Qfe(),s=j6(e,r,["deltaTraffic","factTraffic","age"]),c=e.region||s.deltaTraffic||s.factTraffic||s.age,o=()=>n(r);return Qe("div",{children:[I(DE,{value:(f=e.region)==null?void 0:f.id,onChange:t}),I("div",{className:"space-y-12 mt-4",children:i?I("div",{className:"flex justify-center items-center",children:I(Pf,{})}):Qe(An,{children:[I(Zfe,{fullRange:r}),I(Xfe,{fullRange:r}),I(Yfe,{fullRange:r})]})}),c&&I(LE,{onClick:o})]})},ehe=C.exports.forwardRef(({isCollapsed:e},t)=>{const{mode:n}=Ss(),r=()=>n===Ur.PENDING?I(Ufe,{}):n===Ur.ON_APPROVAL?I(Gfe,{}):I(Jfe,{});return I("div",{className:Pc("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:I("div",{className:"flex flex-col flex-1",children:r()})})}),the=5,nhe=3,K6={property:"prediction_current",stops:[[160,"#FDEBF0"],[161,"#F8C7D8"],[186,"#F398BC"],[201,"#EE67A1"],[211,"#B64490"],[226,"#7E237E"],[251,"#46016C"]]},KC="#CC2222",H6="#ff7d00",rhe="rgba(196,195,195,0.6)",W6="#3f5be8",G6="#26a2a2",NR={type:"circle",paint:{"circle-stroke-width":.4,"circle-stroke-color":"#fff","circle-opacity":.8}},hu=(e=K6,t=the)=>({...NR,paint:{...NR.paint,"circle-color":e,"circle-radius":["interpolate",["linear"],["zoom"],3,0,9,2,13,t]}}),Wh=hu(),ihe=hu(rhe,nhe),ohe=hu(H6),u0={type:"symbol",layout:{"icon-image":"logo","icon-size":["interpolate",["linear"],["zoom"],3,0,9,.1,13,.7]},paint:{"icon-color":"#E63941"}},OR="#ffffff",DR=16,q6={...hu(OR,DR),paint:{...hu(OR,DR).paint,"circle-stroke-width":.4,"circle-stroke-color":"#252525"}},ahe=hu(KC),she=hu(W6),lhe=hu(G6),Z6="#676767",LR={id:"ao",type:"line",source:"ao","source-layer":"public.service_ao",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":Z6,"line-width":1.5,"line-opacity":.8}},zR={id:"rayon",type:"line",source:"rayon","source-layer":"public.service_rayon",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":Z6,"line-width":.5,"line-opacity":.8}},uhe={id:"selected-region",type:"line",source:"selected-region",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#CC2222","line-width":4}},che={ao:"district_id",rayon:"area_id"},Om=e=>C.exports.useMemo(()=>e?["==",["get",che[e.type]],e.id]:null,[e]),FR=["==",["get","status"],Gn.pending],dhe=()=>{const{filters:e}=Cs(),{prediction:t,categories:n,region:r}=e,{selection:i}=ml(),s=[...i.included],c=[...i.excluded],o=Om(r),f=["in",["get","id"],["literal",s]],p=["in",["get","id"],["literal",c]],v=[[">=",["get","prediction_current"],t[0]],["<=",["get","prediction_current"],t[1]]],y=n.length>0?["in",["get","category"],["literal",n]]:!0,w=["all",FR,["!",p],["any",o?["all",...v,y,o]:["all",...v,y],f]],P=["all",FR,["!",f],["any",["!",o?["all",...v,y,o]:["all",...v,y]],p]];return{match:w,unmatch:P}},fhe=()=>{const{isVisible:e}=Za(),{match:t,unmatch:n}=dhe();return Qe(An,{children:[I($o,{...Wh,id:gn["initial-unmatch"],source:"points","source-layer":"public.service_placementpoint",layout:{...Wh.layout,visibility:e[gn.initial]?"visible":"none"},filter:n,paint:ihe.paint}),I($o,{...Wh,id:gn["initial-match"],source:"points","source-layer":"public.service_placementpoint",layout:{...Wh.layout,visibility:e[gn.initial]?"visible":"none"},filter:t,paint:Wh.paint})]})},$R=["==",["get","status"],Gn.onApproval],hhe=()=>{const{isVisible:e}=Za(),{filters:{region:t}}=Fc(),n=Om(t),r=n?["all",$R,n]:$R;return I(An,{children:I($o,{...ohe,id:gn.approve,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[gn.approve]?"visible":"none"},filter:r})})},cb=["==",["get","status"],Gn.working],phe=()=>{const{isVisible:e}=Za(),{filters:{region:t}}=Fc(),n=Om(t),{mode:r}=Ss(),i=()=>r===Ur.ON_APPROVAL&&n?["all",cb,n]:cb;return Qe(An,{children:[I($o,{...q6,id:gn.workingBackground,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[gn.working]?"visible":"none"},filter:i()}),I($o,{...u0,id:gn.working,source:"points","source-layer":"public.service_placementpoint",layout:{...u0.layout,visibility:e[gn.working]?"visible":"none"},filter:i()})]})},BR=["==",["get","status"],Gn.working],mhe=()=>{const{isVisible:e}=Za(),{filters:{deltaTraffic:t,factTraffic:n,age:r,region:i}}=_u(),s=Om(i),c=[[">=",["get","delta_current"],t[0]],["<=",["get","delta_current"],t[1]]],o=[[">=",["get","fact"],n[0]],["<=",["get","fact"],n[1]]],f=[[">=",["get","age_day"],r[0]],["<=",["get","age_day"],r[1]]],p=s?["all",BR,...c,...o,...f,s]:["all",BR,...c,...o,...f];return Qe(An,{children:[I($o,{...q6,id:gn.filteredWorkingBackground,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[gn.filteredWorking]?"visible":"none"},filter:p}),I($o,{...u0,id:gn.filteredWorking,source:"points","source-layer":"public.service_placementpoint",layout:{...u0.layout,visibility:e[gn.filteredWorking]?"visible":"none"},filter:p})]})},db=["==",["get","status"],Gn.cancelled],vhe=()=>{const{isVisible:e}=Za(),{filters:{region:t}}=Fc(),n=Om(t),{mode:r}=Ss(),i=()=>r===Ur.ON_APPROVAL&&n?["all",db,n]:db;return I(An,{children:I($o,{...ahe,id:gn.cancelled,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[gn.cancelled]?"visible":"none"},filter:i()})})},ghe=()=>{const{updateCounter:e}=$6();return I(An,{children:Qe(qd,{id:"points",type:"vector",tiles:[`${_p}/martin/public.service_placementpoint/{z}/{x}/{y}.pbf`],children:[I(fhe,{}),I(hhe,{}),I(phe,{}),I(mhe,{}),I(vhe,{})]},`points-${e}`)})},yhe=["==",["get","type"],"pvz"],xhe=()=>{const{isVisible:e}=Za();return I(An,{children:I($o,{...she,id:gn.pvz,source:"rivals","source-layer":"public.service_rivals",layout:{visibility:e[gn.pvz]?"visible":"none"},filter:yhe})})},_he=["==",["get","type"],"post"],bhe=()=>{const{isVisible:e}=Za();return I(An,{children:I($o,{...lhe,id:gn.other,source:"rivals","source-layer":"public.service_rivals",layout:{visibility:e[gn.other]?"visible":"none"},filter:_he})})},fb=({data:e})=>I(qd,{id:"selected-region",type:"geojson",data:e,children:I($o,{...uhe})}),whe=()=>{const{filters:{region:e}}=Cs(),{filters:{region:t}}=Fc(),{filters:{region:n}}=_u(),{mode:r}=Ss(),i=r===Ur.PENDING&&(e==null?void 0:e.geometry),s=r===Ur.ON_APPROVAL&&(t==null?void 0:t.geometry),c=r===Ur.WORKING&&(n==null?void 0:n.geometry);return Qe(An,{children:[i&&I(fb,{data:e.geometry}),s&&I(fb,{data:t.geometry}),c&&I(fb,{data:n.geometry})]})},Che=()=>Qe(An,{children:[I(qd,{id:"ao",type:"vector",tiles:[`${_p}/martin/public.service_ao/{z}/{x}/{y}.pbf`],children:I($o,{...LR,layout:{...LR.layout}})}),I(qd,{id:"rayon",type:"vector",tiles:[`${_p}/martin/public.service_rayon/{z}/{x}/{y}.pbf`],children:I($o,{...zR,layout:{...zR.layout}})}),I(whe,{}),Qe(qd,{id:"rivals",type:"vector",tiles:[`${_p}/martin/public.service_rivals/{z}/{x}/{y}.pbf`],children:[I(xhe,{}),I(bhe,{})]}),I(ghe,{})]}),She=({lat:e,lng:t,onClose:n,children:r})=>I(Gde,{longitude:t,latitude:e,onClose:n,closeOnClick:!1,style:{minWidth:"300px"},children:r}),Ehe=e=>({clickedPointConfig:null,setClickedPointConfig:(t,n=!1)=>{e(r=>{if(t===null)return r.clickedPointConfig=null,r;r.clickedPointConfig={id:t,shouldSelect:n}})}}),vl=bs(ws(Ehe)),pf=(e,t)=>{var n,r;return(r=(n=t==null?void 0:t[e])==null?void 0:n.name)!=null?r:e},X6=[{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"area_id",fallbackField:"area",render:pf,type:"region"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"district_id",fallbackField:"district",render:pf,type:"region"},{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=>uc[e]},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"}],Phe=[...X6,{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"}],The=[{name:"\u041F\u043B\u0430\u043D",field:"plan_current"},{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"},{name:"id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",field:"postamat_id",empty:"\u041D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D"}],khe={pvz:"\u041F\u0412\u0417",post:"\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442"},Ihe=[{name:"\u0418\u043D\u0444\u043E",field:"info"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"type",render:e=>khe[e]}];function Rhe(e,t){const n=window.document.createElement("a");n.href=window.URL.createObjectURL(new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}const HC=e=>e==null||e==="",nm=({feature:e,dynamicStatus:t,postamatId:n})=>{var p,v;const{data:r}=Tx(),i=e.properties.category===_E.residential,s=e.properties.status===Gn.working,c=((p=e.layer)==null?void 0:p.id)===gn.pvz||((v=e.layer)==null?void 0:v.id)===gn.other,o=()=>{if(c)return Ihe;const y=i?Phe:X6;return s?[...y,...The]:y},f=({field:y,render:w,empty:P,type:k,fallbackField:A})=>{let N=e.properties[y];return y==="status"&&t&&(N=t),y==="postamat_id"&&n&&(N=n),k==="region"?(N=N||e.properties[A],N=w(N,r==null?void 0:r.normalized)):(N=w?w(N):N,N=HC(N)&&P?P:N),N};return I("div",{children:o().map(y=>Qe(AL,{className:Pc("p-1"),children:[I(Gy,{className:"font-semibold",span:12,children:y.name}),I(Gy,{span:12,children:f(y)})]},y.field))})},Mhe=({feature:e})=>{const{include:t,selection:n,exclude:r}=ml(),{setClickedPointConfig:i}=vl(),{filters:s}=Cs(),c=()=>{const{prediction:y,categories:w,region:P}=s,{prediction_current:k,category:A,area:N,district:R,area_id:M,district_id:O}=e.properties,z=k>=y[0]&&k<=y[1],B=w.length>0?w.includes(A):!0;return z&&B&&(()=>P?P.type==="ao"?(R!=null?R:O)===P.id:(N!=null?N:M)===P.id:!0)()},o=e.properties.id,f=c()&&!n.excluded.has(o)||n.included.has(o);C.exports.useEffect(()=>i(o,f),[o,f]);const p=()=>{f?r(o):t(o)},v=Am();return Qe(An,{children:[I(nm,{feature:e}),v&&I(gr,{type:"primary",className:"mt-2 mx-auto",block:!0,onClick:p,children:f?"\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"})]})},Ahe=[{label:uc[Gn.pending],value:Gn.pending},{label:uc[Gn.onApproval],value:Gn.onApproval},{label:uc[Gn.working],value:Gn.working},{label:uc[Gn.cancelled],value:Gn.cancelled}],Y6=({value:e,onChange:t,disabled:n})=>I(sl,{style:{width:250},value:e,onChange:s=>{t(s)},options:Ahe,disabled:n,placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441",onClick:s=>s.stopPropagation()}),Nhe=({feature:e})=>{const t=e.properties.id,{setClickedPointConfig:n}=vl(),{status:r,postamat_id:i}=e.properties,[s,c]=C.exports.useState(r),[o,f]=C.exports.useState(i);C.exports.useEffect(()=>{c(r),f(i)},[r,i]);const[p,v]=C.exports.useState(s===Gn.working&&HC(o)),[y,w]=C.exports.useState("");C.exports.useEffect(()=>n(t),[t]);const P=Oc(),k=()=>{P.invalidateQueries(["on-approval-points"]),P.invalidateQueries(["clicked-point",t])},{mutateAsync:A,isLoading:N}=Px({}),{mutateAsync:R,isLoading:M}=T6(),O=N||M,z=async()=>{const G=new URLSearchParams({id:t,postamat_id:o}),j=new URLSearchParams({status:Gn.working,"location_ids[]":[t]});try{await R(G)}catch{w("\u0423\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0439 id \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0434\u0440\u0443\u0433\u043E\u0439");return}await A(j),k(),v(!1)},B=G=>{if(c(G),G===Gn.working)v(!0);else{v(!1);const j=new URLSearchParams({status:G,"location_ids[]":[t]});A(j).then(k)}},V=Am();return Qe(An,{children:[I(nm,{feature:e,dynamicStatus:s,postamatId:o}),V&&I("div",{className:"flex justify-center mt-4",children:Qe("div",{className:"flex flex-col items-center space-y-2",children:[I(fu,{text:"\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"}),I(Y6,{value:s,onChange:B}),p&&Qe(An,{children:[I(fu,{text:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430"}),I(JL,{className:"w-full",min:0,precision:0,value:o,onChange:G=>f(G)}),y&&I("div",{className:"text-primary text-center",children:y}),I(gr,{type:"primary",disabled:HC(o),onClick:z,loading:O,children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"})]})]})})]})},Ohe=({feature:e})=>{const t=e.properties.id,{setClickedPointConfig:n}=vl();return C.exports.useEffect(()=>n(t),[e]),I(nm,{feature:e})},Dhe=e=>({popup:null,setPopup:t=>{e(n=>{if(!t)return n.popup=null,n;n.popup=t})}}),$c=bs(ws(Dhe)),Lhe=({feature:e})=>{var s,c;const{mode:t}=Ss(),n=((s=e.layer)==null?void 0:s.id)===gn.pvz||((c=e.layer)==null?void 0:c.id)===gn.other,r=e.properties.status===Gn.pending,i=e.properties.status===Gn.working;return n?I(nm,{feature:e}):t===Ur.ON_APPROVAL&&!r?I(Nhe,{feature:e}):t===Ur.WORKING&&i?I(Ohe,{feature:e}):t===Ur.PENDING&&r?I(Mhe,{feature:e}):I(nm,{feature:e})},zhe=({features:e})=>{const{setPopup:t}=$c();return I("div",{className:"space-y-2 p-1",children:e.map(n=>{var r;return I(gr,{className:"text-start w-full",block:!0,onClick:()=>{t({features:[n],coordinates:n.geometry.coordinates})},children:n.properties.category===_E.residential?Qe("div",{className:"space-x-2 flex items-center w-full",children:[I("span",{className:"flex-1 truncate inline-block",children:n.properties.address}),I("span",{children:n.properties.name})]}):I("div",{className:"flex w-full",children:I("span",{className:"truncate",children:(r=n.properties.name)!=null?r:n.properties.category})})},n.properties.id)})})},Fhe=({features:e,lat:t,lng:n,onClose:r})=>I(She,{lat:t,lng:n,onClose:r,children:(()=>e.length===1?I(Lhe,{feature:e[0]}):I(zhe,{features:e}))()}),$he="https://api.mapbox.com/styles/v1/ghermant/cla2nwk5f00el14nxvtjlsi6z/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiZ2hlcm1hbnQiLCJhIjoiY2xhMm5zZ3ZrMDF4MDN2bzc5Yjd0ZjZ1dCJ9.fqnvrEqKKBoguR7R6DR7Yw",Bhe=()=>I(qd,{type:"raster",id:"basemap",tiles:[$he],tileSize:256,children:I($o,{type:"raster",source:"basemap",id:"basemap-layer",paint:{}})});function Vhe(){const e=async()=>{await Co.post("accounts/logout/"),RE(!1)},{data:t}=ao(["profile"],async()=>{const{data:n}=await Co.get("/accounts/profile");return n});return I("div",{className:"absolute top-[20px] right-[20px]",children:I(Y0,{content:Qe(An,{children:[I(fu,{text:t==null?void 0:t.email,classNameText:"lowercase"}),Qe(gr,{type:"primary",block:!0,onClick:e,children:[I("span",{className:"mr-1",children:"\u0412\u044B\u0439\u0442\u0438"}),I(O5,{})]})]}),trigger:"click",placement:"bottomRight",children:I(io,{title:"\u0412\u044B\u0439\u0442\u0438",placement:"left",children:I(gr,{icon:I(zle,{}),type:"primary",size:"large"})})})})}var Uhe="Expected a function",VR=0/0,jhe="[object Symbol]",Khe=/^\s+|\s+$/g,Hhe=/^[-+]0x[0-9a-f]+$/i,Whe=/^0b[01]+$/i,Ghe=/^0o[0-7]+$/i,qhe=parseInt,Zhe=typeof Gs=="object"&&Gs&&Gs.Object===Object&&Gs,Xhe=typeof self=="object"&&self&&self.Object===Object&&self,Yhe=Zhe||Xhe||Function("return this")(),Qhe=Object.prototype,Jhe=Qhe.toString,epe=Math.max,tpe=Math.min,hb=function(){return Yhe.Date.now()};function npe(e,t,n){var r,i,s,c,o,f,p=0,v=!1,y=!1,w=!0;if(typeof e!="function")throw new TypeError(Uhe);t=UR(t)||0,WC(n)&&(v=!!n.leading,y="maxWait"in n,s=y?epe(UR(n.maxWait)||0,t):s,w="trailing"in n?!!n.trailing:w);function P(V){var G=r,j=i;return r=i=void 0,p=V,c=e.apply(j,G),c}function k(V){return p=V,o=setTimeout(R,t),v?P(V):c}function A(V){var G=V-f,j=V-p,X=t-G;return y?tpe(X,s-j):X}function N(V){var G=V-f,j=V-p;return f===void 0||G>=t||G<0||y&&j>=s}function R(){var V=hb();if(N(V))return M(V);o=setTimeout(R,A(V))}function M(V){return o=void 0,w&&r?P(V):(r=i=void 0,c)}function O(){o!==void 0&&clearTimeout(o),p=0,r=f=i=o=void 0}function z(){return o===void 0?c:M(hb())}function B(){var V=hb(),G=N(V);if(r=arguments,i=this,f=V,G){if(o===void 0)return k(f);if(y)return o=setTimeout(R,t),P(f)}return o===void 0&&(o=setTimeout(R,t)),c}return B.cancel=O,B.flush=z,B}function WC(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function rpe(e){return!!e&&typeof e=="object"}function ipe(e){return typeof e=="symbol"||rpe(e)&&Jhe.call(e)==jhe}function UR(e){if(typeof e=="number")return e;if(ipe(e))return VR;if(WC(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=WC(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Khe,"");var n=Whe.test(e);return n||Ghe.test(e)?qhe(e.slice(2),n?2:8):Hhe.test(e)?VR:+e}var ope=npe;const Q6=({width:e=40,height:t=40,fill:n})=>I("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:Qe("g",{children:[I("polygon",{style:{fill:n!=null?n:"#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 "}),I("polygon",{style:{fill:n!=null?n:"#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 "})]})}),zl=({color:e,name:t})=>Qe("div",{className:"flex gap-2 items-center",children:[e?I("span",{className:"rounded-xl w-3 h-3 inline-block",style:{backgroundColor:e}}):I(Q6,{width:12,height:12,fill:"#E63941"}),I("span",{children:t})]}),ape=K6.stops.map(([e,t])=>t),spe=({colors:e,name:t})=>Qe("div",{className:"mb-3",children:[I("span",{className:"mb-1 mt-3 text-center",children:t}),I("div",{className:"w-[200px]",children:I("div",{className:"w-full h-[10px] rounded-xl",style:{background:`linear-gradient(to right, ${e.join(",")})`}})}),I("span",{className:"italic",children:"\u043F\u0440\u043E\u0433\u043D\u043E\u0437 \u0442\u0440\u0430\u0444\u0438\u043A\u0430 \u2192"})]});function lpe(){const{mode:e}=Ss();return Qe("div",{className:"absolute bottom-[20px] left-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3 space-y-3",children:[I("div",{children:Qe("div",{className:"space-y-1",children:[e===Ur.PENDING&&Qe(An,{children:[I(spe,{colors:ape,name:"\u041B\u043E\u043A\u0430\u0446\u0438\u0438 \u043A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E"}),I(zl,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"}),I(zl,{name:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438",color:KC})]}),e===Ur.ON_APPROVAL&&Qe(An,{children:[I(zl,{name:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",color:H6}),I(zl,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"}),I(zl,{name:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438",color:KC})]}),e===Ur.WORKING&&I(An,{children:I(zl,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"})})]})}),Qe("div",{className:"space-y-1",children:[I(zl,{name:"\u041F\u0412\u0417",color:W6}),I(zl,{name:"\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B \u043F\u0440\u043E\u0447\u0438\u0445 \u0441\u0435\u0442\u0435\u0439",color:G6})]})]})}let jR=e=>typeof e=="object"&&e!=null&&e.nodeType===1,KR=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",pb=(e,t)=>{if(e.clientHeight{let i=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightst||s>e&&c=t&&o>=n?s-e-r:c>t&&on?c-t+i:0,upe=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},HR=(e,t)=>{var n,r,i,s;if(typeof document>"u")return[];let{scrollMode:c,block:o,inline:f,boundary:p,skipOverflowHiddenElements:v}=t,y=typeof p=="function"?p:ee=>ee!==p;if(!jR(e))throw new TypeError("Invalid target");let w=document.scrollingElement||document.documentElement,P=[],k=e;for(;jR(k)&&y(k);){if(k=upe(k),k===w){P.push(k);break}k!=null&&k===document.body&&pb(k)&&!pb(document.documentElement)||k!=null&&pb(k,v)&&P.push(k)}let A=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,N=(s=(i=window.visualViewport)==null?void 0:i.height)!=null?s:innerHeight,{scrollX:R,scrollY:M}=window,{height:O,width:z,top:B,right:V,bottom:G,left:j}=e.getBoundingClientRect(),X=o==="start"||o==="nearest"?B:o==="end"?G:B+O/2,Y=f==="center"?j+z/2:f==="end"?V:j,se=[];for(let ee=0;ee=0&&j>=0&&G<=N&&V<=A&&B>=ie&&G<=oe&&j>=ye&&V<=ce)return se;let Ie=getComputedStyle(Z),Te=parseInt(Ie.borderLeftWidth,10),Pe=parseInt(Ie.borderTopWidth,10),De=parseInt(Ie.borderRightWidth,10),Re=parseInt(Ie.borderBottomWidth,10),ke=0,Oe=0,$e="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-Te-De:0,He="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-Pe-Re:0,Ue="offsetWidth"in Z?Z.offsetWidth===0?0:ve/Z.offsetWidth:0,st="offsetHeight"in Z?Z.offsetHeight===0?0:J/Z.offsetHeight:0;if(w===Z)ke=o==="start"?X:o==="end"?X-N:o==="nearest"?Pg(M,M+N,N,Pe,Re,M+X,M+X+O,O):X-N/2,Oe=f==="start"?Y:f==="center"?Y-A/2:f==="end"?Y-A:Pg(R,R+A,A,Te,De,R+Y,R+Y+z,z),ke=Math.max(0,ke+M),Oe=Math.max(0,Oe+R);else{ke=o==="start"?X-ie-Pe:o==="end"?X-oe+Re+He:o==="nearest"?Pg(ie,oe,J,Pe,Re+He,X,X+O,O):X-(ie+J/2)+He/2,Oe=f==="start"?Y-ye-Te:f==="center"?Y-(ye+ve/2)+$e/2:f==="end"?Y-ce+De+$e:Pg(ye,ce,ve,Te,De+$e,Y,Y+z,z);let{scrollLeft:ft,scrollTop:It}=Z;ke=Math.max(0,Math.min(It+ke/st,Z.scrollHeight-J/st+He)),Oe=Math.max(0,Math.min(ft+Oe/Ue,Z.scrollWidth-ve/Ue+$e)),X+=It-ke,Y+=ft-Oe}se.push({el:Z,top:ke,left:Oe})}return se},cpe=e=>typeof e=="object"&&typeof e.behavior=="function",dpe=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function fpe(e,t){if(!e.isConnected||!e.ownerDocument.documentElement.contains(e))return;if(cpe(t))return t.behavior(HR(e,t));let n=typeof t=="boolean"||t==null?void 0:t.behavior;for(let{el:r,top:i,left:s}of HR(e,dpe(t)))r.scroll({top:i,left:s,behavior:n})}const zE=e=>{Rhe("postamates.xlsx",e)},hpe=({provider:e})=>{const[t,n]=C.exports.useState(!1);return e(t,()=>n(!1)),I(io,{title:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",children:I(gr,{onClick:i=>{i.stopPropagation(),n(!0)},loading:t,disabled:t,children:I(Ele,{})})})},ppe={isOpened:!1,fullScreen:!1},mpe=e=>({tableState:ppe,toggleOpened:t=>{e(n=>{n.tableState.isOpened=t[0]==="opened"})},toggleFullScreen:()=>{e(t=>{t.tableState.fullScreen=!t.tableState.fullScreen})},openTable:()=>{e(t=>{t.tableState.isOpened=!0})}}),Dm=bs(ws(mpe)),vpe=()=>{const{tableState:{fullScreen:e},toggleFullScreen:t}=Dm(),[n,r]=C.exports.useState(!1);return C.exports.useEffect(()=>{const o=setTimeout(()=>r(!1),1500);return()=>clearTimeout(o)},[n]),I(io,{title:e?"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C":"\u0420\u0430\u0441\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043F\u043E\u043B\u043D\u044B\u0439 \u044D\u043A\u0440\u0430\u043D",placement:"topRight",open:n,children:I(gr,{onClick:o=>{o.stopPropagation(),t()},onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},children:e?I(kle,{}):I(Mle,{})})})},Ix=({leftColumn:e,rightColumn:t,exportProvider:n,classes:r})=>Qe("div",{className:"flex items-center w-full justify-between",children:[Qe("div",{className:r==null?void 0:r.leftColumn,children:[I("span",{className:"py-[5px]",children:"\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432"}),e]}),Qe("div",{className:r==null?void 0:r.rightColumn,children:[t,Qe("div",{className:"flex items-center gap-x-1",children:[n&&I(hpe,{provider:n}),I(vpe,{})]})]})]}),FE=tr.memo(({rowSelection:e,data:t,pageSize:n,isClickedPointLoading:r,page:i,onPageChange:s,columns:c,header:o,fullWidth:f,loading:p})=>{const{clickedPointConfig:v,setClickedPointConfig:y}=vl(),{map:w}=AE(),{tableState:P,toggleOpened:k}=Dm(),{setPopup:A}=$c(),N={y:P.fullScreen?"calc(100vh - 136px)":"200px",x:"max-content"};return C.exports.useEffect(()=>{if(v===null||r)return;const R=document.querySelector(".scroll-row");R&&fpe(R,{behavior:"smooth"})},[v,t]),I(dI,{bordered:!1,onChange:k,activeKey:P.isOpened?"opened":null,children:I(dI.Panel,{header:o||I(Ix,{}),collapsible:P.fullScreen?"disabled":void 0,children:I(p5,{size:"small",className:"table__wrapper",locale:{emptyText:I(cs,{description:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"})},pagination:{pageSize:n,current:i,onChange:s,total:t==null?void 0:t.count,showSizeChanger:!1,position:"bottomCenter"},dataSource:t==null?void 0:t.results,columns:c,rowKey:"id",scroll:N,sticky:!0,onRow:R=>({onClick:()=>{const M=zf.exports(R.geometry);w.flyTo({center:[M.coordinates[0],M.coordinates[1]],zoom:13,essential:!0}),A({features:[{properties:R}],coordinates:M.coordinates}),y(R.id,e==null?void 0:e.selectedRowKeys.includes(R.id))}}),rowSelection:e,rowClassName:R=>Pc("cursor-pointer",R.id===(v==null?void 0:v.id)&&"scroll-row"),"data-fullwidth":f,loading:p})},"opened")})}),mf=30,gpe=(e,t)=>{const{clickedPointConfig:n}=vl(),{data:r,isInitialLoading:i,isFetching:s}=ao(["clicked-point",n==null?void 0:n.id],async()=>{const c=new URLSearchParams({"location_ids[]":[n.id]}),{data:o}=await Co.get(`/api/placement_points?${c.toString()}`);return o},{enabled:e,onSuccess:t});return{data:r,isLoading:i||s}},$E=(e,t)=>{const[n,r]=C.exports.useState(),[i,s]=C.exports.useState(!1),c=C.exports.useRef(),{data:o,isLoading:f}=gpe(i,()=>s(!1)),{clickedPointConfig:p}=vl(),v=Oc();return C.exports.useEffect(()=>{!e||r(e)},[e]),C.exports.useEffect(()=>{!e||p===null||e.results.find(w=>w.id===p.id)||s(!0)},[e,p]),C.exports.useEffect(()=>{var y;!((y=o==null?void 0:o.results)!=null&&y[0])||(c.current=o.results[0].id,t(mf+1),r({count:e.count+1,results:[o.results[0],...e.results]}))},[o,e]),C.exports.useEffect(()=>{if(p===null){const y=["clicked-point",c.current];v.removeQueries({queryKey:y}),t(mf),r(e)}},[p,e]),{data:n,isClickedPointLoading:f}},ype=(e,t,n,r)=>{const{filters:i}=Cs(),{prediction:s,categories:c,region:o}=i,{data:f,isInitialLoading:p}=ao(["table",e,i],async()=>{const w=new URLSearchParams({page:e,page_size:n,"prediction_current[]":s,"status[]":[Gn.pending],"categories[]":c});return await Lf(w,o)},{keepPreviousData:!0,onError:w=>{w.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:v,isClickedPointLoading:y}=$E(f,r);return{data:v,pageSize:n,isClickedPointLoading:y,isDataLoading:p}},xpe=(e,t)=>{const{filters:n}=Cs(),{prediction:r,categories:i,region:s}=n,{selection:c}=ml(),o=[...c.included],f=[...c.excluded];return ao(["export-initial",n,c],async()=>{const p=new URLSearchParams({"prediction_current[]":r,"status[]":[Gn.pending]});return i.length&&p.append("categories[]",i),o.length&&p.append("included[]",o),f.length&&p.append("excluded[]",f),await kE(p,s)},{enabled:e,onSuccess:zE,onSettled:t,retry:!1})};function _pe(e,t){const[n,r]=C.exports.useState(e);return C.exports.useEffect(()=>{const i=setTimeout(()=>r(e),t||500);return()=>{clearTimeout(i)}},[e,t]),n}const bpe=e=>I("div",{children:e}),BE=({autoFocus:e=!1})=>{const{map:t}=AE(),[n,r]=C.exports.useState(""),i=_pe(n),{setPopup:s}=$c(),{setClickedPointConfig:c}=vl(),o=C.exports.useRef(),{data:f}=ao(["address",i],async()=>(await Co.get(`/api/placement_points/search_address?page_size=100&address=${i}`)).data,{enabled:!!i}),p=C.exports.useMemo(()=>f?f.results.map(w=>({label:bpe(w.address),value:`${w.address}$${w.id}`,item:w})):[],[f]),v=w=>{r(w&&w.split("$")[0])},y=(w,P)=>{const k=zf.exports(P.item.geometry);t.flyTo({center:[k.coordinates[0],k.coordinates[1]],zoom:13,essential:!0});const A={properties:P.item};s({features:[A],coordinates:k.coordinates}),c(A.properties.id)};return C.exports.useEffect(()=>{e&&(o==null?void 0:o.current)&&o.current.focus()},[e]),I("div",{children:I(FW,{options:p,style:{width:300},value:n,onChange:v,onSelect:y,allowClear:!0,onClear:()=>r(""),autoFocus:e,popupClassName:"overflow-visible",children:I(Xy,{prefix:I(uE,{}),placeholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438",className:"text-ellipsis",ref:o})})})},J6=(e=[])=>{const{data:t}=Tx(),{tableState:{fullScreen:n}}=Dm();return C.exports.useMemo(()=>[{title:n?Qe("div",{className:"flex items-center justify-between",children:[I("span",{children:"\u0410\u0434\u0440\u0435\u0441"}),I(Y0,{content:I(BE,{autoFocus:!0}),trigger:"click",placement:"right",children:I(gr,{children:I(uE,{})})})]}):"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"area",key:"area",width:"120px",ellipsis:!0,render:(r,i)=>pf(i.area,t==null?void 0:t.normalized)},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"district",key:"district",width:"120px",ellipsis:!0,render:(r,i)=>pf(i.district,t==null?void 0:t.normalized)},{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:(r,i)=>uc[i.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},...e],[t==null?void 0:t.normalized,e,n])},wpe=({fullWidth:e})=>{const{selection:t,include:n,exclude:r}=ml(),{clickedPointConfig:i,setClickedPointConfig:s}=vl(),[c,o]=C.exports.useState(1),[f,p]=C.exports.useState(mf),v=J6(),{setPopup:y}=$c(),{data:w,isClickedPointLoading:P,isDataLoading:k}=ype(c,()=>o(1),f,p),A=()=>p(mf),R={selectedRowKeys:C.exports.useCallback(()=>{var X;const z=(X=w==null?void 0:w.results.map(Y=>Y.id))!=null?X:[],B=w==null?void 0:w.results.find(Y=>Y.id===(i==null?void 0:i.id)),V=Y=>t.excluded.has(Y),G=Y=>Y===(B==null?void 0:B.id)&&(i==null?void 0:i.shouldSelect)===!1;return[...z.filter(Y=>!V(Y)&&!G(Y)),...t.included]},[w,i,t])(),onSelect:(z,B)=>{const{id:V}=z;B?n(V):r(V)},hideSelectAll:!0},M=C.exports.useCallback(z=>{A(),s(null),y(null),o(z)},[]),O=Am();return I(FE,{rowSelection:O?R:void 0,data:w,onPageChange:M,page:c,pageSize:f,isClickedPointLoading:P,columns:v,fullWidth:e,header:I(Ix,{exportProvider:xpe}),loading:k})},Cpe=(e,t)=>{const{filters:{region:n}}=Fc();return ao(["export-on-approval",n],async()=>{const r=new URLSearchParams({"status[]":[Gn.onApproval,Gn.working]});return await kE(r,n)},{enabled:e,onSuccess:zE,onSettled:t})},Spe=({selectedIds:e,selectedStatus:t,onOpenMakeWorkingModal:n,onSuccess:r})=>{const i=Oc(),{setPopup:s}=$c(),{mutate:c}=Px({onSuccess:()=>{i.invalidateQueries(["on-approval-points"]),s(null),r()}});return I(An,{children:I(gr,{type:"primary",onClick:f=>{f.stopPropagation();const p=new URLSearchParams({status:t,"location_ids[]":e});t===Gn.working?n():c(p)},children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"})})},Epe=({selectedIds:e,onClearSelected:t,onOpenMakeWorkingModal:n})=>{const[r,i]=C.exports.useState(Gn.pending),s=c=>{c.stopPropagation(),t()};return I(Ix,{leftColumn:e.length>0&&Qe(An,{children:[I(Y6,{value:r,onChange:i}),I(Spe,{selectedIds:e,selectedStatus:r,onOpenMakeWorkingModal:n,onSuccess:t})]}),rightColumn:e.length>0&&I(gr,{onClick:s,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:Cpe})},Ppe=[{title:"Id",dataIndex:"id",key:"id",width:50},{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{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)=>uc[t.status]},{title:"Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",dataIndex:"postamat_id",key:"postamat_id",width:"120px",editable:!0}];const eF=tr.createContext(null),Tpe=({index:e,...t})=>{const[n]=sc.useForm();return I(sc,{form:n,component:!1,children:I(eF.Provider,{value:n,children:I("tr",{...t})})})},kpe=({title:e,editable:t,children:n,dataIndex:r,record:i,handleSave:s,setHasError:c,...o})=>{const[f,p]=C.exports.useState(!1),v=C.exports.useRef(null),y=C.exports.useContext(eF);C.exports.useEffect(()=>{f&&v.current.focus()},[f]);const w=()=>{p(!f),y.setFieldsValue({[r]:i[r]})},P=async()=>{try{const A=await y.validateFields();c(!1),w(),s({...i,...A})}catch(A){console.log("Save failed:",A),c(!0)}};let k=n;return t&&(k=f?I(sc.Item,{style:{margin:0},name:r,rules:[{required:!0,message:`\u0423\u043A\u0430\u0436\u0438\u0442\u0435 ${e}`}],children:I(JL,{ref:v,onPressEnter:P,onBlur:P,className:"w-full",min:0,precision:0})}):I("div",{className:"editable-cell-value-wrap",style:{paddingRight:24},onClick:w,children:n})),I("td",{...o,children:k})},Ipe=({data:e,onChange:t,setHasError:n})=>{const r=o=>{const f=[...e],p=f.findIndex(y=>o.id===y.id),v=f[p];f.splice(p,1,{...v,...o}),t(f)},i={body:{row:Tpe,cell:kpe}},s=Ppe.map(o=>o.editable?{...o,onCell:f=>({record:f,editable:o.editable,dataIndex:o.dataIndex,title:o.title,handleSave:r,setHasError:n})}:o);return I(p5,{components:i,size:"small",pagination:!1,dataSource:e,columns:s,rowKey:"id",sticky:!0,rowClassName:()=>"editable-row",className:"!max-w-full",scroll:{y:"max-content",x:"max-content"}})},Rpe=({selectedIds:e,onClose:t,onSuccess:n})=>{const{data:r}=ao(["make-working-table",e],async()=>{const A=new URLSearchParams({page:1,page_size:100,"location_ids[]":e});return await Lf(A)}),[i,s]=C.exports.useState(!1),[c,o]=C.exports.useState([]),[f,p]=C.exports.useState(null);C.exports.useEffect(()=>{o(r==null?void 0:r.results)},[r]);const v=Oc(),{setPopup:y}=$c(),{mutateAsync:w}=T6(),{mutateAsync:P}=Px({});return I(vz,{open:!0,title:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432",onCancel:t,width:800,footer:[f&&I("span",{className:"mr-2 text-primary",children:f},"error"),I(gr,{type:"primary",onClick:()=>{const A=c.map(M=>{const O=new URLSearchParams({id:M.id,postamat_id:M.postamat_id});return w(O)}),N=new URLSearchParams({status:Gn.working,"location_ids[]":e}),R=P(N);Promise.all([...A,R]).then(()=>{v.invalidateQueries(["on-approval-points"]),p(null),y(null),n(),t()}).catch(()=>p("\u0412\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0435 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0442, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0434\u0440\u0443\u0433\u0438\u0435"))},disabled:i,children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"},"ok-button")],children:c&&I(Ipe,{data:c,onChange:o,setHasError:s})})},Mpe=[{title:"Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",dataIndex:"postamat_id",key:"postamat_id",width:"70px",ellipsis:!0}],Ape=({fullWidth:e})=>{const[t,n]=C.exports.useState(mf),[r,i]=C.exports.useState(1),[s,c]=C.exports.useState([]),{filters:{region:o}}=Fc(),[f,p]=C.exports.useState(!1),v=J6(Mpe),{isVisible:y}=Za(),w=()=>c([]),{data:P,isInitialLoading:k}=ao(["on-approval-points",r,o,y],async()=>{const z=[];y[gn.approve]&&z.push(Gn.onApproval),y[gn.working]&&z.push(Gn.working),y[gn.cancelled]&&z.push(Gn.cancelled);const B=new URLSearchParams({page:r,page_size:t,"status[]":z.length>0?z:[Gn.onApproval,Gn.working,Gn.cancelled]});return z.length===0?{count:0,results:[]}:await Lf(B,o)},{keepPreviousData:!0}),{data:A,isClickedPointLoading:N}=$E(P,n),R=C.exports.useCallback(z=>i(z),[]),M={selectedRowKeys:s,onChange:z=>c(z),hideSelectAll:!0},O=Am();return Qe(An,{children:[I(FE,{header:I(Epe,{selectedIds:s,onClearSelected:w,onOpenMakeWorkingModal:()=>p(!0)}),rowSelection:O?M:void 0,data:A,onPageChange:R,page:r,pageSize:t,isClickedPointLoading:N,columns:v,fullWidth:e,loading:k}),f&&I(Rpe,{selectedIds:s,onClose:()=>p(!1),onSuccess:w})]})},Npe=(e,t)=>{const{filters:{region:n,deltaTraffic:r,factTraffic:i,age:s}}=_u();return ao(["export-working",n,r,i,s],async()=>{const c=new URLSearchParams({"status[]":[Gn.working],"delta_current[]":r,"fact[]":i,"age_day[]":s});return await kE(c,n)},{enabled:e,onSuccess:zE,onSettled:t})},Ope=()=>{const{data:e}=Tx(),{tableState:{fullScreen:t}}=Dm();return C.exports.useMemo(()=>[{title:t?Qe("div",{className:"flex items-center justify-between",children:[I("span",{children:"\u0410\u0434\u0440\u0435\u0441"}),I(Y0,{content:I(BE,{autoFocus:!0}),trigger:"click",placement:"right",children:I(gr,{children:I(uE,{})})})]}):"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"area",key:"area",width:"120px",ellipsis:!0,render:(n,r)=>pf(r.area,e==null?void 0:e.normalized)},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"district",key:"district",width:"120px",ellipsis:!0,render:(n,r)=>pf(r.district,e==null?void 0:e.normalized)},{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:"\u041F\u043B\u0430\u043D",dataIndex:"plan_current",key:"plan_current",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},{title:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B",dataIndex:"start_date",key:"start_date",width:"120px",render:n=>n?new Date(n).toLocaleDateString("ru"):"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"},{title:"Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",dataIndex:"postamat_id",key:"postamat_id",width:"70px",ellipsis:!0}],[e==null?void 0:e.normalized,t])},Dpe=({fullWidth:e})=>{const[t,n]=C.exports.useState(mf),[r,i]=C.exports.useState(1),{filters:{region:s,deltaTraffic:c,factTraffic:o,age:f}}=_u(),p=Ope(),{data:v,isInitialLoading:y}=ao(["working-points",r,s,c,o,f],async()=>{const A=new URLSearchParams({page:r,page_size:t,"status[]":[Gn.working],"delta_current[]":c,"fact[]":o,"age_day[]":f});return await Lf(A,s)},{keepPreviousData:!0}),{data:w,isClickedPointLoading:P}=$E(v,n),k=C.exports.useCallback(A=>i(A),[]);return I(FE,{data:w,onPageChange:k,page:r,pageSize:t,isClickedPointLoading:P,columns:p,fullWidth:e,header:I(Ix,{exportProvider:Npe}),loading:y})},Lpe=({fullWidth:e})=>{const{mode:t}=Ss();return t===Ur.ON_APPROVAL?I(Ape,{fullWidth:e}):t===Ur.WORKING?I(Dpe,{fullWidth:e}):I(wpe,{fullWidth:e})},zpe=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:t,children:[I("polygon",{points:"23.7,4.1 23.7,6.1 0.1,6.2 0.1,4.1 "}),Qe("g",{children:[I("circle",{cx:"6.3",cy:"5.2",r:"3.1"}),I("circle",{fill:"#fff",cx:"6.3",cy:"5.2",r:"1.4"})]}),I("polygon",{points:"23.6,11.1 23.7,13.1 0,13.1 0,11 "}),Qe("g",{children:[I("circle",{cx:"18.6",cy:"12.1",r:"3.1"}),I("circle",{fill:"#fff",cx:"18.6",cy:"12.1",r:"1.4"})]}),I("polygon",{points:"23.8,18.2 23.9,20.1 0.2,20.2 0.2,18.2 "}),Qe("g",{children:[I("circle",{cx:"10.2",cy:"19.1",r:"3.1"}),I("circle",{fill:"#fff",cx:"10.2",cy:"19.1",r:"1.4"})]})]}),Fpe=({toggleCollapse:e})=>I(gr,{icon:I(zpe,{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 tF={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},WR=tr.createContext&&tr.createContext(tF),au=globalThis&&globalThis.__assign||function(){return au=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{toggleVisibility:e,isVisible:t}=Za(),{mode:n}=Ss();return Qe("div",{className:"space-y-1 flex flex-col",children:[n===Ur.PENDING&&Qe(An,{children:[I(Ld,{className:"!ml-0",onChange:()=>e(gn.working),checked:t[gn.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"}),I(Ld,{className:"!ml-0",onChange:()=>e(gn.cancelled),checked:t[gn.cancelled],children:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438"})]}),I(Ld,{className:"!ml-0",onChange:()=>e(gn.pvz),checked:t[gn.pvz],children:"\u041F\u0412\u0417"}),I(Ld,{className:"!ml-0",onChange:()=>e(gn.other),checked:t[gn.other],children:"\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B \u043F\u0440\u043E\u0447\u0438\u0445 \u0441\u0435\u0442\u0435\u0439"})]})},Kpe=()=>I(Y0,{content:I(jpe,{}),trigger:"click",placement:"leftBottom",children:I(io,{title:"\u0421\u043B\u043E\u0438",children:I(gr,{className:"absolute bottom-[20px] right-[20px] flex items-center justify-center p-3",children:I(Upe,{className:"w-4 h-4"})})})}),Hpe=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:[I("polygon",{className:"ai-st0",points:"10.5,3.6 10.5,5.2 10.5,19.9 10.3,20.8 10,21.5 9.5,22.1 9.1,22.5 8.4,22.7 7.8,22.7 7.3,22.7 6.7,22.7 6.1,22.1 5.7,21.6 5.3,20.9 4.5,20.9 4,20.6 3.5,20.2 3.2,19.6 3,19.1 3,17.9 2.3,17.2 2,16.7 1,15 0.7,14.1 0.4,13.2 0.3,11.1 0.4,10.1 0.9,9.3 1.5,8.7 2,8.2 1.8,7.3 1.7,6.4 2,5.8 2.3,5.3 3.2,4.9 4.1,4.7 4.7,4.6 4.7,3.8 4.8,3 5.4,2.2 6.1,1.5 6.7,1.3 7.4,1.1 8,1.1 8.5,1.3 9.3,1.7 9.9,2.4 "}),I("polyline",{className:"ai-st0",points:"18.6,4.1 17.3,5.8 12.6,5.7 "}),I("polyline",{className:"ai-st0",points:"12.3,9.9 17.2,9.8 21,13.6 "}),I("line",{className:"ai-st0",x1:"12.3",y1:"14.5",x2:"14.5",y2:"14.5"}),I("polyline",{className:"ai-st0",points:"12.4,19 15.9,19 17.5,20.7 "}),Qe("g",{children:[I("ellipse",{className:"ai-st1",cx:"19.4",cy:"3",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"19.4",cy:"2.9",rx:"1.1",ry:"1.1"})]}),Qe("g",{children:[I("ellipse",{className:"ai-st1",cx:"22",cy:"14.6",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"22.1",cy:"14.6",rx:"1.1",ry:"1.1"})]}),Qe("g",{children:[I("ellipse",{className:"ai-st1",cx:"16.2",cy:"14.5",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"16.2",cy:"14.4",rx:"1.1",ry:"1.1"})]}),Qe("g",{children:[I("ellipse",{className:"ai-st1",cx:"18.7",cy:"21.7",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"18.7",cy:"21.7",rx:"1.1",ry:"1.1"})]}),I("polyline",{className:"ai-st0",points:"5,9.5 3.6,10.9 3.4,12.7 3.8,13.9 5.6,16.4 "})]});const Wpe=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,children:[I("polyline",{className:"approve-st0",points:"-273.8,391.3 -273.8,389.8 -274.1,389 -274.8,388.5 -275.9,388.5 -290.5,388.5 -291.2,388.7 -291.9,389.1 -292.3,389.8 -292.4,405.1 -292.3,405.9 -292,406.4 -291.4,406.7 -290.9,406.8 -276,406.8 -275.2,406.7 -274.4,406.4 -273.9,405.8 -273.8,404.3 "}),I("polygon",{className:"approve-st1",points:"-287.3,392.4 -286.4,393.5 -286.2,393.7 -285.8,393.7 -285,393.5 -284.1,392.4 -283.1,391.6 -282.6,391.6 -282,391.6 -281.6,392 -281.4,392.8 -281.6,393.2 -282.4,394.3 -285.6,397 -286,397 -286.4,397 -287.1,396.4 -289.2,394.3 -289.6,393.9 -289.6,393 -289.2,392.4 -288.7,392.2 -288.1,392 -287.7,392 "}),I("polygon",{className:"approve-st1",points:"-276.8,392.9 -275.9,392.4 -275.5,392.4 -275,393.5 -274.5,393.5 -273.9,393.5 -273.2,393.6 -272.9,392.7 -272.3,392.7 -271.8,392.9 -271.3,393.3 -271.1,393.5 -271.6,394.3 -271.3,394.7 -271.1,395 -270.8,395.6 -269.9,395.2 -269.6,395.6 -269.4,396.1 -269.3,396.4 -269.4,396.8 -269.4,397 -270.3,397.2 -270.2,397.9 -270.2,398.4 -270.3,398.7 -269.2,399.2 -269.4,399.6 -269.6,400.1 -270,400.6 -270.1,400.8 -270.9,400.3 -271,400.2 -271.4,400.5 -271.7,400.7 -272.1,401 -272.3,401.2 -272,402 -272.2,402.3 -273.3,402.7 -273.7,402.6 -273.9,401.8 -274,401.5 -274.8,401.6 -275.5,401.5 -275.6,402.5 -275.9,402.7 -276.4,402.6 -277.3,402.3 -277.3,401.9 -276.8,401 -277.5,400.7 -277.7,400.4 -278.1,400 -279,400.3 -279.3,399.8 -279.6,399 -279.5,398.5 -278.6,398.2 -278.5,397.3 -278.6,396.8 -279,396.5 -279.4,396.3 -279.6,396.2 -279.6,395.8 -279.3,395.1 -279.1,394.9 -278.7,394.9 -277.6,395.1 -277.4,394.6 -276.9,394.4 -276.8,394.2 -277.1,393.1 "}),I("circle",{className:"approve-st2",cx:"-274.4",cy:"397.5",r:"2.2"}),I("path",{className:"approve-st1",d:"M-282,400.2h-7.4c-0.3,0-0.5-0.2-0.5-0.5l0,0c0-0.3,0.2-0.5,0.5-0.5h7.4c0.3,0,0.5,0.2,0.5,0.5l0,0 C-281.5,400-281.7,400.2-282,400.2z"}),I("path",{className:"approve-st1",d:"M-282.1,402.6h-7.4c-0.3,0-0.5-0.2-0.5-0.5l0,0c0-0.3,0.2-0.5,0.5-0.5h7.4c0.3,0,0.5,0.2,0.5,0.5l0,0 C-281.6,402.4-281.8,402.6-282.1,402.6z"})]}),Gpe=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,children:[I("path",{className:"working-st0",d:"M-279.1,402.7"}),I("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 "}),I("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 "}),I("circle",{className:"working-st3",cx:"-277",cy:"397.6",r:"4.6"}),I("circle",{className:"working-st4",cx:"-277.1",cy:"397.5",r:"2.9"}),I("polygon",{className:"working-st3",points:"-270.9,405.7 -269,403.8 -273.5,399.6 -275.4,401 "})]}),qpe=()=>{const{mode:e,setMode:t}=Ss(),n=i=>{t(i)},r=i=>i===e?"primary":"default";return Qe(An,{children:[I(io,{title:"\u041E\u0442\u0431\u043E\u0440 \u043B\u043E\u043A\u0430\u0446\u0438\u0439 \u0434\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B",children:I(gr,{icon:I(Hpe,{}),type:r(Ur.PENDING),onClick:()=>n(Ur.PENDING),className:"flex items-center justify-center",size:"large"})}),I(io,{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:I(gr,{icon:I(Wpe,{}),type:r(Ur.ON_APPROVAL),onClick:()=>n(Ur.ON_APPROVAL),className:"flex items-center justify-center",size:"large"})}),I(io,{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:I(gr,{icon:I(Gpe,{}),type:r(Ur.WORKING),onClick:()=>n(Ur.WORKING),className:"flex items-center justify-center",size:"large"})})]})},Zpe=()=>Qe("div",{className:"absolute top-[20px] left-[19px] flex items-center z-10",children:[Qe("div",{className:Pc("flex items-center gap-x-20"),children:[I(Q6,{}),I("div",{className:"flex items-center gap-x-3",children:I(qpe,{})})]}),I("div",{className:"ml-[71px]",children:I(BE,{})})]}),Xpe="/assets/logo.7b298635.svg",Ype=[{name:"logo",url:Xpe}],Qpe=()=>{const e=C.exports.useRef(null),t=C.exports.useRef(null),n=C.exports.useRef(null),{popup:r,setPopup:i}=$c(),{setClickedPointConfig:s}=vl(),{setLayersVisibility:c}=Za(),{mode:o}=Ss(),{tableState:f,openTable:p}=Dm();C.exports.useEffect(()=>{c(Nce[o]),i(null),s(null)},[o]);const v=N=>{if(!N.features){i(null),s(null);return}const R=N.features[0];if(!R){i(null),s(null);return}const{lng:M}=N.lngLat;if(R.geometry.type==="Point"){const O=R.geometry.coordinates.slice();for(;Math.abs(M-O[0])>180;)O[0]+=M>O[0]?360:-360;i({features:N.features,coordinates:O})}},y=N=>{!N.features[0]||(e.current.getCanvas().style.cursor="pointer")},w=N=>{!N.features[0]||(e.current.getCanvas().style.cursor="")};C.exports.useEffect(()=>{const N=new ResizeObserver(ope(()=>{var R;(R=e==null?void 0:e.current)==null||R.resize()},16));return t.current&&N.observe(t.current),()=>{N.disconnect()}},[t.current]),C.exports.useEffect(()=>{f.fullScreen&&!f.isOpened&&p()},[f.fullScreen]);const[P,k]=C.exports.useState(!1),A=()=>k(N=>!N);return I(Rde,{children:Qe("div",{className:"w-screen h-screen relative flex overflow-hidden",children:[I(Zpe,{}),I(ehe,{isCollapsed:P,ref:n}),Qe("div",{className:"flex-1 h-screen flex flex-col ",children:[I("div",{ref:t,className:Pc(f.fullScreen?"":"flex-1"),children:Qe(NE,{mapLib:Pde,initialViewState:{latitude:55.7558,longitude:37.6173,zoom:12},dragRotate:!1,ref:e,interactiveLayerIds:[gn["initial-match"],gn["initial-unmatch"],gn.approve,gn.working,gn.filteredWorking,gn.cancelled,gn.pvz,gn.other],onClick:v,onMouseEnter:y,onMouseLeave:w,onLoad:()=>{Ype.map(N=>{var M,O;const R=new Image(((M=N.size)==null?void 0:M.width)||24,((O=N.size)==null?void 0:O.height)||24);R.onload=()=>e.current.addImage(N.name,R,{sdf:!0}),R.src=N.url})},id:"map",children:[r&&I(Fhe,{lat:r.coordinates[1],lng:r.coordinates[0],features:r.features,onClose:()=>{i(null),s(null)}}),I(Fpe,{toggleCollapse:A}),I(Bhe,{}),I(Che,{}),I(lpe,{}),I(Vhe,{}),I(Kpe,{})]})}),I("div",{className:"w-full border-solid border-border border-0 border-t-[1px] z-20",children:I(Lpe,{fullWidth:P})})]})]})})};function Jpe(){return I(Ede,{children:I(Qpe,{})})}const eme=new pce;Qce();function tme(){return I(yce,{client:eme,children:I(hV,{basename:"/",children:Qe(dV,{children:[I($g,{path:"/",element:I(Jpe,{})}),I($g,{path:"/signin",element:I(wde,{})}),I($g,{path:"/verify-user",element:I(Sde,{})})]})})})}mb.createRoot(document.getElementById("root")).render(I(tr.StrictMode,{children:I(tme,{})}));